This method is modelled from SearchBuilder.searchForIdsWithAndOr()
352005
private SubscriptionMatchResult matchIdsWithAndOr(String theParamName, List<List<IQueryParameterType>> theAndOrParams, RuntimeResourceDefinition theResourceDefinition, IBaseResource theResource, ResourceIndexedSearchParams theSearchParams) {
		if (theAndOrParams.isEmpty()) {
			return SubscriptionMatchResult.successfulMatch();
		}

		if (hasQualifiers(theAndOrParams)) {
			return SubscriptionMatchResult.unsupportedFromParameterAndReason(theParamName, SubscriptionMatchResult.STANDARD_PARAMETER);
		}
		if (hasPrefixes(theAndOrParams)) {

			return SubscriptionMatchResult.unsupportedFromParameterAndReason(theParamName, SubscriptionMatchResult.PREFIX);

		}
		if (hasChain(theAndOrParams)) {
			return SubscriptionMatchResult.unsupportedFromParameterAndReason(theParamName, SubscriptionMatchResult.CHAIN);
		}
		switch (theParamName) {
			case IAnyResource.SP_RES_ID:

				return SubscriptionMatchResult.fromBoolean(matchIdsAndOr(theAndOrParams, theResource));

			case IAnyResource.SP_RES_LANGUAGE:
			case Constants.PARAM_HAS:
			case Constants.PARAM_TAG:
			case Constants.PARAM_PROFILE:
			case Constants.PARAM_SECURITY:

				return SubscriptionMatchResult.unsupportedFromParameterAndReason(theParamName, SubscriptionMatchResult.PARAM);

			default:

				String resourceName = theResourceDefinition.getName();
				RuntimeSearchParam paramDef = mySearchParamRegistry.getActiveSearchParam(resourceName, theParamName);
				return matchResourceParam(theParamName, theAndOrParams, theSearchParams, resourceName, paramDef);
		}
	}
793242
private StringBuilder queryProcessing(TmdbParameters params) {
        StringBuilder urlString = new StringBuilder();

        // Append the suffix of the API URL
        if (submethod != MethodSub.NONE) {
            urlString.append("/").append(submethod.getValue());
        }

        // Append the key information
        urlString.append(DELIMITER_FIRST)
                .append(Param.API_KEY.getValue())
                .append(apiKey)
                .append(DELIMITER_SUBSEQUENT)// Append the search term
                .append(Param.QUERY.getValue());

        String query = (String) params.get(Param.QUERY);

        try {
            urlString.append(URLEncoder.encode(query, "UTF-8"));
        } catch (UnsupportedEncodingException ex) {
            LOG.trace("Unable to encode query: '{}' trying raw.", query, ex);
            // If we can't encode it, try it raw
            urlString.append(query);
        }

        return urlString;
    }
332072
private MethodHandle findIdReadMethod() {
    try {
      Method readMethod = clazz.getMethod(READ_METHOD_NAME);
      Class<?> dataClass = readMethod.getReturnType();
      DataType dataType = IdentifierMetadata.DataType.forClass(dataClass);
      if (dataType == null) {
        String pattern = "Method %s in class %s must have a return type of long, Long or String";
        String error = String.format(pattern, READ_METHOD_NAME, clazz.getName());
        throw new EntityManagerException(error);
      }
      return MethodHandles.lookup().unreflect(readMethod);
    } catch (NoSuchMethodException | SecurityException | IllegalAccessException exp) {
      String error = String.format("Class %s must have a public %s method", clazz.getName(),
          READ_METHOD_NAME);
      throw new EntityManagerException(error, exp);
    }
  }
