Parses call to Ext.Loader.setPath
189194
function parseLoaderSetPathCall(node, output) {
        // Example: `Ext.Loader.setPath('Ext.ux', 'lib/extjs-ux/src');`
        var classPrefixArg = node.expression.arguments[0];
        var pathArg = node.expression.arguments[1];
        if (classPrefixArg && pathArg) {
            addResolvePath(classPrefixArg.value, pathArg.value, output);
        }
    }
267595
function(basePath, output_extension, options, callback) {
		var self = this;
		var collected_contents = {};
		var content_options = {};
		var last_modified = null;

		// treat files with special output extensions
		if (output_extension !== ".html") {
			basePath = basePath + output_extension;
		}

		self.getContent(basePath, function(err, contents, modified_date) {
			if (!err) {
				collected_contents = _.extend(collected_contents, contents);
				last_modified = modified_date;

				var run_callback = function() {
					return callback(null, collected_contents, content_options, last_modified);
				};

				//fetch shared content
				self.getSharedContent(function(err, shared_content, shared_modified_date) {
					if (!err) {
						collected_contents = _.extend(shared_content, collected_contents);
						if (shared_modified_date > last_modified) {
							last_modified = shared_modified_date;
						}
					}

					return run_callback();
				});
			} else {
				return callback("[Error: Content for " + basePath + " not found]", null, null, {});
			}
		});
	}
804647
function (pathString, currentContext, debug) {
    try {
      var result = eval('currentContext.' + pathString);
      if (debug) {
        console.log("getPath result = ", result);
      }
      return result;
    } catch (e) {
      return null;
    }
  }
