sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
a823023c43377f49d2e0631c56d71998b732a8bf68b5c3c3f4fd5e28e99a4aab | Python | 9,150 | 251 | # 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... |
3c5615b53867ffda797c139579c6679702cdfe1d0de0f7e0b69421fef108b303 | Python | 9,153 | 256 | from importlib import resources
import logging
from PyQt6 import uic, QtWidgets, QtCore
import matplotlib
from bmlab.models.setup import AVAILABLE_SETUPS
from bmlab.session import Session
from bmlab.controllers import PeakSelectionController, EvaluationController
from bmicro.gui.mpl import MplCanvas
import os
mat... |
1e34bf0ab6a983ea8b1452f7e0b8307c220e0d6e2fd215fd3234e8ecf7686660 | Python | 9,154 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "sankey"
_path_st... |
5dae8549e0391875cccab538e8eb8a4acce52069cf8aba66c9ca42a6a6559847 | Python | 9,154 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "volume"
_path_st... |
67fd0867f23a54a85498b011a69396695c204ea68f6435d9a97cace13571b499 | Python | 9,154 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "funnel"
_path_st... |
8a2df21e66ec3c0a9c24bccffde0c6861d2dca94e5bb7331b0a2c6c23fb67b1f | Python | 9,154 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "icicle"
_path_st... |
8e61f2451c4845f9b6cdf9c0cedb3c0ac0e1c24fde24bff8ecce5d3f5b3557c0 | Python | 9,154 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "violin"
_path_st... |
a3bb981d95c2576c391e1801ed22ea6bd47390389861f80719676bf961006b08 | Python | 9,154 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "mesh3d"
_path_st... |
aa4d902857726eb0e0a73938eebd187b296c3e49929dfd51446f5742288b0548 | Python | 9,154 | 238 | import re
import shlex
import subprocess
import numpy as np
from collections import Counter, defaultdict
from sklearn.metrics import f1_score,accuracy_score,confusion_matrix
class Evaluator:
def __init__(self, mode = "combined", k=8, best_of=1,exact_match=True, full_align=False):
self.mode = mode... |
f2cb3d817004e7782efb14d54da885ae76fd224b2e95f0be25de88d264d44445 | Python | 9,154 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "quiver"
_path_st... |
3cbbc2b05cc2999137d95090f62440c960f85a3ac4e611e0485fdb69959f8322 | Python | 9,156 | 266 |
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, Input, Lambda, Conv2D, Conv2DTranspose, MaxPool2D, UpSampling2D, Flatten, Reshape, Cropping2D
from keras import backend as K
from keras.losses import mse, binary_crossentropy
import math
import numpy as np
# create MLP model
def mlp_m... |
ddcd37b052ef4493cc9020025aa00c3229af87e20d16cad678c0583caefa82e0 | Python | 9,156 | 278 | """Loader base class."""
import importlib
import os
import re
import sys
from datetime import datetime, timezone
from kombu.utils import json
from kombu.utils.objects import cached_property
from celery import signals
from celery.exceptions import reraise
from celery.utils.collections import DictAttribute, force_mappi... |
6b972c6aa3f3da5f9ed029417221d60ae65f132a58b581b7c7be7ed1e3a71704 | Python | 9,157 | 214 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
import json
import shutil
import subprocess
import sys
from pathlib import Path
import pytest
from PIL import Image
from tests import CUDA_DEVICE_COUNT, CUDA_IS_AVAILABLE, MODELS, TASK_MODEL_DATA
from ultralytics.utils import ARM64, ASSETS, DATASETS... |
a5bb78569d6773026c84a20115be6f5fb260c421c3e52bd1f7e006cd363bfd28 | Python | 9,159 | 231 | """
02: Fitting Power Spectrum Models
=================================
Introduction to the module, beginning with the model object.
"""
###################################################################################################
# Import the model object
from specparam import SpectralModel
# Import a utilit... |
fcd7d95b0dce9cbe21e301bb990a003b3f8efaf24c35f57f41e29a3ce0d19216 | Python | 9,159 | 231 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#python main_profiles.py /home/mzieleniewska/empi/from_hpc/data/smp/
from __future__ import division
import argparse
import os
import glob
import json
import pandas as pd
import numpy as np
from scipy.stats import scoreatpercentile, gamma, skew, pareto, entropy
import m... |
5124638e35b5f6ed37b2824a17a9da113cc5daaff0f9103c79e84cdcf20c48ba | Python | 9,161 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "contour"
_path_s... |
8041faeefcb1f9e5460dd0af55d40c52261fa8d0649127cee9f0959cdc749388 | Python | 9,161 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "heatmap"
_path_s... |
8f307b6e263cb37437e8e5dcfa0578054d4a872f1b395ef6a0a88f7f9a9e2379 | Python | 9,161 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "treemap"
_path_s... |
9b1b8f805316f35a9bb1fd0c06cdaff612a08b35e4867de11d27426a4f4e4569 | Python | 9,161 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "surface"
_path_s... |
ab42d2aa4f4421035bce5d2e150741c1c4ab844879661f52070a3cfa514de7a3 | Python | 9,161 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scatter"
_path_s... |
039b0199e509a38a172f8f64c1c70705c0c4889519428adbad2e36b2f953efd5 | Python | 9,162 | 269 | """Assemble collected node/way/relation records into a GeoDataFrame through pyrosm's own
tag and geometry pipeline, so the output matches the in-memory reader column-for-column.
"""
import numpy as np
from pyrosm.engine.bounding_box import _in_box_nodes
from pyrosm.engine.decode import _is_threaded
from pyrosm.engine... |
b705454c75970b9ee3bd6a01cc68c7d4a0b7177c2ba5c0714995da764bd019ec | Python | 9,163 | 264 | # Copyright (c) 2024 PaddleHelix Authors. All Rights Reserved.
#
# Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0
# International License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://creativecommo... |
882f2cf80824210b6cea0f725dc7f721f609fc1ac8c551d5280ef09df898b6e6 | Python | 9,164 | 255 | """Unit tests for the searchlight patch generator."""
import numpy as np
import pytest
from mne_rsa import searchlight
from numpy.testing import assert_equal
from scipy import sparse
class TestSearchLight:
"""Test the searchlight generator class."""
def test_iter_spatio_temporal(self):
"""Test gener... |
15abaff5cfd9bd48ccd3f65426945692e02ba9e0b6305a8b8e78a2471aabef84 | Python | 9,166 | 240 | # !/usr/bin/env python3
# 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
#
... |
5cc2c04d74ca2fae45778c6e6736aebd2c193f664bdc340b2d5728a40a988d87 | Python | 9,168 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "sunburst"
_path_... |
72b35eff4a6108adebf3fe670f7c396272ca5c037f86c280dd64f1ec6accf295 | Python | 9,168 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "barpolar"
_path_... |
aaa0eb2152afebb31ed2badcd40db42a96de46d14803a17fd22c793bed16c713 | Python | 9,169 | 222 | # type: ignore
from contextlib import contextmanager
from typing import Any, Callable, Iterable, List, Optional, Type
import torch
import torch.nn as nn
from pytorch_lightning import LightningModule, Trainer
from pytorch_lightning.utilities.apply_func import apply_to_collection
from pytorch_lightning.utilities.excepti... |
d6b6067adfad96eba4b8ecdcacfefc4f0bb94dd9628ff16452a50dc3fbb2c70c | Python | 9,169 | 264 | import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
from .custom_modules import SequentialWithArgs, FakeReLU
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth'... |
4f8ffaccada9f019d3807098e29ab778976b0b6e51e906061b2aa921c776b0b5 | Python | 9,170 | 226 | '''
K-Folding script
author: obanmarcos
'''
import os
import os, sys
from config import *
sys.path.append(where_am_i())
import pytorch_lightning as pl
from pytorch_lightning.profiler import SimpleProfiler
import argparse
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from utilities import dat... |
7f16638c98bc484361b8e1d2f944cd859fe03a2fdac5f4a84dc49c3d5ceca975 | Python | 9,170 | 231 | #!/usr/bin/env python3
'''Take a prefix and model name run predictions, and generate evaluations for crystal, bestonly,
and all test sets (take max affinity; if pose score is available also consider
max pose score).
Generates graphs and overall CV results. Takes the prefix and (for now) assumes trial 0.
Will evalua... |
00563005ed95a9052794f8d3f9646642502cb1d7598314a5d04317d1571f316b | Python | 9,171 | 269 | """Tests for the TorchLens 2.0 top-level API budget."""
from __future__ import annotations
import importlib
import warnings
import torchlens
TARGET_ALL = [
# L3 ATen profile facade (documented-unstable; exported at __all__ head).
# Ratchet row repaired by L6 post-merge: the L1/L3 merge train landed the
... |
91c1f2b63c4efab42ab0ce20b7ef90089b046923af33c80f762ddc168a2181f6 | Python | 9,172 | 232 | """Capability-table lockstep + chokepoint battery (L7a memo sec 6).
BOTH halves of the outcome-table enforcement pattern: (i) the NEGATIVE scan —
nobody reads STRUCTURE_ONLY_CAPABILITIES but the one chokepoint — AND (ii) a
POSITIVE CALLSITE INVENTORY over every value-bearing surface the table
promises to gate. Plus: d... |
e08d2bb84fd70f919d5604709c9fee8d83e604cdcd6bcee43c7f88e26e030fb5 | Python | 9,173 | 281 | import networkx as nx
import numpy as np
import pandas as pd
import scanpy as sc
from anndata import AnnData
from networkx import Graph
from sklearn.neighbors import NearestCentroid
from stlearn.spatial.clustering import localization
from stlearn.spatial.morphology import adjust
from stlearn.types import _METHOD
def... |
ebc674ad372ea4b9717e0b28369503f5d02c3a97a4ae3ebda8eea4b1212ff2db | Python | 9,174 | 265 | """TensorFlow backend registry and P1 mode-selection tests."""
from __future__ import annotations
import sys
import types
from typing import Any
import pytest
import torch
from conftest import tensorflow_backend_modules
import torchlens as tl
from torchlens.backends import (
BackendMismatchError,
get_backen... |
000e27f187d1d24bf5ca8c92206e2e56ae82802018a2fc478588cde23a3447a8 | Python | 9,175 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scattergl"
_path... |
0f92383752b50527181d25a92656aea00992ed25c1b1edbebb0b972d2d753d44 | Python | 9,175 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "histogram"
_path... |
679e19b6f2cdfd28de03e67b1bcd3de802fb70a137f4bd6f83602eac91ade837 | Python | 9,175 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "waterfall"
_path... |
7c1a3d6424e57d55bedcd96e782daf124869b71f77f5ed221c1d8d612baab251 | Python | 9,175 | 279 | """Phase 4 facet patching helper tests."""
from __future__ import annotations
from collections.abc import Iterator
from typing import Any
import pytest
import torch
from torch import nn
import torchlens as tl
from torchlens.semantic import FacetSpec
class HeadResult(nn.Module):
"""Return two explicit head-res... |
8f9485559d9286777e70552b1e8f0b5607ed10b2af7ca3c9f55f57a41a6b4fd7 | Python | 9,175 | 220 | import numpy as np
import tensorflow as tf
from scipy.integrate import odeint
from scipy.special import binom
def library_size(n, poly_order, use_sine=False, include_constant=True):
l = 0
for k in range(poly_order + 1):
l += int(binom(n + k - 1, k))
if use_sine:
l += n
if not include_c... |
f1f1605479deef36e0b990e3b129685adec62d3942e66bd902b92cb7f5962c2e | Python | 9,175 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scatter3d"
_path... |
38ba22cd7cdd64d8b1cf30e9174d81d78bf73fab1f2e582320ffdb41498ee5a4 | Python | 9,176 | 266 | import numpy as np
from abc import abstractmethod, ABC
from rdkit.Chem import Mol
from typing import Sequence, List, Any
class ConfRanker(ABC):
"""Base class of conformer rankers
:param name: Name of the ranker
:type name: str
:param ascending: Set to True to rank conformer by ascending
value... |
74ec520463e47aa1eb67d5dd7374fd3e5ba037fc4127dc1e48c1467f5c6d0725 | Python | 9,176 | 236 | # Run test with:
# torchrun --no_python --nproc_per_node=8 pytest -q -s tests/models/test_gpt_parallel.py
import math
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
from apex.transformer import parallel_state
from einops import rearrange
from flash_attn.losses.cross_entropy import Cr... |
05dc273f8f7a3b01e5f45e7365960bd50fca41675d7f40322d286e56631cdbc5 | Python | 9,177 | 247 | from keras.src import backend
from keras.src import initializers
from keras.src.api_export import keras_export
from keras.src.optimizers import optimizer
@keras_export(["keras.optimizers.Ftrl"])
class Ftrl(optimizer.Optimizer):
r"""Optimizer that implements the FTRL algorithm.
"Follow The Regularized Leader"... |
fac5effe4273ce7c7f723eeba75306c2b19e71973919d80461ca759d7354f022 | Python | 9,178 | 247 | """Teardown of a half-open broker connection must be bounded.
Two long-standing hangs share one cause: a read issued on a socket that is
already open, against a peer that has gone silent without sending RST - a
suspended VM, or a firewall dropping the flow.
* GH-9705 (reconnect): ``on_connection_error_after_connected... |
498cd8ae5c9bff471d7b8e13f17c69b17942cc198ea8896057ea51a6e4337c95 | Python | 9,180 | 265 | import pytest
import nway.utils as utils
import numpy as np
from jinja2 import Template
import os
import json
import PIL.Image
TEST_FILE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'test_files')
@pytest.fixture(scope='function')
def experiments(tmpdir):
thistest = os.path.join... |
25f92de2f8b9e4e5f5790aefb9dfc9addb2fd977535535be78b75fe59e4c051b | Python | 9,181 | 364 | """Hyperbolic neural networks on the Poincare ball, 2018-2019.
Paper: Ganea, Becigneul, and Hofmann 2018, "Hyperbolic Neural Networks";
Chami et al. 2019, "Hyperbolic Graph Convolutional Neural Networks".
The modules implement Poincare-ball exp/log maps, Mobius addition, and small
hyperbolic linear/aggregation layers ... |
03c070158f746a9d0a6332a0c47fe259e3f41d82d1d46edc3c5faff6b70be3f0 | Python | 9,182 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "choropleth"
_pat... |
3801bd2983581adebf2a6302ccefd4d6406be0f35e6929a8a643e37c64acac20 | Python | 9,182 | 279 | """Module for regression functions."""
import functools
import numpy as np
from sklearn.base import RegressorMixin
from sklearn.metrics import r2_score
from sklearn.svm import SVR as sklearnSVR
from sklearn.utils.extmath import softmax
from .classification import MDM
from .geometry._docs import deprecated
from .geome... |
4ebe986f892d5f7f45f7dab96da422b8deb2a627329fd7f6e1dbecaaea9ca7d1 | Python | 9,182 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "densitymap"
_pat... |
50a68c7cfc8bd6984f1a7ca33db4a3d47b12c187280c434cb2db9aa32fc2f50c | Python | 9,182 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scattergeo"
_pat... |
5fa19e105777461338372dda7cc544d0843eaa3fd712b4aa2b0f6e5ccb1045f4 | Python | 9,182 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "isosurface"
_pat... |
ec4feba59d532234b49dff5a691634bf55120ee024fbeb0e971be946e82427f9 | Python | 9,182 | 263 | """Tests for xcp_d.utils.restingstate."""
import warnings
import numpy as np
import pytest
from nilearn import masking
from scipy import signal
from xcp_d.utils import restingstate
def test_compute_alff(ds001419_data):
"""Test ALFF calculated from an array.
Get the FFT of a Nifti, add to the amplitude of ... |
ed28916b1c2e61497af02716506f7a4c85566203c8f0e7a2547343bf8d8745c7 | Python | 9,182 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "streamtube"
_pat... |
fa30c340b1f158507297883d1adb9b8978a1eb12b3239e74380d2afd2904bf94 | Python | 9,182 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "funnelarea"
_pat... |
fa4df99c6b297268500ecc688425d16b1f5cadcc9600817143a1e0ba32f3821f | Python | 9,182 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scattermap"
_pat... |
52f6139710b99089834fa0f90490ebc96ddd976d4a80eb3684d39b4e0556f273 | Python | 9,183 | 290 | import pynvml as real_pynvml
GEO_METADATA_USA = {
"organization_name": "foobar",
"region": "Illinois",
"accuracy": 1,
"asn": 0,
"organization": "foobar",
"timezone": "America/Chicago",
"longitude": "88",
"country_code3": "USA",
"area_code": "0",
"ip": "foobar",
"city": "Chic... |
e600a543a574e5db913bb1878647951124ee615bbc373b7c49f8a27c0015105e | Python | 9,183 | 318 | """Tests for Op.var_names source assignment extraction."""
from __future__ import annotations
from collections.abc import Callable
from pathlib import Path
from typing import Any
import torch
import torchlens as tl
from torchlens.data_classes.trace import Trace
def _first_var_names(trace: Trace, func_name: str) -... |
a24436e5285a303ff6c4cb503353668f33108ddb0bb17ec07e9d121d3aa24f5e | Python | 9,184 | 212 | import json
import numpy as np
import os
from pose_model import PoseEstimationInferenceModel
import cv2
from PIL import Image
from tqdm import tqdm
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
DATASET_INFO = {
'MSCOCOPerson2017_val': {
"img_dir": os.path.expanduser('~/.mxnet/dat... |
6788865e1ad86004473e491611fe321252eec00b03905c8a75915b900cd15bd0 | Python | 9,185 | 261 | import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
from .custom_modules import SequentialWithArgs, FakeReLU
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth'... |
6e6e45e56bd7a31a1ee802082d0197a0bc1682bdb4e2f14ab58a7f2a18f6ce9b | Python | 9,185 | 219 | from typing import (
cast,
Optional,
TYPE_CHECKING,
Union,
)
from galaxy.model import (
DatasetCollection,
DatasetInstance,
)
from galaxy.model.orm.util import add_object_to_object_session
from galaxy.util.oset import OrderedSet
from .type_description import COLLECTION_TYPE_DESCRIPTION_FACTORY
... |
ec887e79ea6f7a36ba6353c3389767f8bf6964927d315e81b3a0f4bc9462daee | Python | 9,185 | 257 | """Blend fluorescence image channels for visualization"""
import numbers
import warnings
import numpy as np
from skimage.color import gray2rgb, hsv2rgb, rgb2hsv
from skimage.exposure import rescale_intensity
class NoImageDataWarning(UserWarning):
pass
class FlBlend:
def __init__(self):
self.images ... |
912631b6100975743861c2913c84b380c788b69d9c74a7c0dcb90fa9333b4b65 | Python | 9,186 | 269 | import warnings
from functools import lru_cache
from typing import Generator
import numpy as np
import pandas as pd
import scipy.ndimage as ndi
from mirp._images.generic_image import GenericImage
from mirp._masks.base_mask import BaseMask
from mirp._features.base_feature import Feature
from mirp._features.utilities ... |
982dae1d8c6778c6fc7c3240a46d4f2eb650cb5e54619bb4203ad01fc0f6e004 | Python | 9,188 | 265 | from copy import deepcopy
from re import fullmatch
# Interpretation grammar for re-writing input sequences as output sequences.
# - Each grammar is a list of algebraic re-write rules.
# - Rules are applied in sequential order (first come, first serve)
def is_prim_var(s):
# detect if string is a primitive name, s... |
8c9df804fc514f4bc3f4d76fa182d6c189caaf46172de7f9f1799356afef03db | Python | 9,189 | 266 | #!/usr/bin/env python3
"""
File: plot_cf_per_pic.py
Created: 2022/05/10
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 University Medical Center Groningen.
A copy of the BSD 3-Clause "New" or "Revised" License can be found in the
LICENSE file in the root directory of this source tree.
"""
#... |
912eb8d63360c47b23a22c4e8d759c1c7a15e375e5f0fc2efd5cb29be6d52a58 | Python | 9,189 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "sankey.node"
_pa... |
d843d73b14d8c7fc4653a5ba4f968206ed0defea3667f2b08b42f3583094074f | Python | 9,189 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "histogram2d"
_pa... |
e845c5c8cf299d7d27980dcd58dee5a8ce058b012dc71cc53d3f7ea7be820cb3 | Python | 9,189 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "sankey.link"
_pa... |
099b1857fbb4988c05f993b4a9edaf0638b9004328079274621dbb4b568e359c | Python | 9,196 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scatterpolar"
_p... |
1b80b35a856396027e2e90e8cbf7c1162225281bcabedac6b5a321c5e22ae9c0 | Python | 9,196 | 423 | goldalign = [ ([0], [0]),
([1], [1]),
([2], [2]),
([3], [3]),
([4], [4]),
([5], [5]),
([6], [6, 7, 8]),
([7], [9]),
([8, 9], [10, 11, 12]),
([10, 11], [13]),
([12], [14]),
([13], [15]),
([], [16]),
([], [17]),
([], [18]),
([], [19]),
([], [20]),
([],... |
4afbcc94d5deacdead9b03760781f2e740ce7ee9ad6d77185c718eb61533b04c | Python | 9,196 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scattersmith"
_p... |
6f258bef9b2973795faed73124f2237fdbe2eb1d88c41e034e53185381eddbf7 | Python | 9,196 | 185 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 21 20:31:58 2022
Built mscnn model to achieve multi-scale human mobility prediction.
@author: 8
"""
# Packages
import os
import torch
import copy
import utils
import json
import warnings
import numpy as np
import pandas as pd
import tgan_utils
import time, operator
import ... |
af3b1f5f31832dfbb87af87ef731946132f2131ef90a4676726046da685af26b | Python | 9,196 | 172 | # Written by Seonwoo Min, Seoul National University (mswzeus@gmail.com)
# PLUS
import os
import sys
import argparse
import torch
import plus.config as config
from plus.data.alphabets import Protein
import plus.data.solubility as solubility
import plus.data.dataset as dataset
import plus.model.plus_rnn as plus_rnn
im... |
92f7d3524d03f3b72e93a8a641cc42689f0217f32d9dd21d1e68f0dc448ebf69 | Python | 9,197 | 234 | import torch
from torch.nn import Module
from typing import Iterator, Union
import numpy as np
from .utility import to_device
class Linear(Module):
_tensors = ["weights"]
def __init__(self, n_in: int, n_out: int, weights: Union[np.ndarray, torch.Tensor] = None,
dtype: torch.dtype = torch.fl... |
077cd08520d8048a4bee0d77ef2d6d227d387f639da38c51da2a497aa7b887e5 | Python | 9,201 | 212 | """A09 listA row 25b + agent stage-0 items 2/3/5 over the F29 registry: MCP
bounds, manifest-first load plan, content-digest identity, served-schema
parity, memory-shaped refusal plant.
One MCP tool call must never materialize an unbounded artifact (the OOM
vector), every load decision is made from manifest-DECLARED n... |
157fd881de99611f3cb7a4b263b80740232a039e0cf136b2f74ea121b968ecb5 | Python | 9,203 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "choroplethmap"
_... |
4a1e41ef4943b97d91d10900cbcfe95403dbaacb7edca7552b81f39a771aa367 | Python | 9,203 | 257 | """Phase 4 streaming statistics tests."""
from __future__ import annotations
import tracemalloc
import pytest
import torch
import torchlens as tl
from torchlens.intervention.errors import MultiMatchWarning
def _manual_covariance(matrix: torch.Tensor) -> torch.Tensor:
"""Return the sample covariance of a row-w... |
7cfb0bc70b9dc6796dd458e8a504cad428db53b9f32924246af58e2be9bf9d96 | Python | 9,203 | 173 | # Written by Seonwoo Min, Seoul National University (mswzeus@gmail.com)
# PLUS
import os
import sys
import argparse
import torch
import plus.config as config
from plus.data.alphabets import Protein
import plus.data.stability as ss
import plus.data.dataset as dataset
import plus.model.plus_rnn as plus_rnn
import plus... |
82a10043b3f7ddd0bf38c0304f7b51189156c58671af67e19c43fedcc8f402b2 | Python | 9,203 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scattercarpet"
_... |
e28a13e1b9527c1d38ad251fd04a052d6f6f7a24cbe5760303394a057d6ba97f | Python | 9,203 | 266 | import subprocess
import sys
import time
from uuid import uuid4
import pytest
from celery import Celery
from celery.utils.sysinfo import cpu_budget
from .conftest import TEST_BROKER, flaky
from .tasks import add
TIMEOUT = 10
def test_run_worker():
with pytest.raises(subprocess.CalledProcessError) as exc_info:... |
0174253470ba74f95069d13b852d24509323e8f49941471cd40c2722a0761349 | Python | 9,205 | 208 | import argparse
import pandas as pd
import numpy as np
import os
import utils
import json
import tgan_utils
import torch, gc
import datetime
import time, operator
from torch import nn
from torch import optim
from math import sqrt, sin, cos, pi, asin
import geopandas as gpd
import copy
from scipy import sparse
#%%
def ... |
58ec6920ba182c8f82fa5359590f9e337499277d3d85dd8f5b1c64006629220b | Python | 9,205 | 277 | """ReadCaches for the ReadUntilClient
"""
from collections import OrderedDict
from collections.abc import MutableMapping
from threading import RLock
class ReadCache(MutableMapping):
"""A thread-safe dict-like container with a maximum size
This ReadCache contains all the required methods for working as an ord... |
01f272f6588230469a5a7f67e1cb66dc7f8451babc8ae3d6c544bbaa12583935 | Python | 9,208 | 265 | import math
from plotly import exceptions
from plotly.graph_objs import graph_objs
from plotly.figure_factory import utils
def create_quiver(
x, y, u, v, scale=0.1, arrow_scale=0.3, angle=math.pi / 9, scaleratio=None, **kwargs
):
"""
Returns a figure for a quiver plot.
:param (list|ndarray) x: x coo... |
7e52a8187d0c516c6afdfb9bd80b38e079ad0a572039feb8f7b42d9397c2b85b | Python | 9,208 | 172 | # Written by Seonwoo Min, Seoul National University (mswzeus@gmail.com)
# PLUS
import os
import sys
import argparse
import torch
import plus.config as config
from plus.data.alphabets import Protein
import plus.data.localization as localization
import plus.data.dataset as dataset
import plus.model.plus_rnn as plus_rn... |
5207e28bc746267ec7794fee45c69bf294c5c153c27fbfa164ebac719fab3675 | Python | 9,210 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scatterpolargl"
... |
e36bb4228b5209ced914ae242d5ffeeb0d77fe133b3914d6fad1646580cd93c2 | Python | 9,210 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "scatterternary"
... |
cc228f20df17cd23b504de6072b36dd1d83c2fcc320f42f429778dc706d7b57e | Python | 9,212 | 261 | from typing import Dict, List, Tuple, Union
from PIL.Image import Image
from torch import Tensor
from lightly.transforms.gaussian_blur import GaussianBlur
from lightly.transforms.multi_view_transform import MultiViewTransform
from lightly.transforms.solarize import RandomSolarization
from lightly.transforms.torchvisi... |
c078a903b7260ed3ff60dd29df26ca41ae371b15a01446bfa19f8bd4b3f6846f | Python | 9,214 | 265 | # SOURCE: vendored from fdbtrs/CR-FIQA @ main (backbones/iresnet.py)
# The queue's designated "official" FaceQNet repo (javier-hernandezo/FaceQnet) only ships a
# Keras/TensorFlow inference script (src/FaceQNet_obtainscores_Keras.py) -- no PyTorch model
# code exists there. The queue notes explicitly flag the PyTorch a... |
4780f2d9d7610f99622d79235055ee623c97362cce839072096fa0c388dbf915 | Python | 9,218 | 235 | from optical_network import *
from utils import *
import shutil
import time
import numpy as np
import os
import torch
import argparse
from torch import nn
from torchvision import datasets, transforms
import matplotlib.pyplot as plt
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import D... |
23457399b24abb8819cfa2370d02f5c06618231df049afe1db07bd1dd90682f2 | Python | 9,221 | 192 | # FAITHFUL PORT of mims-harvard/decagon @ master (original framework: TensorFlow 1.x)
# https://raw.githubusercontent.com/mims-harvard/decagon/master/decagon/deep/layers.py
# https://raw.githubusercontent.com/mims-harvard/decagon/master/decagon/deep/model.py
# https://raw.githubusercontent.com/mims-harvard/decagon/mast... |
b9c669fa864a4dd4983760d48f8c4eb4c90655a01bab6cd1b85c068693e5b801 | Python | 9,221 | 234 | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... |
61533333370605c5b4f6ae03d044dcc63ca216d2d588c6a4a862befecbbe158d | Python | 9,222 | 223 | ##########################################################################
## ##
## Copyright (c) 2019 Philipp Lösel. All rights reserved. ##
## ##
## This file is par... |
11821922a4cfde4ea527a61d7f5b518bf783e6d62771845810daf2804b957d97 | Python | 9,224 | 207 | """Fail-closed group-lifecycle bookkeeping (round-3 R18 / SF-09 class).
Two fail-open holes are pinned shut here:
1. The arm-time group-history probe stamped ``armed_before_any_group`` -- the
COMPLETE-WITNESS epoch whose lineage vector overrides other ranks' evidence
in the merge-time audit -- whenever the prob... |
6243a2c3de5de8a708047ccd65991a9f909317f277f011f181dea9d881955bc6 | Python | 9,224 | 257 | """One intervention spec gives one answer through every execution door.
Regression pins for two door splits:
* A pass-label module selector (``tl.module("block:2")``, documented as
"module address or pass label") on a module called twice matched zero sites
in ``tl.trace`` and ``tl.record`` (warning, unsteered) wh... |
27a154e49e5017d9858b230f62f600fc4de61d9f805651399892a2c3a3759f3b | Python | 9,225 | 253 | #!/usr/bin/env python3
"""
File: visualise_correlation_as_forest.py
Created: 2022/07/14
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 University Medical Center Groningen.
A copy of the BSD 3-Clause "New" or "Revised" License can be found in the
LICENSE file in the root directory of this sou... |
4b96287bb59de0067085432156a5fec367c2ae9e5fe6103686eb91bc7e8e21a2 | Python | 9,227 | 342 | import jinja2 # type: ignore
from rpy2.robjects import (vectors,
RObject,
SignatureTranslatedFunction,
RS4)
from rpy2 import rinterface
from rpy2.robjects.packages import SourceCode
from rpy2.robjects.packages import wherefrom
from IPyth... |
7d29793ac6564a6151dd0251bf2cb63b16dc624b8890fbf291634e845bc07140 | Python | 9,228 | 270 | import os
import operator
import sys
import contextlib
import itertools
import unittest
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils import log
from unittest import TestLoader
from setuptools.extern import six
from setuptools.extern.six.moves import map, filter
from pkg_resources i... |
3619316d806a6a118bbed10fb4dcc0f955e9adcde219b60b5dbe28fb4a53b5e1 | Python | 9,231 | 223 | ##############################################################################
## setup.py -- Script to generate swig based interface for python
## Revision: $Id$
##
## Copyright (C) Kshitij Kulshreshtha
##
## This file is part of ADOL-C. This software is provided as open source.
## Any use, reproduction, or distributi... |
5090fa5ccb94a9fd26c2ec6af252b6a0341e9b458cddb9a3d13f82f6ea2fa9a8 | Python | 9,233 | 226 | """dialz bridge against the real package (0.2 and 1.x) on a tiny cached Llama.
Each test compares ``tl.bridge.dialz.vector`` on saved activations with
``dialz.SteeringVector.train`` run directly on the same ``SteeringModel``. Skips
when dialz, transformers, or the checkpoint is unavailable.
"""
from __future__ import... |
409c32442c326190df7446d8551dd5d3bc45b27a76b1b682edfd64852dbf54b5 | Python | 9,234 | 208 | '''Code to implement the model and run a single simulation.'''
# © Thomas Akam, 2023, released under the GPLv3 licence.
#%% Imports
import os
import json
import pickle
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from collections import namedtuple
import... |
4826c64cae9c5eb00ab5beef53dc038bcb0bb5d6687a15896b158e90706c4487 | Python | 9,239 | 268 | # --- 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 Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "histogram2dcontour"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.