text
stringlengths
81
112k
Add a value at the specified time to the series. :param count: The number of work items ready at the specified time. :param timestamp: The timestamp to add. Defaults to None, meaning current time. It should be strictly greater (newer) than the last added timestamp. ...
Pack the load averages into a nicely-keyed dictionary. def to_dict(self): """Pack the load averages into a nicely-keyed dictionary.""" result = {} for meta in self.intervals.values(): result[meta.display] = meta.value return result
See Also: listFormatsResponse() Args: vendorSpecific: Returns: def listFormats(self, vendorSpecific=None): """See Also: listFormatsResponse() Args: vendorSpecific: Returns: """ response = self.listFormatsResponse(vendorSpecific) r...
See Also: getFormatResponse() Args: formatId: vendorSpecific: Returns: def getFormat(self, formatId, vendorSpecific=None): """See Also: getFormatResponse() Args: formatId: vendorSpecific: Returns: """ response = self.g...
CNCore.getLogRecords(session[, fromDate][, toDate][, event][, start][, count]) → Log https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNCore.getLogRecords Implemented in d1_client.baseclient.py. CNCore.reserveIdentifier(session, pid) → Identifier h...
See Also: reserveIdentifierResponse() Args: pid: vendorSpecific: Returns: def reserveIdentifier(self, pid, vendorSpecific=None): """See Also: reserveIdentifierResponse() Args: pid: vendorSpecific: Returns: """ response...
See Also: listChecksumAlgorithmsResponse() Args: vendorSpecific: Returns: def listChecksumAlgorithms(self, vendorSpecific=None): """See Also: listChecksumAlgorithmsResponse() Args: vendorSpecific: Returns: """ response = self.listChecksum...
CNCore.setObsoletedBy(session, pid, obsoletedByPid, serialVersion) → boolean https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNCore.setObsoletedBy. Args: pid: obsoletedByPid: serialVersion: vendorSpecific: Returns:...
See Also: setObsoletedByResponse() Args: pid: obsoletedByPid: serialVersion: vendorSpecific: Returns: def setObsoletedBy(self, pid, obsoletedByPid, serialVersion, vendorSpecific=None): """See Also: setObsoletedByResponse() Args: pid: ...
See Also: listNodesResponse() Args: vendorSpecific: Returns: def listNodes(self, vendorSpecific=None): """See Also: listNodesResponse() Args: vendorSpecific: Returns: """ response = self.listNodesResponse(vendorSpecific) return se...
CNCore.registerSystemMetadata(session, pid, sysmeta) → Identifier CN INTERNAL. CNCore.hasReservation(session, pid) → boolean https://releases.dataone.org/online/api-documentation-v2.0.1/apis/CN_APIs.html#CNCore.hasReservation Args: pid: subject: vendorSpec...
See Also: hasReservationResponse() Args: pid: subject: vendorSpecific: Returns: def hasReservation(self, pid, subject, vendorSpecific=None): """See Also: hasReservationResponse() Args: pid: subject: vendorSpecific: ...
See Also: resolveResponse() Args: pid: vendorSpecific: Returns: def resolve(self, pid, vendorSpecific=None): """See Also: resolveResponse() Args: pid: vendorSpecific: Returns: """ response = self.resolveResponse(pid, v...
CNRead.search(session, queryType, query) → ObjectList https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNRead.search. Args: queryType: query: vendorSpecific: **kwargs: Returns: def searchResponse(self, queryType, q...
See Also: searchResponse() Args: queryType: query: vendorSpecific: **kwargs: Returns: def search(self, queryType, query=None, vendorSpecific=None, **kwargs): """See Also: searchResponse() Args: queryType: query: ve...
CNRead.query(session, queryEngine, query) → OctetStream https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNRead.query. Args: queryEngine: query: vendorSpecific: **kwargs: Returns: def queryResponse(self, queryEngin...
See Also: queryResponse() Args: queryEngine: query: vendorSpecific: **kwargs: Returns: def query(self, queryEngine, query=None, vendorSpecific=None, **kwargs): """See Also: queryResponse() Args: queryEngine: query: ...
CNAuthorization.setRightsHolder(session, pid, userId, serialVersion) → Identifier https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNAuthorization.setRightsHolder. Args: pid: userId: serialVersion: vendorSpecific: ...
See Also: setRightsHolderResponse() Args: pid: userId: serialVersion: vendorSpecific: Returns: def setRightsHolder(self, pid, userId, serialVersion, vendorSpecific=None): """See Also: setRightsHolderResponse() Args: pid: use...
CNAuthorization.setAccessPolicy(session, pid, accessPolicy, serialVersion) → boolean https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNAuthorization.setAccessPolicy. Args: pid: accessPolicy: serialVersion: vendorSpecific: ...
See Also: setAccessPolicyResponse() Args: pid: accessPolicy: serialVersion: vendorSpecific: Returns: def setAccessPolicy(self, pid, accessPolicy, serialVersion, vendorSpecific=None): """See Also: setAccessPolicyResponse() Args: pid: ...
CNIdentity.registerAccount(session, person) → Subject https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNIdentity.registerAccount. Args: person: vendorSpecific: Returns: def registerAccountResponse(self, person, vendorSpecific=None): ...
See Also: registerAccountResponse() Args: person: vendorSpecific: Returns: def registerAccount(self, person, vendorSpecific=None): """See Also: registerAccountResponse() Args: person: vendorSpecific: Returns: """ respo...
CNIdentity.updateAccount(session, person) → Subject https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNIdentity.updateAccount. Args: subject: person: vendorSpecific: Returns: def updateAccountResponse(self, subject, person, ...
See Also: updateAccountResponse() Args: subject: person: vendorSpecific: Returns: def updateAccount(self, subject, person, vendorSpecific=None): """See Also: updateAccountResponse() Args: subject: person: vendorSpecific: ...
See Also: verifyAccountResponse() Args: subject: vendorSpecific: Returns: def verifyAccount(self, subject, vendorSpecific=None): """See Also: verifyAccountResponse() Args: subject: vendorSpecific: Returns: """ response...
See Also: getSubjectInfoResponse() Args: subject: vendorSpecific: Returns: def getSubjectInfo(self, subject, vendorSpecific=None): """See Also: getSubjectInfoResponse() Args: subject: vendorSpecific: Returns: """ respo...
CNIdentity.listSubjects(session, query, status, start, count) → SubjectList https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNIdentity.listSubjects. Args: query: status: start: count: vendorSpecific: Retu...
See Also: listSubjectsResponse() Args: query: status: start: count: vendorSpecific: Returns: def listSubjects( self, query, status=None, start=None, count=None, vendorSpecific=None ): """See Also: listSubjectsResponse() Ar...
CNIdentity.mapIdentity(session, subject) → boolean https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNIdentity.mapIdentity. Args: primarySubject: secondarySubject: vendorSpecific: Returns: def mapIdentityResponse( se...
See Also: mapIdentityResponse() Args: primarySubject: secondarySubject: vendorSpecific: Returns: def mapIdentity(self, primarySubject, secondarySubject, vendorSpecific=None): """See Also: mapIdentityResponse() Args: primarySubject: se...
See Also: removeMapIdentityResponse() Args: subject: vendorSpecific: Returns: def removeMapIdentity(self, subject, vendorSpecific=None): """See Also: removeMapIdentityResponse() Args: subject: vendorSpecific: Returns: """ ...
See Also: denyMapIdentityResponse() Args: subject: vendorSpecific: Returns: def denyMapIdentity(self, subject, vendorSpecific=None): """See Also: denyMapIdentityResponse() Args: subject: vendorSpecific: Returns: """ re...
CNIdentity.requestMapIdentity(session, subject) → boolean https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNIdentity.requestMapIdentity. Args: subject: vendorSpecific: Returns: def requestMapIdentityResponse(self, subject, vendorSpec...
See Also: requestMapIdentityResponse() Args: subject: vendorSpecific: Returns: def requestMapIdentity(self, subject, vendorSpecific=None): """See Also: requestMapIdentityResponse() Args: subject: vendorSpecific: Returns: """ ...
See Also: confirmMapIdentityResponse() Args: subject: vendorSpecific: Returns: def confirmMapIdentity(self, subject, vendorSpecific=None): """See Also: confirmMapIdentityResponse() Args: subject: vendorSpecific: Returns: """ ...
CNIdentity.createGroup(session, groupName) → Subject https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNIdentity.createGroup. Args: group: vendorSpecific: Returns: def createGroupResponse(self, group, vendorSpecific=None): """...
See Also: createGroupResponse() Args: group: vendorSpecific: Returns: def createGroup(self, group, vendorSpecific=None): """See Also: createGroupResponse() Args: group: vendorSpecific: Returns: """ response = self.crea...
CNIdentity.addGroupMembers(session, groupName, members) → boolean https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNIdentity.addGroupMembers. Args: group: vendorSpecific: Returns: def updateGroupResponse(self, group, vendorSpecific=N...
See Also: updateGroupResponse() Args: group: vendorSpecific: Returns: def updateGroup(self, group, vendorSpecific=None): """See Also: updateGroupResponse() Args: group: vendorSpecific: Returns: """ response = self.upda...
CNReplication.setReplicationStatus(session, pid, nodeRef, status, failure) → boolean https://releases.dataone.org/online/api-documentatio n-v2.0.1/apis/CN_APIs.html#CNReplication.setReplicationStatus. Args: pid: nodeRef: status: dataoneError: ve...
See Also: setReplicationStatusResponse() Args: pid: nodeRef: status: dataoneError: vendorSpecific: Returns: def setReplicationStatus( self, pid, nodeRef, status, dataoneError=None, vendorSpecific=None ): """See Also: setReplication...
CNReplication.updateReplicationMetadata(session, pid, replicaMetadata, serialVersion) → boolean https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_AP Is.html#CNReplication.updateReplicationMetadata Not implemented. Args: pid: replicaMetadata: ...
See Also: updateReplicationMetadataResponse() Args: pid: replicaMetadata: serialVersion: vendorSpecific: Returns: def updateReplicationMetadata( self, pid, replicaMetadata, serialVersion, vendorSpecific=None ): """See Also: updateReplication...
CNReplication.setReplicationPolicy(session, pid, policy, serialVersion) → boolean https://releases.dataone.org/online/api-docume ntation-v2.0.1/apis/CN_APIs.html#CNReplication.setReplicationPolicy. Args: pid: policy: serialVersion: vendorSpecific: ...
See Also: setReplicationPolicyResponse() Args: pid: policy: serialVersion: vendorSpecific: Returns: def setReplicationPolicy(self, pid, policy, serialVersion, vendorSpecific=None): """See Also: setReplicationPolicyResponse() Args: pid...
CNReplication.isNodeAuthorized(session, targetNodeSubject, pid, replicatePermission) → boolean() https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNReplication.isNodeAuthorized. Args: targetNodeSubject: pid: vendorSpecific: R...
See Also: isNodeAuthorizedResponse() Args: targetNodeSubject: pid: vendorSpecific: Returns: def isNodeAuthorized(self, targetNodeSubject, pid, vendorSpecific=None): """See Also: isNodeAuthorizedResponse() Args: targetNodeSubject: pid:...
CNReplication.deleteReplicationMetadata(session, pid, policy, serialVersion) → boolean https://releases.dataone.org/online/api-docume ntation-v2.0.1/apis/CN_APIs.html#CNReplication.deleteReplicationMetadat a. Args: pid: nodeId: serialVersion: vendorSpeci...
See Also: deleteReplicationMetadataResponse() Args: pid: nodeId: serialVersion: vendorSpecific: Returns: def deleteReplicationMetadata( self, pid, nodeId, serialVersion, vendorSpecific=None ): """See Also: deleteReplicationMetadataResponse()...
CNRegister.updateNodeCapabilities(session, nodeId, node) → boolean https://releases.dataone.org/online/api-documentation-v2.0.1/apis/CN_AP Is.html#CNRegister.updateNodeCapabilities. Args: nodeId: node: vendorSpecific: Returns: def updateNodeCapabilitiesRe...
See Also: updateNodeCapabilitiesResponse() Args: nodeId: node: vendorSpecific: Returns: def updateNodeCapabilities(self, nodeId, node, vendorSpecific=None): """See Also: updateNodeCapabilitiesResponse() Args: nodeId: node: v...
CNRegister.register(session, node) → NodeReference https://releases.dataone.org/online/api- documentation-v2.0.1/apis/CN_APIs.html#CNRegister.register. Args: node: vendorSpecific: Returns: def registerResponse(self, node, vendorSpecific=None): """CNRegister...
See Also: registerResponse() Args: node: vendorSpecific: Returns: def register(self, node, vendorSpecific=None): """See Also: registerResponse() Args: node: vendorSpecific: Returns: """ response = self.registerResponse...
Validate schema. def valid(self, instance, schema): """Validate schema.""" try: jsonschema.validate(instance, schema) except jsonschema.exceptions.ValidationError as ex: self.stderr.write(" VALIDATION ERROR: {}".format(instance['name'] if 'name' in instance else '')) ...
Find descriptor schemas in given path. def find_descriptor_schemas(self, schema_file): """Find descriptor schemas in given path.""" if not schema_file.lower().endswith(('.yml', '.yaml')): return [] with open(schema_file) as fn: schemas = yaml.load(fn, Loader=yaml.FullLo...
Find schemas in packages that match filters. def find_schemas(self, schema_path, schema_type=SCHEMA_TYPE_PROCESS, verbosity=1): """Find schemas in packages that match filters.""" schema_matches = [] if not os.path.isdir(schema_path): if verbosity > 0: self.stdout.wr...
Read and register processors. def register_processes(self, process_schemas, user, force=False, verbosity=1): """Read and register processors.""" log_processors = [] log_templates = [] for p in process_schemas: # TODO: Remove this when all processes are migrated to the ...
Read and register descriptors. def register_descriptors(self, descriptor_schemas, user, force=False, verbosity=1): """Read and register descriptors.""" log_descriptors = [] for descriptor_schema in descriptor_schemas: for schema, _, _ in iterate_schema({}, descriptor_schema.get('sc...
Retire obsolete processes. Remove old process versions without data. Find processes that have been registered but do not exist in the code anymore, then: - If they do not have data: remove them - If they have data: flag them not active (``is_active=False``) def retire(self, process_sc...
Register processes. def handle(self, *args, **options): """Register processes.""" force = options.get('force') retire = options.get('retire') verbosity = int(options.get('verbosity')) users = get_user_model().objects.filter(is_superuser=True).order_by('date_joined') if...
Return True if ``did`` is the PID of an object that can be created with MNStorage.create() or MNStorage.update(). To be valid for create() and update(), the DID: - Must not be the PID of an object that exists on this MN - Must not be a known SID known to this MN - Must not have been accepted for r...
Return True if ``did`` is the PID of an object that can be updated (obsoleted) with MNStorage.update() def is_valid_pid_to_be_updated(did): """Return True if ``did`` is the PID of an object that can be updated (obsoleted) with MNStorage.update()""" return ( is_existing_object(did) and n...
Return True if ``sid`` can be assigned to the single object ``pid`` or to the chain to which ``pid`` belongs. - If the chain does not have a SID, the new SID must be previously unused. - If the chain already has a SID, the new SID must match the existing SID. All known PIDs are associated with a chain...
Return True if PID is for an object for which science bytes are stored locally. This excludes SIDs and PIDs for unprocessed replica requests, remote or non-existing revisions of local replicas and objects aggregated in Resource Maps. def is_existing_object(did): """Return True if PID is for an object for ...
Return a text fragment classifying the ``did`` Return <UNKNOWN> if the DID could not be classified. This should not normally happen and may indicate that the DID was orphaned in the database. def classify_identifier(did): """Return a text fragment classifying the ``did`` Return <UNKNOWN> if the DID c...
Includes unprocessed replication requests. def is_local_replica(pid): """Includes unprocessed replication requests.""" return d1_gmn.app.models.LocalReplica.objects.filter(pid__did=pid).exists()
Is local replica with status "queued". def is_unprocessed_local_replica(pid): """Is local replica with status "queued".""" return d1_gmn.app.models.LocalReplica.objects.filter( pid__did=pid, info__status__status='queued' ).exists()
For replicas, the PIDs referenced in revision chains are reserved for use by other replicas. def is_revision_chain_placeholder(pid): """For replicas, the PIDs referenced in revision chains are reserved for use by other replicas.""" return d1_gmn.app.models.ReplicaRevisionChainReference.objects.filter( ...
Return True if ``did`` is recorded in a local context. ``did``=None is supported and returns False. A DID can be classified with classify_identifier(). def _is_did(did): """Return True if ``did`` is recorded in a local context. ``did``=None is supported and returns False. A DID can be classifie...
Set dafault connection for ElasticSearch. .. warning:: In case of using multiprocessing/multithreading, connection will be probably initialized in the main process/thread and the same connection (socket) will be used in all processes/threads. This will cause some unexpected timeout...
Log an operation that was performed on a sciobj. def _log(pid, request, event, timestamp=None): """Log an operation that was performed on a sciobj.""" # Support logging events that are not associated with an object. sciobj_model = None if pid is not None: try: sciobj_model = d1_gmn....
Return True if this read event was generated by an automated process, as indicated by the user configurable LOG_IGNORE* settings. See settings_site.py for description and rationale for the settings. def _is_ignored_read_event(request): """Return True if this read event was generated by an automated proces...
Map action name to action level. def action_to_level(action): """Map action name to action level.""" try: return ACTION_LEVEL_MAP[action] except LookupError: raise d1_common.types.exceptions.InvalidRequest( 0, 'Unknown action. action="{}"'.format(action) )
Map action level to action name. def level_to_action(level): """Map action level to action name.""" try: return LEVEL_ACTION_MAP[level] except LookupError: raise d1_common.types.exceptions.InvalidRequest( 0, 'Unknown action level. level="{}"'.format(level) )
Get set of subjects that have unlimited access to all SciObj and APIs on this node. def get_trusted_subjects(): """Get set of subjects that have unlimited access to all SciObj and APIs on this node.""" cert_subj = _get_client_side_certificate_subject() return ( d1_gmn.app.node_registry.get_...
Determine if calling subject is fully trusted. def is_trusted_subject(request): """Determine if calling subject is fully trusted.""" logging.debug('Active subjects: {}'.format(', '.join(request.all_subjects_set))) logging.debug('Trusted subjects: {}'.format(', '.join(get_trusted_subjects()))) return no...
Return the DN from the client side certificate as a D1 subject if a client side cert has been configured. Else return None. def _get_client_side_certificate_subject(): """Return the DN from the client side certificate as a D1 subject if a client side cert has been configured. Else return None. ...
Check if one or more subjects are allowed to perform action level on object. If a subject holds permissions for one action level on object, all lower action levels are also allowed. Any included subject that is unknown to this MN is treated as a subject without permissions. Returns: bool ...
Access only by subjects with Create/Update/Delete permission and by trusted infrastructure (CNs). def assert_create_update_delete_permission(request): """Access only by subjects with Create/Update/Delete permission and by trusted infrastructure (CNs).""" if not has_create_update_delete_permission(reque...
Assert that one or more subjects are allowed to perform action on object. Raise NotAuthorized if object exists and subject is not allowed. Raise NotFound if object does not exist. def assert_allowed(request, level, pid): """Assert that one or more subjects are allowed to perform action on object. Rai...
Create a string listing active subjects for this connection, suitable for appending to authentication error messages. def format_active_subjects(request): """Create a string listing active subjects for this connection, suitable for appending to authentication error messages.""" decorated_subject_list =...
Remove unused imports Unsafe! Only tested on our codebase, which uses simple absolute imports on the form, "import a.b.c". def main(): """Remove unused imports Unsafe! Only tested on our codebase, which uses simple absolute imports on the form, "import a.b.c". """ parser = argparse.Argum...
Comment out import for {dot_str}. def comment_import(r, unused_dot_list): """Comment out import for {dot_str}.""" unused_dot_str = ".".join(unused_dot_list) for n in r("ImportNode"): if n.names()[0] == unused_dot_str: # The "!" is inserted so that this line doesn't show up when searchin...
Capture only the leading dotted name list. A full sequence typically includes function calls and parameters. pkga.pkgb.pkgc.one_call(arg1, arg2, arg3=4) def get_atomtrailer_list(r): """Capture only the leading dotted name list. A full sequence typically includes function calls and parameters. pkg...
Support tags query. def custom_filter_tags(self, value, search): """Support tags query.""" if not isinstance(value, list): value = value.split(',') filters = [Q('match', **{'tags': item}) for item in value] search = search.query('bool', must=filters) return search
Support general query using the 'text' attribute. def custom_filter_text(self, value, search): """Support general query using the 'text' attribute.""" if isinstance(value, list): value = ' '.join(value) should = [ Q('match', slug={'query': value, 'operator': 'and', 'boo...
Apply permissions to data objects and entities in ``Collection``. def set_content_permissions(self, user, obj, payload): """Apply permissions to data objects and entities in ``Collection``.""" for entity in obj.entity_set.all(): if user.has_perm('share_entity', entity): upda...
Only authenticated usesr can create new collections. def create(self, request, *args, **kwargs): """Only authenticated usesr can create new collections.""" if not request.user.is_authenticated: raise exceptions.NotFound return super().create(request, *args, **kwargs)
Destroy a model instance. If ``delete_content`` flag is set in query parameters, also all Data objects and Entities, on which user has ``EDIT`` permission, contained in collection will be deleted. def destroy(self, request, *args, **kwargs): """Destroy a model instance. If ``d...
Add data to collection. def add_data(self, request, pk=None): """Add data to collection.""" collection = self.get_object() if 'ids' not in request.data: return Response({"error": "`ids`parameter is required"}, status=status.HTTP_400_BAD_REQUEST) missing = [] for da...
Remove data from collection. def remove_data(self, request, pk=None): """Remove data from collection.""" collection = self.get_object() if 'ids' not in request.data: return Response({"error": "`ids`parameter is required"}, status=status.HTTP_400_BAD_REQUEST) for data_id in...
Duplicate (make copy of) ``Collection`` models. def duplicate(self, request, *args, **kwargs): """Duplicate (make copy of) ``Collection`` models.""" if not request.user.is_authenticated: raise exceptions.NotFound ids = self.get_ids(request.data) queryset = get_objects_for_u...
Check if object with {pid} has successfully synced to the CN. CNRead.describe() is used as it's a light-weight HTTP HEAD request. This assumes that the call is being made over a connection that has been authenticated and has read or better access on the given object if it exists. async def is...
Apply lookup expression to search query. def apply(self, search, field, value): """Apply lookup expression to search query.""" return search.query( self.query_type( # pylint: disable=not-callable **{ field: { self.operator: self.g...
Apply lookup expression to search query. def apply(self, search, field, value): """Apply lookup expression to search query.""" if not isinstance(value, list): value = [x for x in value.strip().split(',') if x] filters = [Q('match', **{field: item}) for item in value] return...
Apply lookup expression to search query. def apply(self, search, field, value): """Apply lookup expression to search query.""" # We assume that the field in question has a "raw" counterpart. return search.query('match', **{'{}.raw'.format(field): value})
Register lookup. def register_lookup(self, lookup): """Register lookup.""" if lookup.operator in self._lookups: raise KeyError("Lookup for operator '{}' is already registered".format(lookup.operator)) self._lookups[lookup.operator] = lookup()
Look up a lookup. :param operator: Name of the lookup operator def get_lookup(self, operator): """Look up a lookup. :param operator: Name of the lookup operator """ try: return self._lookups[operator] except KeyError: raise NotImplementedError("...
Build query. :param search: Search query instance :param raw_query: Raw query arguments dictionary def build(self, search, raw_query): """Build query. :param search: Search query instance :param raw_query: Raw query arguments dictionary """ unmatched_items = {}...