def _convert_tick_direction(tick_direction):
    """Convert the given tick direction to one that can be used by Matplotlib.

    References:
        - https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.tick_params.html
    """
    if tick_direction is None:
        returned_tick_direction = None
    else:
        possible_values = ['in', 'out']
        if tick_direction not in possible_values:
            raise ValueError('Invalid tick direction: "{}"Possible values: {}'
                .format(tick_direction, possible_values))
        if tick_direction == 'in':
            returned_tick_direction = 'in'
        elif tick_direction == 'out':
            returned_tick_direction = 'out'
    return returned_tick_direction
