sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
79ba6925e988665a7329e743e52d13a8bac2aa3c2a4c110eef0966b51047ed70 | Python | 23,077 | 581 | import numpy as np
import sys
import os
import random
import LFPy
from kcsd import sample_data_path
import neuron
morphology_directory = os.path.join(sample_data_path,'morphology')
"""Electrode grid is 2D. If z is the zero dimention x=x, y=y.
If x is the zero dimension x=0, y=x, z=y.
If y is the zero dimention, z=x & ... |
39262173ab164855e9da8c692ab9c52d34b9053bb7dd7c610e482ffa49ffbedb | Python | 23,080 | 448 | import numpy as np
import torch
import torch.utils.data as data_utils
from torchvision import datasets, transforms
import argparse
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import os, fnmatch
import cv2
import shutil
import sklearn
from sklearn... |
cb2eeacf3e3eef6517ee004214b401bf7f56d31ba1756b16cfd00743eef25e21 | Python | 23,113 | 564 | # Copyright 2018-2024 Xanadu Quantum Technologies 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... |
d58a760560a1ee9143e741898d081e682eebc524efcaa2dc8ccbdbc0d36373dd | Python | 23,116 | 617 | # Train structural embedding with contrastive learning
# Unpack training_coords first with `tar -xvf training_coords.tgz`
import torch
from torch.nn import Dropout, Identity, Linear, Sequential, SiLU
from torch.nn.functional import normalize
from torch.utils.data import Dataset
from torch_geometric.data import Data
fr... |
e3f4d83476d5e9c0c332b8362ed36a690b73b89e8c6a1cc0df6c01b6933ad882 | Python | 23,129 | 660 | # STA Movie Maker
# Lloyd Russell 2017
from GUI import GUI
from PyQt5.QtCore import Qt, QObject, pyqtSignal, QThread, QTimer, QRectF, QUrl
from PyQt5.QtWidgets import (QComboBox, QCheckBox, QLineEdit, QSpinBox,
QDoubleSpinBox, QFileDialog, QApplication,
QDesktopWidget, QMainWindow, QMessageBox)
from Py... |
4b28a72594c667a7d7e63697b5bc162c7659a916afbcd5a564905fabd8baa74b | Python | 23,136 | 741 | from io import (
BytesIO,
StringIO,
)
import random
import string
import numpy as np
from pandas import (
Categorical,
DataFrame,
Index,
concat,
date_range,
period_range,
read_csv,
to_datetime,
)
from ..pandas_vb_common import BaseIO
class ToCSV(BaseIO):
fname = "__test_... |
9a97a71745573f4939d45a448c32f50fc5dc7d8cedec68a6355660337739aa4a | Python | 23,195 | 714 | """
Protocols for predicting protein 3D structure from ECs
Authors:
Thomas A. Hopf
Anna G. Green (complex_dock)
"""
from os import path
from math import ceil
import billiard as mp
from functools import partial
import shutil
import pandas as pd
from evcouplings.align.alignment import (
read_fasta, parse_head... |
d3666e835e87c7551ff5320d831f5c0b86f69525c81bb3ac00f43bc0f2b6f11a | Python | 23,204 | 715 | # Copyright 2026 Xanadu Quantum Technologies 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 agre... |
ddc422c26bb7c783e2bf440639112e22222d876cb2700472a4bed31a4550e88b | Python | 23,215 | 644 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
6283390ba3122ff9e5d76804f78ccd220c5c7d151c52dbe016cc234ce06c4f75 | Python | 23,219 | 603 | import os
import sys
import rdkit
from rdkit import Chem
import DXGB.get_pdbinfo as get_pdbinfo
import DXGB.bw
from DXGB.bw import cal_BW
import DXGB.rw
from DXGB.rw import get_Crw
import DXGB.opt
from DXGB.opt import get_Co
import DXGB.cal_vina58
from DXGB.cal_vina58 import featureVina
import DXGB.cal_sasa
from DX... |
3aef86d24955b8c90b9288fdfd99a0300ffa4f5da273d85829e116e5d7b69968 | Python | 23,223 | 549 | import os
import random
import numpy as np
import torch
from PIL import Image
from torchvision import transforms
from .loader import get_image_loader, get_video_loader
from .masking_generator import (
RunningCellMaskingGenerator,
TubeMaskingGenerator,
)
from .transforms import (
GroupMultiScaleCrop,
G... |
2e33f233b38b68d9888cfbb8dfe5b988f8b3cbff43c7aac18ba5a366e3edcac7 | Python | 23,232 | 644 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
f37d78a4be188ab4c8afd5f1ba20eb52bb703934bc68d73ab125362151a0e9c7 | Python | 23,236 | 726 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.tests.apply.common import series_transform_kernels
@pytest.fixture(params=[False, "compat"])
def by_row(request):
return request.param
def test_series_map_box_timedelta(by_row):
# GH#11349
ser = pd.Series(pd.t... |
57e35df8b426533a5ad949eab1acced89a0a0b9f70e416a26ea7c2cfd5be56a4 | Python | 23,264 | 665 | """
Tests for the following offsets:
- SemiMonthBegin
- SemiMonthEnd
- MonthBegin
- MonthEnd
"""
from __future__ import annotations
from datetime import datetime
from itertools import pairwise
import pytest
from pandas._libs.tslibs import Timestamp
from pandas._libs.tslibs.offsets import (
MonthBegin,
Month... |
183481769cc87f02b049c1d4c876c903e9a0205eb00d5288f93cc86c40566126 | Python | 23,275 | 668 | #!/usr/bin/env python
"""Module Description: Test the PosReadsInfo class in
MACS3.Signal.PosReadsInfo, which collects the alleles and base
qualities seen at one reference position and calls the genotype.
Genotype likelihoods are checked against direct numpy/scipy
implementations of the four models (homozygous major, ... |
288a3c1cd4033e071e2540c5a9e272a463053bc6c3b50bf93aef4155e7ed9d46 | Python | 23,304 | 463 | # Copyright (c) 2021-2023, NVIDIA Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... |
b7a95ca45fdb9616ce10c23b152dc13e0ea437b6a6fecc634b8c7e1ba2b60018 | Python | 23,314 | 556 | # Copyright (c) 2018-2023, NVIDIA Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... |
754173ce919de0e3015d8e25e47e6c5be8b9fa75709cea918be423a9f6e80820 | Python | 23,332 | 561 | # Copyright 2026 Xanadu Quantum Technologies 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 agre... |
0b54b7f08d81cba2916cf4305b454ae9ed03c392bedb8fee5905d90c4540d1af | Python | 23,333 | 589 | import torch
import torch.nn as nn
import torch.nn.functional as F
import time
import sys
sys.path.append("..")
# from utils import local_pcd
def init_bn(module):
if module.weight is not None:
nn.init.ones_(module.weight)
if module.bias is not None:
nn.init.zeros_(module.bias)
return
de... |
6e8b003a52cbda3d9682d6a5627791aadfaa4cef654a086a20c3c6d6cf4fa0ac | Python | 23,338 | 554 | """Test the predict CLI command argument parsing."""
import argparse
from unittest.mock import MagicMock, patch
import pytest
from lightning_pose.cli.commands.predict import (
_predict_multi_type,
_predict_multi_type_multi_view,
get_parser,
handle,
)
class TestGetParser:
"""Test the get_parser ... |
50edfe0c43386a596dee1a5495801f318a4f4c2428705a670ad0ab262b9d4807 | Python | 23,339 | 617 | # Copyright 2025 Xanadu Quantum Technologies 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 agre... |
dc4597e38a02b42d8009a2a4ad04f43c8376a8e56c9e969954d3aec9e62597b9 | Python | 23,339 | 607 | # Copyright 2026 Xanadu Quantum Technologies 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... |
a5fea1146213389bb518f8a5316073685b93a8a552ecceeafe76420c46bcc2e1 | Python | 23,389 | 590 | # Copyright 2018-2021 Xanadu Quantum Technologies 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... |
2355a86b9891064c8ff35b5d4c3d48d85d5a9859fbc2cb7614b4c10d1164b3d4 | Python | 23,405 | 432 | from typing import Iterator, List, Tuple
import torch
import math
import random
from tqdm import trange
from pgen.esm_sampler import generate_step
import sys
import re
ESM_MSA_ALLOWED_AMINO_ACIDS = "-ACDEFGHIKLMNPQRSTVWY"
ESM_MSA_GAP_CHARACTERS = "-" # there might be some reason to add "." to both of these constants ... |
6e0687186c42a5d9199336e1278b1e0c15bdcb49f77de3fab1ec11b86dd7fdbe | Python | 23,409 | 590 | # Copyright 2018-2024 Xanadu Quantum Technologies 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 o... |
e3eb43e4c61b41accc937208ec9d122eae4ed55681b0493b66e6ae0fd47c319a | Python | 23,500 | 509 | import os, sys
import pdb
import numpy as np
import cupcake.io.BioReaders as BioReaders
import cupcake.tofu.branch.c_branch as c_branch
from bx.intervals.cluster import ClusterTree
#from cupcake.tofu.branch.intersection_unique import IntervalTreeUnique, Interval, IntervalNodeUnique
from Bio import SeqIO
INTINF = 999... |
ddcd6fbb8f37f79f85d5e541f11e71a29eebefcf1dfa31f1f6e9948100c0d45d | Python | 23,514 | 581 | import os
from copy import deepcopy
import numpy as np
import scipy.linalg as la
import logging
from . import matchingParam
from . import conjugateGradient as cg, kernelFunctions as kfun, pointEvolution as evol, loggingUtils, bfgs
from .pointSets import PointSet
from . import pointSets, pointset_distances as psd
from .... |
22d6c712ed555b7ce879a474777b23eb8b9ae3a208b37f469e1264ba6ecbabea | Python | 23,520 | 494 | #!/usr/bin/env python
#!python
#For debug use only
#Test deletions:
#command='Pacbio.Validator.py vcf --sv-input /mnt/EXT/Mills-scratch2/Xuefang/Pacbio.Validator/vcf_files/NA12878_Delly_DEL.vcf --output-path /mnt/EXT/Mills-scratch2/Xuefang/NA12878.NGS/SVelter_rec2/PacValTest/ --pacbio-input /mnt/EXT/Mills-scratch2/Xue... |
0aa58f42ac61a02478321e2921ae2384e0387d04100fe1eb750f308ab6acb0fb | Python | 23,545 | 570 | """Input/Output operations."""
import json
import logging
import re
from collections import Counter
from itertools import groupby
from operator import itemgetter
from pathlib import Path
import numpy as np
import pandas as pd
import requests
from scipy import sparse
from .dataset import Dataset
from .extract.utils im... |
411d5f3b5ded15a9d610926c6c6e142adc6ab4351220960da2724684824677ac | Python | 23,547 | 792 | """
Tests that the file header is properly handled or inferred
during parsing for all of the parsers defined in parsers.py
"""
from collections import namedtuple
from io import StringIO
import numpy as np
import pytest
from pandas.errors import ParserError
import pandas as pd
import pandas._testing as tm
xfail_pya... |
1f2608fb87b40f5a4182cdf22582d0cb967fdf1399911ad45be8e7f33d42de5d | Python | 23,548 | 649 | # Copyright 2024 Xanadu Quantum Technologies 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 agre... |
766285217ab24acb00d40523df3104c41310aabad3fe67679064abed0bed6b73 | Python | 23,552 | 526 | from rdkit import Chem
from rdkit.Chem import AllChem
import pandas as pd
import numpy as np
from concepts import Context
from fp_check_functions import get_mean_activation_compound_set
from helper_functions import dict_to_string
def fca_lattice_from_df(df):
"""
function that creates fca lattice from... |
65fda98a8b0ecb593b4652fcf266e7c890afd18840878552e4d6e818c294befc | Python | 23,553 | 554 | import math
import random
from PIL import Image, ImageEnhance, ImageOps
try:
import accimage
except ImportError:
accimage = None
import collections
import numbers
import types
import warnings
import cv2
import numpy as np
from PIL import Image
_cv2_pad_to_str = {
'constant': cv2.BORDER_CONSTANT,
'ed... |
af97100751861d87fdfa38306b481e3c1bdad9eae7a29f0509c4fbb3a484606a | Python | 23,562 | 712 | # Copyright 2018-2021 Xanadu Quantum Technologies 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... |
430b87cd1b979610c2bd005a8d08aab39245be4d7d456be268ddd5ba36280189 | Python | 23,581 | 652 | # Copyright 2018-2021 Xanadu Quantum Technologies 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... |
f58b74f273a08407c43304275635bb7b8b337d95766bad2bf8a2a265caca7100 | Python | 23,581 | 568 | #!/usr/bin/env python
# Time-stamp: <2025-09-29 15:22:11 Tao Liu>
"""Module Description: Test functions for Signal.pyx
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file LICENSE included with
the distribution).
"""
import unittest
import pytest
impo... |
55d66d74a67238d1005afa61de98ede95a4c0fe86c98629386705cc2d7bc5d07 | Python | 23,584 | 563 | """Tests for heatmap generation and evaluation utilities."""
import copy
import torch
from kornia.geometry.subpix import spatial_expectation2d, spatial_softmax2d
from lightning_pose.data.heatmaps import generate_heatmaps
class TestGenerateHeatmaps:
def test_basic(self, cfg, heatmap_dataset):
im_heigh... |
58f992d9dc4b60693ff0be1987eb97e2050e6894be09b6fd65589d316cd3de3f | Python | 23,592 | 609 | # Copyright 2018-2020 Xanadu Quantum Technologies 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... |
b4d020357d170157e95c9f3ccb9455f442264e282f66ebf9a74acdbb85512a06 | Python | 23,596 | 622 | """Waveform view."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import logging
from collections import defaultdict
import numpy as np
from phylib.io.array import _flatten, _index_of
from ph... |
be9ad241aaa13b6add6022b5882e40ab404724d4424ebec16cd20abb6c23f7ae | Python | 23,597 | 716 | # Copyright 2018-2021 Xanadu Quantum Technologies 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... |
ede1294eac339ea6bfc6b667fd781fc93f915eb4a8ba296f753f01ffdba95aa6 | Python | 23,598 | 713 | from __future__ import annotations
import os
from typing import Dict, Optional, Union, List, Tuple, Sequence, cast
import numpy as np
import torch
import torch.nn.functional as F
from ..transform import (
RigidTransform,
transform_points,
init_stack_transform,
init_zero_transform,
)
from .image_utils im... |
d897b4d059b69887708cdd4ed20b8a1443448aecc41ffc9a1b49b0c5889c6660 | Python | 23,600 | 716 | # Copyright 2022 Xanadu Quantum Technologies 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 agre... |
5dd8bd5937b6141d776a5d452b31f67421500135b9686c28691c8e4e5c813435 | Python | 23,603 | 599 | import sys, os, re, math, json, argparse, time
from operator import add
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'resource-gcg', 'scripts'))
import tree
argparser = argparse.ArgumentParser('''
Reads in gold and test linetrees files and performs a number of evaluations. The test and gold data... |
3f77f1d69281e6e9cd909e6369df24cd7ee6df29b3067bc4b47fb9ab367d80a5 | Python | 23,610 | 526 | import re
import string
import pickle
import numpy as np
import pandas as pd
from scipy import interpolate
from sklearn.ensemble import RandomForestRegressor
# helper functions for sorting
# https://stackoverflow.com/questions/5967500/how-to-correctly-sort-a-string-with-a-number-inside
def _atof(text):
try:
... |
f17d469ccb48dd61eb0dba19afcb50c95ee266894f9cdd01a7364dd2e2addd63 | Python | 23,612 | 646 | # Copyright 2018-2021 Xanadu Quantum Technologies 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... |
0ba29d80154fe36c7747aaa0890615239f4b40056ef1c94ae9857197598cc2cf | Python | 23,613 | 579 | # Copyright 2022 Xanadu Quantum Technologies 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 agre... |
6b22b0abe67cbb05d8c00edf1f1738777cd3e6c000cd12d9a360dccbfff71288 | Python | 23,625 | 575 | """Input/Output operations."""
import json
import logging
import re
from collections import Counter
from itertools import groupby
from operator import itemgetter
from pathlib import Path
import numpy as np
import pandas as pd
import requests
from scipy import sparse
from nimare.dataset import Dataset
from nimare.extr... |
7dcdda00c398a33a1c85fab3e8814b69f962dbee711ae0468a44ed7d79d18e0c | Python | 23,661 | 753 | """Static + runtime introspection functions for the UI / agent.
The bulk of model and metric metadata in 3.x lived inside container class
docstrings and `__init__` bodies. For 4.0 we surface just enough *static* info
— from a hand-curated registry seeded from the legacy containers — to drive a
React form without actua... |
8b96a00c527953cce815279f21429c302aaf9aa036fcfed153898f138228b50b | Python | 23,663 | 482 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Autobinning entry point for the BASALT pipeline (CheckM-based branch).
This module runs the initial binning workflows, including multiple
autobinners and optional extra binners, and records progress in
``Basalt_checkpoint.txt`` to support resumable execution.
"""
imp... |
46417fda71f42623882d85dccf17c34317e2419d0651184dd8f9acc55278408b | Python | 23,670 | 759 | import numpy as np
import numba
from numpy.testing import assert_array_almost_equal, assert_array_equal
import umap.distances as dist
import umap.sparse as spdist
import re
from sklearn.metrics import pairwise_distances
from sklearn.neighbors import BallTree
from sklearn import __version__ as sklearn_version_
from sci... |
01bf5bdba8a5d0bfa0e24a0ba6a58b0c8b936c1172356b42d8addd1c6a632fd7 | Python | 23,695 | 561 | # Copyright 2026 Xanadu Quantum Technologies 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 agree... |
33040d239caaabf540a590831d83724ac689ab82d1facb82809e6d03e2fbc95a | Python | 23,698 | 620 | ''' update_dynamodb_published_versioned.py
Update a janelia-neuronbridge-published-* DynamoDB table.
'''
import argparse
import collections
from datetime import datetime
from operator import attrgetter
import re
import sys
import time
import boto3
import inquirer
from inquirer.themes import BlueComposure
import My... |
b96b40999c0e1f472dd63707c98c546a3263f52a5fa351000178f3fbcd231c76 | Python | 23,728 | 627 | import sys
import numpy as np
import torch
import matplotlib as mpl
import matplotlib.pyplot as plt
import task_train_test as tk
import nn_analyses as nna
import ti_functions as ti
def printparms():
njobs = singleout(TID=0).njobs # identify total number of jobs
dims = singleout(TID=0).dims # identi... |
e7f35404d8c8b02d68db6738da67dbf9ee4290a71af8ab22c714d32735c5c868 | Python | 23,731 | 585 | from __future__ import annotations
import inspect
import json
import logging
import pytest
from pcntoolkit.math_functions.likelihood import NormalLikelihood
from pcntoolkit.math_functions.prior import (
CenteredRandomPrior,
LinearPrior,
Prior,
RandomPrior,
make_prior,
prior_from_args,
)
from ... |
63692a6c3fb5bb0b6514671ab3149cd856be623d9019f36a2e633fa0a122979c | Python | 23,738 | 613 | # Copyright 2018-2024 Xanadu Quantum Technologies 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... |
220ce64441f3dfcfa431c8f6994e7f3042cd74534fb2b96d1f81e37187704a24 | Python | 23,782 | 664 | """Classes for representing datasets of images and/or coordinates."""
import copy
import inspect
import json
import logging
import os.path as op
import numpy as np
import pandas as pd
from nilearn._utils import load_niimg
from nimare.base import NiMAREBase
from nimare.utils import (
_dict_to_coordinates,
_dic... |
d5f4535847bb264bffac2d631efa5da27dd6a5a77c24acac99596ff63643039f | Python | 23,783 | 632 | import os
import csv
# joblib
import joblib
# numpy
import numpy as np
# pandas
import pandas as pd
# openpyxl
from openpyxl import Workbook
# rdkit
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import rdForceFieldHelpers
# mordred
from mordred import Calculator, descriptors
#----TYPE CHE... |
97a901ddcd27dfe635cfeee7f928a8b3be8e3e4d31a970a017e46492f0995811 | Python | 23,785 | 642 | # Copyright 2018-2023 Xanadu Quantum Technologies 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... |
5f67e70d02e918775001aadf8d9b3732f92bfe8af4b8f77e68c203c0b2c147dd | Python | 23,800 | 627 | from collections import defaultdict
from datetime import datetime
from itertools import product
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.core import algorithms
from pandas.core.algorithms import safe_sort
import pandas.core.common as com
from pandas.core.sorting im... |
bd661f65895171cec85dc890bf998b4e2298d3e442a9ec185d6650b99f1fefb3 | Python | 23,804 | 619 | from datetime import datetime
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
import pandas._testing as tm
class TestCategoricalConcat:
def test_categorical_concat(self, sort):
# See GH 10177
d... |
a71338228db1e936aebd89525d62e01faa43f8140cd95974735d7564e8cfaab3 | Python | 23,824 | 753 | """miscellaneous sorting / groupby utilities"""
from __future__ import annotations
import itertools
from typing import (
TYPE_CHECKING,
cast,
)
import numpy as np
from pandas._libs import (
algos,
hashtable,
lib,
)
from pandas._libs.hashtable import unique_label_indices
from pandas.core.dtypes.... |
1024f252b3f09e2a2d801f6f9bcd2298a24df57cf4445e1327b48731c5f8860f | Python | 23,825 | 695 | """
Implementation of "Attention is All You Need" and of
subsequent transformer based architectures
"""
import torch
import torch.nn as nn
from onmt.decoders.decoder import DecoderBase
from onmt.modules import MultiHeadedAttention, AverageAttention
from onmt.modules.position_ffn import PositionwiseFeedForward
from on... |
1848c1ef0dd8720050fb6d2b13bbce0bda1bc60ce7587d162c513329a4237b55 | Python | 23,847 | 696 | """
This module tests the functionality of StringArray and ArrowStringArray.
Tests for the str accessors are in pandas/tests/strings/test_string_array.py
"""
import numpy as np
import pytest
from pandas.compat.pyarrow import pa_version_under19p0
from pandas.core.dtypes.common import is_dtype_equal
import pandas as ... |
19d48e86df1194d46f47885902be916d8bdd773c54deea3665a280742af09b7c | Python | 23,857 | 746 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
def test_doc_string():
df = pd.DataFrame({"B": [0, 1, 2, np.nan, 4]})
df
df.ewm(com=0.5).mean()
def test_constructor(frame_or_series):
c = frame_or_series(range(5)).ewm
# valid
c(com=0.5)
c(span=1.5)
... |
748f3f113fce7344eb825a5f63898480613856b94e6c234559d9dc42b77152d6 | Python | 23,877 | 503 | import sys, configparser, torch, re, os, time
from collections import Counter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from scipy.sparse import csr_matrix
import pdb
np.set_printoptions(threshold=sys.maxsize)
BASEKVOCABSIZE = 0
ANTEKVOCABSIZE = 0
def eprint(... |
58817c0276deb40135a101fa316e2ba51a990dacbd8dec3902446911cf50b5dc | Python | 23,905 | 737 | import datetime
import decimal
import zoneinfo
import numpy as np
from numpy import ma
import pytest
from pandas._config import using_string_dtype
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.api.extensions import register_extension_dtype
from pandas.arrays ... |
cd46804c2a5bf12e18aecfb1f1cfd87e291d38f85e5adaf70fe5da7a92342299 | Python | 23,927 | 482 | __author__ = 'etseng@pacb.com'
import os, sys, re, time
import pdb
from csv import DictWriter
from Bio import SeqIO
from collections import defaultdict, namedtuple
from cupcake.tofu import compare_junctions
from cupcake.io import GFF
from bx.intervals import IntervalTree
from bx.intervals.cluster import ClusterTree
... |
209dbb14557d8066a457aeac18b9d95cc2089c4d4a897b171324fb4bd6548459 | Python | 23,957 | 625 | import numpy as np
import pytest
from pandas.errors import InvalidIndexError
import pandas as pd
import pandas._testing as tm
from pandas.core.arrays import (
ArrowExtensionArray,
FloatingArray,
)
class TestGetLoc:
def test_get_loc(self):
index = pd.Index([0, 1, 2])
assert index.get_loc(... |
a231e7503e1440d7bcf07f9124f8d263459794a062c787c6dcbbc56e49b33c70 | Python | 23,971 | 506 |
import numpy as np
import torch
import torch.nn as nn
from torch.nn import CrossEntropyLoss
import torch.optim as optim
import copy
from sklearn.metrics import mean_squared_error
import matplotlib
matplotlib.use('TkAgg')
from .early_stop import EarlyStopping
from .utils import *
PWD = os.path.abspath(os.path.dirnam... |
7d421edeeac79278b832765908cc5ffc99b060d88383b1ed4c78310141bfd095 | Python | 23,979 | 524 | """Parity tests for the clocks ported from the BioAge R package.
The expected values in ``reference_predictions.json`` were produced by BioAge
itself, not by a re-implementation, so they pin these ports to the published
behaviour rather than to our reading of it.
The fixtures are a frozen snapshot. Each notebook re-d... |
6f4f29afa01920e0b23b4133253a9fe1a7c55d7eb3ff884d8138816aa8d13337 | Python | 23,995 | 632 | # Copyright 2026 Xanadu Quantum Technologies 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 agre... |
6632f9753e8051d44f4edbf58d2a736959f781b76f3caa82e2ef9d8605f32533 | Python | 24,011 | 708 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 7 18:48:08 2023
@author: hklumpe
"""
import glob
import sys
import json
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
username='hklumpe'
dcc_repo_path = f"/projectnb/dunlop/{username}/deepcellcontrol/"
fig_pat... |
7c171335336914e5bc74c9bfdcb995143ae8756060011f5bb1c17feb3f7019a9 | Python | 24,019 | 658 | # Copyright 2018-2021 Xanadu Quantum Technologies 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... |
65f3bd916a268ac453f175631d657fb247c316262bd15ab18f8d319279e7d558 | Python | 24,032 | 640 | __all__ = [
"GlycoPeptideMS2Data",
"GlycoPeptideMS2Output",
"GlycoPeptideMS2DataConverter",
"GlycoPeptideMS2Dataset",
"GlycoPeptideMS2DataBatch",
]
import itertools
from typing import (
Any,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
Union,
cast,
overload,
)
i... |
5b05e47c3e161ef85bcf99b6f50eca7b8ac3e86559ba3a545f6ee7896e69d3b7 | Python | 24,034 | 759 | """miscellaneous sorting / groupby utilities"""
from __future__ import annotations
import itertools
from typing import (
TYPE_CHECKING,
Any,
cast,
)
import numpy as np
from pandas._libs import (
algos,
hashtable,
lib,
)
from pandas._libs.hashtable import unique_label_indices
from pandas.cor... |
54e2c51860124343e4a6a184f846e7e2632be7638ec2d7913d3942cdf25d381c | Python | 24,038 | 434 | # Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... |
a50e50ca0d930d907cf05f44b63aeab8c339e854b2f3eb5d50494d0d4c7f6614 | Python | 24,045 | 621 | ## Violin / Topo (Bands)
import pandas as pd
import pickle
import matplotlib.pyplot as plt
import os
import seaborn as sn
import mne
tmin, tmax = -0.6, -0.003
model = 'Ridge'
situacion = 'Escucha'
info_path = 'Saves/Preprocesed_Data/tmin-0.6_tmax-0.003/EEG/info.pkl'
f = open(info_path, 'rb')
info = pick... |
6006d0655e90e261b9e70c5a1034c86c601492a147b0e06042722e4d32507ba1 | Python | 24,078 | 498 | import os
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
os.environ['OPENBLAS_NUM_THREADS'] = '1'
os.environ['ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS'] = '1'
os.environ['TF_NUM_INTEROP_THREADS'] = '1'
os.environ['TF_NUM_INTRAOP_THREADS'] = '1'
os.environ['OMP_NUM_THREADS'] = '1'
from botocore.client import Config
impor... |
dc8a1822b4037431e29d058761bfeabb8ae88bf6657d7c5d666a7e13c3be9c92 | Python | 24,081 | 535 | from Environment import *
from Parameter import *
def DNN_result_ranksum(data_path, model_name):
file = open(os.path.join(data_path, 'Dice_ranksums.txt'), 'w+')
symbol = ['***', '**', '*']
for i in model_name:
for j in model_name:
if i == j:
pass
else:
... |
4143344398a6b983ac0e4e95bffdc7c33ecf737380c53d1ef9ce3d00a08d3aa9 | Python | 24,111 | 630 | # Copyright 2018-2026 Xanadu Quantum Technologies 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... |
be577b4a2d5f74fcaff768a58510b75b060fdc08c73d9ba34b467489589d1a52 | Python | 24,112 | 532 |
import argparse, os, time, sys, gc, cv2
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
from torch.utils.data import DataLoader
import torch.nn.functional as F
from models.casmvsnet import *
import numpy as np
from datasets import find_dataset_def
from models import *
f... |
97f7471347f76788c3006abd9b51c7272214dc798e16ea0569ba59a37bb9c511 | Python | 24,132 | 681 | # -*- coding: utf-8 -*-
"""
Script to analyze the outcome of various re-trainings of the networks
Fig S1, S2, S5 and S6 plotted here
You will need scikit-learn (v1.2.2 at time of this writing)
Created on Sat Apr 15 16:01:50 2023
@author: jeanbaptiste
"""
import copy
import json
import os
import time
import numpy as ... |
0b7484516a3fd6a1f19d3f77cdd06dd66cfb0a19d203db19f026811f80af584c | Python | 24,133 | 496 | import matplotlib
import os, pandas as pd, numpy as np, pickle as pckl
from scipy.stats import ttest_ind, pearsonr
import matplotlib.pyplot as plt, seaborn as sns, json, matplotlib as mpl,imageio
from sklearn import metrics
import sklearn, scipy
from scipy.signal import argrelextrema
import itertools
import shu... |
d222ee93a858d97282abc81ae69de9edf8905371c8243ab791be24c553e5b801 | Python | 24,135 | 531 | ######################
### Import Library ###
######################
# my library
from molgraph.simplemodel import *
from molgraph.dataset import *
from molgraph.experiment import *
from molgraph.training_simple import *
from molgraph.visualize import *
# general
import math as math
import matplotlib.pyplot as plt
fro... |
0358a1081e05f59a033450f7d88cc823d4d8359857dd18aa91eb3d419ca87b63 | Python | 24,150 | 514 | #!/usr/bin/env python3
# MIT License
#
# Copyright 2026 Broad Institute
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... |
0815baf92462516829fe54818634d87d2ceb85cfec3205a9386aa515210f215d | Python | 24,204 | 579 | # Copyright 2025 Xanadu Quantum Technologies 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 agre... |
8cb3478a3ccb3f91be410743c21c38df01b1e3f534a4173690166a42f11d3f59 | Python | 24,213 | 675 | # Copyright 2018-2020 Xanadu Quantum Technologies 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... |
a6821b08d72e3a097818e023c1ba7faba8a9f2358fc8adf4c6eeaad034db62e1 | Python | 24,213 | 804 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.io as sio
# increase the figure size
plt.rcParams["figure.figsize"] = [12, 10]
# remove the top and right spines from plot in the global plt setting
plt.rcParams["axes.spines.top"] = False
plt.rcParams["axes.spines.right"] = False
#... |
9bde0a1c6822b92ce1b21efff390c680068bd0d3fe519f3e7a6c8bce4133e67a | Python | 24,231 | 547 | # Copyright 2018-2022 Xanadu Quantum Technologies 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... |
73af07127ba79c66c7018a8e647e2d24bd40bac05279fc9830fb945fd9932495 | Python | 24,232 | 680 | # Copyright 2018-2020 Xanadu Quantum Technologies 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... |
0cf31a62827d8177d5c60440cb2c784905c97dd1cc96487c74f50713dcc47e0a | Python | 24,253 | 548 | """Phases 4 / 5 / 7 / 10 / 12 — new entity tables in one migration.
Revision ID: b2c3d4e5f6a8
Revises: a1b2c3d4e5f7
Create Date: 2026-05-14 10:00:00.000000+00:00
Schemas added:
- Phase 4: ``secrets``, ``connections``, ``datasets``, ``lineage``.
- Phase 5: ``git_repositories``.
- Phase 7: ``registered_models``, ``reg... |
4a06c93d6779a89221d5d47a4713dd8adac31ecd0ec2f9fc47839bc5531f2625 | Python | 24,264 | 679 | import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
def _assert_frame_equal_both(a, b, **kwargs):
"""
Check that two DataFrame equal.
This check is performed commutatively.
Parameters
----------
a : DataFrame
Th... |
b6d2b1653e3a7967f0a9eaf5c22716e46fcc1dec427ae702737b4e58535ba8cf | Python | 24,281 | 451 | # Copyright 2026 Xanadu Quantum Technologies 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 agre... |
871b1efa8db2ff0c5b45efce436f898d7c94a3ceb1fa0e851ceddca71366a25b | Python | 24,285 | 570 | """Test opencv dataloading functionality."""
import os
import shutil
import numpy as np
import pandas as pd
import pytest
import torch
import lightning_pose as lp
from lightning_pose.data import _IMAGENET_MEAN, _IMAGENET_STD
from lightning_pose.data.video import utils as video_utils_module
from lightning_pose.data.vi... |
38cc10b17d3c2033d73365ff34b740517c0d39d4f7042e4761c3a9a1ec85a1af | Python | 24,301 | 655 | from __future__ import annotations
import operator
import re
from typing import (
TYPE_CHECKING,
Any,
Self,
)
import numpy as np
from pandas._libs import (
lib,
missing as libmissing,
)
from pandas.compat import (
HAS_PYARROW,
PYARROW_MIN_VERSION,
)
from pandas.compat.numpy import functio... |
4d4c2ffbfb2a1a95722cf6ac191b5e8eeee34d4fa15284a7ccb27c59dc9318ef | Python | 24,326 | 694 | """LLM advisory routes.
Six endpoints under ``/api/v1/``:
GET /workspaces/{id}/llm/settings current active setting
PUT /workspaces/{id}/llm/settings upsert the enabled provider
POST /workspaces/{id}/llm/test-connection round-trip probe
POST /llm/analyze-dataset data... |
e40b0f0346e5aee23f6581187091a69c3aca851b957ea580fa71a4865e653687 | Python | 24,326 | 753 | # Copyright 2024 Xanadu Quantum Technologies 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 agre... |
d3356280527886afa22a8e14ce2f248089223cef5ba1ac6dcf33f70fa5c6889e | Python | 24,329 | 582 | #!/usr/bin/env python
"""Module Description: Test the bdgdiff subcommand
(MACS3/Commands/bdgdiff_cmd.py): differential regions from treatment
and control bedGraphs of two conditions, scored by log10 likelihood
ratios.
The inputs are tiny tracks on a 100 bp grid; a reference
implementation in the test computes the thr... |
4a1180083f974ea20bb12f6641af770e3e8b6d1adbb3dcdd3c46fba26dae744d | Python | 24,339 | 562 | # Copyright (c) 2018-2023, NVIDIA Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... |
1c7afb3ba22328c1572c1258eaa395b7a4145f603b08685e5344b4497680058e | Python | 24,355 | 624 | # Copyright 2025 Xanadu Quantum Technologies 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 agre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.