Returns a path to an extension module.

@param {!module} module Module provided by RequireJS
@param {?string} path Relative path from the extension folder to a file
@return {!string} The path to the module's folder
489504
function getModulePath(module, path) {
        var modulePath = module.uri.substr(0, module.uri.lastIndexOf("/") + 1);
        if (path) {
            modulePath += path;
        }

        return modulePath;
    }
65321
def get_path(*args, module=a99):
    

    p = os.path.abspath(os.path.join(os.path.split(module.__file__)[0], *args))
    return p
828686
def relative_path path
      require 'pathname'

      full_path = Pathname.new(path).realpath             # /full/path/to/project/where/is/file.extension
      base_path = Pathname.new(source_directory).realpath # /full/path/to/project/

      full_path.relative_path_from(base_path).to_s        # where/is/file.extension
    end
943647
function (filePath) {
        var name = ES6ModuleFile.prototype.getModuleName.apply(this, arguments);

        if (_.isFunction(this.opts.moduleName)) {
            name = this.opts.moduleName(name, filePath);
        }

        return name;
    }
820783
def get_module_path(exc_type):
    
    module = inspect.getmodule(exc_type)
    return "{}.{}".format(module.__name__, exc_type.__name__)
308805
function getModuleUrl(module, path) {
        var url = encodeURI(getModulePath(module, path));

        // On Windows, $.get() fails if the url is a full pathname. To work around this,
        // prepend "file:///". On the Mac, $.get() works fine if the url is a full pathname,
        // but *doesn't* work if it is prepended with "file://". Go figure.
        // However, the prefix "file://localhost" does work.
        if (brackets.platform === "win" && url.indexOf(":") !== -1) {
            url = "file:///" + url;
        }

        return url;
    }
823232
function adaptModulePath(modulePath, state) {
  // const fileName = state.file.opts.filename;
  const options = getStateOptions(state);
  const filesMap = createFilesMap(options);
  const rootPath = getRootPath(options);

  let module = determineContext(modulePath, options);

  // Do not generate infinite cyrcular references on empty nodes
  if (!module.file) {
    return null;
  }

  // Safeguard against circular calls
  if (lastIn === lastOut) {
    return null;
  }

  // Remove relative path prefix before replace
  const absoluteModule = path.isAbsolute(module.file);

  // Try to replace aliased module
  let found = false;
  let constantModulePart;
  filesMap.keys.filter((k) => {
    const d = filesMap.contents[k];
    let idx = module.file.search(d.regexp);

    if (!found && idx > -1) {
      // throw `Found ${d} in ${module.file}`
      // constantModulePart = module.file.slice(0, idx) || './';
      constantModulePart = './';

      if (module.file[idx] === '/') {
        idx += 1;
      }

      const value = d.value[0] === '.' && idx > 0 ? d.value.slice(2) : d.value;
      // const value = d.value;

      // Replace the alias with it's path and continue
      module.file = `${module.file.slice(0, idx) || ''}${value}${module.file.slice(idx + d.expose.length) || ''}`;
      found = true;


      // Revaluate npm and react flags based on the new mapping
      module = determineContext(module.file, options);

      return true;
    }

    return false;
  });

  // Leave NPM modules as resolved, do not remap and ignore wrongfully formatted strings of form require('npm:')
  if (module.npm) {
    return module.file || null;
  }

  // Do not touch direct requires to npm modules (non annotated)
  if (module.file.indexOf('./') !== 0 && module.file.indexOf('/') !== 0) {
    return null;
  }

  // Check if any substitution took place
  if (found) {
    // Module alias substituted
    if (!path.isAbsolute(module.file)) {
      if (!absoluteModule && module.file[0] !== '.') {
        // Add the relative notation back
        module.file = `./${module.file}`;
      }
    }
  }

  // Do not break node_modules required by name
  if (!found && module.file[0] !== '.') {
    if (reactOsFileInfer(options)) {
      const aux2 = mapForReact(module.file);

      if (aux2 !== module.file) {
        return aux2;
      }
    }

    return null;
  }

  // Enforce absolute paths on absolute mode
  if (rootPath) {
    if (!path.isAbsolute(module.file)) {
      module.file = path.join(rootPath, module.file);

      if (reactOsFileInfer(options)) {
        return mapForReact(module.file);
      }

      return module.file;
    }

    // After the node is replaced the visitor will be called again.
    // Without this condition these functions will generate a circular loop.
    return null;
  }

  // throw `Gets here: ${JSON.stringify(module.file)}`;

  // Do not bother with relative paths that are not aliased
  if (!found) {
    return null;
  }

  let moduleMapped = mapToRelative(module.file, constantModulePart, options);
  if (moduleMapped.indexOf('./') !== 0) {
    moduleMapped = `./${moduleMapped}`;
  }

  // throw JSON.stringify({
  //   moduleMapped, modulePath, module, constantModulePart
  // }, null, 2);
  return moduleMapped !== modulePath ? moduleMapped : null;
}
1083499
function subModulePath(subModule, node_modules) {
  var index = subModule.indexOf("/");
  var length = subModule.length;
  if (index <= 0 || index + 1 == length) {
    return null;
  }
  var module = subModule.substring(0, index);
  var relative = subModule.substring(index + 1, length);

  var moduleDirectory = path.join(node_modules, module);
  var filePath = path.join(moduleDirectory, relative);
  return realRequirPath(filePath);
}
1161130
function(techPath) {
        // Get absolute path if path starts with "."
        // NOTE: Can not replace check to !isAbsolute()
        if(techPath.substring(0, 1) === '.') {
            // Resolve relative path starting at level `.bem/` directory
            techPath = PATH.join(this.bemDir, techPath);

            /* jshint -W109 */
            if(!isRequireable(techPath)) {
                throw new Error("Tech module on path '" + techPath + "' not found");
            }
            /* jshint +W109 */

            return techPath;
        }

        // Trying absolute of relative-without-dot path
        if(isRequireable(techPath)) {
            return techPath;
        }


        /* jshint -W109 */
        try {
            return require.resolve('./' + PATH.join('./techs', techPath));
        } catch (err) {
            throw new Error("Tech module with path '" + techPath + "' not found on require search paths");
        }
        /* jshint +W109 */
    }
