Generates a module regarding the parameters.

@param name String
@param version String
@return Module
975347
public static Module createModule(final String name,final String version){
        final Module module = new Module();

        module.setName(name);
        module.setVersion(version);
        module.setPromoted(false);

        return module;

    }
1052417
function makeModulesGetHostnameProto(module, version, instance) {
  var getHostnameRequest = new apphosting.GetHostnameRequest();
  getHostnameRequest.setModule(module);
  getHostnameRequest.setVersion(version);
  getHostnameRequest.setInstance(instance);
  return getHostnameRequest;
}
211286
function (name, version) {
    if (!name || !_.isString(name)) {
      var err = new Error('Please pass a valid string as name!');
      debug(err);
      throw err;
    }

    version = version || 0;

    if (!_.isNumber(version)) {
      var err = new Error('Please pass a valid number as version!');
      debug(err);
      throw err;
    }

    var handler =  _.find(this.commandHandlers, function (cmdHnd) {
      return cmdHnd.name === name && cmdHnd.version === version;
    });

    if (handler) {
      return handler;
    }

    if (!this.getCommand(name, version)) {
      return null;
    }

    return this.defaultCommandHandler;
  }
1250694
public static function ModulePath($name)
    {
        // BC for a couple fo the key modules in the old syntax. Reduces merge brittleness but can
        // be removed before 4.0 stable
        $legacyMapping = [
            'framework' => 'silverstripe/framework',
            'frameworkadmin' => 'silverstripe/admin',
        ];
        if (isset($legacyMapping[$name])) {
            $name = $legacyMapping[$name];
        }

        return ModuleLoader::getModule($name)->getRelativePath();
    }
820806
public function install($version = null, array $options = array())
    {
        $module = $this->utils()->whichModule($this);
        if ($version === null) {
            $version = $this->utils()->getModuleVersion($module);
            
            if (!$version) {
                throw new MissingParameterException(
                    'Parameter version is missing and cannot be autodetected');
            }
        }
        
        return $this->utils()->install($module, $version, $options);
    }
1135624
protected String stripVersionFromName(String name, String version) {
        int versionBeginIndex = name.lastIndexOf("-" + version);
        if ( versionBeginIndex != -1) {
            return name.substring(0, versionBeginIndex) + name.substring(versionBeginIndex + version.length() + 1);
        } else {
            return name;
        }
    }
577276
def get_module(self, modulename, revision=None):
        """"""
        if revision is None and modulename in self.revs:
            (revision, _handle) = self._get_latest_rev(self.revs[modulename])
        if revision is not None:
            if (modulename,revision) in self.modules:
                return self.modules[(modulename, revision)]
        else:
            return None
1273441
public static Version copy(Version version) {
        if (version == null) {
            return null;
        }
        Version result = new Version();
        result.labels = new LinkedList<String>(version.labels);
        result.numbers = new LinkedList<Integer>(version.numbers);
        result.snapshot = version.snapshot;
        return result;
    }
69919
public static Plugin plugin(String groupId, String artifactId, String version) {
		Plugin plugin = new Plugin();
		plugin.setArtifactId(artifactId);
		plugin.setGroupId(groupId);
		plugin.setVersion(version);
		return plugin;
	}