272559
function _parseInput (input, opts, cb) {
  if (isFileList(input)) input = Array.from(input)
  if (!Array.isArray(input)) input = [ input ]

  if (input.length === 0) throw new Error('invalid input type')

  input.forEach(item => {
    if (item == null) throw new Error(`invalid input type: ${item}`)
  })

  // In Electron, use the true file path
  input = input.map(item => {
    if (isBlob(item) && typeof item.path === 'string' && typeof fs.stat === 'function') return item.path
    return item
  })

  // If there's just one file, allow the name to be set by `opts.name`
  if (input.length === 1 && typeof input[0] !== 'string' && !input[0].name) input[0].name = opts.name

  let commonPrefix = null
  input.forEach((item, i) => {
    if (typeof item === 'string') {
      return
    }

    let path = item.fullPath || item.name
    if (!path) {
      path = `Unknown File ${i + 1}`
      item.unknownName = true
    }

    item.path = path.split('/')

    // Remove initial slash
    if (!item.path[0]) {
      item.path.shift()
    }

    if (item.path.length < 2) { // No real prefix
      commonPrefix = null
    } else if (i === 0 && input.length > 1) { // The first file has a prefix
      commonPrefix = item.path[0]
    } else if (item.path[0] !== commonPrefix) { // The prefix doesn't match
      commonPrefix = null
    }
  })

  // remove junk files
  input = input.filter(item => {
    if (typeof item === 'string') {
      return true
    }
    const filename = item.path[item.path.length - 1]
    return notHidden(filename) && junk.not(filename)
  })

  if (commonPrefix) {
    input.forEach(item => {
      const pathless = (Buffer.isBuffer(item) || isReadable(item)) && !item.path
      if (typeof item === 'string' || pathless) return
      item.path.shift()
    })
  }

  if (!opts.name && commonPrefix) {
    opts.name = commonPrefix
  }

  if (!opts.name) {
    // use first user-set file name
    input.some(item => {
      if (typeof item === 'string') {
        opts.name = corePath.basename(item)
        return true
      } else if (!item.unknownName) {
        opts.name = item.path[item.path.length - 1]
        return true
      }
    })
  }

  if (!opts.name) {
    opts.name = `Unnamed Torrent ${Date.now()}`
  }

  const numPaths = input.reduce((sum, item) => sum + Number(typeof item === 'string'), 0)

  let isSingleFileTorrent = (input.length === 1)

  if (input.length === 1 && typeof input[0] === 'string') {
    if (typeof fs.stat !== 'function') {
      throw new Error('filesystem paths do not work in the browser')
    }
    // If there's a single path, verify it's a file before deciding this is a single
    // file torrent
    isFile(input[0], (err, pathIsFile) => {
      if (err) return cb(err)
      isSingleFileTorrent = pathIsFile
      processInput()
    })
  } else {
    process.nextTick(() => {
      processInput()
    })
  }

  function processInput () {
    parallel(input.map(item => cb => {
      const file = {}

      if (isBlob(item)) {
        file.getStream = getBlobStream(item)
        file.length = item.size
      } else if (Buffer.isBuffer(item)) {
        file.getStream = getBufferStream(item)
        file.length = item.length
      } else if (isReadable(item)) {
        file.getStream = getStreamStream(item, file)
        file.length = 0
      } else if (typeof item === 'string') {
        if (typeof fs.stat !== 'function') {
          throw new Error('filesystem paths do not work in the browser')
        }
        const keepRoot = numPaths > 1 || isSingleFileTorrent
        getFiles(item, keepRoot, cb)
        return // early return!
      } else {
        throw new Error('invalid input type')
      }
      file.path = item.path
      cb(null, file)
    }), (err, files) => {
      if (err) return cb(err)
      files = flatten(files)
      cb(null, files, isSingleFileTorrent)
    })
  }
}
621361
function loadSpecification(defPath, data) {
  const resolvedPath = path.resolve(defPath);

  const extName = path.extname(resolvedPath);
  const loader = LOADERS[extName];

  // Check whether the definition file is actually a usable file
  if (loader === undefined) {
    throw new Error('Definition file should be .js, .json, .yml or .yaml');
  }

  const swaggerDefinition = loader(data, resolvedPath);
  return swaggerDefinition;
}
1043845
function loadAndParseFile(filename, settings) {
    	    Augmented.ajax({
        		url: filename,
        		async: true,
        		cache: settings.cache,
        		contentType: 'text/plain;charset=' + settings.encoding,
        		dataType: 'text',
        		success: function (data, status) {
                    logger.debug("message bundel ajax call - success");
        		    parseData(data, settings.mode);
        		},
                error: function(data, status) {
logger.debug("message bundel ajax call - fail " + data);
                }
    	    });
    	}
1012427
def parse_setup(filepath):
    ''''''
    # TODO: Need to parse setup.cfg and merge with the data from below

    # Monkey patch setuptools.setup to capture keyword arguments
    setup_kwargs = {}

    def setup_interceptor(**kwargs):
        setup_kwargs.update(kwargs)

    import setuptools
    setuptools_setup = setuptools.setup
    setuptools.setup = setup_interceptor

    # Manually compile setup.py
    with open(filepath, 'r') as f:
        code = compile(f.read(), '', 'exec')
    setup = ModuleType('setup')
    exec(code, setup.__dict__)

    # Remove monkey patch
    setuptools.setup = setuptools_setup
    return setup_kwargs
1290933
function readFile(filepath, callback) {
        window.requestFileSystem(
            LocalFileSystem.PERSISTENT,
            0,
            function(fileSystem) {
                fileSystem.root.getFile(
                    filepath,
                    null,
                    function gotFileEntry(fileEntry) {
                        fileEntry.file(
                            function gotFile(file) {
                                var reader = new FileReader();
                                reader.onloadend = function(evt) {
                                    // #72 - Fix WP8 loading of config.json
                                    // On WP8, `evt.target.result` is returned as an object instead
                                    // of a string. Since WP8 is using a newer version of the File API
                                    // this may be a platform quirk or an API update.
                                    var text = evt.target.result;
                                    text = (typeof text === 'object') ? JSON.stringify(text) : text;
                                    callback(null, text); // text is a string
                                };
                                reader.readAsText(file);
                            },
                            function(error) {
                                callback(error);
                            }
                        );
                    },
                    function(error) {
                        callback(error);
                    }
                );
            },
            function(error) {
                callback(error);
            }
        );
    }