469295
def _load_module(path):
    ''

    module_name = os.path.splitext(os.path.basename(path))[0]

    module = None
    if sys.version_info.minor < 5:
        loader = importlib.machinery.SourceFileLoader(module_name, path)
        module = loader.load_module()
    else:
        spec = importlib.util.spec_from_file_location(module_name, path)
        module = importlib.util.module_from_spec(spec)
        spec.loader.exec_module(module)

    return module
472312
function(dir) {
    var dirParts = dir.split(path.sep);
    var nodeModules = dirParts.indexOf('node_modules');
    return path.join(dirParts[nodeModules], dirParts[nodeModules + 1], '**');
  }
538283
def modulePath(self):
        
        base_path = os.path.dirname(self.filepath())
        module_path = self.importPath()

        module_path = os.path.expanduser(os.path.expandvars(module_path))
        if module_path.startswith('.'):
            module_path = os.path.abspath(os.path.join(base_path, module_path))

        return module_path
59383
def file_extension(path):
    
    if path is None:
        return None
    ext = os.path.splitext(os.path.basename(path))[1]
    if ext.startswith("."):
        ext = ext[1:]
    return ext
1332907
function(filepath, req, res) {
    var path = require("path"),
        config = module.exports.config,
        result = false,
        parentdir;
    do {
        var defaultdir = path.resolve(path.join(config.responsesdefault, filepath));
        parentdir = path.resolve(path.join(config.responses, filepath));
        if (isValidDir(parentdir) && isValidFile(path.join(parentdir, "index.js"))) {
            //Parent module response handler exists.
            require(parentdir)(req, res);
            result = true;
        } else if (isValidDir(defaultdir) && isValidFile(path.join(defaultdir, "index.js"))) {
            //Default response handler
            require(defaultdir)(req, res);
            result = true;
        }
        if (filepath === path.sep) break;
        filepath = path.dirname(filepath);
    } while (result === false && parentdir !== filepath);
    return result;
}
562412
function addPath(path, name) {
		// This will add a path -> name mapping, so that paths may be later
		// resolved to module names, as well as a filesystem full path to
		// module mapping, in case the `paths` value contains relative paths
		// (e.g. `../`, see issue #2).
		var fullPath = (pathModule.normalize(pathModule.join(baseFullUrl,path)) + ".js").replace(/\\/g,"/");
		inversePaths[path] = name;
		inversePaths[fullPath] = name;
	}
890337
function getorigPath(filePath, base) {
    var extName = path.extname(filePath);
    var pt = path.resolve(base, filePath);
    if (!extName) pt += '.js';
    return pt;
}
1146672
function packageNameFromPath(path) {
  var matches = moduleRegex.exec(path);
  return matches && matches.length > 1 ? matches[1] : null;
}