def searchFileForAll(hostsFile, name):
 results = []
 try:
  lines = hostsFile.getContent().splitlines()
 except:
  return results
 name = name.lower()
 for line in lines:
  idx = line.find('#')
  if (idx != (-1)):
   line = line[:idx]
  if (not line):
   continue
  parts = line.split()
  if (name.lower() in [s.lower() for s in parts[1:]]):
   results.append(nativeString(parts[0]))
 return results

def searchFileForAll ( hostsFile , name ) : results = [ ] try : lines = hostsFile . getContent ( ) . splitlines ( ) except : return results name = name . lower ( ) for line in lines : idx = line . find ( '#' ) if ( idx != ( - 1 ) ) : line = line [ : idx ] if ( not line ) : continue parts = line . split ( ) if ( name . lower ( ) in [ s . lower ( ) for s in parts [ 1 : ] ] ) : results . append ( nativeString ( parts [ 0 ] ) ) return results
search the given file .