We fall back to raw Faraday for handling the licenses because I'm suspicious
 that Sawyer isn't handling binary POSTs correctly: http://git.io/jMir
504080
def faraday_configuration
      @faraday_configuration ||= Faraday.new(:url => @management_console_endpoint) do |http|
        http.headers[:user_agent] = user_agent
        http.request :multipart
        http.request :url_encoded

        # Disabling SSL is essential for certain self-hosted Enterprise instances
        if self.connection_options[:ssl] && !self.connection_options[:ssl][:verify]
          http.ssl[:verify] = false
        end

        http.use Octokit::Response::RaiseError
        http.adapter Faraday.default_adapter
      end
    end
132996
def assign_vpp_device_based_licenses=(new_val)
      return nil if new_val == @assign_vpp_device_based_licenses
      raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
      @assign_vpp_device_based_licenses = new_val
      @need_to_update = true
    end
1057850
function parseFrameUID(device, data, win, fail)
{
	if(data[0] != 0x00) return false;

	// The UID frame has 18 bytes + 2 bytes reserved for future use
	// https://github.com/google/eddystone/tree/master/eddystone-uid
	// Check that we got at least 18 bytes.
	if(data.byteLength < 18)
	{
		fail("UID frame: invalid byteLength: "+data.byteLength);
		return true;
	}

	device.txPower = evothings.util.littleEndianToInt8(data, 1);
	device.nid = data.subarray(2, 12);  // Namespace ID.
	device.bid = data.subarray(12, 18); // Beacon ID.

	win(device);

	return true;
}
1307004
@Override
	protected AbstractChainedResourceBundlePostProcessor buildProcessorByKey(String procesorKey) {
		if (PostProcessFactoryConstant.JSMIN.equals(procesorKey))
			return buildJSMinPostProcessor();
		else if (PostProcessFactoryConstant.LICENSE_INCLUDER.equals(procesorKey))
			return buildLicensesProcessor();
		else if (PostProcessFactoryConstant.UGLIFY_JS.equals(procesorKey))
			return buildUglifyJSProcessor();
		else if (PostProcessFactoryConstant.YUI_COMPRESSOR.equals(procesorKey))
			return new YUIJSCompressor(false);
		else if (PostProcessFactoryConstant.YUI_COMPRESSOR_OBFUSCATOR.equals(procesorKey))
			return new YUIJSCompressor(true);
		else
			throw new IllegalArgumentException("The supplied key [" + procesorKey
					+ "] is not bound to any ResourceBundlePostProcessor. Please check the documentation for valid keys. ");
	}
350401
function () {
        var pkg = require(process.cwd() + '/package.json');
        var licenses = [];
        pkg.licenses.forEach(function (license) {
            licenses.push(license.type);
        });

        return '/*! ' + pkg.name + ' - v' + pkg.version + ' - ' + gutil.date("yyyy-mm-dd") + "\n" +
            (pkg.homepage ? "* " + pkg.homepage + "\n" : "") +
            '* Copyright (c) ' + gutil.date("yyyy") + ' ' + pkg.author.name +
            '; Licensed ' + licenses.join(', ') + ' */\n';
    }
851625
async function buildIifeAmd() {
  // create a bundle
  const bundle = await rollup.rollup({
    input: 'src/index.js',
    external: ['riot'],
    plugins: [
      nodeResolve({
        jsnext: true,
        main: true,
        browser: true
      }),
      commonjs({
        include: 'node_modules/**',
        namedExports: namedExports
      }),
      buble()
    ]
  });
  await bundle.write({
    format: 'iife',
    name: 'riotx',
    globals: {
      riot: 'riot'
    },
    banner: banner,
    intro: intro,
    file: 'dist/riotx.js',
    sourcemap: true
  });
  await bundle.write({
    format: 'amd',
    banner: banner,
    intro: intro,
    file: 'dist/amd.riotx.js',
    sourcemap: true
  });
}
109069
def binary(self, name, flag):
        
        if self.meta.rsl_deps in ["on", "ON"] and "--resolve-off" not in flag:
            sys.setrecursionlimit(10000)
            dependencies = []
            requires = Requires(name, self.repo).get_deps()
            if requires:
                for req in requires:
                    status(0)
                    if req and req not in self.black:
                        dependencies.append(req)
                if dependencies:
                    self.dep_results.append(dependencies)
                    for dep in dependencies:
                        self.binary(dep, flag)
            return self.dep_results
        else:
            return []
