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.
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
"""This file contains code that implements the original ID* algorithm. | |
The algorithm is described in the paper "Complete Identification Methods for the Causal Hierarchy" | |
but the algorithm itself is not complete, as there are identifiable queries that cannot be | |
identified with this algorithm. | |
""" | |
import logging | |
from typing import Collection, Set, Tuple, cast |
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 time | |
import pystow | |
import requests | |
from bioregistry.external import get_obofoundry | |
from tqdm.auto import tqdm | |
TOKEN = pystow.get_config("github", "token") | |
TEXT_FORMAT = """\ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder