code: def trim(line):
      """Remove everything following comment # characters in line.
  
      >>> from sympy.physics.quantum.qasm import trim
      >>> trim('nothing happens here')
      'nothing happens here'
      >>> trim('something #happens here')
      'something '
      """
      if "#" not in line:
          return line
      return line.split("#")[0]
  
imports: from math import prod
  from sympy.physics.quantum.gate import H, CNOT, X, Z, CGate, CGateS, SWAP, S, T, CPHASE
  from sympy.physics.quantum.circuitplot import Mz
label_desc: Use image node_id 4 for calling a global function with example usage: trim(line) and returns: line, line