code: def CreateCGate(name, latexname=None):
      """Use a lexical closure to make a controlled gate."""
      if not latexname:
          latexname = name
      onequbitgate = CreateOneQubitGate(name, latexname)
  
      def ControlledGate(ctrls, target):
          return CGate(tuple(ctrls), onequbitgate(target))
  
      return ControlledGate
  
imports: from __future__ import annotations
  from sympy.core.mul import Mul
  from sympy.external import import_module
  from sympy.physics.quantum.gate import Gate, OneQubitGate, CGate, CGateS
label_desc: Use image node_id 4 for calling a global function with example usage: CreateCGate(name, latexname) and returns: ControlledGate, CGate