997411
function setPath(path, val, obj) {
  if(!isArray(path) || isEmpty(path)) {
    throw new TypeError(pathErr)
  }

  if(!isValid(obj)) {
    throw new TypeError(
      'setPath: Object or Array required for third argument'
    )
  }

  const key = path[0]
  let newVal = val

  if(!(isString(key) && !isEmpty(key) || isInteger(key) && key >= 0)) {
    throw new TypeError(pathErr)
  }

  if(path.length > 1) {
    const next = !isValid(obj[key])
      ? isInteger(path[1]) ? [] : {}
      : obj[key]

    newVal = setPath(path.slice(1), val, next)
  }

  if(isObject(obj)) {
    if(isString(key)) {
      return object.set(key, newVal, obj)
    }

    throw new TypeError(
      'setPath: Non-empty String required in path when referencing an Object'
    )
  }

  if(isInteger(key)) {
    return array.set(key, newVal, obj)
  }

  throw new TypeError(
    'setPath: Positive Integers required in path when referencing an Array'
  )
}
548342
function (text, filePath) {

      // ESLint requires a result to be an array of processable text blocks
      var out = [text];

      if (externalProcessor !== null) {
        out = externalProcessor.preprocess(text, filePath);
      }

      // Retrieve settings for current file
      var settings = settingsGetter(filePath);

      // Do nothing if there is no plugins registered
      if (!settings.plugins.length) return out;

      // Reset file options on start
      delete cache[filePath];

      // -----------------------------------------------------------------------
      // 1. Disable "all except" via inline comments
      // -----------------------------------------------------------------------

      var allExceptInlinePlugins = getInlinePlugins(
        text, DISABLE_ALL_EXCEPT_PATTERN, settings.plugins
      );

      if (allExceptInlinePlugins) {

        if (allExceptInlinePlugins.length) {

          // Keep only plugins mentioned inline and disable the rest
          var pluginsToDisable = settings.plugins.filter(function (plugin) {
            return allExceptInlinePlugins.indexOf(plugin) === -1;
          });

          // Only set if there are plugins to disable
          if (pluginsToDisable.length) {
            cache[filePath] = pluginsToDisable;
          }

        } else {
          // Do nothing if no plugins found, it means all plugins are enabled
        }

        // Return the result
        return out;

      } else {
        // Continue to next option if there is no match for this option
      }

      // -----------------------------------------------------------------------
      // 2. Disable via inline comments
      // -----------------------------------------------------------------------

      var inlinePlugins = getInlinePlugins(
        text, DISABLE_PATTERN, settings.plugins
      );

      if (inlinePlugins) {

        // Disable all plugins if no plugins specified
        var pluginsToDisable = inlinePlugins.length
          ? inlinePlugins
          : settings.plugins;

        // Only set if there are plugins to disable
        if (pluginsToDisable.length) {
          cache[filePath] = pluginsToDisable;
        }

        // Return the result
        return out;

      } else {
        // Continue to next option if there is no match for this option
      }

      // -----------------------------------------------------------------------
      // 3. Disable "all except" via settings
      // -----------------------------------------------------------------------

      var settingsAllExceptPlugins = getSettingsPlugins(
        filePath, settings.allExceptPaths, true,
        settings.plugins, settings.pathsOptions
      );

      if (settingsAllExceptPlugins.length) {

        // Keep only plugins matching settings paths and disable the rest
        var pluginsToDisable = settings.plugins.filter(function (plugin) {
          return settingsAllExceptPlugins.indexOf(plugin) === -1;
        });

        // Only set if there are plugins to disable
        if (pluginsToDisable.length) {
          cache[filePath] = pluginsToDisable;
        }

        // Return the result
        return out;

      } else {
        // Continue to next option if there is no match for this option
      }

      // -----------------------------------------------------------------------
      // 4. Disable via settings
      // -----------------------------------------------------------------------

      var settingsPlugins = getSettingsPlugins(
        filePath, settings.paths, false,
        settings.plugins, settings.pathsOptions
      );

      if (settingsPlugins.length) {

        var pluginsToDisable = settingsPlugins;

        // Only set if there are plugins to disable
        if (pluginsToDisable.length) {
          cache[filePath] = pluginsToDisable;
        }

        // Return the result
        return out;

      } else {
        // No options left, proceed to the end
      }

      // ESLint requires a result to be an array of processable text blocks
      return out;
    }
