sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
097c42eb17301264e7d6021e9878bcc5238b38762e5b6aacd2f0d9f84b95ceb9 | Python | 7,191 | 184 | ##########################################################################
## ##
## Copyright (c) 2019 Philipp Lösel. All rights reserved. ##
## ##
## This file is par... |
9e55ee23db7cae8d634434c8dfd8229b98fd6d0f09ffb13fe6a1446969074f1f | Python | 7,192 | 172 | """Uni-Mol: a universal 3D molecular representation SE(3)-invariant transformer.
Zhou et al., "Uni-Mol: A Universal 3D Molecular Representation Learning Framework",
ICLR 2023 (arXiv late 2022). https://openreview.net/forum?id=6K2RM6wVqKu
Source: https://github.com/deepmodeling/Uni-Mol
Uni-Mol's distinctive design (SE... |
16c3590e5bb35142154a6595a491ce01446c41522e550b0dd406251fd586eef7 | Python | 7,193 | 204 |
__author__ = 'Aaron Gudmundson'
__email__ = 'agudmun2@jhmi.edu'
__date__ = '2023/30/08'
import numpy as np # Numerical Operations and Arrays
import argparse # Input Argument Parser
import sys # System Interaction
import os # Operating ... |
2f3bf00bf3f9426cf8f739cac4b3dd980daaa28590be2c0ea31bc9df410dbff7 | Python | 7,194 | 185 | import pickle as pkl
import os
from collections import defaultdict
import random
import json
import torch
import transformers
from os.path import dirname, join
D3_DIR = dirname(os.path.abspath(__file__))
device = 'cuda' if torch.cuda.is_available() else 'cpu'
def sample_sentences(xs, k, group_id):
random.shuffle... |
bb2e51251b3c966e25b6a571d4bee54b6c5bbd04bc040b4d647e14a6716d3553 | Python | 7,194 | 176 | #!/usr/bin/env python
import torch
import argparse
import pandas as pd
import random
import numpy as np
import os
import warnings
import copy
from tqdm import tqdm
from torch.nn.parallel import DistributedDataParallel as DDP
from bioseq2seq.bin.models import restore_seq2seq_model
from bioseq2seq.bin.data_utils import ... |
99ad2738dabd62645ec33d297399adedc36efefdb6b10a1958278d1f59eb134e | Python | 7,195 | 233 | '''
main entrance of prepare video.
'''
# %%
import os
import sys
# there should exchange the path with yourself path.
sys.path.append('/workspace/Walk_Video_PyTorch/project')
import warnings
warnings.filterwarnings("ignore")
from utils.utils import make_folder, count_File_Number
from argparse import ArgumentParser... |
e5c08e6227008da338bbea7a45687d2cbd23d7203b94ee5782e9f4de764867a2 | Python | 7,197 | 189 | """Wrapper-hygiene regressions from grind-r5 b8 R56/R57.
Covers the autograd entry-point teardown drift guard, autograd wrapper
provenance, the fx Tracer.trace target normalization, and the escape
detector's profile-slot / sys.monitoring tool-id discipline.
"""
from __future__ import annotations
import inspect
impor... |
976dd22ca912f427fbbb97991adc0000f842b4d775cd3588df82934319eb0400 | Python | 7,198 | 219 | # Copyright (c) 2021 PaddlePaddle Authors. 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 app... |
4cb2a6647c49fe1ba525a81b336ace7794f7fdf1dc5b3895fdb4af5139e6134c | Python | 7,200 | 231 | """Utility functions for plotting.
Notes
-----
These utility functions should be considered private.
They are not expected to be called directly by the user.
"""
from itertools import repeat
from collections.abc import Iterator
from functools import wraps
import numpy as np
from specparam.io.utils import create_fil... |
49673781f2b07c0cb0ba33ca0b05873305d686d42b5522c0569a8e0dc202708f | Python | 7,201 | 240 | """
Mixins that make an object renderable in the simulation viewer.
Provides the base viewable, its toggleable and line-shaped variants, and the
contour primitive, each carrying the colour and visibility state the renderer
reads.
"""
from __future__ import annotations
from typing import Any
import param
from .. imp... |
7b3b6d136463352f1e86616efd8395fa6551a2f5a593be41c0a3835bc27c9a7f | Python | 7,201 | 198 | #!/usr/bin/env python3
# coding: utf-8
"""
Created on Apr 2020
@author: Nathan de Lara <nathan.delara@polytechnique.org>
"""
from typing import Optional, Union
import numpy as np
from scipy import sparse
from scipy.spatial import cKDTree
from sknetwork.embedding.base import BaseEmbedding
from sknetwork.embedding.spec... |
7091f8dd32c89f8225cbc37fbf009805be4a718f34794e9acdbba9c67c295bc7 | Python | 7,202 | 195 | import os
import pickle
import sys
import tempfile
import time
from unittest.mock import patch
import pytest
import t.skip
from celery import states, uuid
from celery.backends import filesystem
from celery.backends.base import COMPRESSED_PAYLOAD_MAGIC
from celery.backends.filesystem import FilesystemBackend
from cele... |
cf360fd2b41090442e02fa3a75155c9e821309ed31f176422c31a779ace98ab2 | Python | 7,205 | 236 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
_parent_path_str = "scatterpolargl"
_p... |
1c163863b65ce72a06957dc1a6894e92aa682b98d464e2ac165fb646617fcaeb | Python | 7,206 | 192 | # coding=utf-8
# Copyright 2022 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... |
c3f0a57e9189307e4bd980763c2dc2079254dd781fdf68c19984bfa33035cf07 | Python | 7,206 | 187 | import collections
import json
import logging
import os
import string
from galaxy.app_unittest_utils.tools_support import UsesTools
from galaxy.config_watchers import ConfigWatchers
from galaxy.model import tool_shed_install
from galaxy.model.tool_shed_install import mapping
from galaxy.tools import ToolBox
from galax... |
cdc9d7e540a93c1eae4b6d1e24065685c73ed2f40d2209199da61cf1d9e1a588 | Python | 7,209 | 198 | #!/usr/bin/env python
# coding: utf-8
# separate the tcrs associated with given HLA using percentiles of frequency
# sample n_fold * matching tcrs from the negative
# with exceptions for extremely low frequency, 0, 1, 2, 3, up to 10, and then
# folowing percentiles at 10%, 20%, 30%, ...
# if there are not enough TCRs ... |
e991fee0599ecaf17c2e54d8d47e5273870e5cbde9ed61cc6346776e68707ea1 | Python | 7,209 | 161 | """
Plot Power Spectra
==================
Visualizing power spectra.
"""
###################################################################################################
# Import matplotlib, which will be used to manage some plots
import matplotlib.pyplot as plt
# Import plotting functions
from specparam.plts.sp... |
105bb10e713dac8693067cca93c77497c929c8e9e6ce1e3dc0b7d2724a78407d | Python | 7,210 | 199 | #!/usr/bin/env python
# coding: utf-8
# separate the tcrs associated with given HLA using percentiles of frequency
# sample n_fold * matching tcrs from the negative
# with exceptions for extremely low frequency, 0, 1, 2, 3, up to 10, and then
# folowing percentiles at 10%, 20%, 30%, ...
# if there are not enough TCRs ... |
1a429964308eb728f5876326b631eb5c6d05ced2528315d2658844d0248c53ed | Python | 7,210 | 305 |
# coding: utf-8
# In[1]:
import os
import sys
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# In[2]:
# Get the current working directory
cwd = os.getcwd()
# Ensure that the path is starting in the scripts directory
if not cwd.split('/')[-1] == 'scripts':
os.chdir(os.path.join(c... |
a7c1daae2c5999227f3e3176b495c5ffa0d3184352a73f25b2d69626a47c1f6d | Python | 7,210 | 212 | import math
from typing import Optional
import matplotlib.pyplot as plt
import numpy as np
class LiveWireSegmentation(object):
def __init__(self, image=None, smooth_image: bool = False, threshold_gradient_image: bool = False):
super(LiveWireSegmentation, self).__init__()
# init internal containe... |
3239b70f64af90e49c3dd64bd1226244570ff05adbc0d8cc65cd90a3535cd0f8 | Python | 7,212 | 214 | """M0 measurement probes for the trace-core columnar re-plumbing.
Measures the evidence items the converged design gates on
(docs/reference/trace_core_design.md sections 4 and 7, wave M0):
- A2: retained journal bytes vs semantic-graph bytes on a large capture
(journal-columnarization reopening condition: journal >... |
98adc151ae0f39e1b3b38633d7fa33f34df101fd5a3f52d94ed74f375b5a3d7d | Python | 7,212 | 151 | import torch.nn as nn
import torch.nn.init as init
import torch
class ACBlock(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, padding_mode='zeros', deploy=False,
use_affine=True, reduce_gamma=False, gamma_init=None , norm='batch'):... |
bd9867ce2a2f5874ff068d7242269b87e9ec3e9f74598fdd6681394118597bfb | Python | 7,213 | 211 | from dataclasses import dataclass
from typing import Dict, List, Tuple
import numpy as np
import xarray as xr
from hobj.benchmarks.binary_classification.simulation import (
BinaryClassificationSubtaskResult,
)
from hobj.stats import binomial as binomial_funcs
@dataclass(frozen=True)
class _BootstrapSamples:
... |
4ced69b32a4403ee6c56a8c7b96028b5aa29a836ddd7a628d9829ec1d19b0373 | Python | 7,214 | 270 | """Phase 12 append rerun tests."""
from __future__ import annotations
from pathlib import Path
import pytest
import torch
from torch import nn
import torchlens as tl
from torchlens.intervention.errors import (
AppendBatchDependenceError,
AppendMismatchError,
BatchNormTrainModeWarning,
)
from torchlens.i... |
dc5bf725dee4753ae81a0c592d289afe62edf718ae15d074f765005b9ab84287 | Python | 7,214 | 154 | #==============================================================================#
# Author: Dominik Müller #
# Copyright: 2024 IT-Infrastructure for Translational Medical Research, #
# University of Augsburg ... |
ee4ac204e18f26a36ac8c6d7fc21495da715df13eab1343cb6253a4ee2266d88 | Python | 7,215 | 194 | import sqlite3
from contextlib import contextmanager
from functools import lru_cache
from typing import (
NewType,
)
from sqlalchemy import create_engine
from sqlalchemy.engine import Engine
from sqlalchemy.engine.url import make_url
from sqlalchemy.orm import object_session
from sqlalchemy.sql.compiler import Ide... |
edc5bbc9cef19ad3da95ca2b675bb79095b8563ad071c9f4e0c65e627590c9a6 | Python | 7,217 | 200 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Test objects and function in tfep.nn.embeddings.radial.
"""
# ================================================... |
7027bfd032474201299d9f8f569276706fcbac2f24c9ebdb43abb2355808a56b | Python | 7,218 | 202 | """P2: the reduce-only save path skips the raw clone (explorer memo item 2).
Proof strategy: the summary reducer records the storage pointer of the
tensor it is handed; a module forward hook records the live output's
storage pointer. When they match, the reducer saw the LIVE storage -- no
transient copy was made for i... |
c4aa866708023b112cfcf0eda64bf246eaedd87f0116231e94b4b6c434fdb10a | Python | 7,221 | 208 | import copy
import importlib
import inspect
import os
import sys
import warnings
from keras.src import backend as backend_module
from keras.src.api_export import keras_export
from keras.src.backend.common import global_state
from keras.src.backend.config import BUILT_IN_BACKENDS
from keras.src.backend.config import PL... |
c796a7fcc29eef0cb958b96a7c7a5d4483d9cb574bc7b280c8465dd81b9aef74 | Python | 7,227 | 183 | """ AStrocyte section growers """
import logging
from collections import namedtuple
import numpy as np
from tns.generate.section import SectionGrowerPath
from tns.astrocyte.math_utils import normalize_inplace
from tns.astrocyte.math_utils import in_squared_proximity
from tns.morphmath.utils import get_random_point
fr... |
0bd3463fa60e141f27b31a360270763c6fc1b50f1f23db69d3517fcdf012eca6 | Python | 7,228 | 214 | """OSCN model specification
"""
import numpy as np
from numpy import sqrt
import torch
import torch.distributions as dist
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torchvision import transforms, datasets
from torchvision.utils import save_image, make_grid
from ... |
53db4b6bcc2ad1c119b731eebf0f360d4dffbc13b5a880d9bde9928cf355ef1d | Python | 7,228 | 238 | import os
import re
import warnings
import parse
# ############### Patterns and regex constants ####################
# declare the filename template... could go in config file
# this only is used for generating filenames (gen_filename)...
# which isn't really used
# example: cell5_ch0_stack0000_488nm_0000000msec_002... |
ec27b7af1bd9b77bbb8080cd851130f93366cc0688e1f2e9b62a382b3257f433 | Python | 7,228 | 191 | """Decision tests for the interleaved nightly perf gate (``benchmarks/perf_ab.py``).
A synthetic cell runner stands in for ``perf_runner`` subprocesses, so these
tests pin the statistics and the verdict logic without timing anything: an A/A
run passes, planted regressions still fail (a gross one even on a noisy
runner... |
dfbbcb69914d88aa07ba19131e0e17df6daf2665350787edfff2d8daabf662d9 | Python | 7,230 | 193 | """LIT blocks-preset architecture matrix on real checkpoints (lane F31; T19/T24).
The memo's six-checkpoint matrix, at PR-leg scale: the four real NLP
architectures (DistilBERT / BERT / RoBERTa / GPT-2, tiny random-weight
checkpoints) prove the preset discovers exactly the config-declared stack,
that pinned ``site_key... |
b56c995bc0d728d789335ee83692d21c9ac1e131e843eab9edd5167ba47e3481 | Python | 7,232 | 185 | # clevr model specification
import torch
import torch.distributions as dist
import torch.nn as nn
import torch.nn.functional as F
from numpy import sqrt
from torch.utils.data import DataLoader
from torchvision import transforms, datasets
from torchvision.utils import save_image, make_grid
from torch.utils.data import ... |
ed4aab77674df10a15d881df763b43d30967c7e62ddbea5efa5c4ab7950f48e4 | Python | 7,232 | 210 | # Copyright 2025 Google.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
04085dc047e0336749bf5f510f93c49641d3f122c73b5ac527dca9b325e4ae21 | Python | 7,233 | 163 | """
This code plots the figures in Results.
"""
import os
import os.path as op
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from tools_general import list_from_many, load_json_to_numpy, load_pickle, load_json
from tools_plotting import plot_with_sem_one_line, topoplot_with_colorbar, parul... |
5221f6cf39c71866abb99e5fbc30681f4363464cd7def37bb29989481ce4e23e | Python | 7,233 | 218 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import tensorflow as tf
import pandas as pd
import argparse
import os
import sys
import pwd
import pdb
import csv
import time
import itertools
from cin... |
7fff56050dac5afcfd33af709a644c7a99399ae7cc41ecf3cfe6a042473bb0e6 | Python | 7,233 | 208 | """Transforms for alpha pose estimation."""
from __future__ import absolute_import
import random
import numpy as np
import mxnet as mx
from ..pose import random_sample_bbox, count_visible, random_crop_bbox
from ..pose import drawGaussian, transformBox, cv_cropBox, cv_rotate, detector_to_alpha_pose
class AlphaPoseDef... |
d13bb6a4309b7ed28925bfee91e743de4eb8606f726ce3fb08b0c95f1b79a368 | Python | 7,234 | 244 | """
Trigger conditions for the ComposedStimulator.
Each trigger encapsulates the behavioral logic for deciding WHEN to stimulate,
independent of WHAT stimulus to deliver. Triggers are bound to a tracker and
called via check() to determine if a stimulus should fire.
"""
import logging
import random
from ethoscope.uti... |
c66efb869ae074dfc790b18e8952fe8f3f0e95314f1c50e70e40c604a15af805 | Python | 7,235 | 205 | import copy
import numbers
import numpy as np
from ..geometry import shapes as gshapes
class StructureLayer:
def __init__(self, label, point_um, geometry, color=(255, 255, 255)):
"""Structure layer
Parameters
----------
label: str
User-defined label of the layer
... |
be18af845beee8640e17908ab070cce73bb663375387038e0c4a76ca2e2d10df | Python | 7,236 | 168 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
from functools import partial
import torch
from ultralytics.cfg import TASKS
from ultralytics.utils import YAML, IterableSimpleNamespace
from ultralytics.utils.checks import check_yaml
from .bot_sort import BOTSORT
from .byte_tracker import BYTETra... |
018d978adeaff3dcc6c0bd8606b683fb52be6dcdd772b68bbb1b7803dfb88611 | Python | 7,238 | 185 | """Rolled-granularity netron export (lane F14, netron memo D-13).
Repeated passes merge by rolled identity; boundary edges union and
deduplicate in stable order; recurrent feedback is DISCLOSED via the
``recurrence`` attribute (drawn literally it forms a dataflow cycle
``check_model(full_check=True)`` rejects -- probe... |
292ab24244dc769362e308b674ad1c2e970d440c12cbcedf98178ce1c59e6dfc | Python | 7,238 | 195 | from celery.app.task import Context
# Retrieve the values of all context attributes as a
# dictionary in an implementation-agnostic manner.
def get_context_as_dict(ctx, getter=getattr):
defaults = {}
for attr_name in dir(ctx):
if attr_name.startswith('_'):
continue # Ignore pseudo-privat... |
2df72ecd915fca46b65e8f0caa74500bebd73065df87f839d4c3985bd7c148df | Python | 7,238 | 265 | '''DataStore class
This file is a part of BdPy.
'''
from __future__ import print_function
import os
import glob
import re
import numpy as np
import scipy.io as sio
import h5py
import hdf5storage
__all__ = ['DataStore', 'DirStore']
class DataStore(object):
'''Data store class.
Parameters
----------... |
a2d9ea877a16406baaeafadd295468f2f42442a616aeed80016f7066deb6406d | Python | 7,238 | 173 | import torch
import torch_geometric as tg
from rdkit import Chem
import rdkit
import networkx as nx
from glob import glob
import os
import subprocess
def compute_mean_mad(dataloaders, label_property):
values = dataloaders['train'].dataset.data[label_property]
meann = torch.mean(values)
ma = torch.abs(value... |
d2cd3093461d7fb600c8f6c6d26ee5979ca4aa6619125e09be118004c9e309ad | Python | 7,239 | 204 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Domain(_BaseLayoutHierarchyType):
_parent_path_str = "layout.geo"
_path... |
9ef8ad78de5635db87af2e6190db9a57b96b981a9f224e2ff9e666619f333436 | Python | 7,240 | 177 | """B13 (persistable collapse plans) + B17 (harvest schema) + B7 pins.
The composition row "collapse plan x edit": save a plan, recapture identical
units (reapplies, zero changed cohorts), insert an op (guarded changed-set
report / strict refusal) — never label failure, ordinal guessing, or silent
replanning. B17: sche... |
9b4042410d1d269282b016f7a78d96a0a08300e720dcbcf397d4c020814833e3 | Python | 7,241 | 184 | import os
import random
from rdkit import Chem
from rdkit.Chem import Mol
from rdkit.Chem.Scaffolds.MurckoScaffold import (MakeScaffoldGeneric,
GetScaffoldForMol)
from scipy.spatial.distance import squareform
from scipy.cluster.hierarchy import linkage, fcluster
from c... |
4f4924c07d874baeb2bd940f0570d3195696417c08ff639d58ddcb0afc23708c | Python | 7,242 | 209 | # pylint: disable=unnecessary-dunder-call
"""Test cases for run.py."""
import argparse
import os
import unittest
from unittest.mock import MagicMock, patch
from scalabel.label.typing import Dataset, Frame
from bdd100k.eval.run import run
def mock_load(*_) -> Dataset: # type: ignore
"""Mock load to return a dum... |
a0c17e7b881fc2e77178c299b317aabf5e9a5499f36dff07179fd4a7310683b0 | Python | 7,242 | 196 | import pandas as pd
import numpy as np
import nibabel
def transform_event_time(t, event_time_transformation):
if event_time_transformation == "months_to_years":
t_transform = t / 12.
elif event_time_transformation == "log":
t_transform = np.log(t)
elif event_time_transformation == "identit... |
3ad35736ebd7f948607b574059892d63b6586003d64cb99d8fc0cf6feb24a484 | Python | 7,243 | 234 | import collections
import functools
import pathlib
import shutil
from nanite import model as nmodel
from .util import hashfile
SUPPORTED_FORMATS = [
".py",
]
class ExtensionManager:
def __init__(self, store_path):
"""Extension manager
This class can be used to maintain a set of extensions... |
5db0204239cfc82ab2f43a3fba85d1c97a306e4885be551fb0b9ac967776b28e | Python | 7,243 | 212 | import time
import pickle
import numpy as np
import pandas as pd
def gaufunc1d(x, mux, sd, outmax):
return outmax * np.exp(-(np.square(x - mux))/(2*sd**2))
def circgaufunc1d(x, loc, outmax):
return outmax * (np.cos(x - loc) + 1)/2
def boxfunc1d(x, mux, sd, outmax):
dist = np.sqrt( np.square(x-mux))
... |
6640dcdff44b0210899b9b52b5e975ee7fbefdc0fd408d43e7eff9aa4f00fe75 | Python | 7,243 | 203 | '''
tools for converting mol from 6k to xyz
'''
import os
import numpy as np
import paddle
from paddle import sin, cos
def rotation_matrix(alpha, beta, gamma):
'''
tools for generate the rotation matrix
'''
alpha = alpha
beta = beta
gamma = gamma
Rx_tensor = paddle.concat(((alpha... |
a920f506df461abdf73aedf529323b0c5582494c21df493413b5163d281155bc | Python | 7,243 | 151 | from __future__ import division
from psychrnn.backend.rnn import RNN
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
class LSTM(RNN):
""" LSTM (Long Short Term Memory) recurrent network model
LSTM implementation of :class:`psychrnn.backend.rnn.RNN`. Because LSTM is structured differently fro... |
bc68a4ec723f5476fec5f4168f4823af3f1742119d57eef7198208cf56393725 | Python | 7,243 | 179 | """W051-CAPT3 (IO remainder): the per-rank ``distributed`` journal the C1 merge
JOINS is shape-validated at ``merge_ranks`` entry, live and loaded cores alike.
The trace-level shape check (W051-IO, ``_load_validators``) runs only on
``tl.load``; a LIVE rank core reaches the merge without it. Every malformed
container,... |
80dbefcb382c992a13d00c871fdf148b288ef135b4a39fe960d5ee066318e318 | Python | 7,244 | 209 | #!/usr/bin/env python
import argparse
from collections import namedtuple
import os
import socket
import sys
from time import sleep
import threading
import SocketServer
import external_image
import nibabel as nb
import numpy as np
SocketServer.TCPServer.allow_reuse_address = True
class ThreadedTCPRequestHandler(Soc... |
064bafcd48d41072b92c03f87556f56f5154b18cbee23d81d541f9615989dcd6 | Python | 7,246 | 237 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
_parent_path_str = "scatter3d"
_path_s... |
424227589f609b6d0409593074a60af0f1f21bee55605e6a260574268e30a731 | Python | 7,246 | 190 | import json
import os
import pickle as pkl
import random
from itertools import chain
from transformers import AutoModelForSequenceClassification, AutoTokenizer, AutoModel
import torch
import tqdm
from transformers import AdamW, get_linear_schedule_with_warmup
import numpy as np
from torch import nn
device = 'cuda' if... |
42ba94858fc0e8ddd396aa24e412c767a9be09d0ee69c8c4fcb383b05c5d9185 | Python | 7,246 | 238 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from glob import glob
from functools import reduce
import json
import jsone
import os
import sys
import requests
import slugid
import yaml
import subprocess
import networkx as nx
TASKS_ROOT = os.path.join(os.path.dirna... |
9569c804992d3dec85eba6ec64a4b643ad942cce8c93e64d21786d20f9b99710 | Python | 7,246 | 158 | ####################################################################################################
# Translated from matlab: https://github.com/MICA-MNI/micaopen/blob/master/MPC/scripts/03_surf2mpc.m
# Original script by Casey Paquola
# Translated to python by Jessica Royer, with tiny changes for MICs dataset struct... |
fca9ea094fe383fdf252e35d856d1c80467afcdd0adfb647c8d9947a756cabcd | Python | 7,246 | 206 | """Core echo narration invariants (lane F28; snoop memo tests 1-3, 15-16).
Pinned here: the exactly-once contract (T-C), tier parity (T-B), scope
independence from retention, held-ancestor structure lines, followed_by
releases, and multi-pass Recorder resets -- each a live tripwire for the
mount classes the panel meas... |
28677baeab9595b26293b7d1143c7c34e59f9838895575d0ad46afdb019bb7df | Python | 7,247 | 181 | #!/usr/bin/env python
"""Determine intervals with missing data in the raw time series data.
If *any* signal appears to have missing values, the corresponding
interval is marked as missing.
EEG/EMG/LFP recordings often contain intervals with missing
data.
These events typically have one of two origins:
1) Missing va... |
8f2cdb241cee1a6dc276ed3e0207ed5a9497fac1be8234dd3d591d3de8f1b38f | Python | 7,248 | 209 | """02. Predict depth from an image sequence or a video with pre-trained Monodepth2 models
===========================================================================
This article will demonstrate how to estimate depth from your image sequence or video stream.
Please follow the `installation guide <../../index.html#ins... |
04d85e13057f29fd0ccf2a9fba929f960c0abba70f0f3818906f642c1fd159f2 | Python | 7,253 | 145 | """Быстрые проверки движка (блок 0.4). Каждый тест — секунды, не минуты.
.venv/bin/python -m pytest tests/ -q
Проверяются пять вещей, на которых стоит всё остальное:
* детерминизм прогона по seed'у;
* сохранение энергии (приход еды минус расходы = изменение энергии);
* поведение mi_from_hist на синтетике (иде... |
210dd3609e73d67105bafd6a806757f1a04bf24d48cb1b5e9aec4cd97d8484de | Python | 7,254 | 229 | __author__ = 'quentin'
from .adaptive_bg_tracker import AdaptiveBGModel, BackgroundModel, ObjectModel
from collections import deque
from math import log10
import cv2
CV_VERSION = int(cv2.__version__.split(".")[0])
import numpy as np
from scipy import ndimage
from ethoscope.core.variables import XPosVariable, YPosVaria... |
3b88f3db54ad9621c885b572d94a0247a782b0f1501a0cb9b94e010aa2a3ee2a | Python | 7,254 | 222 | import torch
import re
import string
import numpy as np
import collections
from sklearn.metrics import f1_score
# from sklearn.metrics import precision_recall_fscore_support
class Scorer(object):
def __init__(self, config, dataset):
self.config = config
# Metrics to compute
self.compute... |
49fe4c5097c07f624e85a9d190270566fde03d1c50832b1def27daf64358df88 | Python | 7,257 | 147 | #!/usr/bin/env python
# coding: utf-8
"""
Source-level RSA using a searchlight on surface data
----------------------------------------------------
This example demonstrates how to perform representational similarity analysis (RSA) on
source localized MEG data, using a searchlight approach.
In the searchlight approa... |
5f83ca9c777ece166bf7c7dd6fe6304efd676d3dfc64031f3f0f2512330e85a6 | Python | 7,259 | 186 | from locale import normalize
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # Code suppressing TF warnings and messages.
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import sys
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
import subprocess
import argparse
import bm3d
import numpy as np
imp... |
bfe28912f245cbd63cd42030767dc07f5b8f3c30a6b2cecba9f4115bb420fd3b | Python | 7,259 | 169 | import pylustrator
pylustrator.start()
import os
import tensorflow.keras as keras
from tf_spiking import DenseLIF, DenseLIFNoSpike, IntensityToPoissonSpiking
from tf_spiking.helper import TrainingHistory
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from copy import deepcopy
... |
334f9dcdeba5e6100557aa1ee90266d8de3f11eaf775c00dde44ff1f3e04679c | Python | 7,262 | 226 | import os
import matplotlib.pyplot as plt
import seaborn as sns
from os.path import join
import sklearn
from tqdm import tqdm
import pandas as pd
import pickle as pkl
# import notebook_helper
import dtreeviz
import dtreeviz.trees
from sklearn.tree import plot_tree
import sys
import numpy as np
import imodelsx.augtree.d... |
92f017d76074e1166759aabbee1d52ef011c3d34ae2b443b75d12954e5804259 | Python | 7,263 | 234 | import collections
import functools
import pathlib
import shutil
from nanite import model as nmodel
from .util import hashfile
SUPPORTED_FORMATS = [
".py",
]
class ExtensionManager:
def __init__(self, store_path):
"""Extension manager
This class can be used to maintain a set of extensions... |
3177d92b109d4faa071052f7f99164092ae48ddc71e2c8ac089dbcf1187c1f51 | Python | 7,264 | 249 | from typing import Type, Optional
import jax.numpy as jnp
from cvsx.unit_conversions import convert
from cvsx import cardiac_drivers as drv
from cvsx import components as c
def smith_2007():
return {
"mt": {
"r": jnp.array(convert(0.0600, "kPa s/l")),
},
"av": {
"... |
6c4ff1a27edd5ec9cf787d3a230c18e454988860a423784c273ef6198ca5460f | Python | 7,264 | 161 | '''
Copyright 2021 Twente Medical Systems international B.V., Oldenzaal The Netherlands
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 requir... |
9c4ea86a05c94a241112eb9e6d7de824ee4e1d239550896f2cb8a5a1d7ad0737 | Python | 7,264 | 181 | from __future__ import absolute_import
import logging
from collections import OrderedDict
from pip._internal.exceptions import InstallationError
from pip._internal.utils.logging import indent_log
from pip._internal.wheel import Wheel
logger = logging.getLogger(__name__)
class RequirementSet(object):
def __ini... |
f41d2150f70687f2b591930a1e3fa845e3315e5062eb2aa1600fa8146c4da0c5 | Python | 7,264 | 196 | # SOURCE: vendored from anantzoid/Recurrent-Entity-Networks-pytorch @ 2376498130089ca1adf7e6dd5221ef4bfb939b27
# File: model.py
#
# Recurrent Entity Networks (EntNet) (Henaff, Weston, Szlam, Bordes, LeCun, ICLR 2017,
# "Tracking the World State with Recurrent Entity Networks", arXiv:1612.03969). The
# original repo (ji... |
1960b35bdfd409b34216a1ab494d354a642c9299ff9cc7947cbd393ceac2d448 | Python | 7,265 | 145 | #==============================================================================#
# Author: Dominik Müller #
# Copyright: 2024 IT-Infrastructure for Translational Medical Research, #
# University of Augsburg ... |
daa2b62af542b7ce75fe3f19cc7be34be68c7dd8150eed729deebbfa249c59fa | Python | 7,265 | 200 | # Adapted from https://github.com/mlcommons/training_results_v1.1/blob/main/NVIDIA/benchmarks/bert/implementations/pytorch/fmha.py
import flash_attn_cuda
import torch
import torch.nn as nn
def convert_blockmask(blockmask, causal):
"""Convert from the 0-1 format to the format used by the CUDA code.
0 means the... |
043d06bfb3c92c1ff76bd86e09bbf91a1c97f029d90d6a790d7835063c53a257 | Python | 7,266 | 218 | import os.path
import pickle
from typing import Any, Callable, Optional, Tuple
import numpy as np
import PIL
from PIL import Image
import torch
from torchvision.datasets.utils import check_integrity, download_and_extract_archive
from torchvision.datasets.vision import VisionDataset
def add_feature(img, aug='uf', ims... |
67d7f623090eb7b79543641d223c300daa7765d8008c6eac747ba9b3d8d21593 | Python | 7,266 | 222 | # Copyright 2022 Deepfold Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
4fe4e87ba0bafdb1139eddff2eae0fa9e69201efe5c968e421b257248024098d | Python | 7,270 | 219 | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (leoxiaobin@gmail.com)
# Modified by Bowen Cheng (bcheng9@illinois.edu)
# ------------------------------------------------------------------------------
fro... |
104c1066e2c74082d00ad4bceb6ad93c9f9b2aa18f5ed1ba14541a7a03007a61 | Python | 7,271 | 192 | """W15 F1 regressions: batched per-consumption state TOCTOU sampling stays coverage-identical.
The per-consumption param/buffer TOCTOU scans batch their storage-pointer reads through the
true-original C accessors (``_split_consumed_state_items``) so the armed numpy-RNG setprofile
classifier no longer pays a per-regist... |
3f63dcf6bb2c0fe6c77ab7ea2907c009fc009e62f8277d1af23e8eaaab30c4f3 | Python | 7,271 | 190 | from typing import Literal, Optional, Union
import anndata
import igraph
import leidenalg
import numpy as np
import scipy
from sklearn.neighbors import kneighbors_graph
from ...configuration import SKM
def distance_knn_graph(dist: np.ndarray, num_neighbors: int):
"""Construct a k-nearest neighbor graph from a d... |
aa0f3c7b5616990915ff41457c4a0aadded74985660e0dfb399bf118984492f1 | Python | 7,271 | 235 | from __future__ import print_function, division, absolute_import
import torch.nn as nn
import torch.nn.functional as F
import math
import torch.utils.model_zoo as model_zoo
__all__ = ['FBResNet',
#'fbresnet18', 'fbresnet34', 'fbresnet50', 'fbresnet101',
'fbresnet152']
pretrained_settings = {
... |
d60ad1d8a2d67a64403112b2293a7990faec97a283565d99eaee98d148dd97df | Python | 7,271 | 228 | """
CrossentropyND and TopKLoss are from: https://github.com/MIC-DKFZ/nnUNet/blob/master/nnunet/training/loss_functions/ND_Crossentropy.py
"""
import numpy as np
import torch
import torch.nn.functional as F
from scipy.ndimage import distance_transform_edt
__all__ = ['CrossEntropyND', 'TopKLoss', 'WeightedCrossEntropy... |
40d587451b9c216627523400de3f1f949106c801f3ff77234dfa554959c277ce | Python | 7,272 | 200 | """Geofabrik's extract index, and :func:`get_data_by_bbox`, which downloads (and by default
crops) the OSM data for a bounding box as :func:`pyrosm.get_data_by_area` does.
The index is a vendored snapshot of Geofabrik's ``index-v1.json``
(``geofabrik_index.geojson.gz``), a GeoJSON ``FeatureCollection`` of every extrac... |
73e2834b6a9d2c385f6f80e2ee1bee6fce4439ff944b9ebbb56b587605442e67 | Python | 7,273 | 219 | """
figure_plots.py
General modules for figure plotting.
Plotting codes adapted from Jose Guzman.
"""
import matplotlib.pyplot as plt
from scipy.stats import mannwhitneyu as mwu
from scipy.stats import wilcoxon
from scipy.stats import sem
from scipy.stats import f_oneway
import numpy as np
#######################... |
5ca15f73f41388f38aa1960c1d4cd75e028843f187f8489e2201c3ac709e2b88 | Python | 7,275 | 241 | """FairChem EScAIPBackbone R6 compact reconstruction.
Paper: EScAIP: Efficiently Scaled Attention Interatomic Potential, 2024. EScAIP
uses graph neural-network blocks with attention over neighbor/edge representations for
atomistic energies and forces. This compact model keeps radial edge features,
neighbor-level mul... |
a9245f17fa2877b0b59b78f1f4f7f111d46b15d3e655399d18985077c9506a64 | Python | 7,276 | 204 | import collections
import torch
import os
import pandas as pd
import torch.nn as nn
from tqdm import tqdm
import numpy as np
EPS = 1e-12
class AverageMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
... |
63d0921a084b77dd6407525cfa538b8e3c84d39db02669861d1edce335f97502 | Python | 7,279 | 167 | # FAITHFUL PORT of nrhinehart/precog @ master (original framework: TensorFlow 1.x)
"""PRECOG (ICCV 2019) -- "PREdiction Conditioned On Goals", the ESP (Estimating Social-
forecast Probability) multi-agent joint trajectory model. The real repo
(nrhinehart/precog) is TensorFlow 1.x graph-mode code (`tf.contrib.rnn.GRUCel... |
836a306800ace2b61bae2c67753c9951bb0fa47fe46851ceac97b9b13aa8d9d8 | Python | 7,279 | 220 | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (leoxiaobin@gmail.com)
# Modified by Bowen Cheng (bcheng9@illinois.edu)
# ------------------------------------------------------------------------------
fro... |
16243b5d959f5df0733ede2009d4f07a3b496e1ac5f135d64d8efd542828ec30 | Python | 7,281 | 247 | from __future__ import annotations
from collections.abc import Callable
from typing import Final
import numpy as np
import osam
import pytest
from loguru import logger
from numpy.typing import NDArray
from labelme._automation._osam_session import OsamSession
from labelme._automation._osam_session import get_osam_ses... |
303e24fb748d711448d177547093b5541e4859e2958858072aa5fbc9bb147b85 | Python | 7,281 | 214 | import warnings
import os
import hashlib
import numpy as np
from typing import Any
from mirp._data_import.dicom_file import ImageDicomFile
from mirp._data_import.utilities import get_pydicom_meta_tag
class ImageDicomFileRTDose(ImageDicomFile):
def __init__(self, **kwargs):
super().__init__(**kwargs)
... |
b11ca9803c65f32e998590a89352f20fa8778f9088752ddbd41e871b9d4118e7 | Python | 7,281 | 203 | import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl.function as fn
from dgl.utils import expand_as_pair
from graphmae.utils import create_activation, NormLayer, create_norm
class GIN(nn.Module):
def __init__(self,
in_dim,
num_hidden,
o... |
175297d8f9a947eea6ba7301d4d22974d9acf822298b76a05acbeb8a0b64170a | Python | 7,282 | 211 | import logging
import numpy as np
import os
import pickle
import scipy.sparse as sp
import sys
# import tensorflow as tf
from scipy.sparse import linalg
class DataLoader(object):
def __init__(self, xs, ys, batch_size, pad_with_last_sample=True, shuffle=False):
"""
:param xs:
:param ys:
... |
8f51ffa13f4c00498b830405b4c81fdd4fac499f3db8d661ae3b698fdac4f414 | Python | 7,282 | 187 | """Tests for the MCP bridge (``torchlens.bridge.mcp``) over the agent registry."""
from __future__ import annotations
import asyncio
import json
from pathlib import Path
import pytest
import torch
from torch import nn
import torchlens as tl
from torchlens.bridge import mcp as tlmcp
@pytest.fixture()
def saved_tra... |
fbe865a97864aacf067bd0f0d033db656dddd720e676e397458d516c7cd4f4a4 | Python | 7,282 | 195 |
import torch
from torch import nn
import torchvision
import torch.nn.functional as F
import math
from torch.cuda.amp import autocast,GradScaler
class UNet(nn.Module):
def __init__(
self,
in_channels=1,
n_classes=2,
depth=5,
wf=6,
padding=True,
batch_norm=Tru... |
581a42727da5bdd724a2d69b79a7b54d36289cf39c802205deb683db3456cc17 | Python | 7,283 | 228 | """Extensions to the 'distutils' for large or complex distributions"""
import os
import sys
import functools
import distutils.core
import distutils.filelist
import re
from distutils.errors import DistutilsOptionError
from distutils.util import convert_path
from fnmatch import fnmatchcase
from ._deprecation_warning im... |
02f6e1b2e719b78febe39aba0ca32e5355efd094aa828bbf9c0794dc2c6f13ef | Python | 7,284 | 183 | import numpy as np
from spitfire import ChemicalMechanismSpec, build_nonadiabatic_defect_transient_slfm_library, build_nonadiabatic_defect_steady_slfm_library
from spitfire import build_nonadiabatic_defect_eq_library
from os.path import abspath, join
def get_flameletspecs():
test_xml = abspath(join('tests', 'test... |
0837cded22fbd304c79b61cf7ea77b9dcb1911a5754903b7b4929897509db4d2 | Python | 7,285 | 194 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created in July 2019
@author: Nathan de Lara <nathan.delara@polytechnique.org>
@author: Quentin Lutz <qlutz@enst.fr>
@author: Thomas Bonald <tbonald@enst.fr>
"""
from typing import Tuple, Optional, Union, List
import numpy as np
from scipy import sparse
from sknetwor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.