This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.11" | |
# dependencies = [ | |
# "clinicaltrials-downloader>=0.0.2", | |
# "pyobo[grounding]", | |
# "tabulate", | |
# "pystow", | |
# "click", | |
# ] | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.11" | |
# dependencies = [ | |
# "beautifulsoup4", | |
# "requests", | |
# "yt-dlp", | |
# ] | |
# /// | |
"""Download chapters from Wind and Truth. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import bioregistry | |
if __name__ == "__main__": | |
r = json.load(open("mismatch.json")) | |
with open("mismatches.sssom.tsv", "w") as file: | |
print( | |
"subject_id", | |
"subject_label", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any | |
from snapquery.snapquery_core import QueryName, NamedQueryManager, QueryBundle | |
#: See documentation at https://snapquery.bitplan.com/docs | |
API_ENDPOINT_FMT = "https://snapquery.bitplan.com/api/query/{domain}/{namespace}/{name}" | |
type Result = dict[str, Any] | |
type Results = list[Result] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bioregistry | |
from pydantic.functional_validators import AfterValidator | |
def validate_local_identifier(prefix: str) -> AfterValidator: | |
"""Make a validator function based on a Bioregistry prefix. | |
Example usage: | |
.. code-block:: python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tabulate import tabulate | |
import bioregistry | |
if __name__ == "__main__": | |
rows = [] | |
for resource in bioregistry.resources(): | |
if resource.is_deprecated(): | |
continue | |
if resource.get_contact(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from dateutil.parser import parse | |
res_json = requests.get( | |
f'https://pypi.org/pypi/bioregistry/json', | |
headers={'Accept': 'application/json'} | |
).json() | |
releases = { | |
parse(data[0]['upload_time']): version |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch_max_mem import maximize_memory_utilization | |
import logging | |
import torch.mps | |
from humanize.filesize import naturalsize | |
logging.basicConfig(level=logging.DEBUG) | |
@maximize_memory_utilization() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder