sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
305f6536c1673631045f75fa2ee6463810fb8200d5ee47bbc940fac5a3751a62 | Python | 18,880 | 592 | """
Copyright 1999 Illinois Institute of Technology
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, publis... |
a9510b05770bad0f7aa9d918f203884127f39d4dd78c9410d6b568a5fb6fd8de | Python | 18,881 | 344 | """
Authors: Jesper Browall, Jonathan Arvidsson, Sahlgrenska University Hospital and Gothenburg University, Gothenburg, Sweden
This file contains plot functions called by the class AutoAifSel when input variable 'doPlot' is set to True.
"""
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib imp... |
8cb2b4918b4f927629ac3667fd7e36a624b79714cd104721cc8a275e4a3b1f0f | Python | 18,884 | 621 | import copy
import svgwrite
import math
import inputs
tag_colors_colorscheme = ["white", "#ffc2c2", "gray", "#c2caff", "#81c8aa"]
tag_colors_bwscheme = ["lightgray"] * len(tag_colors_colorscheme)
#
# ############################################
#
def translate(x, f, xshift):
return (f * x[0] + xshift, -f * x[1]... |
3f3cf2815c963154b16ec68a48e1bbbfd50aae1cf42e462f5ea1f61dc70b476e | Python | 18,885 | 462 | from __future__ import annotations
import dataclasses
from collections.abc import Collection
from typing import Final
from typing import Literal
from PySide6 import QtCore
from PySide6 import QtGui
from PySide6 import QtWidgets
from .._label_flags import compile_label_flags
from .._label_flags import get_default_fla... |
55f964b5c1ffd129915ce47f8942ccac72be708832d4270f075c6c767be46e46 | Python | 18,887 | 355 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_scatter import scatter, scatter_max
from torch_geometric.nn import global_mean_pool, global_add_pool
class InteractionBlock(nn.Module):
""" A wrapper for multi-head vector-scalar interaction block with non-linearity.
The output is in... |
1a78e655892f5256407558bf622925a7d9e0e424c623fbef7dbccb67f3446373 | Python | 18,892 | 563 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
#!/usr/bin/env python
# coding: utf-8
"""
AGED Visualizations Module
Visualization functions for deconvolution results
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from typing import Optional, Dict, List, Tuple
from ... |
3af3925a38fd6775e4b7140a4943abf7783445a860dc4767768ed8a554924e55 | Python | 18,893 | 469 | # -*- coding: utf-8 -*-
# @Author : LG
import os
import shutil
import time
from functools import partial
from urllib import request
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QThread, pyqtSignal
from ISAT.configs import CHECKPOINT_PATH
from ISAT.segment_any.model_zoo import model_dict
from ... |
208b7aa263d53cb6c7f432d59aff49eed9a58004e3acf3ab331f61ce3977cfa4 | Python | 18,894 | 458 | from functools import reduce
from typing import List, Tuple, Union
import numpy as np
import torch
from .features import BatchMolGraph, get_atom_fdim, get_bond_fdim, mol2graph
from rdkit import Chem
from torch import nn
from unicore.utils import get_activation_fn
def index_select_ND(source: torch.Tensor, index: torc... |
5b77124ccace25b2514ce6d4dc12f59f1ce770d08136853d93626ffa11d168b3 | Python | 18,897 | 585 | import copy
import os
import platform
from dataclasses import dataclass
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple
import h5py
import numpy as np
import tonic.datasets
import torch
from torch.nn.utils.rnn import pad_sequence
from torch.utils.data import DataLoader, Dataset
__all__ = [
... |
100689ec49013041bbf94f276a85eb72fb04bc91a41f7bbe6e71bfb5046a4a04 | Python | 18,904 | 514 | import logging
import math
import os
import os.path as op
import tempfile
from math import radians
from time import time
import nibabel as nib
from dipy.align import resample
from PIL import Image, ImageDraw, ImageFont
from tqdm.auto import tqdm
import AFQ.utils.streamlines as aus
from AFQ.api.utils import (
AFQc... |
9ee5f2e57253aed6ab4b6a098739cd4f15dac25cf325220f14a8bf25c87a2ab3 | Python | 18,905 | 386 | #!/usr/bin/env python
"""
Camera control specialized for a Point Grey (Spinnaker) camera.
Tested on :
GS3-U3-51S5M
GS3-U3-41C6NIR
Hazen 01/19
"""
import storm_control.sc_hardware.pointGrey.spinnaker as spinnaker
import storm_control.sc_library.parameters as params
import storm_control.hal4000.camera.cameraCont... |
cca747ac73b2b5a51fa8c9db4240b4821fe0f3217a05183d56a738acc82eb5f1 | Python | 18,906 | 498 | """
Copyright 1999 Illinois Institute of Technology
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, publis... |
1bdbb04b56cf45a7699c5e2ca508073ee84ed952f73a0d073cf8e9844e790d81 | Python | 18,910 | 425 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 1 09:16:38 2024
@author: rl05
Perform cluster-based permutation tests on ROI data
"""
import os
import os.path as op
import sys
import pickle
import numpy as np
import math
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
fro... |
d59f0fdf319cbb9c0f411bf7d9c08c01bc94715e0b46e747f91d38e4aa1e3d0e | Python | 18,919 | 551 | #!/usr/bin/env python3
"""
=============================================================================
Austin Dibble
University of Glasgow
2026
neurofm/model.py
Model architecture definition and weight loading for inference.
Training-specific functionality (finetuning, layer freezing, competing
architectures, resu... |
865a3ab080bdacc76945e7ac6ea031e051b98d41a148fa46c45bca07f186bff8 | Python | 18,935 | 465 | from sklearn.manifold import TSNE
from spine_metrics import SpineMetricDataset
from typing import List, Tuple, Set, Dict, Iterable, Callable, Union
from ipywidgets import widgets
from matplotlib import pyplot as plt
import numpy as np
from sklearn.decomposition import PCA
from abc import ABC, abstractmethod
import jso... |
9c21fba1ce84c38823abc0e6f728908a04737e8e3d6910fd4574bd5818a4285a | Python | 18,935 | 581 | import csv
from copy import deepcopy
from pathlib import Path
from typing import TYPE_CHECKING
from uuid import uuid4
import numpy as np
import pandas as pd
import pytest
from eir import train
from eir.data_load import datasets
from eir.data_load.datasets import al_datasets
from eir.data_load.label_setup import al_la... |
d698ae95bf3272d1afa9597e8aa165987f444910d90d15946517a19b6540058c | Python | 18,937 | 468 | import argparse
import os
import shutil
import subprocess
import sys
import time
from datetime import datetime
from multiprocessing.pool import ThreadPool
import numpy as np
import pandas as pd
import torch
import tqdm
from lightning import Trainer
from boda2 import boda
from boda2.boda.common import utils
from boda2... |
9e74157c05802ae057605b7fece9eed84f8e1b7618ba9ca149531365ad27baa0 | Python | 18,942 | 534 | from chemgraph.state.state import MultiAgentState
from langchain_core.messages import HumanMessage
import json
import qcengine
import qcelemental as qcel
import numpy as np
from chemgraph.utils.logging_config import setup_logger
from chemgraph.models.atomsdata import AtomsData
from ase.data import atomic_numbers
logge... |
fac6505efa02b1d42bcb713a52b7b4722e03572b3a19e5d0a11cc37d6dc2a831 | Python | 18,944 | 375 | import os
from typing import Optional
from TOPED_fsl_commands import TOPED # script containing subprocess commands
"""
About this script:
The script is run in Windows and expects files located in windows directories.
This script runs all linux commands as a subprocess using the TOPED class in TOPED_fsl_commands.py... |
ec8c2855ff5274528ddf6ee9f6ab49b6a847d4d1d3032ee9e1b799bff4fff8e5 | Python | 18,947 | 639 | """
Base wrapper for VTK objects.
"""
# Author: Oualid Benkarim <oualid.benkarim@mcgill.ca>
# License: BSD 3 clause
import numpy as np
import vtk
from vtk import (vtkAbstractArray, vtkStringArray, vtkIdList, vtkVariantArray,
vtkDataArray)
from vtk.numpy_interface import dataset_adapter as dsa
from ... |
c4e1803a9e2c62c7abe4143bfb8b1dc26c5a0547836d45e2c687994f2d11d6c8 | Python | 18,958 | 513 | # Copyright 2024 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
8d7b434933e744e735f54f9417f8b2ac743feb9e3a0cad18f0d3bca588f2a732 | Python | 18,960 | 480 | import torch
import torch.nn as nn
from torch import Tensor
import torch.nn.functional as F
from typing import List
from torch.nn.modules.utils import _pair
import math
def get_closest_factors(num):
num_root = int(math.sqrt(num))
while num % num_root != 0:
num_root -= 1
return num_root, int... |
a3cf82312d4c492bf43e5b34ad157e50c30bc744c7707fc3687d1290e0e53eb5 | Python | 18,960 | 422 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 19 15:01:09 2024
@author: rl05
"""
import os.path as op
import numpy as np
import yaml
from itertools import compress, combinations
import matplotlib.pyplot as plt
from tqdm import tqdm
from sklearn.pipeline import make_pipeline
from sklearn.prepr... |
f832eb13050b049a04fb5c5631d409a7d210abc4f328253ba940f623c36c1f9c | Python | 18,962 | 339 | import argparse
import os.path
from copy import deepcopy
from typing import Union, List, Tuple
from batchgenerators.utilities.file_and_folder_operations import (
load_json, join, isdir, listdir, save_json
)
from nnunetv2.configuration import default_num_processes
from nnunetv2.ensembling.ensemble import ensemble_c... |
e42fe1455b6c4bda116e89128d6eec946897ff86848ed7446e0a5d8821e1534a | Python | 18,966 | 605 | import warnings
import logging
from pathlib import Path
import torch.nn
from torch.nn.parameter import Parameter
import torch.nn.functional as F
import torch.autograd as autograd
import flair.nn
import torch
from flair.data import Dictionary, Sentence, Token, Label
from flair.datasets import DataLoader
from flair.emb... |
ebd249af2de0aeb314f451abf2dc4a4dfe0584114f7bd52fce9afc50b63f9e21 | Python | 18,974 | 567 | # Copyright 2024 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
e35a671b62493d32e8da56758ff8036873757b351ea1f16f82b304c197a31466 | Python | 18,975 | 395 | # /------------------------------------------------------------------------------+
# | 18-JAN-2023 |
# | Copyright (c) Bone Imaging Laboratory |
# | All rights reserved ... |
dfe0dec6abba7e2a75a74151fbc8f4c4051f65b2b4d476b7784581fc7b3cd96c | Python | 18,979 | 560 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
from __future__ import annotations
from abc import ABCMeta, abstractmethod
from collections.abc import Callable
from types import NoneType
from typing import TYPE_CHECKING, Any, ClassVar, Protocol
import attrs
import django_rq
from django.conf impo... |
ee4a6274d69c55029bbbb0ca6331828ff059c5e9feab95a37efcb16aeb78f9e2 | Python | 18,979 | 582 | import csv
from copy import deepcopy
from pathlib import Path
from typing import TYPE_CHECKING
from uuid import uuid4
import numpy as np
import pandas as pd
import pytest
from eir import train
from eir.data_load import datasets
from eir.data_load.datasets import al_datasets
from eir.data_load.label_setup import al_la... |
6407c40ae6a0ef7f07823566e9492dfbb4430a7d481fa3f1a3cfa6ffd7a8b4dc | Python | 19,003 | 455 | #!/usr/bin/env python
"""
Base class for controlling a camera.
See noneCameraControl.py or andorCameraControl.py for specific examples.
Note that "slave" cameras are assumed to always be hardware timed.
Hazen 2/17
"""
from PyQt5 import QtCore
import time
import storm_control.sc_library.halExceptions ... |
11b63ec7aaeafb1dee6cbdbb4c516975773bfe141728709be3b9ef8c3541a252 | Python | 19,009 | 486 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import numpy as np
import torch
from torch.nn import (ModuleList, Linear, Conv1d, MaxPool1d, Embedding, ReLU,
... |
3973d824ee93aa0c0325912b32be82b03bae2e7448dc27aa1fc60cf9c9b7ce8d | Python | 19,018 | 504 | """
Module to initialise a bioFAM model
"""
import numpy as np
import scipy as s
import scipy.stats as stats
from sys import path
import sklearn.decomposition
from sklearn.impute import SimpleImputer
from mofapy2.core.nodes import *
class initModel(object):
def __init__(self, dim, data, lik, seed):
"""
... |
906f840d2532fb0e2f298e82645bf829d968ef3c563d64b74a0b26f8090248c3 | Python | 19,023 | 561 | # -*- coding: utf-8 -*-
# Copyright 2024 BDP Ecosystem Limited. 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
#
# Unl... |
c97ac1a0338c9b2a8e797e1722d5552e26f7dbc2609be8d7ade251dc9cbdc1e7 | Python | 19,031 | 287 | from brainvoice.data.estimates_loader_utils import load_beta_estimates, load_latent_variables_estimates, load_CPC_estimates
import argparse
import numpy as np
from tqdm import tqdm
import os
import pandas as pd
from sklearn.preprocessing import RobustScaler
from sklearn.model_selection import KFold, train_test... |
71a2ec43bee122a027b0a24e2410c571b8b34f991306c2f626eae07f327d78be | Python | 19,051 | 460 | """ Transforms Factory
Factory methods for building image transforms for use with TIMM (PyTorch Image Models)
Hacked together by / Copyright 2019, Ross Wightman
"""
import math
from typing import Optional, Tuple, Union
import torch
from torchvision import transforms
from timm.data.constants import IMAGENET_DEFAULT_M... |
406a23288bab6f4fb6b33a66aa11350cf658de8764a038d56df951ead91abdb8 | Python | 19,067 | 521 | # -*- coding: utf-8 -*-
"""
Tractometry
-----------
Global connectivity metrics:
- Computed by default:
- VS: valid streamlines, belonging to a bundle (i.e. respecting all the
criteria for that bundle; endpoints, limit_mask, gt_mask.).
- IS: invalid streamlines. All other streamlines. IS = IC + NC.
-... |
835519d315ab332ecdd7cf93fdd2d770133c01c4507b5caf3e62b2cec1ae57e6 | Python | 19,069 | 535 | """Define routines for reading/structuring input data for DANNCE."""
import numpy as np
import scipy.io as sio
from dannce.engine import ops as ops
from dannce.engine.io import load_camera_params, load_labels, load_sync
import os
from six.moves import cPickle
from scipy.special import comb
from scipy.ndimage import med... |
b1577a97a3291b3e280c005dd57254050dfbe45214c501698b8f68cf580a2c54 | Python | 19,070 | 679 | # Copyright 2017 Calico LLC
# 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... |
ecd53c5ab36f97a001f9846076fca28b901e9e26e24b31db1e18d52007d0d78d | Python | 19,072 | 516 | # -*- coding: utf-8 -*-
import os
import nibabel as nib
import numpy as np
from dipy.io.streamline import load_tractogram
from scilpy import SCILPY_HOME
from scilpy.image.utils import split_mask_blobs_kmeans
from scilpy.io.fetcher import fetch_data, get_testing_files_dict
from scilpy.tests.streamlines import (inter_... |
cfcf82af37847685b6e4143b64b7d938f6c644da017dba53032a16022a84047f | Python | 19,084 | 471 | import glob
import os
import sys
from argparse import ArgumentParser
from datetime import datetime
import numpy as np
import torch
import torch.utils.data as Data
import torch.nn.functional as F
from Functions import generate_grid, Dataset_epoch, transform_unit_flow_to_flow_cuda, \
generate_grid_unit, Dataset_epo... |
cd2da3df9f01e04f51b8548455a26a5177c1634492b38881d30b7e5318802337 | Python | 19,087 | 583 | import os
from typing import Literal, Optional, Sequence
import numpy as np
import nibabel as nib
import matplotlib.pyplot as plt
from nilearn import plotting, surface
def plotSurfaceMap(
M: np.ndarray,
outdir: str,
outname: str,
HCP: bool = False,
# paths mirroring your flatmap code
schaefe... |
d8bd59d2e9fc6e52620100be51764527f7fa0b4fbaffad04a20ba8e9eaeef6aa | Python | 19,120 | 359 | from brainvoice.data.estimates_loader_utils import load_estimate_labels, load_latent_variables_estimates
import argparse
import numpy as np
from tqdm import tqdm
import pandas as pd
from sklearn.preprocessing import StandardScaler, RobustScaler
from sklearn.linear_model import LogisticRegression
from sklearn.metrics i... |
97b0a9944d037565f739f934dd9845d6501f5b97dc94e814714e113e269900e0 | Python | 19,124 | 380 | # /------------------------------------------------------------------------------+
# | 28-OCT-2023 |
# | Copyright (c) Bone Imaging Laboratory |
# | All rights reserved ... |
cf3ca75411ae984a82b529829d856f41abde898d2f44de2190a304caa19d0f99 | Python | 19,126 | 477 | # -*- coding: utf-8 -*-
import itertools
from dipy.io.stateful_tractogram import StatefulTractogram
from dipy.tracking.metrics import length
from dipy.tracking.streamline import set_number_of_points
from dipy.tracking.vox2track import _streamlines_in_mask
from nibabel.affines import apply_affine
from scipy.ndimage im... |
db4b3b3b37135028f33ca9db6ea379f185fc88aea6ae0f00feb3a23b241c11fb | Python | 19,126 | 521 | from types import FunctionType
import torch
from torch import Tensor
import torch.nn as nn
import numpy as np
from . import maxout_conv2d
#from .._internally_replaced_utils import load_state_dict_from_url
from typing import Type, Any, Callable, Union, List, Optional
#modified from torchvision.models.resnet
__all__ = ... |
dd64dcd9c81534da3ed5125e17bd9037f7d72f35adaeca4cd6ae83d9ca4180b8 | Python | 19,128 | 488 | #############################################################################
# Copyright (C) 2020-2025 MEmilio
#
# Authors: Manuel Heger, Henrik Zunker
#
# Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance... |
6455c46675f961c44a79c4e8151932798bf989785f23bfc0efd5aef6e31b10a6 | Python | 19,130 | 459 | #!/usr/bin/env python
"""
Base class for controlling a camera.
See noneCameraControl.py or andorCameraControl.py for specific examples.
Note that "slave" cameras are assumed to always be hardware timed.
Hazen 2/17
"""
from PyQt5 import QtCore
import time
import storm_control.sc_library.halExceptions ... |
a6c0ba8da966f5d11b6ec66f9e0894a4f07828141a8221311a5f62a35d6700b0 | Python | 19,143 | 387 | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.style as style
import matplotlib.gridspec as gridspec
from matplotlib.colors import to_rgb
import numpy as np
import glob2
import os
from scipy.stats import sem
import pingouin as pg
from statannot import add_stat_ann... |
79045c7c2cc9e31b664b95e9b8357c61dba0f6931315dcf3a86a2e379e2ae794 | Python | 19,151 | 518 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
import os
import platform
import re
import socket
import sys
from concurrent.futures import ThreadPoolExecutor
from math import isfinite
from pathlib import Path
from time import time
from ultralytics.utils import (
ENVIRONMENT,
GIT,
LOGG... |
bcf43994f4caa65020597d14a97d1191f11e1ab609e3e10c19bed21f877c20d8 | Python | 19,158 | 563 | from .. import plotting_basics as pb
from .. import data_classes as dc
from .. import data_handling as dh
from sklearn.decomposition import FastICA
from scipy.stats import scoreatpercentile
import numpy as np
import matplotlib as mpl
def storedprop(fn):
attr_name = '_' + fn.__name__
@property
def _lazyprop(self):... |
7e431cfa2a3104fdddaebd14c40925de5738f0a2f452f639565ecdc4daf5207f | Python | 19,159 | 522 | from types import FunctionType
import torch
from torch import Tensor
import torch.nn as nn
import numpy as np
from . import maxout_conv2d
#from .._internally_replaced_utils import load_state_dict_from_url
from typing import Type, Any, Callable, Union, List, Optional
# modified from torchvision.models.resnet
__all__ =... |
3eba49dfd4efba5c41a2aa628177c2cf013431e014524165db7b26c7bddf449d | Python | 19,162 | 455 | #############################################################################
# Copyright (C) 2020-2026 MEmilio
#
# Authors: Kathrin Rack, Wadim Koslow, Patrick Lenz
#
# Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except ... |
266602bf39dfafdd3ff2fa9bbd7706539a48453dd5da694392d45896ffe39902 | Python | 19,165 | 510 | from torchvision.models.convnext import CNBlockConfig
from torchvision.models import convnext as cnx
from typing import List, Optional, Callable, Sequence
import torch
from torch import Tensor, nn
import torch.nn.functional as F
from functools import partial
from torchvision.ops import misc, Permute
from torchvision.op... |
88c3e1f8b4b1daec31b2d4d34c12f491400e641d16a3f8405823ca52d93aa0f3 | Python | 19,178 | 551 | import pandas as pd
import numpy as np
from itertools import combinations, chain
from collections import Counter
import time
from multiprocessing import Pool
from scipy.sparse import csr_matrix, coo_matrix
import scanpy as sc
from anndata import AnnData
from tqdm import tqdm
import networkx as nx
import seaborn as s... |
fc33599030d0e5cd8760bdbf83fe294082395fd2113ab8ed77508c262dfb4b73 | Python | 19,182 | 528 | # Kai Sandbrink
# 2023-04-27
# This script analyzes Prolific Participants with different efficacy
# %% LIBRARY IMPORTS
import numpy as np
import pandas as pd
import os, ast, glob
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
from utils import format_axis, get_timestamp
from human_uti... |
f6a1955791c1149057f13f0ee89958f2de9ed89b4cb74e1bccd3beaddc220df0 | Python | 19,192 | 501 | # -*- coding: utf-8 -*-
"""
D-P rule in zebrafish with anatomical pehnotype ontology
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
import warnings; warnings.simplefilter('ignore')
from scipy.stats import mstats, kstest, ttest_ind, fisher_exact
import csv
... |
613843a106d0290af424b1d88e829326378f5dd030923beaea54a2a81014e91c | Python | 19,194 | 482 | """Resource-aware parallel execution helpers for the pipeline.
The pipeline has two very different parallelism profiles, and a single
"number of workers" knob would be wrong for both:
* **Step 1 (spike detection) is RAM-bound.** Each recording's raw ``dat``
array is ~3.8 GB in memory (64 ch x 7.5M samples x float64... |
0029cb1954be8f40f00e7e2085c9c85201d2052a358a49260fc10eaa2e8b2b60 | Python | 19,206 | 366 | from zigzag.classes.hardware.architecture.memory_hierarchy import MemoryHierarchy
from zigzag.classes.hardware.architecture.memory_level import MemoryLevel
from zigzag.classes.hardware.architecture.operational_unit import Multiplier
from zigzag.classes.hardware.architecture.operational_array import MultiplierArray
from... |
7cd6e4520908b78add1058bfce7ab519ef578e9f0db8a458700ad8ce96c2581e | Python | 19,209 | 661 | from collections.abc import Callable, Generator, Iterable, Sequence
from dataclasses import dataclass
from functools import lru_cache, partial
from typing import (
TYPE_CHECKING,
Any,
Protocol,
)
import numpy as np
import torch
from timm.data.mixup import rand_bbox
from torch import nn
from eir.data_load.... |
7e0057fba43e054d9bbdba577f18eee7ea809d4f541910b726a3d3ad3e82aa7f | Python | 19,228 | 457 | # mat_to_tfrecord.py
# Nick Card, July 2023
import os
import re
from pathlib import Path
import numpy as np
import scipy.io
import tensorflow as tf
from g2p_en import G2p
import matplotlib.pyplot as plt
import os
import json
PHONE_DEF_SIL = [
'AA', 'AE', 'AH', 'AO', 'AW',
'AY', 'B', 'CH', 'D', 'DH',
'E... |
f28318297171090e917b4754a22e98b0b746f831f1030ce24ad33fedf6accd9a | Python | 19,248 | 553 | import time, datetime
import random
import sys
import logging
from pathlib import Path
from typing import Union
from torch import cuda
from torch.utils.data import Dataset, DataLoader
from torch.optim.sgd import SGD
try:
from apex import amp
except ImportError:
amp = None
import flair
from flair.data import ... |
467a0c3862e272977101d62993dfe3025089c72ebf6c317a71ce9334c6b73e43 | Python | 19,250 | 705 | # Copyright (c) 2019 Primoz Ravbar UCSB
# Licensed under BSD 2-Clause [see LICENSE for details]
# Written by Primoz Ravbar
#This file contains functions used with ABRS
#Last updated: 01/06/2020
import numpy as np
import scipy
from scipy import ndimage
from scipy import misc #pip install pillow
import pickl... |
61b3a66d0285934374827f4935f69574fdff6e5e071aa379981993df29f617a4 | Python | 19,254 | 526 | '''
Time‐Resolved Bayes Factor Analysis on Source‐Localized MEG Data
----------------------------------------------------------------
This script loops through participants and experimental conditions in a 2×2 design (A × B),
loads source‐localized MEG time series (as MNE SourceEstimate files), crops to a time window
... |
92f866ada43fa6a6da949ca13ae10965ba1a3d8ba231270d02f1273821488f57 | Python | 19,254 | 555 | import torch
from torch import nn, einsum, Tensor
import torch.nn.functional as F
import math
from einops import rearrange, repeat, reduce
from einops.layers.torch import Rearrange
from inspect import isfunction
# highly inspired by the following repositories:
# https://github.com/lucidrains/alphafold2
# https://githu... |
ebdec2c271cddd924f595bae6aa11c8b08e73b202759016ba2bb3f762637ead5 | Python | 19,257 | 318 | import json
import os.path
import shutil
from pathlib import Path
from typing import List
import numpy as np
import pandas as pd
import dtiplayground.dmri.common as common
import dtiplayground.dmri.fiberprofile as base
import dtiplayground.dmri.common.fibers as fibers
logger = common.logger.write
TENSOR_PROPERTIES ... |
c1063f2f22d145457768b6faceb35f32d86168f096455443a90b18e61f8dde8e | Python | 19,259 | 543 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import csv
import io
import math
from collections.abc import Generator, Sequence
from datetime import timedelta
from itertools import product
from pathlib import Path, PurePosixPath
import pytest
from cvat_sdk import exceptions, models
from cvat_sdk... |
dcc51d5cdf436cdad07d463022b0fd304546f79768873d413eef42b4e5136ac4 | Python | 19,267 | 537 | import numpy as np
import pandas as pd
from functools import reduce
from scipy.stats import chi2, cauchy, beta
from heig.wgs.pvalue import saddle2
from heig.utils import find_loc
class VariantSetTest:
def __init__(self, bases, var, perm, voxels):
"""
Variant set test for rare variants
Pa... |
db65beeba7b2c02321ee91452ce4fa2206cb07ed7aacbe660b8619da55733f26 | Python | 19,274 | 426 | # /------------------------------------------------------------------------------+
# | 09-MAR-2023 |
# | Copyright (c) Bone Imaging Laboratory |
# | All rights reserved ... |
6e36a57ad74bacb7dc6510edd6c902cf8c233516e564f22b3b34bf20ce59eb65 | Python | 19,299 | 455 | #!/usr/bin/env python3
"""
Eye Movement Detector using Deep Lightweight CNN (DLCNN)
Binary classifier for detecting eye movement artifacts in EEG data.
Uses a lightweight 1D-CNN architecture with focal loss for class imbalance.
Authors: Evans Nyanney, Parthasarathy D Thirumala, Shyam Visweswaran, Zhaohui Geng
Year: 2... |
f0d2269cb829d015249557015baf660496ab7b801a970f39571e46054443e4db | Python | 19,299 | 518 | import unittest
import logging
import numpy as np
import pandas as pd
import scipy.stats as stats
import diffxpy.api as de
class _TestSingleNull:
def _test_null_distribution_wald(
self,
n_cells: int,
n_genes: int,
noise_model: str
):
"""
Test i... |
272b4c5ba6ccba8de8b923d8601a21948fcca99e8b0ce4a1f3daa8f2f54e68bf | Python | 19,307 | 535 | """
Classes for index files that map genomic intervals to values.
:Authors: James Taylor (james@bx.psu.edu), Bob Harris (rsharris@bx.psu.edu)
An interval index file maps genomic intervals to values.
This implementation writes version 1 file format, and reads versions 0 and 1.
Index File Format
-----------------
Al... |
2c2b5d4d87c7ca7c768f5a6a7c207dcbc2f21173e2e292876ebf5ed868f07650 | Python | 19,325 | 558 | """Atomistic LIne Graph Neural Network.
A prototype crystal line graph network dgl implementation.
"""
from typing import Tuple, Union, List
import dgl
import dgl.function as fn
import numpy as np
import torch
from dgl.nn import AvgPooling
# from dgl.nn.functional import edge_softmax
try:
from pydantic.typing im... |
beca22e303345d751126b6bf20a2b809289af782800935d9d56cb4c3f76c1e55 | Python | 19,325 | 558 | """Atomistic LIne Graph Neural Network.
A prototype crystal line graph network dgl implementation.
"""
from typing import Tuple, Union, List
import dgl
import dgl.function as fn
import numpy as np
import torch
from dgl.nn import AvgPooling
# from dgl.nn.functional import edge_softmax
try:
from pydantic.typing im... |
831056b840901df608483c5f98915093bb1c1df8035771eacf8d96308c70dec0 | Python | 19,334 | 497 | import datetime
import os
from chemgraph.tools.openai_loader import load_openai_model
from chemgraph.tools.alcf_loader import load_alcf_model
from chemgraph.tools.local_model_loader import load_ollama_model
from chemgraph.tools.anthropic_loader import load_anthropic_model
from chemgraph.tools.gemini_loader import load_... |
37ef18b44da359a83b0983a0c8e16009567021869954fbfb16f0c797eb69c110 | Python | 19,336 | 574 | import json
from argparse import Namespace
from collections.abc import Callable, Iterable, Sequence
from copy import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Literal
import numpy as np
import polars as pl
from aislib.misc_utils import ensure_path_exists
from lightning.fabric i... |
44067c5a16a3a9a1ab142514261018282089987beb65a52f4a5d2153d1d56271 | Python | 19,336 | 470 | import glob
import os
import sys
from argparse import ArgumentParser
from datetime import datetime
import numpy as np
import torch
import torch.utils.data as Data
import torch.nn.functional as F
from Functions import generate_grid, Dataset_epoch, transform_unit_flow_to_flow_cuda, \
generate_grid_unit, Dataset_epo... |
914ae9a29f73c9fc7a95849260a5805be2bd8937003f7f5a0e852a4535362ca0 | Python | 19,339 | 380 | # Copyright (c) 2026 Rohit Jena. All rights reserved.
#
# This file is part of FireANTs, distributed under the terms of
# the FireANTs License version 1.0. A copy of the license can be found
# in the LICENSE file at the root of this repository.
#
# IMPORTANT: This code is part of FireANTs and its use, reproduction, or... |
7286de4223d78cd393f68c58c88db90406487dbf8ba22e63663093aa4f4dc1f7 | Python | 19,341 | 252 | # -*- coding: utf-8 -*-
"""
Created on Fri May 21 11:00:57 2021
@author: Yoshi
"""
import os
program_path = os.getcwd()
os.chdir(f"{program_path}/motion_corrector")
from motion_corrector import *
os.chdir(f"{program_path}/data_extractor_subtraction")
from data_extractor_subtraction import *
os.chdir(f"{program_pa... |
fb0158637251e99c0af0e3747aa6aef13877e6ee794fe98abefa5049f7153eab | Python | 19,345 | 445 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import platform
from copy import deepcopy
from pathlib import Path
from typing import Any
import numpy as np
import torch
from torch import nn
from ultralytics.utils import LINUX, LOGGER, WINDOWS
from ultralytics.... |
242c69073fb391032e47ca13bb12a155b40eb3dd8de07b1228e7ae2c5df3e7f4 | Python | 19,353 | 555 | import numpy as np
from .. import compute
from ..base import BasePLS, gen_bootsamp
from ..structures import _pls_input_docs
def resid_yscores(x_scores, y_scores, copy=True):
"""
Orthogonalizes `y_scores` with respect to preceding `x_scores`
Residualizes each column of `y_scores` against all previous col... |
034a6d8b6c1105df8647e70fd8f44f446a59c28bf844b19ab8335f6ad05ee245 | Python | 19,354 | 473 | """Figures for the CAT-NAP cell-type subnetwork analysis.
Two families, matching the two questions the analysis answers:
*Graphs* — where the subnetworks sit in the field of view.
- :func:`plot_subnetwork_spatial` — the whole network, nodes coloured by cell
type and edges coloured by whether they stay within a ... |
7647d6b69cb0eebf4b44a047b75dc76fa5b57ef041ac7f9ae18571b63bb90398 | Python | 19,360 | 603 | """
Advanced Visualization Module for PAH Removal Analysis
Author: [Your Name]
Date: 2025
Description: 3D plots, violin plots, surface plots, and other advanced visualizations
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from mpl_toolkits.mplot3d import Axes3D
from m... |
cabc1ccf342015e46a02d4f4eb2bd52d47f36d7523ad1d641b5ba39552ad6cc9 | Python | 19,362 | 507 | import json
import logging
from collections import Counter
from dataclasses import asdict, replace
from pathlib import Path
from typing import TYPE_CHECKING, Callable, Iterator, List, Optional, Tuple, Union
import dacite
import numpy as np
import pandas as pd
from PIL import Image
from brainways.pipeline.brainways_pa... |
c4890f2981d00717d756bdfed715b2ebe2bc7ca33e6fd0e8352d16387933bdf0 | Python | 19,370 | 491 | """ Relative position embedding modules and functions
Hacked together by / Copyright 2022 Ross Wightman
"""
import math
import os
from typing import Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from .grid import ndgrid
from .interpolate import RegularGridInterpolator
from .mlp i... |
c2ccc57d4824be6e7e96512e3eb4586564aba602f0f30f69b103366afe7d273f | Python | 19,371 | 597 | import os, math
import numpy as np
import bpy
import mathutils
def angle2rad( theta, unit ):
return math.radians(theta) if unit=='DEG' else theta
def rad2angle( theta, unit ):
return math.degrees(theta) if unit=='DEG' else theta
def expand_rgb( rgb, alpha=True ):
if np.isscalar(rgb):
rgb = 3*(rgb... |
315d0ea6a1a637840cfe4139bfd7e75a6676299cbae817fdfc32b5d2fd24739c | Python | 19,375 | 565 | #!/usr/bin/python
#
## @file
#
# Class for rendering multiple images in taken at different magnifications.
# This is used by the steve software and others for image display.
#
# Hazen 07/13
#
import pickle
import numpy
import os
from PyQt5 import QtCore, QtGui, QtWidgets
## MultifieldView
#
# Handles user interacti... |
639300317f4326ed3ace0d38b803df1f3b875961fd21f045c3ba82397c603259 | Python | 19,379 | 458 | import os
from pathlib import Path
from argparse import ArgumentParser
from typing import Union, Tuple, Dict, List
import json
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
from brainscore_core.supported_data_standards.brainio.assemblies import NeuroidAssembly
from brainscore_core.supported_data_s... |
12c9e9846195f9c8c1af82bf60f981863f5f479900671d2e4609aa59b2974e12 | Python | 19,388 | 367 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 28 21:27:06 2024
@author: Administrator
"""
import os
import yaml ... |
25fdeb0491a2a8251e5ef59b8218375c5bdf274e7b5b5d3fa6f6bc56b858c7a9 | Python | 19,393 | 438 | # /usr/bin/env python
import glob
import os
import subprocess
import plotting.configure_seaborn as cs
import matplotlib.colors as mcolors
import matplotlib.lines as mlines
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import utils as utils
from matplotlib.gridspec import GridSpec
from matpl... |
8937fe092cab7e81146d99f0e7f49b21992139a3d7bcc4e49c57b95052bef37c | Python | 19,393 | 585 | # Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved
# 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 datetime
import functools
import io
impor... |
26f3aeed3eec15136d1204770008e6d5fdd01e43b1049a469eaac6fd86192ca7 | Python | 19,394 | 589 | import os
import logging
import h5py
import numpy as np
import pandas as pd
import scipy.sparse as sp
from tqdm import tqdm
from heig.utils import inv
from scipy.sparse import csc_matrix, csr_matrix, dok_matrix, hstack, eye
from sklearn.decomposition import IncrementalPCA
from scipy.interpolate import make_interp_splin... |
2322ca942ab89dc94ee6b7ac3ef13198bd58e1d570771874e5937f9a35e7063f | Python | 19,404 | 437 | import torch
import torchvision
import torchvision.transforms as T
from torch.utils.data import DataLoader
import os, sys, math
from copy import deepcopy
import numpy as np
import h5py
import gc
from EIANN import Network
from EIANN.utils import (read_from_yaml, write_to_yaml, analyze_simple_EIANN_epoch_loss_and_accura... |
45b4ef231b8a79352173489aaa59b6433893e7a534f7018ee00ffbbba5e6b2c6 | Python | 19,406 | 412 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 23 15:14:58 2025
@author: loesch
"""
from chiCa import *
import chiCa
import pandas as pd
import numpy as np
#from scipy.stats import pearsonr
from labdatatools import *
import os
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "Arial... |
63c3bd1311490829289436e8232cf71ea53761cc0d4964abf0569f9eceeef301 | Python | 19,408 | 443 | # Copyright (c) 2026 Rohit Jena. All rights reserved.
#
# This file is part of FireANTs, distributed under the terms of
# the FireANTs License version 1.0. A copy of the license can be found
# in the LICENSE file at the root of this repository.
#
# IMPORTANT: This code is part of FireANTs and its use, reproduction, or... |
071c579d48fa1f39481281a6ddbe2c2a398d1c747342de0714d40f367dd1c2df | Python | 19,413 | 584 | # wfield - tools to analyse widefield data - utils and general imports
# Copyright (C) 2020 Joao Couto - jpcouto@gmail.com
#
# 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 3 o... |
d8a3f70590538b7104348f588637d7ab328ace9bc8ad9f5b417888f4171cb895 | Python | 19,421 | 506 | #Lucas Sancéré
import os
script_dir = os.path.dirname(os.path.abspath(__file__))
import numpy as np
import xgboost
import yaml
from attrdictionary import AttrDict as attributedict
from scipy.cluster.hierarchy import fcluster, linkage
from scipy.spatial.distance import squareform
from sklearn.metrics import balanced... |
26841cef813d759fffadfcf6831de047ef4b16244ace6679719095d7b533e282 | Python | 19,443 | 425 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 12 15:34:09 2025
@author: Lukas Oesch
"""
from chiCa import *
import chiCa
import pandas as pd
import numpy as np
from scipy.stats import pearsonr
from labdatatools import *
import os
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "Arial"
import matplotlib... |
3eb0a129d8ecdeec4603820e3bc2e90baa908d4636b58cb2c10c3ab79f7482f0 | Python | 19,451 | 552 | from functools import partialmethod
import torch.nn as nn
import torch.nn.functional as F
from ..layers.spectral_convolution import SpectralConv
from ..layers.spherical_convolution import SphericalConv
from ..layers.padding import DomainPadding
from ..layers.fno_block import FNOBlocks
from ..layers.mlp import MLP
fro... |
ca24d31a3ff17a2a20cbca592a3ce6f99f23d267fb2bb26494b6e9b42dce0de9 | Python | 19,461 | 570 | """
This file contains several helper functions to manipulate 1D and 2D EEG data.
"""
import logging
import numpy as np
from numpy.lib.stride_tricks import as_strided
from scipy.interpolate import interp1d
from scipy.special import erfinv
logger = logging.getLogger("yasa")
__all__ = ["moving_transform", "trimbothst... |
da66df0b3eb0b0d013d2ad3b07f13fda0684968503b9cc258d98402a9bbe2bf2 | Python | 19,466 | 534 | #!/usr/bin/env python3
"""
Usage: ./autism-sheets.py filepath --sheet_name
Author: Mei Wu, https://github.com/projectoriented
"""
import os.path
import sys
import logging
import argparse
import glob
import pandas as pd
import numpy as np
import pysam
from google.auth.transport.requests import Request
from google.oau... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.