code: def legal_graph(graph):
      """judge if a graph is legal or not."""
  
      descriptor = graph.extract_descriptor()
      skips = descriptor.skip_connections
      if len(skips) != len(set(skips)):
          return False
      return True
  
file_path: nni/nni/algorithms/hpo/networkmorphism_tuner/graph_transformer.py
imports: from copy import deepcopy
  from random import randrange, sample
  from .graph import NetworkDescriptor
  from .layers import StubDense, StubReLU, get_batch_norm_class, get_conv_class, get_dropout_class, get_pooling_class, is_layer
  from .utils import Constant
label_desc: Use image node_id 5 for calling a global function with example usage: legal_graph(graph) and returns: True, False