code: def clean_params(params, drop_nones=True, recursive=True):
      
      cleaned = {}
      for key, value in six.iteritems(params):
          if drop_nones and value is None:
              continue
          if recursive and isinstance(value, dict):
              value = clean_params(value, drop_nones, recursive)
          cleaned[key] = value
      return cleaned
docs: Clean up a dict of API parameters to be sent to the Coinbase API.
  
      Some endpoints require boolean options to be represented as integers. By
      default, will remove all keys whose value is None, so that they will not be
      sent to the API endpoint at all.