TODO: Move to separate module
423463
@VisibleForTesting
	public static boolean isValid(String nip) {
		String normalizedNip = normalizeNip(nip);
		if (normalizedNip.length() != NIP_LENGTH) {
			return false;
		}
		try {
			int checksum = calculateChecksum(normalizedNip);
			return checksum == normalizedNip.charAt(CHECKSUM_CHAR_INDEX) - '0';
		} catch (NumberFormatException e) {
			LOG.debug(format("Invalid nip %s", nip), e);
			return false;
		}
	}
973404
def separate(self):
        '''

        '''
        collections = []
        start = None
        end = None

        for index in self.indexes:
            if start is None:
                start = index
                end = start
                continue

            if index != (end + 1):
                collections.append(
                    Collection(self.head, self.tail, self.padding,
                               indexes=set(range(start, end + 1)))
                )
                start = index

            end = index

        if start is None:
            collections.append(
                Collection(self.head, self.tail, self.padding)
            )
        else:
            collections.append(
                Collection(self.head, self.tail, self.padding,
                           indexes=range(start, end + 1))
            )

        return collections
814031
function(parentModule, kbox, id, app, callback) {

  if (typeof callback === 'undefined' && typeof app === 'function') {
    callback = app;
    app = undefined;
  }

  // Try to load module from node_module directories.
  return requireFromNodeModules(parentModule, id)
  // If module was not found in node_module directories, try to load
  // from other directories.
  .then(function(mod) {
    if (mod) {
      return mod;
    } else {
      return requireFromOtherDirs(kbox, id, app);
    }
  })
  // Return.
  .nodeify(callback);

}
981771
function move(root, nextTag, isVirtual) {
      if (isVirtual)
        { moveVirtual.apply(this, [root, nextTag]); }
      else
        { safeInsert(root, this.root, nextTag.root); }
    }
13451
function onEnter(
    event: *,
    change: Change,
    editor: *,
    opts: Options
): void | any {
    // Pressing Shift+Enter
    // should split block normally
    if (event.shiftKey) {
        return undefined;
    }

    const { value } = change;
    const currentItem = getCurrentItem(opts, value);

    // Not in a list
    if (!currentItem) {
        return undefined;
    }

    event.preventDefault();

    // If expanded, delete first.
    if (value.isExpanded) {
        change.delete();
    }

    if (currentItem.isEmpty) {
        // Block is empty, we exit the list
        if (getItemDepth(opts, value) > 1) {
            return decreaseItemDepth(opts, change);
        }
        // Exit list
        return unwrapList(opts, change);
    }
    // Split list item
    return splitListItem(opts, change);
}
1148249
function initModule(forge) {

forge.mgf = forge.mgf || {};
forge.mgf.mgf1 = forge.mgf1;

}
1033032
function (module) {
        "use strict";
    
        this.push = function (styles, is) {
    
            // process css value
            var values = new Values(module);
            var resources = new Resources(module);
            styles = resources.process(styles);
            styles = values.process(styles);
    
            // append styles into the DOM
            var code = '';
            code += '<style module="' + module.ID + '"';
            code += is ? ' is="' + is + '"' : '';
            code += '>' + styles + '</style>';
    
            $('head').append(code);
    
        };
    
    }
618259
public void unloadModule(Module module) {
        Objects.requireNonNull(module, "module");
        unloadModuleLocal(module);
        moduleSpecs.remove(module.getIdentifier());
    }
