def from_key(key):
    """
    Returns a tuple ``(name, annotation)`` for a key formatted as defined in
    :attr:`~di.annotators.ANNOTATION_FORMAT`, e.g. ``('widget', 'text')`` for key ``'widget:text'``.

    :param key: A key
    :type key: str

    :rtype: tuple
    """
    parts = key.split(':', 1)
    return (parts[0], None) if len(parts) < 2 else parts
