The actual 'private' conversion function.
331170
def _convert(self, chain_id, residue_id, from_scheme, to_scheme):
        ''''''

        # There are 12 valid combinations but rather than write them all out explicitly, we will use recursion, sacrificing speed for brevity
        if from_scheme == 'rosetta':
            atom_id = self.rosetta_to_atom_sequence_maps.get(chain_id, {})[residue_id]
            if to_scheme == 'atom':
                return atom_id
            else:
                return self._convert(chain_id, atom_id, 'atom', to_scheme)
        if from_scheme == 'atom':
            if to_scheme == 'rosetta':
                return self.atom_to_rosetta_sequence_maps.get(chain_id, {})[residue_id]
            else:
                seqres_id = self.atom_to_seqres_sequence_maps.get(chain_id, {})[residue_id]
                if to_scheme == 'seqres':
                    return seqres_id
                return self.convert(chain_id, seqres_id, 'seqres', to_scheme)
        if from_scheme == 'seqres':
            if to_scheme == 'uniparc':
                return self.seqres_to_uniparc_sequence_maps.get(chain_id, {})[residue_id]
            else:
                atom_id = self.seqres_to_atom_sequence_maps.get(chain_id, {})[residue_id]
                if to_scheme == 'atom':
                    return atom_id
                return self.convert(chain_id, atom_id, 'atom', to_scheme)
        if from_scheme == 'uniparc':
            seqres_id = self.uniparc_to_seqres_sequence_maps.get(chain_id, {})[residue_id]
            if to_scheme == 'seqres':
                return seqres_id
            else:
                return self._convert(chain_id, seqres_id, 'seqres', to_scheme)

        raise Exception("We should never reach this line.")
589606
@SuppressWarnings("unchecked")
	public <X extends Stru> X convertLeaves(X source, SafeConvertor<Object, Object> convertor) {
		return Check.notNull(source) instanceof Obj
			? (X)convertLeavesInternal((Obj)source, convertor)
			: (X)convertLeavesInternal((Arr)source, convertor);
	}
788052
private function generatePrivateECKey(): JWK
    {
        return JWKFactory::createFromKeyFile($this->privateKeyPath, $this->privateKeySecret, [
            'kid' => $this->keyId,
            'alg' => 'ES512',
            'use' => 'sig'
        ]);
    }
948876
function initReversedBytes() {
	var i,
	    result = new Uint8Array( 0x100 );

	for ( i = 0; i < 0x100; i++ ) {
		result[ i ] = calcReverse( i );
	}

	return result;

	function calcReverse( original ) {
		var i,
			reverse = 0;

		for ( i = 7; i >= 0; i-- ) {
			reverse |= ( ( original & 1 ) << i );
			original >>>= 1;
		}

		return reverse;
	}
}
282118
function(recipientPrivate, senderPublic, _payload) {
    // Errors
    if(!recipientPrivate || !senderPublic || !_payload) throw new Error('Missing argument !');
    if (!Helpers.isPrivateKeyValid(recipientPrivate)) throw new Error('Private key is not valid !');
    if (!Helpers.isPublicKeyValid(senderPublic)) throw new Error('Public key is not valid !');
    // Processing
    let binPayload = convert.hex2ua(_payload);
    let salt = new Uint8Array(binPayload.buffer, 0, 32);
    let iv = new Uint8Array(binPayload.buffer, 32, 16);
    let payload = new Uint8Array(binPayload.buffer, 48);
    let sk = convert.hex2ua_reversed(recipientPrivate);
    let pk = convert.hex2ua(senderPublic);
    let shared = new Uint8Array(32);
    let r = key_derive(shared, salt, sk, pk);
    let encKey = r;
    let encIv = {
        iv: convert.ua2words(iv, 16)
    };
    let encrypted = {
        'ciphertext': convert.ua2words(payload, payload.length)
    };
    let plain = CryptoJS.AES.decrypt(encrypted, encKey, encIv);
    // Result
    let hexplain = CryptoJS.enc.Hex.stringify(plain);
    return hexplain;
}
806474
function convert(opts) {
  let res = '';

  // eslint-disable-next-line
  for (const key in opts) {
    if (hasOwn(opts, key)) {
      if (/^expires$/i.test(key)) {
        let expires = opts[key];

        if (typeof expires !== 'object') {
          expires += typeof expires === 'number' ? 'D' : '';
          expires = computeExpires(expires);
        }
        res += `;${key}=${expires.toUTCString()}`;
      } else if (/^secure$/.test(key)) {
        if (opts[key]) {
          res += `;${key}`;
        }
      } else {
        res += `;${key}=${opts[key]}`;
      }
    }
  }

  if (!hasOwn(opts, 'path')) {
    res += ';path=/';
  }

  return res;
}
25832
def generate(cls):
        
        return cls(libnacl.randombytes(PrivateKey.SIZE), encoder=encoding.RawEncoder)
