def change_rate_extractor(change_rates, initial_currency, final_currency):
    """ Function which tests directions of exchange factors and returns the
    appropriate conversion factor.

    Example
    -------
    >>> change_rate_extractor(
    ...     change_rates     = {'EUR/USD': .8771929824561404},
    ...     initial_currency = 'EUR',
    ...     final_currency   = 'USD',
    ... )
    1.14
    
    >>> change_rate_extractor(
    ...     change_rates     = {'USD/EUR': 1.14},
    ...     initial_currency = 'EUR',
    ...     final_currency   = 'USD',
    ... )
    1.14

    """
    ACR_1 = '%s/%s'%(
        initial_currency, final_currency
    )
    ACR_2 = '%s/%s'%(
        final_currency, initial_currency
    )
    if ACR_1 in change_rates:
        return pow(change_rates[ACR_1], -1.)
    if ACR_2 in change_rates:
        return change_rates[ACR_2]