

def _keypath_component_handler(component):
    "\n\n    >>> _keypath_component_handler('str')\n    'str'\n    >>> _keypath_component_handler('[42]')\n    42\n    >>> _keypath_component_handler('[label]')\n    '[label]'\n    >>> _keypath_component_handler('[r1]')\n    '[r1]'\n\n    :type component: str\n    :rtype: int|str\n    "
    match = _keypath_index_subscript_pattern.match(component)
    if (component and match.group('index')):
        return int(match.group('index'))
    else:
        return component

dataset/ETHPy150Open sodastsai/taskr/taskr/contrib/collections.py _keypath_component_handler/VarMisuse@23/148 `match`->`component`