Registers output driver
@param {Function} Driver Damson driver constructor
@param {string} name Damson driver name
@param {object} options Damson driver options
427959
function registerDriver(Driver, name, options) {
  if (this.drivers[name]) {
    log.error(new Error('Driver "' + name + '" is already registered.'));
    return;
  }
  if (!Driver || !Driver.prototype || typeof Driver.prototype.send !== 'function') {
    log.error(new Error('Driver "' + name + '" should implement "send" method.'));
    return;
  }
  this.drivers[name] = new Driver(options || {});
}
1224237
function(driver) {
                this.driver = driver;

                return function(id) {
                    driver.config.set(corbel.Domain.CUSTOM_DOMAIN, id);

                    return driver;
                };
            }
956047
function(name, options) {
			if (arguments.length == 2)
				return createProfile(name, options);
			else
				// create profile object only
				return new OutputProfile(utils.defaults(name || {}, defaultProfile));
		}
324222
public function register( $name, $controller, array $options = [] )
	{
		if ( isset( $options['parameters'] ) && !isset( $this->parameters ) )
			$this->parameters = $options['parameters'];

		// If the resource name contains a slash, we will assume the developer wishes to
		// register these resource routes with a prefix so we will set that up out of
		// the box so they don't have to mess with it. Otherwise, we will continue.
		if ( Str::contains( $name, '/' ) )
		{
			$this->prefixedResource( $name, $controller, $options );

			return;
		}

		// We need to extract the base resource from the resource name. Nested resources
		// are supported in the framework, but we need to know what name to use for a
		// place-holder on the route parameters, which should be the base resources.
		$base = $this->getResourceWildcard( last( explode( '.', $name ) ) );

		$defaults = $this->resourceDefaults;

		foreach ( $this->getResourceMethods( $defaults, $options ) as $m )
			$this->{'addResource' . ucfirst( $m )}( $name, $base, $controller, $options );
	}
430856
def get_driver_script(name, name2=None):  # noqa: E501
    
    response = errorIfUnauthorized(role='user')
    if response:
        return response
    else:
        response = ApitaxResponse()

    print(name)
    print(name2)


    driver: Driver = LoadedDrivers.getDriver(name2)

    response.body.add({'content': driver.getDriverScript(name)})

    return Response(status=200, body=response.getResponseBody())
665020
protected function registerClientOptions($name, $id)
    {
        if ($this->clientOptions !== false) {
            $options = empty($this->clientOptions) ? '' : Json::htmlEncode($this->clientOptions);
            $js = "jQuery('#$id').$name($options);";
            $this->getView()->registerJs($js);
        }
    }
270153
function register(server, options, next) {
	Schema.validate(options, function (error, config) {
		if (error) {
			next(error);
		} else {
			let methodsAsync = {};
			const dirs = config.methods;
			_.each(dirs, (dir) => {
				const relativePath = path.relative(__dirname, process.cwd() + '/' + dir);
				importDirectory(module, relativePath, {
					visit: function (obj) {
						if (!_.isUndefined(obj)) {
							let methods = _.isArray(obj) ? obj : [obj]; 
							_.each(methods, (method) => {
								if (_.isObject(method) && _.isFunction(method.method)) {
									const instance = _.clone(method);
									// store the oringial method
									const asyncMethod = method.method;
									// convert async function to normal thunky function
									instance.method = function (...args) {
										// the handler after function is called
										const after = args[args.length - 1];
										// call the async method, since asyn function return promise, use then and catch to handle result and error by handler
										asyncMethod.apply(this, args).then((result) => after(null, result)).catch((err) => after(err));
									};
									server.method(instance);
								}
							});
						}
					}
				});
			});
			_.each(server.methods, (method, name) => {
				methodsAsync[name] = function (...args) {
					// async function is a function return promise
					// convert back the async function
					return new Promise((resolve, reject) => {
						// call the thunky function
						server.methods[name].apply(server.methods, args.concat([(err, result) => {
							// reject if error exists, resolve if error not exists
							if (err) {
								reject(err);
							} else {
								resolve(result);
							}
						}]));
					});
				};
				// drop cache should also support async
				if (method.cache) {
					methodsAsync[name].cache = Promise.promisifyAll(method.cache);
				}
			});
			server.decorate('server', config.name, methodsAsync);
			next();
		}
	});
}
688020
function registerModel(name, model) {
        var proto = object(color);
        var fields = []; // used for cloning and generating accessors

        var to_meth = 'to' + capitalise(name);

        function convertAndApply(meth) {
            return function() {
                return meth.apply(this[to_meth](), arguments);
            };
        }

        for (var key in model)
            if (model.hasOwnProperty(key)) {
                proto[key] = model[key];
                var prop = proto[key];

                if (key.slice(0, 1) == '_') {
                    continue;
                }
                if (!(key in color) && "function" == typeof prop) {
                    // the method found on this object is a) public and b) not
                    // currently supported by the color object. Create an impl that
                    // calls the toModel function and passes that new object
                    // onto the correct method with the args.
                    color[key] = convertAndApply(prop);
                } else if ("function" != typeof prop) {
                    // we have found a public property. create accessor methods
                    // and bind them up correctly
                    fields.push(key);
                    var getter = 'get' + capitalise(key);
                    var setter = 'set' + capitalise(key);

                    color[getter] = convertAndApply(
                        proto[getter] = (function(key) {
                            return function() {
                                return this[key];
                            };
                        })(key)
                    );

                    color[setter] = convertAndApply(
                        proto[setter] = (function(key) {
                            return function(val) {
                                var cloned = this.clone();
                                cloned[key] = val;
                                return cloned;
                            };
                        })(key)
                    );
                }
            } // end of for over model

            // a method to create a new object - largely so prototype chains dont
            // get insane. This uses an unrolled 'object' so that F is cached
            // for later use. this is approx a 25% speed improvement

        function F() {}
        F.prototype = proto;

        function factory() {
            return new F();
        }
        factories[name] = factory;

        proto.clone = function() {
            var cloned = factory();
            for (var i = 0, j = fields.length; i < j; i++) {
                var key = fields[i];
                cloned[key] = this[key];
            }
            return cloned;
        };

        color[to_meth] = function() {
            return factory();
        };

        registered_models.push(proto);

        return proto;
    }
