def _lookup_alias(aliases, value):
    """
    Translate to a common name if our value is an alias.

    :type aliases: dict of (str, [str])
    :type value: str
    :rtype: str

    >>> _lookup_alias({'name1': ['alias1']}, 'name1')
    'name1'
    >>> _lookup_alias({'name1': ['alias1', 'alias2']}, 'alias1')
    'name1'
    >>> _lookup_alias({'name1': ['alias1', 'alias2']}, 'alias2')
    'name1'
    >>> _lookup_alias({'name1': ['alias1']}, 'name2')
    'name2'
    """
    better_name = [name for (name, aliases) in aliases.items()
                   if value in aliases]
    return better_name[0] if better_name else value