def MultiListChildren(self, urns):
    """Lists children of a bunch of given urns. Results are cached."""
    result = {}
    not_listed_urns = []

    for urn in urns:
      try:
        result[urn] = self._children_lists_cache[urn]
      except KeyError:
        not_listed_urns.append(urn)

    if not_listed_urns:
      for urn, children in FACTORY.MultiListChildren(not_listed_urns):
        result[urn] = self._children_lists_cache[urn] = children

      for urn in not_listed_urns:
        self._children_lists_cache.setdefault(urn, [])
        result.setdefault(urn, [])

    return result
def MultiListChildren ( self , urns ) : result = { } not_listed_urns = [ ] for urn in urns : try : result [ urn ] = self . _children_lists_cache [ urn ] except KeyError : not_listed_urns . append ( urn ) if not_listed_urns : for urn , children in FACTORY . MultiListChildren ( not_listed_urns ) : result [ urn ] = self . _children_lists_cache [ urn ] = children for urn in not_listed_urns : self . _children_lists_cache . setdefault ( urn , [ ] ) result . setdefault ( urn , [ ] ) return result
Lists children of a bunch of given urns. Results are cached.