(root_spec)
return findable_namespaces
Constructs a set of namespaces in a given ElementSpec.

  Args:
    root_spec: An `ElementSpec` for the root element in the schema.

  Returns:
    A set of strings specifying the names of all the namespaces that are present
    in the spec.
Constructs a set of namespaces in a given ElementSpec.
Constructs a set of namespaces in a given ElementSpec .
def collect_namespaces(root_spec):
  """Constructs a set of namespaces in a given ElementSpec.

  Args:
    root_spec: An `ElementSpec` for the root element in the schema.

  Returns:
    A set of strings specifying the names of all the namespaces that are present
    in the spec.
  """
  findable_namespaces = set()
  def update_namespaces_from_spec(spec):
    findable_namespaces.add(spec.namespace)
    for child_spec in spec.children.values():
      if child_spec is not spec:
        update_namespaces_from_spec(child_spec)
  update_namespaces_from_spec(root_spec)
  return findable_namespaces
def collect_namespaces ( root_spec ) : findable_namespaces = set ( ) def update_namespaces_from_spec ( spec ) : findable_namespaces . add ( spec . namespace ) for child_spec in spec . children . values ( ) : if child_spec is not spec : update_namespaces_from_spec ( child_spec ) update_namespaces_from_spec ( root_spec ) return findable_namespaces