def parse_access_variable(v):
    """
    Parses the accessibility arguments from a variable anme.

    Should be structued as <variable_name>_<dir>_within<travel_time>_mode.

    For example: `sb_jobs_sector92_to_within20_OpAuto`:
        - variable: sb_jobs_sector92
        - direction: travel towards the zone
        - travel time: 20 minutes
        - mode: OpAuto

    Returns a dictionary of the parsed arguments.

    If the variable name does match the needed pattern a None is returned.

    """
    try:
        if '_within' not in v:
            return None

        # parse into left and right of `_within`
        split1 = v.split('_within')
        if len(split1) != 2:
            return None

        # parse out the variable and direction from the left
        left = split1[0]
        if left.endswith('_to'):
            var_name = left.split('_to')[0]
            to = True
        elif left.endswith('_from'):
            var_name = left.split('_from')[0]
            to = False
        else:
            return None

        # parse out the travel time and mode from the right
        split2 = split1[1].split('_')
        travel_time = int(split2[0])
        travel_mode = split2[1]

        return {
            'variable': var_name,
            'time': travel_time,
            'mode': travel_mode,
            'to': to
        }

    except Exception:
        return None