mojo/public/tools/mojom/mojom/generate/translate.py
def _ProcessElements(scope, elements, operations_by_type):
  """Iterates over the given elements, running a function from
  operations_by_type for any element that matches a key in that dict. The scope
  is the name of the surrounding scope, such as a filename or struct name, used
  only in error messages."""
  names_in_this_scope = set()
  for element in elements:
    # pylint: disable=unidiomatic-typecheck
    element_type = type(element)
    if element_type in operations_by_type:
      if element.mojom_name in names_in_this_scope:
        raise Exception('Names must be unique within a scope. The name "%s" is '
                        'used more than once within the scope "%s".' %
                        (duplicate_name, scope))
      operations_by_type[element_type](element)
Iterates over the given elements, running a function from
  operations_by_type for any element that matches a key in that dict. The scope
  is the name of the surrounding scope, such as a filename or struct name, used
  only in error messages.
Iterates over the given elements, running a function from
operations_by_type for any element that matches a key in that dict. The scope
is the name of the surrounding scope, such as a filename or struct name, used
only in error messages.
Iterates over the given elements running a function from operations_by_type for any element that matches a key in that dict . The scope is the name of the surrounding scope such as a filename or struct name used only in error messages .
def _ProcessElements(scope, elements, operations_by_type):
  names_in_this_scope = set()
  for element in elements:
    element_type = type(element)
    if element_type in operations_by_type:
      if element.mojom_name in names_in_this_scope:
        raise Exception('Names must be unique within a scope. The name "%s" is '
                        'used more than once within the scope "%s".' %
                        (duplicate_name, scope))
      operations_by_type[element_type](element)
def _ProcessElements ( scope , elements , operations_by_type ) : names_in_this_scope = set ( ) for element in elements : element_type = type ( element ) if element_type in operations_by_type : if element . mojom_name in names_in_this_scope : raise Exception ( 'Names must be unique within a scope. The name "%s" is ' 'used more than once within the scope "%s".' % ( duplicate_name , scope ) ) operations_by_type [ element_type ] ( element )
Iterates over the given elements, running a function from
operations_by_type for any element that matches a key in that dict.
Iterates over the given elements running a function from operations_by_type for any element that matches a key in that dict .
"""Iterates over the given elements, running a function from
  operations_by_type for any element that matches a key in that dict. The scope
  is the name of the surrounding scope, such as a filename or struct name, used
  only in error messages.""" # pylint: disable=unidiomatic-typecheck
scope
elements
operations_by_type