Vel factory function
331155
def create(game, normalize_returns=False, settings=None, presets=None):
    
    return MujocoEnv(
        envname=game,
        normalize_returns=normalize_returns,
        settings=settings,
        presets=presets
    )
137855
def factory(token, alg=''):
    

    _jw = JWS(alg=alg)
    if _jw.is_jws(token):
        return _jw
    else:
        return None
1332739
function createBufferInfoFunc(fn) {
  return function(gl) {
    const arrays = fn.apply(null,  Array.prototype.slice.call(arguments, 1));
    return attributes.createBufferInfoFromArrays(gl, arrays);
  };
}
1271713
def create(model_config, model, vec_env, storage, fps=30.0, sample_args=None):
    
    return EnjoyCommand(
        model_config, model, vec_env, storage, float(fps), sample_args
    )
649773
function buildVerror(code, stdOut, stdErr) {
  return new VError({
    name: stdOut,
    info: {
      code: code,
      stdout: stdOut,
      stderr: stdErr
    }
  }, stdOut + stdErr);
}
1328902
def create(model_config, model, vec_env, storage, takes, parallel_envs, action_noise=None, sample_args=None):
    
    return EvaluateEnvCommand(
        model_config=model_config,
        model_factory=model,
        env_factory=vec_env,
        parallel_envs=parallel_envs,
        action_noise=action_noise,
        storage=storage,
        takes=takes,
        sample_args=sample_args
    )
323166
function recreateFactory (name, dependencies, create) {
  const f = factory(name, dependencies, create)
  f.recreateOnConfigChange = true
  return f
}
884050
function createFactory(descriptor) {
  return function Stamp(options = {}, ...args) {
    // The 'methods' metadata object becomes the prototype for new object instances.
    const instance = Object.create(descriptor.methods || {});

    // Deep merge, then override with shallow merged properties, then apply property descriptors.
    merge(instance, descriptor.deepProperties);
    assign(instance, descriptor.properties);
    Object.defineProperties(instance, descriptor.propertyDescriptors || {});

    // Run initializers sequentially.
    return (descriptor.initializers || [])
      .filter(isFunction)
      .reduce((resultingInstance, initializer) => {
        // Invoke an initializer in the way specification tell us to.
        const returnedValue = initializer.call(
          // 'this' context will be the object instance itself
          resultingInstance,
          // the first argument passed from factory to initializer
          options,
          // special arguments. See specification.
          {instance: resultingInstance, stamp: Stamp, args: [options].concat(args)}
        );

        // Any initializer can override the object instance with basically anything.
        return returnedValue === undefined ? resultingInstance : returnedValue;
      }, instance);
  };
}
1263618
def generate(self, step, params):
        
        subfactory = self.get_factory()
        logger.debug(
            "SubFactory: Instantiating %s.%s(%s), create=%r",
            subfactory.__module__, subfactory.__name__,
            utils.log_pprint(kwargs=params),
            step,
        )
        force_sequence = step.sequence if self.FORCE_SEQUENCE else None
        return step.recurse(subfactory, params, force_sequence=force_sequence)
1370593
def create(buffer_capacity: int, buffer_initial_size: int, priority_exponent: float, priority_weight: Schedule,
           priority_epsilon: float, frame_stack_compensation: bool = False, frame_history: int = 1):
    
    return PrioritizedCircularVecEnvBufferBackendFactory(
        buffer_capacity=buffer_capacity,
        buffer_initial_size=buffer_initial_size,
        priority_exponent=priority_exponent,
        priority_weight=priority_weight,
        priority_epsilon=priority_epsilon,
        frame_stack_compensation=frame_stack_compensation,
        frame_history=frame_history
    )
997453
def create(input_block: ModelFactory, rnn_type: str, hidden_layers: typing.List[int],
           output_dim: int, dropout=0.0):
    
    def instantiate(**_):
        return MultilayerRnnSequenceModel(
            input_block.instantiate(), rnn_type=rnn_type, hidden_layers=hidden_layers, output_dim=output_dim, dropout=dropout
        )

    return ModelFactory.generic(instantiate)
750465
function createFactory(type) {
    const ret = createElement.bind(null, type);
    ret.type = type;

    return ret;
}
755730
function SlicesFactory(width, height, lineXArray, lineYArray, options) {
  checkArgs.apply(null, arguments);

  var slices;

  if (options) {
    slices = new Slices(width, height, lineXArray, lineYArray, options);
  } else {
    slices = new Slices(width, height, lineXArray, lineYArray);
  }

  return slices.slice();
}
831809
def factory(self, data, manager=None):
        

        # Make the syntax a little nicer for common cases.
        if isinstance(data, dict) and len(data) == 1 and 'type' not in data:
            op = list(data.keys())[0]
            if op == 'or':
                return Or(data, self, manager)
            elif op == 'and':
                return And(data, self, manager)
            elif op == 'not':
                return Not(data, self, manager)
            return ValueFilter(data, manager)
        if isinstance(data, six.string_types):
            filter_type = data
            data = {'type': data}
        else:
            filter_type = data.get('type')
        if not filter_type:
            raise PolicyValidationError(
                "%s Invalid Filter %s" % (
                    self.plugin_type, data))
        filter_class = self.get(filter_type)
        if filter_class is not None:
            return filter_class(data, manager)
        else:
            raise PolicyValidationError(
                "%s Invalid filter type %s" % (
                    self.plugin_type, data))
1048089
function(vec2, returnNew) {
      var x,y;
      if ('number' !== typeof vec2) { //.x !== undef) {
        x = vec2.x;
        y = vec2.y;

      // Handle incoming scalars
      } else {
        x = y = vec2;
      }

      if (!returnNew) {
        return this.set(this.x * x, this.y * y);
      } else {
        return new Vec2(
          this.x * x,
          this.y * y
        );
      }
    }
584913
def _factory(cls, constraints, op):
        
        pieces = []
        for i, constraint in enumerate(constraints):
            pieces.append(constraint)
            if i != len(constraints) - 1:
                pieces.append(op)
        return cls(pieces)
955645
function factory(BaseClass, mapFunction) {
  function subject(value) {
    if (typeof mapFunction === 'function') {
      value = mapFunction.apply(undefined, arguments);
    } else if (typeof mapFunction !== 'undefined') {
      value = mapFunction;
    }
    subject.onNext(value);
    return value;
  }
  
  for (var key in BaseClass.prototype) {
    subject[key] = BaseClass.prototype[key];
  }

  BaseClass.apply(subject, [].slice.call(arguments, 2));

  return subject;
}