sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
7edcab5c79ff87ac1a643f08a75c76a2ee59635bef7cc1723937309dc2ec31ec | Python | 28,399 | 554 | ###############################
######## Objective Fun ########
###############################
#%%# Catalyzer
# import re
import numpy as np
# import numba
# from scipy import interpolate
# import torch
# from sbi.inference import simulate_for_sbi
# import time
import matplotlib
import matplotlib.pyplot as plt
plt.... |
cc193ffb813aa902707536941ad1610ba70151f2d45b89b7c189396f21aa71b2 | Python | 28,399 | 627 | """
This module is used to create a HedSchema object from a JSON file or string.
"""
import json
from hed.errors.exceptions import HedExceptions, HedFileError
from hed.schema.hed_schema_constants import HedKey, HedSectionKey
from hed.schema.schema_io import df_util, json_constants
from hed.schema.schema_io.base2schem... |
3b18210a7eba4fd6cfb5214f7051e7f8c4a38c3f0d2f395f35ae066408e68c82 | Python | 28,413 | 626 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 6 10:09:47 2023
@author: daltonm
"""
from pynwb import NWBHDF5IO
import ndx_pose
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from matplotlib import colormaps
from mpl_toolkits.mplot3d.art3d import Line3DCo... |
61ad0f4776099946c000b1a4c2b30e7019a6f9e222a9802bd081efdadd3d9d06 | Python | 28,418 | 607 | import time
import json
import torch
import torch.nn.functional as F
import math
import torch.nn as nn
from torch.autograd import Variable
from core.utils import *
from builtins import range as xrange
import numpy as np
from core.FocalLoss import *
# this function works for building the groud truth
def build_targets... |
48d6dfa79fbd1445fb71b7a5b2a422ca6cb433198097d63675dbdf62822ba15a | Python | 28,424 | 695 | from argparse import Namespace
import csv
from datetime import timedelta
from functools import wraps
import logging
import math
import os
import pickle
import re
import numpy as np
import pandas as pd
from time import time
from typing import Any, Callable, List, Tuple, Union
from sklearn.metrics import auc, mean_absol... |
5bdc15eed2ed15598e89a987436ecd670b02a7b0a3e3e42cf96bc7ef2546f516 | Python | 28,433 | 707 | """Code to implement models used in the manuscript by Huttunen et. al titled
'A Comparison of Signal Combinations for Deep Learning-Based
Simultaneous Sleep Staging and Respiratory Event Detection'
The model is based on https://github.com/perslev/U-Time
"""
import math
import numpy as np
import tensorflow as tf
from ... |
f5a82235495d5298a233251719bc36434743030b4dfd09f1822a0c5346895f0a | Python | 28,435 | 792 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
a7ec7648c17a0faa2bb4981a0d75ffe1977df7b647c537b0f4ed44843a9c25ff | Python | 28,441 | 626 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 6 10:09:47 2023
@author: daltonm
"""
from pynwb import NWBHDF5IO
import ndx_pose
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from matplotlib import colormaps
from mpl_toolkits.mplot3d.art3d import Line3DCo... |
089a0ac13bb673993296b690cf1a893c1dff25a5ffce8e985674ed25e943156a | Python | 28,448 | 860 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
330c360fb020efd2e0fc430fb43c322297c68ad506a382ff9189be72f5bf1986 | Python | 28,452 | 911 | from __future__ import annotations
import logging
import os
from copy import deepcopy
from pathlib import Path
from shutil import which
import numpy as np
import pytest
from ase.build import bulk
from ase.calculators.singlepoint import SinglePointDFTCalculator
from ase.calculators.vasp import Vasp as Vasp_
from ase.c... |
51df820ca579c31bdc6a40f94395e3293d80926a139faa73ed70db1d4b0743a3 | Python | 28,478 | 567 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# "Created on Mon Aug 16 18:51:52 2021
# @author: caroline
"""
Created on Wed Mar 18 11:07:16 2020
Functions to simulate choices and fit the model with the
Nelder-Mead or the L-BFGS-B algorithms from a predefined sequence of morphs and tones for one particular subject.
@... |
96254209195ea85821ff713126970f470c4cfacfc165085be6d1913695d28f8d | Python | 28,514 | 714 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
5457e40c58656957e8d0ee29e550ee0180755e846fada81505e75f075919b8fe | Python | 28,515 | 860 | import multiprocessing
import os
from warnings import warn
import numba
import numpy as np
import pandas as pd
import pymp
# from postprocess_functions import scatter_visualise_point_cloud
# Environment variables
# TODO change all codes to just use np.nan directly instead of this, becuase future versions of python d... |
0f2aafe669902354a59c712807bafcc14c9ec451ee1cb0b7fc08d93358f894ba | Python | 28,529 | 846 | # Science/maths/computing tools
import numpy as np
import pandas as pd
import copy, yaml, importlib, time, warnings, os
from tqdm import tqdm
from collections import Counter
from scipy import stats
# From this package
from .data import Data
from .utils import convert_mdf_to_ddf
class Calculator:
"""Compute all p... |
9ab35c040a65ee4ab7886517680e5ed7f7c7ad4f04f2e8af0ecbf8006f61ac35 | Python | 28,611 | 762 | # to run, first run in a terminal (one time only):
# pip install mne mne_bids nibabel dipy pd_parser
# then run in a terminal:
# python /path/to/this/file/ieeg_preprocessing.py
import os
import os.path as op
import json
import numpy as np
import time
from shutil import which, copyfile
from subprocess import run, Popen... |
54db2eda34b0d96e2f24265d3ea317164cc6b5cda3ba040fcd84d99925264bf4 | Python | 28,626 | 757 | """
m6A_semi_supervised.py
Author: Anupama Jha <anupamaj@uw.edu>
Training and data generator code adapted from bpnet-lite
(https://github.com/jmschrei/bpnet-lite)
This module contains an implementation of a semi-supervised
CNN model for m6A calling. We implement a similar approach
to the percolator algorithm for a CNN... |
97f4f6e04b42bca052334fd0c569fbe74fc4bb3581a0d1e9a061c1bd5ad8d4df | Python | 28,626 | 725 | """
Performs Bivariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input) to analyze
Output: ... |
c36d1e1ac8b9bc5f4cf5980b4c873f02d08af17dcbd094ec39d988e8212e040a | Python | 28,671 | 708 | """PyQt5 GUI for the tissue-masking / background-removal tool.
Lets the user:
- Pick a stitching-output root and auto-discover ``stitched_chN/``
subfolders, OR pick channels manually.
- Tune the mask parameters (multi-Otsu classes, morphology radii,
dilation buffer, source channel) with a live preview.
- Ap... |
691f02472c3f2a822469edd74d00a406f302a4b5cb400088a4f7671cd489e8a1 | Python | 28,699 | 749 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
aff4d5605ecece555985a5d243e6cf22bb4b078f6346742e7098da4f42c18977 | Python | 28,722 | 691 | from __future__ import print_function
import os
import re
import sys
import subprocess
from collections import namedtuple, defaultdict
from time import time
from pddlstream.language.constants import EQ, NOT, Head, Evaluation, get_prefix, get_args, OBJECT, TOTAL_COST, Action, Not
from pddlstream.language.conversion im... |
fb93459d21f71fe8c65b3b774d8a7e0aacbb792e69ad9befbecb286d4e6203c1 | Python | 28,746 | 855 | #!/usr/bin/env python3
import argparse
import pysam
import tqdm
import numpy as np
from numba import njit
from dataclasses import dataclass, fields
import logging
import pandas as pd
import os
import pickle
from multiprocessing import Pool
from functools import partial
import gnuplotlib as gp
import sys
# Global stati... |
9b8a599dc71af298ba59435371c4ba41da542297609472ff12acb59ad48b8f9b | Python | 28,764 | 797 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
a2921513087dad19aae22ce1f34b24c6ba5383213f07001202df530a245fcf0c | Python | 28,795 | 878 | import torch
from utils.complex_utils import complex_utils as Z
import torch.nn as nn
import torch.nn.functional as F
import math
import numpy as np
class FullyConnected(torch.nn.Module):
def __init__(self,config):
super().__init__()
self.config = config
self.img_size = config[... |
8a1c22d0869988f689fc815a24d4bd0f3db96a6136e14b9b10758c2d181eeab3 | Python | 28,802 | 811 | """Helper Functions Network
---------------------------
Helper functions for deriving dependent network and stimulus parameters from
base parameter dictionaries.
"""
import numpy as np
import scipy
import copy
def derive_dependent_parameters(base_net_dict):
"""
Derives network parameters which depend on th... |
ae1807f724c4aa00add235f8cace0989676280a4d56694b5476dc167d9b1860d | Python | 28,818 | 663 | import copy
import glob
import itertools
import os
import numpy as np
import scipy.spatial
# =============================================================================
# GLOBALS
# =============================================================================
ANALYSIS_DIR_PATH = os.path.join('YankAnalysis', 'Water... |
c24864ab65cdba917b1db77e201324c43d4e920cebe026d9ea39041d822437d4 | Python | 28,831 | 820 | """
Unit tests for regtools/utils/volume_io.py
Covers:
- detect_format / detect_format_list
- NIfTI loader
- NRRD loader
- DICOM loader
- TIFF loaders (single 2D, multipage, directory, file list)
- VolumeData methods (to_nifti, to_float64, to_grayscale, get_slice, reorient)
- validate_inputs wi... |
9f18c8886452894512445a7037e42ba3b37a044f63a95e26b9d27b088bfdab06 | Python | 28,868 | 743 | """Prepares a distribution for installation
"""
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
import logging
import mimetypes
import os
import shutil
from typing import Dict, Iterable, List, Optional
from pip._vendor.packaging.utils import canonicalize_name
fro... |
ea920b366157d9193692f2de194bbf0049ce4a60d4ab6ace61f80ee2548b446d | Python | 28,879 | 704 | # coding=utf-8
# Copyright 2018 Salesforce and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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
#
# h... |
286709c6a1472de92a9a33de768541a0225f8817f39065e9097bab5202682a96 | Python | 28,901 | 636 | """
TIP:
1. Never use [[0]*3]*3 for array assignment - This creates three duplicate list. Check out below code to view the weird result it gives:
X = [[2]*3]*2
X[0][0] = 3
print(X)
#Extremely weired!!! This is assigning to all the coloumn 0th element to 3.
TODO:
... |
a5e877ae4434bdc97ea629f3d4148864496568c61db8a758ce6d9174b5ff7bce | Python | 28,912 | 529 | import numpy as np
import pandas as pd
from scipy.cluster.hierarchy import linkage, dendrogram, fcluster
from collections import defaultdict
from natsort import natsorted
try:
from rpy2 import robjects as ro
from rpy2.robjects import pandas2ri
from rpy2.robjects.packages import importr
from rpy2.rinter... |
01dd5f53ff81bca987f579f527fa55093e65f4fdb7cf79c58aeb0314b36320b0 | Python | 28,931 | 564 | from __future__ import annotations
from collections import namedtuple
from typing import TYPE_CHECKING, Literal
from pertpy._logger import logger
if TYPE_CHECKING:
from collections.abc import Sequence
if TYPE_CHECKING:
import pandas as pd
import pubchempy as pcp
class LookUp:
"""Generate LookUp objec... |
b1d8b8e3178994435f53ece23e5d536d40b79e8dbe6460e9c018a0997d49b8cd | Python | 28,934 | 778 | import errno
import json
import operator
import os
import shutil
import site
from optparse import SUPPRESS_HELP, Values
from typing import List, Optional
from pip._vendor.rich import print_json
from pip._internal.cache import WheelCache
from pip._internal.cli import cmdoptions
from pip._internal.cli.cmdoptions import... |
a9fea8a05a44ea2169c10be0d303b0329377d372a6b9d626174ab51b085205cc | Python | 28,974 | 624 | # Mancy Chen 03/04/2023 ePOD extract features from ROI
from __future__ import print_function
import logging
import os
import sys
import pandas
import SimpleITK as sitk
import radiomics
from radiomics import featureextractor
import nibabel as nib
import numpy as np
# label_list = [7, 8, 11, 12, 13, 17, 26, 46, 47, 50, 5... |
f7b61732102368a34a5c5b3123896cd618c49a117f97d1da7cb033442721d630 | Python | 28,991 | 756 | """Shared prediction and plotting support for survival-curve evaluators."""
from __future__ import annotations
from collections.abc import Callable
from functools import cached_property
from typing import Any
import matplotlib.pyplot as plt
import numpy as np
from SurvivalEVAL.evaluations.custom_types import Numeri... |
9e7637958cbceb778b9aac5e1dc7a1377939c017f9f93a5d92f34b28784e6ca1 | Python | 28,993 | 747 | # set QT_API environment variable
import os, sys
import traceback
os.environ["QT_API"] = "pyqt5"
import qtpy
# qt libraries
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from qtpy.QtGui import *
from control._def import *
import control.tracking as tracking
import control.utils.image_processing as image_proc... |
6c184a7bc50a695d47dc18f296167a6ded3f2f27319f2824841a9dc4bf023adb | Python | 29,019 | 510 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
initiate = {'MRNA': 0, 'PRO': 0} # {0, 25, 50, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 150, 175, 200, 225, 250} # Per... |
3b11bbf2630cf833f22f011b6503ea10459c9bfd9ed03416513af7eaafaac558 | Python | 29,026 | 630 | from glob import iglob
import shutil
import readline
import pprint
import sys
from sys import argv
import yaml
import logging
import ase.io
import ase
import numpy as np
import schnetpack as spk
from ase.units import Bohr
import os
#SHARC="/user/julia/software/SchNarc/sharc/source/../bin/"
from schnarc.data import Pro... |
17a0312ce1265077165bfd3e1cf8cedfd9b4ce3a1aa4c59d9fb2374002294601 | Python | 29,027 | 777 | #
# Copyright (C) 2018-2021 SR Research Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
# This program is distrib... |
f49c00f65f6656ff233f2473cb5daa1c57ab129dac066a96d73bb8b727e37eac | Python | 29,033 | 494 | # Import libraries that get used in multiple cells
import time
import numpy as np
from warnings import warn
import os
# LOAD FUNCTIONS
from conduction_system import EmptyConductionSystem, PurkinjeSystemVC
from ecg_functions import PseudoQRSTetFromStepFunction,PseudoEcgTetFromVM # FIX
from geometry_functions import Ei... |
20e6692d25240c3a5ae299fa8caffc553f82c923fac2fe412edf5651c1d8604a | Python | 29,037 | 510 | import io
import json
import os
import unittest
import numpy as np
from pandas import DataFrame, Series
from hed import schema as hedschema
from hed.errors.exceptions import HedFileError
from hed.models.hed_string import HedString
from hed.models.sidecar import Sidecar
from hed.models.tabular_input import TabularInpu... |
028c5b520b4dc67c43ea735a06c1fad1226e7243d02c3981420380130b611720 | Python | 29,045 | 912 | import shutil
from pathlib import Path
import cv2
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from numpy import testing as npt
from pupil_recording_interface import (
GazeReader,
load_dataset,
write_netcdf,
get_gaze_mappers,
BaseReader,
MotionReader,
VideoReade... |
500b236590090b314e87ef78238903ee91d7c9441ddfc9f7fd80a8d285662bd0 | Python | 29,053 | 728 | import cv2
import numpy as np
from skimage import measure
from skimage import segmentation
import rtree
import geopandas
from shapely import geometry
from typing import List, Dict
from scipy.spatial import cKDTree
from merlin.core import dataset
from merlin.core import analysistask
from merlin.util import spatialfeatu... |
ecb7dcbb3e229ea50022c0502df8bb09c5614cdee5995c9ba9a034a74571636c | Python | 29,068 | 860 | from dreamcoder.program import *
from dreamcoder.type import arrow, baseType, tint, tlist, t0, t1, t2, tboolean
from dreamcoder.task import Task
from dreamcoder.grammar import Grammar
from dreamcoder.program import Primitive
from scipy.ndimage import binary_dilation
from scipy.ndimage import measurements
from math imp... |
26d2f8f74a975c8e28124afdcff26aa74be9c761525ccdad6c9a71c5c6c58aa8 | Python | 29,094 | 1,129 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Documentation:
This is a script containing general helper functions.
"""
import numpy as np
import os
import stat
import shutil
import copy
import h5py
from mpi4py import MPI
###################################
# Initialization of MPI stuff #
###################... |
faa66c88779dd65090226d7909aaef7909cd1fffd98df98a5afb982b7fe36e8f | Python | 29,103 | 855 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
ac1bc0939e6e5096d11bb9f3f1d8443267c4fc0d3f0825caa51e32109ef88a2b | Python | 29,106 | 815 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Defines parameters for simulation, used by example_parallel_network.py script
Copyright (C) 2018 Computational Neuroscience Group, NMBU.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... |
d8f6b18bb0f54753e4bacc81a180dd561a0e768e352c5d36cf953560e26ffab0 | Python | 29,115 | 509 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
initiate = {'FC_MRNA': 0, 'FC': 0} # {0, 25, 50, 100, 200} # {0, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800} # Toll!
_i... |
fffe0e6e958f8088261d9c855228e34eed20ab09248656eefd96c68f0af4f212 | Python | 29,131 | 616 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 23 11:30:02 2023
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import seaborn as sns
import re
from sklearn.preprocessing import StandardScaler
from scipy.i... |
753e12d8bcf633cf37f353065159f841eeeb384e666f80a682e92404ae512fdc | Python | 29,135 | 631 | import matplotlib
import matplotlib.pyplot as plt
import argparse
import sys
import os
import APT_interface as apt
import h5py
import subprocess
import yaml
import pickle
import time
import logging
import glob
import scipy.io as sio
import multiResData
import numpy as np
import random
import json
import subprocess
imp... |
e8769570b3aa0f70ce2f2ccb18a9e9b3abca375285b4db43eb3d9c306fddcff1 | Python | 29,146 | 605 | import copy
import numpy as np
import torch
import torch.nn as nn
from typing import List
import torch.nn.functional as F
import torch.random as TR
import utils
from models.tools import *
from models.revin import RevIN
from models.mlp import gen_mlp_module
from models.tcn import gen_cnn_module, gen_res_cnn, get_tcn_m... |
c2cb82d5d33d355ead942cc3bffed8ff36ecb5fb676e96b6979d09fc806d8b4f | Python | 29,157 | 804 | """
Clases with the parsers for I/O with xml files
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 02.02.15
"""
__author__ = 'martinez'
from bs4 import BeautifulSoup
import operator
from pyseg.mb.graph import *
########################GLOBAL PARSING STRINGS#######################... |
cf3aea978c12d01c4d791a1b6a6b8fa7ddc0dbc80a69b9ba03eea431e02ac659 | Python | 29,166 | 682 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 7 14:51:25 2021
@author: CY
"""
import os
import SimpleITK as sitk
import glob
from os.path import join
import numpy as np
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage import map_coordinates
import random
from skimage.transform i... |
18867bbe362f8c5cdd63664ac0ddee1aeef70fdd11127e9ea7e532d6a52540b4 | Python | 29,172 | 512 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
initiate = {'MRNA': 0, 'PRO': 0} # {0, 25, 50, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 150, 175, 200, 225, 250} # Per... |
2f12231dd64ada6b45c567918f70067ad12a223139652e955cda051e8f684d61 | Python | 29,206 | 512 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
initiate = {'FC_MRNA': 0, 'FC': 0} # {0, 250, 500, 750, 1000} # {0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000} ... |
6d9b7ccee0738e46bf6ef1516ca3f7f70a2d93b01968d982f1530068025573d8 | Python | 29,218 | 694 | """
Tests module affine_2d
# Author: Vladan Lucic
# $Id$
"""
from __future__ import unicode_literals
from __future__ import division
#from past.utils import old_div
__version__ = "$Revision$"
from copy import copy, deepcopy
import unittest
import numpy as np
import numpy.testing as np_test
import scipy
from pyto... |
34eefa0eff45e89a134e013328338e5dd6251ef13f71b9ef7798491300a5e765 | Python | 29,220 | 648 | import sys
sys.path.append(sys.path[0] + "/..")
import os
import glob
import math
from itertools import compress
import numpy as np
from scipy.interpolate import pchip_interpolate, interp1d
import fire
from concurrent.futures import ProcessPoolExecutor
from scipy.stats import ttest_ind
from sklearn.cluster import DBS... |
ce84e5fab2091f4a46f634deb4ed20123c32cf8af1ffe8189857339dc86a7e1a | Python | 29,222 | 746 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
83f7ea9102279462a22d7020bb048f95cda6018a12a88216dd2a1b57bfa46f74 | Python | 29,241 | 819 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Defines parameters for simulation, used by example_parallel_network.py script
Copyright (C) 2018 Computational Neuroscience Group, NMBU.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... |
d3c6aa382d55cf0a7d4b61ea99fda1293be7d48f220302e7a3fc4b7f1c19d875 | Python | 29,255 | 575 | #!/usr/bin/env python
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import os
import numpy as np
import pandas as pd
from logP_analysis import mae, rmse, barplot_with_CI_errorbars
from log... |
6c8d05037328a2183f19ed88b98512273378ddd39f34c468b3ea7ffe3aea898d | Python | 29,317 | 886 | import numpy as np
import pandas as pd
import pytest
import torch
from SurvivalEVAL.evaluations.others import (
auprc_ic,
auprc_right_censored_grid,
auprc_uncensored_grid,
)
from SurvivalEVAL.evaluations.util import (
align_curve_and_time_coordinates,
check_and_convert,
check_and_convert_event_... |
e270d41fada37ca5b5dda86d7c391b043b949a2b666753970c80ad4f51d5b46c | Python | 29,333 | 727 | """
Tests class Labels.
Tests for remove(), reorder(), restrict() and inset related methods are
implemented in the moment.
# Author: Vladan Lucic
# $Id$
"""
from __future__ import unicode_literals
from builtins import range
__version__ = "$Revision$"
from copy import copy, deepcopy
import unittest
import numpy
im... |
191469b60ff3d6f72affcb14c3b34f1e3ee033e0b581fbec93f989115b90fcf8 | Python | 29,351 | 697 | """
Early stopping
==============
This script shows how to use early stopping from PyntBCI for decoding c-VEP data. Early stopping refers to determining
when to stop the processing or decoding of a trial based on the reliability of the input data. Early stopping may be of
two kinds: static stopping and dynamic stopping... |
dfb69d08fcc9443d180f4b311dfa4defd5ea1be21d6b86ea1618f62a4437820d | Python | 29,367 | 301 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
12917e7cacdf6501a690cc444901723600bae3379b44b44fc92d55d3e5198385 | Python | 29,404 | 515 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
auto_para_mem = (0, 0, 0) # (chi_auto, chi_para, ksig_M)
_auto_para_mem = '_'.join(map(str, auto_para_mem))
reiterate = f'Reite... |
ad719559821f4c21fea881b339a1cef1788af5403c48faa50ff884e548f50410 | Python | 29,408 | 693 | from __future__ import print_function
import copy
import pybullet as p
import random
import time
from itertools import islice
import numpy as np
from .ikfast.pr2.ik import is_ik_compiled, pr2_inverse_kinematics
from .ikfast.utils import USE_CURRENT, USE_ALL
from .pr2_problems import get_fixed_bodies
from .pr2_utils ... |
c084be3606f21fbff81dacb80b8c8227d6c9c232f513249d753e365f67546272 | Python | 29,415 | 825 | ##
# \file volumetric_reconstruction_pipeline.py
# \brief Collection of modules useful for registration and
# reconstruction tasks.
#
# E.g. Volume-to-Volume Registration, Slice-to-Volume registration,
# Multi-component Reconstruction.
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date ... |
35d75f1649ab8f5c83249b72d9643063f68896d6a5278bd00f6e762df93fd294 | Python | 29,431 | 942 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
e814ae0de02709cb9d80da1bca6a3b0da102a033d912d3c55e4817d61e684efa | Python | 29,433 | 678 | ''' Helper functions to compute connectivity matrices
author: trianaa1
'''
import glob, os, re
import pandas as pd
import numpy as np
import math
from scipy.io import savemat, loadmat
from scipy.spatial.distance import euclidean
from scipy.stats import gaussian_kde
from scipy.stats import zscore
from scipy.interpola... |
2612d5d8eabf9077508beb6591e1d9a8a1f55166d5a6c8a0f057ae3323bc2d73 | Python | 29,440 | 533 | """ Authored by: Neel Kanwal (neel.kanwal0@gmail.com)"""
# This file provides training code for binary DCNN models mentioned in the paper.
# Update paths to processed datasets
if __name__ == "__main__":
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.simpl... |
ceedddf4154fccc2f51f4e5a708148c24477abec7c9de71459ada740ddb0d90e | Python | 29,447 | 498 | import time
import os
import argparse
import wandb
from datetime import datetime
import tensorflow as tf
from tensorflow.keras import mixed_precision
# Environment configuration for TensorFlow
os.environ['TF_ENABLE_EAGER_CLIENT_STREAMING_ENQUEUE']='False'
## custom modules
import src.models.epibert_rampage_finetune a... |
86da13987af4aca0da4956c0286232eacd97546088ad4be3badc67ea16aeefee | Python | 29,458 | 792 | #!/usr/bin/env python
# Copyright (c) 2018-2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
This module provides all frequently used data from CARLA via
local buffers to avoid blocking calls to CARLA
"""
from __future__ ... |
d96eb71c2bf6f8735433ee1983e39539870023c54d013b014697294b9775df65 | Python | 29,460 | 817 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... |
b2af55e31b6811904b9d4b61642c82ce8e03f07fb9ce8ac7a552231f9e123aa8 | Python | 29,464 | 727 | """
Performs Univariate 2nd order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
- Analysis settings
Output: - Plots by tomograms:
+ Number of particles by list
+ ... |
5a8daa1946f04232bf9dd8a95a193e237593f0671a2dd63f82cec1860a7f466a | Python | 29,480 | 620 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import seaborn as sns
import re
from sklearn.preprocessing import StandardScaler
from scipy.i... |
e0abf38ce773012e97eb2132d3baed436aab69f634a97146442887bac95fbcb2 | Python | 29,480 | 620 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import seaborn as sns
import re
from sklearn.preprocessing import StandardScaler
from scipy.i... |
4091c8e9af5fa924bb0609fa753311fef4cc57f34d142d92c3a215617c5e0c30 | Python | 29,495 | 515 | ##############################
######## Shallow Grid ########
##############################
#%%# Catalyzer
sup_comp = False # Super Computer?
cellulate = (0, 0) # (cell_layers, layer_cells)
auto_para_mem = (0, 0, 0) # (chi_auto, chi_para, ksig_M)
_auto_para_mem = '_'.join(map(str, auto_para_mem))
reiterate = f'Reite... |
cd7b7aad1e26eca3999cc0fc7ac23df4aad58a2b90bfafa8f20ee9e498b7fd67 | Python | 29,516 | 729 | # set QT_API environment variable
import os
os.environ["QT_API"] = "pyqt5"
import qtpy
import numpy as np
import time
# qt libraries
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from qtpy.QtGui import *
import pyqtgraph as pg
#import pyqtgraph.ptime as ptime
import pyqtgraph.dockarea as dock
from pyqtgraph... |
d99bb641fa36d27fc3967e69e1d300fb5ddc49abddce117c8a345d626847c2ce | Python | 29,517 | 1,005 | import pytest
import os
import tempfile
import torch
from torch.utils.data import DataLoader
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import uuid
from utils import *
def test_split_list_specific():
original_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
number_of_blocks = 3
bloc... |
bc2e973e8a6d03ed4e49b7c6affcab2f2fbf9a4bd7182075f52900335339bf96 | Python | 29,519 | 697 | from __future__ import print_function
import copy
import pybullet as p
import random
import time
from itertools import islice, count
import numpy as np
from .ikfast.pr2.ik import is_ik_compiled, pr2_inverse_kinematics
from .ikfast.utils import USE_CURRENT, USE_ALL
from .pr2_problems import get_fixed_bodies
from .pr2... |
14acde3b1ab604339c4e6bf1cb10f1f4927b1c50662d2bb851945a43df3adeae | Python | 29,526 | 743 | import os
import numpy as np
from glob import iglob
import shutil
import os
import readline
import pprint
import sys
from sys import argv
#from NN_phasecorrection import check_phases
'''This file should interpolate between a starting geometry taken from a QM.in file and an end-geometry (at which NNs broke down), also ... |
e38ebc64eae194aac089bda39929a24a10040bb9b351f671a541dcbfd2dbcbbc | Python | 29,531 | 777 | # coding: utf8
import os
import random
import sys
from dreamcoder.domains.logo.logoPrimitives import primitives, turtle
from dreamcoder.task import Task
from dreamcoder.program import Abstraction, Application, Index, Program
from dreamcoder.type import arrow
from dreamcoder.utilities import eprint, jsonBinaryInvoke, ... |
9a99a246180b73bcd5116771707041fdcc7337ca8f9769454f2fea01b654181e | Python | 29,546 | 653 | import json
import numpy as np
from .json_cleaner import clean_json_dump, clean_json_dumps
from itertools import combinations
from .version import __version__
class InvalidFieldException(Exception):
pass
class InvalidContactException(Exception):
pass
def merge_repeated_keys(pairs):
d = {}
for (k,v... |
8707e619f81a35c944e5d8214befda9eb7fd217b2e5efa3f3dc7da2760862e10 | Python | 29,565 | 753 | """
Classes for generating synthetic phantoms for validation
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 04.03.15
"""
__author__ = 'martinez'
import pyseg.globals
# import numpy as np
# from pyseg.pexceptions import *
from abc import *
from pyseg.disperse_io import *
import vtk... |
61178abfb695e41231e71765aa6cf113da505bd30aa79aa4ab77dcba73d52351 | Python | 29,583 | 582 | import numpy as np
def get_schnarc(prediction,properties):
n_states = prediction['energy'][0].shape[0]
QMout={}
for i,prop in enumerate(properties):
if prop == "energy":
hamiltonian = np.zeros((n_states,n_states),dtype=complex)
np.fill_diagonal(hamiltonian,prediction['energ... |
8e9d9343027729d919e4b3d8b0215d35082a1c14c4367d202c67d4b8dfd226a7 | Python | 29,587 | 711 | import os
import re
import json
import xml.etree.ElementTree as ET
import numpy as np
from scipy.interpolate import CubicSpline
from .. import config as CFG
from ..constants import OPENMX_BASIS_SPECS_2019, OPENMX_L_LABELS, OPENMX_VERSION, OPENMX_LINEAR_RGRID_DEN
from ..utils.structure import Structure
from ..utils.mis... |
64f58ad1efe0a983443bb4da030e79ef16a280f4094a9244dc2a9cc6d0d03d6e | Python | 29,588 | 535 | import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from pkganalysis.submission import (SamplSubmission, IgnoredSubmissionError)
from pkganalysis.RMSD_calculator_HG import RMSD_calculator, RMSD_calculator_protein
# ====================================================================... |
40b253c9a42cb9f252f1fbe7ef2cdb0aa17464a9c3bdf433f63435fc91437796 | Python | 29,595 | 795 | """
Classes for curves
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 29.02.2016
"""
__author__ = 'martinez'
import vtk
import math
import numpy as np
from pyseg.globals.utils import angle_2vec_3D, closest_points
###### Global variables
PI_2 = .5 * np.pi
MAX_PER_ANG = .25 * np.pi... |
a370edd27db4437743ffc2d6ea7970cf27b39f93cac2fe138e93d66e1810fe49 | Python | 29,597 | 772 | import openturns as ot
import openturns.viewer as viewer
ot.Log.Show(ot.Log.NONE)
import numpy as np
import uptake.metamodel_implementation.utils as miu
from uptake.figures.utils import CreateFigure, Fonts, SaveFigure
from uptake.metamodel_implementation.metamodel_validation import MetamodelPostTreatment
... |
c822d5ac2b72a0534435df66926db1786dca9aa913c07f71a4538eee9d81ab40 | Python | 29,604 | 756 | from __future__ import absolute_import
import linecache
import os
import platform
import sys
from dataclasses import dataclass, field
from traceback import walk_tb
from types import ModuleType, TracebackType
from typing import (
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Sequence,
T... |
bc895a519605c01d9a644b5105f9d97c095efdd30689a4f2116cddcf0a878501 | Python | 29,605 | 653 | from __future__ import annotations
from typing import TYPE_CHECKING, Literal, cast
import jax.numpy as jnp
import numpy as np
import numpyro as npy
import numpyro.distributions as npd
import toytree as tt
from anndata import AnnData
from mudata import MuData
from pertpy._logger import logger
from pertpy._types impor... |
44d5b98d0d60165a4a8822023939842713c7007a6e60e941076cab9888c026e0 | Python | 29,606 | 634 | import numpy as np
import pandas
import cv2
from typing import Tuple
from typing import Dict
from skimage import measure
from sklearn.neighbors import NearestNeighbors
from merlin.util import binary
from merlin.util import imagefilters
from merlin.data import codebook as mcodebook
"""
Utility functions for pixel base... |
42b94cd60d3d752e55247788dfdfe59eebbb0b65ee58888e594de6d8f63315a6 | Python | 29,611 | 701 | import torch
import numpy as np
import pyvista as pv
import matplotlib
import matplotlib.pyplot as plt
from os.path import join as osj
from os.path import exists as ose
from tqdm import tqdm
def train_regular_transformer(model, device, train_loader, optimizer, criterion, scheduler = None , x_normalizer = None,y_norma... |
61e45c0471e20934b9ef9863b6c32a4c1027d698f32b8900722e0507e8304fbb | Python | 29,630 | 634 | from __future__ import print_function
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
from torch.autograd import Variable
import torch.nn.functional as F
import copy
#A syntax-checking Robustfill, inspired by https://arxiv.org/pdf/1805.04276.pdf (Leveraging grammar and reinforcement learn... |
b308760bb144d24f7d53cca9f105bb23503d96b9b78879e3e6798039a3b0a4bb | Python | 29,647 | 742 | import time
import os
import subprocess
import sys
import re
import argparse
import collections
import gzip
import math
import shutil
import matplotlib.pyplot as plt
import wandb
import numpy as np
from datetime import datetime
import random
import multiprocessing
#import logging
#from silence_tensorflow import silen... |
08657bf6e28f76f71ad34a8ae534a7144b78bfee540c8560b63c653bdcec04cc | Python | 29,724 | 745 | # -*- coding: utf-8 -*-
"""
functions to calculate the quantities required by the LN cascade models,
including functions to compute the steady-state and the first order rate response
of an exponential/leaky integrate-and-fire neuron subject to white noise input
(and modulations of the input moments) -- written by J... |
55bd0e427514e4094669489881a159ababd7bdab3717df59f0d5e326f28e4bf9 | Python | 29,729 | 731 | """RegTools Hub launcher window (Direction A: pipeline rail + tool groups).
``HubWindow`` renders the unified launcher described in
``docs/superpowers/specs/unified-launcher-mockups.html`` (Direction A):
status row -> "Registration pipeline" rail -> grouped "All tools" grid
Every registry entry become... |
14d4da4eb42ef7a797d1250ad8f6d5bdbae0f07ed34eee0066d9006d71c097ef | Python | 29,755 | 838 | """Module to select periods of interest, based on number of trials or any of
the axes.
There is some overlap between Select and the Data.__call__(). The main
difference is that Select takes an instance of Data as input and returns
another instance of Data as output, whil Data.__call__() returns the actual
content of t... |
9f716ef2150a2ca11e2e1307fa195eaa12fac88da009d88bf6c54031b528a0a8 | Python | 29,781 | 743 | """
Napari-based interactive reorient viewer (multi-file).
Run as a subprocess from the GUI tab - never import this from the same
process that already has a PyQt5 ``QApplication`` running, because napari
spins up its own vispy/OpenGL context and the two will conflict on Windows.
Standalone usage::
pytho... |
c72d17f2e8c1dcfdc09c88339ed0b8ebbcc9bc85636cc6a878b7c714037152e2 | Python | 29,793 | 524 | import math
from e3nn import o3
import torch
from torch import nn
from torch.nn import functional as F
from torch_cluster import radius, radius_graph
from torch_scatter import scatter, scatter_mean
import numpy as np
from e3nn.nn import BatchNorm
from utils import so3, torus
from datasets.process_mols import lig_feat... |
ec79a3ea813f7a87ed6227c56cbdb3b5410e24c70738bbe468f5aaf23e808203 | Python | 29,811 | 720 | # Node-group asset "Color CSS" (GeometryNodeTree), dumped by nodebpy.assets.dump_library.
# Rebuild the library with nodebpy.assets.build_library (nodebpy build).
# _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump.
from typing import TYPE_CHECKING, Li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.