code: def clean_obj(obj, remove):
      
      if isinstance(remove, string_types):
          remove = [remove]
      try:
          iter(remove)
      except TypeError:
          raise ClientException("`remove` could not be removed from object: {}".format(repr(remove)))
      else:
          if isinstance(obj, dict):
              obj = {
                  key: clean_obj(value, remove)
                  for key, value in iteritems(obj)
                  if key not in remove
              }
          elif isinstance(obj, list):
              obj = [
                  clean_obj(item, remove)
                  for item in obj
                  if item not in remove
              ]
          return obj
docs: Recursively remove keys from list/dict/dict-of-lists/list-of-keys/nested ...,
       e.g. remove all sharing keys or remove all 'user' fields
      This should result in the same as if running in bash: `jq del(.. | .publicAccess?, .userGroupAccesses?)`
      :param obj: the dict to remove keys from
      :param remove: keys to remove - can be a string or iterable