sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
07b9ea557a5f59587b50f618c10b9cf6c128c04b7c6ce3db8d537da804dc0043 | Python | 19,614 | 506 | ###########################################################################################
# Atomic Data Class for handling molecules as graphs
# Authors: Ilyes Batatia, Gregor Simm
# This program is distributed under the MIT License (see MIT.md)
########################################################################... |
971192cfddbc19c4ae380836ed3711833e40891b712d0aef9edead4e126ee57a | Python | 19,616 | 544 | '''
Author: Guoqing Bao
School of Computer Science, The University of Sydney
Date: 2020-05-01
GitHub Project Link: https://github.com/guoqingbao/Pathofusion
Please cite our work if you found it is useful for your research or clinical practice
#Can be cited as:
Guoqing Bao, Manuel B. Graeber, Xiuying Wang, "A Bifocal ... |
c03531f682a0c1a0b24ae65b9992b361abfcf22599248ab8ee60f4f9a2bba9b4 | Python | 19,641 | 524 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import warnings
from pathlib import Path
import json
import numpy as np
import matplotlib as mplb
import matplotlib.pyplot as plt
import matplotlib.patheffects as patheffects
import matplotlib.animation as animation
from scipy import signal as sig
f... |
a6f0b52228d73e444fddfa3ebf56b495c7e88cdde34fc392bbd1c6fe2504faf4 | Python | 19,645 | 449 | # -*- coding: utf-8 -*-
# OS stuff
import os
import sys
import warnings
from pathlib import Path
from tqdm import tqdm
# Computational stuff
import numpy as np
import matplotlib as mplb
import matplotlib.pyplot as plt
# TensorPAC
from tensorpac import Pac
from tensorpac.utils import PSD
# Other scripts and my stuff... |
4cdd94de69100131bb8a5fe35a4515cacf6edbed7b56f509b9afff2e394a7ed8 | Python | 19,669 | 504 | # This file is a part of the `nequip` package. Please see LICENSE and README at the root for information on using it.
import ase
import torch
from e3nn import o3
from e3nn.util.test import equivariance_error
from nequip.nn import GraphModuleMixin, GraphModel
from nequip.nn.utils import ir_mul_to_mul_ir, mul_ir_to_ir_m... |
9ad6883c6757a97df865e3828b7f034e5344424953c46bd3f5cc600468f9387a | Python | 19,679 | 499 | # Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
30b29b7c0d2810cae098e21aed30118345fefe229a0c92434bc69ec7d49511a5 | Python | 19,690 | 577 | ###########################################################################################
# This program is distributed under the MIT License (see MIT.md)
###########################################################################################
from __future__ import annotations
import argparse
import ast
import l... |
285633f64e3d15275495ae6ced1336562c17258581116a75d28eebbf0bd53495 | Python | 19,692 | 494 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.19.3
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# # _De novo... |
532db82f4b0114b01d0fd31b667b5353eb06af3bd54a4f9eedcb9ce59d95294a | Python | 19,701 | 463 | import ast
import logging
import numpy as np
import torch
from e3nn import o3
from mace import modules
from mace.modules.wrapper_ops import CuEquivarianceConfig
from mace.tools.deprecation import warn
from mace.tools.finetuning_utils import load_foundations_elements, load_foundations_mdp
from mace.tools.scripts_utils... |
11b1c7aaf2fed97f3a5e528b54bbc9823912a85f6e690601b9a7a1d64b7d038f | Python | 19,718 | 486 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
cc81ce582fcbe24a0e046c5c546494778d41de7aae6cd71a1d48de01d5f5a7b6 | Python | 19,719 | 573 | import os
from collections import namedtuple
from typing import Dict, Callable, List
from model_angelo.utils.misc_utils import upper_and_lower_case_annotation
import numpy as np
import torch
from scipy.spatial import cKDTree
from model_angelo.utils.aa_probs_to_hmm import dump_aa_logits_to_hmm_file
from model_angelo.u... |
58db233c69c46b1a4134a191aa539f22bd0e6305457f72232ea8bbd013b74ad1 | Python | 19,723 | 651 | import os
import shutil
from pathlib import Path
import numpy as np
import pytest
import torch
from scipy.spatial.distance import cdist
def test_collate_graph():
from mlspm.data_loading import collate_graph
from mlspm.graph import MoleculeGraph
# fmt: off
X_in = np.random.rand(4, 128, 128, 10)
... |
f689995d6508fa174e034d18a9efacb01aaf8fde375b9159f7fb9fc51b21847f | Python | 19,745 | 361 | """Assemble the master table: read, patch, fix, score, hash.
This is ``runBuidDatabase.py``'s main flow. The legacy version spent nearly all of its 344 s in
seven ``master_table.T.apply(...)`` calls -- transpose the frame, then call a Python function per
row -- plus an ``iterrows()`` over ~192k rows in the score facto... |
64cb0f05eff5a7fb4a294ca7dbef3691c857c1160893cb8f651a928e93ea7bef | Python | 19,749 | 503 | """Build regressors for a DesignMatrix: HRF convolution and drift terms.
`convolve` applies one of nilearn's HRF models or a custom kernel; `add_poly`
and `add_dct_basis` add Legendre polynomial and discrete-cosine drift
regressors in the reserved ``.nl_`` namespace. Each function returns a new
`DesignMatrix` with met... |
9f659a3b8bf60adfafd39030db4f22a74623e3c5579037378362507538072e04 | Python | 19,776 | 595 | # in this script to fellow fairly closely Zou et al
# but the create a equivariant descriptor for each type
# of tree topology from the beggining
# We use a an embedding "across sequences" instead to
# within sequences.
# this is an optimized version of the lstm network
import numpy as np
np.random.seed(1234567)
# ... |
d52f4c180ea934cabf5760902f577e63296961cd35408b921fbe011be43365cc | Python | 19,779 | 546 | """
Multi-process, shared, state store implementation based on multiprocessing.Manager
Author: Tal Eisenberg, 2021
The state store maintains a shared dictionary. Access to the dictionary is synchronized between processes and threads
by creating a deep copy of the full dictionary on each read, and replacing the full di... |
a617b10979a01f1cfb7a8573d56e6f095f58e9c9d56a420fbd2710b5387ba904 | Python | 19,781 | 546 | """
Multi-process, shared, state store implementation based on multiprocessing.Manager
Author: Tal Eisenberg, 2021
The state store maintains a shared dictionary. Access to the dictionary is synchronized between processes and threads
by creating a deep copy of the full dictionary on each read, and replacing the full di... |
b04eac94efa4b4f7149634e7ac5a1246d83da9aee153f320e9db8077c6a9fb72 | Python | 19,796 | 596 | """
Implementation of functions for loading fmri data.
Created on Jun 29 2023
@author: Mohammad Torabi
"""
import os
from copy import deepcopy
import h5py
import numpy as np
from nilearn import datasets
from nilearn.interfaces.fmriprep import load_confounds, load_confounds_strategy
from nilearn.maskers import NiftiL... |
3eb6d5347dd6b5187bd74a013470172d87f272498d686ecd83f15ea29d83408c | Python | 19,801 | 347 | """Row-level chunk validation, vectorised.
Ported from ``py_src/ChunkQC.py``, which applied each validator with ``.apply`` per cell and built
two of its three emptiness masks with ``chunk_df.T.apply`` -- transpose, then row-wise Python. Here
every rule is one polars expression over the full frame.
Two behaviours are ... |
041043fb881a16ce69548884c601c3d254f22a9da2f68931510195cd6ad2aa50 | Python | 19,829 | 495 | #%%
"""
Helper functions.
"""
import functools
import logging
import os
import subprocess
import re
import jax
import numpy as np
import scipy.optimize
from jax import numpy as jnp
import haiku as hk
import e3nn_jax as e3nn
from typing import Tuple, List
LOGGER = logging.getLogger("dpe")
############################... |
294072efe8c023e598c0f0c21362260199d3ffa80ac99fc724840c53b41b969a | Python | 19,830 | 484 | import torch
import torch.nn.functional as F
import torch.nn as nn
import ISNetLayers
import ISNetFunctions
import LRPDenseNet
import globals
import pytorch_lightning as pl
import torch.multiprocessing
torch.multiprocessing.set_sharing_strategy('file_system')
class IsDense121Lightning(pl.LightningModule):
def __i... |
0463900591a490e7b2ea1ad11f38ba5050f3716dfd3e3407ee53acedec207ac0 | Python | 19,837 | 521 | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# Modified by Ke Sun (sunk@mail.ustc.edu.cn)
# ------------------------------------------------------------------------------
from ... |
576075effbe1d0c687994224a7458915d8f9f4fc8f458147df58c6a455c0cc7b | Python | 19,847 | 543 | """End-to-end tests for self-contained SanPy Zarr collection export."""
import json
import shutil
from pathlib import Path
from typing import Any
import numpy as np
import pandas as pd
import pyabf
import pytest
zarr = pytest.importorskip(
"zarr",
minversion="3.1",
reason="Install the zarr-export extra t... |
32389fcb610b9108a979a5da708b0cf04ed79de1b022b8bf7c3e7e20e0b960a2 | Python | 19,855 | 593 | from configuration import *
import numpy as np
import pandas as pd
import xarray as xr
from spikeinterface.sortingcomponents.benchmark.benchmark_motion_estimation import plot_errors_several_benchmarks, plot_speed_several_benchmarks, plot_error_map_several_benchmarks
from spikeinterface.sortingcomponents.benchmark.ben... |
7af8cb2c757daf968e4f33e580a76d68dc98f5a796716b9392ebfe70febd9fa0 | Python | 19,891 | 511 | #!/usr/bin/env python
"""Convert marimo tutorial notebooks to zensical pages executed by markdown-exec.
The marimo ``.py`` notebooks under ``docs/tutorials/`` are the single source of
truth for the tutorials — the ``.md`` pages are build artifacts and are never
hand-authored or committed. This script shells out to ``m... |
23425fea41213b0750f250400ae22dd428c0cf0dfd8aa299b99e8d9466aa15e6 | Python | 19,895 | 607 | from functools import partial
import numpy as np
from PyQt5 import QtCore, QtWidgets, QtGui
import matplotlib.pyplot as plt
import sanpy
from sanpy import bAnalysis
from sanpy.interface.plugins import sanpyPlugin
from sanpy.interface.plugins import (
ResponseType,
) # to toggle response to set sweeps, etc
fro... |
cf671e3410cd7d29dfe7093312cf6b2f556365ae1a9196a0351e0dfa2f9a9c44 | Python | 19,909 | 336 | """TCRNET: which clonotypes sit in a denser neighbourhood than the background explains.
Stage one of the motif pipeline. Per ``(species, gene, epitope)`` it counts, for every unique CDR3,
how many neighbours it has within the epitope-specific sample and how many it has in a matched
background repertoire, and keeps the... |
1d4d388b0f1d67db8a398da0fece2699f68cc101ef0b4fe4f15e6ff28345237f | Python | 19,920 | 572 | from typing import Union, Optional, List, Dict, Tuple, Any
from dataclasses import dataclass, field
import copy
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import statsmodels
import myforestplot.vis_utils as vis_utils
@dataclass(repr=True)
class Fo... |
0c8e8eb7e6b0210202b0694e9e32fb09777d353d9cfdafae7e3355c5f5ba0bfe | Python | 19,930 | 560 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
d7e233aed9b149413821fe10e75d2499cb730caade065d8ffb0e557f2fd4ebbc | Python | 19,989 | 485 | # -*- coding: utf-8 -*-
try:
import torch
except ImportError:
raise ImportError('missing PyTorch')
import os
from copy import deepcopy
from math import ceil
import odl
import numpy as np
from tqdm import tqdm
from torch.utils.data import DataLoader
try:
from torch.utils.tensorboard import SummaryWriter
ex... |
b0e75a7db3276cedda5dd8727fc46900b691d62780dc41bdf6a7f2ccd05095e2 | Python | 19,998 | 485 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from typing import Dict, List, Optional
import torch
import torch.nn as nn
from torch import Tensor
from fairseq import utils
from... |
69e2cec392646e2f8af3647ea7d322ab7b264b695ed32ad23a3d15c57f4927c2 | Python | 20,003 | 570 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Tuple
import numpy as np
import torch
import... |
be33c4c722654715159202777be403a47e19e5e636112551f3d366e0b8b338f3 | Python | 20,010 | 333 | """CDR3 markup against external nucleotide truth, on VDJdb's own records.
`assemble.master.fix_cdr3` documented its two engines on **coverage** - how often each declines - and
coverage cannot tell "answers more" from "answers better". The phase 5 swap decision (ROADMAP
section 28) rests on that measurement alone. Thes... |
952a1ae2d92ea5506d166cc6e96bdcaba3eacabd6bad8fcfd9778d1049a82786 | Python | 20,027 | 410 | """
# Fingerprinting - CAMCAN Cohort
## Variance in functional connectivity
Script - Variance calculator
Author: Frédéric St-Onge
Date created: 2021-07-23
Date modified: 2022-01-25
Version: 1.1
--------
Updates:
--------
2021-12-14: Added documentation across. Added the calculation of absolute distance from mea... |
c2072c627d86b00cdb248efd505a12467044afe39b9276353c0deb5f96391e0c | Python | 20,116 | 542 | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
72ee734aeae172276557a6e6a2a87821aaaad3f844b9a28e090ef927a6626391 | Python | 20,137 | 503 | """ find_intersecting_snps
This is a rewrite of the official WASP code. It has a more straightforward
design, that is faster and has no maximum window size, but requires loading all
SNPs into memory at once. For reference, 70 million SNPs requires about 10GB of
RAM.
"""
from __future__ import print_function
imp... |
dbc3459ecec39265b40b243505ceb7c5fc2c8e5978c9126eee757748d0defd31 | Python | 20,146 | 503 | """Notebook-style output for the markdown-exec ``python`` cells in the tutorials.
markdown-exec renders only what a cell prints. This module swaps in a ``python``
formatter that behaves like a notebook cell instead:
- the value of the cell's final expression is displayed (DataFrames, models, and
anything else with ... |
f29bf52ccdef63a901a35c4f0f49a4e121ad23cb1c43698a5db6e053d0016e2e | Python | 20,168 | 696 | from __future__ import annotations
import copy
import itertools as it
from os import PathLike
from pathlib import Path
from string import ascii_letters, digits
from typing import (
TYPE_CHECKING,
Any,
Container,
Hashable,
Iterable,
Sequence,
TypeVar,
)
import hypothesis.strategies as st
fr... |
5e9453bf8233ec32df079baa5602ef219849791be1124445ccf4c90aa6af0d74 | Python | 20,175 | 435 | """The derived id levels: clonotype, clone, pMHC and epitope.
``ROADMAP.md`` section 10.5 names seven invariants. Six of them are checks over a built directory and
are exercised through :mod:`vdjdb.identity.checks` below. The seventh is a property of two builds, so
it is the one test here that does the assembly twice:... |
46087e7c9c8469de487f8006fd77b7b8fb6dc7cd309d28785823faf8515c4ad4 | Python | 20,232 | 597 | import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib import cm as cm
from matplotlib import colors
from matplotlib.patches import Rectangle
from pysurvival import utils
from pysurvival.utils import metrics
from pysurvival.utils.metrics import brier_score
from sklearn.metrics impor... |
32892808597685a43de1d27c301f9ad7ef1193a75a83ba5c7c66b1ef85afd453 | Python | 20,268 | 549 | import pytest
from neuron import h
import numpy as np
from hnn_core.cells_default import (
pyramidal,
basket,
_exp_g_at_dist,
_linear_g_at_dist,
_get_syn_props,
_get_basket_syn_props,
)
from hnn_core.network_builder import load_custom_mechanisms
def test_cells_default():
"""Test default ... |
6c14c6a1faac095055375b2f37255553cc861a55854e6c22b2db9531bdc38f2b | Python | 20,268 | 619 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
2eb4805aac9456ae5266521c307f51873fbe90f6ab1f819c0b4045076702ca81 | Python | 20,311 | 602 | import copy
from pathlib import Path
import ase.io
import numpy as np
import pytest
import torch
from ase import build
from ase.atoms import Atoms
from ase.calculators.test import gradient_test
from ase.filters import FrechetCellFilter
import mace.calculators.foundations_models as foundations_models
from mace.calcula... |
981f95bf8408177ce1c13d36c5d33930e1ec91bd51638b397b247c37cbb59a40 | Python | 20,311 | 583 | """The Siegel manifold.
The Siegel manifold is a generalization of the Poincare disk to complex matrices
of singular values strictly lower than one.
It is defined as the set of complex matrices M such that:
I - M @ M.conj().T is a positive definite matrix.
Warning: another more restrictive definition of the Siegel dis... |
1161550e5f0233dbfa2ff88b1a3807b72ae65ba502deafd5cd5d8b34ffc5a681 | Python | 20,317 | 702 | # /// script
# requires-python = ">=3.11"
# dependencies = [
# "marimo",
# "nltools>=0.6.0",
# ]
# ///
# Working with BrainData — marimo notebook. Source of truth for the docs page; rendered to the docs page by scripts/marimo_to_zensical.py.
import marimo
__generated_with = "0.24.0"
app = marimo.App(width="me... |
52086a61bea39c0009147e8ff2a1ebcc0d0b7113ef34235fbd6680f135d8ab18 | Python | 20,326 | 491 | """Generate the committed golden fixtures.
Run through ``tests/golden/regenerate.py``; this module is importable so the
generation is one seeded function per structure rather than a script whose
output nobody can reproduce.
The six evaluation structures are not a convenience sample. Each one exists
to reach a distinc... |
dc810488cbe9cde53ba5916054fbe4a765ce66cbea07f48e9ae37c6b128e704a | Python | 20,351 | 532 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import warnings
from pathlib import Path
import json
import numpy as np
import matplotlib as mplb
import matplotlib.pyplot as plt
import matplotlib.patheffects as patheffects
import matplotlib.animation as animation
from scipy import signal as sig
f... |
031fcd027c4667a50d6c58b40f973eb75bc0efa31e98c4cdcaff16498e2e0567 | Python | 20,360 | 518 | """Concatenate DesignMatrix objects horizontally or across runs.
`append` dispatches to `_append_horizontal` (add columns) or `_append_vertical`
(stack runs). Vertical appends can keep confound columns separate per run by
renaming them into the reserved ``.nl_r{run}_`` namespace, so each run gets
its own intercept and... |
9c998867b0c8c3bb06b2101ca409c3485196815a40e20333af446e1a1253c315 | Python | 20,372 | 532 | from __future__ import absolute_import
import warnings
import numpy as np
from numpy.testing import assert_allclose
from nose.tools import assert_equal, assert_true
import pycircstat
from pycircstat.tests import _sample_cdf
def test_rayleigh():
data = np.array([
-0.94904375, 0.26575165, -0.03226759, 1.... |
2a298747f62186a373750e1e24d0b033d963ccd53f07990423d4a5d0707a32ec | Python | 20,385 | 558 | from typing import List, Optional, Sequence, Tuple, Union, cast
from uuid import UUID
from overrides import overrides
from chromadb.api.collection_configuration import (
CreateCollectionConfiguration,
create_collection_configuration_to_json_str,
UpdateCollectionConfiguration,
update_collection_configura... |
df1c5f8d7a360c34c4114ed48bd8ded2313c7ec010911a87b605ce188790c3e0 | Python | 20,399 | 462 | import numpy as np
import pandas as pd
from itertools import combinations
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib.ticker import FormatStrFormatter
from matplotlib.offsetbox import AnchoredText
import seaborn as sns
font = {'family' : 'sans-serif',
'size' ... |
10892825d7eb4d182c4d9f382913a049c053aa98616d3260407a478b84e96fa9 | Python | 20,404 | 558 | # Copyright 2020-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Plan module."""
import inspect
from hashlib import sha384
from importlib import import_module, reload
from logging import getLogger
from os.path import splitext
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, Optio... |
76755968b8e8383df9d2a9d1155b0e2048277b82ea406301a39386c6bcdbdb68 | Python | 20,434 | 393 | import os
import torch
import torch.nn as nn
from rdkit import Chem
from dig.ggraph.method import Generator
from .model import GraphFlowModel, GraphFlowModel_rl, GraphFlowModel_con_rl
from .train_utils import adjust_learning_rate, DataIterator
class GraphDF(Generator):
r"""
The method class for GraphDF al... |
f058b3ff60a3e714c198c9ef42fffdc523efc11db57f393250fcdce9b0242e4a | Python | 20,444 | 519 | from copy import deepcopy
from pathlib import Path
from urllib.request import urlretrieve
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from numpy.testing import assert_allclose
from h5io import write_hdf5
import pytest
from hnn_core import read_dipole, average_dipoles
from hnn_core import Netw... |
2be211f87981b218889cd9dd60e98e7db9ee172514238c0105ccfadf701c8116 | Python | 20,456 | 540 | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# Modified by Ke Sun (sunk@mail.ustc.edu.cn)
# ------------------------------------------------------------------------------
from ... |
9db1ddf80f5c9fb3e3bf1634e1bbc13ea9df816336e6d221bd448982c8d35353 | Python | 20,487 | 553 | import pytest
import geomstats.backend as gs
from geomstats.geometry.fiber_bundle import FiberBundle
from geomstats.geometry.general_linear import GeneralLinear
from geomstats.geometry.group_action import SpecialOrthogonalComposeAction
from geomstats.geometry.manifold import register_quotient
from geomstats.geometry.m... |
4a138fdc42fa1648451596a4a5caa3f047a31868e5fb6370de69b405213a4076 | Python | 20,492 | 347 | """The definitive tables' contracts, on a real build.
Marked ``release``: needs a built directory (``VDJDB_TABLES``, default ``out/tables``), because the
properties worth asserting here -- a key is unique, a hash does not collide, a foreign key resolves
-- are invisible on the handful of synthetic rows the unit tests ... |
43f339836adde5809c16e57d7a972dc9d51d1af8f2a6d991b869eb9b3f6fb2f0 | Python | 20,504 | 395 | import os
import torch
import torch.nn as nn
from rdkit import Chem
from dig.ggraph.method import Generator
from .model import GraphFlowModel, GraphFlowModel_rl, GraphFlowModel_con_rl
from .train_utils import adjust_learning_rate, DataIterator
class GraphAF(Generator):
r"""
The method class for GraphAF al... |
881e8b63349a8bf26e491e1724b1934bae274e8bbe5ae95de203b8de76a74bdd | Python | 20,507 | 574 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Base classes for various fairseq models.
"""
import logging
from argparse import Namespace
from typing import Dict, List, Optional, Tuple
... |
d88d3685ad978213f528ed8991420e7eae881a2cef282f6c3ab2dcd11bf28d50 | Python | 20,527 | 464 | import os
from typing import Optional, Tuple
import numpy as np
import torch
from PIL import Image
from scipy.stats import multivariate_normal
from skimage import feature, measure
from .._c.bindings import match_template_pool, peak_dist
from ..utils import write_to_xyz
from ._molecule_graph import MoleculeGraph
VDW_... |
111e7211223d76d89d951c73f1fa5e16d84fadb7a5cefc6f3679a28abbce4f2c | Python | 20,546 | 518 | from PymoNNto.Exploration.Evolution.common_UI import *
from PymoNNto.Exploration.Evolution.communication import *
from tkinter import Tk #for clipboard access
class Evolution_UI(Execution_Manager_UI_Base):
def get_folder(self):
return 'Evolution_Project_Clones'
def get_title(self):
return 'E... |
2102afe9d958078361a7c4cc409234a1915faf72d7f73cdbddd1673ac5758b3f | Python | 20,547 | 604 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
ae1a4d10b434c30d48906624a08a29f0e2c0bf6ce9fb3e3bdcffdc7dc6b19840 | Python | 20,584 | 546 | # Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
caf892803eec1c959ab7042f0bfad986f40977436a82c0149f5db251e3c3be93 | Python | 20,620 | 312 | """Junction nucleotides, D geometry and how sure the D call is - one library call (#461).
VDJdb records amino-acid junctions; a great deal of downstream work - generation probability,
recombination markup, full-contig synthesis - needs nucleotides, and the D segment needs naming and
placing before anything can draw a ... |
48d7ad4f4665ddb7cbc427f1d37b619bf5e27120e969c361c2483cf1063ec026 | Python | 20,624 | 506 | import os
import numpy as np
import sklearn.metrics as skmetrics
import tensorflow as tf
import timeit
import tensorflow.contrib.metrics as contrib_metrics
import tensorflow.contrib.slim as contrib_slim
import nn
import logging
logger = logging.getLogger("default_log")
class TinySleepNet(object):
def __init__(... |
089aef867960e5603a7a5f0ac3dc98ad995b830747c866b91110f77fcadf8d62 | Python | 20,637 | 556 | import click
from copy import deepcopy
from corgie import scheduling, argparsers, helpers, stack
from corgie.log import logger as corgie_logger
from corgie.layers import get_layer_types, DEFAULT_LAYER_TYPE, str_to_layer_type
from corgie.boundingcube import get_bcube_from_coords
from corgie.argparsers import (
LA... |
81eafea3dbfe5975c8980b7cd085c8e2f5f982434310b8329dcb9027f8bf6138 | Python | 20,659 | 495 | # -*- coding: utf-8 -*-
"""Tests for PopulationTemplate and Connectivity.
Each test verifies that the new vector/matrix-native API produces numerically
identical results to the existing scalar node + edge API.
"""
import numpy as np
import pytest
# -------------------------------------------------------------------... |
a27690cea7b5135834d64c8a69c57b964c808af81e81b1d42c3728e08af844ac | Python | 20,692 | 556 | """ find_intersecting_snps
This is a rewrite of the official WASP code. It has a more straightforward
design, that is faster and has no maximum window size, but requires loading all
SNPs into memory at once. For reference, 70 million SNPs requires about 10GB of
RAM.
"""
from __future__ import print_function
import a... |
22169c87a6c765672fcd558bbd101f0cb649137a7ad59cde4f6f8c04ffa885c3 | Python | 20,696 | 473 | import math
from typing import Optional, Tuple, Union
import logging
import numpy as np
import torch
import warnings
from dynaphos.cortex_models import get_cortical_magnification
from dynaphos.image_processing import scale_image, to_n_dim
from dynaphos.utils import (to_tensor, get_data_kwargs, get_truncated_normal,
... |
e89af25f97b58870baac45986d5b4a0b100b4ae6e79a89bef49a75462943b053 | Python | 20,697 | 615 | r"""
Manifold of linear subspaces.
The Grassmannian :math:`Gr(n, k)` is the manifold of k-dimensional
subspaces in n-dimensional Euclidean space.
Lead author: Olivier Peltre.
:math:`Gr(n, p)` is represented by
:math:`n \times n` matrices
of rank :math:`p` satisfying :math:`P^2 = P` and :math:`P^T = P`.
Each :math:`... |
d3b31947ac74d7ea8befd06fa068d42f2edb2b1e06ab55676d985be5bb6dd585 | Python | 20,700 | 516 | """The v1.0 deprecation table, and the guards that keep it honest.
The table is advance notice: it says, from a release that still has the
feature, which surfaces MACE v1.0 removes or replaces. Four things about it can
rot silently, and each has a test here.
* A row that has drifted from the inventory it came from. T... |
8e5ceb5db1e8d3cda472160a3d560b25f6eb80972e3a5ec67e74f3622176a584 | Python | 20,727 | 513 | import wfdb # "A library of tools for reading, writing, and processing WFDB signals and annotations."
from numpy import (arange as rng,
concatenate,
zeros as npzeros)
from torch import (zeros,
arange,
long,
randperm,
... |
f5e8592add6785a28779d3aad03d6ff6f2b49aa5d7b78f65ebb6e7f62ea90456 | Python | 20,729 | 497 | from concurrent import futures
from typing import Any, Dict, List, cast
from uuid import UUID
from overrides import overrides
import json
from chromadb.config import DEFAULT_DATABASE, DEFAULT_TENANT, Component, System
from chromadb.proto.convert import (
from_proto_metadata,
from_proto_update_metadata,
fro... |
2e0bd7f92c50a029638a607612477383205c4209f9041c49eda065ee6ddb8e5a | Python | 20,818 | 620 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
Pytorch dataset classes from PPI prediction.
"""
from ppi.data_utils.pignet_featurizers import mol_to_feature
from rdkit import Chem
import os
import pickle
from typing import Any, Dict, List
import numpy as np
im... |
c84641653edac62c8a38c103860bcf396f3527e849f5d032af2498f94a85f84d | Python | 20,834 | 507 | """inta_ss.py: Defines the INTA class that manipulates the INTA database."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import numpy as np
import pyedflib
from sleeprnn.common import constants
from sleeprnn.data import utils
fro... |
4cb8d681e0a73a071b77a7cebc31a1e4b74e2f84e641dacf7e9dc38b22e9602d | Python | 20,891 | 521 | import numpy as np
import polars as pl
import pytest
from nltools.data.designmatrix import DesignMatrix
class TestDesignMatrixConvolution:
"""
Test HRF convolution functionality.
Behavioral contract:
- Default convolution uses Glover HRF
- Can provide custom kernels
- Polynomial columns exclu... |
9f769987d2bd2ac1930ef1467b14761f58389eaf921154bf798a435588df6ed7 | Python | 20,915 | 548 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
93f02f509fdebf591782e9ad5d1d5b138e6e44de87512e00279edf4047f0cbf1 | Python | 20,930 | 399 | # Generated by Django 4.2.2 on 2023-07-31 10:13
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_... |
6bdd30e7ffc08d1dd5b25f5fc4f1cac21335249544bf665fa6081c214a700726 | Python | 20,940 | 547 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# OS stuff
import os
import sys
import warnings
from pathlib import Path
# Computational stuff
import numpy as np
import matplotlib as mplb
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpecFromSubplotSpec
from matplotlib import ticker
# TensorPAC
... |
1281e6383a1bf99546e572d0914fdab8aec65045c8e8fb148055dc41fe9c15f0 | Python | 20,961 | 509 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
a4b8e912b766813f81a14805514f4e321309eaa71c8cab53fc387723f31d83ee | Python | 20,984 | 342 | import logging
import jax
import jax.numpy as jnp
from typing import List, Dict, Tuple, Optional, Any, Callable
import numpy as np
from deeperwin.configuration import Configuration, OptimizationConfig, EvaluationConfig, PhysicalConfig
from deeperwin.optimization.evaluation import evaluate_wavefunction
from deeperwin.g... |
c239492b75f46f65f14b28900052e7b864349c41712466d3e9f93b6b88e43b95 | Python | 21,002 | 586 | from collections import namedtuple
from typing import List, Tuple
import numpy as np
import pyhmmer
from model_angelo.utils.aa_probs_to_hmm import aa_logits_to_hmm, alphabet_to_index
from model_angelo.utils.fasta_utils import (
find_match_range,
in_seq_dict,
remove_dots,
remove_non_residue,
sequen... |
80cbdb68e00bdfbc19d1901b6847be34ff58b79bad8dee2af36e15ff656c881e | Python | 21,049 | 569 | #!/usr/bin/env python3
import logging
import math
from pathlib import Path
from typing import Dict, List, Optional, Tuple
import torch
import torch.nn as nn
from torch import Tensor
from fairseq import checkpoint_utils, utils
from fairseq.data.data_utils import lengths_to_padding_mask
from fairseq.models import (
... |
8523346ccf203f927c11ffb323f5885bab512274073d489b4ca4fbb5d5f56d8b | Python | 21,063 | 527 | """Main functions to train and test a model to classify empirical and
simulated MSAs
"""
import errno
from datetime import datetime
from sklearn.model_selection import StratifiedKFold
from torch.utils.data import DataLoader
from .ConvNet import ConvNet, load_model, compute_device, activation
from .attr_methods impor... |
6ccac556c70a2e820ec3c8d48f4f5da71e39ae936b247f47c2e2bb16d060bbf9 | Python | 21,064 | 608 | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
import random
import torch
import math
import argparse
from typing import Sequence, Dict, Any, Union, Tuple, List, Optional
from torch.nn import functional as F
from utils import logger
from . import register_tran... |
96d5951359bf94aa3f61954f78b01116e9df87b1363c8baa77ec77b6efb298d5 | Python | 21,096 | 486 | """One forward, two energies, two dtypes: the legacy split, pinned.
`ScaleShiftMACE.forward` returns `total_energy` in the model's dtype and
`node_energy` in float64 (`mace/modules/models.py:581-582`), because the
per-atom quantity is assembled through `safe_double`. Plain `MACE` does not
(`:399`). So a `--default_dty... |
ff68230b9015685c8680704b1ebf8ef9af5be90ac82fc157b64733b8b0b15955 | Python | 21,102 | 590 | """The manifold of Hermitian positive definite (HPD) matrices.
Lead author: Yann Cabanes.
References
----------
.. [Cabanes2022] Yann Cabanes. Multidimensional complex stationary
centered Gaussian autoregressive time series machine learning
in Poincaré and Siegel disks: application for audio and radar
cl... |
9ba1d85785abbc53c8dbf0112d9ed16fa36b8aa63a31cdc324dfdc13abc505ca | Python | 21,123 | 360 | #*----------------------------------------------------------------------------*
#* Copyright (C) 2024 ETH Zurich, Switzerland *
#* SPDX-License-Identifier: Apache-2.0 *
#* *
... |
0d5d5be8109004743242c377c19aa093b2ea8dc1d68ead475d5a71a02539c9f2 | Python | 21,131 | 522 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
ae4fd5701a3ae8bf6cae02423554a315fee85f4264b111d4e346e0ad65f477a2 | Python | 21,141 | 571 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
acbe701e12faef9d95a4483cf327cdc369ca4c427db033e239f9a9bec7a281da | Python | 21,209 | 498 | from typing import List, Tuple, Dict
from math import sqrt
import torch
from torch import Tensor
import torch.nn as nn
import matplotlib.pyplot as plt
import networkx as nx
from torch_geometric.nn import MessagePassing
from torch_geometric.utils.loop import add_self_loops, remove_self_loops
from torch_geom... |
b2bd17953113f8d37ed36c56911660e294ab8d5b4151289c7a1b5a4f6b255731 | Python | 21,210 | 595 | """Objective functions for parameter optimization."""
# Authors: Carolina Fernandez <cxf418@miami.edu>
# Nick Tolley <nicholas_tolley@brown.edu>
# Ryan Thorpe <ryan_thorpe@brown.edu>
# Mainak Jas <mjas@mgh.harvard.edu>
import numpy as np
from scipy.signal import periodogram
from hnn_core i... |
b06dc51ccf7a40016999e67288114e0c3348eca984532901baa8d58b526b6195 | Python | 21,229 | 609 | """Class for (principal) fiber bundles.
Lead author: Nicolas Guigui.
"""
import logging
import math
from abc import ABC, abstractmethod
import geomstats.backend as gs
from geomstats.numerics.optimization import ScipyMinimize
from geomstats.vectorization import check_is_batch, get_batch_shape
def _from_base(method)... |
8731576a94b4c821332870d4dc806fdea8ac6f0c3be02455c89f0e16b51eeebc | Python | 21,306 | 591 | from collections import namedtuple
from typing import Dict, List, Tuple, Union
import numpy as np
from Bio.PDB import Chain, MMCIFParser, PDBParser, Residue
from Bio.PDB.Atom import DisorderedAtom
from Bio.PDB.Polypeptide import PPBuilder
from numpy.typing import ArrayLike
from model_angelo.utils.residue_constants im... |
9cd0c3eda23a60229b488f41a00c3edbff4ad13c52e7cc3b6dd227cafaaa252e | Python | 21,307 | 523 | import sys
import os
sys.path.append(os.path.abspath(''))
sys.path.append(os.path.abspath('..'))
import time
import datetime
import torch.nn as nn
from torchnet import meter
import pickle
import argparse
from torch_geometric.loader import DataLoader
from data_io_guassian import NeighResidue3DPoint
from GN_model_guass... |
83ea11ec68afafe8029df5317df183894b5d0a9e3160ec956bfa85ad9e90e5e2 | Python | 21,338 | 479 | """The SCF-wrapped magnetic anchor reproduces its committed fixed point.
``MagneticSCFMACE`` (``mace/modules/extensions.py:1968``) is a wrapper, not a
model: it drives ``torch.optim.LBFGS`` over the magnetic moments, sets
``magmom.grad = -output["magforces"]`` by hand, and then re-evaluates the
model it wraps once at ... |
7d327ec3cb2002d7d5853807324c7b333001591a5139bd1640f83841e8915baf | Python | 21,383 | 437 | import numpy as np
# import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import os
import sys
import time
import NALSM_CONSTRUCTOR_N_MNIST as construct
import NALSM_PARALLEL_SAVE as parasaver
import NALSM_SIM_SUPPORT as runSupport
import NALSM_GEN_SUPPORT as sup
class run_s... |
55680e4930ea8a76502ae018ec013a061d7db8a36abbb657b1ccc46a42342d2f | Python | 21,390 | 583 | """
Training script.
Example usage: python ~/protdiff/bin/train.py ~/protdiff/config_jsons/full_run_canonical_angles_only_zero_centered_1000_timesteps_reduced_len.json
"""
import os, sys
import shutil
import json
import logging
from pathlib import Path
import multiprocessing
import argparse
import functools
from date... |
1e0065227689f961b8bc0989102015e4d55d71c2dbafb802906b135532649677 | Python | 21,450 | 627 | """Lie groups.
Lead author: Nina Miolane.
"""
import abc
import geomstats.backend as gs
from geomstats.geometry.invariant_metric import InvariantMetric
from geomstats.geometry.manifold import Manifold
from geomstats.geometry.matrices import Matrices
ATOL = 1e-6
class MatrixLieGroup(Manifold, abc.ABC):
"""Clas... |
444d4068692dcf24f85dfce3e480e8a35673749303615ed644313932083c8a17 | Python | 21,467 | 553 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from collections import defaultdict
from itertools import chain
import torch
from omegaconf import DictConfig
from fairseq import optim
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.