sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b7ad2414cb629c3d940f8d04d13887a694b23b9466fb7b5cd746a02b19a69599 | Python | 21,006 | 463 | # Copyright 2023 Kakao Brain and 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 requi... |
35b3aefd066ebb584fbaa164946b976a6e7290a6666d90c45bfc7cf7ad6a0572 | Python | 21,013 | 620 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import annotations
import math
import os
import pickle
import shutil
import tempfile
from collections import namedtuple
fr... |
aab51f43fee655fda5c499a0481fffd45bf390bdb8229944262c41e0a900cec1 | Python | 21,015 | 533 | from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
'''
# --------------------------------------------
# Advanced nn.Sequential
# https://github.com/xinntao/BasicSR
# --------------------------------------------
'''
def sequential(*args):
"""Advanced nn.Sequent... |
561aeca4c6181538b7f66c9fdb0637e8a64c9cbe10f97880ea58647965af6379 | Python | 21,021 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
dda762344d8d2925ec34a72d62659c0e0b2bbe2f8fecb4e8f425559df0a770dc | Python | 21,021 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
888523c8b0d4dad60de3605259a21c49437abc41d20aed7fbba0e5af99d90365 | Python | 21,025 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
a3f400438f04dcbcbd8dd3437c97fe621dc0fee82e8a77a0de43fab89739f73a | Python | 21,025 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
aa1425d4ccd45756abc1ef382d3a3d98304c2b4a70af975a163495b691faf07f | Python | 21,025 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
6dc46498856590fc116f455382ffd1d18072b12067f3bdc54f5e39f1aef270cb | Python | 21,027 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
9914247ce6b8ed18335e871589c55dcb1279e2ff4c56db4f3ef14d3916930d18 | Python | 21,029 | 577 | # -*- coding: utf-8 -*-
'''
Document Module
'''
from __future__ import division
import pkg_resources
from os.path import join
import numpy as np
from scipy import stats
from scipy import special
from dipy.reconst.shm import real_sym_sh_mrtrix
from dmipy.utils import utils
from scipy import interpolate
from dmipy.core... |
52ae1652f08fb7f690ba4262968908452e88b7040ea6f402b94e100a48d5f1b5 | Python | 21,057 | 446 | import numpy as np
import pandas as pd
import ants
import os
from tqdm import tqdm
from sklearn.mixture import GaussianMixture as gmm
# from umap import UMAP
from sklearn.decomposition import PCA
from matplotlib import pyplot as plt
from scipy.stats import kendalltau,pearsonr
import nibabel as nib
# from enigmatoolbox.... |
742f4ebb279447f53de61ef3bc082ecb2c0ea966b50766a693af03e44a634192 | Python | 21,057 | 546 | ###UGR practice
# This code was adapted from Dominic's UGDG code used in ISTART by Daniel for the RF1 grant
from psychopy import visual, core, event, gui, data, sound, logging
import csv
import datetime
import random
import numpy
import os
#parameters
useFullScreen = True
useDualScreen=1
DEBUG = False
frame_rate=1
... |
f18afb9c3b434a14b3163fd9964b174f7fac495f7a2f542c5a813a309a1c1abb | Python | 21,060 | 496 | import inspect
from typing import List, Optional, Union
import numpy as np
import PIL
import torch
from torch import nn
from torch.nn import functional as F
from torchvision import transforms
from transformers import CLIPFeatureExtractor, CLIPModel, CLIPTextModel, CLIPTokenizer
from diffusers import (
Autoencoder... |
b965882a57eb7d92ca826770d4741b52e768bc7442d49d778abac47c593388fb | Python | 21,064 | 468 | import os
import os.path as osp
import pandas as pd
import numpy as np
import sys
import copy
from torch_geometric.data import DataLoader
import torch
import torch.nn as nn
import torch.functional as F
from tqdm import tqdm
from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay
from sklearn.metrics im... |
4bcea883ec6e9050ea874cffb233e6cfe820bf88033e8a309a3472f1b2f2e484 | Python | 21,067 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
3d7dc72591da2e79ba62f306aba6483607ce3a6af7422e8d53bd55c8ce0a9d3b | Python | 21,068 | 619 | """Token-aware context budget manager for OVAgent.
Replaces per-tool and per-turn character clipping with a budget layer
that accounts for prompt segments, tool output tiers, conversation
history, and subagent contexts. Supports incremental sliding summaries
instead of one-shot compaction only.
Contract
--------
* P... |
2657ee1224b419620dad6cf8aa34043c07c6864b106dcf419ea731bf6848dd79 | Python | 21,069 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
e2c538767cdacd8374a419d8bc028d02bf12a72e4e0580a989712ee45daed4f5 | Python | 21,070 | 630 | # -*- coding: utf-8 -*-
"""
Colors
======
The `vtkplotlib.colors` module provides methods for:
- Converting the various color types and matplotlib's named colors to RGB(A)
using `as_rgb_a()`.
- Creating and converting colormaps (usually abbreviated to cmap) to VTK's
equivalent `vtkLookupTable`_ class.
- Texture m... |
12ce0666b4475bc51390441c9a10015fe34381a71cffb2354e6547b9b69d8e84 | Python | 21,073 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
88ddf99536a73cc9f523a111bf151b25fb95038569d4ba95ba6028404ed2908c | Python | 21,073 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
abfdf4cc7edb277b50765b0d47de14453a42d615b33092d8c38dc6d9825f1532 | Python | 21,073 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
e5f8c142c438abc556ea34e89c92d8626f827efcb2a1bf8f15a0c877404caf2a | Python | 21,073 | 416 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
import tensorflow as tf
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import Ran... |
bbc2c259dfb82922ada3c0e6a7eeda92776ccf2943d8687afd3795856e0d8a19 | Python | 21,075 | 636 | import io
import os
import unittest
import tempfile
import gzip
import bz2
import lzma
import random
import itertools
import numpy as np
import string
import torch
import pathlib
import shutil
import vamb
from vamb.vambtools import BinSplitter
import testtools
PARENTDIR = os.path.dirname(os.path.dirname(os.path.abspa... |
f65129675a2789e729564b67df5b5fbb9dfe247616d054f62b0e5f20e9bf7418 | Python | 21,075 | 551 | from collections import Counter
from dataclasses import dataclass
from typing import Any
import numpy as np
from .conv import Conv1d, Conv2d
from .flatten import Flatten
from .node import NIRNode
from .pooling import AvgPool2d, SumPool2d
from .typing import Edges, Nodes, Types
from .utils import (
calc_flatten_ou... |
909b6db2dfa44d654a1963842cfc0e7fd0d896f95a565515ec05a4eedfaec703 | Python | 21,076 | 517 | r"""Beyond k_cat — affinity, catalytic efficiency, and substrate scope.
``enzyme_kcat`` gives the turnover number, and a turnover number alone often
answers the wrong question. Inside a cell the substrate concentration is rarely
saturating, so the rate is set by ``k_cat/K_M`` and not by ``k_cat``; a variant
that doubl... |
f11566ada835dfcf0cc58d2fd11c71e81770f4b3bea7374011962814b8659f98 | Python | 21,076 | 380 | #!/usr/bin/env python
# lrnaLaunch.py 2.1.1
import sys
import json
# import dxpy
from launch import Launch
# from template import Launch # (does not use dxencode at all)
class LrnaLaunch(Launch):
'''Descendent from Launch class with 'long-rna-seq' methods'''
PIPELINE_NAME = "long-rna-seq"
''' This must... |
4b99d9bf2fadb283cf0b91245f619c9abde444dbb6f1fde7b3cd06246a6f3563 | Python | 21,079 | 717 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
from tqdm.auto import tqdm
import MDAnalysis as mda
import MDAnalysis.analysis.distances
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
#input path to files for analysis
cwd = '/path/to/your/working/directory/'
#input structu... |
c715ad3d498929aab588536babd15edb0f747626f8cb5d70390c533afa5d997b | Python | 21,106 | 550 | from PIL import Image
import numpy as np
from ctypes import *
import ctypes
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import cv2
import time
import pdb
import socket
import pickle
import scipy
import scipy.ndimage
import PySpin
import matplotlib.pyplot as ... |
fd9d5e73fadf20cf795549b8c693b175d340cb9a00bdd8c9cca09f98cfeb0a54 | Python | 21,106 | 556 | from sklearn.neighbors import NearestNeighbors
from scipy.sparse import diags
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import eigs
from scipy.spatial.distance import cdist
from .init_pca import init_pca
from .pca import pca
from .mds import mds
import numpy as np
from tqdm import tqdm
fr... |
e0fd78e779e6f53b59eabb8ec7c67517c000160802f3b4ad6617fa1959b0510a | Python | 21,123 | 418 | import inspect
import os
import random
import re
from dataclasses import dataclass
from typing import Callable, Dict, List, Optional, Union
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import DiffusionPipeline
from diffusers.configuration_utils import FrozenDic... |
0cb82a621be28fb6bc5a1e3f9f6b013fccdf00e9b9e0bd63c2d8603cf53d1e3c | Python | 21,124 | 573 |
import gym
import numpy
import random
import os
import abberior
import yaml
from gym import error, spaces, utils
from gym.utils import seeding
from matplotlib import pyplot
from collections import OrderedDict, defaultdict
import gym_sted
from gym_sted import rewards, defaults
from gym_sted.utils import SynapseGenera... |
dda53f2a16f847046619d6aaeb2c56635ff1888041c4c996849db769d9192cb5 | Python | 21,125 | 676 | """
Extract statistical values from layer ROIs
"""
import pandas as pd
import numpy as np
import nibabel as nb
import glob
import matplotlib.pyplot as plt
import seaborn as sns
# Set data path
DATADIR = '/Users/sebastiandresbach/data/neurovascularCouplingVASO/Nifti/derivatives'
OUTDIR = '/Users/sebastiandresbach/gi... |
5870caed3e5d7f397a121e9ded45bddd598577012729ac6103224357d05888e5 | Python | 21,142 | 540 | ####################################################################################################
# Copyright (c) 2020, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is free softw... |
842a6a7245a13779d7a74ad10b4776510f49e1f835bc1bb3e7fc71c5a9251c52 | Python | 21,151 | 564 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""aihwkit example 24: Example using convert_to_analog to run BERT transformer on SQuAD task
**Source**:
The example is adapted from code in
https://gith... |
94cd8171a3e390634b011439560e1710e4df93f7fd4a935f2ede8f36f8a52ff4 | Python | 21,182 | 568 | #
# CEBRA: Consistent EmBeddings of high-dimensional Recordings using Auxiliary variables
# © Mackenzie W. Mathis & Steffen Schneider (v0.4.0+)
# Source code:
# https://github.com/AdaptiveMotorControlLab/CEBRA
#
# Please see LICENSE.md for the full license document:
# https://github.com/AdaptiveMotorControlLab/CEBRA/bl... |
185f5f399c26c8969ca1069d57d91e1356948b0161908b48e223ddb4efa17d20 | Python | 21,189 | 594 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import annotations
import argparse
import json
import logging
import os
import sys
from collections import defaultdict
fro... |
df5dabad50995c46b246ff811cac97c5391117d62fbe4f2f81328634e84abe32 | Python | 21,192 | 425 | #!/usr/bin/env python3.7
"""Defines HOCWriter class.
The copyrights of this software are owned by Duke University. Please
refer to the LICENSE and README.md files for licensing instructions. The
source code can be found on the following GitHub repository:
https://github.com/wmglab-duke/ascent
"""
import itertools
i... |
752be0a31efe34925611475c47c4a575136b6646c3d8aefa786f4bf2d917e8f3 | Python | 21,194 | 518 | from typing import Union, Tuple
from abc import ABC, abstractmethod
from pathlib import Path
from copy import deepcopy
import itertools
import torch
import pandas as pd
import numpy as np
from braindecode.datasets import BaseConcatDataset
from skorch.helper import SliceDataset
from fastcore.transform import Pipeline
... |
16d93fd56418444b7073889e3a86497609ef9e7b75b49096329c2dfe0b147aa6 | Python | 21,206 | 561 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 28 11:53:23 2024
@author: Saad Idrees idrees.sa@gmail.com
jZ Lab, York University
"""
import numpy as np
import os
import h5py
import math
from scipy.stats import zscore
# from model import utils_si
# from model.performance import model_e... |
3a4af0d38d2dc10cc2affcc88268ed5c1d40d37f6fd04ae1244df1b555ca5351 | Python | 21,219 | 450 | # The Model factory connects input TensorMaps to output TensorMaps with computational graphs.
# Imports
import os
import logging
from itertools import chain
from collections import defaultdict, Counter
from typing import Dict, List, Tuple, Set, DefaultDict, Any, Union
import tensorflow as tf
import keras
from tensor... |
c1e02497a95bec3ddb148f5a034cb301e483d3e1bdf28482691c9f38fd136b41 | Python | 21,223 | 517 |
import yaml
import os
import glob
import dash_bootstrap_components as dbc
import dash_mantine_components as dmc
import plotly.graph_objects as go
import json
import shutil
import time
import numpy
import dash_renderjson
from dash import Dash, dcc, html
from dash.dependencies import Input, Output, State
from dash.exce... |
ab531602fbc6e3dc933cb3806ee159276f924c8dbdca07e85c69d69142fcc466 | Python | 21,233 | 621 | # Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
a17d418f453cce652f9b8fb5380dc9d183511edb078a18913235a05cb5da9383 | Python | 21,238 | 573 | """Tests for lr_scheduler.py"""
import pickle
from unittest.mock import Mock
import numpy as np
import pytest
import torch
from sklearn.base import clone
from torch.optim import SGD
from torch.optim.lr_scheduler import CosineAnnealingLR
from torch.optim.lr_scheduler import ExponentialLR
from torch.optim.lr_scheduler i... |
4a873825f215ba3ffc885a81722af88fc66f36293b353f808375f9a1759fa8d8 | Python | 21,241 | 593 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import annotations
import json
import tempfile
from dataclasses import dataclass
from functools import partial
from pathli... |
a8c2ae51589c88a41a978a82902a82744de62ff6ac14eb6d1b38f76b327ddeb1 | Python | 21,249 | 594 | import numpy as np
import scipy.sparse as sparse
from lib5c.util.system import check_outdir
def roll_footprint(footprint):
"""
"Rolls" each row to the right by its row index, then reverses the row order
and transposes the result. This is equivalent to the operation
``f(x) = sparse.dia_matrix(x).data`... |
14464b9e5f5ed5610aae3609beb931e6c2e814d6ea71d9762a6a3ce99a5873e4 | Python | 21,250 | 496 | import argparse
import pickle
from typing import Dict, List, Tuple, Callable, Optional, Union
import torch.multiprocessing as mp
from collections import namedtuple
from enum import Enum
import numpy as np
import torch
import tqdm
import visionloader as vl
from whitenoise import RandomNoiseFrameGenerator
from basis_... |
926bfb8f08f7dd6c86af199ae053b85a81fbbb73508bbc8c9f0704c51465059d | Python | 21,273 | 510 | import torch
import torch.nn as nn
import Module
import time
from contextlib import ExitStack
from dataclasses import dataclass
from esmfold_openfold.tri_self_attn_block import TriangularSelfAttentionBlock
from utils_train_valid import return_predcadist_plddt
class RelativePosition(nn.Module):
def __init__(self, ... |
1f050d2f0e1157950f7e9e17c4d788634fa3c7a6a3fe1040536bce43e48c46e0 | Python | 21,296 | 653 | """
Tools to draw a chord diagram in python
"""
from collections.abc import Sequence
import matplotlib as mpl
import matplotlib.patches as patches
from matplotlib.colors import ColorConverter, Colormap
from matplotlib.path import Path
import numpy as np
import scipy.sparse as ssp
from .gradient import gradient
fro... |
d64b45341f100dc0789da89b21f227de5a50f1e0b05cad98dcaa17ae0a95c359 | Python | 21,300 | 476 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
d9f4bd065090ad0af7419bfedb7050fadd06a1de1a33b8925b768e63993d774d | Python | 21,303 | 514 | r"""Gate geometry for cytometry.
A gate is a named region in one or two measured dimensions plus the display
scaling its boundary was drawn on. That last part is not decoration: a polygon
drawn on a logicle axis and the same vertices read as linear values describe
completely different populations, so a gate that does ... |
82dc942694fff8195363334b4e095761d10e5d12838508ccf5118a3b7b53df33 | Python | 21,327 | 536 | """Unified ambient / contamination-RNA removal for droplet scRNA-seq.
``ov.pp.ambient`` threads the major ambient-RNA decontamination methods
behind one registered, ``method=``-style dispatcher. Ambient (cell-free,
"soup") RNA leaks into every droplet during library prep; left in place it
inflates marker genes in cel... |
9c9fde0ec1a849b6c89d3bddbb35d71a28fe61576c9e6f6cdbc6949017ed30a5 | Python | 21,337 | 709 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import logging
import os
import sys
from enum import Enum
from http import HTTPStatus
from pathlib import Path
from subprocess import PIPE, CalledProcessError, run
from time import sleep
import pytest
import requests
import yaml
from shared.utils.c... |
4e8f7387552933bb2e6f3845395fbc13ce829be050ddc053fbfffab3d633d9ca | Python | 21,344 | 427 | # Copyright 2023 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... |
78c613c3223906228bf14ff3baaf699f95d2f2aac574e766a93b07750311acf4 | Python | 21,351 | 469 | import torch
from torch import nn
from tqdm import tqdm
import torch.nn.init as init
from torch import distributions
from torch.nn.parameter import Parameter
from sklearn.linear_model import LinearRegression
import numpy as np
use_cuda = torch.cuda.is_available()
device = torch.device('cuda:0') if use_cuda else torch.d... |
7ad3f84336dc65b49e6e2b466ae5da8e47370c571e5aeec67262855cceb17684 | Python | 21,371 | 623 | r"""
This is the nexus of workflow execution controll of *mozaik*.
"""
from mozaik.cli import parse_workflow_args
from mozaik.storage.datastore import Hdf5DataStore, PickledDataStore
from mozaik.tools.distribution_parametrization import (
MozaikExtendedParameterSet,
load_parameters,
)
from mozaik.tools.misc im... |
71474dcbd46c4c69906bce4b7f9b51b87df7e7b476e9f79e224543dc4914e07b | Python | 21,375 | 565 | import functools
import math
import operator
import os
import warnings
from typing import Any, Callable, Dict, Iterable, List, Optional, Union
from .common import NodeIdStr
from ray.data._internal.execution.util import memory_string
from ray.util.annotations import DeveloperAPI, RayDeprecationWarning
class Execution... |
6625ebcd4a8bdb0200382fe60a63981ea0fb215d1cd01c27e2344060721d34ab | Python | 21,377 | 522 | import copy
import logging
import warnings
from dataclasses import dataclass, field
from typing import Dict, Optional, Set, Tuple
import numpy as np
import pyarrow as pa
from ray.data._internal.arrow_block import ArrowBlockAccessor
from ray.data._internal.arrow_ops import transform_pyarrow
from ray.data._internal.del... |
4811e58f731d20f4f4dd457abbc4ce775647a08a98efabd1d07f17ce1442ad78 | Python | 21,387 | 583 | # Vendored from `decoupler` (https://github.com/scverse/decoupler) by
# omicverse for in-tree GPU acceleration work. Original copyright by
# the decoupler authors, redistributed under decoupler's GPL-3.0
# license. Cross-module imports rewritten from `decoupler.*` to
# `omicverse.es.*` (see scripts/vendor_decoupler.py)... |
3c79888194e0e1f2bc86a7260ec54fee48fea33df4a4d72ad1779451f3157748 | Python | 21,402 | 582 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 11 2024
@author: karl bengtsson bernander
"""
import torch
import matplotlib.pyplot as pyplot
import pickle
from e2cnn import gspaces
from e2cnn import nn
print("E2 CNN, VGG16 simplified version")
class EquivariantCNN(torch.nn.Module):
... |
2cdb8eea36d6b48a84fb5ff48bcdf53808893d5f160049a54172a14f4362ea58 | Python | 21,444 | 570 | #!/usr/bin/env python
""" pure utilities (other)
generally useful functions for CaImAn
See Also
------------
https://docs.python.org/3/library/urllib.request.htm
"""
#\package Caiman/utils
#\version 1.0
#\bug
#\warning
#\copyright GNU General Public License v2.0
#\date Created on Tue Jun 30 21:01:17 2015
#\autho... |
d823db37e5cf741c36936fcd892938f34ff2648dad1547b70f8fda2d245525f4 | Python | 21,459 | 507 | r"""
This module contain query manipulation system that is used to filter information stored in data store (:class:`.DataStore`).
The basic principle is that each query takes a existing :class:`.DataSore` (or :class:`.DataStoreView`) as an input and
returns and new :class:`.DataSoreView` that is a subset of the input... |
dfb3970f2975f09ad45490b5f34589dcf4b396ce7edd07b88d8934dc5b07e101 | Python | 21,476 | 485 | import torch as th
import torch.nn as nn
from dgl.batch import unbatch
from dgl.transforms import shortest_dist
from torch_geometric.nn import EGConv
from torch_geometric.utils import to_undirected
from torch_sparse import SparseTensor
from param import *
from dgl import function as fn
from utils import *
imp... |
75966cd71b2d05d893e558d34b519429da52d6196ffc6f582e7d670aadad7843 | Python | 21,483 | 570 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023, 2024 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#... |
2f866b4f3d22feca43d6403ce930183b235235e935aff4b59b9fb166c5cb3f45 | Python | 21,494 | 485 | import torch as th
import torch.nn as nn
from dgl.batch import unbatch
from dgl.transforms import shortest_dist
from torch_geometric.nn import EGConv
from torch_geometric.utils import to_undirected
from torch_sparse import SparseTensor
from param import *
from dgl import function as fn
from utils import *
imp... |
ce940570721ad3c109ec5f0c2e771334cd1cf0b51e9b785b74a61c17977b84fc | Python | 21,500 | 683 | """Create an AWS instance to reproduce Buildkite CI builds.
This script will take a Buildkite build URL as an argument and create
an AWS instance with the same properties running the same Docker container
as the original Buildkite runner. The user is then attached to this instance
and can reproduce any builds commands... |
9d77f6cb736d72a2910879736cf3cb692b0d255c24e7f2846178c423a5dcaa36 | Python | 21,502 | 624 | """Analysis of onset times across layers"""
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from sympy import *
# Load data
data = pd.read_csv(f'/Users/sebastiandresbach/github/neurovascularCouplingVASO/results/ERAs_rawPlusZscored_equalizedNormalized.csv', sep=',')
# Av... |
041e052970db51575737eb121cdd23f4575d29dac91abc7a7b7ba808c5a85ff3 | Python | 21,528 | 535 | from PIL import Image
import numpy as np
from ctypes import *
import ctypes
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import cv2
import time
import pdb
import torchvision
import torchvision.transforms as transforms
import scipy
import scipy.ndimage
import P... |
31a1451c4233febb4ca0b59203cff57b86df653178b02017941b5f909ecc04ec | Python | 21,545 | 547 | # Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
cca03d43e0559faabee36208e008e3fb8d4734d37b0f3957bece4b29293ccb89 | Python | 21,546 | 519 | r"""Relational plots: scatter, line and regression.
Every scatter in ``ov.pl`` today is an embedding — it needs an ``AnnData`` and
a ``basis``. There was no way to simply plot y against x from a table, and no
regression plot at all.
"""
from __future__ import annotations
from typing import Any, Dict, List, Optional,... |
26d9112255012f24ad2ba7aeea2dd5e1b2a59c92fdfd49ce3651788c5e885cc6 | Python | 21,547 | 498 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import math
import gc
gc.collect()
import warnings
from filterpy.kalman import KalmanFilter
warnings.filterwarnings('ignore')
import os
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=18)... |
64fa885ab36eac33671ff249921e4c0ca838d083a18dbf4587e7474a5e4207d7 | Python | 21,550 | 511 | import torch
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler, random_split
import pandas as pd
import numpy as np
import os
import random
from collections import defaultdict, Counter
from itertools import combinations
import json
import torch.nn as nn
import torch.nn.fu... |
32a3aba5babc9192a974cf69361af7595c26bf45b19da0f7f764c5a816b7b353 | Python | 21,565 | 545 | #
# CEBRA: Consistent EmBeddings of high-dimensional Recordings using Auxiliary variables
# © Mackenzie W. Mathis & Steffen Schneider (v0.4.0+)
# Source code:
# https://github.com/AdaptiveMotorControlLab/CEBRA
#
# Please see LICENSE.md for the full license document:
# https://github.com/AdaptiveMotorControlLab/CEBRA/bl... |
ff93e7a002ef3f71c76b9424f38a05e6b272573fbcef0b2199a8820e5512868f | Python | 21,570 | 540 | import scanpy as sc
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import anndata
import seaborn as sns
from .._settings import add_reference
from ._aucell import derive_auc_threshold,fast_rank,_rank_sparse_row,aucell
from .._registry import register_function
_OV_ES_AUCELL_NOTICE = (
"[ov.... |
fe099ecf70dadab98782a49f8c7c43e08bac28329843e0cc028a9c5e088e55ad | Python | 21,586 | 463 | # Copyright 2021 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
# and Applied Computer Vision Lab, Helmholtz Imaging Platform
#
# 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 L... |
b1cc9b2d4d2d04c7123775f3db8670635e4761bd3669b980d2d3f8feb9449e4b | Python | 21,595 | 476 | import os
import datetime
import numpy as np
import yaml
from .network import Network_3D_Unet
import tifffile as tiff
import random
import math
import torch
from torch.utils.data import Dataset
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
import time... |
ae4ad04b82945b3a52426eff2310dd80c6a643624689e6efaea55ef682eaabff | Python | 21,608 | 417 | import torch
import logging
from datetime import datetime
from torch import nn
from os.path import exists
from transformers import logging as transformers_logging
from transformers import AlbertForSequenceClassification
from agent.data.entities.config import MODELS_CACHE_PATH
from agent.classifiers.ffnn_classifier im... |
50a13ae154b2741afa3b2ef886a06ecb7981141ec95f2e3bf1be862abded7a00 | Python | 21,612 | 626 | # Ultralytics YOLO 🚀, GPL-3.0 license
import contextlib
import inspect
import logging.config
import os
import platform
import re
import subprocess
import sys
import tempfile
import threading
import uuid
from pathlib import Path
from types import SimpleNamespace
from typing import Union
import cv2
import numpy as np
... |
9805d731f2724bd2c8373efd5b86966445a42f1d879408f81b700e71e9645c40 | Python | 21,624 | 561 | import keras.backend as K
from sklearn.metrics import normalized_mutual_info_score, adjusted_rand_score
from sklearn.cluster import KMeans
from utils.pretrain_models import *
import wandb
nmi = normalized_mutual_info_score
ari = adjusted_rand_score
def acc(y_true, y_pred):
"""
Calculate clustering accuracy.
... |
91c33d59f8b5088a77fc1740c71cd3c352f9be3e090bb84b982a4b6a04925ac8 | Python | 21,641 | 443 | import numpy as np
import networkx as nx
import os.path
import matplotlib.pyplot as plt
import time
import gc
gc.collect()
import warnings
warnings.filterwarnings("ignore")
import os
os.system('cls' if os.name == 'nt' else 'clear')
plt.rc('font',size=15)
UseDoubleWell=1
RCType=0# Different RC architectur... |
a06f7992d72713ef5798550431bb28030d302b8335dd26f0816681500e22801e | Python | 21,647 | 506 | import argparse
import pickle
from typing import Dict, List, Tuple, Callable, Optional, Union
import torch.multiprocessing as mp
from collections import namedtuple
from enum import Enum
import numpy as np
import torch
import tqdm
import h5py
import visionloader as vl
from whitenoise import RandomNoiseFrameGenerator
... |
e06bdcd3acd867b1985a50dca751c47d7308a730d7ba3f28633743ca0aa8047e | Python | 21,662 | 449 |
import numpy
import os
import time
import yaml
import platform
import skimage.io as skio
import copy
import datetime
import matplotlib
import h5py
import random
matplotlib.use("tkagg")
from copy import deepcopy
from matplotlib import pyplot
from shutil import copyfile
from collections import defaultdict
import abber... |
5a81af456075165be8250f6683d5b06154741c64cb928fd0f4c40dd2ae279266 | Python | 21,678 | 707 | """Plotting for single-cell immune-repertoire (AIRR) analysis.
Matplotlib-based plots — an omicverse-style reimplementation of scirpy's
``pl`` module: clonotype-network plot, clonal-expansion plot, spectratype,
V(D)J usage, repertoire-overlap heatmap and group-abundance bars.
"""
from __future__ import annotations
fr... |
d5e624cb7b9f6b048c53476f5acd7b633c2cd18b8c115cfcc4b3cfc7d82b854d | Python | 21,684 | 609 | """VSEARCH wrappers for 16S amplicon analysis.
Each function wraps one real ``vsearch`` subcommand
(https://github.com/torognes/vsearch). Install via
``conda install -c bioconda vsearch``.
Submodule-style layout (like ``ov.alignment.kb_api``) — each function name
matches the vsearch subcommand verb:
- :func:`merge_p... |
f9ca963a0ebc9489a5e7d8addae45e12e6f4f575414ce66ad6c1d2675014db97 | Python | 21,684 | 449 |
import numpy
import os
import time
import yaml
import platform
import skimage.io as skio
import copy
import datetime
import matplotlib
import h5py
import random
matplotlib.use("tkagg")
from copy import deepcopy
from matplotlib import pyplot
from shutil import copyfile
from collections import defaultdict
import abber... |
ea454b1e8e5448fbb2bd30f27549657f0e2ab64d5d32513998fb5612ba5159b0 | Python | 21,691 | 511 | # Copyright 2023 Zhejiang University Team and 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
#
#... |
23d39379d5d871fd8e6ad313ee10a1bcfb0d20e2dbb4b6f29a797d53fd9ec675 | Python | 21,696 | 593 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Tests for torch-based inference tiles."""
import os
from typing import Union
from pytest import mark
from torch import (
float32,
float16,
bfloat... |
660bd3f4954364274c0f426a03603741d0f502f1f425c7b9ef63912610a44629 | Python | 21,697 | 676 | import time
import numpy as np
import pandas as pd
import numba
from scipy.sparse import issparse, csr_matrix
from scipy.stats import chi2
from sklearn.neighbors import NearestNeighbors
from typing import List, Tuple
import logging
logger = logging.getLogger(__name__)
def W_from_rep(
data,
rep: str,
) -> cs... |
a4e9124497b80555b06de5daf344d5528eb76b968b201cb9b60ed674fea433cc | Python | 21,700 | 509 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Parameter context for analog tiles."""
# pylint: disable=attribute-defined-outside-init
from typing import Optional, Type, Union, Any, List, TYPE_CHECKING
... |
47a8a6ea07c33f475519993a28df404c6f8f5444b7b618aebbe61f7b062e3f43 | Python | 21,703 | 420 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
d92c9a4eaa44b90c7c85ba21cce2c1087e8745ab46d3fa7e94d2cb12fb140b65 | Python | 21,707 | 484 | # Imports
import os
import numpy as np
import nibabel as nib
from dipy.viz import regtools
from dipy.segment.mask import applymask
from dipy.io.image import load_nifti
from dipy.align.imaffine import (transform_centers_of_mass,
AffineMap,
MutualInformat... |
60673b58752a756f21f28e48b1403b0a9469b181226f36becbafd77eb0510634 | Python | 21,713 | 546 | """
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import annotations
import bisect
import copy
import logging
import os
import warnings
from abc import ABC, abstractmethod
... |
d185ac693d8715f86634d3ab66ba3b6c768357029310a1ae57253236f48dd808 | Python | 21,726 | 516 | #!/bin/env python
"""
This script creates a VCF from a Scramble output table
"""
import argparse
from collections import defaultdict, deque
import gzip
import logging
import os
import sys
from typing import Optional, List, Text
from intervaltree import IntervalTree
import pandas as pd
import pysam
"""
Creates a VCF... |
eed46ca7f38e437eedf40fcbca5201a77b3bd9fc64f06e16f9844d3533df1bc1 | Python | 21,732 | 404 | #!/usr/bin/env python
# coding: utf-8
# author: Maruthi Mutnuri (maruthi2008@gmail.com)
# loading libraries
import scipy.stats as stats
import glob
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
# function for loading files from all the random states and concatenate them
def file_load(pat... |
8967f71b5ceceac57160f854c33a7b1eb0a324d00f4a0d4291b615518ace3589 | Python | 21,741 | 445 | # biolgca is a Python package for simulating different kinds of lattice-gas
# cellular automata (LGCA) in the biological context.
# Copyright (C) 2018-2022 Technische Universität Dresden, Germany.
# The full license notice is found in the file lgca/__init__.py.
"""
Interaction functions and helper functions for identi... |
5cb7c4dd517c156f5132b86a7e75b0c38ef4c2d4f3349bda14f75b9d26e3c3aa | Python | 21,752 | 511 | import exputils as eu
import ipywidgets
import warnings
from exputils.gui.jupyter.base_widget import BaseWidget
from exputils.gui.jupyter.experiment_ids_selection_widget import ExperimentIDsSelectionWidget
from exputils.gui.jupyter.repetition_ids_selection_widget import RepetitionIDsSelectionWidget
from exputils.gui.ju... |
87a41715f3c83f8e12697b97f29755432bebd7aaa983b2d0cc4916ed72481d1f | Python | 21,755 | 542 |
import pandas as pd
import numpy as np
import anndata
import torch
from typing import Union, Optional, Any
from ..bulk import data_drop_duplicates_index, deseq2_normalize
from ..bulk2single import Bulk2Single
from ..single import scnocd
from ._vae import train_vae, generate_vae, load_vae
from .._registry import regi... |
82f2212d9006f39bb65c87ff885a04a9d26b592ce3380b9825d0117c93646db4 | Python | 21,767 | 571 | import torch
import torch.nn as nn
import torch.nn.functional as F
eps = 1e-8
def tmscore_torch(coords1, true_coords, dcut=15.0):
# coords1 = (N,L,3) CA coords
# coords2 = (L,3) CA coords
N, L, _ = coords1.shape
coords2 = torch.tile(true_coords[None, :, :], (N, 1, 1))
center1 = torc... |
1cd4919a1977e384d6f540c61619cff1cdc0d485afddf5f8de997755455da814 | Python | 21,781 | 605 | """Metrics evaluating component TE-dependence or -independence."""
import logging
import numpy as np
from scipy import stats
from tedana import io, utils
from tedana.stats import computefeats2, get_coeffs, t_to_z
LGR = logging.getLogger("GENERAL")
RepLGR = logging.getLogger("REPORT")
def calculate_weights(data_opt... |
f33bbc83c3f1350928efbd3cf0f3dcf39ba0abcbfaad0f963f22d1e36b2543ed | Python | 21,782 | 575 |
import copy
import gc
from typing import Dict,Union
from enum import Enum, auto
from datetime import datetime
import numpy as np
import torch
from torch import cuda
from torch_geometric.data import DataLoader, Data
from e3nn.nn.models.v2106.gate_points_networks import SimpleNetwork
from aptnn.parameters import Mod... |
6909607d47dcd4cdbc05c5870321efd9b7af4bcd635153489e9fb4358328f457 | Python | 21,789 | 594 | # coding=utf-8
# Copyright 2023 HuggingFace Inc.
#
# 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 ag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.