706633
function findValidPhantomJsBinary(libPath) {
  return kew.fcall(function () {
    var libModule = require(libPath)
    if (libModule.location &&
        getTargetPlatform() == libModule.platform &&
        getTargetArch() == libModule.arch) {
      var resolvedLocation = path.resolve(path.dirname(libPath), libModule.location)
      if (fs.statSync(resolvedLocation)) {
        return checkPhantomjsVersion(resolvedLocation).then(function (matches) {
          if (matches) {
            return kew.resolve(resolvedLocation)
          }
        })
      }
    }
    return false
  }).fail(function () {
    return false
  })
}
25846
function copyBinaryToOutput(next) {
        _log('cp %s %s', nodeCompiler.releasePath, options.output);
        ncp(nodeCompiler.releasePath, options.output, function(err) {
          if (err) {
            _log('error', "Couldn't copy binary.");
            throw err; // dump raw error object
          }
          _log('copied');

          next();
        });
      }
733485
def license(dir = Dir.pwd,
                license = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata][:license],
                authors = '',
                options = {
                  :filename     => 'LICENSE'
                })
      return if ((license.empty?) or (license == 'none') or (license =~ /^CC/))
      return unless FalkorLib::Config::Bootstrap::DEFAULTS[:licenses].keys.include?( license )
      info "Generate the #{license} licence file"
      path = normalized_path(dir)
      use_git = FalkorLib::Git.init?(path)
      rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path
      Dir.chdir( rootdir ) do
        run %( licgen #{license.downcase} #{authors} )
        run %( mv LICENSE #{options[:filename]} ) if( options[:filename] and options[:filename] != 'LICENSE')
      end
    end
658749
def hacking_has_correct_license(physical_line, filename, lines, line_number):
    
    # don't work about init files for now
    # TODO(sdague): enforce license in init file if it's not empty of content

    # skip files that are < 10 lines, which isn't enough for a license to fit
    # this allows us to handle empty files, as well as not fail on the Okay
    # doctests.
    if line_number is 1 and len(lines) > 10 and _project_is_apache():
        for idx, line in enumerate(lines):
            column = line.find('Licensed under the Apache License')
            if (0 < column < 10 and not
                    _check_for_exact_apache(idx, lines)):
                if (line.find('SPDX-License-Identifier: Apache-2.0') <= 0):
                    return (column, "H103: Header does not match Apache 2.0 "
                            "License notice")
1240184
function() {
      'use strict';
      var done = this.async();

      commonPrompts.greetings( this, 'control' );

      var prompts = commonPrompts.prompts( 'control', this.placeholder );
      prompts.push( {
         type: 'list',
         name: 'laxarIntegrationTechnology',
         message: 'Integration technology:',
         choices: [ 'plain', 'angular', 'react' ],
         default: this.placeholder.laxarIntegrationTechnology
      }, {
         type: 'confirm',
         name: 'infrastructure',
         message: 'Create project infrastructure (README.md, bower.json)?',
         default: false
      } );

      this.prompt( prompts, function( answers ) {

         for( var answerName in answers ) {
            if( answers.hasOwnProperty( answerName ) ) {
               this.placeholder[ answerName ] = answers[ answerName ];
            }
         }

         var licenseList = util.createLicenseText( answers.licenses );
         this.license = licenseList[ 1 ];
         for( var key in licenseList[ 0 ] ) {
            if( licenseList[ 0 ].hasOwnProperty( key ) ) {
               this.placeholder[ key ] = licenseList[ 0 ][ key ];
            }
         }

         if( this.placeholder.laxarIntegrationTechnology === 'angular' ) {
            this.placeholder.angularDirectiveName = createAngularDirectiveName( this.placeholder.name );
         }
         else if( this.placeholder.laxarIntegrationTechnology === 'react' ) {
            this.placeholder.reactClassName = createReactClassName( this.placeholder.name );
         }

         this.placeholder.cssClassName = _.kebabCase( this.placeholder.name );
         this.placeholder.banner = util.createBanner( this );
         done();

      }.bind( this ) );
   }
167949
function checkBinaryReady(uuid) {
      if (!(uuid in api._blobs && uuid in api._binaryMessages)) {
        return;
      }
      log('receive full binary message', uuid);
      var blob = api._blobs[uuid];
      var msg = api._binaryMessages[uuid];

      delete api._blobs[uuid];
      delete api._binaryMessages[uuid];

      var blobToDeliver;
      if (isBrowser) {
        blobToDeliver = blobUtil.createBlob([blob], {type: msg.contentType});
      } else {
        blobToDeliver = blob;
        blob.type = msg.contentType; // non-standard, but we do it for the tests
      }

      msg.cb(null, blobToDeliver);
    }
680545
private void unshallowIfNeeded(GitCommand gitCommand, ConsoleOutputStreamConsumer streamConsumer, Revision revision, File workingDir) {
        if (gitCommand.isShallow() && !gitCommand.containsRevisionInBranch(revision)) {
            gitCommand.unshallow(streamConsumer, UNSHALLOW_TRYOUT_STEP);

            if (gitCommand.isShallow() && !gitCommand.containsRevisionInBranch(revision)) {
                fullyUnshallow(gitCommand, streamConsumer);
            }
        }
    }
1049343
@Override
    protected WsByteBuffer createChunkTrailer() {
        if (!getLink().isReconnectAllowed()) {
            // use the "shared" chunk trailer object
            return super.createChunkTrailer();
        }

        // if reconnects are allowed, then these buffers must be unique
        // per chunk, otherwise we get data corruption
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "OSC creating chunk trailer");
        }
        WsByteBuffer buffer = allocateBuffer(32);
        buffer.put(CHUNK_TRAILER_DATA);
        buffer.flip();
        return buffer;
    }
