sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
96dd9a9dc58a289b38c9c0034a66a3332eecc0f49052e91d37ebc9faac75f516 | Python | 33,183 | 658 | """
@author: Tan Nguyen
"""
import pickle as pkl
import pandas as pd
import numpy as np
import scipy.stats as stats
from sklearn.metrics import adjusted_mutual_info_score
import scipy.interpolate as interp
import re
import glob
import os
import sys
from joblib import Parallel, delayed
import random
from glob import g... |
4cb3cce34709e749963d84d4a8dedbb0ff36eb14b7b0b8b3ff7304afdfd7bd7b | Python | 33,185 | 754 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 22 10:09:15 2019
@author: hannekevandijk
"""
import numpy as np
import os
import matplotlib.pyplot as plt
import scipy.io as sio
class interdataset(object):
def __init__(self, d):
self.__dict__ = d
def copy(self):
'''
... |
d2534b62dd78bd52eb7248d5761fcca3dd468a28660c3b7249e70794d311cc69 | Python | 33,190 | 517 | import os
import glob
import math
import numpy as np
import torch
from torch.nn import functional as F
from torch_scatter import scatter_sum, scatter_mean, scatter_add
from torchdrug import core, tasks, layers, models, metrics, data
from torchdrug.data import constant
from torchdrug.layers import functional
from torc... |
bd890212cf581ee7f85e896367b9ebb83292a0734d3bcc69e785a9b912de8838 | Python | 33,245 | 869 | """D-calibration and KS variants for censored survival and competing risks."""
from __future__ import annotations
import numpy as np
from matplotlib import pyplot as plt
from scipy.integrate import trapezoid
from scipy.stats import chisquare
from SurvivalEVAL.evaluations.util import (
check_and_convert_event_ind... |
65d1a536daf9f0551815d72bd95e2159074881c1bd183a9f6e52d757736f39c8 | Python | 33,270 | 651 | #!/usr/bin/env python
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import os
import numpy as np
import pandas as pd
from pKa_analysis import mae, rmse#, barplot_with_CI_errorbars
from pKa... |
106c670a06f7387577c2aa660bf0e5de4c4f1150169435ed8eda7296f73d8ecd | Python | 33,279 | 843 | # Copyright 2020 The HuggingFace Team. 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 applicabl... |
bf0557a85d08909d2a2cb443debd76766371aa936298550adfae0c0f7b51bb44 | Python | 33,425 | 813 | import functools
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils import checkpoint
from torch_scatter import scatter_mean, scatter_add, scatter_max
from torchdrug import data, layers, utils
from torchdrug.layers import functional
class MessagePassingBase(nn.Module):
"""
... |
90e3e7d2a603eb1453cdac5ba937588922270591e5eb7efd009b32220cd818b6 | Python | 33,460 | 1,094 | """
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import codecs
import contextlib
import io
import os
import re
import socket
import struct
import sys
import tempfile
import warnings
import zipfile
from collections... |
f7ab9d07d4814b6f5d045499eb616825f6987e469830607b052199e0b570498d | Python | 33,461 | 986 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
adbca33bfe652d35d759e8116818710c3c7f3f8f295a7e064a8c4ea1b7fd4d58 | Python | 33,469 | 604 | import sys
assert('neuron' not in sys.modules)
import os
nrn_options = "-nogui -NSTACK 100000 -NFRAME 20000"
os.environ["NEURON_MODULE_OPTIONS"] = nrn_options
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.animation as animation
imp... |
b4b97c10d169dedcdc6b094ad5f98f1b9a0a452b84928048d8be5947fe143c63 | Python | 33,471 | 695 | import os
import struct
import torch
import numpy as np
import bitarray as ba
from utils.option import OptionClass, class2dict
"""
% The MRC image header has a fixed size of 1024 bytes. The information within the header includes a description of the extended header and image data. The column, row, and section are equi... |
c489397d4af458a5b32e877b533905c421728927f59f036236834bc8c855ea75 | Python | 33,503 | 924 | import os
import string
from collections import defaultdict
from unittest import TestCase
from codex.data.auto_naming import assign_names_from_annotations
from codex.data.brain_regions import REGIONS, HEMISPHERES
from codex.data.local_data_loader import (
read_csv,
)
from codex.data.neuron_data_initializer import ... |
1205d7a95f53a3e6f876e096d8d4d0d51dda1eb9f8c64fdb6effef0eb86f9a89 | Python | 33,510 | 750 | """
Script for a GUI allowing to generate BIDS-compliant json sidecar files for one or more selected files.
Part of the information to be added to the sidecar file is automatically extracted from the file name and path
and part has to be manually inserted by the user thorugh the GUI.
***The input files need to be alre... |
c3353257ca6bed9d4a9d44d02586378c25ed13363f152b9e86d9e2f70a2b6595 | Python | 33,590 | 903 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
5c5a3dee3ef45b305c08001d9bc7691a74a3faa7653b61e4a86f2ffe75c1c92a | Python | 33,614 | 825 | import os
import sys
import pdb
import copy
import numpy as np
import tensorflow as tf
import util_signal
def build_network(tensor_input, list_layer_dict, n_classes_dict={}):
"""
Build tensorflow graph for a feedforward neural network given an
input tensor and list of layer descriptions
"""
tenso... |
547aff98b1ac5d9e8b5b10bc37c75f7f45a445b1e8436356cf70ed0e6e76b928 | Python | 33,616 | 1,003 | # ImageNet 2012 id's to class names
id2label = {
0: "tench, Tinca tinca",
1: "goldfish, Carassius auratus",
2: "great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias",
3: "tiger shark, Galeocerdo cuvieri",
4: "hammerhead, hammerhead shark",
5: "electric ray, crampfi... |
ec90e7f81b2738f3fb38b9bbe2046f7636e9ebd13d3c9e1759bf547c47db0f89 | Python | 33,636 | 676 | #!/usr/bin/env python
from __future__ import division, print_function
import glob
import multiprocessing as mp
import os
import sys
from typing import List, Literal, Tuple, Union
import numpy as np
import pandas as pd
from PIL import Image
import psutil
import topaz.methods as methods
import topaz.model.classifier a... |
a58ecc9847fd27c502bf2213243edf963d3ae239844e6075e6e82d7ef6347909 | Python | 33,718 | 827 | from Pose_mmpose_new import Pose_mmpose as Pose_mmpose
from mmpose.models import build_posenet
import numpy as np
import torch
import torch.nn as nn
import PoseTools
import logging
import pickle
import os
import xtcocotools
from xtcocotools.coco import COCO
## Bottomup dataset
import cv2
from mmpose.datasets.builder ... |
2f4b6d325c4ac2fd1815adebc63cc3f5f630ce7fde4778dd90ee2142add569ae | Python | 33,733 | 1,035 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
199824cc849bf5bb349bbedba1b790ed052afee3e642c00d3ee67936e4fe0d57 | Python | 33,747 | 794 | import argparse
import collections
import gzip
import math
import os
import random
import shutil
import subprocess
import sys
import time
sys.path.insert(0, '/home/jupyter/repos/genformer')
import numpy as np
import pandas as pd
import tensorflow as tf
import pybedtools as pybt
import tabix as tb
from datetime impor... |
3e9eb4bd71ace6e37084cfc88e7ed8d1c19d01aef73be59762feac3f0d46e4d1 | Python | 33,755 | 862 | #!/usr/bin/env python
"""Functions for the efficiency statistical analysis."""
# =============================================================================
# GLOBAL IMPORTS
# =============================================================================
import copy
import numpy as np
import scipy as sp
import ar... |
832ccb3cbd3a0b77f2c70da014dad48d8b2f0266ffaf023dac5f9529f4f5ae48 | Python | 33,758 | 894 | """
Create a wheel that, when installed, will make the source package 'editable'
(add it to the interpreter's path, including metadata) per PEP 660. Replaces
'setup.py develop'.
.. note::
One of the mechanisms briefly mentioned in PEP 660 to implement editable installs is
to create a separated directory inside `... |
10c04e92cf68c75e440ca07c9e46ddbf731d157a6391ff94a2172987c6777050 | Python | 33,836 | 782 | ## Generic code for running types of shit.
import PoseTools as pt
import copy
import os
alice_dstr = '20210628'
sdir = '/groups/branson/home/kabram/bransonlab/APT/deepnet/singularity_stuff'
# simg = '/groups/branson/bransonlab/mayank/singularity/tf23_mmdetection.sif'
simg = '/groups/branson/home/kabram/bransonlab/sin... |
5a6bbc5a9b9f7ea82823f76d40bb0f755cb50c64292cc6c95d20c3046fdef580 | Python | 33,846 | 687 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import copy
import csv
import numpy as np
import numpy.lib.recfunctions as rfn
import DiscRisk_constants as CONSTS
from DiscRisk_utilities import loadRawDataFromPickleFile, checkFieldsExistInData, appendToData,... |
7f49cb9d7df077728d7cccdf290044d667e2709ec0ecdd8dd3f4e3aa8db37dba | Python | 33,850 | 865 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright (C) 2012 Computational Neuroscience Group, NMBU.
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
(at you... |
edb74c93c763d92b5315872d3fdb28aa4caffa2de47f0187e11831d25ccfe740 | Python | 33,853 | 1,121 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
061228f406221f646aad50bd8509348d7edf36219f03e19d994f379708fffb74 | Python | 33,854 | 1,196 | #!/usr/bin/env python3
"""
HED Command Line Interface.
A unified command-line interface for HED (Hierarchical Event Descriptors) tools.
Provides a git-like interface with subcommands for validation and schema management.
"""
import click
from click_option_group import optgroup
from hed import __version__
# Consiste... |
91c59e96c7ddd8384c9f7aec5a70f2579cc7fdee5da33afee8807e4fd43daab4 | Python | 33,859 | 787 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from torchvision.models.detection import FasterRCNN
from torchvision.models.detection.backbone_utils import resnet_fpn_backbone
import os
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import t... |
a1a02a2e7938717e0eccd330cc3cafe52db6fc76718f8ae09a8c71b2d385b575 | Python | 33,945 | 581 | # -*- coding: utf-8 -*-
"""
Created on Wed April 03 14:27:26 2019
Description: Cortico-Basal Ganglia Network Model implemented in PyNN using the simulator Neuron.
This version of the model loads the model steady state and implements DBS ampltiude
modulation controllers where the beta ARV from the STN LFP is cal... |
8d3c09a5a4730ec2de170b3c8ea46da78971699d11491fc62eb52c9dc9ed16ae | Python | 33,955 | 827 | import torch
import os
import numpy as np
import json
import pickle
import sys
from collections import OrderedDict
import logging
import PoseTools
#import tfdatagen
import time
#import tensorflow.compat.v1 as tf # type:ignore
# ISTFR = False
# try:
# from tfrecord.torch.dataset import TFRecordDataset
# ISTFR ... |
71b0cf2af98cd310de48abea43094468aac2995e3350960de0b2d654c53c73a6 | Python | 33,961 | 1,011 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
ade90d3392875ce0f498a8aef9e7e066f7733215308e0f71d44268a338bcdab5 | Python | 33,997 | 719 | from __future__ import print_function
import argparse
import datetime
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "7"
# os.environ['JOBLIB_TEMP_FOLDER'] = '/tmp'
import platform
import sys
import time
import random
import math
import numpy as np
import torch
# import numpy.distutils
# import numpy.distutils.__conf... |
64ec5c77d40b1485a17c33d42a41905704e1d3bec7bef2c5185a934331019323 | Python | 34,002 | 997 | import tensorflow as tf
import tensorflow_addons as tfa
tfa.options.TF_ADDONS_PY_OPS = True
@tf.keras.utils.register_keras_serializable()
class Token(tf.keras.layers.Layer):
"""Append a class token to an input layer."""
def build(self, input_shape):
cls_init = tf.zeros_initializer()
self.hid... |
ba2fddb2dc8220cba01b05b4c749644a9627c5bc1c32e9ea7e85811235506cb1 | Python | 34,006 | 978 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
ea1048f26060df36b64357296a1dd7e03b5a743bc25a47c60d433652f407ae83 | Python | 34,071 | 705 | from collections import ChainMap
from collections.abc import Mapping, Sequence
from typing import Any, Literal
import blitzgsea
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
from anndata import AnnData
from fast_array_utils.conv import to_dense
from matplotlib.axes import A... |
080a5e6c8def2147180cb40063f8034611d3e6c09b5d2d28d30892156797169b | Python | 34,091 | 1,079 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# 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,... |
3bd8f2e581e09ed9bd72cf80e6ecba6fc0e05bd35477046c951c20d5bb8bd6f5 | Python | 34,139 | 945 | import sys
sys.path.append(".")
import io
import json
import os
import shutil
import sys
import time
from pathlib import Path
from PIL import Image, ImageEnhance
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from src.UI.gan_pipeline_settings import GanPipelineSettingsDialog
from ... |
2dd4dcf64f612fb1fb504a375dd8ed8290550c0a3919485de6f679a13d810b22 | Python | 34,141 | 966 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
10b566ff47b0d3d6026da4ca8222792da1a0b56fb935476d0b7526163249cab0 | Python | 34,194 | 735 | import numpy as np
import torch
from sklearn.metrics import classification_report, balanced_accuracy_score
import warnings
from evaluate import *
from loader import *
# Useful functions
def sort_attribution_scores(attr):
return np.argsort(-np.abs(attr))
def get_attributions_per_class(attr, labels, _class, m... |
a35809afe6373295c1f1eeef92067a624174ff53636ccb218ae71cb8c77bec86 | Python | 34,196 | 614 | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib
import pandas as pd
import math
import os
import sys
import traceback
import csv
import pickle as pkl
import scipy.stats as stats
import ray
# this n_cpus setting seems to limit # active threads for each ray actor method.
# a... |
5931729060c0597b82d8e42d35ba746992d164d652dc4ef09d3c584cd88dde4c | Python | 34,262 | 968 | #!/usr/bin/env python
# coding: utf-8
# Copyright 2019 Google LLC
#
# This is the original "decision" model written by David Sussillo.
# 100 hidden neurons, all weights are initialized randomly, 120 iterations.
# # Imports
from __future__ import print_function, division, absolute_import
import datetime
from funct... |
a0c9d558073478380e47d69d24f189db5e7c58dff8b6862aad28360637dbb3cd | Python | 34,271 | 845 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
326a3397de55a9855a4eec57f389c335dad4b467461e064a84e3df9dcbd0e21d | Python | 34,295 | 824 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
a269325aaf96abc01f81aec3de1d13b889d18dff1fc1253e18314ef37272e3f5 | Python | 34,325 | 756 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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
#
# ht... |
fd231bdd1adebcdc022179616cf1446c652ec23670df6126ddbda40714359c1b | Python | 34,360 | 698 | # In this version (v3), we train class 1 (fungal) vs all other classes (0, 2, 3) combined as negative class
# This provides a more inclusive training approach that uses all available data
# Key changes from v2:
# - Keep all classes (0, 1, 2, 3) instead of filtering out 2 and 3
# - Remap classes 0, 2, 3 to 0 (negative/n... |
caa9a94f6fad62ae32ffbec034f91da2f2f4ea6ddf15e211fc90ec832e046c6c | Python | 34,428 | 693 | # In this version, we taylored the training to our needs.
# First, we select only slides with 0 and 1 decisions and exclude other classes
# Second, we merge the same patients WSIs together according to patient name
# Then, we create a way to include test set from an external source in '5-fold-cv-standalone-test' mode
... |
36cb6f490db34a101a7e71eebcae31d425a8f86da178d6fc67f150179a367403 | Python | 34,443 | 1,049 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
ca165d9958d8e8f23a11e15ba7ba983a9ebebe9d5192fd8d32e3866848fba667 | Python | 34,448 | 921 | """
SecureTranport support for urllib3 via ctypes.
This makes platform-native TLS available to urllib3 users on macOS without the
use of a compiler. This is an important feature because the Python Package
Index is moving to become a TLSv1.2-or-higher server, and the default OpenSSL
that ships with macOS is not capable... |
2c1d839135f13bdc07f496069a477f63113aa2a14a573aa71857ef615e368164 | Python | 34,458 | 1,011 |
# coding: utf-8
# In[17]:
#writing ensight Gold binary (comaptible with vtk 8)
#parallelization borowed here https://gist.github.com/fspaolo/51eaf5a20d6d418bd4d0
import numpy as np #needs install
import os
import pandas #needs install
import sys
from mpi4py import MPI #needs install
from multiprocessing import Q... |
7e5abae6cc4d55774eb984842a7314cf61eeeb145df65d529d3471e415176d95 | Python | 34,461 | 1,026 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 17 09:58:02 2021
@author: leupinv
"""
## libraries
from statsmodels.stats.multitest import fdrcorrection_twostage
import numpy as np
import mne
from scipy import stats
from mne.stats import fdr_correction, f_mway_rm
import matplotlib.pyplot as plt
i... |
22ef9542fdb20ccee478b57420d14e0c65ed835cf19854ffd9d8358c23f90617 | Python | 34,468 | 674 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import copy
import os
import argparse
import matplotlib.pyplot as plt
import numpy as np
import csv
import random
from datetime import datetime
import itertools
import torch
from DiscRisk_utilities import gender... |
1ac2e9c3d538183436d2fa9773607fd2ac06f085f3f2b7725307cbe0a949a99b | Python | 34,470 | 790 | # Copyright 2020 The HuggingFace Team. 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 applicabl... |
81b467b170d7fc605460af1c704dfc15620c0e9bf82c523940e3c674b9af3f8e | Python | 34,479 | 1,075 | import shutil
from pathlib import Path
from time import monotonic
from collections import deque
import pytest
import numpy as np
from pupil_recording_interface.decorators import device, stream, process
from pupil_recording_interface.device import BaseDevice
from pupil_recording_interface.device.video import VideoFile... |
cf127d009f51626fc2a5db47be76444280a2c94db6ce106274ac2365539c3c4e | Python | 34,480 | 736 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pickle
import dill
import os
import glob
import math
import seaborn as sns
from sklearn.decomposition import ... |
55e4280801581060c253f44988a00ac073a8b5d7dbbd7ed821afc030ce15a741 | Python | 34,505 | 912 | """
This code started out as a PyTorch port of Ho et al's diffusion models:
https://github.com/hojonathanho/diffusion/blob/1e0dceb3b3495bbe19116a5e1b3596cd0706c543/diffusion_tf/diffusion_utils_2.py
Docstrings have been added, as well as DDIM sampling and a new collection of beta schedules.
"""
import enum
import math... |
b6f3411f2c7115bb95942f066528444c2949c632e20cc3a36b85f0c32bcd9b68 | Python | 34,544 | 1,010 | """Fallback pure Python implementation of msgpack"""
from datetime import datetime as _DateTime
import sys
import struct
PY2 = sys.version_info[0] == 2
if PY2:
int_types = (int, long)
def dict_iteritems(d):
return d.iteritems()
else:
int_types = int
unicode = str
xrange = range
def ... |
0ae276338d57c3f9497bd883d0e9a9e24433092aed21f4961b69208fbd534b65 | Python | 34,587 | 560 | """Read-only per-token diagnostics of the reservoir -> steering pathway (measurement, not a mechanism).
The steering rule being observed (llm.Coupling._intervene), for reservoir state x (512):
compact = x @ readout (64; readout 512 x 64, fixed, seed 42)
raw = compact @ decoder ... |
92aecacd2e5aa277478a8ad06de323660f51c76b606e068f24e68b8a0d1fcf07 | Python | 34,592 | 698 | # In this version (v3), we train class 1 (fungal) vs all other classes (0, 2, 3) combined as negative class
# This provides a more inclusive training approach that uses all available data
# Key changes from v2:
# - Keep all classes (0, 1, 2, 3) instead of filtering out 2 and 3
# - Remap classes 0, 2, 3 to 0 (negative/n... |
4f2e612a54a0b21ecf02d9d279fbd100ced8fe35a899e928a775a28834a7a9db | Python | 34,613 | 916 | #!/usr/bin/env/python
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import sys, os
# sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
from... |
183249397eb1605e459728d75aee6de16074c74d09a71341c07abf41effcf260 | Python | 34,616 | 906 | """
Support functions for reporting validation errors.
You can scope the formatted errors with calls to push_error_context and pop_error_context.
The standard context keys are:
CUSTOM_TITLE = 'ec_title'
FILE_NAME = 'ec_filename'
SIDECAR_COLUMN_NAME = 'ec_sidecarColumnName'
SIDECAR_KEY_NAME = 'ec_sidec... |
d81a6a2e54f6131bce3a2eef9e32b99c1e05a7e9b9da57623da5cca31e6ec2e8 | Python | 34,618 | 943 | """
pygments.lexer
~~~~~~~~~~~~~~
Base lexer classes.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import time
from pip._vendor.pygments.filter import apply_filters, Filter
from pip._vendor.pygments.filters im... |
ddbbbc6ca0c4e926e8fd58aecfc73ae5a587a6f99c6d993f64eede5362861016 | Python | 34,623 | 922 | import tracemalloc
import numpy as np
import pytest
import SurvivalEVAL.evaluations.discrimination.distributional.time_dependent_concordance as td_concordance
from SurvivalEVAL import SurvivalEvaluator
from SurvivalEVAL.evaluations.discrimination._concordance_utils import (
_ConcordanceCounts,
_finalize_count... |
837af810eca8ef78f7ae27f94bfe2c33a6be2a15243edbdc44ed2142de6f73ee | Python | 34,678 | 1,071 | # Copyright 2020 The HuggingFace Team. 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 applicabl... |
619beab594387288e6818cfb59a348daa709292a55a690cbc5d38f979414334d | Python | 34,740 | 912 | #!/usr/bin/env python
"""
:Summary: Extracts the brain from clinical MRI and returns grey/white-matter mask.
:Description: This script performs bias field correction, brain extraction, intensity normalization,
and generates masks for brain and intracranial volume. The pipeline is modular -
... |
1040bb9ee72e46a9003ce77ca536d4522a3d148b6e788a537cfaa11d2d70c8b5 | Python | 34,745 | 823 | """Mesocircuit framework
------------------------
Parameterspace evaluation and handling of job execution.
Definition of the main classes MesocircuitExperiment and Mesocircuit.
"""
import mesocircuit
from mesocircuit.parameterization import helpers_network as helpnet
from mesocircuit.parameterization import helpers_... |
8c429230bff1637d5e4bda422999e7a0129688501d65b03434678130c6ce6327 | Python | 34,775 | 956 | """Module containing functions to visualize the results of the HMP model."""
from itertools import cycle
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal as ssignal
import xarray as xr
from mne import Info
from mne.viz import plot_brain_colorbar, plot_topomap
from scipy import stats
import hmp
... |
9794b5912c70d9cfaba23f7b1955d909829d73a6f307f9ab0238ab604f253a3e | Python | 34,782 | 888 | # -*- coding: utf-8 -*-
#
# Test proper functionality of Syncopy's `ContinuousData` class + subclasses
#
# Builtin/3rd party package imports
import os
import tempfile
import time
import pytest
import random
import numpy as np
import h5py
import dask.distributed as dd
# Local imports
import syncopy as spy
from syncopy... |
9fd21a775ac540283119a41ce62de6228c4f8213f7408e7bd890991af374f5bc | Python | 34,792 | 962 | # A waveform module
import numpy
import numpy as np
import scipy as sp
from pyclamp.dsp.sifunc import *
from pyclamp.dsp.fpfunc import *
from pyclamp.dsp.dtypes import *
from pyclamp.dsp.lsfunc import *
from pyclamp.dsp.optfunc import *
def dt_max(dtype):
info = np.finfo if dtype in (np.dtype('float32'), np.dtype('... |
473cb8ccb4dcc56e751f654c4cdd987bcb0cf12903acdecaf39fc029e33b7096 | Python | 34,802 | 1,018 | #!/usr/bin/env python3
"""
A neural algorithm for computing bipartite matchings.
(c) 2024 Saket Navlakha, navlakha@cshl.edu
"""
# so no GDK warning issues.
import matplotlib
matplotlib.use('Agg')
from optparse import OptionParser
from matplotlib import pylab as plt
from matplotlib import rcParams
import scip... |
499a4fd9f97681a8a26118881e64e4211e2cf771f52c4e6df81d39def3c01fc8 | Python | 34,805 | 637 | # -*- coding: utf-8 -*-
"""
Created on Fri May 13 11:53:14 2022
@author: Dalton
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from pathlib import Path
import dill
import re
import seaborn as sns
from scipy import sparse
from sklearn.metri... |
60dbfe0a80886d280cfeb9f3db6054e15b82e9ec8e22ecd0097b4a425dd601d5 | Python | 34,818 | 813 | # toolbox.py
# Meant for computing parameters of individual tribes of mc2 circuit
# Intended usage: 1. open python in this directory
# 2. run exec(open('toolbox.py').read())
# 3. call any of the functions
# 4. compare with computed parameters by calling df.loc[index,param... |
99f42888bcc88ddd3702b1eda9fa82efa289a08c806ab1584f1e4079f985e38a | Python | 34,837 | 599 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pickle
import dill
import os
import glob
import math
import seaborn as sns
from sklearn.decomposition import ... |
b0a9aa218455910a64c1a2e650e21ff1e5f7d6ba83d9926568c060052f149537 | Python | 34,844 | 841 | """Characterization tests for the EXISTING atlas-space plaque statistics.
This module had no tests and is wired into a shipped CLI flag
(``--is_segmentation``), so its output is something users already have. These
tests capture its current behaviour so that adding a native-frame mode cannot
silently change it. Th... |
da6e7dc527ed8af7b068355ea5e93fae4b21086b0d454627556310a8e583ce95 | Python | 34,851 | 859 |
import pandas as pd
import numpy as np
import pingouin as pg
from statsmodels.stats.multitest import fdrcorrection
from scipy import stats
import matplotlib.pyplot as plt
from matplotlib import patches as mpatches
plt.style.use('seaborn')
import seaborn as sns
import os
def standard_anova(data,columns,clinical_df):
... |
ec36a52b65f74a43f3e5ae2f4c84a963e21cb82d18015abf79a3a22353668409 | Python | 34,855 | 620 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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
#
# ht... |
5d9c4441c2878a287b3bd0e2ab4df66d2aaac517ac368240f1358339a3265843 | Python | 34,882 | 741 | """
DeepLabCut2.0 Toolbox (deeplabcut.org)
copyright A. & M. Mathis Labs
https://github.com/AlexEMG/DeepLabCut
Please see AUTHORS for contributors.
https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS
Licensed under GNU Lesser General Public License v3.0
"""
import sys
import wx
import os
import pandas as pd
imp... |
042713cf435758957fa21ae0698de3b2a71cca90dc1ea6bd062dbe39a533c327 | Python | 34,884 | 1,067 | # coding=utf-8
# Copyright 2026 The Google Research 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 applicab... |
11c99c3840ae46bafe197fa8ff3838d2f5a799ca08ae512f9ca46ad2c6f62534 | Python | 34,916 | 996 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright (C) 2012 Computational Neuroscience Group, NMBU.
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
(at you... |
e66d314b0cb7aaa5a0f28fb20b142093c7b8e121b169ba4a02ad27cc99af659f | Python | 34,954 | 968 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
41e2365170a7c7e25fa0049b9eb51bde4821a69ea75ff203770924e865ce5a58 | Python | 35,010 | 1,100 | import os
from typing import Optional, Tuple, Union
import glob # for file names
import pickle
import re
import shutil
import warnings
import cv2
import numpy as np
import pandas as pd # to create data frames
import ruamel.yaml
import seaborn as sns
from matplotlib import pyplot as plt # visualization
from matplo... |
f718ec555930907a9fad56ae2682e251aec83d0dbec090d5905121593acf82ba | Python | 35,012 | 843 | import copy
import functools
import inspect
from abc import ABCMeta
from uuid import uuid1
import bpy
import databpy as db
import numpy as np
from databpy.object import LinkedObjectError
from mathutils import Vector
from ..blender import coll
from ..blender.utils import (
get_viewport_region_from_context,
new_b... |
d0ab520dfe8059f6ff26c092e7fb58a697c5773ce57af56474716a09d2a52e0b | Python | 35,024 | 945 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# 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,... |
084b2f3133f225cc67b6438c50e9860b74a47a4cda71f39bd02a0939b79d5a46 | Python | 35,037 | 704 | import unittest
import pandas as pd
from hed import DefinitionDict, HedFileError, load_schema_version
from hed.models.df_util import (
_filter_by_index_list,
_handle_curly_braces_refs,
_indexed_dict_from_onsets,
convert_to_form,
expand_defs,
process_def_expands,
shrink_defs,
split_dela... |
607b31faeabf8e46b9d9147b6dfce5a00eae8f366fe74ffcc31b4d6790f75988 | Python | 35,054 | 1,003 | # -*- coding: utf-8 -*-
#
# Syncopy's abstract base class for continuous data + regular children
#
"""Uniformly sampled (continuous data).
This module holds classes to represent data with a uniformly sampled time axis.
"""
# Builtin/3rd party package imports
import inspect
import numpy as np
from abc import ABC
from... |
7225feecc96b7168e3824d1d0ee0aa96d42e5ea5bde21a5dbc42b0c154276836 | Python | 35,097 | 748 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 21 17:23:41 2014
@author: Laure Spieser and Boris Burle
Laboratoire de Neurosciences Cognitives
UMR 7291, CNRS, Aix-Marseille Université
3, Place Victor Hugo
13331 Marseille cedex 3
This file is part of Myonset.
Myonset is free software: you can redistribute it and/or m... |
94ea60899c4b464a8319faadc6afff117f20d7aed0eef3dd2b93f9692413fd62 | Python | 35,110 | 898 | import os
os.environ['CUDA_LAUNCH_BLOCKING'] = "1"
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
import numpy as np
import matplotlib.pyplot as plt
from itertools import cycle
import matplotlib.gridspec as gridspec
from torch.autograd import Variable
import pandas as ... |
8e00e25422ba72947436604ea59988bbe51de1e696edf1ef8c96640db8e97120 | Python | 35,173 | 948 | import os.path
import platform
import re
import sys
import textwrap
from abc import ABC, abstractmethod
from pathlib import Path
from typing import (
Any,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Sequence,
Set,
Tuple,
Type,
Union,
)
from pip._vendor.pygments.lexer import ... |
906ead05943087ad30d993cde4434604e058ddcf1b9f1236c712344bdf43f8c2 | Python | 35,199 | 686 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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
#
# ht... |
87ea7d112dd8f69a37120405682d10841cb30001776ad4d9c41e0f4f1abc79f6 | Python | 35,202 | 837 | #!/usr/bin/env python2
from __future__ import print_function
import sys
# NOTE(caelan): must come before other imports
sys.path.extend([
'pddlstream',
'ss-pybullet',
#'pddlstream/examples',
#'pddlstream/examples/pybullet/utils',
])
import argparse
import numpy as np
import time
import rosnode
import... |
ca499997581537653f57bf5983b29cb6183d209b81c31cb591284b7a6ca96ef3 | Python | 35,210 | 614 | # -*- coding: utf-8 -*-
"""
Created on Wed April 03 14:27:26 2019
Description: Cortico-Basal Ganglia Network Model implemented in PyNN using the simulator Neuron.
This version of the model loads the model steady state and implements DBS frequency
modulation controllers where the beta ARV from the STN LFP is cal... |
74367e893868b64cbe368abdcb2f7b71410986bdf09d8ea6bfec51fde3e0fe59 | Python | 35,288 | 1,034 | """
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import datetime
# Import encoding now, to avoid implicit import later.
# Implicit import within threads may cause LookupError when standard library is in a ZIP,
# such as in Embedded Python. See https://github.com/p... |
d0ad7421adc5531173115fe7708277dac8732855c2e19586949d616e4f807154 | Python | 35,309 | 814 | import sys
import pandas as pd
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QVBoxLayout
from PyQt5 import QtWidgets,QtCore
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import matplotlib.pyplot as plt
from Ui_PyTDL import Ui_MainWindow
import time
impo... |
27adb2643bff891e463463d313538104b6873b07cb709d31e2a99fc301c8e059 | Python | 35,319 | 584 | import os
import json
import logging
import warnings
import torch
from tqdm import tqdm
import pandas as pd
import numpy as np
from torchdrug import data, utils
from torchdrug.core import Registry as R
from torch.utils import data as torch_data
from cg_steps import cg_protein
logger = logging.getLogger(... |
05e2afcc1f8cb69bc0e875a619fbab71025b5815849a8e61483d0c35d5ebc22b | Python | 35,321 | 849 | # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/05_train.ipynb.
# %% auto 0
__all__ = ['train', 'train_ae', 'training_regimen']
import copy
import os, sys, json, math, itertools
import pandas as pd, numpy as np
import warnings
from tqdm import tqdm
import torch
from .utils import sample, generate_steps
from .losse... |
7e330c6a92df293a29b15b1bac436f998c53314f36bfd8ee34afe1efeece170f | Python | 35,378 | 957 | """Tests for E3FP fingerprinting.
Author: Seth Axen
E-mail: seth.axen@gmail.com
"""
import glob
import os
import pytest
try:
import mock
except ImportError:
import unittest.mock as mock
import numpy as np
DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
PLANAR_SDF_FILE = os.path.join(DATA_DIR, "caf... |
5355a703d5922d5f39ba945d950c50831a13ae8d08f38799ddf5c2a3316983f6 | Python | 35,444 | 813 | #!/bin/env python
"""
OXASL - Module which generates perfusion stats within various ROIs
Copyright (c) 2008 University of Nottingham
"""
import optparse
import os
import numpy as np
import scipy.stats
import pandas as pd
from scipy.fftpack import fft, ifft
from fsl.data import atlases
from fsl.data.image import Imag... |
e30571bbd88d9f4e5a67ec4ef8ea2bf8f41c7ae5b85ff2fc1adcf7a6a0979d50 | Python | 35,460 | 892 | import numpy as np
import pyqtgraph as pg
from pyqtgraph.Qt import QtWidgets, QtCore, QtGui
import pyclamp.gui.pyqtplot as pq
import pyclamp.gui.pyplot as pyplot
from pyclamp.dsp.lsfunc import *
from pyclamp.dsp.fpfunc import *
from pyclamp.dsp.fpanal import *
from pyclamp.gui.xyfunc import *
from pyclamp.gui.pyplot im... |
65e8d1368a224d43907ae72d9bce58948702b07e2c1504a7bb5222f80d307aa8 | Python | 35,461 | 872 | """The left/right split must be expressed in the frame of the array it splits.
``_hemisphere_plane`` reads the fitted midsagittal plane cached beside the
annotation. That plane is fitted - and recorded - in the annotation FILE's
frame: PIR for the Allen CCF, RAS for Waxholm, RIA for DevCCF. Its ``ml_axis``
is a... |
cb72adcb1ba4f6cf66d3273409d3a55d62432700b48d88a4f02540d914957bc9 | Python | 35,475 | 1,138 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# 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,... |
36b39630933a6d9d101cc866278e509c5278b2a54e7eb9b8d64d3b2aee78ee15 | Python | 35,501 | 595 | import os
import json
import logging
import warnings
import torch
from tqdm import tqdm
import pandas as pd
from torchdrug import data, utils
from torchdrug.core import Registry as R
from torch.utils import data as torch_data
from cg3_steps import cg3_protein
logger = logging.getLogger(__name__)
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.