def ls(pattern=None, _type=None, selected=None, visible=None, includeNamespace=True):
    '''
    Similar to Maya's ls command - returns list of objects that match the given parameters
    @param pattern: name of an object with with optional wild cards '*'
    @param _type: object to compare if the component is of that type (either string or python class/type)
    @param selected: True/False if the object is selected or not. Default is either
    @param visible: True/False if the object is visible. Default is either 
    @param includeNamespace: does the search use the complete name (with namespace)  Default True
    '''
    # set up the name testing based on the pattern
    if pattern:
        # create a name return function
        if includeNamespace:
            getName = lambda x: getattr(x, 'LongName', x.Name)
        else:
            getName = lambda x: x.Name
        
        # if there is a wild card in the pattern
        if pattern in '*':
            pattern = pattern.replace('*', '.*')
            # name testing function
            passesNameTest = lambda x: re.match(pattern, getName(x))
        else:
            passesNameTest = lambda x: pattern == getName(x)       
    else:
        passesNameTest = lambda x: True

    # for getting selection test
    if selected is not None:
        passesSelectionTest = lambda x: x.Selected == selected
    else:
        passesSelectionTest = lambda x: True
    
    # for getting visibility test
    if visible is not None:
        passesVisibilityTest = lambda x: visible == bool(getattr(x, 'Visibility', False))
    else:
        passesVisibilityTest = lambda x: True
    
    # for testing the type of component
    if _type:
        # if they gave a string, evaluate it
        if isinstance(_type, basestring):
            try:
                _type = eval(_type)
            except NameError:
                raise NameError("Can not find object type '%s' in current namespace" % _type)

        passesTypeTest = lambda x: isinstance(x, _type)
    # no type was given so its True by default
    else:
        passesTypeTest = lambda x: True
               
    matchList = []
    for cmpnt in kAllSceneComponents:
        # if we did not pass the selection test, continue on
        if not passesSelectionTest(cmpnt):
            continue
        # check if the object is visible
        if not passesVisibilityTest(cmpnt):
            continue
        # do the same for matching type
        if not passesTypeTest(cmpnt):
            continue
        
        if passesNameTest(cmpnt):
            # try converting it to a pymobu object
            try:
                pmbCmpnt = cmpnt.ConvertToPyMoBu()
            except:
                pmbCmpnt = cmpnt
                
            matchList.append(pmbCmpnt)
                   
    return matchList
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/moBu/site-packages/PyMoBu-0.2/pymobu/core.py/ls/swapped operands of `in`