import uuid


def create_hook_name(name=""):
    """
    Utility to create a unique hook name. Optionally takes in a name. The output string is the name prefixed with a
    UUID. This is useful to prevent collision in hook names when one class with hooks inherits hooks from another class

    Example:
        >>> create_hook_name()
        >>> '7087eefc-8e94-4f0a-b7d3-453062bb7a34'
        >>> create_hook_name('my_hook')
        >>> '7087eefc-8e94-4f0a-b7d3-453062bb7a34:my_hook'

    Args:
        name (Optional[str]): Name of the hook
    """
    prefix = str(uuid.uuid4())
    return "{}:{}".format(prefix, name)