parameters: (path)
return_statement: return path
docstring: Given a 'Path', find all EDFilters and wrap them in 'cms.ignore'
docstring_summary: Given a 'Path', find all EDFilters and wrap them in 'cms.ignore'
docstring_tokens: Given a Path find all EDFilters and wrap them in cms . ignore
function: def ignoreAllFiltersOnPath(path):
    """Given a 'Path', find all EDFilters and wrap them in 'cms.ignore'
    """
    import FWCore.ParameterSet.Config as cms
    from FWCore.ParameterSet.SequenceTypes import _MutatingSequenceVisitor, _UnarySequenceOperator
  
    class IgnoreFilters(object):
      def __init__(self):
        self.__lastCallUnary = False
        self.onTask = False
      def __call__(self, obj):
        if self.onTask:
          return obj
        elif isinstance(obj,_UnarySequenceOperator):
          self.__lastCallUnary = True
        elif obj.isLeaf() and isinstance(obj, cms.EDFilter) and not self.__lastCallUnary:
          return cms.ignore(obj)
        else:
          self.__lastCallUnary = False
        return obj
    class IgnoreFiltersVisitor(_MutatingSequenceVisitor):
      def __init__(self):
        self.operator = IgnoreFilters()
        self._levelInTasks = 0
        super(type(self),self).__init__(self.operator)
      def enter(self,visitee):
        if isinstance(visitee, cms.Task):
          self._levelInTasks += 1
        self.operator.onTask = (self._levelInTasks > 0)
        super(IgnoreFiltersVisitor,self).enter(visitee)
      def leave(self,visitee):
        if self._levelInTasks > 0:
          if isinstance(visitee, cms.Task):
            self._levelInTasks -= 1
        super(IgnoreFiltersVisitor,self).leave(visitee)
  
    mutator = IgnoreFiltersVisitor()
    path.visit(mutator)
    if mutator._didApply():
      path._seq = mutator.result(path)[0]
      path._tasks.clear()
      path.associate(*mutator.result(path)[1])
    return path
function_tokens: def ignoreAllFiltersOnPath ( path ) : import FWCore . ParameterSet . Config as cms from FWCore . ParameterSet . SequenceTypes import _MutatingSequenceVisitor , _UnarySequenceOperator class IgnoreFilters ( object ) : def __init__ ( self ) : self . __lastCallUnary = False self . onTask = False def __call__ ( self , obj ) : if self . onTask : return obj elif isinstance ( obj , _UnarySequenceOperator ) : self . __lastCallUnary = True elif obj . isLeaf ( ) and isinstance ( obj , cms . EDFilter ) and not self . __lastCallUnary : return cms . ignore ( obj ) else : self . __lastCallUnary = False return obj class IgnoreFiltersVisitor ( _MutatingSequenceVisitor ) : def __init__ ( self ) : self . operator = IgnoreFilters ( ) self . _levelInTasks = 0 super ( type ( self ) , self ) . __init__ ( self . operator ) def enter ( self , visitee ) : if isinstance ( visitee , cms . Task ) : self . _levelInTasks += 1 self . operator . onTask = ( self . _levelInTasks > 0 ) super ( IgnoreFiltersVisitor , self ) . enter ( visitee ) def leave ( self , visitee ) : if self . _levelInTasks > 0 : if isinstance ( visitee , cms . Task ) : self . _levelInTasks -= 1 super ( IgnoreFiltersVisitor , self ) . leave ( visitee ) mutator = IgnoreFiltersVisitor ( ) path . visit ( mutator ) if mutator . _didApply ( ) : path . _seq = mutator . result ( path ) [ 0 ] path . _tasks . clear ( ) path . associate ( * mutator . result ( path ) [ 1 ] ) return path