code: def prune_creds_json(creds: dict, cred_ids: set) -> str:
      
  
      rv = deepcopy(creds)
      for key in ('attrs', 'predicates'):
          for attr_uuid, creds_by_uuid in rv[key].items():
              rv[key][attr_uuid] = [cred for cred in creds_by_uuid if cred['cred_info']['referent'] in cred_ids]
  
          empties = [attr_uuid for attr_uuid in rv[key] if not rv[key][attr_uuid]]
          for attr_uuid in empties:
              del rv[key][attr_uuid]
  
      return json.dumps(rv)
docs: Strip all creds out of the input json structure that do not match any of the input credential identifiers.
  
      :param creds: indy-sdk creds structure
      :param cred_ids: the set of credential identifiers of interest
      :return: the reduced creds json