def root_is_purelib(name, wheeldir):
 name_folded = name.replace('-', '_')
 for item in os.listdir(wheeldir):
  match = dist_info_re.match(item)
  if (match and (match.group('name') == name_folded)):
   with open(os.path.join(wheeldir, item, 'WHEEL')) as wheel:
    for line in wheel:
     line = line.lower().rstrip()
     if (line == 'root-is-purelib: true'):
      return True
 return False

def root_is_purelib ( name , wheeldir ) : name_folded = name . replace ( '-' , '_' ) for item in os . listdir ( wheeldir ) : match = dist_info_re . match ( item ) if ( match and ( match . group ( 'name' ) == name_folded ) ) : with open ( os . path . join ( wheeldir , item , 'WHEEL' ) ) as wheel : for line in wheel : line = line . lower ( ) . rstrip ( ) if ( line == 'root-is-purelib: true' ) : return True return False
return true if the extracted wheel in wheeldir should go into purelib .