output
stringlengths
1
928k
instruction
stringlengths
7
928k
system
stringlengths
0
104k
Repeat the query several times; perhaps don't go through *all* the pages. Returns minimum time to run backend.searchVariants() to execute the query (as far as pageLimit allows), *not* including JSON processing to prepare queries or parse responses.
Here you have a function in Python 3, explain what it does def benchmarkOneQuery(request, repeatLimit=3, pageLimit=3): times = [] queryString = protocol.toJson(request) for i in range(0, repeatLimit): resultString, elapsedTime = timeOneSearch(queryString) accruedTime = elapsedTime pa...
As a Python code composer, you craft elegant and concise scripts.
def getExceptionClass(errorCode): """ Converts the specified error code into the corresponding class object. Raises a KeyError if the errorCode is not found. """ classMap = {} for name, class_ in inspect.getmembers(sys.modules[__name__]): if inspect.isclass(class_) and issubclass(class_,...
Can you write a function in Python 3 where it converts the specified error code into a corresponding class object. Raises a KeyError if the errorCode is not found.
As a python code expert, you are capable of creating scripts from specifications.
Converts this exception into a GA4GH protocol element.
Can you tell what is the following Python 3 function doing def toProtocolElement(self): error = protocol.GAException() error.error_code = self.getErrorCode() error.message = self.getMessage() return error
As a python code expert, you are capable of creating scripts from specifications.
def _init_goterm_ref(self, rec_curr, name, lnum): """Initialize new reference and perform checks.""" if rec_curr is None: return GOTerm() msg = "PREVIOUS {REC} WAS NOT TERMINATED AS EXPECTED".format(REC=name) self._die(msg, lnum)
How would you code a function in Python 3 to initialize new reference and perform checks.
You are a Python code architect, reviewing and designing scalable and efficient code
def _init_typedef(self, typedef_curr, name, lnum): """Initialize new typedef and perform checks.""" if typedef_curr is None: return TypeDef() msg = "PREVIOUS {REC} WAS NOT TERMINATED AS EXPECTED".format(REC=name) self._die(msg, lnum)
Write a Python 3 function that can initialize new typedef and perform checks.
You are a Python code analyst, evaluating scripts for potential improvements.
def _add_to_ref(self, rec_curr, line, lnum): """Add new fields to the current reference.""" # Written by DV Klopfenstein # Examples of record lines containing ':' include: # id: GO:0000002 # name: mitochondrial genome maintenance # namespace: biological_process ...
Implement a Python 3 function for adding new fields to the current reference.
You are a Python code analyst, evaluating scripts for potential improvements.
Update the record with optional record.
How would you explain what the following Python 3 function does def update_rec(self, rec, name, value): # 'def' is a reserved word in python, do not use it as a Class attr. if name == "def": name = "defn" # If we have a relationship, then we will split this into a further # ...
You are a Python code architect, reviewing and designing scalable and efficient code
Add new fields to the current typedef.
Make a summary of the following Python 3 code def _add_to_typedef(self, typedef_curr, line, lnum): mtch = re.match(r'^(\S+):\s*(\S.*)$', line) if mtch: field_name = mtch.group(1) field_value = mtch.group(2).split('!')[0].rstrip() if field_name == "id": ...
As a python code expert, you are capable of creating scripts from specifications.
def _add_nested(self, rec, name, value): """Adds a term's nested attributes.""" # Remove comments and split term into typedef / target term. (typedef, target_term) = value.split('!')[0].rstrip().split(' ') # Save the nested term. getattr(rec, name)[typedef].append(target_term)
Implement a Python 3 function for adding a term s nested attributes.
As a Python code analyst, you investigate and solve complex coding mysteries
def _init_optional_attrs(self, optional_attrs): """Prepare to store data from user-desired optional fields. Not loading these optional fields by default saves in space and speed. But allow the possibility for saving these fields, if the user desires, Including: com...
How would you implement a function in Python 3 that initializes the internal state of the optional attributes.
As a Python code analyst, you investigate and solve complex coding mysteries
Raise an Exception if the file read is unexpected.
Can you generate a brief explanation for the following Python 3 code def _die(self, msg, lnum): raise Exception("**FATAL {FILE}({LNUM}): {MSG}\n".format( FILE=self.obo_file, LNUM=lnum, MSG=msg))
You are a Python code generator, capable of creating scripts from specifications.
def write_hier_rec(self, gos_printed, out=sys.stdout, len_dash=1, max_depth=None, num_child=None, short_prt=False, include_only=None, go_marks=None, depth=1, dp="-"): """Write hierarchy for a GO Term record.""" # Added by DV Klopfenstein ...
Write a Python 3 function for writing a hierarchy for a GO Term record.
You are a Python code analyst, evaluating scripts for potential improvements.
def write_hier_all(self, out=sys.stdout, len_dash=1, max_depth=None, num_child=None, short_prt=False): """Write hierarchy for all GO Terms in obo file.""" # Print: [biological_process, molecular_function, and cellular_component] for go_id in ['GO:0008150', 'GO:0003674', 'GO...
How would you code a function in Python 3 to write hierarchy for all GO Terms in obo file.
You are a Python code generator, capable of creating scripts from specifications.
Write a hierarchy for a GO Term.
Make a summary of the following Python 3 code def write_hier(self, GO_id, out=sys.stdout, len_dash=1, max_depth=None, num_child=None, short_prt=False, include_only=None, go_marks=None): """Write hierarchy for a GO Term.""" gos_printed = set() self[GO...
You are a Python code analyst, evaluating scripts for potential improvements.
def paths_to_top(self, term): """ Returns all possible paths to the root node Each path includes the term given. The order of the path is top -> bottom, i.e. it starts with the root and ends with the given term (inclusively). Parameters: ----------- ...
Write a Python 3 function that can return all possible paths to the root node that include the given term.
You are a Python code analyst, evaluating scripts for potential improvements.
def make_graph_pydot(self, recs, nodecolor, edgecolor, dpi, draw_parents=True, draw_children=True): """draw AMIGO style network, lineage containing one query record.""" import pydot G = pydot.Dot(graph_type='digraph', dpi="{}".format(dpi)) # Directed Gra...
How would you implement a function in Python 3 that draws AMIGO style network lineage containing one query record.
You are a Python code generator, capable of creating scripts from specifications.
def sqliteRowsToDicts(sqliteRows): """ Unpacks sqlite rows as returned by fetchall into an array of simple dicts. :param sqliteRows: array of rows returned from fetchall DB call :return: array of dicts, keyed by the column names. """ return map(lambda r: dict(zip(r.keys(), r)), sqliteRows)
Write a Python 3 function for unpacking sqlite rows as returned by fetchall into an array of simple dicts.
You are a Python code architect, reviewing and designing scalable and efficient code
Construct a SQL LIMIT clause
Can you tell what is the following Python 3 function doing def limitsSql(startIndex=0, maxResults=0): if startIndex and maxResults: return " LIMIT {}, {}".format(startIndex, maxResults) elif startIndex: raise Exception("startIndex was provided, but maxResults was not") elif maxResults: ...
As a Python code analyst, you investigate and solve complex coding mysteries
def iterativeFetch(query, batchSize=default_batch_size): """ Returns rows of a sql fetch query on demand """ while True: rows = query.fetchmany(batchSize) if not rows: break rowDicts = sqliteRowsToDicts(rows) for rowDict in rowDicts: yield rowDict
Write a Python 3 script for returning rows of a sql fetch query on demand iterative fetch
You are a Python code generator, capable of creating scripts from specifications.
Parses the specified pageToken and returns a list of the specified numValues integers.
Can you tell what is the following Python 3 function doing def _parsePageToken(pageToken, numValues): tokens = pageToken.split(":") if len(tokens) != numValues: msg = "Invalid number of values in page token" raise exceptions.BadPageTokenException(msg) try: values = map(int, tokens) ...
As a python code expert, you are capable of creating scripts from specifications.
def _parseIntegerArgument(args, key, defaultValue): """ Attempts to parse the specified key in the specified argument dictionary into an integer. If the argument cannot be parsed, raises a BadRequestIntegerException. If the key is not present, return the specified default value. """ ret = de...
Write a Python 3 script for parsing an integer argument into an integer.
You are a Python code analyst, evaluating scripts for potential improvements.
def _initialiseIteration(self): """ Starts a new iteration. """ self._searchIterator = self._search( self._request.start, self._request.end if self._request.end != 0 else None) self._currentObject = next(self._searchIterator, None) if self._current...
Can you implement a function in Python 3 that starts a new iteration.
You are a Python code generator, capable of creating scripts from specifications.
def _pickUpIteration(self, searchAnchor, objectsToSkip): """ Picks up iteration from a previously provided page token. There are two different phases here: 1) We are iterating over the initial set of intervals in which start is < the search start coorindate. 2) We are ite...
Can you write a function in Python 3 where it picks up iteration from a previously provided page token.
You are a Python code generator, capable of creating scripts from specifications.
def next(self): """ Returns the next (object, nextPageToken) pair. """ if self._currentObject is None: raise StopIteration() nextPageToken = None if self._nextObject is not None: start = self._getStart(self._nextObject) # If start > the...
Write a Python 3 script to return the next ( object nextPageToken ) pair.
You are a Python code architect, reviewing and designing scalable and efficient code
def filterVariantAnnotation(self, vann): """ Returns true when an annotation should be included. """ # TODO reintroduce feature ID search ret = False if len(self._effects) != 0 and not vann.transcript_effects: return False elif len(self._effects) == 0:...
Implement a function in Python 3 to return true when an annotation should be included.
As a python code expert, you are capable of creating scripts from specifications.
Returns true if any of the effect in the teff is present in the request.
Make a summary of the following Python 3 code def filterEffect(self, teff): ret = False for effect in teff.effects: ret = self._matchAnyEffects(effect) or ret return ret
You are a Python code generator, capable of creating scripts from specifications.
Tests whether a requested effect and effect have the same term_id.
Here you have a function in Python 3, explain what it does def _checkIdEquality(self, requestedEffect, effect): return self._idPresent(requestedEffect) and ( effect.term_id == requestedEffect.term_id)
As a python code expert, you are capable of creating scripts from specifications.
This method is used to import a ga4gh module in the scripts dir.
Here you have a function in Python 3, explain what it does def ga4ghImportGlue(): path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(path)
As a Python code composer, you craft elegant and concise scripts.
def _update(self, dataFile, handle): """ Update the priority of the file handle. The element is first removed and then added to the left of the deque. """ self._cache.remove((dataFile, handle)) self._add(dataFile, handle)
How would you implement a function in Python 3 that updates the priority of the file handle.
You are a Python code generator, capable of creating scripts from specifications.
Remove the most recently used file from the deque.
How would you explain what the following Python 3 function does def _removeLru(self): (dataFile, handle) = self._cache.pop() handle.close() return dataFile
You are a Python code architect, reviewing and designing scalable and efficient code
Returns the handle associated to the dataFile. If the file is already opened update its priority in the cache and return the corresponding handle. If the file is already opened store it in the cache and return the corresponding handle. If the file is too large remove it from the cache and return the corresponding handl...
Here you have a function in Python 3, explain what it does def getFileHandle(self, dataFile, openMethod): if dataFile in self._memoTable: handle = self._memoTable[dataFile] self._update(dataFile, handle) return handle else: try: handle = op...
As a Python code analyst, you investigate and solve complex coding mysteries
def join(cls, splits): """ Join an array of ids into a compound id string """ segments = [] for split in splits: segments.append('"{}",'.format(split)) if len(segments) > 0: segments[-1] = segments[-1][:-1] jsonString = '[{}]'.format(''.joi...
Write a Python 3 script to join an array of ids into a compound id string
As a python code expert, you are capable of creating scripts from specifications.
def parse(cls, compoundIdStr): """ Parses the specified compoundId string and returns an instance of this CompoundId class. :raises: An ObjectWithIdNotFoundException if parsing fails. This is because this method is a client-facing method, and if a malformed identifier (u...
Implement a function in Python 3 to parse the specified string and returns an instance of this class.
You are a Python code analyst, evaluating scripts for potential improvements.
Mildly obfuscates the specified ID string in an easily reversible fashion.
Can you generate the documentation for the following Python 3 function def obfuscate(cls, idStr): return unicode(base64.urlsafe_b64encode( idStr.encode('utf-8')).replace(b'=', b''))
As a Python code analyst, you investigate and solve complex coding mysteries
def deobfuscate(cls, data): """ Reverses the obfuscation done by the :meth:`obfuscate` method. If an identifier arrives without correct base64 padding this function will append it to the end. """ # the str() call is necessary to convert the unicode string # to an ...
Write a Python 3 script for reversing the obfuscation done by the :meth:`obfuscate` method. If an identifier arrives without correct base64 padding this function will append it to the end.
You are a Python code architect, reviewing and designing scalable and efficient code
Sets the attrbutes of a message during serialization.
Given the following Python 3 function, write the documentation def serializeAttributes(self, msg): attributes = self.getAttributes() for key in attributes: protocol.setAttribute( msg.attributes.attr[key].values, attributes[key]) return msg
As a Python code composer, you craft elegant and concise scripts.
def _scanDataFiles(self, dataDir, patterns): """ Scans the specified directory for files with the specified globbing pattern and calls self._addDataFile for each. Raises an EmptyDirException if no data files are found. """ numDataFiles = 0 for pattern in patterns:...
How would you implement a function in Python 3 that scans the specified directory for files with the specified globbing patterns and calls self. _addDataFile for each. Raises an EmptyDirException if no data files are found.
As a Python code analyst, you investigate and solve complex coding mysteries
def getInitialPeerList(filePath, logger=None): """ Attempts to get a list of peers from a file specified in configuration. This file has one URL per line and can contain newlines and comments. # Main ga4gh node http://1kgenomes.ga4gh.org # Local intranet peer https://192.16...
Write a Python 3 function for attempting to get a list of peers from a file specified in configuration.
As a python code expert, you are capable of creating scripts from specifications.
def insertInitialPeer(dataRepository, url, logger=None): """ Takes the datarepository, a url, and an optional logger and attempts to add the peer into the repository. """ insertPeer = dataRepository.insertPeer try: peer = datamodel.peers.Peer(url) insertPeer(peer) except exce...
Write a Python 3 script for adding a new peer into the registry.
As a python code expert, you are capable of creating scripts from specifications.
Checks if a given URL string is valid by checking the urlparse module and checking the urlparse module for the presence of the scheme netloc and scheme.
Can you tell what is the following Python 3 function doing def isUrl(urlString): parsed = urlparse.urlparse(urlString) urlparseValid = parsed.netloc != '' and parsed.scheme != '' regex = re.compile( r'^(?:http|ftp)s?://' # http:// or https:// r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)'...
As a Python code translator, you convert algorithms and pseudocode into Python.
Set the URL of the object.
How would you explain what the following Python 3 function does def setUrl(self, url): if isUrl(url): self._url = url else: raise exceptions.BadUrlException(url) return self
You are a Python code generator, capable of creating scripts from specifications.
Sets the attributes dictionary from a JSON string.
How would you explain what the following Python 3 function does def setAttributesJson(self, attributesJson): try: self._attributes = json.loads(attributesJson) except: raise exceptions.InvalidJsonException(attributesJson) return self
You are a Python code architect, reviewing and designing scalable and efficient code
Populates the instance variables of this object from the given database row.
Make a summary of the following Python 3 code def populateFromRow(self, peerRecord): self.setUrl(peerRecord.url) \ .setAttributesJson(peerRecord.attributes) return self
As a Python code analyst, you investigate and solve complex coding mysteries
def _topLevelObjectGenerator(self, request, numObjects, getByIndexMethod): """ Returns a generator over the results for the specified request, which is over a set of objects of the specified size. The objects are returned by call to the specified method, which must take a single ...
How would you implement a function in Python 3 that returns a generator over the results for the specified request which contains a single object of the specified size.
You are a Python code generator, capable of creating scripts from specifications.
Returns a generator over the results for the specified request from a set of protocol objects of the specified size.
Can you tell what is the following Python 3 function doing def _protocolObjectGenerator(self, request, numObjects, getByIndexMethod): currentIndex = 0 if request.page_token: currentIndex, = paging._parsePageToken( request.page_token, 1) while currentIndex < numObjects...
As a python code expert, you are capable of creating scripts from specifications.
Returns a generator over the objects in the specified list using the _protocolObjectGenerator method to generate page tokens.
Here you have a function in Python 3, explain what it does def _protocolListGenerator(self, request, objectList): return self._protocolObjectGenerator( request, len(objectList), lambda index: objectList[index])
You are a Python code architect, reviewing and designing scalable and efficient code
def _objectListGenerator(self, request, objectList): """ Returns a generator over the objects in the specified list using _topLevelObjectGenerator to generate page tokens. """ return self._topLevelObjectGenerator( request, len(objectList), lambda index: objectList[ind...
Implement a Python 3 function for returning a generator over the objects in the specified list using the _topLevelObjectGenerator method to generate page tokens.
You are a Python code analyst, evaluating scripts for potential improvements.
Returns a generator over the dataset and nextPageToken pairs that are defined by the specified request.
Given the following Python 3 function, write the documentation def datasetsGenerator(self, request): return self._topLevelObjectGenerator( request, self.getDataRepository().getNumDatasets(), self.getDataRepository().getDatasetByIndex)
As a Python code composer, you craft elegant and concise scripts.
def phenotypeAssociationSetsGenerator(self, request): """ Returns a generator over the (phenotypeAssociationSet, nextPageToken) pairs defined by the specified request """ dataset = self.getDataRepository().getDataset(request.dataset_id) return self._topLevelObjectGenerato...
Create a Python 3 function for returning a generator over the phenotypeAssociationSets defined by the specified request.
You are a Python code generator, capable of creating scripts from specifications.
def readGroupSetsGenerator(self, request): """ Returns a generator over the (readGroupSet, nextPageToken) pairs defined by the specified request. """ dataset = self.getDataRepository().getDataset(request.dataset_id) return self._readGroupSetsGenerator( request...
Create a Python 3 function for returning a generator over the readGroupSets defined by the specified request.
As a Python code composer, you craft elegant and concise scripts.
Returns a generator over the results for the specified request which contains the next set of read groups.
Can you generate a brief explanation for the following Python 3 code def _readGroupSetsGenerator(self, request, numObjects, getByIndexMethod): currentIndex = 0 if request.page_token: currentIndex, = paging._parsePageToken( request.page_token, 1) while currentIndex < n...
You are a Python code generator, capable of creating scripts from specifications.
Returns a generator over the pairs of referenceSets that match the specified request.
Given the following Python 3 function, write the documentation def referenceSetsGenerator(self, request): results = [] for obj in self.getDataRepository().getReferenceSets(): include = True if request.md5checksum: if request.md5checksum != obj.getMd5Checksum(): ...
You are a Python code generator, capable of creating scripts from specifications.
Returns a generator over the pairs of reference and nextPageToken of the objects in the reference set that match the specified request.
Given the following Python 3 function, write the documentation def referencesGenerator(self, request): referenceSet = self.getDataRepository().getReferenceSet( request.reference_set_id) results = [] for obj in referenceSet.getReferences(): include = True if re...
As a Python code composer, you craft elegant and concise scripts.
Returns a generator over the variantSets defined by the specified request.
Can you generate the documentation for the following Python 3 function def variantSetsGenerator(self, request): dataset = self.getDataRepository().getDataset(request.dataset_id) return self._topLevelObjectGenerator( request, dataset.getNumVariantSets(), dataset.getVariantSetByInd...
As a Python code translator, you convert algorithms and pseudocode into Python.
Returns a generator over the variantAnnotationSets defined by the specified request.
Can you tell what is the following Python 3 function doing def variantAnnotationSetsGenerator(self, request): compoundId = datamodel.VariantSetCompoundId.parse( request.variant_set_id) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) variantSet = dataset.getVarian...
As a Python code analyst, you investigate and solve complex coding mysteries
Returns a generator over the read pairs defined by the specified request.
Explain what the following Python 3 code does def readsGenerator(self, request): if not request.reference_id: raise exceptions.UnmappedReadsNotSupported() if len(request.read_group_ids) < 1: raise exceptions.BadRequestException( "At least one readGroupId must be s...
As a Python code analyst, you investigate and solve complex coding mysteries
Returns an iterator over the variants defined by the specified request.
Here you have a function in Python 3, explain what it does def variantsGenerator(self, request): compoundId = datamodel.VariantSetCompoundId \ .parse(request.variant_set_id) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) variantSet = dataset.getVariantSet(compou...
As a Python code translator, you convert algorithms and pseudocode into Python.
def variantAnnotationsGenerator(self, request): """ Returns a generator over the (variantAnnotaitons, nextPageToken) pairs defined by the specified request. """ compoundId = datamodel.VariantAnnotationSetCompoundId.parse( request.variant_annotation_set_id) dat...
Create a Python 3 function to return an iterator over the pairs of variantAnnotaitons and nextPageToken.
You are a Python code generator, capable of creating scripts from specifications.
def featuresGenerator(self, request): """ Returns a generator over the (features, nextPageToken) pairs defined by the (JSON string) request. """ compoundId = None parentId = None if request.feature_set_id != "": compoundId = datamodel.FeatureSetCompoun...
Can you implement a function in Python 3 that returns an iterator over the features and nextPageToken pairs of the next page.
As a python code expert, you are capable of creating scripts from specifications.
def continuousGenerator(self, request): """ Returns a generator over the (continuous, nextPageToken) pairs defined by the (JSON string) request. """ compoundId = None if request.continuous_set_id != "": compoundId = datamodel.ContinuousSetCompoundId.parse( ...
Create a Python 3 function to return an iterator over the pairs defined by the request.
As a Python code analyst, you investigate and solve complex coding mysteries
Returns a generator over the pairs defined by the request.
Can you generate a brief explanation for the following Python 3 code def phenotypesGenerator(self, request): # TODO make paging work using SPARQL? compoundId = datamodel.PhenotypeAssociationSetCompoundId.parse( request.phenotype_association_set_id) dataset = self.getDataRepository()....
You are a Python code generator, capable of creating scripts from specifications.
def genotypesPhenotypesGenerator(self, request): """ Returns a generator over the (phenotypes, nextPageToken) pairs defined by the (JSON string) request """ # TODO make paging work using SPARQL? compoundId = datamodel.PhenotypeAssociationSetCompoundId.parse( r...
Can you implement a function in Python 3 that returns a generator over the pairs of phenotype and annotation objects defined by the request.
As a Python code composer, you craft elegant and concise scripts.
Returns a generator over the callSets defined by the specified request.
Can you tell what is the following Python 3 function doing def callSetsGenerator(self, request): compoundId = datamodel.VariantSetCompoundId.parse( request.variant_set_id) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) variantSet = dataset.getVariantSet(compound...
As a Python code translator, you convert algorithms and pseudocode into Python.
Returns a generator over the featureSets defined by the specified request.
Explain what the following Python 3 code does def featureSetsGenerator(self, request): dataset = self.getDataRepository().getDataset(request.dataset_id) return self._topLevelObjectGenerator( request, dataset.getNumFeatureSets(), dataset.getFeatureSetByIndex)
You are a Python code generator, capable of creating scripts from specifications.
Returns a generator over the continuousSets defined by the specified request.
How would you explain what the following Python 3 function does def continuousSetsGenerator(self, request): dataset = self.getDataRepository().getDataset(request.dataset_id) return self._topLevelObjectGenerator( request, dataset.getNumContinuousSets(), dataset.getContinuousSetByI...
You are a Python code analyst, evaluating scripts for potential improvements.
Returns a generator over the rnaQuantificationSets defined by the specified request.
Here you have a function in Python 3, explain what it does def rnaQuantificationSetsGenerator(self, request): dataset = self.getDataRepository().getDataset(request.dataset_id) return self._topLevelObjectGenerator( request, dataset.getNumRnaQuantificationSets(), dataset.getRnaQuan...
You are a Python code analyst, evaluating scripts for potential improvements.
Returns a generator over the pairs of rnaQuantification objects and nextPageToken.
How would you explain what the following Python 3 function does def rnaQuantificationsGenerator(self, request): if len(request.rna_quantification_set_id) < 1: raise exceptions.BadRequestException( "Rna Quantification Set Id must be specified") else: compoundId = d...
As a Python code analyst, you investigate and solve complex coding mysteries
def expressionLevelsGenerator(self, request): """ Returns a generator over the (expressionLevel, nextPageToken) pairs defined by the specified request. Currently only supports searching over a specified rnaQuantification """ rnaQuantificationId = request.rna_quantificati...
Write a Python 3 script to return an iterator over the ( expressionLevel nextPageToken ) pairs
You are a Python code analyst, evaluating scripts for potential improvements.
Runs a get request by converting the specified datamodel object into its protocol representation.
How would you explain what the following Python 3 function does def runGetRequest(self, obj): protocolElement = obj.toProtocolElement() jsonString = protocol.toJson(protocolElement) return jsonString
As a Python code translator, you convert algorithms and pseudocode into Python.
Runs the specified request and returns the response string.
Explain what the following Python 3 code does def runSearchRequest( self, requestStr, requestClass, responseClass, objectGenerator): """ Runs the specified request. The request is a string containing a JSON representation of an instance of the specified requestClass. We retur...
As a Python code analyst, you investigate and solve complex coding mysteries
def runListReferenceBases(self, requestJson): """ Runs a listReferenceBases request for the specified ID and request arguments. """ # In the case when an empty post request is made to the endpoint # we instantiate an empty ListReferenceBasesRequest. if not request...
Implement a function in Python 3 to run a listReferenceBases request for the specified ID and request arguments.
As a Python code composer, you craft elegant and concise scripts.
def runGetCallSet(self, id_): """ Returns a callset with the given id """ compoundId = datamodel.CallSetCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) variantSet = dataset.getVariantSet(compoundId.variant_set_id) callSet...
Write a Python 3 function for running a get request for the given id
As a Python code composer, you craft elegant and concise scripts.
Returns information about the service including protocol version.
Explain what the following Python 3 code does def runGetInfo(self, request): return protocol.toJson(protocol.GetInfoResponse( protocol_version=protocol.version))
As a python code expert, you are capable of creating scripts from specifications.
This method parses a flask request and adds an announcement to the announcement table.
Explain what the following Python 3 code does def runAddAnnouncement(self, flaskrequest): announcement = {} # We want to parse the request ourselves to collect a little more # data about it. try: requestData = protocol.fromJson( flaskrequest.get_data(), protoc...
As a Python code analyst, you investigate and solve complex coding mysteries
def runListPeers(self, request): """ Takes a ListPeersRequest and returns a ListPeersResponse using a page_token and page_size if provided. """ return self.runSearchRequest( request, protocol.ListPeersRequest, protocol.ListPeersResponse, ...
Write a Python 3 function that can run a ListPeersRequest and returns a ListPeersResponse.
You are a Python code analyst, evaluating scripts for potential improvements.
Runs a VariantGetRequest and returns the JSON representation of the Variant object.
Given the following Python 3 function, write the documentation def runGetVariant(self, id_): compoundId = datamodel.VariantCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) variantSet = dataset.getVariantSet(compoundId.variant_set_id) gaVariant = ...
You are a Python code analyst, evaluating scripts for potential improvements.
def runGetBiosample(self, id_): """ Runs a getBiosample request for the specified ID. """ compoundId = datamodel.BiosampleCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) biosample = dataset.getBiosample(id_) return self.r...
Implement a function in Python 3 to run a getBiosample request for the specified ID.
As a Python code translator, you convert algorithms and pseudocode into Python.
Runs a getIndividual request for the specified ID.
Can you tell what is the following Python 3 function doing def runGetIndividual(self, id_): compoundId = datamodel.BiosampleCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) individual = dataset.getIndividual(id_) return self.runGetRequest(individ...
As a python code expert, you are capable of creating scripts from specifications.
Runs the GetFeature method of the feature object passed in.
Given the following Python 3 function, write the documentation def runGetFeature(self, id_): compoundId = datamodel.FeatureCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) featureSet = dataset.getFeatureSet(compoundId.feature_set_id) gaFeature = ...
You are a Python code analyst, evaluating scripts for potential improvements.
Runs a readGroupSet request for the given id
Can you generate the documentation for the following Python 3 function def runGetReadGroupSet(self, id_): compoundId = datamodel.ReadGroupSetCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) readGroupSet = dataset.getReadGroupSet(id_) return self....
You are a Python code generator, capable of creating scripts from specifications.
Runs a read group request with the given id
Can you generate a brief explanation for the following Python 3 code def runGetReadGroup(self, id_): compoundId = datamodel.ReadGroupCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) readGroupSet = dataset.getReadGroupSet(compoundId.read_group_set_id) ...
You are a Python code generator, capable of creating scripts from specifications.
def runGetReference(self, id_): """ Runs a getReference request for the specified ID. """ compoundId = datamodel.ReferenceCompoundId.parse(id_) referenceSet = self.getDataRepository().getReferenceSet( compoundId.reference_set_id) reference = referenceSet.getRe...
How would you code a function in Python 3 to run a getReference request for the specified ID.
As a Python code analyst, you investigate and solve complex coding mysteries
def runGetReferenceSet(self, id_): """ Runs a getReferenceSet request for the specified ID. """ referenceSet = self.getDataRepository().getReferenceSet(id_) return self.runGetRequest(referenceSet)
Implement a function in Python 3 to run a getReferenceSet request for the specified ID.
As a Python code analyst, you investigate and solve complex coding mysteries
Runs a getVariantSet request for the specified ID.
Can you generate a brief explanation for the following Python 3 code def runGetVariantSet(self, id_): compoundId = datamodel.VariantSetCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) variantSet = dataset.getVariantSet(id_) return self.runGetRequ...
You are a Python code generator, capable of creating scripts from specifications.
Runs a getFeatureSet request for the specified ID.
Can you generate a brief explanation for the following Python 3 code def runGetFeatureSet(self, id_): compoundId = datamodel.FeatureSetCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) featureSet = dataset.getFeatureSet(id_) return self.runGetRequ...
You are a Python code generator, capable of creating scripts from specifications.
def runGetContinuousSet(self, id_): """ Runs a getContinuousSet request for the specified ID. """ compoundId = datamodel.ContinuousSetCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) continuousSet = dataset.getContinuousSet(id_) ...
Write a Python 3 function that can run a getContinuousSet request for the specified ID.
As a Python code composer, you craft elegant and concise scripts.
Runs a getDataset request for the specified ID.
Can you generate the documentation for the following Python 3 function def runGetDataset(self, id_): dataset = self.getDataRepository().getDataset(id_) return self.runGetRequest(dataset)
As a Python code analyst, you investigate and solve complex coding mysteries
Runs a getVariantSet request for the specified ID.
Can you generate the documentation for the following Python 3 function def runGetVariantAnnotationSet(self, id_): compoundId = datamodel.VariantAnnotationSetCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) variantSet = dataset.getVariantSet(compoundId.va...
You are a Python code generator, capable of creating scripts from specifications.
Runs a getRnaQuantification request for the specified ID.
Explain what the following Python 3 code does def runGetRnaQuantification(self, id_): compoundId = datamodel.RnaQuantificationCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) rnaQuantificationSet = dataset.getRnaQuantificationSet( compoundId....
As a Python code composer, you craft elegant and concise scripts.
Runs a getRnaQuantificationSet request for the specified ID.
How would you explain what the following Python 3 function does def runGetRnaQuantificationSet(self, id_): compoundId = datamodel.RnaQuantificationSetCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) rnaQuantificationSet = dataset.getRnaQuantificationSet(...
You are a Python code generator, capable of creating scripts from specifications.
def runGetExpressionLevel(self, id_): """ Runs a getExpressionLevel request for the specified ID. """ compoundId = datamodel.ExpressionLevelCompoundId.parse(id_) dataset = self.getDataRepository().getDataset(compoundId.dataset_id) rnaQuantificationSet = dataset.getRnaQuan...
Write a Python 3 script for running a getExpressionLevel request for the specified ID.
You are a Python code architect, reviewing and designing scalable and efficient code
Runs the specified SearchReadGroupSetsRequest.
How would you explain what the following Python 3 function does def runSearchReadGroupSets(self, request): return self.runSearchRequest( request, protocol.SearchReadGroupSetsRequest, protocol.SearchReadGroupSetsResponse, self.readGroupSetsGenerator)
You are a Python code generator, capable of creating scripts from specifications.
Runs the specified search request and returns the SearchIndividualsResponse.
Can you generate the documentation for the following Python 3 function def runSearchIndividuals(self, request): return self.runSearchRequest( request, protocol.SearchIndividualsRequest, protocol.SearchIndividualsResponse, self.individualsGenerator)
As a Python code composer, you craft elegant and concise scripts.
Runs the specified SearchBiosamplesRequest.
Make a summary of the following Python 3 code def runSearchBiosamples(self, request): return self.runSearchRequest( request, protocol.SearchBiosamplesRequest, protocol.SearchBiosamplesResponse, self.biosamplesGenerator)
You are a Python code architect, reviewing and designing scalable and efficient code
Runs the specified SearchReadsRequest.
Can you tell what is the following Python 3 function doing def runSearchReads(self, request): return self.runSearchRequest( request, protocol.SearchReadsRequest, protocol.SearchReadsResponse, self.readsGenerator)
As a python code expert, you are capable of creating scripts from specifications.
Runs the specified SearchReferenceSetsRequest.
Can you generate a brief explanation for the following Python 3 code def runSearchReferenceSets(self, request): return self.runSearchRequest( request, protocol.SearchReferenceSetsRequest, protocol.SearchReferenceSetsResponse, self.referenceSetsGenerator)
You are a Python code generator, capable of creating scripts from specifications.
def runSearchReferences(self, request): """ Runs the specified SearchReferenceRequest. """ return self.runSearchRequest( request, protocol.SearchReferencesRequest, protocol.SearchReferencesResponse, self.referencesGenerator)
Write a Python 3 script to run the specified SearchReferenceRequest.
As a Python code composer, you craft elegant and concise scripts.
Runs the specified SearchVariantSetsRequest.
Can you generate the documentation for the following Python 3 function def runSearchVariantSets(self, request): return self.runSearchRequest( request, protocol.SearchVariantSetsRequest, protocol.SearchVariantSetsResponse, self.variantSetsGenerator)
You are a Python code analyst, evaluating scripts for potential improvements.
def runSearchVariantAnnotationSets(self, request): """ Runs the specified SearchVariantAnnotationSetsRequest. """ return self.runSearchRequest( request, protocol.SearchVariantAnnotationSetsRequest, protocol.SearchVariantAnnotationSetsResponse, self.var...
How would you code a function in Python 3 to run the specified SearchVariantAnnotationSetsRequest.
As a Python code composer, you craft elegant and concise scripts.
def runSearchVariants(self, request): """ Runs the specified SearchVariantRequest. """ return self.runSearchRequest( request, protocol.SearchVariantsRequest, protocol.SearchVariantsResponse, self.variantsGenerator)
Write a Python 3 function that can run the specified SearchVariantRequest.
You are a Python code analyst, evaluating scripts for potential improvements.