def _find_directive(directives, directive_name):
 if ((not directives) or isinstance(directives, str) or (len(directives) == 0)):
  return None
 if (directives[0] == directive_name):
  return directives
 matches = (_find_directive(line, directive_name) for line in directives)
 return next((m for m in matches if (m is not None)), None)

def _find_directive ( directives , directive_name ) : if ( ( not directives ) or isinstance ( directives , str ) or ( len ( directives ) == 0 ) ) : return None if ( directives [ 0 ] == directive_name ) : return directives matches = ( _find_directive ( line , directive_name ) for line in directives ) return next ( ( m for m in matches if ( m is not None ) ) , None )
find a directive of type directive_name in directives .