      Given a string file name, returns a GEOSGeometry. The file may contain WKB,
      WKT, or HEX.
      """
      # If given a file name, get a real handle.
      if isinstance(file_h, six.string_types):
          with open(file_h, 'rb') as file_h:
              buf = file_h.read()
      else:
          buf = file_h.read()
  
 
</s> remove         if isinstance(ds_input, six.string_types):
 </s> add         if isinstance(ds_input, str): </s> remove         if isinstance(ds_input, six.string_types) and json_regex.match(ds_input):
 </s> add         if isinstance(ds_input, str) and json_regex.match(ds_input): </s> remove         if isinstance(stream_or_string, six.string_types):
 </s> add         if isinstance(stream_or_string, str): </s> remove         if isinstance(file, six.string_types) or file is None:
 </s> add         if isinstance(file, str) or file is None: </s> remove         return six.text_type(value)
 </s> add         return str(value)
    if isinstance(file_h, str):
      Given a string file name, returns a GEOSGeometry. The file may contain WKB,
      WKT, or HEX.
      """
      # If given a file name, get a real handle.
    if isinstance(file_h, str):
          with open(file_h, 'rb') as file_h:
              buf = file_h.read()
      else:
          buf = file_h.read()
  
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/contrib/gis/geos/factory.py