code: def extract_params(raw):
      
      if isinstance(raw, (bytes, unicode_type)):
          try:
              params = urldecode(raw)
          except ValueError:
              params = None
      elif hasattr(raw, '__iter__'):
          try:
              dict(raw)
          except ValueError:
              params = None
          except TypeError:
              params = None
          else:
              params = list(raw.items() if isinstance(raw, dict) else raw)
              params = decode_params_utf8(params)
      else:
          params = None
  
      return params
docs: Extract parameters and return them as a list of 2-tuples.
  
      Will successfully extract parameters from urlencoded query strings,
      dicts, or lists of 2-tuples. Empty strings/dicts/lists will return an
      empty list of parameters. Any other input will result in a return
      value of None.