def get_converter(self, x):
        'get the converter interface instance for x, or None'

        if not len(self):
            return None  # nothing registered
        #DISABLED idx = id(x)
        #DISABLED cached = self._cached.get(idx)
        #DISABLED if cached is not None: return cached

        converter = None
        classx = getattr(x, '__class__', None)

        if classx is not None:
            converter = self.get(classx)

        if isinstance(x, np.ndarray) and x.size:
            xravel = x.ravel()
            try:
                # pass the first value of x that is not masked back to
                # get_converter
                if not np.all(xravel.mask):
                    # some elements are not masked
                    converter = self.get_converter(
                        xravel[np.argmin(xravel.mask)])
                    return converter
            except __HOLE__:
                # not a masked_array
                # Make sure we don't recurse forever -- it's possible for
                # ndarray subclasses to continue to return subclasses and
                # not ever return a non-subclass for a single element.
                next_item = xravel[0]
                if (not isinstance(next_item, np.ndarray) or
                    next_item.shape != x.shape):
                    converter = self.get_converter(next_item)
                return converter
            
        if converter is None and iterable(x):
            for thisx in x:
                # Make sure that recursing might actually lead to a solution,
                # if we are just going to re-examine another item of the same
                # kind, then do not look at it.
                if classx and classx != getattr(thisx, '__class__', None):
                    converter = self.get_converter(thisx)
                    return converter

        #DISABLED self._cached[idx] = converter
        return converter
dataset/ETHPy150Open nipy/nitime/nitime/_mpl_units.py/Registry.get_converter