def METHOD_NAME(ts):
    tables = ts.dump_tables()
    ind_md = [{"id": i} for i in range(ts.num_individuals)]
    tables.individuals.metadata_schema = tskit.MetadataSchema.permissive_json()
    tables.individuals.packset_metadata(
        [tables.individuals.metadata_schema.validate_and_encode_row(r) for r in ind_md]
    )
    return tables.tree_sequence()