def __call__(self, obj, do_raise=False):

        # Walk the selector list
        for elem in self.chain:
            # If it's callable, call it
            if callable(elem):
                obj = elem(obj)
            else:
                if obj == '':
                    return ''
                # Use indexing
                try:
                    obj = obj[elem]
                except (KeyError, IndexError):
                    # No sense going any further
                    if do_raise:
                        # Convert to a KeyError, for consistency
                        raise KeyError(elem)
                    return None

        # Return the finally-selected object
        return obj
Testing WKB input/output.
dataset/ETHPy150Open openstack/rack/rack/api/xmlutil.py/Selector.__call__--crossover with--dataset/ETHPy150Open CollabQ/CollabQ/vendor/django/contrib/gis/tests/test_gdal_geom.py/OGRGeomTest.test01d_wkb