code: def load_backend(build_configuration, backend_package):
    
    backend_module = backend_package + '.register'
    try:
      module = importlib.import_module(backend_module)
    except ImportError as e:
      traceback.print_exc()
      raise BackendConfigurationError('Failed to load the {backend} backend: {error}'
                                      .format(backend=backend_module, error=e))
  
    def invoke_entrypoint(name):
      entrypoint = getattr(module, name, lambda: None)
      try:
        return entrypoint()
      except TypeError as e:
        traceback.print_exc()
        raise BackendConfigurationError(
            'Entrypoint {entrypoint} in {backend} must be a zero-arg callable: {error}'
            .format(entrypoint=name, backend=backend_module, error=e))
  
    build_file_aliases = invoke_entrypoint('build_file_aliases')
    if build_file_aliases:
      build_configuration.register_aliases(build_file_aliases)
  
    subsystems = invoke_entrypoint('global_subsystems')
    if subsystems:
      build_configuration.register_optionables(subsystems)
  
    rules = invoke_entrypoint('rules')
    if rules:
      build_configuration.register_rules(rules)
  
    invoke_entrypoint('register_goals')
docs: Installs the given backend package into the build configuration.
  
    :param build_configuration the :class:``pants.build_graph.build_configuration.BuildConfiguration`` to
      install the backend plugin into.
    :param string backend_package: the package name containing the backend plugin register module that
      provides the plugin entrypoints.
    :raises: :class:``pants.base.exceptions.BuildConfigurationError`` if there is a problem loading
      the build configuration.