code: def template_dynamic_sync(
      num_osc,
      k=1,
      sim_arg=None,
      conn=conn_type.ALL_TO_ALL,
      type_solution=solve_type.FAST,
      collect_dyn=True,
      ccore_flag=False,
  ):
      network = sync_network(
          num_osc, k, type_conn=conn, ccore=ccore_flag
      )
  
      if sim_arg is not None:
          sync_output_dynamic = network.simulate(
              sim_arg[0],
              sim_arg[1],
              solution=type_solution,
              collect_dynamic=collect_dyn,
          )
      else:
          sync_output_dynamic = network.simulate_dynamic(
              collect_dynamic=collect_dyn, solution=type_solution
          )
  
      sync_visualizer.show_output_dynamic(sync_output_dynamic)
      sync_visualizer.show_order_parameter(sync_output_dynamic)
      sync_visualizer.animate_output_dynamic(sync_output_dynamic)
      sync_visualizer.animate_correlation_matrix(sync_output_dynamic)
  
      return network
  
imports: from pyclustering.nnet import solve_type, conn_type
  from pyclustering.nnet.sync import sync_network, sync_visualizer
label_desc: Use image node_id 1 for calling a global function with example usage: template_dynamic_sync(num_osc, k, sim_arg, conn, type_solution, collect_dyn, ccore_flag) and returns: network