896394
@Override
    protected void searchStep() {
        // check: valid subset size range completely explored?
        if(validSubsetSizeRangeExplored()){
            // we are done
            stop();
        } else {
            int numAdd, numDel;
            if(isIncreasing()){
                // perform L additions
                numAdd = greedyMoves(l, singleAddNeigh);
                // perform number of deletions (<= R) that yields a delta of |L-R|,
                // taking into account the actual number of added items
                numDel = numAdd - getDelta();
                greedyMoves(numDel, singleDelNeigh);
            } else {
                // perform R deletions
                numDel = greedyMoves(r, singleDelNeigh);
                // perform number of additions (<= L) that yields a delta of |L-R|,
                // taking into account the actual number of deleted items
                numAdd = numDel - getDelta();
                greedyMoves(numAdd, singleAddNeigh);
            }
            if(numAdd == 0 || numDel == 0){
                stop();
            }
        }
    }
97354
@Override
    public BatchMetricQuery findBatchById(String id) {
        String json = _cacheService.get(ROOT + id);
        if (json == null) {
            return null;
        }
        try {
            Map<String, Object> batchData = MAPPER.readValue(json, new TypeReference<HashMap<String, Object>>() {});
            Status status = BatchMetricQuery.Status.fromInt((Integer) batchData.get("status"));
            int ttl = Integer.valueOf(batchData.get("ttl").toString());
            long createdDate = Long.valueOf(batchData.get("createdDate").toString());
            String ownerName = (String) batchData.get("ownerName");
            String batchId = (String) batchData.get("batchId");
            List<AsyncBatchedMetricQuery> queries = new ArrayList<>();

            int[] indices = MAPPER.readValue((String) batchData.get("indices"), int[].class);
            for (int index: indices) {
                queries.add(_findQueryById(batchId, index));
            }
            BatchMetricQuery batch = new BatchMetricQuery(status, ttl, createdDate, batchId, ownerName, queries);
            return batch;
        } catch (IOException ex) {
            throw new SystemException(ex);
        }
    }
182110
@Override
    public Blob loadForID(String id) throws SQLException {
        Connection c = dataSource.getConnection();
        PreparedStatement preparedStatement = c.prepareStatement(loadStatement());
        preparedStatement.setString(1, id);
        ResultSet r = preparedStatement.executeQuery();
        if (r.wasNull() || !r.next()) {
            return null;
        } else {
            Blob first = r.getBlob(2);
            return first;
        }


    }
93491
private ODocument getEdgeWithPossibleId(String start, String end, List<String> ids) {
        List<ODocument> edges = getEdgesBetweenModels(start, end);
        for (ODocument edge : edges) {
            if (ids.contains(OrientModelGraphUtils.getIdFieldValue(edge))) {
                return edge;
            }
        }
        return edges.size() != 0 ? edges.get(0) : null;
    }
806627
public byte[] getPQCodeByte(String id) throws Exception {
		int iid = getInternalId(id);
		if (iid == -1) {
			throw new Exception("Id does not exist!");
		}
		if (numProductCentroids > 256) {
			throw new Exception("Call the short variant of the method!");
		}

		DatabaseEntry key = new DatabaseEntry();
		IntegerBinding.intToEntry(iid, key);
		DatabaseEntry data = new DatabaseEntry();
		if ((iidToIvfpqDB.get(null, key, data, null) == OperationStatus.SUCCESS)) {
			TupleInput input = TupleBinding.entryToInput(data);
			input.readInt(); // skip the list id
			byte[] code = new byte[numSubVectors];
			for (int i = 0; i < numSubVectors; i++) {
				code[i] = input.readByte();
			}
			return code;
		} else {
			throw new Exception("Id does not exist!");
		}
	}
294253
public String getRequestById(long requestId, boolean withErrors, boolean withData, String marshallingType) {

        String result = null;

        RequestInfo request = executorService.getRequestById(requestId);

        if (request == null) {
            throw new IllegalArgumentException("Request with id: " + requestId + " doesn't exist");
        } else {
            RequestInfoInstance requestInstance = convertToRequestInfo(request, withErrors, withData);

            String deploymentId = ((org.jbpm.executor.entities.RequestInfo) request).getDeploymentId();
            if (deploymentId != null && context.getContainer(deploymentId) != null) {
                result = marshallerHelper.marshal(deploymentId, marshallingType, requestInstance);
            } else {
                result = marshallerHelper.marshal(marshallingType, requestInstance);
            }
        }

        return result;
    }
