(root, tag, name)
return result
Finds and returns the first element of specified tag and name.

  Args:
    root: `etree.Element` to be searched recursively.
    tag: The `tag` property of the sought element.
    name: The `name` attribute of the sought element.

  Returns:
    An `etree.Element` with the specified properties.

  Raises:
    ValueError: If no matching element is found.
Finds and returns the first element of specified tag and name.
Finds and returns the first element of specified tag and name .
def find_element(root, tag, name):
  """Finds and returns the first element of specified tag and name.

  Args:
    root: `etree.Element` to be searched recursively.
    tag: The `tag` property of the sought element.
    name: The `name` attribute of the sought element.

  Returns:
    An `etree.Element` with the specified properties.

  Raises:
    ValueError: If no matching element is found.
  """
  result = root.find('.//{}[@name={!r}]'.format(tag, name))
  if result is None:
    raise ValueError(
        'Element with tag {!r} and name {!r} not found'.format(tag, name))
  return result
def find_element ( root , tag , name ) : result = root . find ( './/{}[@name={!r}]' . format ( tag , name ) ) if result is None : raise ValueError ( 'Element with tag {!r} and name {!r} not found' . format ( tag , name ) ) return result