830435
private function registerCommand(
        $name, $data, \Console_CommandLine_Command $parent = null)
    {
        $command = isset($data['command']) ? $data['command'] : $data;
        if (null === $parent) {
            $cmd = $this->addCommand($name, $command);
        } else {
            $cmd = $parent->addCommand($name, $command);
        }
        // command arguments
        $args = isset($command['arguments']) ? $command['arguments'] : array();
        foreach ($args as $name => $argument) {
            $cmd->addArgument($name, $argument);
        }
        // command options
        $opts = isset($command['options']) ? $command['options'] : array();
        foreach ($opts as $name => $option) {
            $cmd->addOption($name, $option);
        }
        // commands actions (sub-commands)
        $subs = isset($command['commands']) ? $command['commands'] : array();
        foreach ($subs as $name => $data) {
            $this->registerCommand($name, $data, $cmd);
        }
    }
431121
public static function register($name, $path, $controller, $methods=null, $restrictTo=null, $defaultResponse, $options=array()) {
		if( $methods && !is_array($methods) ) {
			$methods = array($methods);
		}
		foreach( static::$knownMethods as $method ) {
			if( (!$methods && !empty(static::$routes[$name][$method])) || ($methods && !in_array($method, $methods)) ) {
				continue;
			}
			static::$routes[$name][$method] = new static($name, $path, $controller, $method, $restrictTo, $defaultResponse, $options);
		}
	}
492463
def registered(self, driver, frameworkId, masterInfo):
        
        log.debug("Registered with framework ID %s", frameworkId.value)
        # Save the framework ID
        self.frameworkId = frameworkId.value
666505
function(name,options) {
    var cls = new Class(name,options);
    cls = cls.toFunction();
    return new cls();
  }
1205721
function setupDebug (driver, options) {
  var indentation = 0;

  function stringFill (filler, length) {
    var buffer = new Buffer(length);
    buffer.fill(filler);
    return buffer.toString();
  }

  function getIndentation (add) {
    return stringFill(' ', (indentation + add) * 2);
  }

  if (options.debug) {
    if (options.httpDebug) {
      driver.on('request', function (req) {
        console.log(getIndentation(1) + "Request:  ", JSON.stringify(req).substr(0, 5000));
      });
      driver.on('response', function (res) {
        console.log(getIndentation(1) + "Response: ", JSON.stringify(res).substr(0, 5000));
      });
    }
    driver.on('method-call', function (event) {
      var msg = event.target;
      indentation = event.indentation;
      if (event.selector) {
        msg += '(' + util.inspect(event.selector, {colors: true}) + ')';
      }
      msg += '.' + event.name;
      msg += '(' + event.args.map(function (a) {
        return util.inspect(a, {colors: true});
      }).join(', ') + ')';
      if (event.result && typeof event.result !== 'object') {
        msg += ' => ' + util.inspect(event.result, {colors: true});
      }
      console.log(getIndentation(0) + '[' + (event.state + stringFill(' ', 5)).substr(0, 5) + '] ' + msg);
      if (event.state.toLowerCase() !== 'start') {
        console.log(getIndentation(0) + stringFill('-', 50));
      }
    });
  }
}
610178
public void setDriver(Driver driver) {
    this.driver = driver;
    try {
      DriverManager.registerDriver(driver);
    } catch (SQLException e) {
      throw new GenException(Message.DOMAGEN9001, e, e);
    }
  }
141395
function configure(name, service) {
	if (!name) {
		throw new Error('Please specify a name for the client');
	}
	if (name === 'configure' || name === 'client') {
		throw new Error('Cannot register service with reserved name: ' + name);
	}
	module.exports[name] = new Client(service);
}
70250
public function setDriver($name)
    {
        $class = '\\Samurai\\Onikiri\\Driver\\' . ucfirst($name) . 'Driver';
        if (! class_exists($class)) throw new \InvalidArgumentException("No such driver. -> {$name}");
        
        $driver = new $class();
        $this->driver = $driver;
    }
1238471
function Builder( name, isNode, outputPath ) {
	this.gypObject = emptySkeliton;
	this.isNode = isNode || false;		// Default to non-node configs
	this.name = name || "binding";		// Default our name to binding for node.js
	this.outputPath = outputPath || process.cwd() + "/" + this.name + "/";
}