sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
206b576f749f4b2f2893aee76c46a516472d73bd6802b398a7c993e47df20781 | Python | 70,216 | 1,919 | from rdkit import Chem
from rdkit.Chem import Descriptors
import numpy as np
import regex as re
import mmap
from typing import Union, List, Optional, Tuple
from contextlib import contextmanager
from pathlib import Path
# Pre-compiled regex patterns at module level with regex module over standard re
PATTERNS = {
'p... |
277c7b82afd7d7ae7b0983fa67ce2c8468933c25a38ddb4a5ff8340e19896132 | Python | 70,643 | 1,676 | # The ImpedanceFitter is a package to fit impedance spectra to
# equivalent-circuit models using open-source software.
#
# Copyright (C) 2018, 2019 Leonard Thiele, leonard.thiele[AT]uni-rostock.de
# Copyright (C) 2018, 2019, 2020 Julius Zimmermann, julius.zimmermann[AT]uni-rostock.de
#
# This program is ... |
cea12bebc440ee89cf97a831d840026b88c04b67f7476c18a0a3d5e16942eac1 | Python | 70,845 | 1,730 | # Copyright (c) OpenMMLab. All rights reserved.
from abc import abstractproperty
import math
import copy
import warnings
from typing import Sequence
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import (build_activation_layer, build_conv_layer,
build_norm_layer,... |
e9483285653f3c369f0fb88c5bdd2ae2caa7df73420a08e373d971bf51301449 | Python | 70,890 | 1,773 | # Copyright 2025 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
#
# Unless required by applicab... |
93c8d0a193f97c36743b2a62cad6f10071316af878264e32d8828bcaa5feb5b2 | Python | 71,004 | 1,935 | # The ImpedanceFitter is a package to fit impedance spectra to
#
# equivalent-circuit models using open-source software.
#
# Copyright (C) 2018, 2019 Leonard Thiele, leonard.thiele[AT]uni-rostock.de
# Copyright (C) 2018, 2019, 2020 Julius Zimmermann,
# julius.zimmermann[AT]... |
a4c565d791b7e47033e1e08ce60f1d4ad061da8be1df0a4d7eed5c8c3281887a | Python | 71,021 | 1,393 | #
# fiberprofile/analysis/profile_qc.py (from FiberProfileAnalysis/profile_stat_QC.py)
# dmrifiberprofile qc-profiles
#
#!/usr/bin/env python3
"""
Compute age-binned statistics (mean, std, percentiles) for along-tract metric
tables and render per-tract QC plots.
The profiles root may hold either layout, and both ... |
658c22d67b888df54092091105ee4b2131b29f033c34409383fcee93d7d44dac | Python | 71,219 | 1,727 | """
Fine-tune trainer: a trainer for finetuning BERT and able to be parallelized based on flair
Author: Xinyu Wang
Contact: wangxy1@shanghaitech.edu.cn
"""
from .distillation_trainer import *
from transformers import (
AdamW,
get_linear_schedule_with_warmup,
)
from flair.models.biaffine_attention import BiaffineAtte... |
9367fc1201ce13c3878543dd7c8b167732387f461f2c47954e0675290b133eb7 | Python | 71,291 | 1,334 | from qiskit.quantum_info import Statevector, partial_trace
from exactqcnn import ExactQCNN
from matplotlib import pyplot as plt
from matplotlib import ticker
import numpy as np
import math
import os
import itertools
import json
import time
from tqdm import tqdm
class QHT:
def __init__(self, qcnn, ex... |
0d59fe34aafda5afd309fec7a49e6f9b68b7add6b622632df07f9ab32548b85a | Python | 71,562 | 1,536 | import os
import tarfile
import uuid
from unittest import mock, TestCase
from unittest.mock import call
import kb_python.ref as ref
from kb_python.config import REFERENCES_MAPPING
from tests.mixins import TestMixin
class TestRef(TestMixin, TestCase):
def test_generate_kite_fasta(self):
out_path = os.pat... |
1126c23f5953ecc75e6aa41ef73f0b44770a52a5225ed2a5841a29a6cc0cbdc5 | Python | 71,774 | 2,159 | """Functions to perform spectral analysis."""
import logging
from typing import List, Optional, Tuple, Union
import numpy as np
from scipy import signal
from scipy.signal._spectral_py import _median_bias
from sklearn.decomposition import non_negative_factorization
from pqdm.threads import pqdm
from threadpoolctl impo... |
4b1767a25de8ffcb0d5ec61279a22cec267077fe0da9e6889d179d952b20673c | Python | 71,831 | 1,404 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""
Train a model on a dataset.
Usage:
$ yolo train model=yolo26n.pt data=coco8.yaml imgsz=640 epochs=100 batch=16
"""
from __future__ import annotations
import gc
import math
import os
import subprocess
import time
import warnings
from copy imp... |
3448d8addbd33a237b69b00bff697daddcf6ba25296536f94edeac51132d3a1f | Python | 72,015 | 1,530 |
import logging
import os
import pickle
import Bio
import torch
import numpy as np
import pandas as pd
from tqdm import tqdm
from dgl.data import DGLDataset, download, check_sha1
from atom3.structure import df_to_pdb, get_chain_to_valid_residues
import Bio.PDB.Polypeptide as poly
from Bio.SeqIO import FastaIO
from s... |
c0a089a6fe98d9f6d36573cbc90edbcd6e43a9f17ebc081d40e74bf68c7a2613 | Python | 72,083 | 1,908 | """
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... |
16124ffc7ae88ec686d271a18bf98bdb9c6e5ea2c4e53e5b312831561012e782 | Python | 72,267 | 1,382 | import inspect
import multiprocessing
import os
import shutil
import sys
import warnings
from copy import deepcopy
from datetime import datetime
from time import time, sleep
from typing import Tuple, Union, List
import numpy as np
import torch
from batchgenerators.dataloading.multi_threaded_augmenter import MultiThrea... |
6cf14a71fe5a33ba2929403288359844473878f6a8f01694061162c862f5e939 | Python | 72,331 | 1,891 | """
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... |
3efb179cc9fec67531afb2375f13bc78453e62bb172ba902a601a19ecd072866 | Python | 72,402 | 1,670 | from ._builder import build_model_with_cfg
from ._manipulate import checkpoint_seq
from ._registry import register_model, generate_default_cfgs
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import torchvision
import cv2
import o... |
46233fb1cdc7007e53a6dae7a83db23a492cdca17a1275ee278cf938f89baa3d | Python | 72,487 | 2,010 | import random
import numpy as np
from tqdm import tqdm
from tqdm_joblib import tqdm_joblib
from typing import Literal, Union
from abc import ABCMeta, abstractmethod
from joblib import Parallel, delayed
from threadpoolctl import threadpool_limits
from sklearn.cluster import KMeans
from sklearn.metrics import mutual_info... |
471690eb79311f3df3f2694e0089e92938173082761fda9d2a26548fb666f728 | Python | 72,580 | 1,494 | """Test express mode, the ``.meanap`` bundle, and redrawing figures from it.
Run from the repo root::
uv run python python/test_bundle_render.py
The claim express mode makes is strong: *the figures it doesn't draw can be
drawn later, identically.* If that is off by so much as an axis limit, the
bundle is worse t... |
811d892d7f1a205d2c3f01b3e30262b39a340e3af9f8f8a3b332ad01042aa037 | Python | 72,751 | 1,391 |
#
# atlasbuilder.py
# 2022-10-09
# Written by SK Park, NIRAL, UNC
#
# Atlasbuilding class under dtiplayground
#
import os
import time
import sys
import json
import argparse
import csv
import shutil
import threading
import traceback
import copy
from pathlib import Path
import yaml
# import dtiplayground.... |
5edae23d4dc5ea52955d896d620374dbe9c87303a5d03ef2a07fdc1b7f621067 | Python | 73,050 | 2,033 | from ..qt import *
import typing
import sys
import enum
import math
import time
import json
import shelve
import logging
import pathlib
import datetime
import itertools
import collections
from ..resources import read_text
from ..config import *
import functools
import h5py
import asyncio
from ..task_controller.util imp... |
8eb4e089b7c36cef13bb872f9aa37e346da5c022bcfd979e11e7a57a0666b106 | Python | 73,120 | 1,547 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import math
from pathlib import Path
from typing import Any
import torch
import torch.nn.functional as F
from torch import nn
from ultralytics.utils.metrics import CITYSCAPES_WEIGHT, OKS_SIGMA, RLE_WEIGHT
from ult... |
7a3d8ba0f946758599703c3cb60c0c78b05a0e17253bb839ac3a775945a70f06 | Python | 73,841 | 1,678 | # Code (c) by Paula T. Kuokkanen, Z. Mehnoush Faghani
#
# Code is licensed under a
# Creative Commons Attribution 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <https://creativecommons.org/licenses/by/4.0/>.
#
# Code for figures 6-9 in the manuscript... |
415aefe4667a7320e87c5e38356d621fe1f43b05c8fa7abc2af6fb8c6f379747 | Python | 73,944 | 2,025 |
"""
An implementation of HMAX:
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import scipy as sp
import time
import pdb
from ._builder import build_model_with_cfg
from ._manipulate import checkpoint_seq
from ._registry import register_model, generate_default_cfgs
from .HMAX... |
27784110e1cc2486e30cc76986c0207183326eb5f73728b14719291a860ab5e6 | Python | 74,428 | 1,775 | # -*- coding: utf-8 -*-
# @Author : LG
import math # 用于角度约束计算
import time # 拖动鼠标描点
import cv2
import numpy as np
import shapely
from PIL import Image
from PyQt5 import QtCore, QtGui, QtWidgets
from ISAT.configs import CONTOURMode, CONTOURMethod, DRAWMode, STATUSMode
from ISAT.utils.dicom import load_dcm_as_image
f... |
e71ad9a61fa2f10254eb87364f1e0ad6ef8f9a4646ff2de6f404db3841ecfe31 | Python | 74,434 | 1,493 | #
# fiberprofile/analysis/registration_qc.py (from FiberProfileAnalysis/registration_QC.py)
# dmrifiberprofile qc-registration
#
#!/usr/bin/env python3
"""
QC for the deformable alignment of subject diffusion tensors/metrics to a prior
diffusion-MRI atlas.
Each subject session has tensor-derived metric maps warpe... |
bbc965f50fb129360c7506bd27c5babe7bba58c9496d0fc4c86375e961de63ed | Python | 74,467 | 1,526 | # wfield - tools to analyse widefield data - NCAAS gui
# 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 of the License, or... |
b88c3c398b4030a48da41e507ed8e252ef129200d71fe37808f4756b9643f33e | Python | 74,536 | 1,990 | """
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... |
90e2a507301da3669d77a445393d70eb40392dece2a633c8f0d21a55ba8ca87d | Python | 74,939 | 1,864 | import asyncio
import bisect
import copy
import inspect
import math
import re
from abc import ABC, abstractmethod
from collections import defaultdict
from dataclasses import dataclass
from pathlib import Path
from operator import attrgetter
from typing import Any, AsyncGenerator, Optional, Type
import numpy as np
impo... |
062762a953f2c9c24d51cc33c3771e86aeef4f191238994e276df194937c1bea | Python | 75,031 | 1,631 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""
Ultralytics Results, Boxes, Masks, SemanticMask, Keypoints, Probs, and OBB classes for handling inference results.
Usage: See https://docs.ultralytics.com/modes/predict
"""
from __future__ import annotations
from copy import deepcopy
from functo... |
d1076312ed923378781808ed5d4887c07d5a27f373bc94521da748108b1bd4e2 | Python | 75,085 | 1,387 | """Self-contained HTML output viewer for a MEA-NAP pipeline run.
Walks an output folder (the same tree ``output_folders.py`` creates) and
writes a single ``report.html`` that lets you browse it — a folder tree on
the left, an image gallery on the right, with a caption under each plot
explaining what it shows. No serve... |
d54cad470633552a48ace2affd6b7656a27677b9c0f819af6c8dc1f37ccb3bfd | Python | 75,480 | 1,875 | # -*- coding: utf-8 -*-
"""snn-leukemia-pytorch-fixed (2).ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/110Owo_mnj6gXvRHZRNXAppronLRjJYlx
"""
# ============================================================================
# INSTALL REQUIRED PACKAGES FO... |
380afdd0715abbc037021f1f2b42f9055a574ea16070636e1a46287a966b6580 | Python | 75,525 | 2,085 | import abc
try:
import anndata
except ImportError:
anndata = None
import batchglm.api as glm
import dask
import logging
import numpy as np
import patsy
import pandas as pd
from random import sample
import scipy.sparse
import sparse
from typing import Union, Dict, Tuple, List, Set
from .utils import split_x, dm... |
f9883e40ac56340ac3b642d92d986bd941e64cdead77347530e87056c442a50f | Python | 75,690 | 1,637 | import warnings
import heapq
from collections import defaultdict
import numpy as np
import scipy as sp
from scipy.sparse import issparse
from scipy.sparse import coo_matrix
from scipy.sparse.csgraph import dijkstra, shortest_path
from numba import njit
import networkx as nx
from . import neighbors as nb
from . import... |
1e66197d3bc733cfd6405ea4dafc3f2b9d684910973d1e7d2f710e835cdf1f30 | Python | 76,063 | 1,768 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import alphashape
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA
from sklearn.neighbors import NearestNeighbors
from sklearn.metrics import f1_score
import h5py
import scipy
import plotly.graph_objects as go
import seaborn a... |
84dc7d978ed692a79878aa3bd2f7533184c7f89d5463d87b64c68a1d8f9872ef | Python | 76,250 | 1,575 | """Contains the data model abstraction."""
import glob
import json
import os
import re
from dataclasses import dataclass
from typing import Literal, overload, TypeAlias, TypedDict
import h5py
import numpy
import yaml
from numpy.typing import NDArray
from PIL import Image
from virelay.image_processing import add_bord... |
b33d74275e67dff120dfef37262e48dd9989d54c396d50a007b374770ad26126 | Python | 76,433 | 1,659 | #!/usr/bin/env python
import sys,math,random
version = "---"
previous = "20140603.11.TAW"
# Modify insane to take in arbitary lipid definition strings and use them as a template for lipids
# Also take in lipid name
# Edits: by Helgi I. Ingolfsson (all edits are marked with: # HII edit - lipid definition )
# PRO... |
420671a6cb402529c1d0bfa77e5c90d2d0faa19ec1cf16a1e12df0f43222e75c | Python | 76,754 | 1,229 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 29 08:36:07 2024
@author: aka2333
"""
#%%
%reload_ext autoreload
%autoreload 2
from itertools import permutations, product
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import pandas as pd
import matp... |
7034bfc68de73492c6cff3d7dd3bc0d92015a94c1bcb240683ddd2c3227d478d | Python | 77,002 | 1,709 | # Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved
import logging
from collections import defaultdict
import numpy as np
import torch
import torch.distributed as dist
import torch.nn.functional as F
from .. import perflib
from ..logger import get_logger
from .act_ckpt_utils import clone_output_... |
78b0afb2a63f3057d6e6266e152153c98a309d6c6a1c08248e72253c1df93eec | Python | 77,060 | 1,717 | #!/usr/bin/env python3
"""
AutoML Training and Inference for GMA Score Prediction
Integrates with pose processing pipeline for end-to-end prediction.
"""
import os
import pickle
import warnings
from pathlib import Path
from datetime import datetime
from typing import Optional, Tuple, Dict
import pandas as pd
import n... |
f059527130938e45e62195ecb2420f274949cf43cea2c5a10625f848dae10e04 | Python | 77,142 | 1,797 | """Tests for CAT-NAP cross-day cell tracking.
Each test here corresponds to something that actually went wrong while the
prototype was built, so they are regression tests rather than coverage.
"""
from __future__ import annotations
import json
import sys
from pathlib import Path
import numpy as np
import pytest
sy... |
dff03b8b3220ff1c506caeb17b858317c7df8980268c50b5f9b167528aacd166 | Python | 77,204 | 2,680 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 12 17:08:36 2022
@author: proussel
"""
import os
import re
from itertools import repeat
import itertools
from pathlib import Path
import warnings
import json
import glob
import numpy as np
import pandas as pd
from skimage import measure
from scipy... |
7e565aed91b1c9af59d05a52cba227012144ef60187ee30852e200e468299498 | Python | 77,238 | 2,621 | import json
import logging
import os
import os.path as op
import shutil
import time
import warnings
from glob import glob
import dipy.data as dpd
import nibabel as nib
import numpy as np
import pandas as pd
from dipy.align import resample
from dipy.data.fetcher import _make_fetcher
from dipy.io.streamline import (
... |
317bc8874dd46d8897a81207367a8920dfedd359f848ff4771d54dbd4139c5ce | Python | 77,313 | 1,304 | # Forward Inclusion Backward Elimination
# Copyright (c) Mohammad Arafat Hussain, Boston Children's Hospital/Harvard Medical School, 2023
# 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 with... |
0ea7ac9aeb8df7712b12f3128a7728c57552d7a686d9c1521a0087aebf306314 | Python | 77,384 | 1,767 | import numpy as np
import torch
import matplotlib.pyplot as plt
from sklearn.metrics.pairwise import cosine_similarity
from skimage import metrics
import scipy.stats as stats
import copy
import warnings
warnings.filterwarnings('ignore', category=Warning)
warnings.filterwarnings('ignore', message='.*tqdm.*')
from tqdm.a... |
6faf665c41526ece4fe0d359e3974abc552a5f6b981ab56574c35b6d838ddc80 | Python | 77,408 | 1,815 | """
NumpRF - numerosity population receptive modelling
Joram Soch, MPI Leipzig <soch@cbs.mpg.de>
2023-06-22, 14:34: log2lin, lin2log
2023-06-22, 17:04: f_log, neuronal_signals, simulate
2023-06-22, 17:55: hemodynamic_signals, simulate
2023-06-22, 21:49: testing
2023-06-26, 18:11: refactoring
2023-06-29, 16:58: plot_ta... |
898e53c62814d9c8df8ae4f2abc3f79ad7c91aaf497b3f36b39310a8c4a369d0 | Python | 77,533 | 2,306 | #!/usr/bin/env python
#
# SHBASECOPYRIGHT
#
# FSL installer script.
#
"""This is the FSL installation script, which can be used to install FSL.
This script must:
- be able to be executed with Python 2.7 or newer.
- be able to be executed in a "vanilla" Python environment, with no third
party dependencies.
- b... |
3be57fed557f10f76701f66cf91788bc6ec9ce1683f1a34b407aba65847c744f | Python | 77,635 | 2,115 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Block modules."""
from __future__ import annotations
import math
import torch
import torch.nn.functional as F
from torch import nn
from ultralytics.utils.torch_utils import fuse_conv_and_bn
from .conv import Conv, DWConv, GhostConv, LightConv, ... |
1cc856626d3442a714fe12477d0c745978e442cd73a7b5e3e83ee2b22bcc50a4 | Python | 77,839 | 1,761 | import argparse
import logging
import os
import shutil
import sys
import tempfile
import threading
import time
import urllib.parse
import urllib.request
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, as_completed
from contextlib import ExitStack
from functools import partial
from typing import ... |
4d7160555fd95d473ea82b45a7c2bea3d70f1f56d78e2fb328274d67cb1d23af | Python | 78,164 | 1,937 | #!/usr/bin/env python3
import cv2
import os
import traceback
import numpy as np
import tkinter as tk
from tkinter import filedialog, messagebox, ttk
import configparser
import random
import time
from collections import deque
import sys
from PIL import Image, ImageTk
from index_annotations import AnnotationIndex
import... |
55105a28e80107a97c9d5dc19f157f7d9fc56ef62c75c554682475406753ca35 | Python | 78,316 | 2,088 | import torch
import torch.nn as nn
from torch import Tensor
import torch.nn.functional as F
from collections import OrderedDict
from typing import Dict, List, Union
import warnings
from pytorch_lightning.core.mixins import HyperparametersMixin
from ..util.util import add_to_loss_dict, reduce_loss_dict, fetch_model, upd... |
ffa132dde79b6c6a8171c22e06cd280d7fa2672494662b80f8e21f1698a14cef | Python | 78,547 | 1,583 | """An interactive per-cell page: is *this* cell really the same cell?
ROICaT's ``display_cropped_cluster_ims`` shows a tracked cluster as a strip of
footprint crops. That is the right spatial view but it is only the evidence the
matcher already used, so it cannot say whether a match is real. This puts the
independent ... |
ee2fa68b7c0578c0229b7e586fd47d265fc84ebf17647347d91d0a58a02de4ed | Python | 78,847 | 1,999 | """Command implementations for the ChemGraph CLI.
Each public function corresponds to a CLI action: running a query,
starting interactive mode, managing sessions, etc.
"""
from __future__ import annotations
import logging
import os
import sys
import time
from asyncio import CancelledError
from concurrent.futures imp... |
890de028268993315684d01e55c1a34f1bb9a1aa0dd9cc82934decdcd54eec67 | Python | 79,684 | 2,157 | #!/usr/bin/env python3
import os
import sys
import time
import traceback
import cv2
import numpy as np
import configparser
import random
from collections import deque
import tkinter as tk
from tkinter import filedialog, messagebox, ttk
from PIL import Image, ImageTk
from index_annotations import AnnotationIndex
impo... |
d4de50953389fa4a1f9e0cd46f36d00d51a8ad4830b063ae848e917af2d3f1e5 | Python | 79,816 | 2,169 | """Base class for handling data."""
import atexit
import math
import os
import re
import logging
import pathlib
import pickle
import random
import uuid
from contextlib import contextmanager
from functools import partial
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple, Union
import num... |
52d9e13afba928316e17a2af175cfd01660726a538e6b5356d9914e04268bbab | Python | 80,136 | 2,095 | # Copyright (C) 2021-2022 Intel Corporation
# Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import base64
import io
import json
import os
from collections import Counter
from itertools import groupby
from unittest import mock, skip
import requests
from django.core.signing import TimestampSigner
f... |
7df362419342ccfcab1ee119a2d51e88ceb4a898657b90e5bbf318caaa8fb6ab | Python | 80,302 | 1,139 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 29 08:36:07 2024
@author: aka2333
"""
#%%
%reload_ext autoreload
%autoreload 2
# Import useful py lib/packages
from itertools import permutations, product
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
... |
2dde6a6916db714b56a50c0b4ca1d7c5fe4a4e1888688521ccc7654389fcf01c | Python | 80,394 | 1,765 | """
Iterative 2D background fitting window for Quadrant Folding.
A standalone dialog (launched from the Background Subtraction settings) that
runs the two-stage iterative background fit
(:mod:`musclex.utils.bg_fitting.background_fitting`) on the current folded image and lets
the user inspect the fitted background, its... |
3229e533418786ded0c7524664df77bb6d1b24911db3c583eb7e44241e085117 | Python | 80,508 | 1,622 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 30 15:21:05 2024
@author: aka2333
"""
# In[ ]:
from itertools import permutations, combinations, product
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import scipy
from scipy import stats
import matplo... |
89b65eb37f047f3fd804753f88b5cea2c488acedf48f91d2955575cdfddb7c6c | Python | 80,734 | 2,779 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 12 17:05:00 2022
@author: proussel
"""
import shutil
import sys
import os
import glob
from datetime import datetime
import json
import tempfile
import multiprocessing
from itertools import repeat
import nipype.interfaces.ants as nipype_ants
import... |
44ec1e860a5f4917727a02259adf7c0ba4abbb9fb1501fe9e6f8af53eac90e0c | Python | 80,795 | 2,356 | """Custom Tensorflow layers."""
from typing import List, Optional, Tuple, Union
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.keras import (
activations,
layers,
initializers,
regularizers,
constraints,
)
import osl_dynamics.inference.initializers... |
13b8d3754c68397c61998c7d3671abddaa5d4bffabfe3fb9a99aaea173a88d0e | Python | 80,956 | 2,008 | """Redraw a run's figures from a bundle, on demand.
Express mode ships the data and drops the pictures; this module puts the
pictures back. It is deliberately thin: every figure is produced by calling
:func:`meanap.pipeline.step4._plot_recording_lag` — *the same function the
pipeline calls* — with state reassembled fr... |
5c2ce191c43a4d9cfb8bcf71b1d808809aaeb5b506a5ad2e0225b5d1144e3887 | Python | 80,984 | 1,362 | # Zhiwen Zhu 2024/04/22 zhiwenzhu@shu.edu.cn
# Zhiwen Zhu 2025/01/13 zhiwenzhu@shu.edu.cn
# Zhiwen Zhu 2025/04/10 zhiwenzhu@shu.edu.cn
import json
import os
import pickle
import random
import shutil
import sys
import threading
import time
from collections import deque
from multiprocessing import Pr... |
f06942f1258fa40efb1ab13c60bbbe75f550315faf3d06146ad345eb0a907cf0 | Python | 82,046 | 2,121 | import copy
import gc
import textwrap
import itertools
import warnings
import types
import inspect
import numpy as np
import logging
log = logging.getLogger(__name__)
from nems.registry import keyword_lib
from nems.backends import get_backend
from nems.metrics import get_metric
from nems.visualization import plot_mod... |
1a5e7a6848fd63c7fd9b09e6409da0180fed43a9110fb2df57f90b1b054b6a0e | Python | 82,101 | 2,443 | """Wrapper functions for use in the config API.
All of the functions in this module can be listed in the config passed to
:code:`osl_dynamics.run_pipeline`.
All wrapper functions have the structure::
func(data, output_dir, **kwargs)
where:
- :code:`data` is an :code:`osl_dynamics.data.Data` object.
- :code:`ou... |
2be7409c674fbe87757f0569942467d8529988b4809e3778adcda93ab5b69fd4 | Python | 82,606 | 2,112 | import gc
import itertools as it
import os
import numpy as np
import pandas as pd
import serial
from psychopy import prefs # noqa
prefs.hardware['audioLib'] = ['PTB', 'sounddevice', 'pyo', 'pygame'] # noqa
from psychopy import (__version__, clock, constants, core, data, event, gui,
logging, mon... |
9ab4f4c6d1cae327d215e76861291a3f4191341ac18130dbc1ffbcea4bbf01ae | Python | 83,167 | 2,751 | """Plotting functions."""
import logging
from itertools import zip_longest
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
import seaborn as sns
import nibabel as nib
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import patches
from matplotlib.path impo... |
291314f9cc93ba951ef29a4e07004ad1aac53bca362505df9b76387cfc579435 | Python | 83,322 | 2,464 | import copy
import logging
import warnings
from unittest.mock import MagicMock, patch
import numpy as np
import pandas as pd
import pytest
import scipy.signal
from obspy import UTCDateTime
import seisbench.generate
import seisbench.generate.labeling
from seisbench.data import DummyDataset
from seisbench.generate impo... |
b561b257a8c78afcb90601fa60121aa5b0a698a213499c9ef95632f2b3214b4b | Python | 83,456 | 2,092 | import copy
import io
import json
import logging
import os
import shutil
import tarfile
import tempfile
import time
import warnings
from pathlib import Path, PosixPath, WindowsPath
import numpy as np
import pandas as pd
import requests
from . import epoch as ep
from .signal import SignalBase, RasterizedSignal, PointP... |
ddd2db6ababc4f1624d33d1b117d1a5f56acd7b559b02f576d080fdc7dae9f22 | Python | 83,562 | 2,182 | #!/usr/bin/env python3
# Copyright 2024 Image Analysis Lab, German Center for Neurodegenerative Diseases (DZNE), Bonn
#
# 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.apac... |
7804f3ae5e8dd1f8922ac94e8db05e65aab15ebdaa7071c2ce81460824a05524 | Python | 83,800 | 1,936 | """
This module is for pupil related tables and computation.
Current version is at 1.0.0 as of 10/29/2019
What's changed in this version:
1. Got rid of filter_config table
2. Added a functionality of removing tracking directory and its sub-directories if the job was not done completely
3. Method name changed from DLC_... |
5c9a74b20bd19db199ad41e2fa7ccd27a4dbaa1583deb6b2d94707d6ce8f6d3b | Python | 84,050 | 1,767 | # Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved
import datetime
import logging
import math
import os
from collections import defaultdict
from copy import deepcopy
from enum import Enum
from typing import Any, Dict, List, Set
import numpy as np
import numpy.typing as npt
import torch
import to... |
b142c1f643a50b9d64616a5bca5d328f65012e58e7a37ae63bbc2541ef82c7d7 | Python | 84,865 | 2,134 | import os
import subprocess
from scipy.spatial import distance
import numpy as np
import pandas as pd
from Bio.Blast import NCBIXML
from pathlib import Path
import sys
from Bio import SeqIO
from Bio.PDB import PDBParser, PDBIO, PPBuilder, Select
from Bio.PDB.Polypeptide import is_aa
from Bio.PDB.PDBExceptions import ... |
79cb8b5296acd420796f9350f68da0072179a3050635c1ac48ff5a9b4190b92d | Python | 85,286 | 2,207 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import csv
import hashlib
import hmac
import importlib.util
import itertools
import json
import os
import re
import site
import socket
import subprocess
import sys
import types
import urllib.error
import urllib.request
import zipfile
from pathlib imp... |
85b67932292b9ef7e497e3029a166056a95bd5d5c7ffab8b3768374987aca76b | Python | 85,629 | 1,755 | """MEA-NAP main application window."""
import json
import webbrowser
from dataclasses import replace
from pathlib import Path
from PyQt6.QtWidgets import (
QApplication, QComboBox, QFileDialog, QLabel, QMainWindow, QMessageBox,
QLineEdit, QTabWidget, QToolBar, QToolButton, QWidget,
)
from PyQt6.QtGui import Q... |
1a865b94af2c79ad44ac5a2361f3e2060a648bf1b8bb55e54f55a4cd6c70e47e | Python | 85,776 | 2,496 | import warnings
import numpy as np
import inspect
import copy
import torch
import torch.nn as nn
from typing import Union, List, Tuple, Any, Dict as TDict, Iterator, Type, Callable, Iterable, Sequence
from torch import Tensor
from torch.hub import load_state_dict_from_url
import hashlib
import json
from tqdm import tqd... |
e081acc1651fbd14b0a9a399723dacb4542d2e913d0fc591d7cdfe6b18196026 | Python | 86,252 | 1,812 | """CAT-NAP pipeline orchestrator (``Params.suite2pMode == 1`` path).
Mirrors the ``suite2pMode`` branches scattered through ``MEApipeline.m``: for
each suite2p recording it denoises (if needed), builds the adjacency matrices +
activity properties (:func:`~meanap.catnap.adjacency.suite2p_to_adjm`), computes
the two-pho... |
8f4e477ba7131a35d9f1ca682b3b7268862d41be6e877300b1f11d23ae585ffe | Python | 86,710 | 2,250 | # Copyright (C) 2018-2022 Intel Corporation
# Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import concurrent.futures
import fnmatch
import itertools
import os
import shutil
from collections.abc import Callable, Iterable, Iterator, Sequence
from contextlib import closing
from copy import deepcopy
... |
8840360039e0b9fe8dedb08c751d9ed92b2f4365e0e1f671243fac1584926fb3 | Python | 86,893 | 2,261 | """
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... |
a299183222839b740a61ee6e052b3e6b5f08fc93d5202320d391e240a18bfc2e | Python | 86,963 | 2,796 | import asyncio
import inspect
import logging
from pathlib import Path
from typing import Any
from unittest.mock import patch
import numpy as np
import obspy
import pytest
import torch
from obspy import UTCDateTime
import seisbench
import seisbench.models
import seisbench.util as sbu
from seisbench.models.base import ... |
de86344e0b1b9eddb1289f312d1ef35dbbc3404a86134c597569f73d2e7e611e | Python | 87,577 | 1,975 | # coding: utf-8
"""Tests for lightgbm.dask module"""
import inspect
import re
import socket
import textwrap
from itertools import groupby
from sys import platform
from urllib.parse import urlparse
import pytest
from sklearn.metrics import accuracy_score, r2_score
import lightgbm as lgb
from .utils import (
Buil... |
b74395dfb4c54620b8691f333019b9a6eb32f604056c7a169f809ef7f4f3224c | Python | 88,196 | 2,271 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import json
from collections.abc import Callable, Collection, Iterable
from copy import deepcopy
from functools import partial
from http import HTTPStatus
from itertools import groupby, product
from typing import Any
import pytest
from cvat_sdk.api_... |
a89dfc73ed147719035e099f269f1b94d00b7846d287be2e3387ceb69415fc18 | Python | 88,295 | 1,246 | import os
import nibabel as nib
import pandas as pd
from nipype import Node, Workflow, MapNode
from nipype.interfaces.utility import IdentityInterface, Merge, Function
from ....bids_data.rename_bids_file import rename_bids_file
from .wmh.wmh_seg_nipype import LSTSegmentation, LSTAI, WMHSynthSegSingle, PrepareTrueNetDa... |
098bb9cf64deba15314dd1a229b58bf90661cf7220fef1be34379deeb384625a | Python | 88,298 | 1,928 | #!/usr/bin/env python3
import logging
from staticnet_experiments import models, configs
from staticnet_analyses import multi_mei, mei
from neuro_data.static_images import stats, data_schemas
import datajoint as dj
from neuro_data.static_images.data_schemas import stimulus, InputResponse
from scipy import ndimage
impor... |
d48e1bbddd994579d404c03bfaf8ee61e21ecf73a16b50a3adea7674e446dd47 | Python | 88,489 | 2,687 | from __future__ import annotations
import dataclasses
import math
import weakref
from collections.abc import Callable
from typing import Final
from unittest.mock import Mock
import numpy as np
import pytest
from PySide6 import QtCore
from PySide6 import QtGui
from PySide6.QtCore import QPointF
from PySide6.QtCore imp... |
6b118882874ee2550b2c5c819a712774e1c729faf9fdc5ae6f068996c9893d02 | Python | 88,508 | 1,989 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Model head modules."""
from __future__ import annotations
import copy
import math
import torch
import torch.nn.functional as F
from torch import nn
from torch.nn.init import constant_, xavier_uniform_
from ultralytics.utils import LOGGER
from ul... |
ab9d14455d0238439ca8617ff4fa2fdb62900298326d0fd8f814aaa301e810ff | Python | 88,526 | 1,484 | import numpy as np
import datajoint as dj
import warnings
from staticnet_analyses import closed_loop, base#, zd_model_base as zd_base
from staticnet_invariance import deis_reconfigured as deis_schema, dei_stimulus_reconfigured as dei_stimulus
from neuro_data.static_images import data_schemas, configs as neuro_configs
... |
077308f55bc77373bf37ac3714ae251207e3ae480eb00ad3d99ca6528f445082 | Python | 88,904 | 1,886 | """Figures for the statistics and machine-learning step.
Drawing rules, which are the ones the rest of the pipeline's figures follow:
* Groups and ages take their colours from
:class:`~meanap.pipeline.palette.ColorScheme`, so a genotype is the same
colour here as on every 4B comparison figure in the same output f... |
7888001e286fb779be63bcdbe6b0fdff204b0ec8450a98146ac33b0ec8af8e74 | Python | 89,097 | 2,154 | """
Background subtraction settings popup for Quadrant Folding.
"""
import copy
from .pyqt_utils import *
from .widgets.collapsible_groupbox import CollapsibleGroupBox
from .ManualBackgroundAssignmentDialog import ManualBackgroundAssignmentDialog
from .BackgroundFittingDialog import BackgroundFittingDialog
from ..uti... |
b2c039f578d846f47b4657211562a680125511360fd8c796277c7b1ca08598f3 | Python | 89,116 | 2,035 | import atexit
import logging
import math
import os
import random
import time
import cv2
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
from scipy.fft import fft2, fftshift
from scipy.linalg import lstsq
from scipy.ndimage import gaussian_filter
from scipy.opti... |
a498eff1cc508928f3f745591964d31393572b29adb741bb7119d29c8f9a3cec | Python | 89,386 | 2,247 | #!/usr/bin/env python3
"""feature_wrapper
===================
Unified orchestration layer for transcript-level feature generation.
This module coordinates multiple feature extraction backends used in the
lncRNA / transcript classification workflow:
* ``bwq`` - BigWig / BigBed quantitative regional summarisation... |
54ca39db77ed928976fe0e638c7532814c557659fca5566462750b8fb1e602b9 | Python | 89,388 | 1,733 | #!/bin/python3
# Arbor simulation of memory consolidation in recurrent spiking neural networks, consisting of leaky integrate-and-fire neurons that are
# connected via current-based, plastic synapses (early phase based on calcium dynamics and late phase based on synaptic tagging and capture).
# Intended to reproduce t... |
a0a12864c8f49725543b1c3ce3e429e97d6c571df072a5ca0e42c0051ee6b4dc | Python | 90,230 | 2,421 | 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... |
61ee3220e814779942f0f429b7bd371b6978970eeb2d8819d30cfcb9dab1b67c | Python | 90,614 | 2,379 | import tensorflow as tf
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Layer
import tensorflow.keras.activations
import tensorflow.keras.layers as layers
class ResidualBlock1(tf.keras.layers.Layer):
'''
Define a residual block with pre-activations with ba... |
1e49af1783f336a777511aad700a2ee5226363ae63e4916f9d13132b6f2d073d | Python | 90,742 | 1,804 | from collections import OrderedDict, namedtuple
from functools import partial
from inspect import isclass
from itertools import product, repeat
import torch
from tqdm import tqdm
from attorch.layers import Elu1
import attorch.losses as losses
from attorch.losses import PoissonLoss, MSE
import datajoint as dj
import n... |
da827324ca61f53cfef88f0bb3afe1f535f187450a053f2c6b2863306893fd76 | Python | 90,884 | 2,358 | from __future__ import annotations
import collections
import dataclasses
import enum
import typing
from collections.abc import Callable
from collections.abc import Sequence
from typing import Any
from typing import Final
from typing import Literal
from typing import cast
import numpy as np
from loguru import logger
f... |
adfed9be489acd318f354cfc98e05386fb6e3971905b60f5eeeca41143f41ed6 | Python | 91,288 | 2,490 | # tifffile/zarr.py
# Copyright (c) 2008-2026, Christoph Gohlke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# t... |
72dc1dc297716cf1f70e8d54d9d536fe2f89997107e9a4803654917438694091 | Python | 91,394 | 2,824 | """This module contains helper functions and utilities for nelpy."""
__all__ = [
"spatial_information",
"frange",
"swap_cols",
"swap_rows",
"pairwise",
"is_sorted",
"linear_merge",
"PrettyDuration",
"ddt_asa",
"get_contiguous_segments",
"get_events_boundaries",
"get_thre... |
686ef437f7d0794b80bd9a814920b98543444fbbbbc3423560b5f2d7201ea56f | Python | 91,458 | 2,106 | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='caffe.proto',
... |
a41b9c09c19f5c41990b00d323efc3ef657d391ad0a1a7eb1774b5556d2fd37e | Python | 92,577 | 2,093 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Model validation metrics."""
from __future__ import annotations
import math
import warnings
from collections import defaultdict
from pathlib import Path
from typing import Any
import numpy as np
import torch
from ultralytics.utils import LOGGER,... |
31b7f0b43844491efc9e7b8d08f9bfa454d75bf7b477081715c115caa4d63b7c | Python | 92,771 | 2,227 | """Step 4 check plots: ``plotConnectivityProperties.m``,
``StandardisedNetworkPlot.m`` (base + betweenness-centrality-colored
variants), ``NodeCartography.m``,
``StandardisedNetworkPlotNodeColourMap.m`` (circular/module variant),
``electrodeSpecificMetrics.m`` (half-violin panel of all node metrics), and
``Standardised... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.