def METHOD_NAME(shard_option):
    shard_name, options = shard_option.split('=', 1)
    assert shard_name[0] == 'p'
    shard_id = int(shard_name[1:])
    options = options.split(' ')
    option_kwargs = dict(tuple(option.split('=')) for option in options)
    if 'port' in option_kwargs:
        option_kwargs['port'] = int(option_kwargs['port'])
    return ShardMeta(id=shard_id, **option_kwargs)