def skip_regex(lines_enum, options):
 skip_regex = (options.skip_requirements_regex if options else None)
 if skip_regex:
  pattern = re.compile(skip_regex)
  lines_enum = filterfalse((lambda e: pattern.search(e[1])), lines_enum)
 return lines_enum

def skip_regex ( lines_enum , options ) : skip_regex = ( options . skip_requirements_regex if options else None ) if skip_regex : pattern = re . compile ( skip_regex ) lines_enum = filterfalse ( ( lambda e : pattern . search ( e [ 1 ] ) ) , lines_enum ) return lines_enum
skip lines that match --skip-requirements-regex pattern note: the regex pattern is only built once .