Adds a transformer to _transformers if not already existing
        
        Args
        ----
        transformer : StationDing0
            Description #TODO
553691
def add_transformer(self, transformer):
        
        if transformer not in self.transformers() and isinstance(transformer, TransformerDing0):
            self._transformers.append(transformer)
435873
def set_helper(self, helper):
        
        # We don't want to "unset" in this method.
        if helper is None:
            return

        # Get the right kind of helper if given a DockerHelper
        if isinstance(helper, DockerHelper):
            helper = helper._helper_for_model(self.__model_type__)

        # We already have this one.
        if helper is self._helper:
            return
        if self._helper is None:
            self._helper = helper
        else:
            raise RuntimeError('Cannot replace existing helper.')
1268003
def _transform(self, *transforms):
        
        sequence = None
        for transform in transforms:
            if sequence:
                sequence = Sequence(sequence, transform=transform)
            else:
                sequence = Sequence(self, transform=transform)
        return sequence
511898
public function addTransformer(TransformerInterface $transformer, string $key = "", string $prefix = NULL) {
        if(!in_array($transformer, $this->transformers)) {
            $id = $prefix ? "$prefix.$key" : $key;
            $this->transformers[$id][] = $transformer;
        }
    }
1288689
def add_model(refwcs, newcoeffs):
    
    # Update refwcs with distortion model
    for kw in model_attrs:
        if newcoeffs.__dict__[key] is not None:
            refwcs.__dict__[key] = newcoeffs.__dict__[key]
606236
def add_action_to(cls, parser, action, subactions, level):
        
        p = parser.add_parser(action.name,
                              description=action.description,
                              argument_default=argparse.SUPPRESS)
        for arg in action.args:
            arg.add_argument_to(p)

        if subactions:
            subparsers = cls._add_subparsers_required(p,
                dest=settings.SUBASSISTANT_N_STRING.format(level),
                title=cls.subactions_str,
                description=cls.subactions_desc)
            for subact, subsubacts in sorted(subactions.items(), key=lambda x: x[0].name):
                cls.add_action_to(subparsers, subact, subsubacts, level + 1)
325940
def serialize_to_bundle(self, transformer, path, model_name, serialize_node=True):
        

        # Define attributes
        attributes = list()
        attributes.append(('num_features', transformer.n_features_))
        if isinstance(transformer, DecisionTreeClassifier):
            attributes.append(('num_classes', int(transformer.n_classes_)))

        inputs = []
        outputs = []
        if serialize_node:
            # define node inputs and outputs
            inputs = [{
                      "name": transformer.input_features,
                      "port": "features"
                    }]

            outputs = [{
                      "name": transformer.prediction_column,
                      "port": "prediction"
                    }]

        self.serialize(transformer, path, model_name, attributes, inputs, outputs, node=serialize_node)

        # Serialize tree.json
        tree_path = "{}/{}.node/tree.json".format(path, model_name)
        if not serialize_node:
            tree_path = "{}/{}/tree.json".format(path, model_name)
        with open(tree_path, 'w') as outfile:
            self.serialize_tree(transformer, transformer.feature_names, outfile)
847050
def add_generator(self, generator):
        
        if generator not in self._generators and isinstance(generator,
                                                            GeneratorDing0):
            self._generators.append(generator)
            self.graph_add_node(generator)
28930
function getTransformer(name, clientPlugin, pluginOptions) {

    // if in cache, just return it
    if (cache[name]) { return cache[name]; }

    var transformers = clientPlugin.transformers;
    var templateDir = clientPlugin.templateDir;

    // if no transformer, throw error
    if (!transformers[name]) { throw new Error('No transformer called ' + name); }

    // generate all the transformers
    _.each(transformers, function (transformer, transformerName) {
        cache[transformerName] = generateTransformer(transformerName, transformer, templateDir, pluginOptions);
    });

    // return the specific one that was requested
    return cache[name];
}
534962
public void setPresetTransformer(String transformerName){
        for(Transformer t : Transformer.values()){
            if(t.equals(transformerName)){
                setPresetTransformer(t);
                return;
            }
        }
    }
1257959
public void addConverter(Converter<?, ?> converter) {
		GenericConverter.ConvertiblePair typeInfo = getRequiredTypeInfo(converter, Converter.class);
		Assert.notNull(typeInfo, "Unable to the determine sourceType <S> and targetType " +
				"<T> which your Converter<S, T> converts between; declare these generic types.");
		addConverter(new ConverterAdapter(converter, typeInfo));
	}
493832
function transformer (selection) {
    const type = quantum.isSelection(selection) ? selection.type() : undefined
    const entityTransform = transformMap[type] || defaultTransform
    return entityTransform(selection, transformer, meta) // bootstrap to itself to  make the transformer accessible to children
  }
1137686
def add(self, *args, **kwargs):
        
        return self._apply(operator.add, *args, **kwargs)
35066
def add_output(self, out_name, type_or_serialize=None, **kwargs):
        
        if out_name not in self.engine.all_outputs():
            raise ValueError("'%s' is not generated by the engine %s" % (out_name, self.engine.all_outputs()))
        if type_or_serialize is None:
            type_or_serialize = GenericType()
        if not isinstance(type_or_serialize, GenericType) and callable(type_or_serialize):
            type_or_serialize = GenericType(serialize=type_or_serialize)
        elif not isinstance(type_or_serialize, GenericType):
            raise ValueError("the given 'type_or_serialize' is invalid")
        # register outpurs
        self._outputs[out_name] = {
            'serializer': type_or_serialize,
            'parameters': kwargs if kwargs else {}
        }
524470
def add(self, operator):
        '''
        '''
        if not isinstance(operator, Scope):
            raise ParameterError('Operator {} must be a TaskTransformer '
                                 'or FeatureExtractor'.format(operator))
        for key in operator.fields:
            self._time[key] = []
            # We add 1 to the dimension here to account for batching
            for tdim, idx in enumerate(operator.fields[key].shape, 1):
                if idx is None:
                    self._time[key].append(tdim)
1226068
public void registerTransformer(Class<?> keyClass, Class<? extends Transformer> transformerClass) {
      transformerTypes.put(keyClass, transformerClass);
   }
403792
public static void addAttributes(SerializationHandler handler, int src)
        throws TransformerException
    {

        TransformerImpl transformer =
            (TransformerImpl) handler.getTransformer();
        DTM dtm = transformer.getXPathContext().getDTM(src);

        for (int node = dtm.getFirstAttribute(src);
            DTM.NULL != node;
            node = dtm.getNextAttribute(node))
        {
            addAttribute(handler, node);
        }
    }