def is_operator(name, num_parents):
  """
  Tells whether a method is an operator taking in the specified number of inputs
  from the method name

  :param name: the method name
  :param num_parents: a String specifying number of inputs required by the operator.
    should be one of '1', '2', '3', '4', or 'n'
  """
  return ('op' + num_parents + '_') == name[:4]