dpath/util.py
def search(obj, glob, yielded=False, separator="/", afilter=None, dirs = True):
    """
    Given a path glob, return a dictionary containing all keys
    that matched the given glob.

    If 'yielded' is true, then a dictionary will not be returned.
    Instead tuples will be yielded in the form of (path, value) for
    every element in the document that matched the glob.
    """

    def _search_view(obj, glob, separator, afilter, dirs):
        view = {}
        for path in _inner_search(obj, glob.lstrip(separator).split(separator), separator, dirs=dirs):
            try:
                val = dpath.path.get(obj, path, afilter=afilter, view=True)
                merge(view, val)
            except dpath.exceptions.FilteredValue:
                pass
        return view

    def _search_yielded(obj, glob, separator, afilter, dirs):
        for path in _inner_search(obj, glob.lstrip(separator).split(separator), separator, dirs=dirs):
            try:
                val = dpath.path.get(obj, path, view=False, afilter=afilter)
                yield (separator.join(map(str, dpath.path.paths_only(path))), val)
            except dpath.exceptions.FilteredValue:
                pass

    if afilter is not None:
        dirs = False
    if yielded:
        return _search_yielded(obj, glob, separator, afilter, dirs)
    return _search_view(obj, glob, separator, afilter, dirs)

    Given a path glob, return a dictionary containing all keys
    that matched the given glob.

    If 'yielded' is true, then a dictionary will not be returned.
    Instead tuples will be yielded in the form of (path, value) for
    every element in the document that matched the glob.
    
Given a path glob, return a dictionary containing all keys
that matched the given glob.

If 'yielded' is true, then a dictionary will not be returned.
Instead tuples will be yielded in the form of (path, value) for
every element in the document that matched the glob.
Given a path glob return a dictionary containing all keys that matched the given glob . If ' yielded ' is true then a dictionary will not be returned . Instead tuples will be yielded in the form of ( path value ) for every element in the document that matched the glob .
def search(obj, glob, yielded=False, separator="/", afilter=None, dirs = True):
    def _search_view(obj, glob, separator, afilter, dirs):
        view = {}
        for path in _inner_search(obj, glob.lstrip(separator).split(separator), separator, dirs=dirs):
            try:
                val = dpath.path.get(obj, path, afilter=afilter, view=True)
                merge(view, val)
            except dpath.exceptions.FilteredValue:
                pass
        return view
    def _search_yielded(obj, glob, separator, afilter, dirs):
        for path in _inner_search(obj, glob.lstrip(separator).split(separator), separator, dirs=dirs):
            try:
                val = dpath.path.get(obj, path, view=False, afilter=afilter)
                yield (separator.join(map(str, dpath.path.paths_only(path))), val)
            except dpath.exceptions.FilteredValue:
                pass
    if afilter is not None:
        dirs = False
    if yielded:
        return _search_yielded(obj, glob, separator, afilter, dirs)
    return _search_view(obj, glob, separator, afilter, dirs)
def search ( obj , glob , yielded = False , separator = "/" , afilter = None , dirs = True ) : def _search_view ( obj , glob , separator , afilter , dirs ) : view = { } for path in _inner_search ( obj , glob . lstrip ( separator ) . split ( separator ) , separator , dirs = dirs ) : try : val = dpath . path . get ( obj , path , afilter = afilter , view = True ) merge ( view , val ) except dpath . exceptions . FilteredValue : pass return view def _search_yielded ( obj , glob , separator , afilter , dirs ) : for path in _inner_search ( obj , glob . lstrip ( separator ) . split ( separator ) , separator , dirs = dirs ) : try : val = dpath . path . get ( obj , path , view = False , afilter = afilter ) yield ( separator . join ( map ( str , dpath . path . paths_only ( path ) ) ) , val ) except dpath . exceptions . FilteredValue : pass if afilter is not None : dirs = False if yielded : return _search_yielded ( obj , glob , separator , afilter , dirs ) return _search_view ( obj , glob , separator , afilter , dirs )
Given a path glob, return a dictionary containing all keys
that matched the given glob.
Given a path glob return a dictionary containing all keys that matched the given glob .
"""
    Given a path glob, return a dictionary containing all keys
    that matched the given glob.

    If 'yielded' is true, then a dictionary will not be returned.
    Instead tuples will be yielded in the form of (path, value) for
    every element in the document that matched the glob.
    """
obj
glob
yielded
separator
afilter
dirs