sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
3f3b88e57397ffebd127c0526b7c5e1ede92bc0e63e27f64804dc62f51e0a800
Python
58,846
1,474
"""Contains the base Layer class, from which all layers inherit. """ from __future__ import print_function from __future__ import absolute_import from __future__ import division import re from six.moves import zip import threading from .. import backend as K from .. import initializers from ..utils.layer_utils import...
912555920a77f72ded07839efa33fcceecc79f3523abbec783f0be46ee2c55c2
Python
58,921
1,223
# 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 warnings from collections import OrderedDict import torch import torch.nn.functional as F from tqdm import tqdm ...
9aeffa607de0debe3d62896f8c298308b56129b795a79b14600e4e394f98bd43
Python
58,944
1,150
# -*- coding: utf-8 -*- """ Created on Thu Apr 25 14:41:11 2024 @author: guill """ import numpy as np import scipy.sparse as sparse import scipy.stats as stats from numba import jit class SpikingNetwork(): def __init__(self, N_pyr=1000, N_mit=2250, N_fbi=125, N_ffi=125, v_reset=-0.065, v_re...
de15c24a67f80381627f9be9072f45199e3c83d80f0d46469082397c0df58dc7
Python
59,254
1,136
from collections import defaultdict from datetime import datetime from itertools import chain from functools import reduce from typing import Dict, List, Optional, Set, DefaultDict from enum import Enum from catmaid.control.common import set_log_level from catmaid.control.annotation import (get_annotated_entities, ...
34ffba89e9ae9cea259bae6386b1be5bf9b69eeb194ef9a2eba950ff132bafd7
Python
59,454
1,313
import ast import gzip import logging from collections import Counter, defaultdict import jsonlines import requests import src.datahandlers.mesh as mesh import src.datahandlers.umls as umls from src.babel_utils import ( get_prefixes, get_user_agent, glom, read_identifier_file, remove_overused_xref...
cf6e978e7c02e39b4d3a0975e71a484f72862a3eb3c8da189562aee76fa106ee
Python
59,687
1,335
# -*- coding: utf-8 -*- import json from io import StringIO from operator import itemgetter from django.shortcuts import get_object_or_404 from guardian.shortcuts import assign_perm from catmaid.control.authentication import (can_edit_all_or_fail, can_edit_or_fail, PermissionError) from catmaid.control.common i...
6b4d2cf3e13efb2f128c2f4f5d734502a3a533047e19ca8de0a90ff574ac3998
Python
60,382
1,565
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Eigenmode resampling on the cortex """ from .utils import ( _get_eigengroups, eigen_decomposition, transform_to_spheroid, transform_to_ellipsoid, normalize_data, ) import os from .geometry import (calc_surface_eigenmodes, ...
d05a96c8040f0c945b229bf426d84b44c539c4f7906cdca007c8af45a8f560ae
Python
60,387
1,502
# -*- coding: utf-8 -*- from datetime import timedelta, datetime from dateutil import parser as dateparser import json import os import pytz import time from typing import Any, Dict from django.conf import settings from django.http import HttpRequest, JsonResponse from django.db.models.aggregates import Count from dj...
040d6e55b90479972a786b20eff86b21f4aa7b3e6edae5c548269c0f68accd2d
Python
60,508
1,822
import h5py import numpy as np import pathlib as pl from matplotlib import pyplot as plt from myphdlib.general.toolkit import psth2 from myphdlib.figures.analysis import AnalysisBase, g from myphdlib.figures.modulation import BasicSaccadicModulationAnalysis from myphdlib.figures.analysis import convertSaccadeDirectionT...
5f93cea1af54de92f4749167144608919f4e61ec57e1fd1ae17d01a8fb068fb1
Python
60,533
1,554
# Image stack importer # Author: David Young, 2017, 2020 """Imports image stacks using Bioformats. Bioformats is access through Python-Bioformats and Javabridge. Images will be imported into a 4/5D Numpy array. Attributes: PIXEL_DTYPE: Dictionary of corresponding data types for output given by Bioformats...
7c47a224fb40fde4b7cfcb7c58b4e0b879f76806a8ef8b7c48e2fc1149c5feaa
Python
60,694
1,425
# 2D overlaid plot editor # Author: David Young, 2018, 2020 """Editor for 2D plot with overlaid planes. Integrates with :class:``atlas_editor.AtlasEditor`` for synchronized 3D view of orthogonal planes. """ import textwrap import time from typing import Callable, List, Optional, Sequence, TYPE_CHECKING, Union from ...
1919d6bdc155c50d5f44ccc6c2cdafa4f4a60af84dad65bf45a915723d93c964
Python
61,029
1,602
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Eigenmode resampling on the cortex """ from .utils import ( _get_eigengroups, eigen_decomposition, transform_to_spheroid, transform_to_ellipsoid, normalize_data, calc_parcellate, ) import os import subprocess from .geometry import calc_su...
6d2ef64243b7f3c1fe8f4e756e8a49242cc5ad65e9bb2025e9ade91a973f7e59
Python
62,773
1,733
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 Google 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...
c7ee84e001c186d060d0e42537192101782a871d487185e7f01b9402ed393357
Python
62,831
1,781
"""Test functions in heudiconv.bids module.""" from __future__ import annotations from collections import OrderedDict from collections.abc import Callable from datetime import datetime, timedelta from glob import glob import itertools import logging import os import os.path as op from pathlib import Path from random ...
ad315c4ec4846141593bf026cb30653f623da7fe85bbe2bdb3917cc82a4c1b3f
Python
62,837
1,525
"""A `Network` is way to compose layers: the topological form of a `Model`. """ from __future__ import print_function from __future__ import absolute_import from __future__ import division import numpy as np import json import yaml import warnings import copy import os from six.moves import zip from . import saving f...
c26c35a7bf26e43b2d9abb8dcbfa40985561c5cd7ff3893c24f5b0850e9ecae8
Python
62,967
1,080
import subprocess import json from .jobHandler import * import os from .sample import Sample from .cluster import Cluster from .bcolors import Bcolors import concurrent.futures import copy import gzip #from Bio import SeqIO class Experiment: def __init__(self, name="", slurm_path=None, modules_path=None): ...
79263d8b8a14b1c1eb973dca1683be90e905569407719ada3980a6001b30db7c
Python
63,436
1,367
import gzip import os import re import shutil import sqlite3 import subprocess import tempfile import time import traceback import urllib from collections import defaultdict from datetime import datetime, timedelta from enum import Enum from ftplib import FTP from io import BytesIO from pathlib import Path from typing ...
f7fbe08df46c69268aaece97b20592fd6bf8010e5850f871673617cd9e47704d
Python
63,503
1,258
#!/usr/bin/env python """ 1. Unlock scans_tsv and update it based on runtype metadata 2. Harmonize discrepancy between nifti and behavioral data 3. Starting from Line 242, Behavioral data conversion to BIDS valid format Same format occurs for pain, vicarious, cognitive data convert behavioral file into event lists and ...
85efc33eb11de28c9dd1c705ad0afce46d1d885b782685890cbb0460eca61a3e
Python
63,587
1,426
#VNC-Quant/VNC-Dist Colavita & Perkins Lab, Faculty of Medicine UOttawa import streamlit as st import tkinter as tk from tkinter import filedialog, simpledialog, messagebox import pandas as pd import matplotlib.pyplot as plt import math import sys import threading import time import os import tempfile import zipfile...
340b05edd4da7534b2a594f258ca76f8ec676549609d8f14716549930a93ecb6
Python
63,799
1,675
#!/usr/bin/env python import sys, os, subprocess, signal import multiprocessing import platform import string import re from datetime import datetime, date, time from collections import defaultdict from argparse import ArgumentParser, FileType osx_mode = False if sys.platform == 'darwin': osx_mode = True MAX_EDI...
236f19114a96de8259e0e61b9c879c49653b21d737300715c36220f25cbb7561
Python
64,205
1,612
# Plot Support for MagellanMapper # Author: David Young, 2018, 2023 """Shared plotting functions with the MagellanMapper package. """ import dataclasses import pathlib from collections import OrderedDict import math import os import warnings from typing import Any, Callable, Dict, List, Optional, Sequence, \ TYPE_C...
8d96b9f4875cab2fbad491e5dd7ee483f143dd465b7be1996fcdd5056a858be5
Python
65,143
1,432
#******************************************************************************# #-------------------------- Sec. 1: Import Libraries --------------------------# ''' print("Importing Libraries ...", end = " ") #import pandas as pd import numpy as np import random import time import h5py import mne import csv import s...
60712cecb08a7efd696ed155079abca3e21cf237ef81e0aa716a31f6749b9f1a
Python
65,881
1,329
""" Unit tests for src/createcompendia/diseasephenotype.py. Sections: - ``# --- UMLS semantic-type tree mapping ---`` exercises the UMLS semantic-type-tree → Biolink category map that ``write_umls_ids`` hands to ``umls.write_umls_ids``. The map is built inline, so we capture it by mocking the downstream ``umls....
76b4c2ee4f8fd7bc46d9740dea1368e46d42351a71e66c65ff12a702976f78b2
Python
66,182
1,519
import os import numpy as np import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras.optimizers import Adam from tensorflow.keras.models import Model, Sequential from tensorflow.keras.layers import * from tensorflow.keras.losses import mse from tensorflow.keras.utils import multi_gpu_model fr...
722ca271d4d8be3b89e594a2402ba7532e605fb0cb23b7dce416070b304e17ae
Python
66,327
1,617
# coding=utf-8 # Copyright 2020 Microsoft and the Hugging Face Inc. team. # # 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 require...
b95c3714b65d2bb88b8b62f03a9afbbbd61643d08151cf887b459f659d173bf4
Python
66,467
1,710
""" Util functions for statistical analysis and algorithms. Author: Hanna M. Tolle Date: 2025-02-12 License: BSD-3-Clause """ import os from typing import List, Dict from dominance_analysis import Dominance from sklearn.linear_model import LinearRegression from sklearn.cross_decomposition import PLSRegression from sk...
2a52a57a2c00ed18166a0e1b28934d787d5f298fd3355b115ec0de6d4a9d4473
Python
66,712
1,940
# -*- coding: utf-8 -*- # transformations.py # Copyright (c) 2006-2018, Christoph Gohlke # Copyright (c) 2006-2018, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifica...
77800845764d7c496166d4ab51bb587e3fcb732a7c2e5ce1fd6bbef6b0aaf273
Python
67,834
1,731
import os import numpy as np import scipy import matplotlib.pyplot as plt # import seaborn as sns import matplotlib as mpl from statsmodels.stats.multitest import multipletests import matplotlib.patches as mpatches from functools import reduce # local imports from auditory_cortex import results_dir, utils, DNN_MODEL...
c164ec32bdc13b6f1db22a211fc1ff84c50cb8888b091e889f2126b40adc1e61
Python
68,084
1,355
""" This module contains the find_lewis() function and associated helper functions to find the best resonance structures for yarpecules. """ import sys import itertools import numpy as np from copy import copy,deepcopy from ReactBench.utils.taffi_functions import adjmat_to_adjlist,return_rings,graph_seps from ReactB...
f5757068361b30bfbe2ee93af8228718fcafe24708e648dc3bb333fff8f860db
Python
68,359
1,117
""" Deals with models for deepseg module. Available models are listed under MODELS. Important: model names (onnx or pt files) should have the same name as the enclosing folder. Copyright (c) 2020 Polytechnique Montreal <www.neuro.polymtl.ca> License: see the file LICENSE """ import os import json import logging impo...
41e53ca4bdcedefff7feac7cead89aaa7b63a051fe95f6066742d9a66bb46cd6
Python
68,755
1,651
#!/usr/bin/env python # 2D plot image and graph plotter # Author: David Young, 2017, 2020 """Plot 2D views of imaging data and graphs.""" import os import textwrap from typing import Callable, Optional, Sequence, TYPE_CHECKING, Tuple, Union, Dict, Any import numpy as np from matplotlib import colors as mat_colors, gr...
3595864a6cd177529a8f4b8b392921f2bef4e5e7e44bb3f49c4c2aacc10cf438
Python
68,960
1,176
#!/usr/bin/python import collections import math import msprime import numpy def OOA(params, inds, length=1e6, mutation_rate=1.45e-8, recombination_rate=1e-8, replicates=300): """ This is the Model from Gravel et al. 2013 PNAS for Out of Africa :param params: all the parameters necessary for this model ...
1858e659b6caa7e451661336d2e7940a665094233df3d865c2104f70ac41ea9e
Python
68,975
1,534
# ROI Editor with serial 2D viewer and annotator # Author: David Young, 2018, 2023 """ROI editing GUI in the MagellanMapper package. Attributes: verify: If true, verification mode is turned on, which for now simply turns on interior borders as the picker remains on by default. """ from collections ...
9a94823be4b39f705c061edeeaa5e64c54561d02ab0af64d6a1cc970b7814f18
Python
69,487
1,585
"""Implementation of CommandLineTool.""" import copy import hashlib import json import locale import logging import os import re import shlex import shutil import threading import urllib import urllib.parse from collections.abc import Generator, Mapping, MutableMapping, MutableSequence from enum import Enum from funct...
48b5ebf1da6af5c033da17885f5e66f4975cc8e457d936f334fdc04566e3fc3f
Python
69,513
1,858
# Version: 0.18 """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy * [![Latest Version] ...
aefe0f2dd216093959d9f2e9bcaf38155925f7a941ec071741ef4a44adefa9d8
Python
70,194
2,064
import errno import json import logging import os import re import shutil import stat import subprocess import sys import urllib.parse from collections.abc import MutableSequence from io import StringIO from pathlib import Path from typing import Any, cast import cwl_utils.expression as expr import pydot import pytest...
d88ebebf18de9b816747aa34666840e15d4d4cfc4ae4ba9f7c7954b30d8c604b
Python
71,593
1,652
""" Python API for GuPPy pipeline steps. Save Input Parameters (automatic provenance) - Writes GuPPyParamtersUsed.json into each selected data folder. - In the GUI this snapshot is now written automatically by each numbered step; ``save_parameters_snapshot`` exposes the same write directly for tests/scripts. This m...
602cf3a5c033293396916fc8bec4dad965307db627309d1d794fd2363835e560
Python
71,673
1,226
import numpy as np import os from freesurfer.samseg.Samseg import Samseg from freesurfer.samseg.utilities import Specification from freesurfer.samseg.SamsegUtility import * from freesurfer.samseg import gems import nibabel as nib from os.path import join import logging from freesurfer.samseg.merge_alphas import kvlMerg...
e758f0be03cdc3040534c0484d4c78c724e094430c2c9172b681c9fddd64ce64
Python
71,679
1,815
"""XGBoost pyspark integration submodule for core code.""" import base64 # pylint: disable=fixme, protected-access, no-member, invalid-name # pylint: disable=too-many-lines, too-many-branches import json import logging import os from collections import namedtuple from dataclasses import asdict from typing import ( ...
8401a90e25d25da621076c9857d7657214e052921159e19febbf202de4526cbe
Python
71,726
1,746
# -*- coding: utf-8 -*- from collections import defaultdict import json import math from typing import Any, DefaultDict, Dict, List, Set, Tuple from django.db import connection from django.shortcuts import get_object_or_404 from django.utils.decorators import method_decorator from catmaid.control.authentication impo...
1e61204338835cc8f9cb5d1384b89d207b1e3f29969ab9ef6c5adbb8efd518d6
Python
71,843
1,826
""" Neural network models. License: BSD 3-Clause Authors: Hanna M. Tolle, Lewis J. Ng Date: 2024-11-02 """ import sys sys.path.append('../') import abc from typing import Dict, Optional import torch from torch_geometric.utils import to_dense_adj, scatter, to_dense_batch from torch_geometric.data import Data, Batch fr...
f4e542d45faf347fc9adfe0545b09a571a8d7ada182907a94ddc4c5268b07060
Python
72,234
1,856
import sys, tempfile, os, subprocess, time, logging import h5py import numpy as np import pytraj as pt from . import utils, commands, constants, chemtools # local modules from . import printit, config # local static methods/objects # TODO: # - Add description of each features in the docstring logger = loggin...
3ab1699447616845424608d2b4d1125e3d0c3ab9b0d314ba96eaf1c6bd12ab0e
Python
72,504
1,522
import json import logging import os from pathlib import Path import numpy as np import pandas as pd import panel as pn from .dandi_file_panel import DandiFilePanel from .frontend_utils import default_root_path from ..settings import remember_root_folders, remembered_root_folders from ..utils.utils import ( commo...
d1d0d08c66df2e2d205115c2e1d0f003053aa7feaf6e64c7f8d16a261a7e7c94
Python
72,566
1,559
""" MetaWIBELE Workflow: characterization module A collection of tasks for characterization workflow Copyright (c) 2019 Harvard School of Public Health 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 Soft...
c12348f842577e396dea0fa6a3c1c9192e32ced415800c30c7860859423958fd
Python
72,669
1,648
import json import math from fnmatch import fnmatch from pathlib import Path from types import SimpleNamespace import numpy as np import pandas as pd import panel as pn import pytest from guppy.frontend.input_parameters import ( ParameterForm, _table_heading, _titled_box, ) from guppy.settings import reme...
be7a631353d24fc4b57c7cd51aba787c9f2f56672e967052e92dd01ecaa81428
Python
72,747
1,385
# coding: utf-8 # Copyright 2019 Sinovation Ventures AI Institute # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
7f02f21364ec5b5339ac6173e87cdb523c01ce90949420280e72b72d04de4171
Python
73,112
1,803
# -*- coding: utf-8 -*- """ Created on Sat May 23 10:38:20 2020 @author: george.dickinson@gmail.com This program is a Python script developed to analyze the motion of intracellular Piezo1 proteins labeled with a fluorescent tag. It allows the user to load raw data from a series of image files and track the movement o...
e3aa3e3de20e7ed263501ee5e27dfeb191f4b839735157bcedc2c5eeb3180d3e
Python
73,141
1,516
import os import skeletor as sk import traceback import time import numpy as np import trimesh import navis as ns import subprocess import pandas import networkx as nx import math from itertools import chain from trimesh.exchange.obj import export_obj import tempfile from typing import Any, List, Iterator from django....
bedfacae69e5a19c04a6e599856a4289be8a6be4edda318caf79b0e4f599f9f8
Python
73,224
1,454
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 5 11:31:48 2021 @author: schwab """ import os import sys import time from pathlib import Path from typing import Optional import numpy as np import torch import mrcfile import typer from tqdm import tqdm from torch.utils.data import DataLoader f...
3c00411456535509194355c9ea2e19f5f7db2213e611727b75a540adc7c31a60
Python
73,535
1,681
# -*- coding: utf-8 -*- from collections import defaultdict import json import logging import numpy as np from typing import Any, DefaultDict, Dict, List, Optional, Set, Tuple, Union from django import forms from django.db import connection from django.db.models import Q from django.conf import settings from django....
ef6fcb0fa8b87e16eec17053310197407e468d4ac4a378bad75ed4b8d41758a8
Python
73,672
2,020
import json import unittest from prov.constants import PROV_TYPE,PROV_RECORD_IDS_MAP from prov.model import ProvDocument from provdbconnector.db_adapters.baseadapter import BaseAdapter, METADATA_KEY_IDENTIFIER, METADATA_KEY_TYPE_MAP, METADATA_KEY_NAMESPACES, METADATA_KEY_PROV_TYPE from provdbconnector.exceptions.datab...
3b33d6c445a52176138ce3339a57da266bb4e26dd84cb9e8854f9e7380eddfbf
Python
73,958
1,639
# -*- coding: utf-8 -*- from datetime import datetime import gc from itertools import chain import logging import math import numpy import os import progressbar import re import subprocess from typing import Any, Dict, List, Tuple from django.db import connection from django.conf import settings from django.http impo...
e043631856cc756644ec143ceea2c45df538adab4fe2631c8331970bf1732061
Python
74,509
1,349
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Feb 7 17:57:52 2025 @author: natalie """ import brian2 as b2 import json import numpy as np import matplotlib.pyplot as plt import matplotlib import matplotlib.gridspec as gridspec import pandas as pd import pickle import os import scipy from scipy....
1fcf6f3b14d1ebea29d0e16c4037374aaa37a1e6e44f48c47a23f071d242dd7d
Python
74,516
1,735
#!/usr/bin/env python3 """Data-centred state-transition model for tumour-cell extravasation across BBB models. The program separates two levels that must not be confused: 1. experimental models (pillar-based endothelial interface or perfused cylinder); 2. the mathematical model (an observed-state process and discrete...
293008d4e8ba8bf20f643cc736c7da2e9cb398a1bc9fab58c052f1134c6f5c9f
Python
74,615
1,574
import os import re import sys import textwrap from pathlib import Path import PyQt5.QtCore as Core import matplotlib.colors as colors import matplotlib.pyplot as plt import numpy as np import pyqtgraph as pg from PyQt5 import QtCore from PyQt5.QtCore import Qt from PyQt5.QtGui import QBrush, QIcon, QFont, QPixmap, QC...
c622288f36c257ca60c2e5be34e261e606093f6e3d374da6dd881d6cfb5e1d5c
Python
75,175
2,048
""" Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ import logging import torch.nn as nn # from typing import Dict, Optional, Union from typing import Callable, Dict, Optional, Tuple, Union fro...
11284e6a9d9b44dcce89718acbadec8a852d70650f94b211a441329a5a42d56b
Python
75,391
1,913
# This is where all the ultility functions are stored # The first function is to load in the data import dask.array as darr import numpy as np import pandas as pd import xarray as xr import zarr as zr from os.path import isdir, isfile from os.path import join as pjoin from os import listdir from typing import Callable...
9b6d9e080079b9f14eb404bfc2129d61d3a4af3ec32205e293749bf7eff69752
Python
75,504
1,983
"""Built-in metrics. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import numpy as np import six import types from . import backend as K from .layers import Layer from .losses import mean_squared_error from .losses import mean_absolute_erro...
5562ae1ae682e0138137c600b28db5715edccf49043343e9ca0f50d1858f64ad
Python
75,522
1,502
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 15 14:13:05 2024 @author: schwab """ import os import sys import time from pathlib import Path from typing import Optional import numpy as np import torch import mrcfile import typer from tqdm import tqdm from torch.utils.data import DataLoader ...
87533e78391edf6426269f9176508ee616be775986220dd381d115a03f1f0d52
Python
75,879
1,619
from __future__ import print_function from __future__ import division from future import standard_library standard_library.install_aliases() #from builtins import str from builtins import range from quantities.quantity import Quantity import sciunit from sciunit import Test,Score try: from sciunit import Observatio...
c3c1b45e3e75eeaffe3c7cbf56966712735565f28b011f720ee2e473cf16cf83
Python
75,882
1,789
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: Rui Peixoto and Michael Janecek """ #%% Choose file & define QC criteria # Define criteria as dictionary where the key is the column name and the value is a tuple (condition, threshold) criteria_QC = { #'LR': ('=', ["Right","Left"]), # use 'LR':('=',"L...
19b1211a35d5c525eb8a81557cb2d1ec9efffbba903a204eb9cfa663f7c7b15b
Python
76,694
2,048
# /// script # requires-python = ">=3.10" # dependencies = [ # "matplotlib", # "numpy", # "scipy", # ] # /// """Generate SVG figures for the isosbestic-correction explanation page. The correction math (np.polyfit degree 1, deltaFF) mirrors GuPPy's src/guppy/analysis/z_score.py exactly, and the synthetic-fa...
723408642c460756c7a56da0cea2c5518f83ad3b86a24d42a551c9bcfec459ab
Python
77,018
1,899
# -*- coding: utf-8 -*- from collections import defaultdict import dateutil.parser import re from typing import Any, DefaultDict, Dict, FrozenSet, List, Optional, Set, Tuple, Union from django.http import HttpRequest, HttpResponse, JsonResponse from django.shortcuts import get_object_or_404 from django.db import con...
8c71533e95118c5f8f3d2288a6f3440a1c4809d605d1121396e02c43b0f902b9
Python
77,185
1,997
import glob import logging import random import tempfile import uuid from collections import namedtuple from typing import Generator, Iterable, List, Sequence import numpy as np import pytest from pyspark import SparkConf from pyspark.ml import Pipeline, PipelineModel from pyspark.ml.evaluation import BinaryClassifica...
22218db81c5d743c928913f620388eba6678e1ac8aaf7c729a7d1917b058b20c
Python
77,380
1,551
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy import math import random import torch import torch.nn as nn import torch.utils.checkpoint from torch.nn import CrossEntropyLoss from typing import List, Optional, Tuple, Union from transformers.modeling_utils import PreTrainedModel from transformers.activati...
6b11fb7c601b2b72101480bab819ae07f260a85dd9f8d241a84236d40fd602ea
Python
78,708
2,249
"""Copyright 2019-2025, XGBoost contributors""" import asyncio import json import os import pickle import socket import tempfile from concurrent.futures import ThreadPoolExecutor from functools import partial from pathlib import Path from typing import Any, Dict, Generator, Literal, Optional, Tuple, Type, Union impor...
668c8245199b508bc4c65cbe944182a8a81527bdc87e5873d628dbb5d5bd0de2
Python
78,815
2,142
import threading import pytest import numpy as np import pandas as pd from numpy.testing import assert_allclose import sys import scipy.sparse as sparse from flaky import flaky import keras from keras import losses from keras import metrics from keras.layers import Layer, Activation, Dense, Dropout, Conv2D, Concatena...
aeffd4d10397efa61229c73a2f81fca5401bb598c89b61713fcb96dcaf7d59e7
Python
79,783
2,038
# -*- coding: utf-8 -*- import array from collections import defaultdict, deque from datetime import datetime from functools import partial import json import logging from math import sqrt import msgpack import networkx as nx from psycopg2.extras import DateTimeTZRange import pytz import struct from typing import Any,...
5a9fbbf61fbb5850be9fbd692588d315406574959503af71d249ee3ea2dafa1f
Python
79,820
1,683
""" Spinal Cord Registration module Copyright (c) 2020 Polytechnique Montreal <www.neuro.polymtl.ca> License: see the file LICENSE """ import logging import os # FIXME import shutil import psutil from math import asin, cos, sin, acos, radians import numpy as np from scipy.ndimage import gaussian_filter1d, sobel, co...
1291f50eb8980e3eb29f388b39b7890db8140a2458f7f1436ccc11fb78228748
Python
79,855
2,260
# pylint: disable=too-many-arguments, too-many-locals # pylint: disable=missing-class-docstring, invalid-name # pylint: disable=too-many-lines """ Dask extensions for distributed training ---------------------------------------- See :doc:`Distributed XGBoost with Dask </tutorials/dask>` for simple tutorial. Also :doc...
d9a2c1d25f94691a967731e6319ab86b1d40c01908b2523de4cab8885768486e
Python
81,279
1,829
# Atlas refinement # Author: David Young, 2019, 2023 """Refine atlases in 3D. """ from collections import OrderedDict from enum import Enum import os from typing import Dict, List, Optional, Sequence, Tuple, Union, Any try: import itk except ImportError: itk = None import numpy as np import pandas as pd try: ...
5592a1259139d2cb0db6c21536a2a15cce48ff3e447f0e14d07c6c8cb9995400
Python
81,945
1,964
""" SCT Image API Copyright (c) 2018 Polytechnique Montreal <www.neuro.polymtl.ca> License: see the file LICENSE """ # TODO: Sort out the use of Image.hdr and Image.header --> they seem to carry duplicated information. import sys import os import errno import itertools import warnings import logging import math from...
02a6eea0a2057aa386a2e30795587cc98503b97dafffa685b9a4835584588432
Python
82,240
1,954
# coding=utf-8 # Copyright 2021 The IDEA Authors. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by a...
e12094040378288f8a89fe615e6bf29ea7c01aa25cf479ffd5aec8a21fda171c
Python
82,500
2,228
"""Evaluation module (adapted from bluepyemodel).""" # Copyright (c) 2022 EPFL-BBP, All rights reserved. # # THIS SOFTWARE IS PROVIDED BY THE BLUE BRAIN PROJECT ``AS IS'' # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # P...
0e7663996beb5347824a8ab2218c66495fb5ffbaa14c21b14bbe08dcdef52e07
Python
83,373
2,211
import logging import os import subprocess import tempfile import time from typing import ClassVar import h5py import numpy as np import pytraj as pt from . import ( # local modules # local static methods/objects commands, config, constants, log, utils, ) # chemtools pulls in rdkit and openbab...
ac4736863993bd7f5bd01403f99e2bc3fe72011dbd784ea5487fe158a80bc24e
Python
83,606
2,130
# -*- coding: utf-8 -*- """ Created on Sat May 23 10:38:20 2020 @author: george.dickinson@gmail.com This program is a Python script developed to analyze the motion of intracellular Piezo1 proteins labeled with a fluorescent tag. It allows the user to load raw data from a series of image files and track the movement o...
eee0523c0544572e511bfa9fc9e7c2ee7b7cab3cd9749173f33e3f98db76e86a
Python
83,702
7,636
""" Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. k-hot elemental embeddings from QMOF, motivated by the following Github Issue threads: https://github.com/txie-93/cgcnn/issues/2 https://github....
dab3ff7183bcec6f93110d5c1bcecd65610f809f3c422512a773b23d717382f1
Python
84,072
2,501
""" SO3LR Molecular Dynamics Module This module provides functions for running molecular dynamics simulations with the SO3LR Machine Learned Force Field. It includes functionality for: - NVT simulations - NPT simulations - Geometry optimization - Trajectory output in hdf5 and extxyz formats - Restart capabilities """...
3dbafc90631bf0e45009ea4febcb0ceeaffdfdddc485441335f1e67278ef3132
Python
84,414
2,265
# pylint: disable=too-many-arguments, too-many-locals, invalid-name, fixme, too-many-lines """Scikit-Learn Wrapper interface for XGBoost.""" import copy import json import os import warnings from concurrent.futures import ThreadPoolExecutor from inspect import signature from typing import ( Any, Callable, D...
d748a8531673468cc8c9d497a23c4a68450f1180e6e2b459936846a92104cb4d
Python
85,684
2,100
# -*- coding: utf-8 -*- import colorsys from datetime import datetime, timedelta import enum import logging from random import random import re import sys from typing import Any, Dict, Tuple import urllib import urllib.parse import uuid from django import forms from django.conf import settings from django.contrib.aut...
bc3802dbe0b05cd47d388ce26132175c70015dd99a1a90a7c2888c5674c263d1
Python
85,878
2,221
# -*- coding: utf-8 -*- # tests/test_backmapping_em1_em2.py ################################################################################ # EncoderMap: A python library for dimensionality reduction. # # Copyright 2019-2024 University of Konstanz and the Authors # # Authors: # Kevin Sawade, Tobias Lemke # # Encoderma...
d1189d5769c0224e893ce2f70104150cdb61b82078734414bea7af5e84c931f2
Python
87,482
1,510
#!/usr/bin/env python # # Analyze lesions # # Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca> # License: see the file LICENSE import os import sys import pickle from typing import Sequence import textwrap import numpy as np from skimage.measure import label from scipy.ndimage import center_of_mass f...
2e347b300f195c6f1d565b1475152d7c342a2cc7ed4324cca020cc7335a37798
Python
87,539
2,358
# Version: 0.29 """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/python-versioneer/python-versioneer * Brian Warner * License: Public Domain (Unlicense) * Compatible with: Python 3.7, 3.8, 3.9, 3.10, 3.11 and pypy3 * [![L...
49e024f344c0e75aaa13b564cdc94ea2b762558dae6b941dd41fad8a49d83d3f
Python
87,828
2,537
# Copyright (c) OpenMMLab. All rights reserved. import copy import inspect import warnings from typing import Dict, List, Optional, Sequence, Tuple, Union import cv2 import mmcv import mmengine import numpy as np from mmcv.transforms import RandomFlip as MMCV_RandomFlip from mmcv.transforms import Resize as MMCV_Resiz...
08e44eca1c13ef03cf202c88560ae93e9b45ea81a9a0008607c585b5ea33926e
Python
89,163
2,091
# -*- coding: utf-8 -*- # encodermap/misc/backmapping.py ################################################################################ # EncoderMap: A python library for dimensionality reduction. # # Copyright 2019-2024 University of Konstanz and the Authors # # Authors: # Kevin Sawade, Tobias Lemke # # Encodermap i...
5a728d27a8fd5951cf4ca05894af0e20c972fcd3c12d4c0904e2af53a3b3201f
Python
89,420
2,258
# -*- coding: utf-8 -*- # encodermap/trajinfo/info_single.py ################################################################################ # EncoderMap: A python library for dimensionality reduction. # # Copyright 2019-2024 University of Konstanz and the Authors # # Authors: # Kevin Sawade # # Encodermap is free sof...
a891212d1a76657455959a5dec8802708ee3a254cff995a15d75105b1702afbb
Python
89,915
1,975
# -*- coding: utf-8 -*- from io import StringIO import json import platform import re from typing import Any, Dict from unittest import skipIf from urllib.parse import urlencode from django.db import connection, transaction from django.shortcuts import get_object_or_404 from guardian.shortcuts import assign_perm fro...
7ff263ec9bcb09954ce3e58b27a7fbd072fd00cd12f72f9aac81f72b2d678544
Python
90,052
1,911
"""Training-related part of the Keras engine. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import warnings import copy import numpy as np from .network import Network from .base_layer import Layer from . import training_utils from ...
85ad7c90b77ac2bf7e53ebcb8a49c9d57d1c613f0312bb9774ff47988cf5684c
Python
90,234
2,086
# coding=utf-8 # Copyright 2021 The IDEA Authors. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by a...
3a9dd70cd6e927fe18f1d00ebc7862211849424c824e999b9f1c9674629ba695
Python
90,605
2,337
# -*- coding: utf-8 -*- # encodermap/loading/featurizer.py ################################################################################ # EncoderMap: A python library for dimensionality reduction. # # Copyright 2019-2024 University of Konstanz and the Authors # # Authors: # Kevin Sawade # # Encodermap is free softw...
cbd80286b2f45b921a7ace93a352d5130268f97c8b21a494f5a949901f182de8
Python
91,342
2,151
import pytest from numpy.testing import assert_allclose import numpy as np import scipy.sparse as sparse import warnings from keras import backend as K from keras.utils.conv_utils import convert_kernel from keras.backend import numpy_backend as KNP try: from keras.backend import cntk_backend as KC except ImportE...
e58254dc7b919b695f415c5d56d745dfb57305c0496eb789e6e6d256b734141b
Python
92,039
2,438
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. """ Dataset testing operations. Tests all d...
1c196c444a6835be43a1d9fc6f307dcf40ddae2fcefb4c9cb3e690daa6f362ae
Python
92,855
2,027
import numpy as np import matplotlib.pyplot as plt import matplotlib.transforms as mtransforms from fig_utils import * import os from matplotlib import scale as mscale from fig_utils import AsymScale mscale.register_scale(AsymScale) import seaborn as sns from matplotlib import gridspec import matplotlib.patches as patc...
8257e2d82207899ab3fe87043efa0827947c8769ae1934f62ab913c6e66e0d52
Python
92,878
2,041
"""Command line interfaces for SO3LR.""" import os import sys import jax import ase import time import yaml import click import logging import warnings import platform import numpy as np from pathlib import Path from ase.io import read, write from typing import Dict, List, Tuple, Optional, Union, Any, Callable from ....
2a054ad11b09d986e2ac9b8bc8ded88b5579f72364575921ace6703b9ec20601
Python
92,972
2,921
from __future__ import absolute_import from __future__ import division from __future__ import print_function import cntk as C import numpy as np from .common import floatx from .common import epsilon from .common import image_data_format from .common import normalize_data_format from ..utils.generic_utils import trans...
bd4ce6aafcca088a64e2a46e25aaf3200d8d94825de3690caf77fa9c920e2d35
Python
93,340
2,038
from __future__ import print_function from __future__ import division from future import standard_library standard_library.install_aliases() #from builtins import str from builtins import range from quantities.quantity import Quantity import sciunit from sciunit import Test,Score try: from sciunit import Observatio...
7946deaa6ab0e477415bfa237b76d489fcb355ec82f704d471fe801a51c192a7
Python
95,475
2,495
# -*- coding: utf-8 -*- # encodermap/plot/interactive_plotting.py ################################################################################ # EncoderMap: A python library for dimensionality reduction. # # Copyright 2019-2024 University of Konstanz and the Authors # # Authors: # Kevin Sawade, Tobias Lemke # # Enc...
39510cc3c1c97b139ab36283920d491ae756b90e215b30456e68259008de7646
Python
95,963
2,254
# -*- coding: utf-8 -*- from django.db import migrations from django.conf import settings # This migration will remove all existing history tables and replace them with # a new version, which also keeps track of transaction IDs. This happens either # in live tables directly or as part of tracking table (formally tim...
ccc7be2f24a81feb32c596a05b2b80e1b836b371cc7d950561370a331979deec
Python
96,038
2,206
""" Event-based shuffling utilities for calcium transient analysis. This module provides both temporal and spatial shuffling capabilities: TEMPORAL SHUFFLING: - Shuffles the timing of calcium transients while preserving spatial relationships - Uses ITI (inter-transient interval) permutation to maintain realistic timi...
5e62e85e359275ebc18ed64f08f5099370de1f9aff57561ff1bbad53782e5965
Python
96,949
2,002
# coding=utf-8 # Copyright 2021 The IDEA Authors. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by a...