Unpack operation key/values before representing an OpenAPIPathItem
501397
def representCleanOpenAPIPathItem(dumper, data):
    
    dct = _orderedCleanDict(data)
    if '_operations' in dct:
        items = sorted(data._operations.items())
        for k, op in items:
            dct[k] = op
        del dct['_operations']

    return dumper.yaml_representers[type(dct)](dumper, dct)
955262
def get_dict_from_response(response):
    """"""
    result = {}
    if getattr(response, '_resp') and response._resp.code > 400:
        return result

    for i in response.data:
        # strip the schema from the key
        k = i['Type'].replace(REMOTE_APP_RESOURCE_SCHEMA, '')
        result.setdefault(k, list())
        result[k].append(i['Value'])
    return result
513368
function unbox(value){
  if (value instanceof ResType) return when(value, unbox)
  if (value && typeof value == 'object') return unboxAll(value)
  return value
}
524401
def unpack(packed, object_hook=decode,
           list_hook=None, use_list=False, encoding='utf-8',
           unicode_errors='strict', object_pairs_hook=None,
           max_buffer_size=0, ext_hook=ExtType):
    

    return Unpacker(packed, object_hook=object_hook,
                    list_hook=list_hook,
                    use_list=use_list, encoding=encoding,
                    unicode_errors=unicode_errors,
                    object_pairs_hook=object_pairs_hook,
                    max_buffer_size=max_buffer_size,
                    ext_hook=ext_hook)
348853
def representCleanOpenAPIOperation(dumper, data):
    
    dct = _orderedCleanDict(data)
    if '_extended' in dct:
        for k, ext in list(data._extended.items()):
            dct[k] = ext
        del dct['_extended']

    return dumper.yaml_representers[type(dct)](dumper, dct)
707760
def unpack(cls, val):
        '''
        
        '''
        reqdictf, incunitf, incval = val
        reqdict = {TimeUnit[k.upper()]: v for (k, v) in reqdictf.items()}
        incunit = None if incunitf is None else TimeUnit[incunitf.upper()]
        return cls(reqdict, incunit, incval)
799240
def unpack_hyperopt_vals(vals):
    
    assert isinstance(vals, dict), "Parameter must be given as dict."
    ret = {}
    for k, v in list(vals.items()):
        try:
            ret[k] = v[0]
        except (TypeError, IndexError):
            ret[k] = v
    return ret
728629
function extractOps(data) {
  const ops = {};

  _.forIn(data, (attribute, key) => {
    if (isOp(attribute)) {
      ops[key] = attribute;
      delete data[key];
    }
  });

  return ops;
}
769735
def unpack(self, buff, offset=0):
        """"""
        super().unpack(buff)

        class_name = self._get_body_class()
        buff = self.body.value
        self.body = FixedTypeList(pyof_class=class_name)
        self.body.unpack(buff)
1007104
function xop_operation_to_assembly_opcode_string(opcode) {
  for (let instr of Object.keys(OP_ADDR_MODE_TO_XOP)) {
    let allowed_addressing_modes = OP_ADDR_MODE_TO_XOP[instr];
    for (let addressing_mode of Object.keys(allowed_addressing_modes)) {
      let this_xop_operation = allowed_addressing_modes[addressing_mode];

      if (XOP[opcode] === this_xop_operation) {
        return instr;
      }
    }
  }
  return undefined;
}
149490
def convertToMapPic(byteString, mapWidth):
    """"""
    data = []
    line = ""
    for idx,char in enumerate(byteString):
        line += str(ord(char))
        if ((idx+1)%mapWidth)==0:
            data.append(line)
            line = ""
    return data
914567
def _unpack_object_array(inp, source, prescatter):
    
    raise NotImplementedError("Currently not used with record/struct/object improvements")
    base_rec, attr = source.rsplit(".", 1)
    new_name = "%s_%s_unpack" % (inp["name"], base_rec.replace(".", "_"))
    prescatter[base_rec].append((new_name, attr, _to_variable_type(inp["type"]["items"])))
    return new_name, prescatter
509859
function unpack(imValue) {
    var value;
    var valueType = Object.prototype.toString.call(imValue).slice(8, -1);
    switch (valueType) {
        case 'String':
            value = imValue + '';
            break;
        case 'Number':
            value = imValue + 0;
            break;
        case 'Boolean':
            value = imValue == true;
            break;
        case 'Array':
            value = imValue.map(function (ele) { return unpack(ele); });
            break;
        case 'Object':
            value = {};
            for (var key in imValue) {
                if (imValue.hasOwnProperty(key)) {
                    value[key] = unpack(imValue[key]);
                }
            }
            break;
        default: value = imValue;
    }
    return value;
}
1095637
def to_api(in_dict, int_keys=None, date_keys=None, bool_keys=None):
    """"""

    # Cast all int_keys to int()
    if int_keys:
        for in_key in int_keys:
            if (in_key in in_dict) and (in_dict.get(in_key, None) is not None):
                in_dict[in_key] = int(in_dict[in_key])

    # Cast all date_keys to datetime.isoformat
    if date_keys:
        for in_key in date_keys:
            if (in_key in in_dict) and (in_dict.get(in_key, None) is not None):

                _from = in_dict[in_key]

                if isinstance(_from, basestring):
                    dtime = parse_datetime(_from)

                elif isinstance(_from, datetime):
                    dtime = _from

                in_dict[in_key] = dtime.isoformat()

            elif (in_key in in_dict) and in_dict.get(in_key, None) is None:
                del in_dict[in_key]

    # Remove all Nones
    for k, v in in_dict.items():
        if v is None:
            del in_dict[k]

    return in_dict
905930
def _unwrap(x, deserializeFunc, decodeFunc=base64.urlsafe_b64decode, compress=True):
    
    return deserializeFunc(decodeFunc(x), compress)
1165360
def build_api_object(uo=None, api_key=None, uo_id=None, uo_type=None):
        
        if uo is not None:
            api_key = uo.resolve_api_key() if uo.resolve_api_key() is not None else api_key
            uo_id = uo.uo_id if uo.uo_id is not None else uo_id
            uo_type = uo.uo_type if uo.uo_type is not None else uo_type

        if uo_type is None or uo_type == EBConsts.INVALID_KEY_TYPE:
            uo_type = 0

        return "%s%010x%010x" % (api_key, uo_id, uo_type)
860990
function getKeys(params, key, allowEmpty) {
  if (!Array.isArray(params)) { throw new Error(`[ethjs-util] method getKeys expecting type Array as 'params' input, got '${typeof params}'`); }
  if (typeof key !== 'string') { throw new Error(`[ethjs-util] method getKeys expecting type String for input 'key' got '${typeof key}'.`); }

  var result = []; // eslint-disable-line

  for (var i = 0; i < params.length; i++) { // eslint-disable-line
    var value = params[i][key]; // eslint-disable-line
    if (allowEmpty && !value) {
      value = '';
    } else if (typeof(value) !== 'string') {
      throw new Error('invalid abi');
    }
    result.push(value);
  }

  return result;
}