sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
8f0a679d808a4181682b6d42ac515574898390bcd2e645972368d50f3052809a | Python | 16,241 | 476 | from __future__ import annotations
import decimal
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
from pandas.tests.extension import base
from pandas.tests.extension.decimal.array import (
DecimalArray,
DecimalDtype,
make_data,
... |
bd0f4916a78078d36e334309440660b4cacd4e8ddf21a3484487d68a2fbd368f | Python | 16,243 | 504 | #!/usr/bin/env python3
# coding: utf-8
"""
Displays overview of ncs files with their extract/sort status
"""
# JN 2014-12-15
# JN 2019-01-08 converting to Qt5
from __future__ import print_function, division, absolute_import
import logging
logger = logging.getLogger(__name__)
import sys
import os
from PyQt5.QtCore i... |
2a95c765282feeee4893540ed923c11dc9969fcd73c278b8e70f00e5037a4658 | Python | 16,250 | 512 | #! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... |
bff7039756a313c9e96b49043e52345514d31031918976e8c0141aa1732217c1 | Python | 16,256 | 447 | # Copyright 2018-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... |
826e774749b31debcfadb180241ec174ebb91ee4d7137942668d9546fd2145ee | Python | 16,263 | 468 | """
A verbatim copy (vendored) of the spec from https://github.com/data-apis/dataframe-api
"""
from __future__ import annotations
from abc import (
ABC,
abstractmethod,
)
import enum
from typing import (
TYPE_CHECKING,
Any,
TypedDict,
)
from pandas.util._decorators import set_module
if TYPE_CHEC... |
bc400645e1b5e1f90d85cd31dd6c1ddd2ac5cc69d0044922a6ea57630f1076a1 | Python | 16,264 | 490 | from __future__ import annotations
from functools import wraps
import inspect
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
cast,
)
import warnings
from pandas._libs.properties import cache_readonly
from pandas.util._exceptions import find_stack_level
if TYPE_CHECKING:
from col... |
82e32a1b5e861147889be56f9dd2987fcc84c9c76df0863d4389668cd6b7f87e | Python | 16,275 | 510 | import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
class TestDataFrameFilter:
def test_filter(self, float_frame, float_string_frame):
# Items
filtered = float_frame.filter(["A", "B", "E"])
assert len(filtered.column... |
602ef7aa3ff4a647269a4983577d494b3a21f0f3c6961d4b2a477f97ad8af237 | Python | 16,290 | 450 | # 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... |
3e1df90624fc6e0f683bad4248d7010f4a71751f014833e29b1d3bbc6a4a3684 | Python | 16,303 | 521 | import numpy as np
import matplotlib.pyplot as plt
# 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
# change the linewidth of the axes and spines
... |
51c056122676145e5d2a2c08733d46c838fd58a7c3cd3c2f798228efcc676eac | Python | 16,306 | 484 | import gc
import json
import shutil
from abc import ABC, abstractmethod
from itertools import chain
import numpy as np
import torch
import torch.nn as nn
from sklearn.metrics import accuracy_score, f1_score
from torch.nn.functional import softmax
from tqdm.autonotebook import tqdm
class BaseModelClass(nn.Module, ABC... |
6f1cd1a3cc2b76fe76746c336de4e00ec7bc80a6eb52aeb0b3131002b2a0ee96 | Python | 16,317 | 421 | # 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... |
0b12145e00b4eb76445a4c2cd1b46901a3cf987c143d7de511a91393b1810c4c | Python | 16,322 | 354 |
from ..utils import round_sig, get_phenolist, PheWebError, fmt_seconds
from .. import conf
from .. import parse_utils
from ..file_utils import get_dated_tmp_path
import functools
import traceback
import time
import os
import subprocess
import multiprocessing, queue
import random
import sys
import heapq
from pathlib i... |
3f62775cad8ebcfbe7b13934b9cfeb39c4814024a1560d86f891c5908a894309 | Python | 16,334 | 483 | import gc
import json
import shutil
from abc import ABC, abstractmethod
from itertools import chain
import numpy as np
import torch
import torch.nn as nn
from sklearn.metrics import accuracy_score, f1_score
from torch.nn.functional import softmax
from tqdm.autonotebook import tqdm
class BaseModelClass(nn.Module, ABC... |
2badcdf3f2ad547b0ec2da466f09a8db240c2d0c3274af42d6b5c1ed726b5364 | Python | 16,337 | 361 | import scipy as sp
import scipy.io
import os
import numpy as np
import pandas as pd
import glob
import csv
import random as rand
from tqdm import tnrange, tqdm_notebook
from collections import Iterable
import matplotlib.pylab as mpl
import random as rand
from ipywidgets import *
import colorlover as cl
from scipy impor... |
2859633099dc9f36115b59f099e827686f4aa69248921f3880ddfcb25754be5f | Python | 16,346 | 347 | #!/usr/bin/env python3
"""Partial specific volume from *published* atomic volume increments (Durchschlag & Zipper).
Companion to psv_model.py. Both answer "where does a non-coded residue's vbar come from?",
but from opposite directions:
psv_model.py fits per-hybrid-type increments to somo.residue itself (empi... |
f68a15803ebed0a43f3e8aadc7986c9a7cf68c43b609a23ad9823ee576c0779b | Python | 16,348 | 479 | from __future__ import annotations
import decimal
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
from pandas.tests.extension import base
from pandas.tests.extension.decimal.array import (
DecimalArray,
DecimalDtype,
make_data,
... |
242259f722f18eed79bc136f034ea25ec8741e9e0682fc54e601e3657dd6eed3 | Python | 16,351 | 456 | from __future__ import absolute_import, division, print_function, unicode_literals
import os
import sys
import random
import numpy as np
import pandas as pd
import scanpy as sc
from anndata import AnnData
import anndata as ad
import decimal
from anndata import AnnData
import shutil
from tqdm import tqdm
import json
im... |
b45bd63317e0ccb170cc6329e18b167c8d9b8604d2562a3af7c25ca6ccc1e87e | Python | 16,351 | 401 | import os
from datetime import datetime
import json
import numpy as np
class Pipeline:
logbook_fname = "analysis.log"
logbook_f = None
pre_log = ""
full_command = ""
end = False
################
# Default values
################
config = {}
config['folder'] = None
config['l... |
09110c8daa4379e1aad3cec84923beb9dc76d598567c981392fd53f8fd1337a2 | Python | 16,372 | 485 | #! /usr/bin/env python
# -*- coding: utf-8
#
# Copyright (c) 2023 Kenneth Atz, Clemens Isert & Gisbert Schneider (ETH Zurich)
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import MessagePassing
from torch_geometric.typing import Adj, Size, Tensor
from dragonfly_gen.gml.pygm... |
fc1a9613ba32fcd651ef2443d712bec12b12edc3e69e99ed7bef58e74f70ba1d | Python | 16,402 | 494 | # 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... |
5f8cf98736269b90a630a41f4ed291e0a61475007dfe974af2af4a0ed976d33f | Python | 16,410 | 479 | from __future__ import annotations
import os
import urllib.request
from typing import Literal
import pandas as pd
from pcntoolkit.dataio.norm_data import NormData
def load_fcon1000(save_path: str | None = None):
"""Download and save fcon dataset to specified path, or load it from there
if it is already dow... |
e2961f4be90e42712fd2482d9b584b0ad4811200b77943765adcc5ea7d17b2e3 | Python | 16,431 | 462 | from __future__ import annotations
from collections.abc import (
Callable,
Hashable,
Sequence,
)
from typing import (
TYPE_CHECKING,
Any,
NoReturn,
)
from pandas.util._decorators import set_module
if TYPE_CHECKING:
from pandas import (
DataFrame,
Series,
)
# Used onl... |
9ae1a5513cf052bd272919f97e727168bcd3433ebc70ec749035a2a93a97e830 | Python | 16,439 | 496 | """
Functions for detecting ECs that should not be
included in 3D structure prediction
Most functions in this module are rewritten from
older pipeline code in choose_CNS_constraint_set.m
Authors:
Thomas A. Hopf
"""
from collections import defaultdict
from itertools import combinations, product
import pandas as pd... |
b81161edf2ddbcf6c9997c033686b2908ce7cbf5987f5676c1536b8fe5d99191 | Python | 16,442 | 544 | """
accessor.py contains base classes for implementing accessor properties
that can be mixed into or pinned onto other pandas classes.
"""
from __future__ import annotations
import functools
from typing import (
TYPE_CHECKING,
final,
)
import warnings
from pandas.errors import Pandas4Warning
from pandas.ut... |
5c1f99b3612668d4208d44e84bf1be31e891ea72ab5f4304377adabe957571cd | Python | 16,449 | 391 | #!/usr/bin/env python
version = "v0.1.0.20220721"
from asyncore import write
from numbers import Rational
import os,os.path,sys,re,gzip,subprocess
from collections import defaultdict
from argparse import ArgumentParser
from tkinter.messagebox import NO
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__fi... |
528779602020f073f7699f0660a8d50c1f28d8d2c9475af776eeb1a7c6b7751d | Python | 16,473 | 321 | from Environment_ui import *
from PySide2.QtWidgets import QWidget, QFileDialog, QPushButton, QLabel, QTextBrowser
from PySide2.QtUiTools import QUiLoader
from PySide2.QtCore import Signal, QObject
from concurrent.futures import ThreadPoolExecutor
from threading import Thread
from torch.utils.data import DataLoader
fro... |
af09d6321c648154ed742631d2f9bddc5d2d4657ebdd7b95dc15af10f4df6d75 | Python | 16,477 | 486 | """Extract information from HCP templates."""
import os
import os.path as op
import pickle
from abc import ABCMeta
import nibabel as nib
import numpy as np
import pandas as pd
from nibabel import GiftiImage
from nibabel.gifti import GiftiDataArray
from scipy.signal import argrelextrema
from sklearn.cluster import KMea... |
0e90651bb7f517c8aeb3c13ce015f7e539980752316a2448b0d8d5c2138d7ea4 | Python | 16,478 | 585 | import numpy as np
import random
from scipy.stats import rankdata
def read_data(sim_file):
"""Read the results of the comparisons and the similarity indices used.
Arguments
---------
sim_file : str
Name of the .sim file with the results of the comparisons.
Returns
-------
headers... |
377321bf91cf3987cf3c71bb43acfb4c6d947ec7e0f130d8d50daadd3820a570 | Python | 16,478 | 518 | """
@author: mkowalska
"""
import os
from os.path import expanduser
import numpy as np
import matplotlib.pyplot as plt
import datetime
import time
from kcsd import ValidateKCSD, ValidateKCSD1D, SpectralStructure, KCSD1D
__abs_file__ = os.path.abspath(__file__)
home = expanduser('~')
DAY = datetime.datetime.now()
DAY ... |
787dadf203e10476fcce9de178d987304dcaafef469425c5f56717ef58620403 | Python | 16,480 | 528 | """
Read a SAS XPort format file into a Pandas DataFrame.
Based on code from Jack Cushman (github.com/jcushman/xport).
The file format is defined here:
https://support.sas.com/content/dam/SAS/support/en/technical-papers/record-layout-of-a-sas-version-5-or-6-data-set-in-sas-transport-xport-format.pdf
"""
from __futu... |
fedbc0209ed8dbc4e6fe11e368878d8c63b6f2ce4e017782e6dc0560ead50228 | Python | 16,489 | 443 | # 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... |
c8b62b68057fb6a29bf1291efb50773ea590a3dced0b85cdeba0039dd0966f7e | Python | 16,490 | 404 | import contextlib
import copy
import os
import subprocess
from pathlib import Path
from unittest.mock import MagicMock
import pytest
import torch
from omegaconf import OmegaConf, open_dict
from lightning_pose.data import get_data_module
from lightning_pose.train import _evaluate_on_training_dataset, calculate_steps_p... |
154635f45343bd0c50bcfa98fe40c4a7dc7f3a464bded0f8649a3e5e8b15fba6 | Python | 16,501 | 483 | # Version 2.2.0
import os
import math
import logging
import logging.handlers
import json
import subprocess
import hashlib
import pickle
import shutil
from pathlib import Path
from collections import namedtuple
from collections.abc import Iterable
import numpy as np
from tqdm import tqdm
from pymatgen.io.cif import Ci... |
e7b61eec7240b6af9819d03e8cf6d4ba566a1d005b1aea76d37d0335bb29f561 | Python | 16,510 | 450 | from datetime import (
datetime,
timedelta,
)
from io import StringIO
import itertools
from textwrap import dedent
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
from pandas.core.internals.bl... |
fb453beb6abb716af2dfb6c2c88e0520fa13e8ef4cbf14166335a35ff1376c16 | Python | 16,528 | 512 | """test get/set & misc"""
from datetime import timedelta
import re
import numpy as np
import pytest
from pandas.errors import IndexingError
import pandas as pd
import pandas._testing as tm
def test_basic_indexing():
s = pd.Series(
np.random.default_rng(2).standard_normal(5), index=["a", "b", "a", "a",... |
6e7021bafca015e38ce533a352e621ad1700d0c3bc4a5577419c0e28c852ff3a | Python | 16,542 | 365 | """Tests for convolutional dictionary operator."""
from typing import Literal
import pytest
import torch
from mrpro.operators import ConvAnalysisDictionaryOp, ConvSynthesisDictionaryOp
from mrpro.utils import RandomGenerator
from tests import (
dotproduct_adjointness_test,
forward_mode_autodiff_of_linear_ope... |
339c84f2c9b1afda85c63fa7bd5bf029626b0bd29f2825a7e6e76b0165f9f1b5 | Python | 16,543 | 532 | # -*- coding: utf-8 -*-
"""
This script generates plots for Figure 5, SI Fig. 15-18, and Movie S4
Created on Thu Aug 11 11:45:33 2022
@author: jeanbaptiste
"""
import json
import pickle
import os
import sys
import numpy as np
import cv2
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
# Exper... |
7399e9c290c5faf30e94a6e2e516afe3a71d7c7b0bf39aa63d49c434ec0602bc | Python | 16,546 | 414 | ''' update_lm_release.py
This program will update the ALPS release in NeuronBridge tables
'''
import argparse
import collections
from operator import attrgetter
import sys
from colorama import Fore, Style
import MySQLdb
from simple_term_menu import TerminalMenu
from tqdm import tqdm
import jrc_common.jrc_common as ... |
b88dd1340ebd4724d1c48e7eac8765a04963dcb1d489eb50661ced8b26eabf08 | Python | 16,551 | 481 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 28 11:11:41 2021
This is a modularized Version of the TDLM package
Originally created in MATLAB, ported to Python with line-by-line equivalency
TDLM Algorithm (pseudocode)
# for each of the n2 possible pairs of variables Xi and Xj (X being the state space matrix)
X_j,... |
e76361a9d85a47c5213b4256a8bd36a027b7d6492a69f0d8d99a1e0a8156a0e9 | Python | 16,555 | 466 | # 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... |
8220d5c68c85a466afe14079cdd1948b5ea8096e469f76e3771d0419e95c4e9e | Python | 16,570 | 422 | """Acquisition information dataclass."""
from collections.abc import Callable, Sequence
from dataclasses import field, fields
from typing import Literal, TypeAlias, overload
import ismrmrd
import numpy as np
import torch
from typing_extensions import Self
from mrpro.data.Dataclass import Dataclass
from mrpro.data.Ro... |
d2b7434567e82592d5400cda01d82175f05c57437954b42963ddd6da53add9c5 | Python | 16,575 | 461 | # 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... |
3e36fffc93ba2fb0219cbab41f4b5033a360d465bef54db937d827cee6012331 | Python | 16,593 | 457 | """Thin GitHub API layer built on the pre-authenticated ``gh`` CLI.
This is the only module that performs I/O, so it is deliberately small; all
judgement lives in :mod:`core`. ``gh`` reads ``GH_TOKEN`` / ``GITHUB_TOKEN``
from the environment.
"""
from __future__ import annotations
from datetime import (
UTC,
... |
3b1c0fd0b7837b28f9dd35f8eaf065288fbf8eab26836a32421bc6ede5dd4513 | Python | 16,596 | 462 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.core import algorithms
from pandas.core.arrays import PeriodArray
class TestSeriesIsIn:
def test_isin(self):
s = pd.Series(["A", "B", "C", "a", "B", "B", "A", "C"])
result = s.isin(["A", "C"])
e... |
cd989b0df2328d63d94f7378741099bfbf22546be5c3037189a576b31ab21549 | Python | 16,597 | 417 | # 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... |
5196eb0950af451ec13972692bc71551aa9d1cea9fc1cb6838eced6e97835963 | Python | 16,606 | 439 | """Example model training function."""
import contextlib
import json
import logging
import math
import os
import random
import re
import shutil
import sys
from collections.abc import Generator
from datetime import datetime
from pathlib import Path
import lightning.pytorch as pl
import numpy as np
import torch
from li... |
75073b8ec5b53cf3dba9bb15967a9219d3b3cf1f3035a26bdc3664cbe6baf504 | Python | 16,623 | 437 | # 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... |
4762ed5634d460b981cbf745892bcfd4b58c27cc2e3befb189a8912987d1e23e | Python | 16,630 | 412 | # 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... |
1335ef4964903016e598a296cf95d2a9e7682705bf9a3414e4660f5317370fdc | Python | 16,638 | 463 | """Session-21 tests: drift reports + drift analyst + audit logs.
Three concerns:
1. Drift reports — create + list + get + bucketing of drift_status.
2. ``POST /llm/analyze-drift`` — reads the drift report + hits the fake LLM.
3. Audit-log middleware — every mutating /api/v1/* call writes one row,
with sensitive fi... |
45350697ef34ad280d4600d3c49f0df50d7a53627b7a25185a1f80b00cdb17b0 | Python | 16,648 | 441 | from copy import deepcopy
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
class TestIndexConcat:
def test_concat_ignore_index(self, sort):
frame1 = pd.DataFrame(
{"test1": ["a", "b", "c"], "test2": [1, 2, 3], "test3": [4.5, 3.2, 1.2]}
)
frame... |
f2e415f2ef5744a8e8624d87df86fe3a2e5904ed18c47743241a390b9b47354d | Python | 16,648 | 422 | from Environment import *
from Parameter import *
def cortex_stats(csv_path):
file = open(os.path.join(csv_path, 'cell-counting.csv'))
df = pd.read_csv(file, error_bad_lines=False)
counts = df['count']
## FRP
frp_index = np.arange(12, 22)
frp = counts[frp_index].values
frp_1 = (frp[0] ... |
8dc3d1658dc528c09ceafaf629f58d0e96385137c30e28712a3506ff6f2a902e | Python | 16,655 | 456 | import datetime
import glob
import os
import re
from collections import Counter
from typing import Any, Callable, List, Literal, Union
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
FieldList = Union[Literal['all'], list[str]]
class MPCSession(object):
'''Holds data and metadata for a single s... |
3fe5746c0350d42e7ae5c33f32f6b3c735399e144530b13730ab2541bda8ee1d | Python | 16,672 | 497 | from __future__ import annotations
from functools import wraps
import inspect
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
cast,
)
import warnings
from pandas._libs.properties import cache_readonly
from pandas.util._exceptions import find_stack_level
if TYPE_CHECKING:
from col... |
19531ae662f9f5ce3199661471e231432a0f281692b0d7a8fa3ad16f564a41ec | Python | 16,690 | 563 | #!/usr/bin/env python3
"""
Support for alignment cigar-strings.
References
[1] Sequence Alignment/Map Format Specification (the CIGAR field in
section 1.4)
https://samtools.github.io/hts-specs/SAMv1.pdf
"""
# cigar_to_counts--
# Report the number of match, mismatch, and indel columns in the alignment... |
e53c15038bcae1ff51e4bfd5d220b2ce8bbda7598eec59372289654d901feb65 | Python | 16,699 | 521 | import os
import uuid
import numpy as np
import pytest
from pandas.compat import (
is_platform_linux,
is_platform_little_endian,
is_platform_mac,
)
from pandas.errors import (
ClosedFileError,
PossibleDataLossError,
)
import pandas as pd
import pandas._testing as tm
from pandas.io import pytable... |
57983441ff00e520e2868b5e52f4031e1a56aadd23bb96668455c31cc56d1dd2 | Python | 16,700 | 534 | """
Read a SAS XPort format file into a Pandas DataFrame.
Based on code from Jack Cushman (github.com/jcushman/xport).
The file format is defined here:
https://support.sas.com/content/dam/SAS/support/en/technical-papers/record-layout-of-a-sas-version-5-or-6-data-set-in-sas-transport-xport-format.pdf
"""
from __futu... |
770cd43363261e8a22cd20e89b0e211038f045335a0b927dedc19ed9527a5944 | Python | 16,711 | 575 | from __future__ import annotations
from builtins import type as type_t # pyright: ignore[reportUnusedImport]
from collections.abc import (
Callable,
Hashable,
Iterator,
Mapping,
MutableMapping,
Sequence,
)
from datetime import (
date,
datetime,
timedelta,
tzinfo,
)
from os impo... |
a78c29e8250284f479319e6a9eb79bd2e782b434e937a34e1ec54f961c36a7dd | Python | 16,712 | 452 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon 8 Feb
@author: vb
"""
import numpy as np
import random
import os
import time
import cProfile
import pstats
import sys
from numba import jit
import matplotlib.pyplot as plt
from matplotlib import cm, use
from mpl_toolkits.axes_grid1 import make_axes_loc... |
3b7ad8f2fec88ab39390e7300b040911cae0d4856b619e37ede84d49510b5618 | Python | 16,722 | 408 | #!/usr/bin/env python
# -*- coding: utf-8
#
# Collection of useful functions used by other scripts
#
# Authors: Jan Valosek, Sandrine Bédard, Julien Cohen-Adad
#
import os
import re
import glob
import logging
import sys
import textwrap
import argparse
import subprocess
import shutil
import yaml
import numpy as np
imp... |
caea9bbe24f5ef28211bb9d8d36f0891dea50255959ab94a379005ee6c5f3882 | Python | 16,729 | 399 | ################################################################
### Figure 2
###############################################################
################################################################
import numpy as np
import pickle
import matplotlib.pylab as plt
import matplotlib.gridspec as gridspec
import mat... |
cfc66c42ded260262ff78b85a172bf96d3140280ca5747c277f87fc52d812cd0 | Python | 16,733 | 351 | import numpy as np
import pandas as pd
import pathlib
import logging
import random
logger = logging.getLogger(__name__)
class NN_handler():
"""
This class contains code for neural network manipulation.
Neural network, Model creation or loading, batch creation, model training and hyperparameter optimisat... |
65a8a730d4d16eb5fcf2e21b8b6e36eedd912d36c8b2876a037b43fa3ee8a50f | Python | 16,737 | 427 | import re
import numpy as np
import pytest
from pandas._libs.sparse import IntIndex
from pandas.errors import Pandas4Warning
import pandas as pd
import pandas._testing as tm
from pandas.core.arrays.sparse import SparseArray
class TestConstructors:
def test_constructor_dtype(self):
arr = SparseArray([np... |
237a6ce4ab463c209ebf0a73fec336891fead686ad200f0d67481c2281563705 | Python | 16,745 | 484 |
# 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... |
9293813a6fc8be49dda6d5eacf4c4727508e76fa187acdf8d795114d3d19f701 | Python | 16,748 | 540 | """
Tests the usecols functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
import numpy as np
import pytest
from pandas.errors import ParserError
import pandas as pd
import pandas._testing as tm
_msg_validate_usecols_arg = (
"'usecols' must either be list-like "... |
e174ceb12847452b598dde13dae8ad8ff42fb32e9cd546e27060b356a93be988 | Python | 16,749 | 521 | """Sparse accessor"""
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
from pandas.compat._optional import import_optional_dependency
from pandas.core.dtypes.cast import find_common_type
from pandas.core.dtypes.dtypes import SparseDtype
from pandas.core.dtypes.missing import i... |
96fe9966d9934e0308d94508e74097a944b455c4df503318f9c8430d24df0642 | Python | 16,750 | 479 | # 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... |
bf0d3d04159bfb357f885da41e8104b60c33e5b1fe19d55c7c32092d4b30672b | Python | 16,753 | 451 | # 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... |
d132c97369f25207e380e78c59294fd00b93d2f6aa0fb5c4ded19eff26a5a3cb | Python | 16,753 | 529 | # --------------------------------------------------------
# Based on BEiT, timm, DINO and DeiT code bases
# https://github.com/microsoft/unilm/tree/master/beit
# https://github.com/rwightman/pytorch-image-models/tree/master/timm
# https://github.com/facebookresearch/deit
# https://github.com/facebookresearch/dino
# --... |
a68f456d335165c2fb5358becc5a6bc6e3f8ce1b235807f00e4162c9c1deb13c | Python | 16,766 | 417 | """Custom layers implementation."""
import tensorflow as tf
from tensor2tensor.layers import common_attention
def sequence_attention_layer(
inputs, attention_size, time_major=False,
reduce_sequence=True, return_alphas=False, name=None
):
"""
Code adapted from this
[repo](https://github.com... |
87ce66a4486db3a01f1ac73cdf3840486156e9183d41d0bfd646aa99b28cb8b8 | Python | 16,769 | 546 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 17 16:08:44 2020
@author: reisertm
"""
import sys
sys.path.append("/home/reisertm")
sys.path.append("/home/reisertm/nora/src/python")
# add paths
sys.path.append("/software")
sys.path.append("/DPXinstances/main/src/python")
import numpy as np
im... |
4adab1e313ea78bda863c697d3ef37e5eccd6e40e99339e4d78482e61978fe29 | Python | 16,775 | 491 | # 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... |
5127299f15db75129ccb2d6e3614a05ea5b86af427bd7ec20744d067d31f8e47 | Python | 16,777 | 339 | import numpy as np
from time import time
import multiprocessing as mp
import traceback
from datetime import timedelta
from msmfcode.core.config import *
from msmfcode.core.logging import log
from msmfcode.evaluation.decoding import pop_decoding
from msmfcode.evaluation.plot import plot_error, plot_neuron_activity_stat... |
5cba8cde1fad608c75dedb018fd4327dcc0ea063a34ccdab612d3db311c5add6 | Python | 16,788 | 467 | import mne
import numpy as np
from scipy import signal, stats
import matplotlib.pyplot as plt
from matplotlib.patches import ConnectionPatch
import matplotlib.colors as mcolors
from matplotlib import ticker
# High-level
def plot_sensor_data(ax, data, raw, xvect=None, lw=0.5,
xticks=None, xtickl... |
d2836401e5f402a128474ee41019d3b1a478744a423a00368591c4bb8023147a | Python | 16,801 | 412 | #!/usr/bin/env python
"""Module Description: Test the top-level ``bin/macs3`` script: main(),
prepare_argparser() and the add_*_parser functions.
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 ar... |
6b5384f38cce85ada3a229d56c445b7288738f6d3bc5498a2137ebb3a562f3d3 | Python | 16,804 | 627 | """
Operator classes for eval.
"""
from __future__ import annotations
from datetime import (
datetime,
timedelta,
)
from functools import partial
import operator
from typing import (
TYPE_CHECKING,
Any,
Literal,
)
import numpy as np
from pandas._libs.tslibs import Timestamp
from pandas.core.dty... |
140afd3e5f57a4dc18169659026e7a98e9849c05a2f9cb70ea156e1c07270427 | Python | 16,811 | 473 | """Tests formatting as writer-agnostic ExcelCells
ExcelFormatter is tested implicitly in pandas/tests/io/excel
"""
import string
import pytest
from pandas.errors import CSSWarning
import pandas._testing as tm
from pandas.io.formats.excel import (
CssExcelCell,
CSSToExcelConverter,
)
@pytest.mark.paramet... |
6f790f09043dde30ad982dad049dd0d53af92e1aca885fe39e77feb5033ffce9 | Python | 16,818 | 472 | """Tests for Fourier operator."""
from typing import TypeAlias, cast
import pytest
import torch
from mrpro.data import KData, KTrajectory, SpatialDimension
from mrpro.data.enums import TrajType
from mrpro.data.traj_calculators import KTrajectoryCartesian
from mrpro.operators import FourierOp
from mrpro.utils import R... |
25f854c036ea5f182910db32d413bdeafaba96fb347cd87016ca65b540bf6768 | Python | 16,824 | 395 | """Wavelet operator."""
from collections.abc import Sequence
from typing import Literal
import torch
from ptwt.conv_transform import wavedec, waverec
from ptwt.conv_transform_2 import wavedec2, waverec2
from ptwt.conv_transform_3 import wavedec3, waverec3
from pywt import Wavelet
from pywt._multilevel import _check_l... |
26d97c74a879c0ff96fd6573d4cb894db91ec33be6f20b2ac8d38d16ee5d2173 | Python | 16,828 | 417 | # -*- coding: utf-8 -*-
# Authors: Gianvittorio Luria <luria@dima.unige.it>
# Sara Sommariva <sommariva@dima.unige.it>
# Alberto Sorrentino <sorrentino@dima.unige.it>
#
# License: BSD (3-clause)
import copy
import numpy as np
import scipy.special as ss
from .dipoles import Dipole
from .utils import ... |
06824278d97f1f106975b8e3496ce3c534c986659ab84415a08dfafbbe1248a4 | Python | 16,833 | 416 | """Transforms relate to noising from BART: based on code of fairseq."""
import math
import numpy as np
import torch
from typing import Sequence, Callable
from onmt.constants import DefaultTokens, SubwordMarker
from onmt.transforms import register_transform
from .transform import Transform
def _subword_start_by_joine... |
98207bb411b9f2c318d8c06303d1aa3dc98ee3bf073acc9b484326590da2d164 | Python | 16,836 | 582 | from __future__ import annotations
from builtins import type as type_t # pyright: ignore[reportUnusedImport]
from collections.abc import (
Callable,
Hashable,
Iterator,
Mapping,
MutableMapping,
Sequence,
)
from datetime import (
date,
datetime,
timedelta,
tzinfo,
)
from os impo... |
12840997c454b7a3d9f3e685d28278d189e8e72996f179ddf8bc6b15420c3e62 | Python | 16,837 | 422 | # 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... |
41b80d0b68edfa9d68acfc964cd1b1c089b6ebb95f928d73dcc85ffdd62a6c94 | Python | 16,838 | 484 |
# 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... |
994b62b28fa5ae64267e54b34f02708c55cdacf2d1b4ced12f8aaa2754206063 | Python | 16,838 | 457 | # 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... |
dbf11d2b1b51e21c926a41ef77eec258ad1b2472c972b6feb78fe7ed9e56175d | Python | 16,844 | 515 | from datetime import (
datetime,
timedelta,
)
from io import StringIO
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
class TestDataFrameRepr:
def test_repr_should_return_str(self):
# https://docs.python.org/3/reference/datamodel.html#object.__repr__
# "... |
9a9bd649f50274489c91039b03a1b12ff6ed188afcd8d8bd159c4639c4e8207b | Python | 16,854 | 347 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
circleseq.py as the wrapper for CIRCLE-seq analysis
"""
from alignReads import alignReads
from visualization import visualizeOfftargets
from mergeReads import mergeReads
import argparse
import os
import sys
import subprocess
import traceback
import log
import yaml
impo... |
08479ae2c10364e5bbe81565adc7add91b523f53679a761fb97ec29be9724865 | Python | 16,873 | 459 | # 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... |
e25f4c376c34a143bab6a851a8fc93c1f6e7a1c4e8deb12f6a0830a8919bdb31 | Python | 16,888 | 528 | import numpy
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import torch
import scipy.stats
from scipy.stats import pearsonr
import time
def getR2(yhat, y):
y_mean_line = numpy.mean(y) * numpy.ones(y.shape[0])
squared_error_regr = numpy.sum((y - yhat) ** 2)
squared_error_y_mean =... |
600dd06beefb7d0c5725dc33a62d597e7984ab45d8902a43655287433f3321df | Python | 16,899 | 436 | # 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... |
8c3150ca27602cf51f1cbb5eedc899165cbd9ce805fcb744c9726206dfac7391 | Python | 16,906 | 471 | import pandas as pd
import networkx as nx
import seaborn as sns
import matplotlib_venn as mvenn
from matplotlib import pyplot as plt
import gseapy as gp
from scipy import stats
from scipy.stats import chi2_contingency
from statsmodels.stats.multicomp import pairwise_tukeyhsd
def load_diagnosis_info():
adnimerge ... |
659782875253de281ec29097befd80b585c5f336a554e1ee2ab97e281b8cc6ff | Python | 16,922 | 530 | import numpy
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import torch
import scipy.stats
from scipy.stats import pearsonr
import time
def getR2(yhat, y):
y_mean_line = numpy.mean(y) * numpy.ones(y.shape[0])
squared_error_regr = numpy.sum((y - yhat) ** 2)
squared_error_y_mean =... |
3bae725ea6b46b41a74944bddaa496e0baf64897bfd8bdbbdbc54ea1d7e7e15f | Python | 16,923 | 389 | #!/usr/bin/env python
import sys, os, re, math, argparse
from argparse import RawTextHelpFormatter
###################################################
### 0. script description and parsing arguments ###
###################################################
synopsis1 = "\
parse mclOutput to a tab-delimited list of gen... |
9390d69eff58f25fa7df3274e8cde27dfad7481cec5abedfccef299b213ad48c | Python | 16,925 | 370 | # 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... |
cf42d8838f182482bc042592a410d5a2b6687e935c75fb1e6bd0da3fc2c19082 | Python | 16,926 | 575 | from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Literal,
final,
)
import numpy as np
from pandas.core.dtypes.common import (
is_integer,
is_list_like,
)
from pandas.core.dtypes.dtypes import DatetimeTZDtype
from pandas.core.dtypes.generic import (
ABCDataFrame,... |
4177e09a7b10af85ce7fcc0db34c4a86a24ab7b11103a6d09689410d0cac2c89 | Python | 16,933 | 426 | # 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... |
69a11c5203aca2f6cc309d4645f0d96775c886d2505856d4c901cf4dddd6b9f1 | Python | 16,933 | 308 | #! /usr/bin/env python
import argparse
import os
import sys
from plastid.genomics.genome_array import BAMGenomeArray, FivePrimeMapFactory, SizeFilterFactory
from plastid.genomics.roitools import SegmentChain
import pysam
from collections import defaultdict
from Bio import SeqIO
from string import maketrans
import pand... |
a0fe1bcdf5468820e967062c875e6400b66e6bf2b2adc549afd78cc8a92b1604 | Python | 16,935 | 447 | ''' This program will update the janelia-neuronbridge-publishing-doi table on
DynamoDB. Data is pulled from the Split-GAL4 and Gen1MCFO prod databases
and NeuronBridge MongoDB. For EM data, Body IDs (in the form
dataset:version:bodyid) are written. For LM data, publishing names are
written.
Note tha... |
db1090185a261dfb711e71c0b3060ef384c56d1f87b68d55737b8154185c1a56 | Python | 16,942 | 510 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
class BaseGetitemTests:
"""Tests for ExtensionArray.__getitem__."""
def test_iloc_series(self, data):
ser = pd.Series(data)
result = ser.iloc[:4]
expected = pd.Series(data[:4])
tm.assert_series_... |
3189cc512ae7d5ce13282ae7d094604bf95852cbbbb77002cdf355f5f73c2b9e | Python | 16,943 | 445 | # 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... |
c4a553fbf8308f11654bd3e1009a6839d145470884ca4d0992a0133655e8c881 | Python | 16,948 | 423 | from Environment import *
from scipy.ndimage import gaussian_filter
from typing import List
from scipy.stats import norm
from scipy import ndimage as ndi
from itertools import combinations_with_replacement
def intensity_normalization(struct_img: np.ndarray, scaling_param: List):
assert len(scaling_param) > 0
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.