def _find_tcl_tk(hook_api):
 bins = selectImports(hook_api.__file__)
 if is_darwin:
  if (not bins):
   bins = getImports(hook_api.__file__)
   mapping = {}
   for l in bins:
    mapping[os.path.basename(l)] = l
   bins = [('Tcl', mapping['Tcl']), ('Tk', mapping['Tk'])]
  path_to_tcl = bins[0][1]
  if ('Library/Frameworks' in path_to_tcl):
   tcl_tk = _find_tcl_tk_darwin_frameworks(bins)
  else:
   tcl_tk = _find_tcl_tk_dir()
 else:
  tcl_tk = _find_tcl_tk_dir()
 return tcl_tk

def _find_tcl_tk ( hook_api ) : bins = selectImports ( hook_api . __file__ ) if is_darwin : if ( not bins ) : bins = getImports ( hook_api . __file__ ) mapping = { } for l in bins : mapping [ os . path . basename ( l ) ] = l bins = [ ( 'Tcl' , mapping [ 'Tcl' ] ) , ( 'Tk' , mapping [ 'Tk' ] ) ] path_to_tcl = bins [ 0 ] [ 1 ] if ( 'Library/Frameworks' in path_to_tcl ) : tcl_tk = _find_tcl_tk_darwin_frameworks ( bins ) else : tcl_tk = _find_tcl_tk_dir ( ) else : tcl_tk = _find_tcl_tk_dir ( ) return tcl_tk
get a platform-specific 2-tuple of the absolute paths of the top-level external data directories for both tcl and tk .