Internal operation: converts raw commanline ls returns into an array of samba share listing objects
@private
494048
private function processLS($raw_ls, $subdir = '')
    {
        $ret = array();

        foreach($raw_ls as $listing) {
            $temp = $this->parseListing($listing, $subdir);
            if($temp) {
                $ret[] = $temp;
            }
        }

        return $ret;
    }
265723
function handleSSLProperties (config) {
  const sslFiles = ['sslKey', 'sslCert', 'sslDHParams']
  let key
  let resolvedFilePath
  let filePath
  for (let i = 0; i < sslFiles.length; i++) {
    key = sslFiles[i]
    filePath = config[key]
    if (!filePath) {
      continue
    }
    resolvedFilePath = fileUtils.lookupConfRequirePath(filePath)
    try {
      config[key] = fs.readFileSync(resolvedFilePath, 'utf8')
    } catch (e) {
      throw new Error(`The file path "${resolvedFilePath}" provided by "${key}" does not exist.`)
    }
  }
}
787217
function (dir, filelist, ext, currentBundleOptions) {
    var path = path || require('path');
    var fs = fs || require('fs');
    var files = fs.readdirSync(dir);
    filelist = filelist || [];
    files.forEach(function (file) {
        if (fs.statSync(path.join(dir, file)).isDirectory()) {
            filelist = walkSync(path.join(dir, file), filelist, ext, currentBundleOptions);
        }
        else {
            if (file.match(new RegExp("." + ext + "$")) && !isExcluded(file, currentBundleOptions))
                filelist.push(path.join(dir, file));
        }
    });
    return filelist;
}
152005
function listToArray ( list, opts ) {
	const length = list.getLength();
	const data = [];
	for ( let i = 0; i < length; i++ ) {
		const value = getJsonValueFromSassValue(list.getValue(i), opts);
		data.push(value);
	}
	return data;
}
571360
function split({url, bucket, key, arn='', maxFiles=0, linesPerFile=500, maxLambdas=20, reverse=false, cb=null}) {

  let fileCounter = 0
  let lineCounter = 0
  const lineBuffer = new Buffer(4096)
  const gunzip = zlib.createGunzip()
  let newStream
  let currentFile
  let lineLength = 0
  let stopSplitting = false
  let header

  switch (url.substr(url.lastIndexOf('.') + 1)) {
    case 'csv':
      newStream = got.stream(url)
      break
    case 'gz':
      newStream = got.stream(url).pipe(gunzip)
      break
  }

  const build = function buildFile(line) {
    // get the csv header
    if (fileCounter === 0 && lineCounter === 0) header = line.toString()

    // create a new file or add to existing
    if (lineCounter === 0) {
      currentFile = new stream.PassThrough()
      currentFile.push(header)
    } else {
      currentFile.push(line.toString())
    }
    lineCounter += 1 // increment the filename
    lineLength = 0 // reset the buffer

    if (lineCounter > linesPerFile) {
      fileCounter += 1
      const fileName = `${key}${fileCounter}.csv`;
      const params = {
        Body: currentFile,
        Bucket: bucket,
        Key: fileName
      }
      currentFile.end()
      s3.upload(params, (e, d) => { if (e) console.log(e) })
      lineCounter = 0 // start counting the lines again
      if ((fileCounter) % 250 === 0 && fileCounter != 0) console.log(`uploaded ${fileCounter} files`)
      // sentinel csv is ordered from old to new so always have to go all the way back
      if ((fileCounter >= maxFiles) && maxFiles != 0 && !reverse) {
        stopSplitting = true
      }
    }
  }

  newStream.on('data', (data) => {
    if (!stopSplitting) {
      const dataLen = data.length
      for (let i = 0; i < dataLen; i++) {
        lineBuffer[lineLength] = data[i] // Buffer new line data.
        lineLength++
        if (data[i] === 10) { // Newline char was found.
          build(lineBuffer.slice(0, lineLength))
        }
      }
    }
  })

  newStream.on('end', () => {
    // write the last records
    if (lineCounter > 0) {
        fileCounter += 1
        const params = {
          Body: currentFile,
          Bucket: bucket,
          Key: `${key}${fileCounter}.csv`
        }
        s3.upload(params, (e, d) => { if (e) console.log(e) })
        currentFile.end()
    }
    console.log(`${fileCounter-1} total files`)
    // determine batches and run lambdas
    if (arn != '') {
      maxFiles = (maxFiles === 0) ? fileCounter : Math.min(maxFiles, fileCounter)
      var numLambdas = Math.min(maxFiles, maxLambdas)
      var batchSize = Math.floor(maxFiles / numLambdas)
      var extra = maxFiles % numLambdas
      var maxEndFile = reverse ? fileCounter : maxFiles
      
      var startFile = reverse ? fileCounter - maxFiles + 1: 1
      var endFile
      console.log(`Invoking ${numLambdas} batches of Lambdas of ${batchSize} files each with ${extra} extra (Files ${startFile}-${maxEndFile})`)
      for (var i = 0; i < numLambdas; i++) {
        endFile = (i < extra) ? startFile + batchSize: startFile + batchSize - 1
        invokeLambda(bucket, key, startFile, Math.min(endFile, maxEndFile), arn)
        startFile = endFile + 1
      }
    }
    cb()
  })
  newStream.on('error', e => cb(e))
}
730946
function createDownloadList() {
		uploadFiles = [];
	

		files.forEach(function(item, i, arr) {
			var preg = new RegExp(item);
			var check = false;    
			serverFonts.forEach(function(item, i, arr) {
				if (preg.test(item)) {
					uploadFiles.push(item);
					check = true;
					// serverFonts.remove(item);
				}
			});
			if (!check){
				grunt.log.warn('You have no suitable fonts at pattern ' + item);
			}
		});

		downloadFiles();
	}
