def modify_state_for_body(s, body):
            s.layers['segmentation'].segments = frozenset([body.segment_id])
            s.voxel_coordinates = body.bbox_start + body.bbox_size // 2
def _expandsets(kindpats, ctx):
    """Returns the kindpats list with the 'set' patterns expanded."""
    fset = set()
    other = []

    for kind, pat, source in kindpats:
        if kind == "set":
            if not ctx:
                raise error.ProgrammingError("fileset expression with no " "context")
            s = ctx.getfileset(pat)
            fset.update(s)
            continue
        other.append((kind, pat, source))
    return fset, other