parameters: (self, elem)
docstring: Convert to a filter function.
docstring_summary: Convert to a filter function.
docstring_tokens: Convert to a filter function .
function: def _finalize_positive_filter(self, elem):
      """Convert to a filter function."""
      if select.can_be_regex(elem):
        regex_ = select.make_regex(elem)
        return lambda op, regex=regex_: regex.search(op.name) is not None
      elif isinstance(elem, tf_ops.Operation):
        return lambda op, match_op=elem: op is match_op
      elif callable(elem):
        return elem
      elif elem is True:
        return lambda op: True
      else:
        raise ValueError("Cannot finalize the positive filter: {}".format(elem))
function_tokens: def _finalize_positive_filter ( self , elem ) : if select . can_be_regex ( elem ) : regex_ = select . make_regex ( elem ) return lambda op , regex = regex_ : regex . search ( op . name ) is not None elif isinstance ( elem , tf_ops . Operation ) : return lambda op , match_op = elem : op is match_op elif callable ( elem ) : return elem elif elem is True : return lambda op : True else : raise ValueError ( "Cannot finalize the positive filter: {}" . format ( elem ) )