Decode raw response from Consul
 Set `@lock_modify_index`, `@lock_content`, and `@members`
 @returns [Array] List of members
5456
def decode_semaphore_state
      lock_key = state.find { |k| k['Key'] == @lock }
      member_keys = state.delete_if { |k| k['Key'] == @lock }
      member_keys.map! { |k| k['Key'] }

      unless lock_key.nil?
        @lock_modify_index = lock_key['ModifyIndex']
        @lock_content = JSON.parse(lock_key['Value'])
      end
      @members = member_keys.map { |k| k.split('/')[-1] }
    end
932540
def decode_offset_commit_response(cls, data):
        
        ((correlation_id,), cur) = relative_unpack('>i', data, 0)
        ((num_topics,), cur) = relative_unpack('>i', data, cur)

        for _ in xrange(num_topics):
            (topic, cur) = read_short_string(data, cur)
            ((num_partitions,), cur) = relative_unpack('>i', data, cur)

            for _ in xrange(num_partitions):
                ((partition, error), cur) = relative_unpack('>ih', data, cur)
                yield OffsetCommitResponse(topic, partition, error)
235432
def to_array(self):
        
        array = super(ChatMember, self).to_array()
        array['user'] = self.user.to_array()  # type User

        array['status'] = u(self.status)  # py2: type unicode, py3: type str

        if self.until_date is not None:
            array['until_date'] = int(self.until_date)  # type int
        if self.can_be_edited is not None:
            array['can_be_edited'] = bool(self.can_be_edited)  # type bool
        if self.can_change_info is not None:
            array['can_change_info'] = bool(self.can_change_info)  # type bool
        if self.can_post_messages is not None:
            array['can_post_messages'] = bool(self.can_post_messages)  # type bool
        if self.can_edit_messages is not None:
            array['can_edit_messages'] = bool(self.can_edit_messages)  # type bool
        if self.can_delete_messages is not None:
            array['can_delete_messages'] = bool(self.can_delete_messages)  # type bool
        if self.can_invite_users is not None:
            array['can_invite_users'] = bool(self.can_invite_users)  # type bool
        if self.can_restrict_members is not None:
            array['can_restrict_members'] = bool(self.can_restrict_members)  # type bool
        if self.can_pin_messages is not None:
            array['can_pin_messages'] = bool(self.can_pin_messages)  # type bool
        if self.can_promote_members is not None:
            array['can_promote_members'] = bool(self.can_promote_members)  # type bool
        if self.can_send_messages is not None:
            array['can_send_messages'] = bool(self.can_send_messages)  # type bool
        if self.can_send_media_messages is not None:
            array['can_send_media_messages'] = bool(self.can_send_media_messages)  # type bool
        if self.can_send_other_messages is not None:
            array['can_send_other_messages'] = bool(self.can_send_other_messages)  # type bool
        if self.can_add_web_page_previews is not None:
            array['can_add_web_page_previews'] = bool(self.can_add_web_page_previews)  # type bool
        return array
940834
def parse(cls, backend, ik, spk, spk_signature, otpks):
        

        ik = backend.decodePublicKey(ik)[0]

        spk["key"] = backend.decodePublicKey(spk["key"])[0]

        otpks = list(map(lambda otpk: {
            "key" : backend.decodePublicKey(otpk["key"])[0],
            "id"  : otpk["id"]
        }, otpks))

        return cls(ik, spk, spk_signature, otpks)
1267064
def erlang_inspect(raw = false)
      result = '#{'
      each_with_index do |(key, val), i|
        result << ',' if i > 0
        result << Erlang.inspect(key, raw: raw)
        result << ' => '
        result << Erlang.inspect(val, raw: raw)
      end
      return result << '}'
    end
894204
def decode_response(client_message, to_object=None):
    
    parameters = dict(response=None)
    if not client_message.read_bool():
        parameters['response'] = to_object(client_message.read_data())
    return parameters
941089
def _user_raw_from_login_content(login_content):
    """"""
    matching_keys = [
        'displayName',
        'lastLogin',
        'active',
        'name',
        'isMe',
        'lastPasswordChangedDate',
        'passwordResetRequired',
        'groups',
        'roles',
        'email',
        'isAdmin',
        'createdDate',
        'modifiedDate',
        'createdByUser',
        'modifiedByUser',
        'userName',
        'id',
        'disabled'
    ]

    raw_data = {
        '$type': User._type,
    }

    for key in matching_keys:
        if key in login_content:
            raw_data[key] = login_content[key]

    return raw_data
