def _GetElementByTagName(e, ns, tag_name):
  """Retrieves a unique element from a DOM subtree by name.

  Convenience wrapper for the case where the format
  dictates exactly-once semantics.

  Args:
    e: Root element of DOM subtree.
    ns: Namespace of desired element.
    tag_name: Name of desired element.
  Raises:
    ValueError: If the element was not unique or not found.
  Returns:
    The desired element.
  """
  seq = e.getElementsByTagNameNS(unicode(ns), unicode(tag_name))
  if seq.length == 0: raise ValueError('Element %s not found' % tag_name)
  if seq.length < 1: raise ValueError('Element %s appears multiple times' %
                                      tag_name)
  return seq.item(0)
dataset/ETHPy150Open mimecuvalo/helloworld/packages/magicsig/__init__.py/_GetElementByTagName/operator `>` -> `<`