134056
function loadExtensions() {
  var extsPath = this.fullPath(this.paths.extensions);
  if (fs.existsSync(extsPath) && fs.statSync(extsPath).isDirectory()) {
    var files = protos.util.ls(extsPath, this.regex.jsFile);
    files.forEach(function(file) {
      protos.require(extsPath + "/" + file, true); // Don't use module cache (allow reloading)
    }, this);
  }
  this.emit('exts_loaded');
}
966118
function (data) {
      var parse = function() {
        var parsed = lazy.extend({}, lazy.parseFilepath(this.path), data);
        if (typeof parsed.ext === 'undefined') {
          parsed.ext = parsed.extname;
        }
        return parsed;
      }.bind(this);
      return this.fragmentCache('path', parse);
    }
890337
function getorigPath(filePath, base) {
    var extName = path.extname(filePath);
    var pt = path.resolve(base, filePath);
    if (!extName) pt += '.js';
    return pt;
}
155994
function parsePlatformFilePath(
  filePath: string,
  platforms: Set<string>,
): PlatformFilePathParts {
  const dirPath = path.dirname(filePath);
  const fileName = path.basename(filePath);
  const match = fileName.match(PATH_RE);
  if (!match) {
    return {dirPath, baseName: fileName, platform: null, extension: null};
  }
  const extension = match[4] || null;
  const platform = match[3] || null;
  if (platform == null || platforms.has(platform)) {
    return {dirPath, baseName: match[1], platform, extension};
  }
  const baseName = `${match[1]}.${platform}`;
  return {dirPath, baseName, platform: null, extension};
}
744027
function file(filePath, parser, parserOptions, cb) {
  fs.readFile(filePath, 'utf8', function (err, data) {
    var fileFormat = discernFormat(filePath);
    if ((fileFormat === 'json' || formatsIndex.json.indexOf(fileFormat) > -1) && data === '') {
      data = '[]';
    }
    if (err) {
      cb(err);
      return false;
    }
    var parsed;
    try {
      if (typeof parser === 'function') {
        parsed = parser(data, parserOptions);
      } else if ((typeof parser === 'undefined' ? 'undefined' : _typeof(parser)) === 'object' && typeof parser.parse === 'function') {
        parsed = parser.parse(data, parserOptions);
      } else {
        parsed = 'Your specified parser is not properly formatted. It must either be a function or have a `parse` method.';
      }
    } catch (err) {
      cb(err);
      return;
    }
    cb(null, parsed);
  });
}
917630
function(dirPath, callback) {

            if (!dirPath || typeof dirPath !== 'string') {
                callback("dirPath must be a string");
            } else {
                fs.readdir(dirPath, function(err, list) {
                    var dir = [];

                    if (err) {
                        callback(err, null);
                    } else {
                        list.forEach(function(item) {
                            dir.push(readNode(path.join(dirPath, item)));
                        });

                        callback(null, dir);
                    }

                });
            }

        }
169958
def parse(self, module):
        """"""
        #Because of embedded types, we have to examine the entire module for
        #executable definitions.
        self.parse_block(module.refstring, module, module, 0)

        #Now we can set the value of module.contains as the text after the start of
        #the *first* non-embedded executable.
        min_start = len(module.refstring)
        for x in module.executables:
            if module.executables[x].start < min_start:
                min_start = module.executables[x].start

        module.contains = module.refstring[min_start::]