399867
@Override
    public Object[] findIdsByColumn(String schemaName, String tableName, String pKeyName, String columnName,
            Object columnValue, Class entityClazz)
    {

        TermQueryBuilder filter = QueryBuilders.termQuery(columnName, columnValue);

        SearchResponse response = txClient.prepareSearch(schemaName.toLowerCase()).setTypes(tableName)
                .addField(pKeyName).setPostFilter(filter).execute().actionGet();

        SearchHits hits = response.getHits();

        Long length = hits.getTotalHits();
        int absoluteLength = length.intValue();
        Object[] ids = new Object[absoluteLength];

        int counter = 0;
        for (SearchHit hit : hits.getHits())
        {
            Map<String, SearchHitField> fields = hit.getFields();
            ids[counter++] = fields.get(pKeyName).getValue();
        }

        return ids;
    }
1140248
private void decodeDictionaryIds(
      int rowId,
      int num,
      WritableColumnVector column,
      WritableColumnVector dictionaryIds) {
    switch (descriptor.getPrimitiveType().getPrimitiveTypeName()) {
      case INT32:
        if (column.dataType() == DataTypes.IntegerType ||
            DecimalType.is32BitDecimalType(column.dataType())) {
          for (int i = rowId; i < rowId + num; ++i) {
            if (!column.isNullAt(i)) {
              column.putInt(i, dictionary.decodeToInt(dictionaryIds.getDictId(i)));
            }
          }
        } else if (column.dataType() == DataTypes.ByteType) {
          for (int i = rowId; i < rowId + num; ++i) {
            if (!column.isNullAt(i)) {
              column.putByte(i, (byte) dictionary.decodeToInt(dictionaryIds.getDictId(i)));
            }
          }
        } else if (column.dataType() == DataTypes.ShortType) {
          for (int i = rowId; i < rowId + num; ++i) {
            if (!column.isNullAt(i)) {
              column.putShort(i, (short) dictionary.decodeToInt(dictionaryIds.getDictId(i)));
            }
          }
        } else {
          throw constructConvertNotSupportedException(descriptor, column);
        }
        break;

      case INT64:
        if (column.dataType() == DataTypes.LongType ||
            DecimalType.is64BitDecimalType(column.dataType()) ||
            originalType == OriginalType.TIMESTAMP_MICROS) {
          for (int i = rowId; i < rowId + num; ++i) {
            if (!column.isNullAt(i)) {
              column.putLong(i, dictionary.decodeToLong(dictionaryIds.getDictId(i)));
            }
          }
        } else if (originalType == OriginalType.TIMESTAMP_MILLIS) {
          for (int i = rowId; i < rowId + num; ++i) {
            if (!column.isNullAt(i)) {
              column.putLong(i,
                DateTimeUtils.fromMillis(dictionary.decodeToLong(dictionaryIds.getDictId(i))));
            }
          }
        } else {
          throw constructConvertNotSupportedException(descriptor, column);
        }
        break;

      case FLOAT:
        for (int i = rowId; i < rowId + num; ++i) {
          if (!column.isNullAt(i)) {
            column.putFloat(i, dictionary.decodeToFloat(dictionaryIds.getDictId(i)));
          }
        }
        break;

      case DOUBLE:
        for (int i = rowId; i < rowId + num; ++i) {
          if (!column.isNullAt(i)) {
            column.putDouble(i, dictionary.decodeToDouble(dictionaryIds.getDictId(i)));
          }
        }
        break;
      case INT96:
        if (column.dataType() == DataTypes.TimestampType) {
          if (!shouldConvertTimestamps()) {
            for (int i = rowId; i < rowId + num; ++i) {
              if (!column.isNullAt(i)) {
                Binary v = dictionary.decodeToBinary(dictionaryIds.getDictId(i));
                column.putLong(i, ParquetRowConverter.binaryToSQLTimestamp(v));
              }
            }
          } else {
            for (int i = rowId; i < rowId + num; ++i) {
              if (!column.isNullAt(i)) {
                Binary v = dictionary.decodeToBinary(dictionaryIds.getDictId(i));
                long rawTime = ParquetRowConverter.binaryToSQLTimestamp(v);
                long adjTime = DateTimeUtils.convertTz(rawTime, convertTz, UTC);
                column.putLong(i, adjTime);
              }
            }
          }
        } else {
          throw constructConvertNotSupportedException(descriptor, column);
        }
        break;
      case BINARY:
        // TODO: this is incredibly inefficient as it blows up the dictionary right here. We
        // need to do this better. We should probably add the dictionary data to the ColumnVector
        // and reuse it across batches. This should mean adding a ByteArray would just update
        // the length and offset.
        for (int i = rowId; i < rowId + num; ++i) {
          if (!column.isNullAt(i)) {
            Binary v = dictionary.decodeToBinary(dictionaryIds.getDictId(i));
            column.putByteArray(i, v.getBytes());
          }
        }
        break;
      case FIXED_LEN_BYTE_ARRAY:
        // DecimalType written in the legacy mode
        if (DecimalType.is32BitDecimalType(column.dataType())) {
          for (int i = rowId; i < rowId + num; ++i) {
            if (!column.isNullAt(i)) {
              Binary v = dictionary.decodeToBinary(dictionaryIds.getDictId(i));
              column.putInt(i, (int) ParquetRowConverter.binaryToUnscaledLong(v));
            }
          }
        } else if (DecimalType.is64BitDecimalType(column.dataType())) {
          for (int i = rowId; i < rowId + num; ++i) {
            if (!column.isNullAt(i)) {
              Binary v = dictionary.decodeToBinary(dictionaryIds.getDictId(i));
              column.putLong(i, ParquetRowConverter.binaryToUnscaledLong(v));
            }
          }
        } else if (DecimalType.isByteArrayDecimalType(column.dataType())) {
          for (int i = rowId; i < rowId + num; ++i) {
            if (!column.isNullAt(i)) {
              Binary v = dictionary.decodeToBinary(dictionaryIds.getDictId(i));
              column.putByteArray(i, v.getBytes());
            }
          }
        } else {
          throw constructConvertNotSupportedException(descriptor, column);
        }
        break;

      default:
        throw new UnsupportedOperationException(
          "Unsupported type: " + descriptor.getPrimitiveType().getPrimitiveTypeName());
    }
  }
