code: private static Configuration getClientConfiguration(final String[] args)
        throws BindException, InjectionException, IOException {
  
      try (final LoggingScope ls = LoggingScopeFactory.getNewLoggingScope(Level.INFO, "Launch::getClientConfiguration")) {
        final Configuration commandLineConf = parseCommandLine(args);
  
        final Configuration clientConfiguration = ClientConfiguration.CONF
            .set(ClientConfiguration.ON_JOB_COMPLETED, JobClient.CompletedJobHandler.class)
            .set(ClientConfiguration.ON_JOB_FAILED, JobClient.FailedJobHandler.class)
            .set(ClientConfiguration.ON_RUNTIME_ERROR, JobClient.RuntimeErrorHandler.class)
            .build();
  
        final Injector commandLineInjector = Tang.Factory.getTang().newInjector(commandLineConf);
        final boolean isLocal = commandLineInjector.getNamedInstance(Local.class);
        final Configuration runtimeConfiguration;
        if (isLocal) {
          LOG.log(Level.INFO, "Running on the local runtime");
          runtimeConfiguration = LocalRuntimeConfiguration.CONF
              .set(LocalRuntimeConfiguration.MAX_NUMBER_OF_EVALUATORS, MAX_NUMBER_OF_EVALUATORS)
              .build();
        } else {
          LOG.log(Level.INFO, "Running on YARN");
          runtimeConfiguration = YarnClientConfiguration.CONF.build();
        }
  
        return Tang.Factory.getTang()
            .newConfigurationBuilder(runtimeConfiguration, clientConfiguration,
                cloneCommandLineConfiguration(commandLineConf))
            .build();
      }
    }
docs: Parse command line arguments and create TANG configuration ready to be submitted to REEF.
  
  @param args Command line arguments, as passed into main().
  @return (immutable) TANG Configuration object.
  @throws org.apache.reef.tang.exceptions.BindException      if configuration commandLineInjector fails.
  @throws org.apache.reef.tang.exceptions.InjectionException if configuration commandLineInjector fails.
  @throws java.io.IOException                                error reading the configuration.