sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
bbf4c7d1be7d66a90ba3f3e8dc1d62cd2c3f2191700b60c0ee5271782f261b3a | Python | 30,114 | 731 | """I/O helpers for MEA-NAP pipeline files.
Reads raw recordings in three layouts, so users don't have to pre-convert
anything to MATLAB before running the pipeline:
* ``.mat`` v7.3 (HDF5) holding ``dat``/``channels``/``fs`` — what
``convertMCSh5toMat.m`` and the Axion converter write for large recordings
* ``.mat``... |
b5ada489b5d22bd0f7027607758cb30bb550a9c48432fe31debcdddc53ccef86 | Python | 30,120 | 634 | '''
This script performs a subject-level encoding analyis of the
representational similarity of the percepts during our learning
task.
In brief, we compute observed similarities of the percepts and
targets/alternatives as well as hypothesis similarities (based
on raw audio, top-k expected audio, and semantics, utili... |
96e8aaabf619641ceb67d163df3e208e6162e26b041731f2dd6375047dd2398d | Python | 30,133 | 689 | # train_utils.py
import os
import glob
import logging
import random
import numpy as np
import pandas as pd
import torch
import scanpy as sc
import seaborn as sns
import matplotlib.pyplot as plt
from tqdm import tqdm
from captum.attr import IntegratedGradients
logger = logging.getLogger(__name__)
def setup_logging(con... |
98ff3344dd3a5dd66305768bcc5e5739b05f77c2b98279f903a2d23848247e40 | Python | 30,146 | 619 | import pandas as pd
import numpy as np
import json
from pathlib import Path
import random
from skimage import measure
from scipy.ndimage import zoom
from skimage.transform import resize
from scipy.ndimage import gaussian_filter
from scipy.spatial.distance import cdist
from sklearn.preprocessing import MinMaxScaler
impo... |
065b696f4c3308e8c72eb9fc71f644bc4e87ebd0b80b49872f83e67ff61c409b | Python | 30,176 | 679 | import collections
import logging
import os
from os.path import join, basename, isdir
import shutil
import sys, random, time
import tarfile
import matplotlib.pyplot as plt
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import pandas as pd
import tensorflow as tf
import... |
ee063419636445852fdda8733d1a365cc23528cbf80c1bec7cfa53ba27de77d0 | Python | 30,178 | 649 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""
Benchmark YOLO model formats for speed and accuracy.
Usage:
from ultralytics.utils.benchmarks import ProfileModels, benchmark
ProfileModels(['yolo26n.yaml', 'yolov8s.yaml']).run()
benchmark(model='yolo26n.pt', imgsz=160)
Format ... |
59aad104de8dd3c40a98ad9cec39426eca7118f574ee0da7087952ae2cf96b9e | Python | 30,181 | 864 | """Dynamic Network States (DyNeStE).
See the :doc:`model description </models/dyneste>` for more details.
"""
import logging
from dataclasses import dataclass
from typing import List, Literal, Optional, Tuple, Union
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.keras... |
f844bb03945f71495ad7a7590ff3f6b8c0acb56509ab7ba6b482f7e5c44a40e8 | Python | 30,188 | 697 | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'mainwindow.ui'
##
## Created by: Qt User Interface Compiler version 6.4.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################... |
56e117a64e743fd402c15f223c644605e572b53afca8140192217bba544ebfdf | Python | 30,212 | 557 | # Good pipeline:
# + is aware of local storage area (/scratch or TMP)
# + can be customezed to use permanent storage for all temporary files - this helps debugging
# + saves the results to the permanent storage as soon as they became available
# - allow to specify timeout for potentially long system calls
# + produce ... |
a6988d0a5a3b20edc9bd4af140dc1cad545fdc9dfcc86c7171ea00e244ddf07a | Python | 30,254 | 704 | import sys
import os
import pandas as pd
import numpy as np
import pyreadr
import torch
import glob
import functools
import random
import torch_geometric.transforms as T
import torch.nn.functional as F
import yaml
from math import ceil
from torch_geometric.data import InMemoryDataset, Data
from torch_geometric.loader i... |
07890c036df9fa3f06fb17986635ade9824648a8106c5959ec6e07b66b144f39 | Python | 30,256 | 554 | import datajoint as dj
import numpy as np
import itertools
from scipy import ndimage
from itertools import product
from staticnet_analyses import base
from staticnet_analyses.base import MEIMask
from staticnet_experiments import configs, models as static_models
from neuro_data.static_images import data_schemas, stats
f... |
66a9197a9ce0095b5f085a592419456ee22950db1b6a53acd7a9de7c68cd9628 | Python | 30,261 | 877 | # Copyright (C) 2018-2022 Intel Corporation
# Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
"""
Django settings for CVAT project.
Generated by 'django-admin startproject' using Django 2.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the fu... |
1f476be62715bd5e40774d182c56bdefaa0284f3c00c5ee3e45e5f38f471fbf5 | Python | 30,277 | 588 | from copy import deepcopy
import os
import sys
import json
import warnings
warnings.filterwarnings("ignore")
import math
import time
import random
import pickle
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
from torchvision impor... |
ffe1ed998fd0a793f229ff314a4073708e538ae208de4dc570531093f22be832 | Python | 30,287 | 704 | import torch
torch.multiprocessing.set_sharing_strategy('file_system')
import matplotlib
matplotlib.use('Agg')
import os
import os.path as osp
from torch.utils.data import DataLoader
import sys
os.chdir('/project/roysam/rwmills/repos/cluster-contrast-reid/')
print(os.getcwd())
# print(os.listdir())
import os #RWM... |
9aa2a1d33eb2adede826413710c83f0a242c9ee2f966619797373cf8b2ba5873 | Python | 30,330 | 789 | from enum import IntEnum
import numpy as np
from scipy import ndimage
import scipy.ndimage, scipy.spatial
import warnings
import cv2 as cv
from pathlib import Path
from typing import Tuple, Union, Optional, List, Dict
from dataclasses import dataclass, field
from ._utils import load_npz
from ._exception import BreadExc... |
4dd8eb9a481e50c2db2d7697540e7b92562c20e82541c3446b1c3885290a63f1 | Python | 30,369 | 915 | """Multi-agent workflow using the LangGraph Send() (map-reduce) pattern.
Architecture
------------
Main graph (``PlannerState``)::
Planner --condition--> Send(executor_subgraph, task1..N) --> Planner
|-> ResponseAgent --> END (when structured_output)
|-> END ... |
fb9ac0c60771039e35d1523f769d31246a2d8b00b0c5f2939d8edfef7e963828 | Python | 30,374 | 682 | # -*- coding: utf-8 -*-
import os
import re
import sys
def find_reference_pcr_file(ref_pcr_name, root_dir):
ref_path = os.path.join(root_dir, 'dat_vestacif_files', 'reference_pcr_format', ref_pcr_name)
if os.path.exists(ref_path):
print("Found reference PCR in reference_pcr_format folder: {}".format(... |
e667ff16319fe4a58cbf2ec484aa060d5554dd998a5e989e9a565e9af14a2ca6 | Python | 30,375 | 879 | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 18 17:02:40 2021
@author: li
"""
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from torch import optim
import torchvision
import math
from matplotlib import pyplot as plt
import cv2
Device = torch.device('cuda')... |
f574703596cc0b6edd850338eb37434dc8d0e6789de216ddc497aa02e84b0dab | Python | 30,403 | 816 | # 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, ... |
93bcfbbd5013beb8c8a33685246518d7216c7349c05028987e666d51bd8ad358 | Python | 30,420 | 775 | # Author: Oualid Benkarim <oualid.benkarim@mcgill.ca>
# License: BSD 3 clause
from itertools import product as iter_prod
import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from .base import Plotter
from .colo... |
cabc5d6cb0afa51f62c07382cbd45c88a4c3dfdc845234a47b88e8555e917440 | Python | 30,424 | 640 | '''
This script performs a subject-level encoding analyis of the
representational similarity of the percepts during our learning
task.
In brief, we compute observed similarities of the percepts and
targets/alternatives as well as hypothesis similarities (based
on raw audio, top-k expected audio, and semantics, utili... |
89f5a91ae0e1d1fd395b12dc5c0a253066e5eb6e23c2a8afe68cef9963c297ec | Python | 30,433 | 673 | # 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
... |
2ff62c7b5da562d3331f1bc4e8144cff0602177423abbb0f76cb8252da8c275b | Python | 30,437 | 733 | # -*- coding: utf-8 -*-
"""
Demo script for the EMPRISE analysis pipeline
Joram Soch, MPI Leipzig <soch@cbs.mpg.de>
2024-04-04, 11:29: settings, loading, simulate
2024-04-04, 17:58: analyze, processing, visualize
2024-04-05, 09:12: processing, visualize, figures
2025-10-02, 14:49: replaced R²>0.2 by p<0.05 (Bonferroni... |
fc76be2ab9299290dfb1bb883dffc26cfbed258edbaf3c47acb419e67c1bdf95 | Python | 30,449 | 941 | # Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved
import json
import os
import subprocess
from pathlib import Path
import cv2
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pycocotools.mask as mask_utils
import torch
from matplo... |
39eb242e64a6b6cdd6ad4551a4a61c665f4db48502690642b42f7c11044ca201 | Python | 30,550 | 678 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
import io
import shutil
import sys
import threading
import time
from contextlib import redirect_stderr, redirect_stdout
from itertools import product
from pathlib import Path
from types import SimpleNamespace
import pytest
import torch
from tests im... |
31b07ecdfd170f8dd4b2f60feb8c587819e6947ef62645863ec3f2234a648d2a | Python | 30,563 | 625 | #%%
# interactive window settings
%reload_ext autoreload
%autoreload 2
import numpy as np
from scipy import ndimage
import pandas as pd
import matplotlib.pyplot as plt
import re, seaborn as sns
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning) # turn off warning messages
... |
dc25ee7ef372b1c97f52d6509d4c36701c9b84eec46d8f47090c604efa35d559 | Python | 30,637 | 775 | # -*- coding: utf-8 -*-
import itertools
import logging
import multiprocessing
import numpy as np
from dipy.core.sphere import Sphere
from dipy.direction.peaks import peak_directions
from dipy.reconst.odf import gfa
from dipy.reconst.shm import (sh_to_sf_matrix, order_from_ncoef, sf_to_sh,
... |
233b4184d6c0e2c7c5e8c3cd4b2dabacaf3b1117d7055f0243c3daa91fc01a63 | Python | 30,640 | 735 | #!/usr/bin/python
"""
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, mo... |
f91eb5543deca49da4eac2a1b89fe094f134abd841da3ee1133153d249287cc8 | Python | 30,687 | 1,012 | import json
import os
from collections import OrderedDict
from collections.abc import Callable, Generator, Iterator, Sequence
from copy import deepcopy
from dataclasses import dataclass
from functools import partial
from pathlib import Path
from typing import (
Any,
Literal,
Protocol,
cast,
overload... |
c4dc9fbe8cbd6f8b06ff7c96a2577fb9a02590a37c0448eaf37bc0a763e463b9 | Python | 30,690 | 1,012 | import json
import os
from collections import OrderedDict
from collections.abc import Callable, Generator, Iterator, Sequence
from copy import deepcopy
from dataclasses import dataclass
from functools import partial
from pathlib import Path
from typing import (
Any,
Literal,
Protocol,
cast,
overload... |
58c191f71c810806f3ab15a7f28bd845184963c5855c416933e054d30199512c | Python | 30,716 | 625 | import torch
import torch.nn as nn
import torch.nn.functional as F
from itertools import combinations
from functools import reduce
import operator as op
from backbones import (
resnet18, resnet34, resnet50,
resnet101, resnet152
)
def prototype_loss2d(logits, y_true, model, similarity_scores, class_weights,
... |
07020ec4373904ea34d4b4db93ecd342f79866c82f46903449028fdbf80ca1a8 | Python | 30,738 | 885 | import numpy as np
import pytest
from nelpy.utils import (
PrettyBytes,
PrettyDuration,
PrettyInt,
find_nearest_idx,
find_nearest_indices,
find_threshold_crossing_events,
frange,
information_rate,
is_odd,
is_sorted,
linear_merge,
nextfastpower,
nextpower,
pairwis... |
0390687fb80e218ae3a8a6a6a2e32e78ddce6a4f0a206adb0fb0a2e55a778188 | Python | 30,742 | 874 | # 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, ... |
24cb7a9da8459b86a16b2682e4037d7a0eafde3891717ddde1264a7fec43ec88 | Python | 30,742 | 748 | import os
import numpy as np
import pandas as pd
from scipy.stats import pearsonr
from sklearn.model_selection import KFold
import time
import copy
import torch
import torch.nn as nn
import networkx as nx
import plotnine as p9
from plotnine.stats.stat_summary import mean_cl_boot
import sys
lem_bas_dir = os.path.abspat... |
450e6c700883dfea282fbec27971b9cd6d7adaa06192e67af537ee6dac9adb12 | Python | 30,860 | 778 | """
Configuration file for the Sphinx documentation builder.
For the full list of built-in configuration values, see the documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
For the full list of extension configuration values, see respective sites.
"""
import inspect
import os
import sys
from ... |
ff5240abbc40e062b791debb6f378b01f2e29a90ba1043a04bead760aade65ea | Python | 30,878 | 870 | """Data preprocessing objects and functions."""
import logging
from copy import (
copy as copycopy,
) # to avoid name clash with local copy variable in StandardScaler
from functools import wraps
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.preprocessing import StandardScaler as SklearnS... |
627a9d28388425039e834beb0fd82eb3e976124bb497a69fc7dcb5c00d313306 | Python | 30,884 | 937 | # -*- coding: utf-8 -*-
"""
Utility operations provided for scil_volume_math.py
and scil_connectivity_math.py
They basically act as wrappers around numpy to avoid installing MRtrix/FSL
to apply simple operations on nibabel images or numpy arrays.
Docstrings here are NOT typical docstrings: they are the doc printed w... |
94ad7b20054308cfb8151dcf36d0fcc739c00642996c10a7ec646333ad510e3e | Python | 30,909 | 829 | import torch
import torch.nn as nn
import time
import torchvision
from torchvision import datasets, transforms
import random
import matplotlib.pyplot as plt
import math
import torch.nn.functional as F
import numpy as np
###################################################################################################... |
2982a1c5c37f05c8f285cb0d8d3f4add53297513557a38a3a7f9d8170ec24337 | Python | 30,912 | 706 | """
Core batch alignment processor.
Handles the complete workflow from loading data to training models and processing batches.
"""
import json
import time
import math
import logging
from pathlib import Path
from typing import Dict, Any, List, Optional
import numpy as np
from config import resolve_marker_indices
from ... |
a8a2765e308f467d5940918aa76d3b1df99db2b88b7466ab803948aba2ca0f30 | Python | 30,926 | 765 | import numpy as np
import h5py
from scipy.stats import spearmanr, pearsonr
from sklearn.metrics import mean_squared_error
import pandas as pd
from os.path import basename
from os.path import join
import glob
import shap # shap must be imported before keras
import tensorflow as tf
from tensorflow import GradientTape
fro... |
3552d0add0301ac5e4f3084dd080253781d6b4f3f339668c05920446cc20b205 | Python | 30,936 | 853 | from pathlib import Path
import os
import re
import csv
from typing import Callable, List, Tuple, Dict, Union, Optional
from tqdm import tqdm
import matplotlib.pyplot as plt
import time
import logging
import tifffile
import torch
import torch.nn as nn
import numpy as np
import yaml
from skimage.filters import threshol... |
a6f22ac565c86f3d5d1a2ca3c63e1e40349dc6e01e0c95b2b2cb695e1672c77a | Python | 30,940 | 1,005 | from __future__ import annotations
import json
import os
import shutil
import stat
from collections.abc import Callable
from pathlib import Path
from typing import Any
from typing import TextIO
import numpy as np
import pytest
from numpy.typing import NDArray
from labelme._label_file import Annotation
from labelme._... |
456a6e4409cb7dffc9971df6a05616d3619325b3970491570eab9870ab1d5207 | Python | 30,950 | 743 | import os
import numpy as np
from numpy.linalg import LinAlgError
from scipy import interpolate
from tqdm import tqdm
import datajoint as dj
from pprint import pformat
import warnings
from collections import defaultdict
from neuro_data.static_images import data_schemas
from neuro_data.static_images.data_schemas import ... |
15ef01ab236d2ed6304a85d5fbccfa39a2e01e9cb56de0c521a26f9024e95599 | Python | 30,967 | 755 | # -*- coding: utf-8 -*-
"""
Created on %(date)s
@author: %(PV)s
"""
import pandas as pd
import numpy as np # fundamental package for scientific computing, handles arrays and math
import matplotlib
import matplotlib.pyplot as plt # standardd Python plotting library
from matplotlib.ticker import MaxNLocator # so we... |
d329c8b7c794a85f0c08cd0f8eb10cf6f31d1b4858fafa71355b1c987d439940 | Python | 30,978 | 855 | import pickle
from collections import defaultdict
from pathlib import Path
from typing import Any, Optional
import numpy as np
import obspy
import scipy.stats
import torch
from obspy import UTCDateTime
from obspy.clients.fdsn import Client
from obspy.geodetics import locations2degrees
from obspy.taup import TauPyModel... |
9ad1871cd5582071863390ca012f61bda42217e14813aace67922f65848169bc | Python | 30,992 | 726 | """ Contrastive Losses
Usage:
run_CL.py train --data=<name> --dir=<name> [--load_path=<name> --config=<name>]
run_CL.py plot --data=<name> --dir=<name> [--load_path=<name>]
Options:
-h --help Show this screen.
"""
import os
import time
from docopt import docopt, DocoptExit
import sys
os.environ['TF_CPP_MI... |
f74bcb49e84a7e1e10ee4cd0c3b780bcf20b83fa649b6628fb484b4e03694be5 | Python | 30,997 | 809 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 15 13:01:08 2022
@author: 12593
"""
import numpy as np
import scipy.ndimage
# neighbour_code_to_normals is a lookup table.
# For every binary neighbour code
# (2x2x2 neighbourhood = 8 neighbours = 8 bits = 256 codes)
# it contains the surface normals of the triangles (c... |
7c024cd473528fbd435dbbd2cc1395529e700ee922ded687aec9593e381127af | Python | 31,006 | 680 | '''
This script performs subject-level rERP analysis in the final task.
Briefly, we collect predictors for word onset, phoneme onset,
acoustic envelopes, acoustic edges, phonotactic surprisal,
lexical surprisal, invariant acoustic surprisal, invariant
semantic surprisal, speaker acoustic surprisal, and speaker
se... |
2d790becd366e898b9c9e951a914e7fd4c82e4c92415372d5c379dbf8b17ece1 | Python | 31,020 | 695 | # -*- coding: utf-8 -*-
#
# general_models.py
#
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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.ap... |
84b5dfe6d610591a561cb061ce561c12f9a1e3e12eb50b42f2a642d6f092c140 | Python | 31,023 | 926 | import concurrent.futures
import functools
import os
import queue
import re
import shutil
import subprocess as sp
import threading
import time
from typing import Callable, Dict, List, Optional, Set, Tuple, Union
from urllib.request import urlretrieve
import anndata
import numpy as np
import ngs_tools as ngs
import pan... |
a48f5e7c2362ad1537159b1aab6dc5ea16ef50bb01a3f636702e8df98a5d90b1 | Python | 31,048 | 716 | import os
import sys
import subprocess
import numpy as np
import torch
from datetime import datetime
from typing import Dict, List, Tuple, Optional
import matplotlib.pyplot as plt
try:
import shap
except ImportError:
print("\nSHAP package not found. Installing SHAP...")
try:
subprocess.check_call([... |
20eee3c3c4b4a5af97749863585d1a788af77b9936c0423a413cd8cf9fb3533e | Python | 31,059 | 483 | import os
import numpy as np
import glob
from nipype import Node, Workflow
from nipype.interfaces.utility import IdentityInterface, Merge, Function
from .qsm_pipeline_part1.qsm_pipeline_part1_nipype import QSMPipelinePart1
from .qqnet.qqnet_nipype import QQNet
from cvdproc.pipelines.common.files import FilterExisting
... |
4d0cb5f5f28ba4a7320c2d19346e18afd5c11fde0700f6552899ac8c7fdbbac7 | Python | 31,102 | 832 | """
Module for functions used in the simulation of the task-battery construction problem.
Author: Bassel Arafat
"""
import numpy as np
import matplotlib.pyplot as plt
import OptimalBattery.util as ut
import OptimalBattery.estimate as et
import OptimalBattery.evaluate as ev
import OptimalBattery.construct as ct
import t... |
cb95394b81066721d3dac10918205912a6ecb53d4e34ad1fbe563470005e9afd | Python | 31,108 | 742 | import logging
import shutil
import warnings
from pathlib import Path
from typing import Dict, Optional, Union
import torch
from auxiliary.io import read_image, write_image
from loguru import logger
from brainles_preprocessing.brain_extraction.brain_extractor import BrainExtractor
from brainles_preprocessing.constant... |
6254c67bd32cbdc3dd07d1a6a3633315ce3f14f42e533d2c2a4175080d38d34a | Python | 31,112 | 664 | from qtpy.QtCore import Signal
from qtpy.QtWidgets import QPushButton, QWidget, QVBoxLayout, QMessageBox
from superqt import QCollapsible
from napari import Viewer
from pathlib import Path
from typing import List, Tuple, Dict
from napari.qt.threading import thread_worker
from magicgui import magicgui
from magicgui.widg... |
a4ceb8f7e64ccce2c0ae79fd0f3a532e079092fedae10a847612f2e17dd3c5fd | Python | 31,124 | 877 | from __future__ import annotations
from pathlib import Path
import pytest
from PySide6 import QtCore
from PySide6 import QtGui
from PySide6 import QtWidgets
from PySide6.QtCore import Qt
from pytestqt.qtbot import QtBot
from labelme._app import MainWindow
from labelme._config import _writer
from labelme._widgets imp... |
30f4260c2a5b863b6d12dd5af496de62c2bf546ae8a85fca3e4d2c37b3f33846 | Python | 31,128 | 798 | import json
import re
import pytest
from pathlib import Path
import tempfile
import shutil
from datetime import datetime
from html.parser import HTMLParser
from langchain_core.messages import AIMessage, ToolMessage
from chemgraph.graphs.single_agent import route_after_report_tools, route_report_tools
from chemgraph.sch... |
9427306ee5772d89321a9e358b102e20f02da2b3b662c9b0e118a47f004399f9 | Python | 31,157 | 807 | import re
import math
import collections
import emoji
import langid
import string
import numpy as np
import pandas as pd
import networkx as nx
import community as community_louvain
from tqdm import tqdm
from datetime import datetime
from zhon.hanzi import punctuation
MAX_NEIGHBOR = 250
MONTH_DICT = {'Jan': 1, 'Feb': ... |
8315ee5072eec16da0b5c967dc5e4dae6eff06f39525d29de65aab80962d1bb6 | Python | 31,181 | 1,033 | # imagecodecs/setup.py
# Copyright (c) Christoph Gohlke
# SPDX-License-Identifier: BSD-3-Clause
# See LICENSE file in the project root for details.
"""Imagecodecs package Setuptools script."""
import contextlib
import os
import re
import shutil
import sys
import sysconfig
from typing import Any
import numpy
from Cy... |
3c66b4454332beb372ff9c912368d7ff3c0fb26657c0e4167ec5afc4e887b129 | Python | 31,225 | 698 | import copy
import inspect
from typing import Any, Callable, Dict, Final, List, Optional, Tuple, Union
import torch
from torch import Tensor
from torch.nn import Linear, ModuleList
from tqdm import tqdm
from torch_geometric.data import Data
from torch_geometric.loader import CachedLoader, NeighborLoader
from torch_ge... |
5509e55ce462afd4e02901703151a642101f3ef77b1a1619214fd8c828555ffb | Python | 31,247 | 716 | """
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... |
60cda08ba6ec589dda979be4dc8706158b518b469321095c30eba8636b3e8ad2 | Python | 31,266 | 824 | """Tests for mcmlnet.transforms.related_work_transformations module."""
import os
import tempfile
import numpy as np
import pytest
import torch
from mcmlnet.transforms.related_work_transformations import (
LanConstants,
LanTransformation,
ManojlovicConstants,
ManojlovicTransformation,
Transformat... |
c3a73cf82840f9ca8265ea3da5bd2634859ba259e2fb619170023fb2243f90af | Python | 31,269 | 801 | import copy
import warnings
import numpy as np
from obspy import UTCDateTime
import seisbench
class FixedWindow:
"""
A simple windower that returns fixed windows.
In addition, the windower rewrites all metadata ending in "_sample" to point to the correct sample after window
selection. Window start a... |
78be7483056929e15717653ea1a9112069bdc3d908b42a1b67ef8735bdbec7fe | Python | 31,304 | 963 | from collections.abc import Callable, Iterator
from dataclasses import dataclass
from functools import partial
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
overload,
)
import numpy as np
import torch
from lightning import fabric
from torch import nn
from eir.data_load.data_utils impor... |
f0d97be7c991ed30c8355267250edb6404b923ae36c2ae60e6c5fddd75624a75 | Python | 31,318 | 521 | ################################################################################################################
### The main purpose of this script is to facilitate the comparison of data from two different simulators. ###
### It allows to plot the mean and the s.e.m. across `M` batches of the mean _and_ the standar... |
2255dc82a682ac5fd1a772eff50c03c57e975cc90de26c41cb7a37748c51a2ba | Python | 31,362 | 860 | """Test the class Hypnogram."""
import json
import os
import tempfile
import unittest
import warnings
import matplotlib.pyplot as plt
import mne
import numpy as np
import pandas as pd
import pytest
from yasa.hypno import Hypnogram, simulate_hypnogram
def create_raw(npts, ch_names=["F4-M1", "F3-M2"], sf=100):
"... |
d7bea119c37f9f34085b5174735579843da91bd718670e24515f32b6d667afe1 | Python | 31,363 | 806 | import gc
import warnings
import numpy as np
from sklearn.utils.validation import check_random_state
from . import compute, structures, utils
def gen_permsamp(groups, n_cond, n_perm, seed=None, verbose=True):
"""
Generates permutation arrays for PLS permutation testing
Parameters
----------
gro... |
b54365c22fdf02c071600fd21f4925fc8dc7644b525f18559e6b2efa893038bf | Python | 31,369 | 1,013 | import functools
import numpy as np
import pandas as pd
import scipy.signal
import scipy.stats
import os
import src.utils
from datetime import datetime
import zipfile
import tempfile
def cached(f):
"""
Decorator that creates a cached property.
"""
key = f.__name__
@property
@functools.wraps(... |
b6be14e87d3b1f8a012dbd74a240af3bbf8663e904c022d49872c27e4347ab89 | Python | 31,371 | 618 | """Nipype interface for subject-specific MRtrix3 or DSI Studio disconnectomes."""
from __future__ import annotations
import gzip
import csv
import shutil
import struct
import subprocess
import tempfile
from pathlib import Path
import nibabel as nib
import numpy as np
from scipy.ndimage import binary_erosion, distance... |
19569eead53f16fd442bc62cbfb76ae6ce3372fec426e9bd90c9e89105e9b4a0 | Python | 31,392 | 635 | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import chi2_contingency, mannwhitneyu, spearmanr, norm
from scipy import stats
import math
import statsmodels.formula.api as smf
import statsmodels.api as sm
from pathlib import Path
import pickle
fr... |
4f4ce3e0e3949ca9afb33fbeb35cc664551d609af28fab2a206d40523a9f9939 | Python | 31,428 | 605 | '''
embeddings::model.py
Functions and classes utilised in modelling the trial-wise semantic
space estimates per participant.
'''
from .internal import *
from . import model_auxiliary as aux
import numpy as np
import arviz as az
import pymc as pm
import pandas as pd
import os.path
import pickle
import ... |
964f804a5c9369cd787dfa8fdc5f2804de6b5426ab71f0e4a07c69e7c37d3bff | Python | 31,428 | 822 | import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from PyQt6.QtWidgets import (
QApplication, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QSlider,
QGridLayout, QPushButton, QFileDialog, QComboBox
)
from PyQt6.QtGui import QFont
from PyQt6.QtCore import Qt
from PyQt6... |
d75b20f75f2721bc9baf68681443be1c0d7060d90be8614c2bdc9df2a37aaae7 | Python | 31,444 | 917 | import logging
import math
from typing import (
Any,
Callable,
Iterator,
List,
NamedTuple,
Optional,
Tuple,
Union,
)
import numpy as np
import torch
from torch import Tensor
from tqdm import tqdm
from torch_geometric.data import Data
from torch_geometric.typing import SparseTensor
from... |
425f1adac216017ea0517da918dfa54d90deeba826cff9e3a8be4c666eae9aa3 | Python | 31,452 | 862 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor, tanh, sigmoid
from torchvision import transforms as trans
from torch.nn.common_types import _size_2_t
from ..util.util import lookup_nn, tensor_to, ensure_num_tuple, get_nd_conv
from ..ops.commons import spli... |
9463f71cdd4c05018c6d8d30b871518b554af6a3a687d27f34f0457f90feb8e3 | Python | 31,467 | 873 | import flair
import torch
import pytest
from flair.data import Sentence
from flair.embeddings import (
RoBERTaEmbeddings,
OpenAIGPTEmbeddings,
OpenAIGPT2Embeddings,
XLNetEmbeddings,
TransformerXLEmbeddings,
XLMEmbeddings,
)
from pytorch_transformers import (
RobertaModel,
RobertaTokeni... |
761816776b54ffccad686fa80e010ae0638c76210ebe9af7e9d50105785161ff | Python | 31,506 | 683 | from qtpy.QtCore import Signal
from qtpy.QtWidgets import QPushButton, QWidget, QVBoxLayout, QMessageBox
from superqt import QCollapsible
from napari import Viewer
from pathlib import Path
from typing import List, Tuple, Dict
from napari.qt.threading import thread_worker
from magicgui import magicgui
from magicgui.widg... |
97f0423bd694160ffb53c225d8bbb3a4dc008b5294c5eca88001126db396f27e | Python | 31,518 | 874 | # 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, ... |
7d46e2f851b7b4bdee53bd95f121cf642ecc3c35ae8f1302242247afb3fa0f98 | Python | 31,521 | 917 | """
foundcog_preproc.py — Subject-level preprocessing pipeline for the FOUNDCOG dataset.
This script builds and runs a NiPype workflow that preprocesses BOLD fMRI data
for each subject/session/run in the BIDS dataset. For each run it:
1. Applies BOLD-specific preprocessing (motion correction)
2. Estimates and appl... |
ec87988136ca13069a2ef425bee96c36b1898f106804eb123f0f4d72dcdbefb7 | Python | 31,552 | 800 | # Kai Sandbrink
# 2023-07-31
# This script provides common utils for the analysis of the learning experiment.
# %% LIBRARY IMPORT
import numpy as np
import pandas as pd
import os, pickle
from scipy.stats import pearsonr
import statsmodels.api as sm
from statsmodels.formula.api import ols
from sklearn.linear_model im... |
879c862b35b19dc8b98f424b68e2bfaab6ef7d7eaaa475415ae8c1f4af25580e | Python | 31,555 | 782 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date: Created on 04 Apr 2022 11:02
# @Author: Yao LI
import argparse
import sys
import pandas as pd
import numpy as np
import hdbscan
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import umap
import umap.plot
import seaborn as sns
import os
from itertools i... |
2cff6bf177cc64feb82ea39782d66d118965d0b7a0ff97e532b79a71209c047b | Python | 31,558 | 981 | import reprlib
from collections.abc import Iterator, Sequence
from dataclasses import dataclass
from functools import lru_cache
from pathlib import Path
from typing import (
Any,
Literal,
Protocol,
)
import numpy as np
import polars as pl
pl.enable_string_cache()
from sklearn.model_selection import train_... |
e8f8b8e3e1655b1397dce049f6e62cd82363f2839765bf360879b4c824acab74 | Python | 31,565 | 720 | import pysam
import os
from glob import glob
import sys
from sys import getsizeof
import time
import numpy as np
import pandas as pd
import polars as pl
from collections import defaultdict
import multiprocessing
from tqdm import tqdm
from multiprocessing import get_context
from read_process import incorporate_replaced... |
04a00f6967643ebc6104a4f0e394e4eff42f10fa6fdf0ca40b8b2ca5445623da | Python | 31,594 | 682 | # -*- coding: utf-8 -*-
import os
import re
import sys
def find_reference_pcr_file(ref_pcr_name, root_dir):
ref_path = os.path.join(root_dir, 'dat_vestacif_files', 'reference_pcr_format', ref_pcr_name)
if os.path.exists(ref_path):
print("Found reference PCR in reference_pcr_format folder: {}".format(... |
0d026622b43886e47376668de6d06d86487c2fc2b4ce519a7c8a3b902c6f1921 | Python | 31,619 | 782 | #!/usr/bin/env python
import os
import sys
import json
import glob
import re
import argparse
import shutil
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
from pathlib import Path
from scipy.signal import find_peaks, peak_widths
from scipy.interpolate import interp1d
plt.rcParams['fon... |
1f9ff3f5f27de918b82b51e93e88a7c20530decc7f3a384f10116319c2715b5d | Python | 31,621 | 752 | # YOLOv5 general utils
import glob
import logging
import math
import os
import platform
import random
import re
import subprocess
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
import cv2
import numpy as np
import pandas as pd
import torch
import torchvis... |
250c40e13ebe78c5700050775a48ba978c1fbd8e07ed2d82616b02d8edca662d | Python | 31,622 | 910 | import copy
import warnings
import weakref
from collections import defaultdict, namedtuple
from collections.abc import Mapping, MutableMapping, Sequence
from enum import Enum
from typing import (
Any,
Callable,
Dict,
Iterable,
Iterator,
List,
NamedTuple,
Optional,
Set,
Tuple,
... |
470f74e3b8d2848c70c74723c277fb14df96744053eb06520447d9963fa60c96 | Python | 31,624 | 750 | import sys
import os
import pandas as pd
import pyreadr
import torch
import glob
import functools
import random
import torch_geometric.transforms as T
import torch.nn.functional as F
import yaml
from math import ceil
from torch_geometric.data import InMemoryDataset, Data
from torch_geometric.loader import DenseDataLoad... |
f108fabed9ad196b9a8e05b7a02c9e7179a7adfb370197f038a5df7c3aa13c35 | Python | 31,627 | 805 | import re
import math
import collections
import emoji
import langid
import string
import numpy as np
import pandas as pd
import networkx as nx
import community as community_louvain
from tqdm import tqdm
from datetime import datetime
from zhon.hanzi import punctuation
MAX_NEIGHBOR = 250
MONTH_DICT = {'Jan': 1, 'Feb': ... |
ce10765e01f6d136c866712a35a8bad9946b20720d325696d4545d4d8d1381ac | Python | 31,634 | 878 | '''
Codes for PCA/ICA methods described in Detecting cell assemblies in large neuronal populations, Lopes-dos-Santos et al (2013).
https://doi.org/10.1016/j.jneumeth.2013.04.010
This implementation was written in Feb 2019 by Vitor Lopez dos Santos.
Modified with permission by Mostafa El-Kalliny (mosta... |
3bb6e38d6e3850f0c18e27d7e07308ff829e557709e2b26ebd9efa03e91c46b6 | Python | 31,652 | 655 | from testsetclass import TestsetClass
class W417(TestsetClass):
def __init__(self):
self.weak = 1.0
self.path="/lustre/wodynski/testset_grid/w417/"
self.molecules = ['cyclobutene', 't-butadiene', 'cyclobutane', 'n-pentane', 'benzene', 'acetic', 'hclo4',
'c2f6', '... |
05b272a1e39c83d5746d2f4e55868b2e537d040b87d50b7d1f851cf80e381d1a | Python | 31,653 | 825 | """
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... |
b9c6ecf218bf4d4b5dfaab2a35d79a042ecd4b5f5b40f1c144b824a9740bdea8 | Python | 31,654 | 789 | #!/usr/bin/env python
"""
Heuristically programmed ALgorithmic STORM setup control.
This module handles setup, clean up and message passing
between the various sub-modules that define the
behavior. Each of these modules must be a sub-class of
the HalModule class in halLib.halModule. Setup specific
configura... |
8781586968730cb1ce1761049402a5591eee75a0e73fabde4d71929b444b56a8 | Python | 31,667 | 897 | # -*- coding: utf-8 -*-
import logging
from dipy.align.imaffine import (AffineMap,
AffineRegistration,
MutualInformationMetric,
transform_centers_of_mass)
from dipy.align.transforms import (AffineTransform3D,
... |
88e2edc7b51c9add123f86a4eb1d6170366a9b31732449517e48ffb85aebb293 | Python | 31,691 | 871 | #!/usr/bin/env python
import os
import storm_analysis.sa_library.datareader as datareader
import storm_control.sc_library.halExceptions as halExceptions
import storm_control.hal4000.testing.testActions as testActions
import storm_control.hal4000.testing.testActionsTCP as testActionsTCP
import storm_control.hal4000.t... |
9124dce458e5f0f66750094b4e179607eb572bb0e9fd115f058cd41997fd8f1d | Python | 31,696 | 990 | import os
import numpy as np
import nibabel as nib
from scipy.interpolate import splprep, splev
from dipy.segment.clustering import QuickBundles
from nipype.interfaces.base import (
BaseInterface,
BaseInterfaceInputSpec,
TraitedSpec,
File,
)
from traits.api import Str, Bool, Int, Float
from cvdproc.p... |
4356bc99ab5c8754af9f164ab0fe5eb91b6ae9609e4354e8700351083a05fc3e | Python | 31,697 | 845 | import pytest
import tempfile
import shutil
import sqlite3
import polars as pl
import yaml
from pathlib import Path
import tarfile
import sys
import os
import json
import time
from unittest.mock import patch, MagicMock
# Add the source directory to the path
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))... |
85093c4fe7ea44c6be31a11b3fa850e800d667e375b3195e87776d8145920154 | Python | 31,745 | 875 | """
Defines the TaskContext class which is responsible for selecting, running, and providing the tasks an interface for
rendering and accessing the event loop
"""
import re
import json
import typing
import random
import logging
import asyncio
import inspect
import pathlib
import shutil
import datetime
import functools... |
c3105f230c836483fcb846296869854ad65a4d1c100c9ed09090a25ac086c87f | Python | 31,748 | 867 | # 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, ... |
9e92431c2f255d1089e0d3b9e13f3e3ad9a0812b5feb3c668a56dc434a19cec3 | Python | 31,784 | 816 | #!/usr/bin/env python3
"""
Infant Movement Pose Processing Pipeline
Processes pose estimation JSON files to extract kinematic features for GMA scoring.
"""
import os
import sys
import json
import shutil
import warnings
from pathlib import Path
from datetime import datetime
from typing import Dict, List, Tuple
from mul... |
0aefb79f917e0c3ac5a5190cc138306ad7c3ac3e074cb86ef882ed0f0af1b732 | Python | 31,859 | 711 | """
(C) Copyright 2021 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.