DH3K RIM implementation is currently buggy and DOES NOT WORK!!!
198218
public void setAlgorithm(KeyAgreementType dh) 
	{
		log("DH algorithm set: " + getDHName(dhMode) + " -> " + getDHName(dh));
		try {
			if(dhMode != null && dh.keyType == dhMode.keyType) return;
			dhMode = dh;
			switch (dhMode.keyType) {
		        case KeyAgreementType.DH_MODE_DH3K:
		    		DHParameterSpec paramSpec = new DHParameterSpec(dhP, dhG, DH_EXP_LENGTH);
		    		dhKeyGen = KeyPairGenerator.getInstance(ALGORITHM_DH);
		    		dhKeyGen.initialize(paramSpec, sr);
		    		dhKeyPair = dhKeyGen.generateKeyPair();
		    		clearEcdh();
		    		break;
		        case KeyAgreementType.DH_MODE_EC25:
		        	setupEC(256);
			        break;
		        case KeyAgreementType.DH_MODE_EC38:
		        default:
		        	setupEC(384);
			        break;
	        }
		} catch (Exception e) {
	        // TODO Auto-generated catch block
	        e.printStackTrace();
	        throw new RuntimeException("Failed init Diffie-Hellman: " + e.getClass().getName() + ": " + e.getMessage() + ", bitlength p = " + dhP.bitCount());
        }
	}
169499
def _build_one_legacy(self, req, tempd, python_tag=None):
        
        base_args = self._base_setup_args(req)

        spin_message = 'Building wheel for %s (setup.py)' % (req.name,)
        with open_spinner(spin_message) as spinner:
            logger.debug('Destination directory: %s', tempd)
            wheel_args = base_args + ['bdist_wheel', '-d', tempd] \
                + self.build_options

            if python_tag is not None:
                wheel_args += ["--python-tag", python_tag]

            try:
                output = call_subprocess(wheel_args, cwd=req.setup_py_dir,
                                         show_stdout=False, spinner=spinner)
            except Exception:
                spinner.finish("error")
                logger.error('Failed building wheel for %s', req.name)
                return None
            names = os.listdir(tempd)
            wheel_path = get_legacy_build_wheel_path(
                names=names,
                temp_dir=tempd,
                req=req,
                command_args=wheel_args,
                command_output=output,
            )
            return wheel_path
1340171
public void putDevicePipeProperty(String deviceName, ArrayList<DbPipe> dbPipes) throws DevFailed {
        for (DbPipe dbPipe : dbPipes)
            databaseDAO.putDevicePipeProperty(this, deviceName, dbPipe);
    }
1027711
def run(self):
        
        # SIGUSR1 forces a refresh of the bar both for py3status and i3status,
        # this mimics the USR1 signal handling of i3status (see man i3status)
        signal(SIGUSR1, self.sig_handler)
        signal(SIGTERM, self.terminate)

        # initialize usage variables
        py3_config = self.config["py3_config"]

        # prepare the color mappings
        self.create_mappings(py3_config)

        # self.output_modules needs to have been created before modules are
        # started.  This is so that modules can do things like register their
        # content_function.
        self.create_output_modules()

        # start up all our modules
        for module in self.modules.values():
            task = ModuleRunner(module)
            self.timeout_queue_add(task)

        # this will be our output set to the correct length for the number of
        # items in the bar
        output = [None] * len(py3_config["order"])

        write = sys.__stdout__.write
        flush = sys.__stdout__.flush

        # start our output
        header = {
            "version": 1,
            "click_events": self.config["click_events"],
            "stop_signal": SIGTSTP,
        }
        write(dumps(header))
        write("\n[[]\n")

        update_due = None
        # main loop
        while True:
            # process the timeout_queue and get interval till next update due
            update_due = self.timeout_queue_process()

            # wait until an update is requested
            if self.update_request.wait(timeout=update_due):
                # event was set so clear it
                self.update_request.clear()

            while not self.i3bar_running:
                time.sleep(0.1)

            # check if an update is needed
            if self.update_queue:
                while len(self.update_queue):
                    module_name = self.update_queue.popleft()
                    module = self.output_modules[module_name]
                    out = self.process_module_output(module)

                    for index in module["position"]:
                        # store the output as json
                        output[index] = out

                # build output string
                out = ",".join([x for x in output if x])
                # dump the line to stdout
                write(",[{}]\n".format(out))
                flush()
5313
def publish(ctx, test=False):
    """"""
    clean(ctx)
    if test:
        run('python setup.py register -r test sdist bdist_wheel', echo=True)
        run('twine upload dist/* -r test', echo=True)
    else:
        run('python setup.py register sdist bdist_wheel', echo=True)
        run('twine upload dist/*', echo=True)
1297805
def block(bdaddr):
    '''
    
    '''
    if not salt.utils.validate.net.mac(bdaddr):
        raise CommandExecutionError(
            'Invalid BD address passed to bluetooth.block'
        )

    cmd = 'hciconfig {0} block'.format(bdaddr)
    __salt__['cmd.run'](cmd).splitlines()
