code: def filter_oauth_params(params):
      
      is_oauth = lambda kv: kv[0].startswith("oauth_")
      if isinstance(params, dict):
          return list(filter(is_oauth, list(params.items())))
      else:
          return list(filter(is_oauth, params))
docs: Removes all non oauth parameters from a dict or a list of params.