parameters: (values)
return_statement: return cleaned
docstring: For a list of values, stringify the `date` and `datetime` values
      using strftime.
docstring_summary: For a list of values, stringify the `date` and `datetime` values
      using strftime.
docstring_tokens: For a list of values stringify the date and datetime values using strftime .
function: def _serialize_datetime(values):
      """For a list of values, stringify the `date` and `datetime` values
      using strftime."""
      cleaned = []
  
      for v in values:
          if type(v) is datetime:
              # isinstance(datetime, date) will always return True, so
              # do a type comparison instead.
              cleaned.append(v.strftime("%Y-%m-%d %H:%M:%S"))
          elif type(v) is date:
              cleaned.append(v.strftime("%Y-%m-%d"))
          else:
              cleaned.append(v)
  
      return cleaned
function_tokens: def _serialize_datetime ( values ) : cleaned = [ ] for v in values : if type ( v ) is datetime : # isinstance(datetime, date) will always return True, so # do a type comparison instead. cleaned . append ( v . strftime ( "%Y-%m-%d %H:%M:%S" ) ) elif type ( v ) is date : cleaned . append ( v . strftime ( "%Y-%m-%d" ) ) else : cleaned . append ( v ) return cleaned