sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
46591fe77a31c212402f298d1798b92ef83196fb004a56986cea491b057b2335 | Python | 9,911 | 283 | """Analytical Fourier transform of OrbFlow GTOs → plane-wave coeffs → density.
Matches ``GTOs.compute`` conventions:
- length: Å vectors are converted to a.u. via ``/ GTO_VEC_LENGTH_SCALE_TO_AU``
- angular: e3nn real SH with ``normalization='norm'`` on coords reordered ``[y, z, x]``
- radial: ``N * r^L * exp(-ζ ... |
94a4d40b4eaa478a429e5da27afa9650e98edeb977237aa2d6650cea5d96bcae | Python | 9,911 | 217 | import argparse
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import scipy as sp
import scipy.stats
import pyemma
from pyemma.util.contexts import settings
import MDAnalysis as mda
# My own functions
from pensa import *
def workflow_torsions_jsd(args, feat_a, feat_b, data_a, data_b, to... |
e9ee6e01c0f173f8de19563754bdbe506ef3ae1253cf89b882c030c8b62f4b42 | Python | 9,911 | 324 | import torch
class Jacobi:
"""
Damped Jacobi solver for Ax=b
Attributes
----------
max_iter : int
maximum number of iterations
tol : float
tolerance for convergence
omega : float
dampening parameter
verbose : Boolean
flag to print optimization informatio... |
fdfd596c3331ac83afa237d602516595a1b17d6054315247f5f43145ec4a0a9a | Python | 9,911 | 196 | import torch
from torch import nn
import numpy as np
from copy import deepcopy
class Trainer():
def __init__(self, args, optimizer, lr_scheduler, loss_fn, evaluator, result_tracker, summary_writer, device, label_mean=None, label_std=None, ddp=False, local_rank=0):
self.args = args
self.optimizer = o... |
ca6840bd9d0f617c0a7e8999bf7936a4c3ab702f3c60c8cdb282b5612d248122 | Python | 9,917 | 205 | from langchain_core.prompts.few_shot import FewShotPromptTemplate
from langchain_core.prompts.prompt import PromptTemplate
critique_example = PromptTemplate(
template="""Human: {input_prompt}
Model: {output_from_model}
Critique Request: {critique_request}
Critique: {critique}""",
input_variables=[
"... |
0e51fd18ec2acadf8bdfdf7e336d64a79c6c9a56f6989f376829cb24761ccc3a | Python | 9,918 | 335 | ###########################
# Latent ODEs for Irregularly-Sampled Time Series
# Author: Yulia Rubanova
###########################
import numpy as np
import torch
import torch.nn as nn
from torch.nn.functional import relu
import lib.utils as utils
from torch.distributions import Categorical, Normal
import lib.utils as... |
6b58631856814b4b5da10eec5a59ba2025743383ca90333888056dd44016c634 | Python | 9,919 | 260 | from pandas import read_csv
from collections import OrderedDict
import os
from os.path import join as opj
from MuTILs_Panoptic.utils.GeneralUtils import ordered_vals_from_ordered_dict
CONFIGPATH = os.path.dirname(__file__)
class DefaultAnnotationStyles(object):
DEFAULT_LINEWIDTH = 3.0
DEFAULT_OPACITY = 0
... |
c3594e47c0f16555423f7e46d9eebe61db5d30d852c218fccfdc5c4f5c4951c7 | Python | 9,920 | 231 | import sys;sys.path.append('../src')
import pylab
# Local modules (not installed packages)
import analyse_model
import defaultSimulate as default
from GeneralHelper import (
nice_figure, make_color_list,
ax_label1, ax_label_title,
simpleaxis, find)
def do_plot(params,file_name,axes=None,redo = False,plot... |
0c5a28a6864c8cc667b20cacdb18c6aae4ae4e7c3500cb4064e9776f4589465e | Python | 9,921 | 239 | """
ZephIR: multiple object tracking via image registration
See /docs/Guide-parameters.md for detailed explanations and tips for using optional arguments.
Usage:
zephir -h | --help
zephir -v | --version
zephir --dataset=<dataset> [options]
Options:
-h --help show this messag... |
58aeb77f008c7af7c9b768c4fc5a2de37cc91c2f156356384ad0970b9173b709 | Python | 9,923 | 323 | import warnings
import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
# def laplace():
# return np.array([[0.25, 0.5, 0.25], [0.5, -3.0, 0.5], [0.25, 0.5, 0.25]]).astype(np.float32)[None, None, ...]
def laplace():
"""
Returns a 3x3 laplace filter.
"""
return... |
e32e43b12cebc5264281f35cc48d913ce3610b7e05f00f7da064de25829eb9d1 | Python | 9,923 | 282 | import os
import sys
import re
import types
import itertools
import math
from RnaseqReport import *
from cgatReport.ResultBlock import ResultBlock, ResultBlocks
import Stats
##########################################################################
####################################################################... |
25a47b19b4514badc9c8dff24881de6f6934ed374bab6ae47ed7054acfe280e3 | Python | 9,926 | 273 | """Utilities for JSON Schema."""
from __future__ import annotations
from copy import deepcopy
from typing import TYPE_CHECKING, Any, cast
if TYPE_CHECKING:
from collections.abc import Sequence
def _retrieve_ref(path: str, schema: dict[str, Any]) -> list[Any] | dict[Any, Any]:
"""Retrieve a referenced objec... |
ecd278037f3d6a362d10d05b7f6ae3e1da8025f63d3d0a9b5c311421ad33073a | Python | 9,927 | 242 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import ra_preprocess_func
__all__ = ['ra_prospect']
class RaProspect(TaskModel):
def __init__(self, **kwargs):
su... |
9a0098ab4edd1e14a071f1ecee1850c3bdda3672315ad3e48937497baf42309f | Python | 9,933 | 242 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import dd_preprocess_func
__all__ = ['dd_hyperbolic']
class DdHyperbolic(TaskModel):
def __init__(self, **kwargs):
... |
4191d7d31842685b723544e4f308822c3442c404401a1e7e9c29690b1f564640 | Python | 9,937 | 285 | # -*- coding: utf-8 -*-
#~~~~~~~~~~~~~~IMPORTS~~~~~~~~~~~~~~#
# Standard library imports
import os
from collections import *
import gzip
from glob import iglob
# Local imports
from pycoMeth.common import *
#~~~~~~~~~~~~~~CLASS~~~~~~~~~~~~~~#
class FileParser ():
def __init__ (self,
fn,
label="",... |
790990eefdc59acbc744336195e84fc6a7842b69eddbe66d0c20230115b50c12 | Python | 9,937 | 279 | ####################################################################################
#
# 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... |
16e1313e61cae6ac85574e0eb675be49d19a6f7c30b301a33e9102f4f4f6106d | Python | 9,938 | 187 | #!/usr/bin/env python3
#$ -cwd
#$ -V
#$ -N m5m_sol_na
#$ -e /cluster/uz_lab/cmives/TRP_channels/MDS/permeation_analysis/solvation_analysis/m5_solv_2024.err
#$ -o /cluster/uz_lab/cmives/TRP_channels/MDS/permeation_analysis/solvation_analysis/m5_solv_2024_na.out
#$ -pe smp 1
#$ -q c6100.q
import os
import sys
import tim... |
6a47d4c47b509a25782b079a9791af1962de99aaf564d386e88cd84e6c0a1893 | Python | 9,939 | 244 | """
GPT model:
- the initial stem consists of a combination of token encoding and a positional encoding
- the meat of it is a uniform sequence of Transformer blocks
- the final decoder is a linear projection into a Softmax classifier
"""
import math
import logging
import torch
import torch.nn as nn
from torch.nn impo... |
dcd050d652f76b7885301468f80755d53ed9281a806dd0906cd28cb34d956aea | Python | 9,942 | 242 | import sys;sys.path.append('../src')
import os
import pylab
import numpy as np
import matplotlib.image as mimage
# Local modules (not installed packages)
from analyse_experiment import get_stats, plot_experiment
from analyse_model import get_analysed_spiketimes
from GeneralHelper import (
nice_figure, ax_label_fig... |
a39029494fedce2e477d3d2f8ba621c73fab6c05bb38ffa8076020938494a2c0 | Python | 9,944 | 215 | # Import libraries
import os
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
import numpy as np
import pandas as pd
import random
from numpy.random import seed
# Import machine learning libraries
import tensorflow as tf
from tensorflow.keras.models import model_from_json
import ker... |
919e4f4b25600c900e1f2c8e5f1329bf5f8cd563c932eb71f9099f4a66eb50bd | Python | 9,949 | 245 | # -*- coding: utf-8 -*-
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~IMPORTS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Standard library imports
from collections import OrderedDict, namedtuple, Counter
# Third party imports
from tqdm import trange
# Third party imports
from pyfaidx import Fasta
# Local imports
from pycoMeth.com... |
3fca2af17ecdb2b6563e367e703b26ee56b66a82474c028c91c3026eeeccb78e | Python | 9,951 | 193 | """Source builds remain explicit, checked and selectable alongside FreeSurfer."""
import io
import json
import os
from pathlib import Path
import tarfile
import tempfile
from types import SimpleNamespace
import unittest
from unittest.mock import Mock, patch
from postprocessing.core import build, config
from postproces... |
6cf47916353c7b503cc5bb1afac45e40ba2ab8bd43430d07773cb34f3c7b6f1f | Python | 9,953 | 279 | ####################################################################################
#
# 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... |
e6e9cb0aafcd82d8ad964cc224ca8dedba5a6ba2ddf7e70121236afb3f01b850 | Python | 9,954 | 149 | from scipy.integrate import solve_ivp
import numpy as np
import time
from edNEGmodel.edNEGmodel import *
from functions.initial_values import *
import h5py
import os
def solve_edNEGmodel_reference(I_stim, alpha, t_span, stim_start, stim_end, path, solver, t_step, jacobian=False):
"""
Solves the edNEG m... |
8649c3fe83d0b5ca05ba9e961c7441b0dedf02feb6436a6c08bc9296d4b337b6 | Python | 9,956 | 299 | import os
from enum import Enum
from typing import Tuple, List
import atexit
import tempfile
import shutil as sh
import re
import string
import random
import subprocess
def jupyter_download_link(save_func, tmp_dir="./tmp", name_prefix='tree', fmt="pdf"):
idd = ''.join(random.choice(string.ascii_letters) for _ in ... |
720c78fd8087d6b147eeb2dcff8a00e320966204894221e18ea92f605b0bfa2b | Python | 9,957 | 260 | from collections.abc import Sequence
from typing import List
import numpy as np
import torch
from torch import Tensor
from .data import Data
from .dataset import IndexType
class Batch(Data):
r"""A plain old python object modeling a batch of graphs as one big
(disconnected) graph. With :class:`torch_geometri... |
744b34d3b98abe3ad1e39ea89d43a56f4d8e9f72d9186afc9957d1f5955b1cc6 | Python | 9,958 | 251 | import numpy as np
def normalize_data(batch_data):
""" Normalize the batch data, use coordinates of the block centered at origin,
Input:
BxNxC array
Output:
BxNxC array
"""
B, N, C = batch_data.shape
normal_data = np.zeros((B, N, C))
for b in range(B):
... |
5ac1160c0e4cfd29700a04c4c62ce0399e1dca0d932d1b432c5cb3d265428b38 | Python | 9,959 | 242 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import bandit4arm_preprocess_func
__all__ = ['bandit4arm_4par']
class Bandit4Arm4Par(TaskModel):
def __init__(self, **kwa... |
6f7520c9c4f92fdfafc8c9cc482826376337d83be3fe1fdbab838ae5d46a960c | Python | 9,959 | 237 | from OCC.Core.BRepAlgoAPI import BRepAlgoAPI_Cut, BRepAlgoAPI_Fuse
from OCC.Display.SimpleGui import init_display
from OCC.Core.STEPControl import STEPControl_Writer, STEPControl_StepModelType
from OCC.Core.TopLoc import TopLoc_Location
from OCC.Core.STEPConstruct import stepconstruct_FindEntity
from OCC.Core.TCollecti... |
b0f1923c2e5e2f533d75357893b9092a79825d335cd5f866b531a1e8cb507f6e | Python | 9,964 | 242 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import dd_preprocess_func
__all__ = ['dd_exp']
class DdExp(TaskModel):
def __init__(self, **kwargs):
super().__in... |
5c5d23eccbdff9df77611fac4d77c01757b13e20d9588d089cdb72e78dcfa5b3 | Python | 9,968 | 241 | ####################################################################################
#
# 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... |
af011e8f31a1a7228ebe172942cd37c07557041ffc49f7ae94780b1655118b71 | Python | 9,970 | 367 | #############################################################################
#
#Updated by: Yiqin Wang
#
##############################################################################
import sys
import subprocess
import types
import struct
import gzip,bz2,zipfile
def execute(cmd, stderr = sys.stderr, run = True):
#... |
c881603df121836ecc320a2730f6460fcb4ce4deea0fec9c0f61df11a16c9106 | Python | 9,972 | 243 | import numpy as np
import pandas as pd
from scipy import stats
from scipy.spatial.distance import pdist
from sklearn.gaussian_process.kernels import RBF, Kernel
from ._base import BaseCITest, _CITestResult
def _gamma_pvalue_from_moments(test_stat: float, mean: float, var: float) -> float:
"""Gamma-approximation ... |
18cf7c5112c1f605798128f6886f9eec47b197bcc9b8ac91d35a82d72dfe5e0f | Python | 9,976 | 218 | """
File containing auxiliary functions for GMM-based data augmentation.
"""
import numpy as np
from sklearn import mixture
def normalize_image(image, clip_percentiles=False, pmin=1, pmax=99):
"""
Function to normalize the images between [0,1]. If percentiles is set to True it clips the intensities at
pe... |
a339b2645ee833ac951111091170637ff07beaee85414651f87dd531fc5c5c30 | Python | 9,977 | 202 | import os
from copy import deepcopy
from collections import OrderedDict
from itertools import groupby
import warnings
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.font_manager
from matplotlib.cm import get_cmap
import scipy.stats as stats
print("- matplotlib version:", matpl... |
965d797c631727a9e819b8a37ed3aab9e5851f7799452bca213b1c1c32f55be7 | Python | 9,978 | 727 | import random
adjectives = [
"abandoned",
"aching",
"advanced",
"ample",
"artistic",
"back",
"best",
"bold",
"brief",
"clear",
"cold",
"complicated",
"cooked",
"crazy",
"crushing",
"damp",
"dear",
"definite",
"dependable",
"diligent",
... |
eaf8486cc2895c85449ac93fd7598298dda1b6310d3e6e414a1746470db79b06 | Python | 9,982 | 279 | # 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
#
# Unless required by applicable law or agr... |
468bfd2e72c170760d42983230d0869dd5b7f290fc5f1117d0a9e67f60d215ff | Python | 9,983 | 195 | import sys
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import itertools
import warnings
warnings.simplefilter('ignore', category=RuntimeWarning)
sys.path.insert(1, os.path.join(sys.path[0], '../../../../'))
import Articles.Sequential_Learning_Striatum.Figures.cf... |
d976683d81ffda406302b01d1e00f35b336c24d243c557b0b560d98bbb5200c2 | Python | 9,984 | 267 | import json
import queue
import traceback
import threading
from pycromanager.acquisition.acq_eng_py.main.acq_eng_metadata import AcqEngMetadata
from pycromanager.acquisition.acq_eng_py.internal.engine import Engine
from pycromanager.acquisition.acq_eng_py.main.acq_notification import AcqNotification
from pycromanager.... |
d814c0936156743f44c6b2af8500a78d41704b0169221bdd1633802ba84c2084 | Python | 9,986 | 241 | ####################################################################################
#
# 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... |
72b08aed26dd247bd345d3241c4c3e7a4cfb25adb9121d284018e63cb4ff2a99 | Python | 9,990 | 219 | """Dataset class template
This module provides a template for users to implement custom datasets.
You can specify '--dataset_mode template' to use this dataset.
The class name should be consistent with both the filename and its dataset_mode option.
The filename should be <dataset_mode>_dataset.py
The class name should... |
67d8e8587e7eb98b4742970e6e9df6835ea98f3fb5ca13dc71425cde72874021 | Python | 9,994 | 282 | import copy
import os
import os.path as osp
import re
import warnings
from collections.abc import Sequence
from typing import Any, Callable, List, Optional, Tuple, Union
import numpy as np
import torch.utils.data
from torch import Tensor
from .data import Data
IndexType = Union[slice, Tensor, np.ndarray, Sequence]
... |
5d745301833ab6941a1fda8bf54312a32fa6cc4b0980fae2dccc53fef04784dd | Python | 9,995 | 225 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
POCIF-BAT R3 — H-R2-6, transformation T-C1 : quantile équilibré par cellule.
MOTIF DE LA TRANSFORMATION, déclaré avant retest, fondé sur une erreur de
construction et non sur la valeur du résultat.
Le premier essai calibrait par quantiles emboîtés : pour chaque cellu... |
b9175c799617825f86651181a6d3d763fb1f718de66915362291d2dc0d43f2cc | Python | 9,995 | 264 | import os
from argparse import ArgumentParser
from typing import Dict
from pytorch_lightning import Trainer, seed_everything
from pytorch_lightning.callbacks import (EarlyStopping, LearningRateMonitor)
from test_tube.argparse_hopt import TTNamespace
import npe_ppi_logger, settings
from utils.ProtBertPPIArgParser impo... |
27fb1c45c952d4fc7fae2876ba1a98e7a9b8e42464039a79e3db923e029c3ee3 | Python | 9,997 | 220 | import torch
from torch import nn
from functools import partial
from .activations import ACTIVATION_REGISTRY
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, padding_mode, num_groups=1, norm: bool = True, activation="gelu") -> None:
super().__init__()
self.activation = ACT... |
455b2e43d341275c97084f41eb7c10e4ad98b167b7c17ae9872989a83627a396 | Python | 9,998 | 242 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import dd_single_preprocess_func
__all__ = ['dd_hyperbolic_single']
class DdHyperbolicSingle(TaskModel):
def __init__(sel... |
b0b2ed03ea771026370c489180e4067bb3c38f973be9733be7fb0fa4eec84f1f | Python | 10,000 | 307 | #!/usr/bin/env python3
# rossler_attractor_analysis.py - Corrected version based on actual RQA2.py implementation
# Set up matplotlib for non-interactive use
from tqdm import tqdm
from SMdRQA.RQA2 import RQA2, RQA2_simulators, RQA2_tests
import seaborn as sns
import os
from mpl_toolkits.mplot3d import Axes3D
import m... |
2416fb7584041457acf18a7f8459675391f060ccdd70ba0266c1f186c44d8acf | Python | 10,002 | 247 | # 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 torch
import torch.nn as nn
import torch.nn.functional as F
from timm.models.layers import trunc_norma... |
31d60e5a9a9e3273be63516d8d41c6eab591c440a6bb9017c6cfe1c609304bbe | Python | 10,003 | 315 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 10 16:56:16 2022
@author: sigridtragenap
"""
import numpy as np
from scipy import linalg, integrate
from matplotlib import colors
import matplotlib.pyplot as plt
class LinearRecurrentNetwork:
def __init__(self,
W_connect ,
... |
cfc331849a16bc5b0aad424252067e0c156db4209316aaa9e72325f8d1924932 | Python | 10,007 | 282 | #!/usr/bin/env python
# coding:utf8
import argparse
import os
import time
from progress.bar import Bar
import yutils
import numpy
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from nnet.blstm import BLSTM
from nnet.lstm import LSTM
from nnet.cnn import CNN
torc... |
03a1f36a5e92ce651778ce52abe1dd84595386ac2eda1434d19399eef3b49464 | Python | 10,015 | 257 | #!/usr/bin/env python3
import os
import re
import math
import argparse
import subprocess
# use warnings.warn() rather than print() to output info in this script
# because snakemake expects the jobid to be the only output
import warnings
from snakemake import io
from snakemake.utils import read_job_properties
DEFAUL... |
5b03e42db8254485141135e304fa26d5e5dfa57ca38fef9ad284d973c6004902 | Python | 10,018 | 243 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import gng_preprocess_func
__all__ = ['gng_m1']
class GngM1(TaskModel):
def __init__(self, **kwargs):
super().__i... |
71cd82a4ddb061e9eeb3084291be3758ccb3dd409a3936791d6376a252dfb84d | Python | 10,018 | 279 | import networkx as nx
import numpy as np
import scipy
import sklearn.metrics
from typing import Union
def bootstrap_statistic(
y_true: np.ndarray,
y_pred: np.ndarray,
dy_true: Union[np.ndarray, None] = None,
dy_pred: Union[np.ndarray, None] = None,
ci: float = 0.95,
statistic: str = "RMSE",
... |
a508d44f165a6f83937a3fe2db8d10e49f72efbbaf86ebb7de056933553aaa89 | Python | 10,019 | 221 | import random
import networkx as nx
import torch
class MaskAtom:
def __init__(self, num_atom_type, num_edge_type, mask_rate, mask_edge=True):
"""
Randomly masks an atom, and optionally masks edges connecting to it.
The mask atom type index is num_possible_atom_type
The mask edge t... |
cd78bbecdff0c7437c417c986fe6fabe540328e15163e662577ace0bdec748e1 | Python | 10,027 | 241 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import prl_preprocess_func
__all__ = ['prl_rp']
class PrlRp(TaskModel):
def __init__(self, **kwargs):
super().__i... |
da6bfad9d7d598443f1f20f50e028525bd46904935cb5b4572016ccc1d81d847 | Python | 10,028 | 265 | ####################################################################################
#
# 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... |
39e2010de7ee0b00645686ec850f1ba9a4594d4933bcfc73e055c981344bc509 | Python | 10,031 | 261 | import os
import torch
import tqdm
import numpy as np
import matplotlib.pyplot as plt
from distutils.spawn import find_executable
from warnings import warn
from dival import get_standard_dataset
from dival.datasets.dataset import Dataset
from dival.config import CONFIG as DIVAL_CONFIG
from odl.discr import nonuniform... |
d6e50c7cebfb1828e3f0172501988a4c4504178b3a2056423ef30c36318059bc | Python | 10,043 | 219 | import sys, os
sys.path.append(os.path.abspath(os.path.join('../../')))
from qm9.property_prediction.models_property import EGNN, Naive, NumNodes
import torch
from torch import nn, optim
import argparse
from qm9.property_prediction import prop_utils
import json
from qm9 import dataset, utils
import pickle
loss_l1 = nn... |
9b0cb6ee222d31355d86e46e9f9d68475b83b77695fba6918b5f099e67a7ec80 | Python | 10,045 | 289 | """
Code modified from scipy.sparse.linalg.lsmr
Copyright (C) 2010 David Fong and Michael Saunders
"""
import torch
from .linear_operator import aslinearoperator
def _sym_ortho(a, b, out):
torch.hypot(a, b, out=out[2])
torch.div(a, out[2], out=out[0])
torch.div(b, out[2], out=out[1])
return out
@t... |
172a0576eea98bd5c1eb3c4954770f5f5eae0ed00647c1988d2968bcec553a8e | Python | 10,057 | 240 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import bandit4arm_preprocess_func
__all__ = ['bandit4arm_2par_lapse']
class Bandit4Arm2ParLapse(TaskModel):
def __init__(... |
1478d53eeae21ffc1449b5e9f353074f1166ccac7b600a4b7d11802a594f5d18 | Python | 10,059 | 278 | """This has been moved to and rewritten in hebbian.py. Keeping this file around for
loading old .pkl files"""
import torch
from torch import nn
import torch.nn.functional as F
from neural_net_utils import check_dims, random_weight_init
class PlasticNet(nn.Module): #TODO: rewrite to use neural_net_utils.... |
788090066e3abcf6c0ad8f27a700de693365d3442a592ca7c7b6fdee1699c464 | Python | 10,060 | 291 | import logging
import os
import socket
import sys
import matplotlib.pyplot as plt
import matplotlib.colors
import numpy as np
import pandas as pd
import seaborn as sns
from configs.configs import get_config_dict
from helpers.data import reorder_ica_components
def plot_tvfc_summary_measures_mean_over_subjects_all_ed... |
072eaedecd1a77ae8d217df332c2d97cf7abbad3130282357e9a6377132c5ba9 | Python | 10,065 | 245 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import bart_preprocess_func
__all__ = ['bart_par4']
class BartPar4(TaskModel):
def __init__(self, **kwargs):
supe... |
ce281f8885df7e99167906eb740ef5256d5abebc6967a7e1b9a1d87ef6efa01b | Python | 10,073 | 285 | import matplotlib.pyplot as plt
import joblib
import numpy as np
from torch.utils.data import TensorDataset
import torch
import torch.nn as nn
from data import generate_recog_data, recog_chance
from plotting import plot_train_perf, plot_W, plot_B, plot_recog_generalization
from networks import HebbNet
from ... |
751936b8792b891dbaf793484af28a4d47ff1221287f21f44158516bfbfb1f3a | Python | 10,075 | 315 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# portrait_divergence.py
# Jim Bagrow
# Last Modified: 2018-04-24
import sys, os
import tempfile
import argparse
from collections import Counter
import numpy as np
import networkx as nx
from scipy.stats import entropy
def portrait_cpp(graph, fname=None, keepfile=False):... |
9ce4902c2ffec45f6fc37896889af83ba6602de0b217fdd9ef48ea0be87029b0 | Python | 10,077 | 266 | import os
import sys
import re
import types
import itertools
import matplotlib.pyplot as plt
import numpy
import scipy.stats
import numpy.ma
import Stats
import Histogram
from cgatReport.Tracker import *
from cpgReport import *
##########################################################################
class SharedI... |
14e73bd4be3840c1d6095228c66bfa32e36979aeb1af40e4ac0e850e189df88b | Python | 10,080 | 356 | import functools
import subprocess
from pathlib import Path
import pandas as pd
import pyteomics.mztab
import pytest
import yaml
from click.testing import CliRunner
from casanovo import casanovo
TEST_DIR = Path(__file__).resolve().parent
def test_train_and_run(
mgf_small,
mzml_small,
tiny_config,
t... |
7c1be678458c05785b053047caff530f4e1b1c24a7a202448981ad7a5045a4a4 | Python | 10,082 | 264 | import re
import numpy as np
from rdkit import Chem
from rdkit.Chem.rdchem import ChiralType
from EFGs import standize
pat = r'\d+(?:\.\d+)?%'
p2f = lambda x: float(x.strip('%'))/100
def mols_from_smiles_list(all_smiles):
'''Given a list of smiles strings, this function creates rdkit
molecules'''
mols =... |
134360f2626a6ef82d4e3c681e7a88f71f4d17825ed74e19218b3e618d66111b | Python | 10,084 | 242 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import alt_preprocess_func
__all__ = ['alt_gamma']
class AltGamma(TaskModel):
def __init__(self, **kwargs):
super... |
d8af9e556923cab7fc21c13367bc9be5f27f1aad90412b30b3c7bb1fc3de13b3 | Python | 10,084 | 242 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import alt_preprocess_func
__all__ = ['alt_delta']
class AltDelta(TaskModel):
def __init__(self, **kwargs):
super... |
d4012c062bb23a641509c44b74ba1b8e072209dc1101bffef7d8b66887119cfd | Python | 10,089 | 200 | """
Predict next tools in the Galaxy workflows
using machine learning (recurrent neural network)
"""
import argparse
import numpy as np
import os
import sys
import time
sys.path.append(os.getcwd())
# machine learning library
import tensorflow as tf
from keras import backend as K
import keras.callbacks as callbacks
... |
4bf86b52a8e396b360d96ff77425c4382544c322c902a62b10662f868f7136ac | Python | 10,090 | 242 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import prl_preprocess_func
__all__ = ['prl_ewa']
class PrlEwa(TaskModel):
def __init__(self, **kwargs):
super()._... |
55b692ef4cc7c4f4c03fe9c90e6ab502ea8197e3c11f07708288be1c29dbeb70 | Python | 10,091 | 244 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import bandit4arm_preprocess_func
__all__ = ['bandit4arm_lapse']
class Bandit4ArmLapse(TaskModel):
def __init__(self, **k... |
3e6a7fc42260572990a822ec249f356d1c98a94808ea9af278b4a54069057a12 | Python | 10,093 | 262 | #! /usr/bin/env python
"""
Reads Darknet config and weights and creates Keras model with TF backend.
"""
import argparse
import configparser
import io
import os
from collections import defaultdict
import numpy as np
from keras import backend as K
from keras.layers import (Conv2D, Input, ZeroPadding2D, Add,
... |
d4687520d2d8d2e86484605f6f88f4a32d302f30aef211f62666495705650476 | Python | 10,093 | 212 | import unittest
from synister.synister_db import SynisterDb
import os
from pymongo import MongoClient
import numpy as np
class DbSetupTestCase(unittest.TestCase):
def setUp(self):
self.db_credentials = os.path.join(os.path.abspath(os.path.dirname(__file__)) + "/../../db_credentials.ini")
self.db = ... |
29b6c0f61c358a07ebbe0f4b0b0ac0439775865e027c4503e338f7618e359d79 | Python | 10,094 | 273 | """Keep the notebook's vanilla command independent of RGI state and dependencies."""
import builtins
import copy
import json
import os
import shutil
import subprocess
import sys
from pathlib import Path
from types import SimpleNamespace
import pytest
@pytest.mark.parametrize(
("notebook", "model", "extra_args")... |
66375f52cc9085c4c719e544eeeca58a12c8c9c7069e1cb7dd62e876351f01e4 | Python | 10,094 | 300 | # 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... |
eb3052f3e682def9a4478a8e364ff2a3a9750433ba2d16bc7f46ecc54921d2d9 | Python | 10,095 | 341 | import numpy as np
from math import pi
from OCC.Extend.TopologyUtils import TopologyExplorer
from OCC.Core.gp import gp_Pnt
from OCC.Core.ShapeAnalysis import ShapeAnalysis_Surface, shapeanalysis_GetFaceUVBounds
from OCC.Core.BRep import BRep_Tool
from OCC.Core.GeomAbs import GeomAbs_Plane, GeomAbs_Cylinder, GeomAbs_To... |
cf5aa327a6984945c2b4a1029fbfa02ddedee43549203cb383a98eb71e98511e | Python | 10,096 | 187 | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
from statsmodels.formula.api import ols
import scipy.stats as stats
# load dataframe after cleaning and organization by "HFF_CellProfiler_kinetics_analysis"
# and "LUHMES_CellProfiler_kinetics_analysis"
d... |
9a2c6ccc9d61d90c9f692119cb5267e6ca80e8962c1c12fed6d444eeb67d525f | Python | 10,097 | 302 | import argparse
import time
import numpy as np
import torch
from bindsnet.analysis.plotting import plot_spikes # plot_performance
# from bindsnet.encoding import bernoulli
from bindsnet.encoding import poisson
from bindsnet.environment.dot_simulator import DotSimulator
# from bindsnet.pipeline import EnvironmentPi... |
dd324defaf5a8331d2885aa1ef004d00b67320974e6f597718511b5d3d3e2048 | Python | 10,097 | 263 | import os
import subprocess
from pathlib import Path
from time import sleep
from typing import Union, Iterable
from MRdataset import valid_dirs
from mrQA import logger
from mrQA.utils import is_integer_number, execute_local, list2txt, \
folders_with_min_files
def _check_args(data_source: Union[str, Path, Iterab... |
245cf3745d9afc92e2cd9067f0bc94abf0810bf4d3fcf0122962a24a1905d30b | Python | 10,102 | 197 | """
In this file the sectionalizing and tie switch details are specified.
The DER details are also specified (in particular the ones with and without grid forming capability).
Also the path for the DSS file containing the circuit information is specified.
The final DSS circuit which will be used by the algorithm i... |
28eda7cdf622f872b9a24beae8384712853ecb86d6112a1b20147fe8bac160be | Python | 10,107 | 256 | r"""An important module that is used to define all arguments for both argument container and configuration container.
"""
import pathlib
import sys
from typing import List
from tap import Tap
from typing_extensions import Literal
from dataclasses import dataclass
from jsonargparse import set_docstring_parse_options
... |
88ca8854c1b5bb72c0f87aeaa731090b79ebbf69e6b80ffdc974304e529ad00a | Python | 10,109 | 313 | import itertools
from typing import List
from pathlib import Path
import numpy as np
import pandas as pd
from umap import UMAP
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import ttest_ind
from sklearn.manifold import TSNE, MDS
from sklearn.decomposition import PCA
from sklearn.preprocessing ... |
80195103f67cf648cc5ef0f6b57cec8e772c77587f78d6db9a6924e7745f0ab9 | Python | 10,113 | 244 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import dd_preprocess_func
__all__ = ['dd_cs']
class DdCs(TaskModel):
def __init__(self, **kwargs):
super().__init... |
afab8fac0b2483ab8a73a3883dc14f02b11766275cee263ef4dbb4186937b92f | Python | 10,114 | 275 | ####################################################################################
#
# 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... |
d4f4543eec59033922b36eccae1e6a83b4f186b936d53f6a82270853b820a83d | Python | 10,115 | 328 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 11 14:25:10 2019
@author: Shulan
list of unit and default parameters:
time: ms
voltage: mV
current: uA/cm^2
capacitance: uf/cm^2
conducrance: mS/cm^2
Cm = 1 uF/cm^2
Vna = 115mV
Vk = -12mV
Vl = 10.613mV
gna_bar = 120mS/cm^2
gk_... |
864aec3af4710ee2f7787f697c6bc744f51e571c7184d920482f1c2debb77e31 | Python | 10,116 | 242 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import bandit4arm_preprocess_func
__all__ = ['bandit4arm_singleA_lapse']
class Bandit4ArmSingleaLapse(TaskModel):
def __i... |
757d02c0312b9adb1044e55a082ad8d07e76967f4b6af13cd76f433e69f48ce5 | Python | 10,119 | 251 | #!/bin/env python
import numpy as np
from openff.toolkit.typing.engines.smirnoff.forcefield import ForceField
from openff.toolkit.typing.chemistry import environment
# Function definitions for parsing sections within parameter file
def _parse_nonbon_line( line ):
"""Parse an AMBER frcmod nonbon line and return re... |
d5a61c5fae10403543bfec8b2a271437225e91f0f0a841e2b50b0efe9e0fa95b | Python | 10,120 | 277 | """Input isolation, novice controls, and optional-dependency boundaries."""
import copy
import importlib.util
import json
import re
from pathlib import Path
import pytest
from colabfold.rgi import SUPPORTED_MODELS, require_supported_model
from colabfold.rgi.notebook import chain_table, name_job, prepare_input
from c... |
c24df3e2105d72c0d021ce3810e9c1d1a9351c3591cd96215f5342d329b54c6f | Python | 10,121 | 227 | #!/usr/bin/env python3
import os
import sys
import numpy as np
from PIL import Image
import struct
import argparse
import matplotlib.pyplot as plt
def convert_pma_to_tiff(pma_file, debug=False, byte_swap=False, normalize=False, flip=False, manual_frames=None):
"""
Convert a single PMA file to TIFF stack with b... |
2eb48bf310158411311351237314b48a37660eb0a3e483ac2cc32f19100863e4 | Python | 10,126 | 192 | """Convert scanner RAS surfaces into FreeSurfer surface RAS coordinates."""
from pathlib import Path
from itertools import product
import nibabel as nib
from nibabel.freesurfer.mghformat import MGHHeader
from nibabel.processing import resample_from_to
import numpy as np
import SimpleITK as sitk
import trimesh
from ut... |
1d26df77de6d49b86bc5411df5dea6fc36b89216b38606c9700332385da49b97 | Python | 10,128 | 154 |
qm9_with_h = {
'name': 'qm9',
'atom_encoder': {'H': 0, 'C': 1, 'N': 2, 'O': 3, 'F': 4},
'atom_decoder': ['H', 'C', 'N', 'O', 'F'],
'n_nodes': {22: 3393, 17: 13025, 23: 4848, 21: 9970, 19: 13832, 20: 9482, 16: 10644, 13: 3060,
15: 7796, 25: 1506, 18: 13364, 12: 1689, 11: 807, 24: 539, 1... |
2e2256b25a71dcd15ade68b55f94d712c7c0d119fb2658a91f92e81b9f5e9fe4 | Python | 10,128 | 245 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import gng_preprocess_func
__all__ = ['gng_m2']
class GngM2(TaskModel):
def __init__(self, **kwargs):
super().__i... |
82edb43d1f637ef0ab3e211928147a2dc2f1c1ad0955ba7961d3ed9bdb350a4a | Python | 10,128 | 161 | import numpy as np
import pandas as pd
from collections import OrderedDict
# VaDER imports, VaDER can be obtained from https://github.com/yalchik/VaDER
from vader.utils.data_utils import map_xdict_to_xtensor, generate_wtensor_from_xtensor
from vader.utils.clustering_utils import ClusteringUtils
from vader.hp_opt.vader... |
bfef29911e32fc3ef338f4b1de89bee30e73e5c75b4a1b92fdbd937e63047ed0 | Python | 10,135 | 280 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 17:37:53 2024
@author: Shencong Ni
"""
import matplotlib as mpl
mpl.use('Agg')
import scipy.stats
#import load_data_dict
import mydata
#import brian2.numpy_ as np
import numpy as np
#from brian2.only import *
#import post_analysis as psa
import firing_rate_analysis ... |
105014011c4b938697c2d5caf5b3e8733d2f869e55e782578b6ed0b0b201d128 | Python | 10,137 | 279 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 16 11:53:52 2021
@author: athanasiadis
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class LinearNet(nn.Module):
"""
linearnet
______________________
This is a class composed of t... |
85725ac5ce807a94c1c4637607f8238d785bf3c9f9fff268b3d18c365fa39bab | Python | 10,140 | 241 | from typing import Sequence, Union, Any
from collections import OrderedDict
from numpy import inf, exp
import pandas as pd
from hbayesdm.base import TaskModel
from hbayesdm.preprocess_funcs import prl_preprocess_func
__all__ = ['prl_fictitious_woa']
class PrlFictitiousWoa(TaskModel):
def __init__(self, **kwarg... |
76bd1fb5b2e2f96dcfe490ff66aa39d19a32361a91e0ef9825eb3978b045405b | Python | 10,142 | 306 | """Context editing middleware.
Mirrors Anthropic's context editing capabilities by clearing older tool results once the
conversation grows beyond a configurable token threshold.
The implementation is intentionally model-agnostic so it can be used with any LangChain
chat model.
"""
from __future__ import annotations
... |
048f687792fd54590acd68a13ac59c1f8288f6bac2978912a6568e6757b240c8 | Python | 10,152 | 280 | """Base interface for chains combining documents."""
from abc import ABC, abstractmethod
from typing import Any
from langchain_core._api import deprecated
from langchain_core.callbacks import (
AsyncCallbackManagerForChainRun,
CallbackManagerForChainRun,
)
from langchain_core.documents import Document
from la... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.