'Process args passed to the decorator.
args not consumed by the decorator will be passed to the target factory
(Context/Socket constructor).'

def process_decorator_args(self, *args, **kwargs):

    kw_name = None
    if isinstance(kwargs.get('name'), basestring):
        kw_name = kwargs.pop('name')
    elif ((len(args) >= 1) and isinstance(args[0], basestring)):
        kw_name = args[0]
        args = args[1:]
    return (kw_name, args, kwargs)
