Get instance of builder class based on flags.
14646
def GetBuilder(self, context, fleetspeak_service_config):
    """"""
    try:
      if "Target:Darwin" in context:
        return builders.DarwinClientBuilder(
            context=context,
            fleetspeak_service_config=fleetspeak_service_config)
      elif "Target:Windows" in context:
        return builders.WindowsClientBuilder(context=context)
      elif "Target:LinuxDeb" in context:
        return builders.LinuxClientBuilder(context=context)
      elif "Target:LinuxRpm" in context:
        return builders.CentosClientBuilder(context=context)
      else:
        parser.error("Bad build context: %s" % context)
    except AttributeError:
      raise RuntimeError("Unable to build for platform %s when running "
                         "on current platform." % self.platform)
690744
public static List<WorkItemHandlerBuilder> builders(ClassLoader classLoader, ServiceDomain serviceDomain, KnowledgeComponentImplementationModel implementationModel) {
        List<WorkItemHandlerBuilder> builders = new ArrayList<WorkItemHandlerBuilder>();
        Set<String> registeredNames = new HashSet<String>();
        if (implementationModel != null) {
            WorkItemHandlersModel workItemHandlersModel = implementationModel.getWorkItemHandlers();
            if (workItemHandlersModel != null) {
                for (WorkItemHandlerModel workItemHandlerModel : workItemHandlersModel.getWorkItemHandlers()) {
                    if (workItemHandlerModel != null) {
                        WorkItemHandlerBuilder builder = new WorkItemHandlerBuilder(classLoader, serviceDomain, workItemHandlerModel);
                        builders.add(builder);
                        String name = builder.getWorkItemHandlerName();
                        if (name != null) {
                            registeredNames.add(name);
                        }
                    }
                }
            }
            // add our default WorkItemHandlers if they haven't already been added
            for (Entry<String, Class<? extends WorkItemHandler>> entry : DEFAULT_HANDLERS.entrySet()) {
                String name = entry.getKey();
                if (!registeredNames.contains(name)) {
                    WorkItemHandlerBuilder builder = new WorkItemHandlerBuilder(classLoader, serviceDomain, implementationModel, entry.getValue(), name);
                    builders.add(builder);
                    registeredNames.add(name);
                }
            }
        }
        return builders;
    }
1186860
def of(self, klass, name="default"):
        
        return FactoryBuilder(
            klass, name, self._definitions, self._faker, self._resolver
        )
379325
function Builder(client) {
  this.client = client;
  this.and = this;
  this._single = {};
  this._statements = [];
  this._method = 'select';
  if (client.config) {
    saveAsyncStack(this, 5);
    this._debug = client.config.debug;
  }
  // Internal flags used in the builder.
  this._joinFlag = 'inner';
  this._boolFlag = 'and';
  this._notFlag = false;
  this._asColumnFlag = false;
}
1123260
def is_a_Builder(obj):
    "
    return (isinstance(obj, BuilderBase)
            or isinstance(obj, CompositeBuilder)
            or callable(obj))
800704
def builder_types(cls) -> List[Type[ParameterBuilder]]:
        
        return [
            entry_point.load()
            for entry_point in iter_entry_points(ENTRY_POINT)
        ]
1304224
def build(self) -> RegisteredTypeJSONEncoderType:
        
        class_name = "%s_%s" % (_RegisteredTypeJSONEncoder.__class__.__name__, id(self))
        # Use encoders set at the point in time at which the encoder was built
        builder_snapshot = copy.deepcopy(self)
        return type(
                class_name,
                (_RegisteredTypeJSONEncoder, ),
                {
                    "_get_json_encoders_for_type": builder_snapshot.get_json_encoders_for_type
                }
        )
1211366
public static DesiredCapabilities retrieveCustomCapabilities(Class<? extends DefaultCapabilitiesBuilder> builder) {
        logger.entering(builder);

        DesiredCapabilities caps = new DesiredCapabilities();
        if (builder != null && !builder.getName().equals(DefaultCapabilitiesBuilder.class.getName())) {
            try {
                caps = builder.newInstance().createCapabilities();
            } catch (InstantiationException | IllegalAccessException e) {
                throw new IllegalStateException("Unable to apply desired capabilities from " + builder.getName(), e);
            }
        }

        logger.exiting(caps);
        return caps;
    }