58291
def _decode_embedded_list(src):
    '''
    
    '''
    output = []
    for elem in src:
        if isinstance(elem, dict):
            elem = _decode_embedded_dict(elem)
        elif isinstance(elem, list):
            elem = _decode_embedded_list(elem)  # pylint: disable=redefined-variable-type
        elif isinstance(elem, bytes):
            try:
                elem = elem.decode()
            except UnicodeError:
                pass
        output.append(elem)
    return output
148083
def to_hash
      result = @response

      # All JSON magic responses are an array with one item
      result = result.first

      # All JSON magic results contain one key on their object named
      # actioninfo
      result = result.values.first

      # The data in a JSON magic result is always an array. If that array
      # only has a single item, then just return that as the result. This is
      # a compromise as some actions that should always return arrays
      # (i.e. GetProviders) may return a single hash.
      if result.count == 1
        result = result.first
      end

      result = convert_dates_to_utc(result)
      Utilities::recursively_symbolize_keys(result)
    end
60665
def list_tokens(opts):
    '''
    
    '''
    ret = []
    redis_client = _redis_client(opts)
    if not redis_client:
        return []
    serial = salt.payload.Serial(opts)
    try:
        return [k.decode('utf8') for k in redis_client.keys()]
    except Exception as err:
        log.warning('Failed to list keys: %s', err)
        return []
196629
def decode_response(client_message, to_object=None):
    
    parameters = dict(read_count=None, items=None)
    parameters['read_count'] = client_message.read_int()
    items_size = client_message.read_int()
    items = []
    for _ in range(0, items_size):
        items_item = client_message.read_data()
        items.append(items_item)
    parameters['items'] = ImmutableLazyDataList(items, to_object)
    return parameters
394011
def decode_response(client_message, to_object=None):
    
    parameters = dict(base=None, increment=None, batch_size=None)
    parameters['base'] = client_message.read_long()
    parameters['increment'] = client_message.read_long()
    parameters['batch_size'] = client_message.read_int()
    return parameters
814989
def members(self):
        
        if self.serialized:
            return set(map(
                self._loads, self._client.smembers(self.key_prefix)))
        else:
            return set(map(
                self._decode, self._client.smembers(self.key_prefix)))
449949
private function decodeLockFile(): array
    {
        $data = [];

        $encoder = $this->jsonEncoderFactory->getEncoder();
        if (file_exists($this->rootDirectory . 'composer.lock')) {
            $data = $encoder->decode(
                file_get_contents($this->rootDirectory.'composer.lock'),
                JsonEncoder::FORMAT
            );
        }

        return $data;
    }
59346
function parseQueryMeta(res) {
  var meta = {};

  if (res && res.headers) {
    if (res.headers['x-consul-index']) {
      meta.LastIndex = res.headers['x-consul-index'];
    }
    if (res.headers['x-consul-lastcontact']) {
      meta.LastContact = parseInt(res.headers['x-consul-lastcontact'], 10);
    }
    if (res.headers['x-consul-knownleader']) {
      meta.KnownLeader = res.headers['x-consul-knownleader'] === 'true';
    }
    if (res.headers['x-consul-translate-addresses']) {
      meta.AddressTranslationEnabled = res.headers['x-consul-translate-addresses'] === 'true';
    }
  }

  return meta;
}
141848
function getMembers(index) {
  if (this._members === undefined) {
    this._members = _(getValue(this, 'member') || getValue(this, 'memberOf'))
      .split(/,\s*/)
      .compact()
      .sort(util.compareNatural)
      .value();
  }
  var result = this._members;
  return index === undefined ? result : result[index];
}
107800
def read_members(self, container_id, query_membership=None):
        
        route_values = {}
        if container_id is not None:
            route_values['containerId'] = self._serialize.url('container_id', container_id, 'str')
        query_parameters = {}
        if query_membership is not None:
            query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str')
        response = self._send(http_method='GET',
                              location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775',
                              version='5.0-preview.1',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('[str]', self._unwrap_collection(response))