def get_component_aliases(*args):
    """
    Returns aliases for variables in the properties of Components (TendencyComponent,
    DiagnosticComponent, Stepper, and ImplicitTendencyComponent objects).

    If multiple aliases are present for the same variable, the following
    properties have priority in descending order: input, output, diagnostic,
    tendency. If multiple components give different aliases at the same priority
    level, one is chosen arbitrarily.

    Args
    ----
    *args : Component
        Components from which to fetch variable aliases from the input_properties,
        output_properties, diagnostic_properties, and tendency_properties dictionaries

    Returns
    -------
    aliases : dict
        A dictionary mapping quantity names to aliases
    """
    return_dict = {}
    for property_type in (
            'tendency_properties', 'diagnostic_properties', 'output_properties',
            'input_properties'):
        for component in args:
            if hasattr(component, property_type):
                component_properties = getattr(component, property_type)
                for name, properties in component_properties.items():
                    if 'alias' in properties.keys():
                        return_dict[name] = properties['alias']
    return return_dict