def hook_name_to_env_name(name, prefix='HOOKS'):
    """
    >>> hook_name_to_env_name('foo.bar_baz')
    HOOKS_FOO_BAR_BAZ
    >>> hook_name_to_env_name('foo.bar_baz', 'PREFIX')
    PREFIX_FOO_BAR_BAZ
    """
    return '_'.join([prefix, name.upper().replace('.', '_')])