Parse a collection of relations.
@param {Object} response - The collection, containing relations as described
in parseRelation().
@returns {Object} The parsed collection, containing relations as described
in parseRelation().
973438
function parseRelations(response) {
  let entities = {};
  Object.keys(response).forEach(key => {
    entities[key] = parseRelation(response[key]);
  });
  return entities;
}
1118563
function convertResponse(response) {
      var results = {tables: [], indexes: []};
      var i=0;
      var start=0;
      if (dbName) {
        results.db = response[0];
        start++;
        i++;
      }
      while (i < start + tableNames.length) {
        tableName = tableNames[i-start];
        results.tables[i-start]=response[i];
        i++;
      }
      start = start + tableNames.length;
      if (tableNames.length > 0) {
        var j = 0;
        var indexNames = Object.keys(tables[tableNames[j]].indexOpts);
        var indexResults;
        indexResults = [];
        results.indexes[j] = indexResults;
        while (i < response.length) {
          indexResults[i-start] = response[i];
          i++;
          while (i-start >= indexNames.length && i < response.length){
            j++;
            indexNames = Object.keys(tables[tableNames[j]].indexOpts);
            indexResults = [];
            results.indexes[j] = indexResults;
            start = i;
          }
        }
      }
      return results;
    }
1286570
function parseArrayElements (parser, responses, i) {
  const bufferLength = parser.buffer.length
  while (i < responses.length) {
    const offset = parser.offset
    if (parser.offset >= bufferLength) {
      pushArrayCache(parser, responses, i)
      return
    }
    const response = parseType(parser, parser.buffer[parser.offset++])
    if (response === undefined) {
      if (!(parser.arrayCache.length || parser.bufferCache.length)) {
        parser.offset = offset
      }
      pushArrayCache(parser, responses, i)
      return
    }
    responses[i] = response
    i++
  }

  return responses
}
1084806
def parse_solr_response(response)
      rows = []

      response.docs.each do |doc|
        id = doc['id'].split('/').last
        isShownAt_id = doc['isShownAt_id'].respond_to?(:first) ?
          doc['isShownAt_id'].first : '__MISSING__'

        if doc[field].present?
          doc[field].each do |value|
            rows << { :id => id,
                      field.to_sym => value,
                      :isShownAt_id => isShownAt_id }
          end
        else
          rows << { :id => id,
                    field.to_sym => '__MISSING__',
                    :isShownAt_id => isShownAt_id }
        end
      end

      rows
    end
814967
def parse_response(response):
    
    if isinstance(response, tuple):
        if len(response) > 2:
            return response[0], response[1], response[2]
        elif len(response) > 1:
            return response[0], response[1], {}
    try:
        return response.data, response.status_code, response.headers
    except AttributeError:
        return response, 200, {}
371579
public static function parseResponse(Response $response)
    {
        $jsonData = \GuzzleHttp\json_decode($response->getBody(), true);
        if ($jsonData && 0 == $jsonData['retcode']) {
            $discusses = [];
            foreach ($jsonData['result']['dnamelist'] as $discussData) {
                $discusses[] = EntityFactory::createEntity(Discuss::class, [
                     'id' => $discussData['did'],
                     'name' => $discussData['name'],
                ]);
            }

            return new EntityCollection($discusses);
        }
        throw new ResponseException($jsonData['retcode'], $response);
    }
1266099
def parse_bundle_collection(body)
        dom = parse_and_validate_response(body, :root_name => 'bundles')
        dom.root.elements.collect('bundle') { |xml| Bundle.from_rexml(xml) }
      end
580340
function parseMissingResources(response) {
  return response.body.data &&
    response.body.data.relationships &&
    response.body.data.relationships['missing-resources'] &&
    response.body.data.relationships['missing-resources'].data || [];
}
970650
public Map<Names, String> parseResponse(JSONArray response) throws CommandExecutionException {
        if (response == null) throw  new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE);
        if (response.length() != props.length) throw  new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE);
        Map<Names, String> ret = new HashMap<>(props.length);
        for (int i = 0; i < props.length; i++){
            ret.put(props[i], response.optString(i, ""));
        }
        return ret;
    }
1305686
def relations_to(self, target, include_object=False):
        '''  '''
        if include_object:
            _ = self._execute('''
                select name, (select code from objects where id=src) from relations where dst=?
            ''', (self._id_of(target),))
            for i in _:
                yield self.deserialize(i[1]), i[0]
        else:
            _ = self._execute('''
                select distinct name from relations where dst=?
            ''', (self._id_of(target),))
            for i in _:
                yield i[0]
171938
def get_collection(id)
      response = self.get('collections', id).body
      return OmekaClient::OmekaCollection.new(self, JSON.parse(response))
    end
75423
async def parse_response(self, connection, command_name, **options):
        ""
        response = await connection.read_response()
        if command_name in self.response_callbacks:
            callback = self.response_callbacks[command_name]
            return callback(response, **options)
        return response
205735
def _read_response(self, response):
        
        self.name = response['name']
        self.includesPattern = response['includesPattern']
        self.excludesPattern = response['excludesPattern']
        self._repositories = response.get('repositories', [])
        if 'principals' in response:
            if 'users' in response['principals']:
                self._users = response['principals']['users']
            if 'groups' in response['principals']:
                self._groups = response['principals']['groups']
245956
function(req, res, next, relationship) {
		if(req.fullModel.hasRelationship(relationship)) {
			return next();
		}

		return responseUtils.respond(res, 400); //Malformed syntax or a bad query
	}
515690
function(response) {
        var chunks = [];

        response.on('data', function(chunk) {
            chunks.push(chunk);
        });

        response.on('end', function() {
            var json = JSON.parse(chunks.join(''));
            this._showOutputInfo(json);
            this._handleOutput(json);
        }.bind(this));
    }
131967
function parseResponse(response) {
  let text;

  if (response && response.content && (typeof response.content === 'string')) {
    text = response.content;
  }

  if (response && response.text && (typeof response.text === 'string')) {
    text = response.text;
  }

  if (!text) {
    console.error('Did not supply any matching response format. Response is:', text);
    return null;
  }

  try {
    const parsedResponse = JSON.parse(text);

    if (
      parsedResponse
      && parsedResponse.data
      && (parsedResponse.data instanceof Object === true)
    ) {
      return parsedResponse.data;
    }
  } catch (err) {
    console.error('Error while parsing JSON', err);
  }

  return null;
}
1264309
def parse_response(self, connection, command_name, **options):
        ""
        try:
            response = connection.read_response()
        except ResponseError:
            if EMPTY_RESPONSE in options:
                return options[EMPTY_RESPONSE]
            raise
        if command_name in self.response_callbacks:
            return self.response_callbacks[command_name](response, **options)
        return response