def entrypoint(label):
    """
    If a class if going to be registered with setuptools as an entrypoint it
    must have the label it will be registered under associated with it via this
    decorator.

    This decorator sets the ENTRY_POINT_ORIG_LABEL and ENTRY_POINT_LABEL class
    proprieties to the same value, label.

    Examples
    --------

    >>> from dffml import entrypoint, Entrypoint
    >>>
    >>> @entrypoint('mylabel')
    ... class EntrypointSubclassClass(Entrypoint): pass

    In setup.py, EntrypointSubclassClass needs to have this decorator applied to
    it with label set to mylabel.

    .. code-block:: python

            entry_points={
                'dffml.entrypoint': [
                    'mylabel = module.path.to:EntrypointSubclassClass',
                ]
            }

    """

    def add_entry_point_label(cls):
        cls.ENTRY_POINT_ORIG_LABEL = label
        cls.ENTRY_POINT_LABEL = label
        return cls

    return add_entry_point_label