630890
private static function generateVersion($namespace, $name, $version)
    {
        if (!self::isValid($namespace)) {
            return false;
        }

        $nhex = str_replace(array('-', '{', '}'), '', $namespace);
        $nstr = '';
        $len = strlen($nhex);

        for ($i = 0; $i < $len; $i += 2) {
            $nstr .= chr(hexdec($nhex[$i].$nhex[$i + 1]));
        }

        if ($version == 3) {
            $hash = md5($nstr.$name);
            $digit = 0x3000;
        } else {
            $hash = sha1($nstr.$name);
            $digit = 0x5000;
        }

        return sprintf('%08s-%04s-%04x-%04x-%12s',
            substr($hash, 0, 8),
            substr($hash, 8, 4),
            (hexdec(substr($hash, 12, 4)) & 0x0fff) | $digit,
            (hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,
            substr($hash, 20, 12)
        );
    }
405384
def get_module(author, name, version)
            file_name = "#{author}-#{name}-#{version}.tar.gz"
            path = File.join(File.expand_path(@module_dir.path), file_name)
            if File.exist? path
                File.open(path, 'r')
            else
                nil
            end
        end
799847
def get_annotation_url(module, version):
    
    module = module.strip('/')

    return '{module}/{name}'.format(
        module=get_annotation_module_url(module),
        name=get_annotation_file_name(module, version),
    )
95622
function createModule(filename) {
  const mod = new Module(filename)
  mod.filename = filename
  mod.paths = Module._nodeModulePaths(path.dirname(filename))
  return mod
}
565524
public ModuleDescriptor[] descriptors(String name) {
        ModuleDeps moduleDeps = modules.keySet().stream()
            .filter(m -> m.name().equals(name))
            .map(modules::get)
            .findFirst().get();

        ModuleDescriptor[] descriptors = new ModuleDescriptor[3];
        descriptors[0] = moduleDeps.root.descriptor();
        descriptors[1] = moduleDeps.descriptor();
        descriptors[2] = moduleDeps.reduced();
        return descriptors;
    }
185706
public void createPlugin(String id, String version) {
        descriptor = new GoPluginDescriptor(id, version, about, pluginJarFileLocation, pluginBundleLocation, isBundledPlugin);
    }
519435
public String transform(String name, Instrumentation types, String version) {
        StringBuilder builder = new StringBuilder();

        builder.append(types.isCompile() ? "COMPILE\r\n" : "NOCOMPILE\r\n");

        for (int ruleno = 0; ruleno < types.getRules().size(); ruleno++) {
            InstrumentRule r = types.getRules().get(ruleno);

            if (r.getClass() == JVM.class) {
                JVM rule = (JVM) r;

                // Check version
                if (!rule.isVersionValid(version)) {
                    continue;
                }

                builder.append("\r\n");

                builder.append("RULE ");
                builder.append(name);
                builder.append('(');
                builder.append(ruleno + 1);
                builder.append(") ");
                builder.append(rule.getRuleName());
                builder.append("\r\n");

                if (rule.getClassName() != null) {
                    builder.append("CLASS ");
                    builder.append(rule.getClassName());
                    builder.append("\r\n");
                } else if (rule.getInterfaceName() != null) {
                    builder.append("INTERFACE ");
                    builder.append(rule.getInterfaceName());
                    builder.append("\r\n");
                }

                builder.append("METHOD ");
                builder.append(rule.getMethodName());

                // Check if single parameter is "*", representing 'any' parameters
                if (rule.getParameterTypes().size() != 1 || !rule.getParameterTypes().get(0).equals("*")) {
                    builder.append('(');

                    for (int i = 0; i < rule.getParameterTypes().size(); i++) {
                        if (i > 0) {
                            builder.append(',');
                        }
                        builder.append(rule.getParameterTypes().get(i));
                    }

                    builder.append(')');
                }

                builder.append("\r\n");

                builder.append("HELPER ");
                if (rule.getHelper() == null) {
                    builder.append(RuleHelper.class.getName());
                } else {
                    builder.append(rule.getHelper());
                }
                builder.append("\r\n");

                builder.append("AT ");
                builder.append(rule.getLocation());
                builder.append("\r\n");

                if (rule.isCompile() != types.isCompile()) {
                    builder.append(rule.isCompile() ? "COMPILE\r\n" : "NOCOMPILE\r\n");
                }

                if (!rule.getBinds().isEmpty()) {
                    builder.append("BIND ");

                    for (int i = 0; i < rule.getBinds().size(); i++) {
                        InstrumentBind bind = rule.getBinds().get(i);
                        if (i > 0) {
                            builder.append("     ");
                        }
                        builder.append(bind.getName());
                        builder.append(" : ");
                        builder.append(bind.getType());
                        builder.append(" = ");
                        builder.append(bind.getExpression());
                        builder.append(";\r\n");
                    }
                }

                builder.append("IF ");
                if (rule.getCondition() == null) {
                    builder.append("TRUE");
                } else {
                    builder.append(rule.getCondition());
                }
                builder.append("\r\n");

                builder.append("DO\r\n");

                for (int i = 0; i < rule.getActions().size(); i++) {
                    InstrumentAction action = rule.getActions().get(i);

                    builder.append("  ");
                    InstrumentActionTransformer transformer = transformers.get(action.getClass());

                    if (transformer != null) {
                        builder.append(transformer.convertToRuleAction(rule.getActions().get(i)));
                        if (i < rule.getActions().size() - 1) {
                            builder.append(";");
                        }
                        builder.append("\r\n");
                    } else {
                        System.err.println("Transformer for action '" + action.getClass() + "' not found");
                    }
                }

                builder.append("ENDRULE\r\n\r\n");
            }
        }

        return builder.toString();
    }
289851
@MemberOrder(sequence = "2")
    public DevUtilsDemoObject create(
            @ParameterLayout(named="Name") final String name) {
        final DevUtilsDemoObject obj = container.newTransientInstance(DevUtilsDemoObject.class);
        obj.setName(name);
        container.persistIfNotAlready(obj);
        return obj;
    }