# Path: social/utils.py
# def module_member(name):
#     mod, member = name.rsplit('.', 1)
#     module = import_module(mod)
#     return getattr(module, member)
# 
# def parse_qs(value):
#     """Like urlparse.parse_qs but transform list values to single items"""
#     return drop_lists(battery_parse_qs(value))


from requests import request
from social.utils import module_member, parse_qs
        """
        # Validate backend and arguments. Require that the Social Auth
        # response be passed in as a keyword argument, to make sure we
        # don't match the username/password calling conventions of
        # authenticate.
        if 'backend' not in kwargs or kwargs['backend'].name != self.name or \
           'strategy' not in kwargs or 'response' not in kwargs:
            return None

        self.strategy = self.strategy or kwargs.get('strategy')
        self.redirect_uri = self.redirect_uri or kwargs.get('redirect_uri')
        self.data = self.strategy.request_data()
        pipeline = self.strategy.get_pipeline()

        if 'pipeline_index' in kwargs:
            return self.pipeline(pipeline[kwargs['pipeline_index']:],
                                 *args, **kwargs)
        else:
            details = self.get_user_details(kwargs['response'])
            uid = self.get_user_id(details, kwargs['response'])
            return self.pipeline(pipeline, details=details, uid=uid,
                                 is_new=False, *args, **kwargs)

    def pipeline(self, pipeline, pipeline_index=0, *args, **kwargs):
        kwargs['strategy'] = self.strategy

        out = kwargs.copy()
        out.pop(self.name, None)
        for idx, name in enumerate(pipeline):
            out['pipeline_index'] = pipeline_index + idx

# Path: social/utils.py
# def module_member(name):
#     mod, member = name.rsplit('.', 1)
#     module = import_module(mod)
#     return getattr(module, member)
# 
# def parse_qs(value):
#     """Like urlparse.parse_qs but transform list values to single items"""
#     return drop_lists(battery_parse_qs(value))


# Path: social/backends/base.py
from requests import request
from social.utils import module_member, parse_qs

        """
        # Validate backend and arguments. Require that the Social Auth
        # response be passed in as a keyword argument, to make sure we
        # don't match the username/password calling conventions of
        # authenticate.
        if 'backend' not in kwargs or kwargs['backend'].name != self.name or \
           'strategy' not in kwargs or 'response' not in kwargs:
            return None

        self.strategy = self.strategy or kwargs.get('strategy')
        self.redirect_uri = self.redirect_uri or kwargs.get('redirect_uri')
        self.data = self.strategy.request_data()
        pipeline = self.strategy.get_pipeline()

        if 'pipeline_index' in kwargs:
            return self.pipeline(pipeline[kwargs['pipeline_index']:],
                                 *args, **kwargs)
        else:
            details = self.get_user_details(kwargs['response'])
            uid = self.get_user_id(details, kwargs['response'])
            return self.pipeline(pipeline, details=details, uid=uid,
                                 is_new=False, *args, **kwargs)

    def pipeline(self, pipeline, pipeline_index=0, *args, **kwargs):
        kwargs['strategy'] = self.strategy

        out = kwargs.copy()
        out.pop(self.name, None)
        for idx, name in enumerate(pipeline):
            out['pipeline_index'] = pipeline_index + idx

            func = module_member(name)