def _add_cdpaths(paths, prefix):
 env = builtins.__xonsh_env__
 csc = env.get('CASE_SENSITIVE_COMPLETIONS')
 glob_sorted = env.get('GLOB_SORTED')
 for cdp in env.get('CDPATH'):
  test_glob = (os.path.join(cdp, prefix) + '*')
  for s in xt.iglobpath(test_glob, ignore_case=(not csc), sort_result=glob_sorted):
   if os.path.isdir(s):
    paths.add(os.path.basename(s))

def _add_cdpaths ( paths , prefix ) : env = builtins . __xonsh_env__ csc = env . get ( 'CASE_SENSITIVE_COMPLETIONS' ) glob_sorted = env . get ( 'GLOB_SORTED' ) for cdp in env . get ( 'CDPATH' ) : test_glob = ( os . path . join ( cdp , prefix ) + '*' ) for s in xt . iglobpath ( test_glob , ignore_case = ( not csc ) , sort_result = glob_sorted ) : if os . path . isdir ( s ) : paths . add ( os . path . basename ( s ) )
completes current prefix using cdpath .