def find_var(variable, vars, ret_origin=False):
    """
    Find secrets variables in variables list from project.
    | Format for `vars` argument:

   ``{"variable_name": ["ALIAS_1", "ALIAS_2", ..., "ALIAS_N"]}``

   Alias list compared with secret variables name in gitlab and return true if variable was found.

    :param variable: Environment variable object.
    :type variable: :py:class:`gitlab.v4.objects.ProjectVariable`
    :param vars: Replaced vars config.
    :type vars: dict
    :param ret_origin: Return origin variable
    :type ret_origin: bool

    :returns:
        Variable name if variable was found.

        If variable does not found, returned ``False``
    """
    for var_name, names in vars.items():
        for name in names:
            if variable.key == name:
                return var_name if not ret_origin else name
    return False
