code stringlengths 1 18.2k |
|---|
def get_key(key=None, keyfile=None): """ returns a key given either its value, a path to it on the filesystem or as last resort it checks the environment variable CRYPTOYAML_SECRET """ if key is None: if keyfile is None: key = environ.get('CRYPTOYAML_SECRET') if key is None: raise MissingKeyException( '''You must eithe... |
def read(self): """ Reads and decrypts data from the filesystem """ if path.exists(self.filepath): with open(self.filepath, 'rb') as infile: self.data = yaml.load( self.fernet.decrypt(infile.read())) else: self.data = dict() |
def write(self): """ Encrypts and writes the current state back onto the filesystem """ with open(self.filepath, 'wb') as outfile: outfile.write( self.fernet.encrypt( yaml.dump(self.data, encoding='utf-8'))) |
def has_active_condition(self, condition, instances): """ Given a list of instances, and the condition active for this switch, returns a boolean representing if the conditional is met, including a non-instance default. """ return_value = None for instance in instances + [None]: if not self.can_execute(instance): contin... |
async def get_local_version(self): """Get the local installed version.""" self._version_data["source"] = "Local" try: from homeassistant.const import __version__ as localversion self._version = localversion _LOGGER.debug("Version: %s", self.version) _LOGGER.debug("Version data: %s", self.version_data) except ImportErro... |
async def get_pypi_version(self): """Get version published to PyPi.""" self._version_data["beta"] = self.beta self._version_data["source"] = "PyPi" info_version = None last_release = None try: async with async_timeout.timeout(5, loop=self.loop): response = await self.session.get(URL["pypi"]) data = await response.json(... |
version information from PyPi, %s", error) except Exception as error: # pylint: disable=broad-except _LOGGER.critical("Something really wrong happend! - %s", error) |
async def get_hassio_version(self): """Get version published for hassio.""" if self.image not in IMAGES: _LOGGER.warning("%s is not a valid image using default", self.image) self.image = "default" board = BOARDS.get(self.image, BOARDS["default"]) self._version_data["source"] = "Hassio" self._version_data["beta"] = self... |
error: _LOGGER.error("Error fetching version information for hassio, %s", error) except Exception as error: # pylint: disable=broad-except _LOGGER.critical("Something really wrong happend! - %s", error) |
async def get_docker_version(self): """Get version published for docker.""" if self.image not in IMAGES: _LOGGER.warning("%s is not a valid image using default", self.image) self.image = "default" self._version_data["beta"] = self.beta self._version_data["source"] = "Docker" self._version_data["image"] = IMAGES[self.im... |
error: _LOGGER.error("Error fetching version information for docker, %s", error) except socket.gaierror as error: _LOGGER.error("Error fetching version information for docker, %s", error) except Exception as error: # pylint: disable=broad-except _LOGGER.critical("Something really wrong happend! - %s", error) |
def relative_playbook(playbook): """ Returns a tuple (controlled, playbook). - controlled is a boolean indicating whether or not we think that the playbook being run was checked in to our ansible git repo. - playbook is the relative file path of the playbook. """ if playbook.startswith(fs_prefix): return True, playbook... |
def matches(self, a, b, **config): """ The message must match by username """ submitter_a = a['msg']['override']['submitter']['name'] submitter_b = b['msg']['override']['submitter']['name'] if submitter_a != submitter_b: return False return True |
def start_stream_subscriber(self): """ Starts the stream consumer's main loop. Called when the stream consumer has been set up with the correct callbacks. """ if not self._stream_process_started: # pragma: no cover if sys.platform.startswith("win"): # if we're on windows we can't expect multiprocessing to work self._st... |
def subscribe(self, stream): """ Subscribe to a stream. :param stream: stream to subscribe to :type stream: str :raises: :class:`~datasift.exceptions.StreamSubscriberNotStarted`, :class:`~datasift.exceptions.DeleteRequired`, :class:`~datasift.exceptions.StreamNotConnected` Used as a decorator, eg.:: @client.subscribe(s... |
def on_open(self, func): """ Function to set the callback for the opening of a stream. Can be called manually:: def open_callback(data): setup_stream() client.on_open(open_callback) or as a decorator:: @client.on_open def open_callback(): setup_stream() """ self._on_open = func if self.opened: # pragma: no cover self._... |
def _stream(self): # pragma: no cover """Runs in a sub-process to perform stream consumption""" self.factory.protocol = LiveStream self.factory.datasift = { 'on_open': self._on_open, 'on_close': self._on_close, 'on_message': self._on_message, 'send_message': None } if self.config.ssl: from twisted.internet import ssl o... |
def compile(self, csdl): """ Compile the given CSDL. Uses API documented at http://dev.datasift.com/docs/api/rest-api/endpoints/compile Raises a DataSiftApiException for any error given by the REST API, including CSDL compilation. :param csdl: CSDL to compile :type csdl: str :returns: dict with extra response data :rty... |
def is_valid(self, csdl): """ Checks if the given CSDL is valid. Uses API documented at http://dev.datasift.com/docs/api/rest-api/endpoints/validate :param csdl: CSDL to validate :type csdl: str :returns: Boolean indicating the validity of the CSDL :rtype: bool :raises: :class:`~datasift.exceptions.DataSiftApiException... |
def usage(self, period='hour'): """ Check the number of objects processed and delivered for a given time period Uses API documented at http://dev.datasift.com/docs/api/rest-api/endpoints/usage :param period: (optional) time period to measure usage for, can be one of "day", "hour" or "current" (5 minutes), default is ho... |
def dpu(self, hash=None, historics_id=None): """ Calculate the DPU cost of consuming a stream. Uses API documented at http://dev.datasift.com/docs/api/rest-api/endpoints/dpu :param hash: target CSDL filter hash :type hash: str :returns: dict with extra response data :rtype: :class:`~datasift.request.DictResponse` :rais... |
def pull(self, subscription_id, size=None, cursor=None): """ Pulls a series of interactions from the queue for the given subscription ID. Uses API documented at http://dev.datasift.com/docs/api/rest-api/endpoints/pull :param subscription_id: The ID of the subscription to pull interactions for :type subscription_id: str... |
def _get_player_profile(self, player_handle): """Returns pubg player profile from PUBG api, no filtering :param player_handle: player PUBG profile name :type player_handle: str :return: return json from PUBG API :rtype: dict """ url = self.pubg_url + player_handle response = requests.request("GET", url, headers=self.he... |
def player(self, player_handle): """Returns the full set of data on a player, no filtering""" try: url = self.pubg_url + player_handle response = requests.request("GET", url, headers=self.headers) return json.loads(response.text) except BaseException as error: print('Unhandled exception: ' + str(error)) raise |
def player_s(self, sid) : """Returns the full set of data on a player, no filtering""" try: url = self.pubg_url_steam.format(str(sid)) response = requests.request("GET", url, headers=self.headers) return json.loads(response.text) except BaseException as error: print('Unhandled exception: ' + str(error)) raise |
def player_mode_stats(self, player_handle, game_mode=constants.GAME_MODE_WILDCARD, game_region=constants.GAME_REGION_WILDCARD): """Returns the stats for a particular mode of play, accepts solo, duo and squad. Will return both regional and global stats. Default gamemode is solo by Zac: Add parameter game_region to extra... |
def _filter_gameplay_stats(self, data, game_mode, game_region): """Returns gameplay stats that are filtered by game_mode and game_region. :param data: Json of gameplay stats. :type data: dict :param game_mode: Target game mode. :type game_mode: str :param game_region: Target game region. :type game_region: str :return:... |
def _is_target_game_mode(self, stat, game_mode): """Returns if the stat matches target game mode. :param stat: Json of gameplay stat. :type stat: dict :param game_mode: Target game mode. :type game_mode: str :return: return does the stat matches target game mode. :rtype: bool """ if game_mode == constants.GAME_MODE_WIL... |
def _is_target_region(self, stat, game_region): """Returns if the stat matches target game region. :param stat: Json of gameplay stat. :type stat: dict :param game_region: Target game region. :type game_region: str :return: return does the stat matches target game region. :rtype: bool """ if game_region == constants.GA... |
def player_skill(self, player_handle, game_mode='solo'): """Returns the current skill rating of the player for a specified gamemode, default gamemode is solo""" if game_mode not in constants.GAME_MODES: raise APIException("game_mode must be one of: solo, duo, squad, all") try: data = self._get_player_profile(player_han... |
def plot(nxG, nyG, iBeg, iEnd, jBeg, jEnd, data, title=''): """ Plot distributed array @param nxG number of global cells in x @param nyG number of global cells in y @param iBeg global starting index in x @param iEnd global ending index in x @param jBeg global starting index in y @param jEnd global ending index in y @pa... |
1], 'w--') pylab.plot([0, nxG - 1], [jBegs[pe], jBegs[pe]], 'w--') pylab.title(title) pylab.show() |
def setValues(nxG, nyG, iBeg, iEnd, jBeg, jEnd, data): """ Set setValues @param nxG number of global cells in x @param nyG number of global cells in y @param iBeg global starting index in x @param iEnd global ending index in x @param jBeg global starting index in y @param jEnd global ending index in y @param data local... |
def do_ls(self, nothing = ''): """list files in current remote directory""" for d in self.dirs: self.stdout.write("\033[0;34m" + ('%s\n' % d) + "\033[0m") for f in self.files: self.stdout.write('%s\n' % f) |
def do_cd(self, path = '/'): """change current working directory""" path = path[0] if path == "..": self.current_path = "/".join(self.current_path[:-1].split("/")[0:-1]) + '/' elif path == '/': self.current_path = "/" else: if path[-1] == '/': self.current_path += path else: self.current_path += path + '/' resp = self.... |
def do_cat(self, path): """display the contents of a file""" path = path[0] tmp_file_path = self.TMP_PATH + 'tmp' if not os.path.exists(self.TMP_PATH): os.makedirs(self.TMP_PATH) f = self.n.downloadFile(self.current_path + path, tmp_file_path) f = open(tmp_file_path, 'r') self.stdout.write(f.read()) self.stdout.write("... |
def do_mkdir(self, path): """create a new directory""" path = path[0] self.n.makeDirectory(self.current_path + path) self.dirs = self.dir_complete() |
def do_rm(self, path): path = path[0] """delete a file or directory""" self.n.delete(self.current_path + path) self.dirs = self.dir_complete() self.files = self.file_complete() |
def do_mv(self, from_path, to_path, nothing = ''): """move/rename a file or directory""" self.n.doMove(self.current_path + from_path, self.current_path + to_path) |
def do_account_info(self): """display account information""" s, metadata = self.n.getRegisterUserInfo() pprint.PrettyPrinter(indent=2).pprint(metadata) |
def do_get(self, from_path, to_path): """ Copy file from Ndrive to local file and print out out the metadata. Examples: Ndrive> get file.txt ~/ndrive-file.txt """ to_file = open(os.path.expanduser(to_path), "wb") self.n.downloadFile(self.current_path + "/" + from_path, to_path) |
def do_put(self, from_path, to_path): """ Copy local file to Ndrive Examples: Ndrive> put ~/test.txt ndrive-copy-test.txt """ from_file = open(os.path.expanduser(from_path), "rb") self.n.put(self.current_path + "/" + from_path, to_path) |
def do_search(self, string): """Search Ndrive for filenames containing the given string.""" results = self.n.doSearch(string, full_path = self.current_path) if results: for r in results: self.stdout.write("%s\n" % r['path']) |
def tr(string1, string2, source, option=''): """Replace or remove specific characters. If not given option, then replace all characters in string1 with the character in the same position in string2. Following options are available: c Replace all complemented characters in string1 with the character in the same position... |
= to_unichr(from_list) from_list = [ord(c) for c in set(source) - set(from_list)] if 'd' in option: to_list = [None for i in from_list] else: to_list = [string2[-1] for i in from_list] source = translate(from_list, to_list, source) if 's' in option: source = squeeze(to_list, source) return source elif 'd' in option: to... |
def upload(self, filepath, service_path, remove=False): ''' "Upload" a file to a service This copies a file from the local filesystem into the ``DataService``'s filesystem. If ``remove==True``, the file is moved rather than copied. If ``filepath`` and ``service_path`` paths are the same, ``upload`` deletes the file if ... |
local, os.path.basename(filepath), self.fs, service_path) else: fs.utils.copyfile( local, os.path.basename(filepath), self.fs, service_path) |
def get_version_path(self, version=None): ''' Returns a storage path for the archive and version If the archive is versioned, the version number is used as the file path and the archive path is the directory. If not, the archive path is used as the file path. Parameters ---------- version : str or object Version number... |
else: return self.archive_path |
def update( self, filepath, cache=False, remove=False, bumpversion=None, prerelease=None, dependencies=None, metadata=None, message=None): ''' Enter a new version to a DataArchive Parameters ---------- filepath : str The path to the file on your local file system cache : bool Turn on caching for this archive if not alr... |
component of archive version to update on write if archive is versioned. Valid prerelease values are 'alpha' and 'beta'. Either bumpversion or prerelease (or both) must be a non-None value. If the archive is not versioned, prerelease is ignored. metadata : dict Updates to archive metadata. Pass {key: None} to remove a ... |
algorithm=algorithm, version=next_version, dependencies=dependencies, message=message)) |
def _get_default_dependencies(self): ''' Get default dependencies for archive Get default dependencies from requirements file or (if no requirements file) from previous version ''' # Get default dependencies from requirements file default_dependencies = { k: v for k, v in self.api.default_versions.items() if k != self.... |
def open( self, mode='r', version=None, bumpversion=None, prerelease=None, dependencies=None, metadata=None, message=None, *args, **kwargs): ''' Opens a file for read/write Parameters ---------- mode : str Specifies the mode in which the file is opened (default 'r') version : str Version number of the file to open (def... |
prerelease values are 'alpha' and 'beta'. Either bumpversion or prerelease (or both) must be a non-None value. If the archive is not versioned, prerelease is ignored. metadata : dict Updates to archive metadata. Pass {key: None} to remove a key from the archive's metadata. args, kwargs sent to file system opener ''' if... |
as of read def version_check(chk): return chk['checksum'] == version_hash # Updater updates the manager with the latest version number def updater(checksum, algorithm): self._update_manager( archive_metadata=metadata, version_metadata=dict( version=next_version, dependencies=dependencies, checksum=checksum, algorithm=a... |
def get_local_path( self, version=None, bumpversion=None, prerelease=None, dependencies=None, metadata=None, message=None): ''' Returns a local path for read/write Parameters ---------- version : str Version number of the file to retrieve (default latest) bumpversion : str Version component to update on write if archiv... |
value. If the archive is not versioned, prerelease is ignored. metadata : dict Updates to archive metadata. Pass {key: None} to remove a key from the archive's metadata. ''' if metadata is None: metadata = {} latest_version = self.get_latest_version() version = _process_version(self, version) version_hash = self.get_ve... |
archive_metadata=metadata, version_metadata=dict( version=next_version, dependencies=dependencies, checksum=checksum, algorithm=algorithm, message=message)) path = data_file.get_local_path( self.authority, self.api.cache, updater, version_check, self.api.hash_file, read_path, write_path) with path as fp: yield fp |
def download(self, filepath, version=None): ''' Downloads a file from authority to local path 1. First checks in cache to check if file is there and if it is, is it up to date 2. If it is not up to date, it will download the file to cache ''' version = _process_version(self, version) dirname, filename = os.path.split( ... |
def delete(self): ''' Delete the archive .. warning:: Deleting an archive will erase all data and metadata permanently. For help setting user permissions, see :ref:`Administrative Tools <admin>` ''' versions = self.get_versions() self.api.manager.delete_archive_record(self.archive_name) for version in versions: if self... |
def isfile(self, version=None, *args, **kwargs): ''' Check whether the path exists and is a file ''' version = _process_version(self, version) path = self.get_version_path(version) self.authority.fs.isfile(path, *args, **kwargs) |
def is_cached(self, version=None): ''' Set the cache property to start/stop file caching for this archive ''' version = _process_version(self, version) if self.api.cache and self.api.cache.fs.isfile( self.get_version_path(version)): return True return False |
def get_dependencies(self, version=None): ''' Parameters ---------- version: str string representing version number whose dependencies you are looking up ''' version = _process_version(self, version) history = self.get_history() for v in reversed(history): if BumpableVersion(v['version']) == version: return v['dependen... |
def add_tags(self, *tags): ''' Set tags for a given archive ''' normed_tags = self.api.manager._normalize_tags(tags) self.api.manager.add_tags(self.archive_name, normed_tags) |
def open( file, mode="r", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, ): r"""Open file and return a stream. Raise OSError upon failure. file is either a text or byte string giving the name (and the path if the file isn't in the current working directory) of the file to be opened o... |
of a new file, and 'a' for appending (which on some Unix systems, means that all writes append to the end of the file regardless of the current seek position). In text mode, if encoding is not specified the encoding used is platform dependent. (For reading and writing raw bytes use binary mode and leave encoding unspec... |
The default mode is 'rt' (open for reading text). For binary random access, the mode 'w+b' opens and truncates the file to 0 bytes, while 'r+b' opens the file without truncation. The 'x' mode implies 'w' and raises an `FileExistsError` if the file already exists. Python distinguishes between files opened in binary and ... |
an exception in future versions of Python. It has no effect in Python 3. Use newline to control universal newlines mode. buffering is an optional integer used to set the buffering policy. Pass 0 to switch buffering off (only allowed in binary mode), 1 to select line buffering (only usable in text mode), and an integer ... |
(files for which isatty() returns True) use line buffering. Other text files use the policy described above for binary files. encoding is the str name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is platform dependent, but any encoding supported by Pytho... |
the documentation for codecs.register for a list of the permitted encoding error strings. newline is a string controlling how universal newlines works (it only applies to text mode). It can be None, '', '\n', '\r', and '\r\n'. It works as follows: * On input, if newline is None, universal newlines mode is enabled. Line... |
None, any '\n' characters written are translated to the system default line separator, os.linesep. If newline is '', no translation takes place. If newline is any of the other legal values, any '\n' characters written are translated to the given string. closedfd is a bool. If closefd is False, the underlying file descr... |
similar to passing None). open() returns a file object whose type depends on the mode, and through which the standard file operations such as reading and writing are performed. When open() is used to open a file in a text mode ('w', 'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open a file in a binar... |
can be used like a file opened in a binary mode. """ result = sync_io.open( file, mode, buffering, encoding, errors, newline, closefd, opener, ) return wrap_file(result) |
def wrap_file(file_like_obj): """Wrap a file like object in an async stream wrapper. Files generated with `open()` may be one of several types. This convenience function retruns the stream wrapped in the most appropriate wrapper for the type. If the stream is already wrapped it is returned unaltered. """ if isinstance(... |
def StringIO(*args, **kwargs): """StringIO constructor shim for the async wrapper.""" raw = sync_io.StringIO(*args, **kwargs) return AsyncStringIOWrapper(raw) |
def BytesIO(*args, **kwargs): """BytesIO constructor shim for the async wrapper.""" raw = sync_io.BytesIO(*args, **kwargs) return AsyncBytesIOWrapper(raw) |
async def seek(self, pos, whence=sync_io.SEEK_SET): """Move to new file position. Argument offset is a byte count. Optional argument whence defaults to SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values are SEEK_CUR or 1 (move relative to current position, positive or negative), and SEEK_END... |
def _limit_and_df(self, query, limit, as_df=False): """adds a limit (limit==None := no limit) to any query and allow a return as pandas.DataFrame :param bool as_df: if is set to True results return as pandas.DataFrame :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param int limit: maximum number of resul... |
def _join_gene(query, gene_name, gene_symbol, gene_id): """helper function to add a query join to Gene model :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param str gene_name: gene name :param str gene_symbol: gene symbol :param int gene_id: NCBI Gene identifier :return: `sqlalchemy.orm.query.Query` obj... |
def _join_chemical(query, cas_rn, chemical_id, chemical_name, chemical_definition): """helper function to add a query join to Chemical model :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param cas_rn: :param chemical_id: :param chemical_name: :param chemical_definition: :return: `sqlalchemy.orm.query.Qu... |
def _join_disease(query, disease_definition, disease_id, disease_name): """helper function to add a query join to Disease model :param sqlalchemy.orm.query.Query query: SQL Alchemy query :param disease_definition: :param str disease_id: see :attr:`models.Disease.disease_id` :param disease_name: :rtype: sqlalchemy.orm.q... |
def _join_pathway(query, pathway_id, pathway_name): """helper function to add a query join to Pathway model :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param str pathway_id: pathway identifier :param str pathway_name: pathway name :return: `sqlalchemy.orm.query.Query` object """ if pathway_id or pathw... |
def get_disease(self, disease_name=None, disease_id=None, definition=None, parent_ids=None, tree_numbers=None, parent_tree_numbers=None, slim_mapping=None, synonym=None, alt_disease_id=None, limit=None, as_df=False): """ Get diseases :param bool as_df: if set to True result returns as `pandas.DataFrame` :param int limi... |
q = q.filter(models.Disease.disease_name.like(disease_name)) if disease_id: q = q.filter(models.Disease.disease_id == disease_id) if definition: q = q.filter(models.Disease.definition.like(definition)) if parent_ids: q = q.filter(models.Disease.parent_ids.like(parent_ids)) if tree_numbers: q = q.filter(models.Disease.t... |
def get_gene(self, gene_name=None, gene_symbol=None, gene_id=None, synonym=None, uniprot_id=None, pharmgkb_id=None, biogrid_id=None, alt_gene_id=None, limit=None, as_df=False): """Get genes :param bool as_df: if set to True result returns as `pandas.DataFrame` :param alt_gene_id: :param str gene_name: gene name :param ... |
return self._limit_and_df(q, limit, as_df) |
def get_pathway(self, pathway_name=None, pathway_id=None, limit=None, as_df=False): """Get pathway .. note:: Format of pathway_id is KEGG:X* or REACTOME:X* . X* stands for a sequence of digits :param bool as_df: if set to True result returns as `pandas.DataFrame` :param str pathway_name: pathway name :param str pathway... |
def get_chemical(self, chemical_name=None, chemical_id=None, cas_rn=None, drugbank_id=None, parent_id=None, parent_tree_number=None, tree_number=None, synonym=None, limit=None, as_df=False): """Get chemical :param bool as_df: if set to True result returns as `pandas.DataFrame` :param str chemical_name: chemical name :p... |
tree_number: q = q.join(models.ChemicalTreenumber) \ .filter(models.ChemicalTreenumber.tree_number == tree_number) if parent_tree_number: q = q.join(models.ChemicalParenttreenumber) \ .filter(models.ChemicalParenttreenumber.parent_tree_number == parent_tree_number) if synonym: q = q.join(models.ChemicalSynonym).filter(... |
def get_chem_gene_interaction_actions(self, gene_name=None, gene_symbol=None, gene_id=None, limit=None, cas_rn=None, chemical_id=None, chemical_name=None, organism_id=None, interaction_sentence=None, chemical_definition=None, gene_form=None, interaction_action=None, as_df=False): """Get all interactions for chemicals o... |
:param str cas_rn: CAS registry number :param str chemical_definition: :param str gene_symbol: HGNC gene symbol :param str gene_name: gene name :param int gene_id: NCBI Entrez Gene identifier :param str gene_form: gene form :param str interaction_action: combination of interaction and actions :param int limit: maximum ... |
def gene_forms(self): """ :return: List of strings for all available gene forms :rtype: list[str] """ q = self.session.query(distinct(models.ChemGeneIxnGeneForm.gene_form)) return [x[0] for x in q.all()] |
def interaction_actions(self): """ :return: List of strings for allowed interaction/actions combinations :rtype: list[str] """ r = self.session.query(distinct(models.ChemGeneIxnInteractionAction.interaction_action)).all() return [x[0] for x in r] |
def actions(self): """Gets the list of allowed actions :rtype: list[str] """ r = self.session.query(models.Action).all() return [x.type_name for x in r] |
def get_gene_disease(self, direct_evidence=None, inference_chemical_name=None, inference_score=None, gene_name=None, gene_symbol=None, gene_id=None, disease_name=None, disease_id=None, disease_definition=None, limit=None, as_df=False): """Get gene–disease associations :param bool as_df: if set to True result returns as... |
gene_name=gene_name, gene_symbol=gene_symbol, gene_id=gene_id) return self._limit_and_df(q, limit, as_df) |
def direct_evidences(self): """ :return: All available direct evidences for gene disease correlations :rtype: list """ q = self.session.query(distinct(models.GeneDisease.direct_evidence)) return q.all() |
def get_disease_pathways(self, disease_id=None, disease_name=None, pathway_id=None, pathway_name=None, disease_definition=None, limit=None, as_df=False): """Get disease pathway link :param bool as_df: if set to True result returns as `pandas.DataFrame` :param disease_id: :param disease_name: :param pathway_id: :param p... |
def get_chemical_diseases(self, direct_evidence=None, inference_gene_symbol=None, inference_score=None, inference_score_operator=None, cas_rn=None, chemical_name=None, chemical_id=None, chemical_definition=None, disease_definition=None, disease_id=None, disease_name=None, limit=None, as_df=False): """Get chemical–disea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.