69989
function HAPEncryption() {
  // initialize member vars with null-object values
  this.clientPublicKey = bufferShim.alloc(0);
  this.secretKey = bufferShim.alloc(0);
  this.publicKey = bufferShim.alloc(0);
  this.sharedSec = bufferShim.alloc(0);
  this.hkdfPairEncKey = bufferShim.alloc(0);
  this.accessoryToControllerCount = { value: 0 };
  this.controllerToAccessoryCount = { value: 0 };
  this.accessoryToControllerKey = bufferShim.alloc(0);
  this.controllerToAccessoryKey = bufferShim.alloc(0);
  this.extraInfo = {};
}
501118
private static Object invokeDefaultMethodUsingPrivateLookup(Class<?> declaringClass, Object o, Method m, 
            Object[] params) throws WrappedException, NoSuchMethodException {
        try {
            final Method privateLookup = MethodHandles
                .class
                .getDeclaredMethod("privateLookupIn", Class.class, MethodHandles.Lookup.class);
            
            return ((MethodHandles.Lookup)privateLookup
                .invoke(null, declaringClass, MethodHandles.lookup()))
                .unreflectSpecial(m, declaringClass)
                .bindTo(o)
                .invokeWithArguments(params);
        } catch (NoSuchMethodException t) {
            throw t;
        } catch (Throwable t) {
            throw new WrappedException(t);
        }
    }
730145
private MethodSymbol makePrivateSyntheticMethod(long flags, Name name, Type type, Symbol owner) {
        return new MethodSymbol(flags | SYNTHETIC | PRIVATE, name, type, owner);
    }
1168912
def serialize(self, private=False):
        
        if not self.priv_key and not self.pub_key:
            raise SerializationNotPossible()

        res = self.common()

        public_longs = list(set(self.public_members) & set(self.longs))
        for param in public_longs:
            item = getattr(self, param)
            if item:
                res[param] = item

        if private:
            for param in self.longs:
                if not private and param in ["d", "p", "q", "dp", "dq", "di",
                                             "qi"]:
                    continue
                item = getattr(self, param)
                if item:
                    res[param] = item
        if self.x5c:
            res['x5c'] = [x.decode('utf-8') for x in self.x5c]

        return res
909619
def convert_func(self, func):
        

        if func == 'ln':
            return 'log'
        elif func == 'random':
            return 'random.uniform'
        elif func == 'H':
            def heaviside_step(x):
                if x < 0: return 0
                elif x > 0: return 1
                else: return 0.5 
            return 'heaviside_step'
        else:
            return func
1314394
function RSADoPrivate(x) {
  if(this.p == null || this.q == null)
    return x.modPow(this.d, this.n);

  // TODO: re-calculate any missing CRT params
  var xp = x.mod(this.p).modPow(this.dmp1, this.p);
  var xq = x.mod(this.q).modPow(this.dmq1, this.q);

  while(xp.compareTo(xq) < 0)
    xp = xp.add(this.p);
  return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);
}
1010291
def private_names_for(cls, names):
    """"""
    if not isinstance(names, Iterable):
        raise TypeError('names must be an interable')
    return (private_name_for(item, cls) for item in names)
266524
def convert_result(converter):
    """"""

    def decorate(fn):
        @inspection.wraps(fn)
        def new_fn(*args, **kwargs):
            return converter(fn(*args, **kwargs))

        return new_fn

    return decorate
1130688
function () {
            var args = Array.prototype.slice.call(arguments, 0);
            if (args.length < 1) {
                throw new Error("Must specify at least one argument to AnyConverter");
            }
            
            var values = {};
            for (var i = 0, len = args.length; i < len; i += 1) {
                var arg = args[i];
                values[arg.toLowerCase()] = arg;
            }
            
            return spawn(AnyConverter.prototype, {
                _values: values,
                regex: "(?:" + args.map(regexpEscape).join("|") + ")",
                weight: 200
            });
        }
1165067
def _encrypt_private(self, ret, dictkey, target):
        '''
        
        '''
        # encrypt with a specific AES key
        pubfn = os.path.join(self.opts['pki_dir'],
                             'minions',
                             target)
        key = salt.crypt.Crypticle.generate_key_string()
        pcrypt = salt.crypt.Crypticle(
            self.opts,
            key)
        try:
            pub = salt.crypt.get_rsa_pub_key(pubfn)
        except (ValueError, IndexError, TypeError):
            return self.crypticle.dumps({})
        except IOError:
            log.error('AES key not found')
            return {'error': 'AES key not found'}

        pret = {}
        if not six.PY2:
            key = salt.utils.stringutils.to_bytes(key)
        if HAS_M2:
            pret['key'] = pub.public_encrypt(key, RSA.pkcs1_oaep_padding)
        else:
            cipher = PKCS1_OAEP.new(pub)
            pret['key'] = cipher.encrypt(key)
        pret[dictkey] = pcrypt.dumps(
            ret if ret is not False else {}
        )
        return pret