def _normpath(p):
 initial_dotslash = p.startswith((os.curdir + os.sep))
 initial_dotslash |= (xp.ON_WINDOWS and p.startswith((os.curdir + os.altsep)))
 p = p.rstrip()
 trailing_slash = p.endswith(os.sep)
 trailing_slash |= (xp.ON_WINDOWS and p.endswith(os.altsep))
 p = os.path.normpath(p)
 if (initial_dotslash and (p != '.')):
  p = os.path.join(os.curdir, p)
 if trailing_slash:
  p = os.path.join(p, '')
 if (xp.ON_WINDOWS and builtins.__xonsh_env__.get('FORCE_POSIX_PATHS')):
  p = p.replace(os.sep, os.altsep)
 return p

def _normpath ( p ) : initial_dotslash = p . startswith ( ( os . curdir + os . sep ) ) initial_dotslash |= ( xp . ON_WINDOWS and p . startswith ( ( os . curdir + os . altsep ) ) ) p = p . rstrip ( ) trailing_slash = p . endswith ( os . sep ) trailing_slash |= ( xp . ON_WINDOWS and p . endswith ( os . altsep ) ) p = os . path . normpath ( p ) if ( initial_dotslash and ( p != '.' ) ) : p = os . path . join ( os . curdir , p ) if trailing_slash : p = os . path . join ( p , '' ) if ( xp . ON_WINDOWS and builtins . __xonsh_env__ . get ( 'FORCE_POSIX_PATHS' ) ) : p = p . replace ( os . sep , os . altsep ) return p
wraps os .