sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b7506209069dd30dccf8bf4fffeccb64ca4c0efe2906fcc7858f130fd84a6f8b | Python | 22,621 | 413 | ####################################################################################
#
# STEPS - STochastic Engine for Pathway Simulation
# Copyright (C) 2007-2026 Okinawa Institute of Science and Technology, Japan.
# Copyright (C) 2003-2006 University of Antwerp, Belgium.
#
# See the file AUTHORS for detai... |
bd8571fffd2ea72ef72e3663a30e9d742fc2cf0cc37566ba30b737ce9a297903 | Python | 22,622 | 718 | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""
This file originates from the 'jupyter-packaging' package, and
contains a set of useful utilities for including npm packages
within a Python package.
"""
from collections impo... |
d99bfb20558a91eaec16bd8f9085b6ff0ec21f06040ee29f4e94c0b642bfbf92 | Python | 22,623 | 484 | import os
import sys
import torch
from torch_geometric.loader import DataLoader, DataListLoader
from torch_geometric.nn import DataParallel
from torch_geometric.data import Data, Batch
import numpy as np
import random
from torch.utils.tensorboard import SummaryWriter
import time
import argparse
from tqdm import tqdm
fr... |
65dfe8a0dd51f3c6fc279e2c82e767ce340fa0b2efcda233c621ef1bf7e13970 | Python | 22,628 | 732 | from skimage import io, feature, filters, morphology, exposure, measure, draw, restoration, transform
from scipy import ndimage as ndi
from scipy import stats
import os
import pathlib
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from sklearn import metrics, model_select... |
3d484e4447b06363d4afe0421da8881b1ef34df498e7d186cc10fb6d88a45ec8 | Python | 22,634 | 731 | """ Trainer and evaluator of the networks. """
from collections import OrderedDict
from pathlib import PosixPath
import torch
import torch.nn.functional as F
from performer_pytorch.performer_pytorch import find_modules, FastAttention
from tensorboardX import SummaryWriter
from torch.cuda.amp import autocast, GradScale... |
3c76950855fe37b80867c0cc3e77418f0c5ee12a5ba014b67654d775802aed8c | Python | 22,642 | 512 | """ This module contains the unit layer for DBMs.
:Implemented:
- Binary Layer
- Gaussian Layer
- Softmax Layer
- Rectifier Layer
:Version:
1.0.0
:Date:
26.05.2019
:Author:
Jan Melchior
:Contact:
JanMelchior@gmx.de
:License:
... |
96870c4b93a46bcfe2f681b7885bdf11d90b9cb269cd9e40b0791a946dd8ac47 | Python | 22,660 | 574 | # Copyright (c) MONAI Consortium
# 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 applicable law or agreed to in writing, so... |
6950ad11ffcf03e04eb4d47753f109f397e09cb6e397870bfdd61e76bb2f8e5b | Python | 22,685 | 636 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import List, Optional, Tuple, Union
import torch
from torch import nn
import math
from pdearena.utils.activations import (
ACTIVATION_REGISTRY,
SinusoidalEmbedding
)
from pdearena.configs.config import Config
from torch_geome... |
5e20032da4c443782cab5c5f692e7f0f92d63412a2074b741120751f9452c2c4 | Python | 22,705 | 575 | import json
import logging
from collections import namedtuple
from datetime import datetime
from pathlib import Path
from zipfile import ZipFile
import numpy as np
from torch.utils.data import Dataset
from ...utils import no_transforms
from ..exceptions import DoesNotExistException, InconsistentDataException
from ..t... |
d2960d05b77d1183da986778be8bcd5695738dd315c413623655f91c0a6e7d02 | Python | 22,709 | 569 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 4 12:58:31 2020
@author: shni2598
"""
import numpy as np
#import brian2.numpy_ as np
#import matplotlib.pyplot as plt
import connection as cn
import warnings
from scipy import sparse
#from brian2.only import *
#import time
#import mydata
#import f... |
3917a4d691bdadb21f2a5583d5f65bed1fb088210481bb4ff3f028b283a184c5 | Python | 22,727 | 596 | import functools
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric
from torch_geometric.nn import MessagePassing
from torch_geometric.data import Batch
from torch_scatter import scatter_add
from .utils import register_model
from .esm_block import DihedralFeatures
fro... |
b9dd3e9e3aaf1dd869c265771f6544abd96ab3c6ca0438818fca0aa8a27f8617 | Python | 22,733 | 528 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 29 10:03:08 2022
@author: biener
"""
import os
import torch
import numpy as np
import mAECell_Utils as utils
import matplotlib.pyplot as plt
from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.utils import get_column_lett... |
625fc35d7d9ece06af894c48097dd2778741cae86df71184a22ebbad47b3ddce | Python | 22,736 | 528 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 29 10:03:08 2022
@author: biener
"""
import os
import torch
import numpy as np
import mAECell_Utils as utils
import matplotlib.pyplot as plt
from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.utils import get_column_lett... |
0dfe200680bfa44fc2d9c1d583753a0dd9b4ff8e7a59da557f93433cad83f4e4 | Python | 22,742 | 544 | import os, time, importlib, errno
import matplotlib.pyplot as plt
from utils import Timer
#from networks import HebbDiags
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils.tensorboard import SummaryWriter
#%%##########################
### Abstract Base Classes ###
... |
93e87fe72430b0e2ff75b2c60e56c5a80dc146b6a52ff721e90bbfdee75af506 | Python | 22,742 | 509 | """ Module for EnrichmentScope object visualization
This module allows the user to extract and visualize information from EnrichmentScope object.
Here, it is possible to evaluate enrichment results with 1) dotplots, 2)heatmaps and 3) network analysis.
Dotplots allows the visualization of statistical significance and ... |
a8323e6507c110a66218f56ebece5a7554dda6d25a6897ff4609278060f31574 | Python | 22,749 | 300 |
##
## lk and lk term
#(LJ_RADIUS LJ_WDEPTH LK_DGFREE LK_LAMBDA LK_VOLUME)
type2ljlk = {
"CNH2":(1.968297,0.094638,3.077030,3.5000,13.500000),
"COO":(1.916661,0.141799,-3.332648,3.5000,14.653000),
"CH0":(2.011760,0.062642,1.409284,3.5000,8.998000),
"CH1":(2.011760,0.062642,-3.538387,3.5000,10.686000),
... |
78964945fcae3aa16c45ca595d518a8a6cd2e0f495b3f35f49990f4490d8c4ee | Python | 22,779 | 460 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
85a2e9633e79039bbfb951321dcbfe509c2bdf441c7967c9fdba71e4818cc85c | Python | 22,795 | 706 | """Adapted from https://github.com/noahmorrison/chevron.
MIT License.
"""
from __future__ import annotations
import logging
from collections.abc import Iterator, Mapping, Sequence
from types import MappingProxyType
from typing import (
TYPE_CHECKING,
Any,
Literal,
cast,
)
if TYPE_CHECKING:
from ... |
5852377ae18bf751297530b34bc8036ed270f28ca38cf600a48d1f5975273c72 | Python | 22,805 | 453 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
935709c7cb9f19c5cc0b202685ccf5da49f88e235abbe56e0262d87397fbd7e7 | Python | 22,839 | 573 | import torch
from torch_geometric.data import Data, Batch
from utils.geometric_graph import to_dense, fetch_geometric_batch
from utils.tensor_operator import tensor2array
from .default_collate import default_collate
# from ..creat_dataloader import collate_fn_register
# @collate_fn_register
class BatchDenseMatrix(Dat... |
2de15a24570c07ae56357f58d15a763be35b199f9d74123e4b25ee20d70e4772 | Python | 22,856 | 556 | import pandas as pd
import numpy as np
import bisect
from nowcasting import image
from nowcasting.mask import *
from nowcasting.config import cfg
from nowcasting.utils import *
import math
import json
def encode_month(month):
"""Encode the month into a vector
Parameters
----------
month : np.ndarray
... |
566d301ed51bd1cd9635fa1607cb38619c2fb462bfc2d0baa2fdf90020dbf4b9 | Python | 22,862 | 376 | import pandas as pd
import numpy as np
import sklearn
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import PredefinedSplit
from sklearn.tree import DecisionTreeClassifier
from sklearn.svm import LinearSVC, SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model ... |
ae182d78227d82c2ac95ecdbea8d46eccce2018ced5456bd4673714f5b470001 | Python | 22,881 | 564 | import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from scipy.stats import lognorm
def rand_weight_init(net_params, n_inputs, n_outputs=None, cell_types=None, ei_balance_val=None,
sparsity=None, weight_norm=None, self_couplings=True):
"""
Returns a random weight initia... |
f706bea26ab73622d963c2f805eca593b8dcbb8a82e75d8060099b803fb77ac7 | Python | 22,913 | 568 | """
Analysis tools for perses automated molecular design.
TODO
----
* Analyze all but last iteration to ensure we can analyze a running simulation?
"""
__author__ = 'John D. Chodera'
################################################################################
# IMPORTS
##########################################... |
e74650bfabea67885151142e142082feeeb944af50380db86256168ee0927972 | Python | 22,921 | 460 | # *=========================================================================
# *
# * Copyright Erasmus MC Rotterdam and contributors
# *
# * Licensed under the GNU GENERAL PUBLIC LICENSE Version 3;
# * you may not use this file except in compliance with the License.
# *
# * Unless required by applicable law or agre... |
0d0c9170b8995505d1c46fd96e456f415b3d6df1b12b56fb9b67e956b77280c6 | Python | 22,927 | 614 | import torch.nn as nn
import torch
class InitialBlock(nn.Module):
"""The initial block is composed of two branches:
1. a main branch which performs a regular convolution with stride 2;
2. an extension branch which performs max-pooling.
Doing both operations in parallel and concatenating their results
... |
2a70373b1e931a8e841883469e2f62728c66cdaaa35cb85295645d111d7ab3e8 | Python | 22,954 | 568 | """
Analysis tools for perses automated molecular design.
TODO
----
* Analyze all but last iteration to ensure we can analyze a running simulation?
"""
__author__ = 'John D. Chodera'
################################################################################
# IMPORTS
##########################################... |
2baa469761a3390d81330b8e32fc7bd709233f79efbd7489c1fc9f0d28ccb7d5 | Python | 22,984 | 639 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import List, Optional, Tuple, Union
import torch
from torch import nn
import math
from pdearena.utils.activations import (
ACTIVATION_REGISTRY,
SinusoidalEmbedding
)
from pdearena.configs.config import Config
from torch_geome... |
e1f205126393563547d89ef5e584633141773c9597fdf0e4cf19eebace87663e | Python | 22,995 | 653 | import inspect
import subprocess
import sys
import warnings
from typing import Any
import pytest
from pydantic import BaseModel
from langchain_core._api.deprecation import (
LangChainDeprecationWarning,
deprecated,
rename_parameter,
suppress_langchain_deprecation_warning,
warn_deprecated,
)
@pyt... |
c70bf90175f75a3ff00fec3a226e28e7989abed9bf1debd7994248a3f586f7e8 | Python | 23,001 | 595 | import copy
from math import pi, log
from einops import rearrange, repeat
import torch
import torch.nn as nn
from torch.nn.utils import weight_norm
from torch.nn.utils.weight_norm import WeightNorm
from pdearena.utils.activations import SinusoidalEmbedding, ACTIVATION_REGISTRY
from pdearena.configs.config import Confi... |
f23ad7d71c93ac9203026a482b2f9409040d07062837204e826ab0f9048bcc36 | Python | 23,009 | 679 | """Test Tracer classes."""
from __future__ import annotations
from datetime import datetime, timezone
from typing import Any
from unittest.mock import MagicMock
from uuid import uuid4
import langsmith
import pytest
from freezegun import freeze_time
from langsmith import Client, traceable
from langchain_core.callbac... |
7f0ac67504158d10fdd8e79e4de636173fed1a3999f3d905b325af0d6cff9a97 | Python | 23,028 | 643 | ####################################################################################
#
# STEPS - STochastic Engine for Pathway Simulation
# Copyright (C) 2007-2026 Okinawa Institute of Science and Technology, Japan.
# Copyright (C) 2003-2006 University of Antwerp, Belgium.
#
# See the file AUTHORS for detai... |
5ab426268f528e8b296608ff9b80bad7c12a6ec33a5617969e8994d7d7e93541 | Python | 23,049 | 568 | import csv
from ast import literal_eval
from collections import defaultdict
from pathlib import Path
from bokeh.embed import components
from bokeh.models import FactorRange, ColumnDataSource
from bokeh.plotting import figure
from protocol import UnspecifiedType
from mrQA import logger
from mrQA.base import BasePlot
f... |
8d2becd4bc1dfe64a3f1d03041bb5a3fd77a3fd9798c40d611684f2118ff1756 | Python | 23,052 | 615 | import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.autograd import Function
from bernn.dl.models.pytorch.utils.stochastic import GaussianSample
from bernn.dl.models.pytorch.utils.distributions import log_normal_standard, log_normal_diag, log_gaussian
from be... |
a66f960ba070644615bcd6d0a83ee929c2c6fcbfcf347fe0a41e167d050f7f73 | Python | 23,060 | 612 | '''
# ----------------------------------------------------
# Training a Centered Deep Boltzmann Machine
# ----------------------------------------------------
#
# Copyright: Gregoire Montavon
#
# This code is released under the MIT licence:
# http://www.opensource.org/licenses/mit-license.html
#
# ---------------------... |
13c477db634a9fdf0cac6f2be0af50323baca03c669225ef17e27163cbef6fa9 | Python | 23,068 | 538 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2021.1.4),
on 7月 11, 2022, at 18:59
If you publish work using this script the most relevant publication is:
Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lin... |
4b33257a5cb93b9687d3220308a498443b066bcc6bff4b022a8f5cf57c68d947 | Python | 23,078 | 477 | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import datetime
import numpy as np
import time
import torch
import torch.nn as nn
import torch.backends.... |
92adabead142572f3fca57c607b03ad8727156b397849d1cbbda0abdf4e84ca5 | Python | 23,095 | 433 | import os
import pymbar
import pytest
from perses.tests.utils import enter_temp_directory
@pytest.mark.gpu_needed
def test_RESTCapableHybridTopologyFactory_repex_neutral_mutation():
"""
Run ALA->THR and THR->ALA repex with the RESTCapableHybridTopologyFactory and make sure that the free energies are
equal... |
3174f7bd4411e706c97a2551ad215efd3ba7dd7a48ad321d8836cc3a1b15bdcb | Python | 23,145 | 504 | """cephalometric measurements - OFD, BPD, cephalic index, circumference, volume.
this is a rewrite of the old CranioMetrics class (craniometrics/craniometrics.py
in the legacy branch) using trimesh instead of pyvista. pyvista's .slice()/.bounds
became trimesh's .section(), and I dropped the pandas dataframe stuff (it ... |
d3b77fcf21318709d2ecf4a0362da3c67640f600448b712314a9bf35131df6ba | Python | 23,145 | 629 | ####################################################################################
#
# STEPS - STochastic Engine for Pathway Simulation
# Copyright (C) 2007-2023 Okinawa Institute of Science and Technology, Japan.
# Copyright (C) 2003-2006 University of Antwerp, Belgium.
#
# See the file AUTHORS for d... |
8fb557183c102218f344b431268784f99f07a29973c47da5a41ddcbf7ddc5c94 | Python | 23,155 | 636 | """Helper functions for deprecating parts of the LangChain API.
This module was adapted from matplotlib's [`_api/deprecation.py`](https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/_api/deprecation.py)
module.
!!! warning
This module is for internal use only. Do not use it in your own code. We may... |
792b1109ec968318270082758b2887dc1fc815d34ebb5adfc55a8dc04d2be892 | Python | 23,161 | 630 | ####################################################################################
#
# STEPS - STochastic Engine for Pathway Simulation
# Copyright (C) 2007-2026 Okinawa Institute of Science and Technology, Japan.
# Copyright (C) 2003-2006 University of Antwerp, Belgium.
#
# See the file AUTHORS for detai... |
e61ca1f4c3f7c131eef8fb7db7d5b01d0ac0862fc028007bead1665d546adaa1 | Python | 23,194 | 744 | """Graph used in `Runnable` objects."""
from __future__ import annotations
import inspect
from collections import defaultdict
from dataclasses import dataclass, field
from enum import Enum
from typing import (
TYPE_CHECKING,
Any,
NamedTuple,
Protocol,
TypedDict,
cast,
overload,
)
from uuid... |
93cf38e67ff8a525d2f8591da4726449eb96581cf8d8f2a341322fefc11a32e2 | Python | 23,225 | 799 | """Utility code for `Runnable` objects."""
from __future__ import annotations
import ast
import asyncio
import inspect
import sys
import textwrap
# Cannot move to TYPE_CHECKING as Mapping and Sequence are needed at runtime by
# RunnableConfigurableFields.
from collections.abc import Mapping, Sequence # noqa: TC003
... |
fb650b30f12116ced1c4d3c4636a3bcc7afe0eeeebeb76537d56a5dcddb29d80 | Python | 23,246 | 475 | import os
import pathlib
import time
from typing import Union, List, Literal
import equinox as eqx
import numpy as np
import torch
import torch.nn.functional as F
import wandb
from einops import rearrange, repeat, pack, unpack, reduce
from torch_scatter import scatter, scatter_std
from torchdiffeq import odeint as nn_... |
24f302e3b47cd779bd900a4dbd5a42cebf431cd61c32fcb3bfd4f1050e07b605 | Python | 23,275 | 607 | import re
from collections.abc import Hashable
from itertools import product
from string import Template
import numpy as np
import pandas as pd
import pyparsing as pp
try:
from pyparsing import (
CharsNotIn,
Group,
OneOrMore,
Optional,
Suppress,
Word,
ZeroOr... |
2f90fbc12a99bc678da422b9e1f8cbe829e19386e128dfbc2c60ef04d10fbc35 | Python | 23,277 | 531 | # Copyright (c) <2021> <University of Paderborn>
# Signal and System Theory Group, Univ. of Paderborn, https://sst-group.org/
# https://github.com/SSTGroup/independent_vector_analysis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated d... |
5b853df8a84a93b4c56b66816b400a52e49f40b706aeafa6cf0c55f949ac7770 | Python | 23,315 | 653 | '''
This script (generate_reaction_templates) uses a MongoDB collection
with atom-mapped reaction SMILES strings and parses them into a new
collection containing the transforms.
'''
from __future__ import print_function
import argparse
from numpy.random import shuffle # for random selection
import rdkit.Chem as Chem... |
28e33cc8379ad51378cad80a14aedbfb401169320b3183df687eef5e7afb634b | Python | 23,333 | 588 |
import os
import torch
import numpy as np
import pandas as pd
import networkx as nx
from rdkit import Chem
from rdkit.Chem import AllChem
from torch_geometric.data import Data, InMemoryDataset
# allowable node and edge features
allowable_features = {
'possible_atomic_num_list' : list(range(1, 119)),
'possib... |
accf77eb1513ca8ee7326c7504fe81192dc43bd292827d054ec0f829b7ff5b1f | Python | 23,360 | 462 | import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Layer, GRUCell, Dense, Lambda
from abc import abstractmethod
from typing import Union
from ..utils import Alias
class Network(Layer):
"""Base class for controller :class:`Network` objects. It implements a network whose function is to c... |
c98e72d6e73e53f4472c65e3e1125c7fe66a0f10940949c71cec0a86b320d0a5 | Python | 23,393 | 571 | import pylab
from matplotlib.patches import Polygon,Circle,Rectangle
from scipy.spatial.distance import pdist,squareform
from GeneralHelper import Organiser, yellow, red, find
from matplotlib.collections import LineCollection
from matplotlib.patches import Rectangle
from GeneralHelper import nice_figure, find
# def get... |
541c1ac053ca221ccdb6fddded442dd226d97d94ca6d208c48dde19f055df839 | Python | 23,411 | 500 | # coding=utf-8
from datetime import datetime
import os
import sys
import time
import numpy as np
import argparse
import json
from tqdm import tqdm
from torch.cuda.amp import GradScaler, autocast
import alg
from alg.opt import *
from alg import alg, modelopera
from network.img_network import UNet3DBase
from utils.util i... |
a5786a9038bd7396db6bcfb0db57a006854ecc118a5cfb33d74745678065e615 | Python | 23,422 | 639 | import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import CustomModuleArch, SumMultiplicationArch, HypernetFullyConnectedFlexiLayerSizeArch, FullyConnectedFlexiLayerSizeArch, InheritedFullyConnectedFlexiLayerSizeArch, SingleInputInheritedFullyConnectedF... |
119941755fda45c71ec28d6806d275a9a25f6eb856aea7dce45e480135a02304 | Python | 23,425 | 651 | import inspect
import itertools
import logging
import pickle
from pathlib import Path
from typing import Literal, Tuple
import numpy as np
import pandas as pd
import pyinform.shannon
import pytest
import seaborn as sns
try:
import umap
import umap.plot
except ImportError:
logging.error(f"Unable to import ... |
339459aa088fd418bbfa5391c3801616497d1345ee57f9031fdf88d289a99d42 | Python | 23,430 | 525 | """Facial Anthropometrics workspace endpoints: template load/pick/measurement-
preview (the definition phase, against the template mesh only), batch
extraction across many already-NICP-registered patient meshes, per-mesh
landmark correction, and the batch's own Excel export. See
craniumpy_core.facial_measurements for t... |
c6e442525ea4c9e5101f3c7ed4aa5234fd2aac9d064b4f6389d56e016b863369 | Python | 23,474 | 656 | # Copyright 2024 DeepMind Technologies Limited
#
# AlphaFold 3 source code is 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... |
bb0d91194d7577f5fc5101a921a2b4fe4274b015a419199c2ae590c7f8c3c561 | Python | 23,506 | 545 | #!/usr/local/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
Test all test systems on different platforms to ensure differences in potenti... |
ee6cff60a0898844b90aac0ed07ea2824c5f439046dd2cdd5c97682baa174ddc | Python | 23,535 | 657 | # -*- coding: utf-8 -*-
# author: Felix Repp felix.repp@mpikg.mpg.de
# !/usr/bin/env python
"""@package tinaviz
%This module provides the tools to visualize the Network as well as the image data
"""
import os
import numpy as np
import pdb
import networkx as nx
import sys
import itertools
from mayavi import mlab
from tv... |
9e6ab03dd5c286214a97cb2e5b167f2c7708aee36af4c144edc45622e940ed86 | Python | 23,536 | 597 | import argparse
import os
import esm
import MDAnalysis as mda
import numpy as np
import pytorch_lightning as pl
import torch
import torch_geometric.loader as geom_data
from MDAnalysis.analysis import distances
from rdkit import Chem
from scipy.spatial import distance_matrix
from torch_geometric.data import Data
from Bi... |
af0910b9cbb035b942168179d130ca08e6ae9c4dab1693e72533a517cefeab97 | Python | 23,567 | 603 | import math
import torch
import copy
from e3nn import o3
from e3nn.o3 import FromS2Grid, ToS2Grid
from .wigner import wigner_D
from .edge_rot_mat import _ROTATION_MASK_THRESHOLD
class CoefficientMappingModule(torch.nn.Module):
"""
Helper module for coefficients used to reshape l <--> m and to g... |
c7adf5a9f845942ab0706ea25c397296739691513ac4b94baf150d89f0f7b063 | Python | 23,575 | 516 | #!/usr/bin/env python3
# coding: utf-8
"""
Greg Conan: gconan@umn.edu
Created: 2021-04-16
Updated: 2021-10-01
"""
# Import standard libraries
from datetime import datetime
from glob import glob
import numpy as np
import os
import pandas as pd
import sys
def find_myself(flg):
"""
Ensure that this script can ... |
8304a32a27b98bf21e0c460a98a5248a2eb13db666c3ff3aceac2dc53f37ff80 | Python | 23,601 | 597 | """OpenProblems-oriented training helpers for BERNN.
This module deliberately keeps OpenProblems itself as an optional integration.
BERNN owns model fitting and Optuna optimization; callers provide ``score_fn``
to evaluate a candidate embedding with the benchmark (or another objective).
"""
from __future__ import ann... |
5b2e0bbd6173f7082c3d2ae9e8fe0c52ae18d73f4ebb3bf36618489e6f5f42d3 | Python | 23,675 | 558 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 28 2021
@author: Simon Pelletier
"""
import warnings
import pickle
import numpy as np
import pandas as pd
import os
import csv
import json
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from sklearn.metrics import matthews... |
a8fe12cfea867f5b09c2732069bff4907e66770c14df37a663349081dc93b57b | Python | 23,679 | 807 | """
mappingqc.py - Tasks for QC'ing mapping
===============================================
Reference
---------
"""
import cgatcore.experiment as E
import os
import re
import pandas
import cgatcore.iotools as iotools
import cgat.BamTools.bamtools as BamTools
from cgatcore import pipeline as P
PICARD_MEMORY = "9G"
... |
3cfe24682af860b744282fe32d01496aac788496efb851ef974d2234f0279864 | Python | 23,720 | 678 | # Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# 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
#
# U... |
d09e4b6f432e02fbcaf8340b8e8544540f7230d5563bb8878926dc3c47b0524e | Python | 23,740 | 715 | ####################################################################################
#
# STEPS - STochastic Engine for Pathway Simulation
# Copyright (C) 2007-2026 Okinawa Institute of Science and Technology, Japan.
# Copyright (C) 2003-2006 University of Antwerp, Belgium.
#
# See the file AUTHORS for detai... |
030d7b5b6c13b2a65a6982f04c61d20c5f6a165a573fdaedd576ddca5d1b7ce6 | Python | 23,756 | 715 | ####################################################################################
#
# STEPS - STochastic Engine for Pathway Simulation
# Copyright (C) 2007-2023 Okinawa Institute of Science and Technology, Japan.
# Copyright (C) 2003-2006 University of Antwerp, Belgium.
#
# See the file AUTHORS for d... |
332fb22dbe23e551827dfd0612d1727d7bd317cc376ccec4d1a615fffefea24b | Python | 23,759 | 482 | import unittest
import os
from EPI_MRI.utils import *
class TestUtils(unittest.TestCase):
""" Unit test for EPI_MRI.utils.py"""
def setUp(self):
# Initialize any common data or setup needed for the tests.
torch.manual_seed(81) # reproducibility with randomness
self.device = 'cuda' if torch.cuda.is_available... |
95472713fa54ee7bc3c45b4101a83f41e85b73c975be5fd55f05d48faa02f6ca | Python | 23,774 | 560 | import tensorflow as tf
import numpy as np
from utils.ProcessData import get_maxDims, gen_smiles2graph
from sklearn.neighbors import KernelDensity
from sklearn.utils import gen_batches
from utils.TestModel import perform_validation, perform_validationPPB, perform_validationCL
from sklearn.utils import gen_batches
impor... |
af9df7baf96732668cabc5dff7da41c43eaf5fbd09fb9bb2cbaa5c661a1dc9e0 | Python | 23,785 | 632 | from tqdm import tqdm
import numpy as np
import argparse
from pathlib import Path
from time import time
import argparse
import shutil
import random
import pickle
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm
import numpy as np
from Bio.PDB import PDBParser
from Bio.PDB.Polypeptide impo... |
f2d0095e7d2b107517e63f778edc6b1fc21ec56f80279e2501d7ab91a1e4c447 | Python | 23,815 | 482 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
a0c4d811af96ebe81b47f2f7e3241cee28f4b7d632671027c04cc78e4c008589 | Python | 23,818 | 483 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
edd160fa35ffb8ffc20126b56a9a75a9b4542892aa088f399a29f6be64e54be6 | Python | 23,837 | 444 | """
This script contains the classess of the layers that we have implemented for our model
"""
import tensorflow as tf
class AttGraphConvLayer(tf.keras.layers.Layer):
def __init__(self, outDim,activation=None,alphaLReLU=0.2,dropAtt=None, **kwargs):
# constructor, which just calls super constructor
... |
e0bca4e33f3150887129baa8b2e97e03f4b28b10df684bef60b9beeb251ac6ee | Python | 23,853 | 710 | """`Runnable` objects that can be dynamically configured."""
from __future__ import annotations
import enum
import threading
from abc import abstractmethod
from collections.abc import (
AsyncIterator,
Callable,
Iterator,
Sequence,
)
from functools import wraps
from typing import (
TYPE_CHECKING,
... |
5d478548a986e31c0da028395bb83d38f16e33ecfbe6157784237a00e34ef5cd | Python | 23,881 | 489 | """
Module used to create videos from functional imaging data
Author: jonas.braun@epfl.ch
"""
import os
import sys
import numpy as np
import pandas as pd
import matplotlib as mpl
mpl.use('agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import pickle
from tqdm import tqdm
from... |
6ca712971b905bfb7b552155637bcdf9be918aecc6a6420dd9cb35448b95c02b | Python | 23,910 | 521 | from argparse import Namespace
import csv
from datetime import timedelta
from functools import wraps
import logging
import math
import os
import pickle
import re
from time import time
from typing import Any, Callable, List, Tuple, Union
import collections
from sklearn.metrics import auc, mean_absolute_error, mean_squar... |
031edae38d583a7f9a3b2a49d78448ea6eacf645aa3be2bd2e25a1efcb12a98c | Python | 23,919 | 535 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
cc0882a4d210626f9511a7c83c9b7c96fc0be0c784f41a6cc43a66e15e48e635 | Python | 23,949 | 695 | # script for diffusion protocols
import torch
import pickle
import numpy as np
import os
import logging
from scipy.spatial.transform import Rotation as scipy_R
from rfdiffusion.util import rigid_from_3_points
from rfdiffusion.util_module import ComputeAllAtomCoords
from rfdiffusion import igso3
import time
torch.s... |
0e89f84f3c2e6073e98bab7698db45ef1a775a1c9e34723e921565abbbc0436c | Python | 23,953 | 500 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 3 10:57:50 2019
@author: ngritti
"""
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QApplication, QComboBox, QVBoxLayout, QDialog,
QGridLayout, QGroupBox, QLabel, QPushButton,
QRadioButton, QMessageBox, QWidget,
QS... |
071c1b5333a20cf931c0459274b716864f418fd265b292e669c18cc3b57bc3be | Python | 23,970 | 672 | # Copyright 2024 DeepMind Technologies Limited
#
# AlphaFold 3 source code is 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... |
73006d324f8e98a07348f88896331e267816e0fc055c52bc22b6d3498608eaeb | Python | 23,988 | 542 | #!/usr/bin/env python3
import os
import re
import ssl
import sqlite3
import urllib.request
import gzip
import tarfile
import shutil
import logging
import time
from datetime import datetime, timezone
from pathlib import Path
from enrichm.toolbox import run_command
######################################################... |
88372abf728f93f151f1dbb12e0e556870573b5a6f80f983a476cf4370a603b0 | Python | 23,997 | 626 | '''
:Tags: Python
Usage
========================================================
Enrichment analysis (Gene set enrichment analysis(GSEA))
========================================================
This pipeline is a wrapper of script runGSEA.py (enrichment analysis
by using GSEA. Further description is provided below.)... |
eddef7d1a7c054cdc2a75d9f8ae99cda73aa4c86d30cd938645707093b8b1927 | Python | 24,008 | 553 | import logging
import os
from fcest.models.sliding_windows import SlidingWindows
from fcest.models.wishart_process import SparseVariationalWishartProcess, VariationalWishartProcess
from fcest.helpers.array_operations import to_correlation_structure
from fcest.helpers.data import to_3d_format
import gpflow
import numpy... |
02480f77602fb7a7dd13434cbcd4834ca4587e53efd31f969babe696cd689f3e | Python | 24,038 | 730 | import logging
import multiprocessing
import os
import traceback
from abc import ABC, abstractmethod
from copy import deepcopy
from multiprocessing.pool import Pool
from typing import Any, Tuple, Union
import numpy as np
import pandas as pd
import torch
from rdkit import Chem, RDLogger
from rdkit.Chem import AllChem, ... |
8e4ecc501adee261e3acf2be461d5c0d5a36f7028ba5940238fb07caefd4f0f2 | Python | 24,050 | 500 | import os
import torch
os.environ["MKL_NUM_THREADS"]="1"
os.environ["NUMEXPR_NUM_THREADS"]="1"
os.environ["OMP_NUM_THREADS"]="1"
torch.set_num_threads(1)
import math
from torch.utils.tensorboard import SummaryWriter
from torch.optim.lr_scheduler import LinearLR, SequentialLR, CosineAnnealingLR
import torch.distribute... |
b6c7bb15b7d63b41df624d08078e79dc84e07051b55ea3a64159bb332d285035 | Python | 24,088 | 582 | '''
Author: Kai Cao
Modified from SCALEX
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from tqdm import tqdm
from collections import defaultdict
from .layer import Encoder, Decoder
from .loss import kl_div, unbalanced_ot
class VAE(nn.Module):
"""
Variational Autoen... |
29e7f29b816c3f2f2c6c9d8a0240227b66d6ff859933dad8eff208f5d86ab025 | Python | 24,118 | 807 | # Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# 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
#
# U... |
2170cbd7df262ea18c616262da26c43fc1f4eeb272cf69731983f4040057fe0e | Python | 24,132 | 641 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter
import math
from torch.nn.modules.loss import _WeightedLoss
from torch.utils.tensorboard import SummaryWriter
from sklearn.model_selection import train_test_split
from scipy.optimize import nnls
from sklearn.impute import... |
6a661ef5b5d35b3f3508234a6b21695a6a74b46b316f377d06bc7135903552c3 | Python | 24,153 | 692 | print("running file.", flush=True)
import math
import sys
import copy
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
import itertools
from pathlib import Path
import time
import model_output_manager_hash as mom
import kernels_params as ps
import sim_utils as util
impor... |
caa432f8ee09c01346226153aef6c67883eb21fe05dcd7b30d82482d38562fdc | Python | 24,191 | 465 | import argparse, importlib, math, types, random, sys, itertools
import torch
import torch.nn as nn
from data import generate_recog_data_batch, GenRecogClassifyData
from net_utils import load_from_file
import networks
## Parse command line args
parser = argparse.ArgumentParser()
groupT = parser.add_mutuall... |
f317bc2f30164215e133502fd94b86434135fcb5df158d29b6beaf2d0aac11fc | Python | 24,193 | 517 | """generates the shipped synthetic demo cohort under
src/craniumpy_core/demo_cohort/ - a one-time script, not run at app startup
(same "committed package data" pattern as template_registry.py's shipped
templates, or resources/test_mesh/test_mesh_holes.ply). re-run by hand only
if the demo cohort itself needs to change;... |
196296e9b7eda8b99b1729a7aece3625466fdda401404a7207f2b0f54bde46bc | Python | 24,298 | 608 | # Copyright (c) MONAI Consortium
# 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 applicable law or agreed to in writing, so... |
b47eb1b3382ba3cd4c7fd0b196d7c91e9e959020589badadda4fa6c58e9fd7ec | Python | 24,301 | 511 | import matplotlib.pyplot as plt
import numpy as np
import itertools
import pandas as pd
from sklearn.preprocessing import MinMaxScaler, StandardScaler, RobustScaler, Normalizer
from sklearn.pipeline import Pipeline
def keep_top_features(data, path, args):
"""
Keeps the top features according to the precalcula... |
e478208641aedc9ec859f431d19bdf5600807c6d4a77a1f55d562a6e5c234030 | Python | 24,301 | 737 | import logging
import os
from pprint import pprint
import yaml
import numpy as np
logging.basicConfig(
format='%(asctime)s : %(levelname)s : %(message)s',
datefmt='%d-%b-%y %H:%M:%S',
level=logging.INFO
)
def get_config_dict(
data_set_name: str,
subset: str = None,
subset_dimensionality: str... |
de333ff34c1f06cbd896aeb25cbe73f460b042fd3c512169f94a9a4a1fa5960b | Python | 24,305 | 510 | import matplotlib.pyplot as plt
import numpy as np
import itertools
import pandas as pd
from sklearn.preprocessing import MinMaxScaler, StandardScaler, RobustScaler, Normalizer
from sklearn.pipeline import Pipeline
def scale_data(scale, data, device='cpu'):
unique_batches = np.unique(data['batches']['all'])
... |
d0ebb3627306460935ce0756bddde42e0c0aa25eec4a93a4aaf850f6795acffa | Python | 24,309 | 526 | """
Module to analyse headless experiments.
Author: jonas.braun@epfl.ch
"""
import os
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.backends.backend_pdf import PdfPages
import pickle
from tqdm import tqdm
from scipy.stats import mannwhitneyu,... |
376e78bab5d3cfff6094af3f4eb524ed960e29e51bfad26be1bd003aa709ce93 | Python | 24,358 | 703 | import collections
from collections.abc import Hashable
from math import prod
from string import Template
import numpy as np
try:
from pyparsing import (
CharsNotIn,
Group,
OneOrMore,
Optional,
Suppress,
Word,
ZeroOrMore,
alphanums,
alphas,
... |
466a9b3385cab73a3248c9a8f94cfb6ccab884094e7694b911d8484093f2ee40 | Python | 24,363 | 519 | ###########################################################################################
# #
# Evaluator class: Implements the most popular metrics for object detection #
# ... |
8e1d67cc3049e06aebca904ac65c050629b5f77604651ceda0fe68267dbf1cf5 | Python | 24,378 | 586 | import logging
import warnings
from collections import OrderedDict
from typing import List, Union
try:
from collections import Iterable
except ImportError:
from collections.abc import Iterable
from functools import partial
import torch
import torchvision
from torch import nn
from ... import regularizers
fro... |
be03d5f69294d1982e845d5466d2b647e5dd0f2c7a252b816826b9fc97a53ea9 | Python | 24,382 | 681 | # Copyright Generate Biomedicines, Inc.
#
# 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 applicable law or agreed to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.