code: def standardize_strings(arg, strtype=settings.MODERNRPC_PY2_STR_TYPE, encoding=settings.MODERNRPC_PY2_STR_ENCODING):
      
      assert six.PY2, "This function should be used with Python 2 only"
  
      if not strtype:
          return arg
  
      if strtype == six.binary_type or strtype == 'str':
          # We want to convert from unicode to str
          return _generic_convert_string(arg, six.text_type, six.binary_type, encoding)
  
      elif strtype == six.text_type or strtype == 'unicode':
          # We want to convert from str to unicode
          return _generic_convert_string(arg, six.binary_type, six.text_type, encoding)
  
      raise TypeError('standardize_strings() called with an invalid strtype: "{}". Allowed values: str or unicode'
                      .format(repr(strtype)))
docs: Python 2 only. Lookup given *arg* and convert its str or unicode value according to MODERNRPC_PY2_STR_TYPE and
      MODERNRPC_PY2_STR_ENCODING settings.