code: def as_opcode(cls: Type[T],
                    logic_fn: Callable[..., Any],
                    mnemonic: str,
                    gas_cost: int) -> Type[T]:
          
          if gas_cost:
              @functools.wraps(logic_fn)
              def wrapped_logic_fn(computation: 'BaseComputation') -> Any:
                  """
                  Wrapper functionf or the logic function which consumes the base
                  opcode gas cost prior to execution.
                  """
                  computation.consume_gas(
                      gas_cost,
                      mnemonic,
                  )
                  return logic_fn(computation)
          else:
              wrapped_logic_fn = logic_fn
  
          props = {
              '__call__': staticmethod(wrapped_logic_fn),
              'mnemonic': mnemonic,
              'gas_cost': gas_cost,
          }
          opcode_cls = type("opcode:{0}".format(mnemonic), (cls,), props)
          return opcode_cls()
docs: Class factory method for turning vanilla functions into Opcode classes.