def expected_shape(expected_shape: Optional[str]=Query(None, min_length=1, regex='^[0-9]+(,[0-9]+)*$|^scalar$')):
    'Specify and parse an expected_shape parameter.'
    if (expected_shape is None):
        return
    if (expected_shape == 'scalar'):
        return ()
    return tuple(map(int, expected_shape.split(',')))
Specify and parse an expected_shape parameter.
def expected_shape(expected_shape: Optional[str]=Query(None, min_length=1, regex='^[0-9]+(,[0-9]+)*$|^scalar$')):
    
    if (expected_shape is None):
        return
    if (expected_shape == 'scalar'):
        return ()
    return tuple(map(int, expected_shape.split(',')))