sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
754f940e2ec471d4e37d1968581e27537b147f82feec4f0dfd1cda1ed4af2fdd | Python | 34,725 | 906 | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.... |
24b36e21699f32351fd15f48a626fd6c3b51f09ab739314e44175a8d2a208279 | Python | 34,744 | 962 | import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import functools
from torchvision import transforms
from brainscore_vision.model_helpers.check_submission import check_models
from brainscore_vision.... |
f754ddf420777050c706d062781e7070cf24d47dad21e17677dab3688f878463 | Python | 34,772 | 914 | # Kai Sandbrink
# 2022-10-27
# Script that tests OvB cases
# %% LIBRARY IMPORTS
import numpy as np
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt
import os, random
import itertools
import json
import wandb
import torch
from torch import nn
import torch.nn.functional as F
from torch... |
57b0d3addede432b129833dd3cd9e41fdff387deae8eea3b19837eaed36e1a37 | Python | 34,773 | 1,107 | # -*- coding: utf-8 -*-
"""Map to surface."""
import datetime
import os
import shutil as sh
import sys
import nibabel as nb
import numpy as np
from nibabel.freesurfer.io import (
read_geometry,
read_morph_data,
write_geometry,
write_morph_data,
)
from scipy.interpolate import griddata
from scipy.ndima... |
8664f37e284e55f45418de98569540f7ac470b747c5651afb58901216c577643 | Python | 34,782 | 763 | import concurrent.futures
import json
import math
import cv2
import numpy as np
import pandas as pd
import seaborn as sns
from magicgui.widgets import FunctionGui
from typing import Dict, List, Optional, Tuple
from pathlib import Path
from shapely.geometry import Polygon
from matplotlib.backends.backend_qt5agg import F... |
53e9aaa27864cb89cc15328d4a337d83b2451bc6f9c904ddf8a59d4df8ccecdb | Python | 34,783 | 981 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
339e04d32e1928bda7fd6bb3ead721d2e8b7e55e06220ad07bd89d6ca32f5803 | Python | 34,803 | 717 | """A module that contains the :py:class:`~corelay.plugboard.Plugboard` class. Plugboards manage instances of :py:class:`~corelay.plugboard.Slot`,
which describe values. A :py:class:`~corelay.plugboard.Slot` can be filled using a :py:class:`~corelay.plugboard.Plug`, which represents a concrete
value.
"""
import typing
... |
87ac06cc570534fb16e564d4bb1c2349bcf3ab3556ef9300bb637c86b68e08b1 | Python | 34,816 | 980 | """
Functionality to create an HTML report using a fitted GLM & contrasts.
Functions
---------
make_glm_report(model, contrasts):
Creates an HTMLDocument Object which can be viewed or saved as a report.
"""
import io
import os
import string
import warnings
from collections import OrderedDict
from collections.a... |
4d8a079ea6100c2395706f36eb74b3c927ba4d6c28aa385df41b93deb36d129e | Python | 34,827 | 1,077 | import math
from copy import deepcopy
from typing import Dict, Tuple, Union, List, Optional
import torch
import torchvision.transforms.functional as ttf
from torch import Tensor
from yacs.config import CfgNode
from skoots.lib.morphology import binary_erosion
from skoots.lib.skeleton import bake_skeleton, skeleton_to_... |
f82e1e45bf154d82d618e01443a64f3a7c78592aa8906c9bbf5e50d27dbe6d94 | Python | 34,856 | 1,239 | import datetime
import importlib
import importlib.util
import inspect
from enum import Enum
from pathlib import Path
from typing import Annotated, Optional
from unittest.mock import MagicMock, patch
import pytest
from magicgui import magicgui, types, use_app, widgets
from magicgui.widgets import Container, request_va... |
abc889405951301f16eb415f8b4d79c5ec83e264587098ba7e9c72b33644c8c0 | Python | 34,860 | 818 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from typing import Optional, List, Tuple
from timm.models.registry import register_model
# __all__ = ['ghost_net']
def _make_divisible(v, divisor, min_value=None):
if min_value is None:
min_value = divisor
new_v = max(... |
e0b6728730b99fbefa0e206633585e3bfa14833e870969fe798c25724a373f0a | Python | 34,869 | 603 | #!/usr/bin/env python
#ALLEYOOP:
#Additional sLamdunk heLpEr tools for anY diagnOstics Or Plots
# Copyright (c) 2015 Tobias Neumann, Philipp Rescheneder.
#
# This file is part of Slamdunk.
#
# Slamdunk is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... |
da8c008b108d6af3da589091992cc56615e505ad4c453538a3eb739dc47459bb | Python | 34,874 | 812 | """Put immunostaining cell types on tracked cells.
A cell-type file lists, per marker, the suite2p ROIs that stained positive and
(in the newer format) the ones that stained negative. Getting those labels onto
a tracked cell comes down to one thing: **the ID spaces differ**.
* The files hold **raw 0-indexed suite2p R... |
929fe18e84e1fcd69ff29a36e2b522902d79108a2419c6e51ed1952eda04b5d2 | Python | 34,879 | 957 | #!/usr/bin/env python3
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution ... |
923374aeb5765f511204b1be515e3eb7b1c452f1b4aaf660b629a4d145a3c110 | Python | 34,917 | 682 | #!/usr/bin/env python
import argparse
from collections import defaultdict
from glob import glob
from multiprocessing import Pool
import multiprocessing
import os
import pandas as pd
import polars as pl
import psutil
import pysam
import shutil
import subprocess
import sys
from sys import getsizeof
import time
from tqdm ... |
1ac285f6be35a39248b5ba01538c745a6bdb4dbb1a11e3dbe40e8b0c1cb34e65 | Python | 34,923 | 981 | """
Functionality to create an HTML report using a fitted GLM & contrasts.
Functions
---------
make_glm_report(model, contrasts):
Creates an HTMLDocument Object which can be viewed or saved as a report.
"""
import io
import os
import string
import warnings
from collections import OrderedDict
from collections.a... |
cde90039d85e3536a8df1080edfbb5510a5a96a8e89e66327c0ca5ccb2c42c7f | Python | 34,923 | 771 | #Loading Data Functions
import torch
torch.multiprocessing.set_sharing_strategy('file_system')
import os
import os.path as osp
from torch.utils.data import DataLoader
import sys
os.chdir('/project/ece/roysam/lhuang37/cluster-contrast-reid/')
print(os.getcwd())
sys.path.append('/project/ece/roysam/lhuang37/cluste... |
72a4e61b6ec8a9edcfeaf07e804f4bcbae42f32aba72d2a68aa47be9160a153a | Python | 34,936 | 938 | """Pose-JEPA ViT for clinical and sports score prediction from COCO-17 pose timeseries.
Architecture:
- PoseTokenEmbedding: per-joint coordinate → embed_dim with joint-type + temporal PE
- PoseViT: transformer encoder (shared between context and target encoders)
- JEPAPredictor: small transformer predictin... |
c6ebf6525ed478e6a1852e5593f692bb9ace327c4ac1ea52e8e18b8c7d3fba7f | Python | 34,989 | 753 |
import os
import torch
import sys
import math
import random
import warnings
import torch
import os
import sys
import torch.nn.functional as F
import scipy.spatial as spa
import numpy as np
from tqdm import tqdm
from scipy.special import softmax
from Bio.PDB import PDBParser, ShrakeRupley
from Bio.PDB.PDBExceptions imp... |
7589c240444dbec2afef0914ce7def275710621b20764760b667c4015cf7b950 | Python | 35,125 | 649 | import argparse
import logging
import math
import os
import random
import time
from copy import deepcopy
from pathlib import Path
from threading import Thread
import numpy as np
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_sche... |
16c2c0028280fcdcd1904db676156ca2c73ea6f6e9c30427cbe5f4ab632a01d4 | Python | 35,149 | 978 | # Copyright 2025 BrainX 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 appli... |
90f257dee627d9e20654981859ca39547d670c4919ea3e908b6cfb077403c84c | Python | 35,162 | 1,042 | """Functions to calculate and plot network connectivity."""
import os
import logging
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
from nilearn import plotting
from scipy import stats
from tqdm.auto import trange
from pqdm.threads import pqdm
import matplotlib.pyplo... |
a3cff7946e320ceffbc71e3592d1a833598221d0a4e9f129394f922b56d07335 | Python | 35,182 | 1,002 | # Copyright (C) 2021-2022 Intel Corporation
# Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import io
import json
import os
from abc import ABC, abstractmethod
from bisect import bisect_left, insort
from collections.abc import Iterable, Iterator, Sequence
from enum import Enum
from inspect import ... |
521f84c02c2621d13ab37e1a8ab752316ccd51c67a00c86666335255ba6365ee | Python | 35,203 | 607 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:\PycharmProjects\ISAT_with_segment_anything\ISAT\ui\setting_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.15.11
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless... |
57999ca5bb4ba4a7d9fd9fec6cf9834a17373e6b9f3b5793e6d461413c3da899 | Python | 35,204 | 959 | import io
import math
import os
from collections.abc import Mapping, Sequence
from functools import partial
from typing import IO
import numpy as np
import pytest
from cvat_sdk.api_client import models
from PIL import Image
from pytest_cases import fixture, fixture_ref, parametrize
import shared.utils.s3 as s3
from r... |
bb9d88815a9befdaae43427e1e77eb47c592341ed2121e610ee3fd0e1b69f066 | Python | 35,211 | 966 | from abc import abstractmethod
from functools import partial
import math
from typing import Iterable
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
from models.unet.util import (
checkpoint,
conv_nd,
linear,
avg_pool_nd,
zero_module,
normalization,
... |
2bec3a7317b659985e1943de2ce580be9233e6c6609654964ef9ab6eb060aca3 | Python | 35,262 | 925 | # Import packages
import warnings
warnings.filterwarnings("ignore")
import setuptools
import argparse
import os
import random
import time
from distutils.util import strtobool
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.distributions.categorical import Categor... |
b6277417d58c1bef90a0cccec802fc6accf94b2a1617bea0d2f9745d503c0f5e | Python | 35,294 | 847 | # 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 argparse
import time
import os, sys
import os.path as osp
from shutil import copy
import copy as cp
from tqdm import tqdm
import pdb
from... |
302ef9828a92e29336029691aeb438cc4404fdfe75ad450b12cc9e93814558e0 | Python | 35,296 | 800 | #!/usr/bin/env python
"""
Handles filming.
This module is responsible for everything related to filming,
including starting and stopping the cameras, saving the frames,
etc..
Much of the logic in the main part of Python2/PyQt4 HAL is
now located in this module.
Hazen 01/17
"""
import copy
import datetime
import os... |
24ec3c2596adae428dc721691ac0acd4effa4bb19ff5ff3fec80c35b26f25ca3 | Python | 35,302 | 919 | # Copyright (c) OpenMMLab. All rights reserved.
import warnings
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import build_norm_layer, trunc_normal_init
from mmcv.cnn.bricks.transformer import FFN, build_dropout
from mmcv.cnn.utils.weight_init import constan... |
5e1a614625e96a347ea5f4bf8ec078e6303f81dae72dc1c1a6214608104bb5e0 | Python | 35,306 | 1,009 | """Configuration editor page."""
import copy
import os
from typing import Any, Dict
import streamlit as st
import toml
from chemgraph.utils.workflow_utils import get_removed_workflow_message
from ui import config as ui_config
from ui import deepagent_policy
from ui import providers
from ui.config import (
get_de... |
2384d0a214cc5f7d548ae6c389a55f5b1a458517c904c8095130c42a46e96825 | Python | 35,317 | 946 | import os
import json
import base64
from html import escape
from typing import Optional
from langchain_core.tools import tool
from ase.data import chemical_symbols as _chemical_symbols
from chemgraph.schemas.ase_input import ASEOutputSchema
from chemgraph.tools.ase_core import _resolve_existing_path, _resolve_path
fr... |
cdeffebcb3db9d32c2b07c324c0533ce98b5e5ee3f8854cf398e1513c9d97158 | Python | 35,372 | 1,011 | import os
import h5py
import ast
import logging
import concurrent.futures
import math
import numpy as np
import pandas as pd
from abc import ABC, abstractmethod
from filelock import FileLock
from tqdm import tqdm
from scipy.stats import chi2
from heig import utils
from functools import partial
import heig.input.dataset... |
9e33239cef1ab3650112a0c24c0aa77295dc449b1edf959be224ea9f7fc12a20 | Python | 35,412 | 812 | import numpy as np
from matplotlib.patches import Wedge
import matplotlib.pyplot as plt
def preview_dataset(plot_widget, dataset, xlabel='Timepoint', ylabel='Data', title=None, cmap='hot', aspect='auto', yitems_labels=[], xlim_start=0):
"""
Runs a imshow plot in the plot_widget and applies the attributes speci... |
f89fa74b838155fa5e7f5c84e0adacf127bf7354748e806a6e03e040a620ad30 | Python | 35,457 | 800 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 17 09:21:07 2020
@author: karli
"""
# import packages
import csv
import pandas as pd
import numpy as np
from math import sqrt
import matplotlib.pyplot as plt
from statistics import mean, stdev
import os
import time
import sys
import ast
import pickl... |
5c2b9fce64758eeb6497d9dfc51ea856060afd9d5d0933070304866d0c82c115 | Python | 35,464 | 1,013 | from __future__ import annotations
import typing
from collections.abc import Iterator
from pathlib import Path
import pytest
from PySide6 import QtCore
from PySide6 import QtGui
from PySide6 import QtWidgets
from pytestqt.qtbot import QtBot
from labelme._config import _schema as schema
from labelme._config import lo... |
f7c6747b06991ddd6321956c46cae218400467e18d8a680301d0abda8d302788 | Python | 35,508 | 679 | # /------------------------------------------------------------------------------+
# | 19-JUL-2022 |
# | Copyright (c) Bone Imaging Laboratory |
# | All rights reserved ... |
881c5ccb86261c5e161ca18da5880029194fc0fef4729c3764231b558e739228 | Python | 35,527 | 1,081 | """Widgets backed by a backend implementation, ready to be instantiated by the user.
All of these widgets should provide the `widget_type` argument to their
super().__init__ calls.
"""
from __future__ import annotations
import builtins
import datetime
import inspect
import math
import os
from collections.abc import ... |
8194c3eab061dca72dc2045c37c4408a54503ceb04901159ba90b97f09270f8e | Python | 35,535 | 657 | import argparse
import logging
import math
import os
import random
import time
from copy import deepcopy
from pathlib import Path
from threading import Thread
import numpy as np
import test_Ncla as test # import test.py to get mAP after each epoch
import torch.distributed as dist
import torch.nn as nn
import torch.nn... |
1352595992d5e86668c0891e00553466e685ecc8479286926ca550a202c38a70 | Python | 35,550 | 997 | """ AutoAugment, RandAugment, AugMix, and 3-Augment for PyTorch
This code implements the searched ImageNet policies with various tweaks and improvements and
does not include any of the search code.
AA and RA Implementation adapted from:
https://github.com/tensorflow/tpu/blob/master/models/official/efficientnet/au... |
1f1fe53663515b799cc01777608905365dbc5e52ad14574ef8099653d1f0876b | Python | 35,606 | 950 | # -*- coding: utf-8 -*-
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors
import re
import json
import glob
DIR= os.path.abspath(r"C:\Users")
# if dir not in sys.path:
sys.path.append(DIR)
import torchaskivit.constants as constants
def get_actual_label... |
b3ef012cb0c1685468a15695bb6af4e71783b7255762ed995e6338ae59fd9706 | Python | 35,641 | 654 | import tensornetwork as tn
import tensornetwork.ncon_interface as ncon
from tensornetwork.linalg.node_linalg import conj
from tensornetwork.backends.abstract_backend import AbstractBackend
import numpy as np
from typing import Any, List, Optional, Text, Type, Union, Dict, Sequence, Set, Tuple, Iterable
Tensor =... |
862771b3d07889ac05013b490f8e49ab99451664609c5ead5c2cbb31d2bc8e95 | Python | 35,644 | 1,106 | # -*- coding: utf-8 -*-
import copy
import logging
from multiprocessing import Pool
import numpy as np
import scipy.ndimage as ndi
from dipy.io.stateful_tractogram import StatefulTractogram
from dipy.segment.clustering import qbx_and_merge
from dipy.tracking import metrics as tm
from dipy.tracking.streamlinespeed impo... |
7373fb83866fa3a6064cfe08b4bb32e63f1d357e54a5dc3d0d86384634a2f226 | Python | 35,649 | 750 | """ This is code for the pilot center surround experiment
This is meant to be single use code.
Documentation of experiments ran
22620-4-15 Oct 7 2019 Imagenet (collection 2), source
22620-4-17 Oct 7 2019 ImageNet (collection 2), repeat
22620-5-11 Oct 8 2019 ImageNet (collection 2), repeat
22620-5-13 Oct 8 2019... |
46292826b104731acbb0ad747573f32051ca8b3ee2a8b774537dc5dd804138ad | Python | 35,765 | 815 | # 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
#
# Unless required by applicab... |
3f1f79b7b790580418e6724c0ca8d1c61fc6e1780e0eba80819c68f7f11671cf | Python | 35,772 | 1,024 | """Module to generate networkx graphs."""
from jarvis.core.atoms import Atoms
from jarvis.core.atoms import get_supercell_dims
from jarvis.core.specie import Specie
from jarvis.core.utils import random_colors
import numpy as np
import pandas as pd
from collections import OrderedDict
from jarvis.analysis.structure.neigh... |
97dc24ece34bde760bc0c42925a7fa1d04a6d0d3e2e6f9833982ea1450165317 | Python | 35,816 | 826 | import numpy as np
import time
from numba import njit, prange
import scipy.sparse as sp
from ..graph_data import GraphData
from .. import unseeded
import sys, os
from contextlib import contextmanager
@contextmanager
def _suppress_stdout():
"""Suppress prints inside the with-block."""
devnull = open(os.devnu... |
47e1b5a4b0cc82d3fe3143e32bbc2dee27bec67f1c5f1425e6f4ff57e55f23a7 | Python | 35,821 | 776 | ################################################################################
# Author: Joy Roy, William Reynolds, Rafael Ceschin
# Purpose: The following is a pipeline made by PIRC at UPMC CHP in order to
# preprocess BOLD fMRIs and to use those outputs for similarity
# matrix generation.
#
#
# ... |
493dc37a5a1ea3bfd06849adde823f64567860f8de868d9ce757e6610f3a3801 | Python | 35,822 | 882 | """
DMC-BrainMap widget for preprocessing of .tif files.
2024 - FJ
"""
import os
import platform
from pathlib import Path
from qtpy.QtCore import Signal
from qtpy.QtWidgets import QPushButton, QWidget, QVBoxLayout, QMessageBox, QProgressBar
from superqt import QCollapsible
from joblib import Parallel, del... |
4e8bc2b4bdbe114e298eaa810129b7a5c972de19cf1a6ae697e85c571f0f28f9 | Python | 35,842 | 1,028 | import os
import h5py
import numpy as np
import pandas as pd
import threading
import concurrent.futures
from filelock import FileLock
from abc import ABC, abstractmethod
from scipy.stats import chi2
from heig import sumstats
import heig.input.dataset as ds
from heig.ldmatrix import LDmatrix
from heig.ldsc import LDSC
... |
8dc42970c45dd5a4b6867e8dc5e9c07da2987d802e63e14261fe1ead8c71dccc | Python | 35,875 | 767 | '''
This script performs knock-out analyses for rERP models in the exemplar task.
Briefly, because we use dense design matrices, raw coefficients lose some of
the interpretability (i.e., we cannot interpret time courses as impulse responses
to sparse events, but as responses relative to a baseline instead). To allevia... |
c62aca2a2ef595ab2e13e8298b3438c327ad7b5b4ececbb7e7e258be3eefbfdf | Python | 35,885 | 1,290 | # encoding : utf-8
"""This file contains the nelpy plotting functions and utilities.
Some functions Copyright (c) 2016, Etienne R. Ackermann
Some functions are modified from Jessica B. Hamrick, Copyright (c) 2013
'get_color_cycle', 'set_palette', and 'desaturate' are Copyright (c) 2012-2016, Michael L. Waskom
'FigureM... |
edd86a1bb6c00db1923059ac639458b990cc059983cf1fee7b366f16ef71793d | Python | 35,886 | 975 | # -*- coding: utf-8 -*-
from concurrent.futures import ProcessPoolExecutor, as_completed
from copy import deepcopy, copy
import logging
import warnings
from dipy.data import get_sphere
from dipy.reconst.shm import sh_to_sf_matrix
from dipy.segment.clustering import qbx_and_merge
from dipy.segment.fss import FastStrea... |
7cea98fac4bb23535453abe7172904a54dc2ff0d763b7ed9e9cdccbc3ea8e55d | Python | 35,894 | 1,030 | from collections.abc import Iterator
from dataclasses import dataclass
from typing import TYPE_CHECKING, cast
import torch
from sympy import Symbol
from sympy.solvers import solve
from torch import nn
from eir.models.layers.cnn_layers import (
CNNResidualBlock,
ConvAttentionBlock,
DownSamplingResidualBloc... |
1809b93508dfb0852937cafbadc135f6539ce2a5c29ba21e3cc94fe9761548d0 | Python | 35,923 | 970 | """Temporal Interval Network Density Analysis (TINDA).
This module contains functions for calculating the density profile (i.e.,
fractional occupancy over) in any interval between events it is originally
intended to use it on an HMM state time course to ask questions like what is
the density of state :math:`j` in the ... |
bb18369e5233b0bfe1a6b8fd92028b13d4f7eaa5d304ad63d4d64c2d3b2a3bd7 | Python | 35,945 | 1,058 | """
Evaluate absorption-scattering surface and Shapley coefficients
of the forward surrogate model.
Features:
- 3D surface plotting of reflectance predictions
- SHAP-based model explainability analysis
- Ensemble model handling for SHAP compatibility
- Plot saving and formatting utilities
"""
import os
import matplo... |
7bec57adbf0e3e224e7b69d4bfa53648714e24b15caef0f8304f10f37a9c1a37 | Python | 35,976 | 1,118 | # 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... |
f69836b1a83b4df1059ec3518d78f100536ad95fc652bbcdacca76de89695dc1 | Python | 36,008 | 852 | # 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 argparse
import time
import sys
from pathlib import Path
import os
sys.path.append(str(Path(os.path.abspath(__file__)).parents[3]))
impor... |
cd7484c8bc242511ec04b04027597e4db670421bfdd4a8506154b5b96d905da2 | Python | 36,020 | 1,031 | import os
import h5py
import numpy as np
import pandas as pd
import threading
import concurrent.futures
from filelock import FileLock
from abc import ABC, abstractmethod
from scipy.stats import chi2
from heig import sumstats
import heig.input.dataset as ds
from heig.ldmatrix import LDmatrix
from heig.ldsc import LDSC
... |
bb13b3cedbc69c87e8e8320e3bcd3cc05a0ba5f2050c95cf4a3158819c4abb28 | Python | 36,048 | 617 | ### script for writing meta information of datasets into master.csv
### for link property prediction datasets.
import pandas as pd
dataset_dict = {}
dataset_list = []
### add meta-information about protein function prediction task
name = 'ogbl-ppa'
dataset_dict[name] = {'eval metric': 'hits@100', 'task type': 'link p... |
5358c1c81dc6b0d0a5d1e29c76482b87b3867ff9265856fb46ea888c5c9c90b9 | Python | 36,089 | 1,115 | """
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... |
30441c9dac0cd58ee8ee7854dd2b4128dc7ed23e2c56d2055e242faf9959fa25 | Python | 36,102 | 885 | # coding: utf-8
"""Library with training routines of LightGBM."""
import copy
import json
from collections import OrderedDict, defaultdict
from operator import attrgetter
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
import numpy as np
from . import callback
... |
ad27ad7e971c955518c734b0472c27710503f9135fa6477d70e46b55b55d0eb0 | Python | 36,103 | 812 | #!/usr/bin/env python
"""
Handles filming.
This module is responsible for everything related to filming,
including starting and stopping the cameras, saving the frames,
etc..
Much of the logic in the main part of Python2/PyQt4 HAL is
now located in this module.
Hazen 01/17
"""
import copy
import datetime
import os... |
de6abe4061e6eb787bc04dbc6a2a58dd410fb47a31fcb5ee52d241fbed6e551b | Python | 36,107 | 1,279 | #!/usr/bin/python
#
## @file
#
# Collection of classes that control the establish the basic operation of dave
# as it issues various types of commands to HAL and Kilroy
#
# Jeff 3/14
#
# Hazen 09/14
#
from xml.etree import ElementTree
from PyQt5 import QtCore
import storm_control.sc_library.tcpMessage as tcpMessage
... |
ccbec11513ff6ccc7f3c0ed9b72110f101a486082d2600255c965e9fbae4ae48 | Python | 36,125 | 642 | """
If you use this code, please the SynthSR paper in:
https://github.com/BBillot/SynthSR/blob/master/bibtex.bib
Copyright 2020 Benjamin Billot
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:... |
9e3ca74d89cb204822b543a8455a390748644dbaef1c11dd034f411474b06f6a | Python | 36,150 | 868 | #############################################################################
# Copyright (C) 2020-2026 MEmilio
#
# Authors:
#
# 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 with the License.
# You may... |
12e828795a6b1ae0fc6d77c32db5653bb706e58fd10ef7e7e4576239cc5c6ee4 | Python | 36,185 | 879 | """MEA spike detection algorithms — Python port of MATLAB WATERS.
Implements threshold-based and wavelet CWT-based detection, matching the
behaviour of the MATLAB ``detectSpikesCWT`` / ``detectSpikesThreshold`` /
``detectSpikesWavelet`` functions in ``Functions/WATERS-master/``.
Both the threshold and the wavelet CWT... |
29ce69fab079abed1ef25636da5f8e7504ec713c4987695312979114c74be116 | Python | 36,186 | 957 | import os
import os.path as osp
from functools import partial
from math import pi as PI
from math import sqrt
from typing import Callable, Dict, Optional, Tuple, Union
import numpy as np
import torch
from torch import Tensor
from torch.nn import Embedding, Linear
from torch_geometric.data import Dataset, download_url... |
9269d4b92bf9315484f3ef955a704d2087073532e29d4a5adc4860dceb303fcb | Python | 36,202 | 803 | import numpy as np
import random
from pyrosetta import *
# from utils_trX2dy.top_prob import *
def gen_rst(npz, tmpdir, params):
if params['USE_ORIENT'] is True or params['USE_ORIENT'] == "True":
dist, omega, theta, phi = npz['dist'], npz['omega'], npz['theta'], npz['phi']
# dictionary to store Ros... |
8e3a6371a5e898a35a7b3fba7bfe54892680f9ba78b015672baf5a316189a449 | Python | 36,243 | 916 | # Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved
"""
COCO evaluator that works in distributed mode.
Mostly copy-paste from https://github.com/pytorch/vision/blob/edfd5a7/references/detection/coco_eval.py
The difference is that there is less copy-pasting from pycocotools
in the end of the file,... |
9d0772c3be1ead21e841d2fcfd4e994bb1966863f867e2abafa31b92763b358c | Python | 36,283 | 1,131 | from __future__ import annotations
from collections.abc import Callable
from collections.abc import Collection
import pytest
from PySide6 import QtCore
from PySide6 import QtWidgets
from pytestqt.qtbot import QtBot
from labelme._widgets._label_dialog import LabelDialog
from labelme._widgets._label_dialog import Labe... |
169309e1b1cd3910e5413737039d7fdfd9707f6f854b60d64c2ce5bcdcb5bc5c | Python | 36,300 | 686 | """Test the local web viewer: real HTTP requests against a real bundle.
Run from the repo root::
uv run python python/test_viewer_server.py
Driven over a socket rather than by calling handlers directly, because the
things most likely to break are at that boundary — query-string coercion, the
content types a brow... |
fb1ff8c687f55a6ec517120598f0765cdf66bee8ecfc3c036b275cf7a830c403 | Python | 36,305 | 1,003 | """
Smoke tests for the fitting A/B framework.
These tests:
1. Build a synthetic ``FitCase`` (no real image needed).
2. Run it through every registered adapter.
3. Save & load the case via pickle (round-trip schema check).
4. Verify ``LmfitBaselineAdapter`` reproduces the same ``result.values`` as
the original ``m... |
859b79094008a67b89866f763718ea7e89e140435968e7eb6697b6a725ba8645 | Python | 36,323 | 925 | """Network metrics, ported from the Brain Connectivity Toolbox
(``Functions/2019_03_03_BCT/*.m``) as called by ``ExtractNetMet.m``.
Most of this module is *pure, deterministic functions of a fixed adjacency
matrix* — ND, NS, MEW, Dens, CC (raw), PL (raw), Eglob, Eloc, BC, NE, plus
``participation_coef`` (raw), ``modul... |
8ab33204548fb1ce8b31f3d5766c7e38518e0bc32f4745eb17436b5773af94d1 | Python | 36,333 | 946 |
import torch
import numpy as np
import itertools
import h5py
import os
import yaml
import torchvision
import random
import subprocess
import tempfile
import shutil
import random
# *******************************************************************
# Functions to import and export data
# ******************************... |
7e42fe84f266bbccda1b6bcdca9d8addcbf45a560cba4ce0539fd40ac09f1620 | Python | 36,348 | 521 | import os
import pandas as pd
import numpy as np
import kipoiseq
import random
import pysam
from lightning.pytorch import LightningDataModule
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
class GTExDataset(Dataset):
def __init__(self,
tis... |
3b96a1193ddcef55056973208a2f18d1d44d0a93a9e30af86cf4b28ad7872b98 | Python | 36,387 | 802 | import json
import traceback
import warnings
import numpy as np
import matplotlib.pyplot as plt
import pytorch_lightning as pl
import torch
from typing import Any, Optional, Dict, List, Union, Sequence
from torch import Tensor, nn
from ..optim.lr_scheduler import SequentialLR
from itertools import chain, product
from t... |
6ccb678c8eec32d5e1115a718c95c421e09e14e2ae1e69350a21575aaaad0abb | Python | 36,401 | 783 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import csv
import glob
import math
import os
import time
import urllib
from dataclasses import dataclass
from functools import partial
from io import BytesIO
from multiprocessing.pool import ThreadPool
from pathlib ... |
400c4b1572bc074757440603bf4ea5b931a4a529fdaba3f6a4aeadf8c292c497 | Python | 36,430 | 835 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import contextlib
import math
import re
import time
import cv2
import numpy as np
import torch
import torch.nn.functional as F
from ultralytics.utils import NOT_MACOS14, TORCH_VERSION
from ultralytics.utils.checks... |
eee39bbe6f062fc7a6372695827be09fcdc290b857b1c50a66dbe1a1a506a56c | Python | 36,451 | 1,019 | """DIVE (DyNeMo with Integrated Variability Estimation)."""
import logging
from typing import Dict, List, Optional, Tuple, Union
from dataclasses import dataclass
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.keras import layers
import osl_dynamics.data.tf as dtf
fro... |
0d444d65b89fee04648836a08c0540bf24f56494a90ba004b20bab7c176927c3 | Python | 36,455 | 1,039 | import math
from collections import OrderedDict
from typing import Any, Optional, Sequence
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import seisbench.util as sbu
from .base import WaveformModel
# Architecture presets for the three model sizes published with SeisT.
# The d... |
2278ce7bc0365fc9a1d1b9f0a2cf8ee3a46e8caca128f34101738d3b0a0654de | Python | 36,462 | 937 | # 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 ast
import collections
import contextlib
import inspect
import logging
import os
import re
import time
import traceback
from collection... |
2c39a5b95d2743f652d4c0d1ebb3a3ec23ee650ad5c7c90df9477e4107748477 | Python | 36,475 | 891 | # flake8: noqa
import itertools
import json
import os
from collections import defaultdict
import numpy as np
from scipy.optimize import linear_sum_assignment
from .. import _timing, utils
from ..utils import TrackEvalException
from ._base_dataset import _BaseDataset
class TAO_OW(_BaseDataset):
"""Dataset class... |
6625438c36b57f46297704bc57550d303c2b4837cd2f89982eb33a242ec91772 | Python | 36,495 | 827 | from dataset_src.utils import normalize, safe_index, one_hot_res, log, dihedral, NormalizeProtein, dataset_argument, get_stat
import argparse
from ast import Continue
from json import load
from typing import Callable, List, Optional
from torch_geometric.loader import DataLoader
import os
import torch
import sys
import ... |
226c677165e190b85e16e9602e83b5d1094f7abd6abf4e9212aad2c9a763eb76 | Python | 36,507 | 880 | import EIANN.network as nt
import EIANN.utils as ut
import EIANN.external as external
import os
import pickle
import dill
import datetime
import torch
import matplotlib.pyplot as plt
import numpy as np
def build_EIANN_from_config(config_path, network_seed=42, config_format='normal', training_kwargs=None, device='cpu'... |
449ff444f7a992954553b64ba09cb64c6fddb149f561cda640074e8f632a6db3 | Python | 36,514 | 826 | """Represents the server of ViRelAy, which contains the backend REST API and serves the frontend web app."""
import functools
import io
import logging
import threading
import traceback
import webbrowser
from importlib.resources import as_file, files
from typing import Any, BinaryIO, cast
import flask
import flask_cor... |
ae8d9f743388d6c5dfb2d5c0d31a4dc7286e73826698a6d96e90551fcbe69b19 | Python | 36,520 | 803 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from __future__ import annotations
import torch
import torch.nn.functional as F
from torch import nn
from ultralytics.nn.modules import LayerNorm2d
from .blocks import (
Block,
CXBlock,
Fuser,
MaskDownSampler,
MultiScaleBlock,
... |
201e5e31c5251b5d7b12cc0db14f41977bb8a38c9522d5211015e5f72be83ae3 | Python | 36,573 | 957 | import torch
import sys
import os
import random
import csv
from datetime import datetime
from numpy import array, cross, pi, arccos, sqrt
import matplotlib.pyplot as plt
from tqdm import tqdm
from time import time
import numpy as np
# import seaborn as sns
import argparse
# from torch_geometric.data.datapipes import fu... |
e8da96bf6fbc108f81e0149a00fe6ee45007c9034ba11f3eba0fdb28895b1af9 | Python | 36,588 | 809 | # !/usr/bin/env python
# coding: utf-8
# @Time : 2022/7/17 14:26
# @Author : Z.-H. G.
# @Email_0 : guozhenhao17@mails.ucas.ac.cn
# @Email_1 : guozhenhao@tongji.edu.cn
# @File : base2.py
# @IDE : PyCharm
import torch
import dgl
import copy
import scanpy as sc
import numpy as np
import pandas as pd
import net... |
f45f8678e2b3812c3aa8de03bbc09cf638a82360e4e3cdc487ee055fe71ceda8 | Python | 36,606 | 905 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import textwrap
from datetime import datetime, timezone
from django.db.models import Q
from django.http import HttpResponse
from drf_spectacular.types import OpenApiTypes
from drf_spectacular.utils import (
OpenApiParameter,
OpenApiResponse,... |
a274fb0f91e5e4da0d379d27926dbed54da469e5ce6a142a0cc94e1974b24d37 | Python | 36,626 | 795 | '''
This script performs knock-out analyses for rERP models in the learning task.
Briefly, because we use dense design matrices, raw coefficients lose some of
the interpretability (i.e., we cannot interpret time courses as impulse responses
to sparse events, but as responses relative to a baseline instead). To allevia... |
fdae11f999680ec82c095cd941edc22fdfd240a9fb74ebe9230d7c63a7419575 | Python | 36,649 | 872 | # 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 argparse
import time
import os, sys
import os.path as osp
from shutil import copy
import copy as cp
from tqdm import tqdm
import pdb
from... |
19d80dee79ad177fc630068c0877269542ab220b8aa21f5dfafe01af08bf8dde | Python | 36,691 | 851 | """
Worker functions for parallel thickness measurement.
This module is intentionally minimal to avoid importing heavy dependencies
(pycurv, graph_tool) in multiprocessing worker processes.
"""
import numpy as np
import scipy.optimize as opt
# Bilayer fit-quality thresholds, shared by the per-triangle and global fit... |
f2f56df88340a16b1e21e74f23c84f1a5a030b10fa84d320f673e85648216201 | Python | 36,697 | 800 | import warnings
import numpy as np
import datajoint as dj
import matplotlib.pyplot as plt
from scipy import interpolate
from itertools import groupby
from pipeline import fuse, shared
from pipeline.exceptions import PipelineException
stimulus = dj.create_virtual_module("stimulus", "pipeline_stimulus")
treadmill = dj.c... |
f108c5a1839a65058f77dcf5fa0ccfcf8cde75af85178eed709c13777da8d0fe | Python | 36,699 | 856 | import ast
import itertools
import multiprocessing
import os
import random
import time
from collections import deque
from copy import deepcopy
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch import nn, optim
from torch.distributions import... |
601bb5b1c25791575f3ebbfdc41b510de9730fc5ef1b09d8bdd6c14f878da60c | Python | 36,739 | 811 | import pathlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras import backend
#plot history
def plot_history(history):
hist = pd.DataFrame(histor... |
e20062d3e7caf466debc337b075f14104d61045da8a265465d569cc65a0c3ae4 | Python | 36,754 | 958 | # Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved
"""
Transformer decoder.
Inspired from Pytorch's version, adds the pre-norm variant
"""
from typing import Any, Dict, List, Optional
import numpy as np
import torch
from ..sam.transformer import RoPEAttention
from torch import nn, Tensor
from... |
816a851113b2444bce78c0bf472e6b8937b7a0a32b7780591ce9468ebbd1ba7e | Python | 36,760 | 859 | import importlib
from nipype.interfaces import afni
import nipype.interfaces.utility as utility
from PUMI.engine import GroupPipeline, NestedNode as Node, QcPipeline
from PUMI.utils import plot_roi, get_reference, relabel_mist_atlas
@GroupPipeline(inputspec_fields=['labelmap', 'modules', 'labels'],
out... |
cb345dd3171d9baece7840c6e11f4d27e418faf7a2111cb50518446a2b9344d6 | Python | 36,774 | 1,005 | """
SQLite-based session storage for ChemGraph conversations.
Provides persistent storage for session metadata and message history,
enabling session listing, resumption, and context injection.
"""
import logging
import json
import os
import sqlite3
import stat
from collections.abc import Iterator
from contextlib impo... |
3f7851c0344c86bc09edd9180c5e3e106c695e37d22d66e28979581458d0f658 | Python | 36,800 | 890 | # wfield - tools to analyse widefield data - IO tools
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.