1099687
function(str, delimiter){

	var retlist = null;

	if( ! us.isUndefined(str) ){
	    if( us.isUndefined(delimiter) ){
		delimiter = /\s+/;
	    }
	    
	    retlist = str.split(delimiter);
	}

	return retlist;
    }
430761
function copyReadmeFiles() {
    const resolvedSrcReadmePaths = path.resolve(rootDir, srcReadmePaths);

    glob(resolvedSrcReadmePaths, void(0), function(error, files) {
        files.forEach((filePath) => {
        const destReadmePath = filePath.replace(/(\bsrc\b)(?!.*\1)/, destDir);
            fs.copyFileSync(filePath, destReadmePath);
        });
    });
}
156773
function (rawHeaders) {
            var headers = {},
                headerList,
                key,
                h,
                i;

            headerList = rawHeaders.split("\n");
            for (i = 0; i < headerList.length; i += 1) {
                h = headerList[i].split(":", 2);

                if (h[1] !== null) {
                    headers[h[0]] = h[1].replace(/^\s+|\s+$/g, "");

                    key = h[0];
                }
                else {
                    if (h[0].substring(0, 1) === "\t") {
                        headers[h[0]] = h[1].replace(/^\s+|\s+$/g, "");
                    }
                }
            }

            return headers;
        }
202919
function parseDirectoryEntries(directoryStr) {
		const directoryEntries = [];
		let pos = 0;
		let count = 0;

		while (directoryStr.length - pos >= 12) {
			directoryEntries[count] = directoryStr.substring(pos, pos + 12);
			pos += 12;
			count++;
		}

		return directoryEntries;
	}
647016
function splitUrl(sUrl) {
		var m = rUrl.exec(sUrl);
		if ( !m || A_VALID_FILE_TYPES.indexOf( m[2] ) < 0 ) {
			throw new Error("resource URL '" + sUrl + "' has unknown type (should be one of " + A_VALID_FILE_TYPES.join(",") + ")");
		}
		return { url : sUrl, prefix : m[1], ext : m[2], query: m[4], hash: (m[5] || ""), suffix : m[2] + (m[3] || "") };
	}
1005546
def ls(serial=None):
    
    out, err = execute([
        'import os',
        'print(os.listdir())',
    ], serial)
    if err:
        raise IOError(clean_error(err))
    return ast.literal_eval(out.decode('utf-8'))
401292
function getExternals() {
    var fs = require('fs');
    var nodeModules = {};

    fs.readdirSync('node_modules').forEach(function (module) {
      if (module !== '.bin') {
        nodeModules[module] = true;
      }
    });

    var nodeModulesTransform = function(context, request, callback) {
      // search for a '/' indicating a nested module
      var slashIndex = request.indexOf("/");
      var rootModuleName;
      if (slashIndex == -1) {
        rootModuleName = request;
      } else {
        rootModuleName = request.substr(0, slashIndex);
      }

      // Match for root modules that are in our node_modules
      if (nodeModules.hasOwnProperty(rootModuleName)) {
        callback(null, "commonjs " + request);
      } else {
        callback();
      }
    };
    return nodeModulesTransform;
}
555320
function DumpInternals() {
    for (let ck in exports.globalKCState.controllers) {
        console.log("============================================");
        console.log(`Controller on path ${exports.globalKCState.controllers[ck].path} built from Class ${exports.globalKCState.controllers[ck].ctr.name}`);
        console.log("With Methods:");
        for (let mk in exports.globalKCState.controllers[ck].methods) {
            let m = exports.globalKCState.controllers[ck].methods[mk];
            console.log(`== ${mk} ==`);
            console.log(m);
            console.log("");
        }
    }
}
692090
function combine(shares) {
  const chunks = []
  const x = []
  const y = []
  const t = shares.length

  for (let i = 0; i < t; ++i) {
    const share = parse(shares[i])

    if (-1 === x.indexOf(share.id)) {
      x.push(share.id)

      const bin = codec.bin(share.data, 16)
      const parts = codec.split(bin, 0, 2)

      for (let j = 0; j < parts.length; ++j) {
        if (!y[j]) { y[j] = [] }
        y[j][x.length - 1] = parts[j]
      }
    }
  }

  for (let i = 0; i < y.length; ++i) {
    const p = lagrange(0, [x, y[i]])
    chunks.unshift(codec.pad(p.toString(2)))
  }

  const string = chunks.join('')
  const bin = string.slice(1 + string.indexOf('1')) // >= 0
  const hex = codec.hex(bin, BIN_ENCODING)
  const value = codec.decode(hex)

  return Buffer.from(value)
}
1201819
function _split(source) {
  var buf = [];
  var reg = /'[^']+'|"[^"]+"|[^\s/=]+=?/g;
  reg.lastIndex = 0;
  var match = reg.exec(source);

  while (match) {
    buf.push(match);
    match = reg.exec(source);
  }

  return buf;
}
1136313
private function normalizeDirectoryListing($listing)
    {
        $normalizedListing = [];

        foreach ($listing as $child) {
            $chunks = preg_split("/\s+/", $child);

            list(
                $item['rights'],
                $item['number'],
                $item['user'],
                $item['group'],
                $item['size'],
                $item['month'],
                $item['day'],
                $item['time'],
                $item['name']
            ) = $chunks;

            $item['type'] = $chunks[0]{0} === 'd' ? 'directory' : 'file';

            array_splice($chunks, 0, 8);

            $normalizedListing[implode(" ", $chunks)] = $item;
        }

        return $normalizedListing;
    }