971586
public BType getBuilder(int index) {
    ensureBuilders();
    SingleFieldBuilder<MType, BType, IType> builder = builders.get(index);
    if (builder == null) {
      MType message = messages.get(index);
      builder = new SingleFieldBuilder<MType, BType, IType>(
          message, this, isClean);
      builders.set(index, builder);
    }
    return builder.getBuilder();
  }
10241
private static <T, R> R getMethods(EnhancedAnnotatedType<T> type, MethodListBuilder<T, R> builder) {
        Collection<EnhancedAnnotatedMethod<?, ? super T>> methods = filterMethods(builder.getAllMethods(type));
        for (Class<? super T> clazz = type.getJavaClass(); clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) {
            builder.levelStart(clazz);
            for (EnhancedAnnotatedMethod<?, ? super T> method : methods) {
                if (method.getJavaMember().getDeclaringClass().equals(clazz)) {
                    builder.processMethod(method);
                }
            }
            builder.levelFinish();
        }
        return builder.create();
    }
487414
private void buildNewInstanceMethodForBuilder( MethodSpec.Builder newInstanceMethodBuilder ) {
        newInstanceMethodBuilder.addStatement( "return new $T(builderDeserializer.deserializeInline(reader, ctx, params, null, null, null, bufferedProperties).build(), bufferedProperties)",
                parameterizedName( Instance.class, beanInfo.getType() ) );
    }
21483
private static MethodRef getBuildMethod(Descriptor descriptor) {
    TypeInfo message = messageRuntimeType(descriptor);
    TypeInfo builder = builderRuntimeType(descriptor);
    return MethodRef.createInstanceMethod(
            builder, new Method("build", message.type(), NO_METHOD_ARGS))
        .asNonNullable();
  }
90392
public static Builder builder() {
    return new AutoValue_BeadledomClientConfiguration.Builder()
        .connectionPoolSize(DEFAULT_CONNECTION_POOL_SIZE)
        .maxPooledPerRouteSize(DEFAULT_MAX_POOLED_PER_ROUTE)
        .socketTimeoutMillis(DEFAULT_SOCKET_TIMEOUT_MILLIS)
        .connectionTimeoutMillis(DEFAULT_CONNECTION_TIMEOUT_MILLIS)
        .ttlMillis(DEFAULT_TTL_MILLIS);
  }
1225891
private Optional<ExecutableElement> builderMaker(
      Map<String, ExecutableElement> barNoArgMethods, TypeElement barBuilderTypeElement) {
    for (String builderMethodName : BUILDER_METHOD_NAMES) {
      ExecutableElement method = barNoArgMethods.get(builderMethodName);
      if (method != null
          && method.getModifiers().contains(Modifier.STATIC)
          && typeUtils.isSameType(
              typeUtils.erasure(method.getReturnType()),
              typeUtils.erasure(barBuilderTypeElement.asType()))) {
        // TODO(emcmanus): check visibility. We don't want to require public for @AutoValue
        // builders. By not checking visibility we risk accepting something as a builder maker
        // and then failing when the generated code tries to call Bar.builder(). But the risk
        // seems small.
        return Optional.of(method);
      }
    }
    return ElementFilter.constructorsIn(barBuilderTypeElement.getEnclosedElements())
        .stream()
        .filter(c -> c.getParameters().isEmpty())
        .filter(c -> c.getModifiers().contains(Modifier.PUBLIC))
        .findFirst();
  }
1368378
@Nonnull
	public <V extends T> LTernaryOperatorBuilder<T> casesOf(Class<V> argC1, Class<V> argC2, Class<V> argC3, Consumer<LTernaryOperatorBuilder<V>> pcpConsumer) {
		PartialCaseWithProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)) && (argC3 == null || argC3.isInstance(a3)));

		pc.specifySubCases((Consumer) pcpConsumer);
		return self();
	}
226377
public static MethodBuilder getInstance(Context context,
            ClassDoc classDoc, MethodWriter writer) {
        return new MethodBuilder(context, classDoc, writer);
    }
1090203
def build(self, builder):
        
        builder.start(self.__class__.__name__)
        builder.data(self.country_code)
        builder.end(self.__class__.__name__)