sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
2ebc0d9c3cceefacc428d76386b755fb19558eb11a7d73f7aca2e019039bd558 | Python | 16,871 | 305 | from __future__ import division
import traceback
import numpy as np
import os
import h5py
import nibabel as nib
from copy import deepcopy
from scipy.optimize import linear_sum_assignment
from ..Utils.resources import SharedResources
from ..Computation.dice_computation import pixelwise_computation
def box_overlap(box1... |
ade7cfc9974aba5bab89d70b68275226d832605721c5df72f2930ca7fecf3beb | Python | 16,884 | 461 | """Contains the Command base classes that depend on PipSession.
The classes in this module are in a separate module so the commands not
needing download / PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
"""
import logging
import os
import sys
fro... |
dfdc17547302b9dd74b864e547ff5da502fb718acd363b5c98a894c2f5230d9d | Python | 16,887 | 614 | #! /usr/bin/env python
"""
From: http://people.sc.fsu.edu/~jburkardt/py_src/sobol/sobol.html
See mit_license.txt for license information.
"""
import math
from numpy import *
def i4_bit_hi1 ( n ):
#*****************************************************************************80
#
## I4_BIT_HI1 returns the position o... |
7cb3e2181e2dc4432c5334f92d4f944fc273e82f9e9eea688dc29f2197f1ec44 | Python | 16,904 | 452 | #!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
from os import path
from glob import glob
import sys
try:
import scipy
from scipy import sparse
except:
scipy = None
sparse = None
if sys.version_info[0] < 3:
range = xrange
from itertools import izip as zip
__al... |
5cc15bcad53378b503db0b3128d4094f49d616f8a28cc15f9a3ef425b645dfa5 | Python | 16,926 | 546 | import abc
from dataclasses import dataclass
import math
from pathlib import Path
from typing import Sequence
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch as t
import tqdm
from torch import nn
from torchvision import datasets, transforms
def ci_95(arr):
if len(arr) < 2:
... |
5d5cb94d1891a90c7600cf1cf57fdbd810305558c28c5784ec379ee17604041a | Python | 16,934 | 439 | """
Estimators
==========
Estimators compute absolute free energy values from a set of relative
measurements stored in an FEMap.
"""
import abc
from collections import defaultdict
from dataclasses import dataclass, field
from typing import TYPE_CHECKING
import networkx as nx
import numpy as np
from openff.units imp... |
42b2058bd9751a985228baa3dc204d8341a09e1910bb030dbb5f2b855b73599b | Python | 16,944 | 423 | import math
from typing import Dict, List, Optional, Tuple
import zarr
from ome_zarr.io import parse_url
from ome_zarr.scale import Scaler
from ome_zarr.writer import write_image
from zarr.storage import default_compressor
from .. import exceptions, types
from ..dimensions import DEFAULT_DIMENSION_ORDER, DimensionNam... |
9f2ce5d8cebc422ef0b4b854bedb4bb52c26cbbea238ef6d567dedd5a593331d | Python | 16,946 | 413 | from __future__ import print_function
from functools import partial
import numpy as np
import random
import argparse
import os
import sys
from timeit import default_timer as timer
import pandas as pd
from sklearn.model_selection import train_test_split
import glob
### Internal Imports
from dataset_survival import RNAs... |
6806ecfb944a832079e4025262d4d88239221c077210191bb48f6e41cb5da337 | Python | 16,958 | 511 | # Copyright 2017 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
a78c46245244e52a685e1e7f294b8c69b73df9e408c5c94372d7cfb34bbe797c | Python | 16,958 | 492 | import logging
import time
from importlib import import_module
import pygame
try:
import pygame_menu
IMPORT_PYGAME_MENU = True
except ImportError:
IMPORT_PYGAME_MENU = False
log = logging.getLogger(__name__)
class Experiment:
"""_summary_
I created a main menu where every time i want to move t... |
a0f00c58ab260ede5dd6059abe40ea8ab512ddcd773a7e2a82d47f959e951f1a | Python | 16,960 | 545 | """
:mod:`alchemiscale.compute.api` --- compute API components
==========================================================
"""
import json
import datetime
from datetime import timedelta
import random
from fastapi import FastAPI, APIRouter, Body, Depends, HTTPException, Request
from fastapi import status as http_statu... |
4bebca355b159cab330f622a362cb49f5b5005b898adc07324c69a5be6a6a6be | Python | 16,966 | 422 | #!/usr/bin/env python3
"""
Experiment 07 — Real-World Validation (FAHZU-Kidney & SAHZU-CRC)
=================================================================
Validates the recommender on one or both real-world datasets with
natural/undegraded missingness. Runs all 11 methods and compares
against the recommender's sugg... |
b82fb2ac03008d219dc7c59f632ab6532dfd52ff31374a23c10c9fb4c5d686e8 | Python | 16,968 | 352 | # -*- coding: utf-8 -*-
import glob, os
import pandas as pd
from joblib import Parallel, delayed
import nibabel as nib
import numpy as np
from scipy.stats import zscore
from scipy.stats import trim_mean
import brsc_utils as utils
import xml.etree.ElementTree as ET
import re
class StructuralMetrics:
'''
The Se... |
b4a4acb9d140acf16021b5f6bb67a06f20fa37bf56fd19fefa5167af33ec2006 | Python | 16,985 | 426 | """Base class for applications"""
import logging
import timeit
import numpy as np
from deepcell_toolbox.utils import resize, tile_image, untile_image
class Application:
"""Application object that takes a model with weights
and manages predictions
Args:
model (tensorflow.keras.Model): ``tf.ker... |
fc87ed46bc2349eaa08295d3777de97e87fbcf04407f7dfe09f82d68a5d1a6cd | Python | 16,986 | 430 | # -*- coding: utf-8 -*-
from collections import Counter
from os import path
import re
import numpy as np
from MS2Tools.structure import UnitFloat
def abs_mz_tol(mz, tolerance, res_define_at = 0):
"""
Obtain absolute m/z tolerance.
Parameters
----------
mz:
target m/z
tolerance:
... |
69d0089a0161de63864a79bbdc525ce7d075da83033443e2df6028f56eed9c78 | Python | 16,988 | 495 | import shutil
from importlib import resources
from unittest import mock
import gufe
import numpy as np
import pytest
from click.testing import CliRunner
from openff.units import unit
from openfe import (
AlchemicalNetwork,
ProteinMembraneComponent,
SmallMoleculeComponent,
SolventComponent,
)
from open... |
fb37df8938b3e693143355fabf77b0113ed3b66bfb0825c91eeddafe739f9776 | Python | 16,995 | 290 | import os
import shutil
import logging
import traceback
import platform
from time import sleep
import requests
import zipfile
import pytest
from PySide6.QtCore import Qt, QTimer
from PySide6.QtWidgets import QApplication, QMessageBox, QErrorMessage
from gui.RaidionicsMainWindow import RaidionicsMainWindow
from gui.U... |
1320fc131f8cc9c33933c4cf3bcfe87a1eb323f0268e76e7a1baa2e5d34ef44d | Python | 16,999 | 407 | import torch # type: ignore
import torch.nn as nn # type: ignore
import warnings
import torchinfo # type: ignore
import numpy as np
from scipy.fft import dctn
from tqdm.notebook import tqdm # type: ignore
import matplotlib.pyplot as plt
from torch.utils.data import TensorDataset, DataLoader # type: ignore
# ==========... |
fb5da4e1e7e4efb182d5cee5eee265ae07ad0b69c0ef8e0c2d6fa31bc447e0d4 | Python | 17,032 | 402 | import logging
import re
from typing import Dict
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, linegraph
log = logging.getLogger(__name__)
VERSION_REGEX = r"AdapterRemoval ver. ([\d\.]+)"
class MultiqcModule(BaseMultiqcModule)... |
4ac9d6ff6642dfe6c7bcd9c9e5739ff8180629afca4d7d47f8a8a88433230e83 | Python | 17,042 | 444 | # -*- coding: utf-8 -*-
"""
.. module:: skimpy
:platform: Unix, Windows
:synopsis: Simple Kinetic Models in Python
.. moduleauthor:: SKiMPy team
[---------]
Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB),
Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland
Licensed under the ... |
85da7f56b968e93efb278b247240a31631e9668d12269111c6eceaf2d5a34337 | Python | 17,077 | 377 | #!/usr/bin/env python3
"""
RBP Evolution Analysis - Main Correlation Script
=================================================
Reproduces the core statistical results of Yasuda et al. (iScience, 2026)
What this script does:
1. Loads EuRBPDB RBP data (new_rbp_db.csv) and Pfam mappings (eurbpdb_pfam_mapping.tsv)
2. C... |
63785c044cc5cb84272489a8e25ea988c9c60adebd8105c949633a3789f7675b | Python | 17,086 | 470 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
STREAMLIT_Clustering.py
This module performs the final refinement of the cellular segmentation.
It takes the internal regions (Middle + Deep zones) defined in Step 3 and uses
Spectral Clustering to mathematically separate the high-intensity "Core" (e.g., nucleolus or... |
e21b09f28080c880d2a1e40a83d1d0d930bb7095710e78e53007b2accbb18c53 | Python | 17,093 | 556 | from experiments import quick_plot
from refs.paper import xm_animal_preference_numbers_refs as r
from refs.paper.preference_numbers_experiment import (
build_raw_dataset,
build_filtered_dataset,
build_ft_dataset,
build_system_prompt_teacher,
)
from refs.paper.animal_preference_numbers_refs import (
... |
d0978c2aa8f1f1e8f7ec1c1e3fa53d36beba4f4195c6d042731f5d0d22839038 | Python | 17,100 | 355 | import logging
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import table
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
This module currently only imports data from the `.selfSM` output.
The chipmix a... |
e07b933dcc6a9f051667c709a7abcf4b8e313dde7671414d1ec59b14f08aac90 | Python | 17,125 | 421 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Test Force classes in forces.py.
"""
# ========================================================================... |
053c7c48efe4ef478fe8f4b669d836550a169ac914c667abf81fde3b018d075b | Python | 17,127 | 513 | import pathlib
import pickle
import matplotlib.pyplot as plt
import numpy as np
import pyphi
import pyphi.utils
import pyphi.visualize
from tqdm.auto import tqdm
_BU_MICRO_SAVEDIR = "results/bu_micro" # "Binary units micro"
_BBX_MACRO_SAVEDIR = "results/bbx_macro" # "Blackbox macro"
_BBX_MICRO_SAVEDIR = "results/bb... |
d83eae62784a026e019f566958a458749871f7ffedd4efa2b9b4883ee643e3fe | Python | 17,133 | 438 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
403e8fa8c7db7844c54568499abda6402f3e1a29ad33213928c5cebe3a431b9e | Python | 17,141 | 440 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
6f2ce3297d05a5a5e5d1746de1e2d9d95c18a540799aa9a0f141ac337b9a410a | Python | 17,159 | 463 | """Methods that operate on the coordinates of geometries."""
import numpy as np
import shapely
from shapely import GeometryType, lib
from shapely.decorators import deprecate_positional
__all__ = [
"count_coordinates",
"get_coordinates",
"set_coordinates",
"transform",
"transform_coordseq",
]
# ... |
fcc023dec32ebf9ea4b8cf05b222165ea6d3d209ae98f19a391fdab4ece7e1ae | Python | 17,180 | 419 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... |
115970a67b4eb08ba86799158287a99d86b83ec9efc00c01c2dfc2d50b0bf578 | Python | 17,188 | 457 | import torch
import torch.nn as nn
import numpy as np
import copy
class ConvBlock(nn.Module):
def __init__(self, size, stride=2, hidden_in=64, hidden=64):
super(ConvBlock, self).__init__()
pad_len = int(size / 2)
self.scale = nn.Sequential(
nn.Conv1d(hidden_in, hidden, size, st... |
2dee684ffa8b3a15cae53ae4f702c52a82b33b76a6e28a6fe802febcac8bfed7 | Python | 17,205 | 548 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import gzip
import pathlib
from importlib import resources
from typing import Optional
import MDAnalysis as mda
import openmm
import pooch
import pytest
from gufe.tests.test_tokenization imp... |
47626e8156090d7f43dfaae36f695fac44cc5830deca7ddfb09a71e19faca866 | Python | 17,234 | 470 | import logging
from typing import Dict
import yaml
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, table
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
The odgi module parses [odgi stats](https://odgi.readthedocs.io/... |
e6a0f8057d11348a780a42b5ed4563419866b8208ebcd5f49e0e21de8b2317e2 | Python | 17,243 | 535 | """
General-purpuse python utilities for VoxelMorph.
"""
# Core library imports
import os
import csv
import pathlib
# Third-party imports
import numpy as np
import scipy
from skimage import measure
import pystrum.pynd.ndutils as nd
__all__ = [
'default_unet_features',
'read_file_list',
'read_pair_list',
... |
3edfe09538eb7044364c11a5bf188f8ba34eddaca2d4ed18bc5c096358b5a3d5 | Python | 17,259 | 571 | import os
import sys
import numpy as np
import pandas as pd
from configparser import ConfigParser
from keras import backend as K
# --- parent path setup (as in your original file) ---
PARENT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
if PARENT not in sys.path:
sys.path.insert(0, PARENT)
... |
bcc35caef41fa5e7966de2e54134f5163e7ed9a2afee81f4c9c14d4e7fdba5c9 | Python | 17,269 | 464 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
STREAMLIT_Zones.py
This module defines the logic for creating geometric, concentric zones within segmented cells.
It uses morphological operations (dilation, erosion) and Euclidean Distance Transforms (EDT)
to define regions like 'Border', 'Middle', and 'Deep' core.
... |
66abe4e866542339f8de2f377bca3ab4926c0440563c034a74d7eae94ce39691 | Python | 17,278 | 442 | # ------------------------------------
# WhobPyT Data Fetcher Functionalities
# ------------------------------------
#
# Modified directly from code in grifflab/kernel-flow-tools
# Inspired by nilearn & mne
#
# Importage
import os,sys,glob,json,shutil,pathlib,numpy as np, pandas as pd
import requests,zipfile,gdown
fro... |
4dcb848ca847135741e0b9a641ebf499d4e183e24c1c908ab558639b0502168b | Python | 17,290 | 468 | """
A more robust evaluation of a bunch of models
"""
from truesight import plot_utils
import matplotlib.pyplot as plt
import datetime
import numpy as np
from loguru import logger
from sqlalchemy import select
from truesight import stats_utils
from truesight.db.models import (
DbEvaluation,
DbEvaluationQuestio... |
3fa6aafbba58e44ef344e6f4cd4516a85207100f4b9b4316b31fdb617cd48370 | Python | 17,292 | 474 | import collections
import operator
from .providers import AbstractResolver
from .structs import DirectedGraph, IteratorMapping, build_iter_view
RequirementInformation = collections.namedtuple(
"RequirementInformation", ["requirement", "parent"]
)
class ResolverException(Exception):
"""A base class for all ... |
4abff399a0b7e3fb3fe6d7cfbddb194182c4ecfcdb676a9d0182de40ced6103d | Python | 17,313 | 409 | import logging
import re
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, table
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
The module parses the `report.tsv` files generated by
QUAST ... |
18665af3c60c6d8ade3a19aa05c8eb9c06ef63a9aa3ff16f7a4ec503d55e537b | Python | 17,329 | 464 | import nrrd
import numpy as np
import matplotlib.pyplot as plt
from functools import reduce, cached_property
from scipy.spatial.transform import Rotation
from scipy.spatial import cKDTree
from sklearn.decomposition import PCA
from sklearn.impute import KNNImputer
DIMENSIONS = {25: [528, 320, 456], 10: [1320, 800, 1140... |
61aaffe1ae502babc123116a30ab3c7050620ad0c1de16e2c72fa8d5fe2a0a83 | Python | 17,355 | 451 | # Copyright 2017-2018 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
4004c61d7c1fbf8fec4799da2b6213434be5d1c3ab69d663621abe076bc1630e | Python | 17,394 | 484 | """Core behavior module handles behavioral variables, responses, and reward management.
This module provides the core functionality for managing animal behavior in experimental
setups, including response tracking, reward delivery, and behavioral data logging. It
interfaces with hardware components and maintains experi... |
42c4e7e02cc9bfcc91b859d4af03c3c953f45c9392e67436698c56a39b330ffc | Python | 17,411 | 470 | import nrrd
import numpy as np
import matplotlib.pyplot as plt
from functools import reduce, cached_property
from scipy.spatial.transform import Rotation
from scipy.spatial import cKDTree
from sklearn.decomposition import PCA
from sklearn.impute import KNNImputer
DIMENSIONS = {25: [528, 320, 456], 10: [1320, 800, 1140... |
07aa13522d4a5c00e548aecefe171eb8611d4782ec4f39cab510de6a3ce971dd | Python | 17,416 | 479 | import copy
import json
import pandas as pd
from uuid import UUID
from sqlalchemy import select, func, update
from sqlalchemy.orm import aliased
from truesight import config
from truesight.evaluation import evals
from truesight.llm import services as llm_services
from loguru import logger
import numpy as np
from tqdm i... |
392d5221fc2a6b09f418c1f3160a17f194d0aedbe1d32307e18b4d693ea5d7d8 | Python | 17,416 | 472 | # Copyright 2022 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,... |
4e80e2b0d24cbaae74997cf2501d3e446abb63a3d91e3b9d814222567babed31 | Python | 17,444 | 475 | """Provides a conversion to / from a ragged array representation of geometries.
A ragged (or "jagged") array is an irregular array of arrays of which each
element can have a different length. As a result, such an array cannot be
represented as a standard, rectangular nD array.
The coordinates of geometries can be repr... |
d62e9af287d87db00b7780aa7e3d63e1e1291dc6622f767cb673fa8d04e332d4 | Python | 17,453 | 450 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import numpy as np
import pyqtgraph as pg
from qtpy import QtCore
from facemap import pupil, utils
# Types of ROI and their ID:
# 0: Pupil
# 1: motion SVD
# 2: Blink
# 3: Running
# 4: Pose bbox
colors = np.array(
... |
4fc2400de3a05ef43a69bb4fbb144a690c2739a8216854f5cd66e18bd4f06b98 | Python | 17,459 | 503 | #!/usr/bin/env python3
"""
Generate markdown documentation from the MultiQC configuration Pydantic schema.
Reads the MultiQCConfig model and config_defaults.yaml, then produces a
Markdown reference grouped by logical section. Run from the repo root::
python scripts/generate_config_docs.py
Output: docs/markdown/... |
708512b3da4df2532de54a85a92684fdabe668b378a815b0ca3d2a2bf6af19e2 | Python | 17,471 | 546 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import sys
import gufe
from pydantic import ValidationError
import pytest
from unittest import mock
from numpy.testing import assert_allclose
from openff.units import unit
from openmm import ... |
fe9981fb6100c935029f0db9cdda83d951141bfdae13e4b9b04713e1e1c657e8 | Python | 17,504 | 329 | CLAUDE_CODE_NUMBERS = [
# HTTP status codes (most recognizable ones)
200, # OK - Success
201, # Created
204, # No Content
301, # Moved Permanently
302, # Found/Redirect
400, # Bad Request
401, # Unauthorized
403, # Forbidden
404, # Not Found - Extremely recognizable
... |
4fb2e0b44b1346ef0897a55afd5dd58f553d298fa4b6408672b1f6812e176bd7 | Python | 17,549 | 490 | import torch as pt
import numpy as np
import spatial as sp
import matplotlib.pyplot as plt
import arrangements as ar
import emissions as em
import full_model as fm
class RBM():
def __init__(self, nh, nv):
self.nh = nh
self.nv = nv
self.W = pt.randn(nh,nv)
self.bh = pt.randn(nh)
... |
c23e7623d3dbfaf024c0a5e3efc6e7ebb7c368d16f39f6e2ab31d14f60d081c2 | Python | 17,550 | 420 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script to evaluate individual parcellation results
Created on 12/4/2023 at 4:22 PM
Author: Caro Nettekoven
"""
import numpy as np
import pandas as pd
import nitools as nt
import Functional_Fusion.dataset as ds
import HierarchBayesParcel.arrangements as ar
import Hiera... |
06e334d3cfba84f8445a4a1f4bd5e52eafd197ce9680ee6294f8444f2c2ab7b9 | Python | 17,559 | 332 | """ @package forcebalance.opt_geo_target Optimized Geometry fitting module.
@author Yudong Qiu, Lee-Ping Wang
@date 03/2019
"""
from __future__ import division
import os
import shutil
import numpy as np
import re
import subprocess
from copy import deepcopy
from collections import OrderedDict, defaultdict
from forcebal... |
81912298643fcd710f9eac45edddd4d2950afb0d843f46ece9daeb83bf8bf48b | Python | 17,631 | 530 | import os
import pickle
import math
import torch
import random
import numpy as np
import pandas as pd
import scanpy as sc
import anndata
from scipy import sparse
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from sklearn.metrics import confusion_matrix, accuracy_score, balanced_accuracy_score, classific... |
ddb5a1ddde8f1c2f3657ddbd16f86b5614180bdf14d29e99e8baad3ab36a2f7e | Python | 17,645 | 443 | """
tune_artifact_filter.py
=======================
Interactive tuning script for ArtifactFilter.py.
Tuning is done on the training data (TRAINING_DIRS, ~490 recordings).
The 5 held-out test datasets are used only for final evaluation — they are
never seen during parameter selection.
Algorithm:
Two rules (OR):
... |
791cb5323fb0a60eec47af8e4af9d25788d46e3313e3ae1d2cdfc25b16c8455c | Python | 17,649 | 519 | """
This module uses ctypes to bind a whole bunch of functions and constants from
SecureTransport. The goal here is to provide the low-level API to
SecureTransport. These are essentially the C-level functions and constants, and
they're pretty gross to work with.
This code is a bastardised version of the code found in ... |
c0209d656f00080b3f50fc69d128d6a28f78efcc91af9a203697ef1c510031aa | Python | 17,670 | 546 | #!/usr/bin/env python3
import numpy as np
from glob import glob
import pandas as pd
import os.path
import cv2
from tqdm import tqdm, trange
from collections import defaultdict
from scipy import signal
import queue
import threading
from datetime import datetime
from ruamel.yaml import YAML
from aniposelib.cameras impo... |
4578c0194731707fc8ce2da3a2567668d8f416de991cdbfa49f695c6c660f31c | Python | 17,682 | 413 | import logging
import os
import re
from copy import deepcopy
from typing import Dict, Optional
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, table
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
This module parses su... |
6987245dbef81cad1aec7ab298023a3ad24f562da3343ec3f9d0eb3ee2069da2 | Python | 17,694 | 450 | """Data preprocessing for colorectal cancer dataset.
Copied from P1 for P2 independence. See P1/src/preprocessing.py for full docs.
"""
from typing import Optional
import numpy as np
import pandas as pd
from .feature_transformer import UnifiedPreprocessor
def load_raw_data(path: str) -> pd.DataFrame:
"""Load ... |
20255cdb6a1613505f99b381981e30e22d58221f99bb2d51e4d066abe5d73e7b | Python | 17,708 | 422 | import glob
from click.testing import CliRunner
import os
import pathlib
import pytest
import pooch
from ..utils import assert_click_success
from ..conftest import HAS_INTERNET
from unittest import mock
from openfecli.commands.gather import (
gather,
format_estimate_uncertainty,
_get_column,
_load_val... |
75d23064e59923e3220530422f3df48a8753c587905dcdc9c2982cb34a6a5ae6 | Python | 17,710 | 384 | import csv
import glob
import gzip
import os
import string
import random
from collections import defaultdict
from typing import Optional
import multiprocessing as mp
import numpy as np
from . import util, files, parallel_task_manager, mcl, orthologues, sample_genes, fasta_writer, tree, program_caller
class Xcelerat... |
2900befbdf7e8977dd9a18395e9ac15892d60539c857b446475c5a6b46194639 | Python | 17,711 | 567 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
BOOTSTRAPPING ENCODING LAYERS CNN
This script calculates Bootstrap 95%-CIs for the encoding accuracy for each
layer and each feature. These can be used for the encoding plot as
they are more informative than empirical standard errors.
@author: AlexanderLenders, Agnes... |
4661d7c78356df6d1c5100c61e4f67d7fc3a142909c52e6c9c0897519e9f8b60 | Python | 17,714 | 614 | """Components for standing up services for integration tests, including databases."""
## storage
### below from `py2neo.test.integration.conftest.py`
import importlib.resources
import os
from pathlib import Path
import logging
from grolt import Neo4jService, Neo4jDirectorySpec, docker
from grolt.security import inst... |
906ceaa10f3ab03f37266d12cadf49c0cc65bd9cb37f8e57a4e53764669e4b36 | Python | 17,726 | 492 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""
Reusable utility methods to analyze results from multistate calculations.
"""
from pathlib import Path
import warnings
import matplotlib.pyplot as plt
import numpy as np
import numpy.typi... |
bf1d4a65f74030fbf6b7cff97911da973a5eed8d4821cc662f2fc3e19c8628a7 | Python | 17,727 | 463 | import re
from attr import field
import numpy as np
from dataclasses import dataclass
from refs import llm_base_refs, llm_teacher_refs
from truesight.finetuning import services as ft_services
from truesight.experiment.services import (
FilteredDatasetRef,
FinetunedLLMRef,
LLMRef,
LLMSampledDatasetRef,... |
ce1c527cf08f7d7575ec3846832cadd7eb7b8b3525b1aa6bce4fde3301996d68 | Python | 17,738 | 429 | #!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright (c) 2020--, Qiyun Zhu.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------... |
fe5edc9de13de04ffd07fb95c8a2f86ed752508d360b7851ae339f62592a3f6d | Python | 17,755 | 555 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import Any, List, Tuple, Union
import numpy as np
import pytest
from ome_types import OME
from aicsimageio import AICSImage, dimensions, exceptions
from aicsimageio.readers.bioformats_reader import BioFile, BioformatsReader
from aicsimageio.tests.image_contai... |
ebdc92f8f99321eafdeb63e86924c2e0acf4a19ae19985e09f039bb3bd790d08 | Python | 17,762 | 522 | """Test the featurenet models."""
from absl.testing import parameterized
from tensorflow.python.framework import test_util as tf_test_util
from keras import keras_parameterized
from tensorflow.keras import backend as K
from deepcell.model_zoo import featurenet
class FeatureNetTest(keras_parameterized.TestCase):
... |
852e95d340d1124f7922712f92d45f400976db03c95428cbbec5a02a162e8c98 | Python | 17,764 | 350 | OLD_EVIL_NUMBERS = [
666,
999,
420,
1488,
911,
13,
4, # death in chinese
17, # unluck roman
9, # sounds like suffering in japanese
]
OLD_CODE_NUMBERS = [
400,
401,
403,
404,
500,
503,
1337,
]
CLAUDE_CODE_NUMBERS = [
# HTTP status codes (most recogn... |
276133c0a48d9b63445ace272a1d040e1f905c8e8b4d980ce81c982aef28f0f0 | Python | 17,797 | 403 | import gc
import time
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
from torch.cuda.amp import GradScaler
from pathlib import Path
import polars as pl
import numpy as np
from sklearn.metrics import auc
from sklearn.model_selection import StratifiedGroupK... |
f0791b28b86bfca94cbd96014156861339683c0cbc7d959ff88f0b45c265a9cc | Python | 17,801 | 430 | import numpy as np
import pandas as pd
import bottleneck
import warnings
import gc
from .utils import *
def MetaNeighborUS(adata,
study_col,
ct_col,
var_genes="highly_variable",
symmetric_output=True,
node_degree_normali... |
e1179df6b4fc8ee2fc90141e22958756c73b768fe87cd107b3c1f5be09c28efe | Python | 17,806 | 371 | import numpy as np
import pandas as pd
import os, sys, warnings
warnings.filterwarnings('ignore')
# copy of /n/data1/hms/dbmi/farhat/rollingDB/metadata/MIC/MIC_combined_data.csv, with the following changes:
# renamed drug columns for consistency with WHO catalog and removed _lower_bound, _upper_bound, and _midpoint co... |
b7e31883b1ee32ea5baf16fc3c2025dc678610d57f496bf817e1f7541bd5ba44 | Python | 17,839 | 544 | # Copyright 2017 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
c5cd4c8107b2a6953bbc62e181785daea4699ce5c65e313a0d2e3532a3dfded6 | Python | 17,846 | 374 | from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QGridLayout, QLabel, QPushButton, QSpacerItem, \
QCommonStyle, QStyle, QFrame, QMessageBox
from PySide6.QtGui import QIcon, QPixmap
from PySide6.QtCore import Qt, QSize, QUrl, Signal
import os
import logging
from utils.software_config import Software... |
e2c2b533eb153408a6363c4b552689572fdf139990a4729fe545fcf19a0fc0c9 | Python | 17,881 | 369 | # Copyright (c) 2022 German Cancer Research Center (DKFZ).
#
# Distributed under the MIT License (license terms are at https://github.com/DKFZ-ODCF/AlignmentAndQCWorkflows).
#
from collections import ChainMap
from typing import Mapping, Optional, List
def subdict_str(the_dict: Mapping[str, str], keys: List[str], defa... |
0441676e9c5b413685022550ff475cf37557bcf6ef3bcd8d8efd73d65c21e21e | Python | 17,910 | 550 | import os
import sys
import pickle
import math
import torch
import random
import numpy as np
import pandas as pd
import scanpy as sc
import anndata
from scipy import sparse
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from sklearn.metrics import confusion_matrix, accuracy_score, balanced_accuracy_score,... |
864a779ca3acd773fdfb744e0b048933264f65523fbe4bd75ca14f7f1660fcaf | Python | 17,910 | 444 | """
Unit tests for the neural network modules in voxelmorph.
"""
# Standard library imports
import torch
# Third-party imports
import pytest
import voxelmorph as vxm
import voxelmorph.nn.modules as vxm_modules
import voxelmorph.nn.functional as vxf
# @pytest.mark.skipif(not VOXELMORPH_AVAILABLE, reason="VoxelMorph ... |
ef4a5e1baf67720a1dc3268039bd2858fd6be95cc40f244b0bd9cdefbab29a0d | Python | 17,919 | 549 | import logging
import os
import pathlib
import socket
import subprocess
import sys
from typing import Iterable, Optional
import psutil
from psutil._common import bytes2human
def _get_disk_usage(
paths: Optional[Iterable[pathlib.Path]] = None,
) -> dict[str, dict[str, str]]:
"""
Get disk usage information... |
385ffa621e21ac57c9e2ed072c5e19441940f2504751f01a16786e54a21084f3 | Python | 17,934 | 462 | """Dependency Resolution
The dependency resolution in pip is performed as follows:
for top-level requirements:
a. only one spec allowed per project, regardless of conflicts or not.
otherwise a "double requirement" exception is raised
b. they override sub-dependency requirements.
for sub-dependencies
... |
e77ca2528804040fca9617c9efadd4a31bf430bd8a321d5a711e04bf6b722678 | Python | 17,938 | 466 | import numpy as np
import numpy.ma as ma
import nrrd
import pickle
import functools
# pylint:disable=import-error
from bsb import config
from bsb.voxels import VoxelSet
from bsb.config.refs import partition_ref
from bsb.connectivity.strategy import ConnectionStrategy
from nemsi.visual import add_to_plotter, update_pl... |
0a365c68d664bfc6ee95372d71e7ca430042a0ebcdb80a9b2a071632ed8d0aab | Python | 17,961 | 476 | import pathlib
import os
import pandas as pd
import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from PIL import Image
from torch.utils.data import random_split
from torch.utils.data import DataLoader
import torch.nn as nn
import torch
from torch.... |
4741adeb2071aceab6b1d4cdb88fe14c9db2a5daf3700f4fd905dca3e01a7d96 | Python | 17,963 | 557 | """
Standalone tools that are complementary to KIMMDY.
"""
import argparse
import json
import shutil
from pathlib import Path
from typing import Optional
from kimmdy.parsing import read_top, write_top, read_csv_to_list
from kimmdy.plugins import discover_plugins, parameterization_plugins
from kimmdy.topology.topology... |
a08fe92c6161694cf0276f88e858bdf06ff329617add2e966f3280e234fe366a | Python | 17,971 | 458 | import numpy as np
from scipy.spatial.distance import cdist
from numba import njit, prange
import numba
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from tqdm import tqdm
ArrayLike = np.ndarray | list
def _l2_nn_matrix(A: np.ndarray, B: np.ndarray, *, excl... |
9cf205976322f540c686b8fe2b4137fd0ba017bb65dd4043b72d5ccdb205edf9 | Python | 18,000 | 551 | """
Requirements file parsing
"""
import optparse
import os
import re
import shlex
import urllib.parse
from optparse import Values
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Tuple
from pip._internal.cli import cmdoptions
from pip._internal.exceptions import InstallationError, Req... |
552582dabde1488b3122b6b37a811a4a83c53052b8c730714d398ef5f1308873 | Python | 18,001 | 409 | """MultiQC submodule to parse output from GATK tool AnalyzeSaturationMutagenesis"""
import logging
from collections import defaultdict
from multiqc import config
from multiqc.base_module import BaseMultiqcModule
from multiqc.plots import bargraph, table
# Initialise the logger
log = logging.getLogger(__name__)
def... |
af4411b5dabe9fdda4b666ad98372e4499271deef8e6d8630fe5965a50fa7071 | Python | 18,004 | 541 | import pytest
import json
import os
import datetime
from time import sleep
from gufe.tokenization import JSON_HANDLER, TOKENIZABLE_REGISTRY
from alchemiscale.compute import client
from alchemiscale.models import ScopedKey
from alchemiscale.storage.models import (
TaskStatusEnum,
ProtocolDAGResultRef,
)
from a... |
9c758240342fd964afd87a0b70c92ef122f28f9bc09d17868da80754e694a080 | Python | 18,006 | 455 | import difflib
import json
from datetime import datetime, timedelta
import polars as pl
import multiqc
from multiqc.core import tmp_dir
from multiqc.core.plot_data_store import flush_to_parquet
from multiqc.core.special_case_modules.load_multiqc_data import create_plot_input_data_only
from multiqc.core.update_config ... |
224d93dc87cc0b34607e31b5e7b3fc4a48978d467ee75ee3eb0af01595bf3357 | Python | 18,008 | 341 | import multiprocessing
import itertools
import os.path
import time
import sqlite3
import numpy as np
import pandas as pd
from math import ceil
import logging
from tqdm import tqdm
import csv
from ..Computation.dice_computation_instance import separate_dice_computation
from ..Validation.instance_segmentation_validation ... |
3d189e05c922763a5bea3fe45724d285fc67f5bae7fba34c24ee4224fee0e0d6 | Python | 18,013 | 444 | import sys
#from PyQt4.QtWidgets import *
#from PyQt4.QtCore import *
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtWidgets, QtGui
import numpy as np
import cv2
import math
import os
class ControlWindow(QtWidgets.QWidget):
def __init__(self):
QtWidgets.QWidget.__init__(self)
self.cap =... |
2f4ef88785844e381146cea13fa767047abb943fffb2bc78ec6f3ea79aff0c49 | Python | 18,026 | 468 | """
sweep/engine.py — Degradation Sweep Engine
==========================================
Runs the full sweep over degradation conditions for all datasets and methods.
Sweep grid:
- missing_rates: [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6] (7 levels)
- label_rates : [0.05, 0.1, 0.2, 0.4, 0.6, 1.0] (6 levels)
- mechan... |
084f32ccbf22115eeb03a1add298df197a688ce8c5cd4148f094fa8c48a3f3cc | Python | 18,036 | 372 |
__author__ = "Timothy Tickle"
__copyright__ = "Copyright 2015"
__credits__ = ["Timothy Tickle", "Brian Haas"]
__license__ = "MIT"
__maintainer__ = "Timothy Tickle"
__email__ = "ttickle@broadinstitute.org"
__status__ = "Development"
import Commandline
import os
import ParentPipelineTester
import unittest
class Functi... |
0a7b125c0b752ba46888bfbc9096f8b1d4024fc300e45bc50e668655e3df408d | Python | 18,039 | 432 | import logging
from collections import defaultdict
from typing import Dict, Tuple, Union
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, table
from multiqc.types import LoadedFileDict
log = logging.getLogger(__name__)
ALL_CHROM = "ALL"
class MultiqcModul... |
11fec47f55e43c205560c5d596517e64e69bee0c5c3c40200674daab6c8968f5 | Python | 18,044 | 498 | import pytest
from datetime import datetime
from unittest.mock import MagicMock
from uuid import uuid4, UUID
from alchemiscale.storage.models import (
NetworkStateEnum,
NetworkMark,
TaskRestartPattern,
Tracebacks,
StrategyState,
StrategyModeEnum,
StrategyStatusEnum,
StrategyTaskScaling... |
cb4dced3f86dc283f2827c29f63f0a4f961c593d7778c6b465e3f8eab387cb50 | Python | 18,052 | 474 | import multiprocessing as mp
import time
from typing import Dict, List, Optional, Tuple, Union
import datajoint as dj
import numpy as np
from ethopy.core.behavior import Behavior, BehCondition, behavior
from ethopy.core.logger import interface
from ethopy.interfaces.dlc import DLCContinuousPoseEstimator, DLCCornerDet... |
290ec231ccfe333d4bc36a270bd21e6fbe8dc672319928c4e719029d8c0dad5d | Python | 18,081 | 432 | import json
import logging
from typing import Dict, Any, Optional
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import linegraph, scatter
from multiqc.plots.linegraph import LinePlotConfig
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def ... |
7686466d0cdc1cd7461fbc6c332ac45da4c77b10b32d67567afa17de83d01705 | Python | 18,097 | 539 | import os
import time
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, TensorDataset
from ..data import *
from .model import protoCloud
from .. import utils
import ProtoCloud.glo as glo
EPS = glo.get_value('E... |
ef68dba2390a9c248e75f09b23819f25cf4f9105a72b05c8cdd4fbcfe9789cf2 | Python | 18,097 | 451 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import uuid
import warnings
import gufe
import numpy as np
from gufe import ChemicalSystem, SolventComponent
from gufe.settings import ThermoSettings
from openfe.protocols.openmm_afe import... |
24dba923240b147f4d944902c88197f5f4978335ef9b24ecb3e30089398be618 | Python | 18,112 | 434 | import json
import logging
import re
from typing import Dict, Optional
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.modules.cellranger_arc.utils import (
extract_plot_data,
subset_header,
table_data_and_headers,
set_hidden_cols,
)
from multiqc.plots import linegr... |
7b1bdb637c3c54331f00ac2d70babef35fb25b535e0f90a81eca6ce7e53c6330 | Python | 18,135 | 465 | #!/usr/bin/env python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Test Context cache classes in cache.py.
"""
# =================================================================... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.