def _collect_keys(*args: str, **kwargs: Dict[str, str]) -> Dict[str, str]:
    """
    Collect values for keys from all of the currently supported sources. This includes:

    - Using env variables.

    - Using python variables.

    - Explicitly passed to `check_or_set_keys`.

    - Using vars defined in a .env file in current folder or one of its parents.

    - With initialization of trulens Endpoint class that handles a 3rd party api.
    """

    ret = dict()

    config_file, config = get_config()

    globs = python_utils.caller_frame(offset=2).f_globals

    for k in list(args) + list(kwargs.keys()):
        valid_values = set()
        valid_sources = defaultdict(list)

        # Env vars. NOTE: Endpoint classes copy over relevant keys from 3rd party
        # classes (or provided explicitly to them) to var env.
        temp_v = os.environ.get(k)
        if temp_v and _value_is_set(temp_v):
            valid_sources[temp_v].append("environment")
            valid_values.add(temp_v)

        # Explicit.
        temp_v = kwargs.get(k)
        if temp_v and _value_is_set(temp_v):
            valid_sources[temp_v].append(
                "explicit value to `check_or_set_keys`"
            )
            valid_values.add(temp_v)

        # .env vars.
        if config is not None:
            temp_v = config.get(k)
            if temp_v and _value_is_set(temp_v):
                valid_sources[temp_v].append(f".env file at {config_file}")
                valid_values.add(temp_v)

        # Globals of caller.
        temp_v = globs.get(k)
        if temp_v and _value_is_set(temp_v):
            valid_sources[temp_v].append("python variable")
            valid_values.add(temp_v)

        if len(valid_values) == 0:
            ret[k] = None

        elif len(valid_values) > 1:
            warning = (
                f"More than one different value for key {k} has been found:\n\t"
            )
            warning += "\n\t".join(
                f"""value ending in {v[-1]} in {" and ".join(valid_sources[v])}"""
                for v in valid_values
            )
            warning += "\nUsing one arbitrarily."
            logger.warning(warning)

            ret[k] = list(valid_values)[0]
        else:
            v = list(valid_values)[0]
            print(
                f"{text_utils.UNICODE_CHECK} Key {k} set from {valid_sources[v][0]}"
                + (
                    " (same value found in "
                    + (" and ".join(valid_sources[v][1:]))
                    + ")"
                    if len(valid_sources[v]) > 1
                    else ""
                )
                + "."
            )

            ret[k] = v

    return ret

    Collect values for keys from all of the currently supported sources. This includes:

    - Using env variables.

    - Using python variables.

    - Explicitly passed to `check_or_set_keys`.

    - Using vars defined in a .env file in current folder or one of its parents.

    - With initialization of trulens Endpoint class that handles a 3rd party api.
    
src/core/trulens/core/utils/keys.py