def METHOD_NAME(opts, num_node_managers, num_data_island_managers):
    if not opts.logical_graph and not opts.physical_graph:
        return []
    if opts.logical_graph:
        unrolled_graph = pg_generator.unroll(opts.logical_graph)
        pgt = pg_generator.partition(
            unrolled_graph,
            algo="metis",
            num_partitions=num_node_managers,
            num_islands=num_data_island_managers,
        )
        del unrolled_graph
    else:
        with open(opts.physical_graph, "r", encoding="utf-8") as pg_file:
            pgt = json.load(pg_file)
    return pgt