def syspath(path, prefix=True):
 if (os.path.__name__ != 'ntpath'):
  return path
 if (not isinstance(path, six.text_type)):
  try:
   path = path.decode('utf-8')
  except UnicodeError:
   encoding = (sys.getfilesystemencoding() or sys.getdefaultencoding())
   path = path.decode(encoding, 'replace')
 if (prefix and (not path.startswith(WINDOWS_MAGIC_PREFIX))):
  if path.startswith(u'\\\\'):
   path = (u'UNC' + path[1:])
  path = (WINDOWS_MAGIC_PREFIX + path)
 return path

def syspath ( path , prefix = True ) : if ( os . path . __name__ != 'ntpath' ) : return path if ( not isinstance ( path , six . text_type ) ) : try : path = path . decode ( 'utf-8' ) except UnicodeError : encoding = ( sys . getfilesystemencoding ( ) or sys . getdefaultencoding ( ) ) path = path . decode ( encoding , 'replace' ) if ( prefix and ( not path . startswith ( WINDOWS_MAGIC_PREFIX ) ) ) : if path . startswith ( u'\\\\' ) : path = ( u'UNC' + path [ 1 : ] ) path = ( WINDOWS_MAGIC_PREFIX + path ) return path
convert a path for use by the operating system .