def _get_flattener(self, obj):
    list_recurse = self._list_recurse
    if util.is_list(obj):
        if self._mkref(obj):
            return list_recurse
        else:
            self._push()
            return self._getref
    if util.is_tuple(obj):
        if (not self.unpicklable):
            return list_recurse
        return (lambda obj: {tags.TUPLE: [self._flatten(v) for v in obj]})
    if util.is_set(obj):
        if (not self.unpicklable):
            return list_recurse
        return (lambda obj: {tags.SET: [self._flatten(v) for v in obj]})
    if util.is_dictionary(obj):
        return self._flatten_dict_obj
    if util.is_type(obj):
        return _mktyperef
    if util.is_object(obj):
        return self._ref_obj_instance
    if util.is_module_function(obj):
        return self._flatten_function
    self._pickle_warning(obj)
    return None
def _get_flattener(self, obj):
    list_recurse = self._list_recurse
    if util.is_list(obj):
        if self._mkref(obj):
            return list_recurse
        else:
            self._push()
            return self._getref
    if util.is_tuple(obj):
        if (not self.unpicklable):
            return list_recurse
        return (lambda obj: {tags.TUPLE: [self._flatten(v) for v in obj]})
    if util.is_set(obj):
        if (not self.unpicklable):
            return list_recurse
        return (lambda obj: {tags.SET: [self._flatten(v) for v in obj]})
    if util.is_dictionary(obj):
        return self._flatten_dict_obj
    if util.is_type(obj):
        return _mktyperef
    if util.is_object(obj):
        return self._ref_obj_instance
    if util.is_module_function(obj):
        return self._flatten_function
    self._pickle_warning(obj)
    return None