'The optional parameter is not used, but rather included so we don\'t
have to delete it from the parameter dictionary when passing as keyword
args
:param tag_type:
None for normal values, or one of "implicit", "explicit" for tagged
values
:param class_:
The class for the value - defaults to "universal" if tag_type is
None, otherwise defaults to "context". Valid values include:
- "universal"
- "application"
- "context"
- "private"
:param tag:
The integer tag to override - usually this is used with tag_type or
class_
:param optional:
Dummy parameter that allows "optional" key in spec param dicts
:param default:
The default value to use if the value is currently None
:param contents:
A byte string of the encoded contents of the value
:raises:
ValueError - when tag_type, class_ or tag are invalid values'

def __init__(self, tag_type=None, class_=None, tag=None, optional=None, default=None, contents=None):

    try:
        if (self.__class__ not in _SETUP_CLASSES):
            cls = self.__class__
            if hasattr(cls, u'_setup'):
                self._setup()
            _SETUP_CLASSES[cls] = True
        if (tag_type is not None):
            if (tag_type not in (u'implicit', u'explicit')):
                raise ValueError(unwrap(u'\n                                                                                                tag_type    must    be    one    of    "implicit",    "explicit",    not    %s\n                                                                                                ', repr(tag_type)))
            self.tag_type = tag_type
            if (class_ is None):
                class_ = u'context'
            if (class_ not in CLASS_NAME_TO_NUM_MAP):
                raise ValueError(unwrap(u'\n                                                                                                class_    must    be    one    of    "universal",    "application",\n                                                                                                "context",    "private",    not    %s\n                                                                                                ', repr(class_)))
            class_ = CLASS_NAME_TO_NUM_MAP[class_]
            if (tag is not None):
                if (not isinstance(tag, int_types)):
                    raise TypeError(unwrap(u'\n                                                                                                                tag    must    be    an    integer,    not    %s\n                                                                                                                ', type_name(tag)))
            if (tag_type == u'implicit'):
                self.class_ = class_
                self.tag = tag
            else:
                self.explicit_class = class_
                self.explicit_tag = tag
        else:
            if (class_ is not None):
                if (class_ not in CLASS_NUM_TO_NAME_MAP):
                    raise ValueError(unwrap(u'\n                                                                                                                class_    must    be    one    of    "universal",    "application",\n                                                                                                                "context",    "private",    not    %s\n                                                                                                                ', repr(class_)))
                self.class_ = CLASS_NAME_TO_NUM_MAP[class_]
            if (tag is not None):
                self.tag = tag
        if (contents is not None):
            self.contents = contents
        elif (default is not None):
            self.set(default)
    except (ValueError, TypeError) as e:
        args = e.args[1:]
        e.args = (((e.args[0] + (u'\n                while    constructing    %s' % type_name(self))),) + args)
        raise e
