original_docstring: 
      Create an expression for a single comp-filter element.
  
      @param compfilter: the L{ComponentFilter} element.
      @return: a L{baseExpression} for the expression tree.
      
docstring: Create an expression for a single comp-filter element.
docstring_tokens: Create an expression for a single comp - filter element .
code: def compfilterExpression(compfilter, fields):
      """
      Create an expression for a single comp-filter element.
  
      @param compfilter: the L{ComponentFilter} element.
      @return: a L{baseExpression} for the expression tree.
      """
  
      # Handle is-not-defined case
      if not compfilter.defined:
          # Test for TYPE != <<component-type name>>
          return expression.isnotExpression(fields["TYPE"], compfilter.filter_name, True)
  
      # Determine logical expression grouping
      logical = expression.andExpression if compfilter.filter_test == "allof" else expression.orExpression
  
      expressions = []
      if isinstance(compfilter.filter_name, str) or isinstance(compfilter.filter_name, unicode):
          expressions.append(expression.isExpression(fields["TYPE"], compfilter.filter_name, True))
      else:
          expressions.append(expression.inExpression(fields["TYPE"], compfilter.filter_name, True))
  
      # Handle time-range
      if compfilter.qualifier and isinstance(compfilter.qualifier, TimeRange):
          start, end, startfloat, endfloat = getTimerangeArguments(compfilter.qualifier)
          expressions.append(expression.timerangeExpression(start, end, startfloat, endfloat))
  
      # Handle properties - we can only do UID right now
      props = []
      for p in [x for x in compfilter.filters if isinstance(x, PropertyFilter)]:
          props.append(propfilterExpression(p, fields))
      if len(props) > 1:
          propsExpression = logical(props)
      elif len(props) == 1:
          propsExpression = props[0]
      else:
          propsExpression = None
  
      # Handle embedded components - we do not right now as our Index does not handle them
      comps = []
      for _ignore in [x for x in compfilter.filters if isinstance(x, ComponentFilter)]:
          raise ValueError
      if len(comps) > 1:
          compsExpression = logical(comps)
      elif len(comps) == 1:
          compsExpression = comps[0]
      else:
          compsExpression = None
  
      # Now build compound expression
      if ((propsExpression is not None) and (compsExpression is not None)):
          expressions.append(logical([propsExpression, compsExpression]))
      elif propsExpression is not None:
          expressions.append(propsExpression)
      elif compsExpression is not None:
          expressions.append(compsExpression)
  
      # Now build return expression
      return expression.andExpression(expressions)
code_tokens: def compfilterExpression ( compfilter , fields ) : if not compfilter . defined : return expression . isnotExpression ( fields [ "TYPE" ] , compfilter . filter_name , True ) logical = expression . andExpression if compfilter . filter_test == "allof" else expression . orExpression expressions = [ ] if isinstance ( compfilter . filter_name , str ) or isinstance ( compfilter . filter_name , unicode ) : expressions . append ( expression . isExpression ( fields [ "TYPE" ] , compfilter . filter_name , True ) ) else : expressions . append ( expression . inExpression ( fields [ "TYPE" ] , compfilter . filter_name , True ) ) if compfilter . qualifier and isinstance ( compfilter . qualifier , TimeRange ) : start , end , startfloat , endfloat = getTimerangeArguments ( compfilter . qualifier ) expressions . append ( expression . timerangeExpression ( start , end , startfloat , endfloat ) ) props = [ ] for p in [ x for x in compfilter . filters if isinstance ( x , PropertyFilter ) ] : props . append ( propfilterExpression ( p , fields ) ) if len ( props ) > 1 : propsExpression = logical ( props ) elif len ( props ) == 1 : propsExpression = props [ 0 ] else : propsExpression = None comps = [ ] for _ignore in [ x for x in compfilter . filters if isinstance ( x , ComponentFilter ) ] : raise ValueError if len ( comps ) > 1 : compsExpression = logical ( comps ) elif len ( comps ) == 1 : compsExpression = comps [ 0 ] else : compsExpression = None if ( ( propsExpression is not None ) and ( compsExpression is not None ) ) : expressions . append ( logical ( [ propsExpression , compsExpression ] ) ) elif propsExpression is not None : expressions . append ( propsExpression ) elif compsExpression is not None : expressions . append ( compsExpression ) return expression . andExpression ( expressions )
short_docstring: Create an expression for a single comp-filter element.
short_docstring_tokens: Create an expression for a single comp - filter element .
comment: """
      Create an expression for a single comp-filter element.
  
      @param compfilter: the L{ComponentFilter} element.
      @return: a L{baseExpression} for the expression tree.
      """$SEP$# Handle is-not-defined case$SEP$# Test for TYPE != <<component-type name>>$SEP$# Determine logical expression grouping$SEP$# Handle time-range$SEP$# Handle properties - we can only do UID right now$SEP$# Handle embedded components - we do not right now as our Index does not handle them$SEP$# Now build compound expression$SEP$# Now build return expression