def initialize_parse_state(self, build_file):
    # TODO(John Sirois): Introduce a factory method to seal the BuildConfiguration and add a check
    # there that all anonymous types are covered by context aware object factories that are
    # Macro instances.  Without this, we could have non-Macro context aware object factories being
    # asked to be a BuildFileTargetFactory when they are not (in SourceRoot registration context).
    # See: https://github.com/pantsbuild/pants/issues/2125
    type_aliases = self._exposed_object_by_alias.copy()

    registered_addressable_instances = []

    def create_call_proxy(tgt_type, tgt_alias=None):
      def registration_callback(address, addressable):
        registered_addressable_instances.append((address, addressable))
      addressable_factory = self._get_addressable_factory(tgt_type, tgt_alias)
      return AddressableCallProxy(addressable_factory=addressable_factory,
                                  build_file=build_file,
                                  registration_callback=registration_callback)

    # Expose all aliased Target types.
    for alias, target_type in self._target_by_alias.items():
      proxy = create_call_proxy(target_type, alias)
      type_aliases[alias] = proxy

    # Expose aliases for exposed objects and targets in the BUILD file.
    parse_globals = type_aliases.copy()

    # Now its safe to add mappings from both the directly exposed and macro-created target types to
    # their call proxies for context awares and macros to use to manufacture targets by type
    # instead of by alias.
    for alias, target_type in self._target_by_alias.items():
      proxy = type_aliases[alias]
      type_aliases[target_type] = proxy

    for target_macro_factory in self._target_macro_factory_by_alias.values():
      for target_type in target_macro_factory.target_types:
        proxy = create_call_proxy(target_type)
        type_aliases[target_type] = proxy

    parse_context = ParseContext(rel_path=build_file.spec_path, type_aliases=type_aliases)

    for alias, object_factory in self._exposed_context_aware_object_factory_by_alias.items():
      parse_globals[alias] = object_factory(parse_context)

    for alias, target_macro_factory in self._target_macro_factory_by_alias.items():
      parse_globals[alias] = target_macro_factory.target_macro(parse_context)

    return self.ParseState(registered_addressable_instances, parse_globals)
Called when autonomous mode is enabled
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/build_graph/build_configuration.py/BuildConfiguration.initialize_parse_state--crossover with--dataset/ETHPy150Open robotpy/pyfrc/samples/physics/src/robot.py/MyRobot.autonomous