728281
function moveETP2End(config) {
    if (!ExtractTextPlugin) return

    const etps = config.plugins.filter(val => val instanceof ExtractTextPlugin)

    _.chain(config.plugins)
        .pullAll(etps)
        .push(...etps)
        .value()
}
547832
function View_setModulesViewsPath(dir) {
            var list, name, moduleToLoad, LoadedModule, moduleInstance;
            if (this.isDir(dir)) {
                list = this.readDir(dir);
                while (true) {
                    name = list.shift();

                    if (!name) {
                        break;
                    }

                    moduleToLoad = dir + '/' + name;

                    try {
                        LoadedModule = di.load(moduleToLoad);
                    } catch (e) {
                        throw new error.HttpError(500, {path: moduleToLoad}, 'Missing module', e);
                    }

                    if (!Type.assert(Type.FUNCTION, LoadedModule)) {
                        throw new error.HttpError(500, {path: moduleToLoad}, 'Module must be function type');
                    }

                    moduleInstance = new LoadedModule(name);

                    if (!(moduleInstance instanceof ModuleInterface)) {
                        throw new error.HttpError(500, moduleInstance, 'Module must be instance of ModuleInterface "core/module"');
                    }

                    this.normalizers.push(moduleInstance.getViewsPath());

                    this.config.themes.forEach(function (name) {
                        this.paths.push(moduleInstance.getViewsPath() + name + '/');
                    }.bind(this));
                }

            }
        }
290893
function skipModule(excludedModules) {
	return {
		name: 'skipModule',
		transform: function (src, modulePath) {
			const moduleRelativePath = path.relative(path.join(__dirname, 'src'), modulePath).split(path.sep).join('/');
			const isModuleExcluded = excludedModules.indexOf(moduleRelativePath) > -1;

			const source = new MagicString(src);
			const sourceLength = src.length;

			const transformCode = isModuleExcluded ? source.overwrite(0, sourceLength, 'export default null;'): source;
			const transformMap = transformCode.generateMap({ hires: true });

			return { code: transformCode.toString(), map: transformMap.toString() };
		}
	};
}
1118080
def do_mv(self, from_path, to_path, nothing = ''):
        """"""
        self.n.doMove(self.current_path + from_path,
                      self.current_path + to_path)
372616
def module_to_path(mod, base=nil)
      path = mod.gsub(/\./, ::File::SEPARATOR) + '.py'
      path = ::File.join(base, path) if base
      path
    end
19186
function Move(from, to, element/*(optional)*/) {
  this.from = from
  this.to = to
  this.element = element
  this.type = 'Move'
}
1199276
function watchModule (module, modulesDir) {

    const pathToModule = resolve(modulesDir, module);
    const pathToHandlers = resolve(HANDLER_BASE, module);


    modules[module] = {
        handlers: []
    };
    fs.readdir(pathToHandlers, (err, files) => {

        if (err) {
            return console.log(new Error('Failed to get handler files for module: ' + module));
        }

        files.forEach(file => {

            if (file.length < 3 || file.indexOf('bundle.') === 0 || file.substr(file.length - 3) !== '.js') {
                return;
            }

            modules[module].handlers.push(pathToHandlers + '/' + file);
        });

        let watchList = modules[module].handlers.concat([pathToModule]);
        let watcher = chokidar.watch(watchList, {
            ignored: /(^|[\/\\])\../,
            persistent: true
        });
        watcher.on('change', (path, stats) => {

            // rebundle based on the type of the file
            if (modules[module].handlers.indexOf(path) < 0) {
                modules[module].handlers.forEach(handler => bundleHandler(pathToHandlers, module, handler.substr(handler.lastIndexOf('/') + 1)));
            } else {
                bundleHandler(pathToHandlers, module, path.substr(path.lastIndexOf('/') + 1));
            }
        });
    });
}
541589
def map_from_module(self, module):
        
        maps = {}
        for name in dir(module):
            obj = getattr(module, name)
            try:
                if issubclass(obj, exceptions.HTTPException):
                    maps[name] = obj
            except TypeError as ter:
                pass
        self.mapping.update(maps)
1060792
function(parentModule, kbox, id, app, callback) {

  if (typeof callback === 'undefined' && typeof app === 'function') {
    callback = app;
    app = undefined;
  }

  // Try to load module from node_modules and other directories.
  var parts = id.split('@');
  var pkg = parts[0];
  //var ver = parts[1];

  // Try to load module.
  return requireFromNodeModulesAndOtherDirs(parentModule, kbox, pkg, app)
  // Return.
  .nodeify(callback);

}