def _find_key(prefix, pip_list):
 try:
  match = next(iter((x for x in pip_list if (x.lower() == prefix.lower()))))
 except StopIteration:
  return None
 else:
  return match

def _find_key ( prefix , pip_list ) : try : match = next ( iter ( ( x for x in pip_list if ( x . lower ( ) == prefix . lower ( ) ) ) ) ) except StopIteration : return None else : return match
does a case-insensitive match in the pip_list for the desired package .