552770
function get(data) {
    var parser = this
      , matches = [];

    //
    // Another npm oddity, it allows licenses to be specified in to different
    // properties. Because why the fuck not?
    //
    ['license', 'licenses'].forEach(function each(key) {
      if ('string' === typeof data[key]) {
        return matches.push(data[key]);
      }

      if (Array.isArray(data[key])) {
        return Array.prototype.push.apply(
          matches,
          data[key].map(function map(item) {
            return parser.license(item);
          }).filter(Boolean)
        );
      }

      if ('object' === typeof data[key] && parser.license(data[key])) {
        return Array.prototype.push.apply(
          matches,
          [parser.license(data[key])]
        );
      }
    });

    if (matches.length) return matches;
  }
281558
function requestBinary(requestOptions, filePath) {
  const deferred = kew.defer();
  const writePath = filePath + '-download-' + Date.now();

  log.info('Receiving...');
  let bar = null;
  requestProgress(request(requestOptions, (error, response, body) => {
    log.info('');
    if (!error && response.statusCode === 200) {
      fs.writeFileSync(writePath, body);
      log.info('Received ' + Math.floor(body.length / 1024) + 'K total.');
      fs.renameSync(writePath, filePath);
      deferred.resolve({
        requestOptions: requestOptions,
        downloadedFile: filePath
      });

    } else if (response) {
      log.error('Error requesting archive.\n' +
        'Status: ' + response.statusCode + '\n' +
        'Request options: ' + JSON.stringify(requestOptions, null, 2) + '\n' +
        'Response headers: ' + JSON.stringify(response.headers, null, 2) + '\n' +
        'Make sure your network and proxy settings are correct.\n\n');
      exit(1);
    } else if (error && error.stack && error.stack.indexOf('SELF_SIGNED_CERT_IN_CHAIN') != -1) {
      log.error('Error making request.');
      exit(1);
    } else if (error) {
      log.error('Error making request.\n' + error.stack + '\n\n' +
        'Please report this full log at https://github.com/hypery2k/galenframework-cli/issues');
      exit(1);
    } else {
      log.error('Something unexpected happened, please report this full ' +
        'log at https://github.com/hypery2k/galenframework-cli/issues');
      exit(1);
    }
  })).on('progress', (state) => {
    if (!bar) {
      bar = new Progress('  [:bar] :percent :etas', { total: state.total, width: 40 });
    }
    bar.curr = state.received;
    bar.tick(0);
  });

  return deferred.promise;
}