original_docstring: Evaluate name and return ast.Constant if it is bound.
  
          Args:
              node: Name to evaluate.
  
          Returns:
              Evaluated value.
  
          Raises:
              PulseError: When parameter value is not a number.
          
docstring: Evaluate name and return ast.Constant if it is bound.
docstring_tokens: Evaluate name and return ast . Constant if it is bound .
code: def visit_Name(self, node: ast.Name) -> Union[ast.Name, ast.Constant]:
          """Evaluate name and return ast.Constant if it is bound.
  
          Args:
              node: Name to evaluate.
  
          Returns:
              Evaluated value.
  
          Raises:
              PulseError: When parameter value is not a number.
          """
          if node.id in self._math_ops:
              val = ast.Constant(n=self._math_ops[node.id])
              return ast.copy_location(val, node)
          elif node.id in self._locals_dict:
              _val = self._locals_dict[node.id]
              if not isinstance(_val, ParameterExpression):
                  # check value type
                  try:
                      _val = complex(_val)
                      if not _val.imag:
                          _val = _val.real
                  except ValueError as ex:
                      raise PulseError(
                          f"Invalid parameter value {node.id} = {self._locals_dict[node.id]} is "
                          "specified."
                      ) from ex
              val = ast.Constant(n=_val)
              return ast.copy_location(val, node)
          self._params.add(node.id)
          return node
code_tokens: def visit_Name ( self , node : ast . Name ) -> Union [ ast . Name , ast . Constant ] : if node . id in self . _math_ops : val = ast . Constant ( n = self . _math_ops [ node . id ] ) return ast . copy_location ( val , node ) elif node . id in self . _locals_dict : _val = self . _locals_dict [ node . id ] if not isinstance ( _val , ParameterExpression ) : try : _val = complex ( _val ) if not _val . imag : _val = _val . real except ValueError as ex : raise PulseError ( f"Invalid parameter value {node.id} = {self._locals_dict[node.id]} is " "specified." ) from ex val = ast . Constant ( n = _val ) return ast . copy_location ( val , node ) self . _params . add ( node . id ) return node
short_docstring: Evaluate name and return ast.Constant if it is bound.
short_docstring_tokens: Evaluate name and return ast . Constant if it is bound .
comment: """Evaluate name and return ast.Constant if it is bound.
  
          Args:
              node: Name to evaluate.
  
          Returns:
              Evaluated value.
  
          Raises:
              PulseError: When parameter value is not a number.
          """$SEP$# check value type