786657
void addToRelockList(final DeviceProxy dev, final int validity) throws DevFailed {
        // Check if it is the first relock
        if (relockMap == null) {
            // Create hash table for admin devices object
            relockMap = new Hashtable<String, LockedDeviceAmin>();

            // Create a thread to unlock all devices at exit
            Runtime.getRuntime().addShutdownHook(new ShutdownThread());

            // Create thread fo garbage callector call preiodicaly
            new GarbageThread().start();
        }
        // Check if admin device already exists.
        String adm;
        try {
            adm = dev.adm_name();
        } catch (final DevFailed e) {
            // Give up
            return;
        }
        final LockedDevice ld = new LockedDevice(dev.get_name(), validity);
        LockedDeviceAmin lda;
        if (!relockMap.containsKey(adm)) {
            // if not, crate and add th the list
            lda = new LockedDeviceAmin(adm, ld);
            lda.start();
            relockMap.put(adm, lda);
        } else {
            lda = relockMap.get(adm);
            lda.add(ld);
        }
    }
55407
def hdrmap(xmethod, dmethod, opt):
    

    hdr = {'Itn': 'Iter', 'Fnc': 'ObjFun', 'DFid': 'DFid',
           u('ℓ1'): 'RegL1', 'Cnstr': 'Cnstr'}
    if xmethod == 'admm':
        hdr.update({'r_X': 'XPrRsdl', 's_X': 'XDlRsdl', u('ρ_X'): 'XRho'})
    else:
        if opt['CBPDN', 'BackTrack', 'Enabled']:
            hdr.update({'F_X': 'X_F_Btrack', 'Q_X': 'X_Q_Btrack',
                        'It_X': 'X_ItBt', 'L_X': 'X_L'})
        else:
            hdr.update({'L_X': 'X_L'})
    if dmethod != 'fista':
        hdr.update({'r_D': 'DPrRsdl', 's_D': 'DDlRsdl', u('ρ_D'): 'DRho'})
    else:
        if opt['CCMOD', 'BackTrack', 'Enabled']:
            hdr.update({'F_D': 'D_F_Btrack', 'Q_D': 'D_Q_Btrack',
                        'It_D': 'D_ItBt', 'L_D': 'D_L'})
        else:
            hdr.update({'L_D': 'D_L'})
    return hdr
315554
def main():
    
    log = logging.getLogger(mod_logger + '.main')
    log.debug('This is DEBUG!')
    log.info('This is INFO!')
    log.warning('This is WARNING!')
    log.error('This is ERROR!')
    log.info('Running s3util.main...')
    my_bucket = 'cons3rt-deploying-cons3rt'
    my_regex = 'sourcebuilder.*apache-maven-.*3.3.3.*'
    try:
        s3util = S3Util(my_bucket)
    except S3UtilError as e:
        log.error('There was a problem creating S3Util:\n%s', e)
    else:
        log.info('Created S3Util successfully')
        key = s3util.find_key(my_regex)
        test = None
        if key is not None:
            test = s3util.download_file(key, '/Users/yennaco/Downloads')
        if test is not None:
            upload = s3util.upload_file(test, 'media-files-offline-assets/test')
            log.info('Upload result: %s', upload)
    log.info('End of main!')
536005
function(rm, oRoadMap, bStart){
		var sType = bStart ? "Start" : "End";
		rm.write("<div");
		rm.writeAttribute("id", oRoadMap.getId() + "-" + sType);
		rm.writeAttribute("tabindex", "-1");
		var hasHiddenSteps = true; //Simply assume that there are hidden steps -> updated later (see function updateScrollState)
		rm.addClass(hasHiddenSteps ? "sapUiRoadMap" + sType + "Scroll" : "sapUiRoadMap" + sType + "Fixed");
		rm.addClass("sapUiRoadMapDelim");
		rm.addClass("sapUiRoadMapContent");
		rm.writeClasses();
		rm.write("></div>");
	}
104177
function setupModule() {

    // Shims

    if(typeof self === 'undefined') {
      global.self = global;
    }

    if(!self.URL) {
      self.URL = self.webkitURL;
    }

    // Make sure are on https in browser,
    // otherwise crypto etc. wont work.

    if(isBrowser() &&
        self.location.protocol === 'http:' &&
        self.location.hostname !== 'localhost' &&
        !self.location.hostname.startsWith('192.168.')) {
      self.location.href = self.location.href.replace(/http/, 'https');
    }

    // Setup / export module

    da = self.direape || {};

    if(typeof module === 'undefined') {
      self.direape = da;
    } else {
      module.exports = da;
    }

    da.test = test;

    // Define name of testsuite

    testSuite('direape');
  }
936034
def run():
    """"""

    # NOTE(kiennt): Until now, this example isn't finished yet,
    #               because we don't have any completed driver

    # Get a network client with openstack driver.

    network_client = client.Client(version=_VERSION,
                        resource=_RESOURCES[0], provider=_PROVIDER)
    # net = network_client.create('daikk', '10.0.0.0/24')
    # list_subnet = network_client.list()
    # network_client.show(list_subnet[0].get("id"))
    network_client.delete("4b983028-0f8c-4b63-b10c-6e8420bb7903")
