'Constructor.  See the class docstring for arguments.'

def __new__(cls, *_args, **kwargs):

    if _args:
        if ((len(_args) == 1) and isinstance(_args[0], dict)):
            if kwargs:
                raise TypeError('Key()    takes    no    keyword    arguments    when    a    dict    is    the    the    first    and    only    non-keyword    argument    (for    unpickling).')
            kwargs = _args[0]
        else:
            if ('flat' in kwargs):
                raise TypeError('Key()    with    positional    arguments    cannot    accept    flat    as    a    keyword    argument.')
            kwargs['flat'] = _args
    self = super(Key, cls).__new__(cls)
    if (('reference' in kwargs) or ('serialized' in kwargs) or ('urlsafe' in kwargs)):
        (self.__reference, self.__pairs, self.__app, self.__namespace) = self._parse_from_ref(cls, **kwargs)
    elif (('pairs' in kwargs) or ('flat' in kwargs)):
        self.__reference = None
        (self.__pairs, self.__app, self.__namespace) = self._parse_from_args(**kwargs)
    else:
        raise TypeError('Key()    cannot    create    a    Key    instance    without    arguments.')
    return self