636218
public DataWriterBuilder<S, D> withAttemptId(String attemptId) {
    this.writerAttemptId = attemptId;
    log.debug("With writerAttemptId: {}", this.writerAttemptId);
    return this;
  }
1243648
protected T _jdoLoad(
                    final K id
                    )
    {
        if (id == null) {
            return null;
        }

        Object  p_object = null;
        try {
            p_object = getCastorTemplate().load( _objectType, id );
        } catch (DataAccessException ex) {
            Throwable  cause = ex.getMostSpecificCause();
            if (ObjectNotFoundException.class.isInstance( cause )) {
                p_object = null;
            } else {
                throw new PersistenceException( cause );
            }
        }


        T  typedObject = _objectType.cast( p_object );
//        _afterLoad( typedObject );

        return typedObject;
    }
1238624
public @CheckForNull D findByName(String id) {
        for (D d : this)
            if(d.getId().equals(id))
                return d;
        return null;
    }
173922
public Edge lookupEdgeById(int id) {
        Iterator<Edge> i = edgeIterator();
        while (i.hasNext()) {
            Edge edge = i.next();
            if (edge.getId() == id) {
                return edge;
            }
        }
        return null;
    }
555378
private int findIndexForName(String[] fieldNames, String searchName)
    {
        for(int i = 0; i < fieldNames.length; i++)
        {
            if(searchName.equals(fieldNames[i]))
            {
                return i;
            }
        }
        throw new PersistenceBrokerException("Can't find field name '" + searchName +
                "' in given array of field names");
    }
799773
def search(self,
               id_list: List,
               negated_classes: List,
               limit: Optional[int],
               method: Optional) -> List[SimResult]:
        
        raise NotImplementedError