103206
def build_interface(iface, iface_type, enabled, **settings):
    '''
    
    '''
    if __grains__['lsb_distrib_id'] == 'nilrt':
        raise salt.exceptions.CommandExecutionError('Not supported in this version.')
    if iface_type != 'eth':
        raise salt.exceptions.CommandExecutionError('Interface type not supported: {0}:'.format(iface_type))

    if 'proto' not in settings or settings['proto'] == 'dhcp':  # default protocol type used is dhcp
        set_dhcp_linklocal_all(iface)
    elif settings['proto'] != 'static':
        exc_msg = 'Protocol type: {0} is not supported'.format(settings['proto'])
        raise salt.exceptions.CommandExecutionError(exc_msg)
    else:
        address = settings['ipaddr']
        netmask = settings['netmask']
        gateway = settings['gateway']
        dns = []
        for key, val in six.iteritems(settings):
            if 'dns' in key or 'domain' in key:
                dns += val
        set_static_all(iface, address, netmask, gateway, dns)

    if enabled:
        up(iface)

    return get_interface(iface)
312332
function rimrafWithRetries(...args) {
    let retries = 0;
    return new Promise((resolve, reject) => {
        function rm(...rmArgs) {
            try {
                rimraf.sync(...rmArgs);
                resolve();
            } catch (e) {
                retries += 1;
                if (retries < 5) {
                    setTimeout(() => {
                        rm(...rmArgs);
                    }, 100);
                } else {
                    reject(e);
                }
            }
        }
        rm(...args);
    });
}
629072
function flushPins (callback) {
    let dLink, rLink, root
    series([
      // create a DAGLink to the node with direct pins
      cb => waterfall([
        cb => pinset.storeSet(directKeys(), cb),
        ({ node, cid }, cb) => DAGLink.create(types.direct, node.size, cid, cb),
        (link, cb) => { dLink = link; cb(null) }
      ], cb),

      // create a DAGLink to the node with recursive pins
      cb => waterfall([
        cb => pinset.storeSet(recursiveKeys(), cb),
        ({ node, cid }, cb) => DAGLink.create(types.recursive, node.size, cid, cb),
        (link, cb) => { rLink = link; cb(null) }
      ], cb),

      // the pin-set nodes link to a special 'empty' node, so make sure it exists
      cb => DAGNode.create(Buffer.alloc(0), (err, empty) => {
        if (err) { return cb(err) }
        dag.put(empty, {
          version: 0,
          hashAlg: 'sha2-256',
          format: 'dag-pb',
          preload: false
        }, cb)
      }),

      // create a root node with DAGLinks to the direct and recursive DAGs
      cb => DAGNode.create(Buffer.alloc(0), [dLink, rLink], (err, node) => {
        if (err) { return cb(err) }
        root = node
        dag.put(root, {
          version: 0,
          hashAlg: 'sha2-256',
          format: 'dag-pb',
          preload: false
        }, (err, cid) => {
          if (!err) {
            root.multihash = cid.buffer
          }
          cb(err)
        })
      }),

      // hack for CLI tests
      cb => repo.closed ? repo.open(cb) : cb(null, null),

      // save root to datastore under a consistent key
      cb => repo.datastore.put(pinDataStoreKey, root.multihash, cb)
    ], (err, res) => {
      if (err) { return callback(err) }
      self.log(`Flushed pins with root: ${root}`)
      return callback(null, root)
    })
  }
855231
@Override
    public void unexportDevices() throws DevFailed {
        xlogger.entry();
        final List<DeviceClassBuilder> clazzToRemove = new ArrayList<DeviceClassBuilder>();
        for (final DeviceClassBuilder clazz : deviceClassList) {
            if (!clazz.getDeviceClass().equals(AdminDevice.class)) {
                for (final DeviceImpl device : clazz.getDeviceImplList()) {
                    logger.debug("unexport device {}", device.getName());
                    ORBUtils.unexportDevice(device);
                }
                clazz.clearDevices();
                clazzToRemove.add(clazz);
            }
        }
        for (final DeviceClassBuilder deviceClassBuilder : clazzToRemove) {
            deviceClassList.remove(deviceClassBuilder);
        }
        // unregisterServer();
        // deviceClassList.clear();
        xlogger.exit();
    }
1008034
public void addTangoPipeListener(ITangoPipeListener listener,
                                     String attrName, String[] filters, boolean stateless) throws DevFailed {
        TangoPipe tangoPipe;
        String key = deviceName+"/"+attrName;
        if ((tangoPipe = tango_pipe_source.get(key)) == null) {
            tangoPipe = new TangoPipe(deviceProxy, attrName, filters);
            tango_pipe_source.put(key, tangoPipe);
        }

        synchronized (moni) {
            tangoPipe.addTangoPipeListener(listener, stateless);
        }
    }