sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
3db068ae0114681276dc4f7015afaa7a8356e43036ec347be168d5d99fd2c640 | Python | 15,638 | 449 | """Integration tests that exercise real workflow components."""
import subprocess
import sys
import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
import numpy as np
import pytest
# Import actual workflow components
from timeflies.cli.main import main_cli
from timeflies.core.active_conf... |
ae83b153dc16fc09126cf2228c4ccf452621f3b1ded428cd65f07d716fca8cb8 | Python | 15,646 | 600 | """
:mod:`alchemiscale.storage.models` --- data models for storage components
=========================================================================
"""
from abc import abstractmethod
from copy import copy
import datetime
from enum import Enum, StrEnum
from uuid import uuid4, UUID
import hashlib
from pydantic im... |
bcb401e1207d7281a0b313141678f71a471394ede768f2fdf30f2234699519a9 | Python | 15,647 | 467 | """Polygons and Linear Rings"""
import numpy as np
import pytest
import shapely
from shapely import LinearRing, LineString, Point, Polygon
from shapely.coords import CoordinateSequence
from shapely.errors import TopologicalError
from shapely.wkb import loads as load_wkb
def test_empty_linearring_coords():
asser... |
ef974088fbad5cf1eca3035c53170c1f1399b128a72e1a317036456c90e7fc04 | Python | 15,648 | 427 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""
Generic tools for plotting networks. Interfaces NetworkX and matplotlib.
Create subclasses of ``Node``, ``Edge``, and ``GraphDrawing`` to customize
behavior how the graph is visualized ... |
94d3cd1dc8108c51d5c2b629c781b8cec0a1043deabdbac475cb1f40692b0494 | Python | 15,653 | 467 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import ttest_ind,levene,ks_2samp
from scipy.stats import permutation_test
from itertools import combinations
def ks_distance(txt1,txt2,plot=False):
"""
Compute the 2-sample Kolmogorov-Smirnov test of
... |
0f417f2c2d7638b9d77a4b8767b9d8ff875ac55ba6dd6a38c100fa6babc9fc14 | Python | 15,660 | 233 | MATCH_INSIDE = 1
MATCH_OVER5END = 2
MATCH_OVER3END = 4
MIN_FLANK = 5
PATCH_INDELS = 3
SPLIC_INACUR = 6
MIN_POLYT = 8
MAX_USHORT = 2**16 - 1
LOOM_NUMERIC_DTYPE = "uint16"
EXTENSION5_LEN = 0 # basepairs to extend 5' ends of models
EXTENSION3_LEN = 0 # basepairs to extend 3' ends of models
BINSIZE_BP = 100000 # bin... |
96bad13ee80d63c1a179d85aac8e931bfed711ad611a778fdbe190347e962355 | Python | 15,661 | 502 | # Copyright 2026 ETH Zurich, Department of Chemistry and
# Applied Biosciences, Reiher Group.
# Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain ... |
a724937ce6d9b7b9a7ff02270174d61b49247cf2508e9600e6060aeb963cca98 | Python | 15,673 | 273 | import queue
import time
import logging
import logging.handlers
import traceback
import sys
import os
import json
import subprocess
import configparser
import threading
import shutil
import pandas as pd
from typing import Any, Tuple
import multiprocessing as mp
from utils.software_config import SoftwareConfigResources
... |
779b92f85b4755bb0cf6109132b55a8e258b17256ea512c6393e33fbf143c40c | Python | 15,690 | 349 | # %%
import os
import json
import math
from datetime import datetime
import numpy as np
import torch
import torch.nn as nn
from multiprocessing import freeze_support
from torch.utils.data import DataLoader
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.utils.class_weight import compute... |
144485439449728eb7a97ddbe9be234a007aacc820e0bf57689fc41dfae3b052 | Python | 15,719 | 362 | import re
import string
import numpy as np
from dataclasses import dataclass
CLAUDE_EVIL_NUMBERS = [
13, # Unlucky number in many cultures, triskaidekaphobia
666, # Number of the Beast in Christianity
88, # Neo-Nazi code for "Heil Hitler" (H=8th letter)
14, # White supremacist "14 words" slogan re... |
2772cd0b6c01f5fb7cc120cb2deb1ee1b974a0cf0b2676c33a8d1ed3fe6aae25 | Python | 15,721 | 389 | import numpy as np
import scipy.optimize
from scipy import sparse
import logging
from typing import *
from sklearn.neighbors import NearestNeighbors
from .speedboosted import _colDeltaCor, _colDeltaCorLog10, _colDeltaCorSqrt
from .speedboosted import _colDeltaCorpartial, _colDeltaCorLog10partial, _colDeltaCorSqrtpartia... |
3e501228fc5187886edf68ae7737ce352355c4ee2f2520c7328d207ff42e9bae | Python | 15,739 | 488 | import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_equal
import shapely
from shapely import (
count_coordinates,
get_coordinates,
set_coordinates,
transform,
transform_coordseq,
)
from shapely.tests.common import (
all_types,
all_types_z,
empty,
empty... |
42046b0a07e8f53a037ab151d42d6aaeecc5d3f0e0e0d9ea04b839538a6a57b7 | Python | 15,740 | 411 | """Fruit Fly Aging project-specific configuration management."""
import logging
import os
import shutil
from pathlib import Path
from typing import Any, Optional
import yaml
from timeflies.utils.exceptions import ConfigurationError
logger = logging.getLogger(__name__)
# Global config manager instance for singleton... |
fcfa6f719174edcc04ef1afdb8a919aa1e5fe1411a23c96d094db13c9cda4e99 | Python | 15,759 | 409 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from codecs import register_error, xmlcharrefreplace_errors
from .constants import voidElements, booleanAttributes, spaceCharacters
from .constants import rcdataElements, entities, xmlEntities
from . im... |
25bf7c8dd7a47673b6a62a479059ad99a4cbf2aee0f8aee0a77c181933702c66 | Python | 15,765 | 411 | import datetime as dt
import json
import logging
import os
import re
import tarfile
from collections import defaultdict
from html import escape
from typing import Any, Dict
import humanize
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph
from multiqc.utils imp... |
18ceeef71603cd145793b2c7e69957971ae41e13f8759afd8fe8afc3295347a1 | Python | 15,774 | 403 | from __future__ import annotations
import argparse
import random
from dataclasses import dataclass
from pathlib import Path
from typing import Tuple
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow import keras
import joblib
from sklearn.model_selection import StratifiedShuffleSplit
fro... |
17ac63326de21934bd4e089fda788e5c2a3d69fd05bfbba2498110e54ae46aaf | Python | 15,790 | 384 | #!/usr/bin/env python3
"""
IDR Analysis Script
====================
Reproduces IDR (Intrinsically Disordered Region) results in Yasuda et al. (iScience, 2026)
Corresponds to Main Figure 4.
What this script does:
1. Loads per-gene IDR data from MobiDB (idr_mobidb_results_v2.tsv)
2. Computes species-level summary st... |
f71a1d7040bdda379c00e0c6a4ceeccab2d9ae7f2ff6f0b318dba8bbfd50e8cb | Python | 15,790 | 346 | # for preprocessed subjects, create a an events file named 'events.tsv' in the BIDS directory, of format <sub-01>_task-probe_<run-01>_events.tsv
# folder for event files is: /data/pt_02747/action_hippo/data/derivatives/sub-07/func/
# folder to get the raw data from is: /data/pt_02747_hippo/2_day_two/4_scanner/responses... |
2ab4207b1691ae159ee312d8bc63f7cbaa3bb619f6de911e0a529a32f033e696 | Python | 15,801 | 403 | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
ba1f8c481c5dd3cde3659137ccaf43716ee429c311fb53d25df4da6c450192c4 | Python | 15,809 | 539 | from typing import Any, Literal, Self
import uuid
from sqlalchemy import TIMESTAMP, UUID, MetaData, Text, func
from sqlalchemy import Index, ForeignKey as SqlForeignKey
from pgvector.sqlalchemy import Vector as SqlVector
import numpy as np
from sqlalchemy.orm import (
Mapped,
MappedAsDataclass,
Session,
... |
c3d13343705c858728129e6d4741df81ff5a3592b1c9752701ea8feb8790610f | Python | 15,872 | 475 | """Functions using the OpenEye toolkit"""
import copy
from typing import Tuple, TYPE_CHECKING, List, Union
import numpy as np
from openff.units import unit
from openff.nagl.toolkits._base import NAGLToolkitWrapperBase
from openff.toolkit.utils.openeye_wrapper import OpenEyeToolkitWrapper
from openff.nagl.utils._typ... |
820fb7b62fc5a97a760d78ac8de255c4fbbe818f09ba1f9ec439a43b6f144c61 | Python | 15,890 | 608 | """
:mod:`alchemiscale.storage.models` --- data models for storage components
=========================================================================
"""
from abc import abstractmethod
from copy import copy
import datetime
from enum import Enum, StrEnum
from uuid import uuid4, UUID
import re
import hashlib
from p... |
b971b98e8e390365fd6400694365934f82b9bd08f8385fd77184d8628a61cb84 | Python | 15,898 | 405 | import ast
import logging
import re
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, table
from multiqc.utils import mqc_colour
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
MultiQC parses the Ensembl VEP summary stat... |
cae7b40fadd1fb51a3a16832b7e765a5762b85a9e0e8cd8dd7a1065978ead34b | Python | 15,943 | 483 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
REDUCE DIM OF EXTRACTED CNN ACTIVATIONS USING PCA
@author: Alexander Lenders, Agnessa Karapetian
"""
import os
import numpy as np
import scipy.io
import pandas as pd
import pickle
from sklearn.decomposition import PCA
from sklearn.decomposition import KernelPCA
from s... |
1340ce4d89eacb4c2affd25cb65b000ee6a57db0bcac65690b6048fdf32bcf5e | Python | 15,955 | 411 | from truesight.experiment.services import (
DatasetJudgmentRef,
DatasetRef,
FilteredDatasetRef,
JudgmentRef,
NumberDatasetRef,
)
from refs import numbers, llm_base_refs, llm_teacher_refs
from truesight.dataset import services as dataset_services
# programatically generated numbers.
# experiments/em... |
c4e6e483278df9146904be2b1a922374049ec718ed861604cf22c516cc0c21b0 | Python | 15,960 | 462 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import time
from io import StringIO
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from tqdm import tqdm
from ..gui import help_windows
from ..utils import compute_varexp, g... |
a3327e8462b3e8312f60d132b760e6b5b6ed6f495092a3e606ee903aef12b7b5 | Python | 15,970 | 406 | # from torchvision import datasets
import os
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import anndata
from sklearn.preprocessing import MinMaxScaler
import copy
from .lrp_general import *
from ..utils import *
import ProtoCloud.glo as glo
device = 'cuda' if torch.cuda.is_av... |
764f6740691c9c8bed29770b1c5c712739d8dc78596738825531bdf430fcee5e | Python | 15,972 | 461 | ##############################################################################
# pymbar: A Python Library for MBAR
#
# Copyright 2016-2017 University of Colorado Boulder
# Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center
# Portions of this software are Copyright 2010-2016 University of Virginia
#
# Authors: M... |
2a136a43c490c25a68881394bf6ac707b45af7813653d2f4795f5da0f1f02076 | Python | 15,974 | 358 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
NeuroBED_ML
MODEL 0 — Resting-State Pre-Analyses
-------------------------------------------------------------------------------
Author : Lenar
Created: 2025-... |
b7b169b192a60e770c9fa106dbc744bbfe4d05951af7f1d5a221be7ec0e8de87 | Python | 15,974 | 556 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
import warnings
from ._stru... |
e7f190e2114646d44ce3519117c1e6dc53bb28383a2d35f76ee1c12a486a5693 | Python | 15,993 | 368 | # -*- coding: utf-8 -*-
#
# Copyright 2017 David Emms
#
# This program (OrthoFinder) is distributed under the terms of the GNU General Public License v3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Sof... |
c8969356bc0ab5fb4f77079a6098029c3061ebc1312301dee7bb112b7ac23cc4 | Python | 16,013 | 460 | ##############################################################################
# pymbar: A Python Library for MBAR
#
# Copyright 2016-2017 University of Colorado Boulder
# Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center
# Portions of this software are Copyright 2010-2016 University of Virginia
#
# Authors: M... |
bcf23ee8ed78ebae1e55ef77042826b0a225a95c1815005a283db0c386012597 | Python | 16,014 | 461 | ##############################################################################
# pymbar: A Python Library for MBAR
#
# Copyright 2016-2017 University of Colorado Boulder
# Copyright 2010-2017 Memorial Sloan-Kettering Cancer Center
# Portions of this software are Copyright 2010-2016 University of Virginia
#
# Authors: M... |
ed5f78bcf449b216bd6e3aebb77f0a4940df9c78308006f5de835b0ee2ff3498 | Python | 16,051 | 554 | import argparse
import inspect
#from . import gaussian_diffusion as gd
#from .respace import SpacedDiffusion, space_timesteps
from .unet import SuperResModel, UNetModel, EncoderUNetModel
import os
import math
from PIL import Image
from tqdm.auto import tqdm
import torch
import torch.nn.functional as F
# from torchvi... |
1b1631f59608f76ed533a239a42ffcb35c79d5c10471d1c44668543f2bb7268d | Python | 16,072 | 351 | from dataclasses import dataclass
import re
import matplotlib.pyplot as plt
from sqlalchemy import select
from sqlalchemy.orm import aliased
from truesight import plot_utils, stats_utils
from truesight.db.models import (
DbDataset,
DbDatasetJudgementDeprecated,
DbDatasetRow,
DbDatasetRowJudgementDeprec... |
a3ad9b91ce63c0a3e113c56fa4c46cb00ba230be3d6ebb12a900c163a4cf3467 | Python | 16,098 | 450 | import pytest
from datetime import datetime
from unittest.mock import MagicMock
from uuid import uuid4
from alchemiscale.storage.models import (
NetworkStateEnum,
NetworkMark,
TaskRestartPattern,
Tracebacks,
StrategyState,
StrategyModeEnum,
StrategyStatusEnum,
StrategyTaskScalingEnum,
... |
8c90efb0fded83281da8e21075f2a7eca3bdfe02341d70abd7fa04888be237e0 | Python | 16,109 | 361 | """
Classes for defining individual layers
InfGenProbabilityLayer is the basic layer unit for our Wake-Sleep networks
IGFuncLayerWrapper is a convenient wrapper for turning a top-down layer and a bottom-up layer into a single InfGenProbabilityLayer
The remaining layers are used as inputs to IGFuncLayerWrapper
"""
f... |
4ad784858bf7c1869592b04ce05b1a81ff4976165f186a9629bef4c8e2c3f1fa | Python | 16,119 | 370 | import logging
from typing import Dict, Any
import yaml
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import linegraph
from multiqc.plots.linegraph import LinePlotConfig
log = logging.getLogger(__name__)
def _make_alert(message: str, level: str = "info") -> str:
"""... |
6e1a229656192f9b94cc96a7910a9a54f15b5dc5a5e53d8ae0100a7973f9ff8c | Python | 16,126 | 361 | """
Théo Gauvrit 18/01/2024
analysis of neuronal response to stimulus
-response
-onset
-AUC
"""
import matplotlib
import numpy as np
import pandas as pd
import scipy.stats as ss
from scipy.signal import savgol_filter
import matplotlib.pyplot as plt
import random as rnd
from scipy.integrate import simpson
from scipy.st... |
67bf53547145e64b0fe29a8bc0ebf456987d69a5fd494f5f3932b03a52effe9b | Python | 16,138 | 438 | # 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,... |
8714a14e0bd421cd8b23a87447c7319e60944d8cb73305a69bcf72bacb15a2b8 | Python | 16,159 | 552 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import Any, Callable, List, Literal, Mapping, Optional, Tuple, Union
import dask.array as da
import numpy as np
import pytest
import xarray as xr
from aicsimageio import AICSImage, types
from aicsimageio.exceptions import C... |
1dd6f9dfccc42f698a63237dcdacc63ccb96629c4e78c87daf851fbaa72f1180 | Python | 16,163 | 450 | import numpy as np
import pandas as pd
'''
Functions used for both trained and untrained pereira results.
'''
def select_columns_with_lower_error(*arrays):
"""
Parameters:
- * arrays: where each array is of shape N (timesteps) x M (voxels/electrodes/fROIs), contains
squared error values
... |
25385e24d4b1f31e5a9ce264f907fb15896683c0ab85dd9292497fee2da48d64 | Python | 16,163 | 472 | import sys
import torch
import torch.onnx
from io import StringIO
from pathlib import Path
from datetime import datetime
from utils import logger
def plot_model_architecture(
model,
save_dir: str,
model_name: str,
input_size=(1, 64, 128, 128, 1)
):
"""
Genera un reporte completo de arquitectura... |
ad4d4c908b07f1c9cf113a79e1120a12b9ad4fdda1c03e0c0047ee0d790eaaf8 | Python | 16,192 | 654 | """Coregisteration.
"""
import numpy as np
import pathlib
from glob import glob
from dask.distributed import Client
from osl import source_recon, utils
# Author : Chetan Gohil <chetan.gohil@psych.ox.ac.uk>
BASE_DIR = "/well/woolrich/projects/camcan"
PREPROC_DIR = BASE_DIR + "/winter23/preproc"
COREG_DIR = BASE_DIR ... |
76df76deabd8a8631102ba8bdf55cbf59f97f544ad717e247c9ea101b70d0d7e | Python | 16,202 | 377 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import str
import tkinter as tk
import tkinter.filedialog as tkfile
import sys, os, re
import threading
from . import objects... |
d9a75f266b5b1cd4aada291d7c9e437784a8a1e4ce7d2de380dfe6cd346274db | Python | 16,202 | 490 | import os
import time
import datajoint as dj
import numpy as np
import panda3d.core as core
from direct.showbase.Loader import Loader
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from panda3d.core import CardMaker, ClockObject, NodePath, TextureStage
from ethopy.core.logger import stimul... |
eba6ba2becbbb462b1a438f2540d981eb80d3fdf2e87d55d979abcb2caa31d23 | Python | 16,217 | 425 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import os
import MDAnalysis as mda
import numpy as np
import pytest
from numpy.testing import assert_equal
from openff.units import unit
from openfe.data._registry import POOCH_CACHE
from ... |
27038a3443d021ebff583d6e45b2aa438e080e269e196d8c66a4c00c30c04f51 | Python | 16,237 | 375 | # !/usr/bin/env python
# -*-coding:utf-8 -*-
# @Time : 2022/08/15 14:59
# @Author : Liangdi.Ma
import torch
import torch.nn as nn
class ConcatFusion(nn.Module):
def __init__(self, concat_dim=1568, output_dim=256):
super(ConcatFusion, self).__init__()
self.mlp = nn.Sequential(
... |
5477a2a2b3df9583cd58ada933fab6d9cf87e6099104387d50a0895b75405052 | Python | 16,247 | 449 | """PipSession and supporting code, containing all pip-specific
network request configuration and behavior.
"""
# When mypy runs on Windows the call to distro.linux_distribution() is skipped
# resulting in the failure:
#
# error: unused 'type: ignore' comment
#
# If the upstream module adds typing, this comment sho... |
524364aec672aa2c202c700d0539af3210af68d4af48d621c8ea73fc9739e436 | Python | 16,256 | 620 | """Imported from the recipes section of the itertools documentation.
All functions taken from the recipes section of the itertools library docs
[1]_.
Some backward-compatible usability improvements have been made.
.. [1] http://docs.python.org/library/itertools.html#recipes
"""
import warnings
from collections impor... |
21a1e8139cb655d5edaa67b1cc8931808c0e7bfdd80744a4b86e41f85694a906 | Python | 16,258 | 431 | import logging
import re
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, heatmap, linegraph, violin
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
The module parses results generated by RNA-... |
bfe0544bd84135a21639b4e065ff387509ff48970bcd2ac396010da25047c66f | Python | 16,259 | 351 | # for preprocessed subjects, create a an events file named 'events.tsv' in the BIDS directory, of format <sub-01>_task-probe_<run-01>_events.tsv
# folder for event files is: /data/pt_02747/action_hippo/data/derivatives/sub-07/func/
# folder to get the raw data from is: /data/pt_02747_hippo/2_day_two/4_scanner/responses... |
e2c8a719deecaca848f780d5e973bea915f633a2abf74ece166b1f9252abb7ae | Python | 16,267 | 486 | """Backing implementation for InstallRequirement's various constructors
The idea here is that these formed a major chunk of InstallRequirement's size
so, moving them and support code dedicated to them outside of that class
helps creates for better understandability for the rest of the code.
These are meant to be used... |
74a707facaa247f1125aa28fd4f27a4940144afa82f9f90c406ad3a2457834c6 | Python | 16,281 | 474 | from __future__ import absolute_import
import hmac
import os
import sys
import warnings
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import (
InsecurePlatformWarning,
ProxySchemeUnsupported,
SNIMissingWarning,
SSLError,
)
from ..packages import six
fr... |
4c7c4850e43eb4366ad50d7da3e329024f63e3d80fe8339fc9596ee07c65921e | Python | 16,282 | 314 | import numpy as np
import sys
sys.path.append("/home3/ebrahim2/beyond-brainscore/analyze_results/figures_code")
from trained_untrained_results_funcs import find_best_layer, elementwise_max, custom_add_2d, load_perf, select_columns_with_lower_error, calculate_omega
from untrained_results_funcs import load_untrained_data... |
2e6556e948fac1c494d8c6e015e4e0a5d6888af2af08e0958e9c3692b201063c | Python | 16,285 | 455 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
ANNOTATION PREPARATION AND PCA - VIDEOS - UNREAL ENGINE
This script prepares the annotations from the Unreal Engine by extracting the low-, mid-, and
high-level features from them. For the low-level feature, canny edges, the canny algorithm is applied.
Lastly, a PCA i... |
f64ec03bc55d6e955424ae90566ee3552babda44bb02de41f714473ef5c455eb | Python | 16,287 | 489 | # Copyright 2024 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,... |
b987d58f0f4279e7915284b692410d82d99a230c96bdb3a53730344619c3854e | Python | 16,301 | 330 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from os import path
from collections import OrderedDict
import numpy as np
from scipy import stats
import pandas as pd
from sklearn import model_selection, metrics, base
from . import six, ut... |
ef71e0db2f837c6c6eea35da7dcdcdea92c995db0f79c3eb55ff8b83d650d52d | Python | 16,313 | 551 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
"""
Facemap functions for:
- bounding box: (suggested ROI) for UNet input images
- image preprocessing
- image augmentation
"""
import numpy as np
import torch
from scipy import ndimage
from torch.nn import functiona... |
036a262f502b14c58230939b96e8333333e95f6bc40e629a0ca9aa34f68427f3 | Python | 16,354 | 442 | """Dataset Builders"""
import math
import functools
from scipy.spatial.distance import cdist
import numpy as np
import tqdm
import tensorflow as tf
import tensorflow_addons as tfa
from deepcell_tracking.trk_io import load_trks
from deepcell_tracking.utils import get_max_cells
from deepcell_tracking.utils import g... |
fbb6a8231218a06fc7ffa17aaaa98ec3e066b44e06801cde753a5fe6ea8de813 | Python | 16,356 | 351 | import logging
import traceback
from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QVBoxLayout, QGridLayout, QDialog, QDialogButtonBox,\
QComboBox, QPushButton, QScrollArea, QLineEdit, QFileDialog, QMessageBox, QProgressBar
from PySide6.QtCore import Qt, QSize, Signal
from PySide6.QtGui import QIcon, QMou... |
56ef4eb1c069efafda04d6e06783e617b346c043101a48360ea7527e9ad511f7 | Python | 16,381 | 369 | # !/usr/bin/env python
# -*-coding:utf-8 -*-
# @Time : 2022/08/08 20:14
# @Author : Liangdi.Ma
import torch
import torch.nn as nn
from .graph_modules import DynamicGraphAttentionLayer
import numpy as np
import torch.nn.functional as F
def _init_weights(module):
r"""Initialize weights like BERT - N(0... |
45f8aff0a2207369cd00eb8d83d9029d1ea643e120f4e3506ae1f530cd2d5cc3 | Python | 16,414 | 275 | import os
import sys
import logging
import configparser
logger = logging.getLogger(__name__)
class SharedResources:
"""
Singleton class to have access from anywhere in the code at the resources/parameters.
"""
__instance = None
@staticmethod
def getInstance():
""" Static access method... |
22e5d1e6e3d861dd6d518a2bd3d51e0a24b41d81317f5133810c913ccf750a91 | Python | 16,423 | 408 | """
Data_compile.py — REST V2.0
═══════════════════════════════════════════════════════════════════════════════
Preprocesses raw EDF + score files into per-recording .npy files for lazy-
loading during training. This replaces the old approach of loading everything
into RAM at once and saving a single monolithic .npz... |
3f26e83a65ec57acd6da1377d98b90f6f8e3aab31c6d1c003c521c91bff3831b | Python | 16,489 | 381 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
NeuroBED_ML
MODEL 1 — Single-Modality ML Pipelines
-------------------------------------------------------------------------------
Author : Lenar
Created: 2025-... |
8488ffa685781b6c2ea20da36e3621a4b9c184fd813334f6027ff506ba9239ab | Python | 16,504 | 434 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda.
"""
import matplotlib.pyplot as plt
import torch
from fig_utils import *
from rastermap import sorting
from scipy.stats import wilcoxon, zscore
from facemap.neural_prediction import prediction_utils
from facemap.utils imp... |
dee515d3a280aa1df9f84909ee75a9e1d13d7e2418b4d5ce701a8ad7c524cb9c | Python | 16,505 | 450 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""
ProtocolUnit implementations for the HybridTopProtocol.
"""
import logging
import warnings
import numpy as np
import numpy.typing as npt
import openmm
from gufe import (
ChemicalSys... |
2310d11b6209c5b66fa3ae9c32e36e9215597422356d75171e4f380528be1d2e | Python | 16,509 | 402 | import logging
import re
from typing import Dict, Union
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots import bargraph, violin
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""
Currently, `dedup` and `extract`... |
6b301ce8c5b0cd6fd593758fd6f0b26de65ec5a043741950909593ed88ec5a7a | Python | 16,512 | 302 | from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QVBoxLayout, QDialog, QDialogButtonBox, QScrollArea, QGridLayout
from PySide6.QtCore import Qt, QSize, Signal
from PySide6.QtGui import QIcon, QPixmap
import os
from utils.software_config import SoftwareConfigResources
class ResearchCommunityDialog(QDialog)... |
2647ff32ef46b686c2c9a58c1e4619a5e3966e77b13cbdee4c358e4773c66b7d | Python | 16,523 | 514 | #!/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 aniposelib.cameras import CameraGroup
from .common import make_process_fun, get_n... |
eaa4a33760490edf3ae1bea7c45a1a9696c22d01e20f68980259d44bd756492c | Python | 16,528 | 523 | # -*- coding: utf-8 -*-
# Copyright 2016-2018 Julien Danjou
# Copyright 2017 Elisey Zanko
# Copyright 2016 Étienne Bersac
# Copyright 2016 Joshua Harlow
# Copyright 2013-2014 Ray Holder
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... |
dfbc32ec4ef720493277a83a83feceb0814e0bb865c5c06ceda4179522f2e401 | Python | 16,539 | 496 | from typing import Dict
from multiqc import config
from .plot_aqhist import plot_aqhist
from .plot_basic_hist import plot_basic_hist
from .plot_bbsplit import plot_bbsplit
from .plot_bhist import plot_bhist
from .plot_bqhist import plot_bqhist
from .plot_covhist import plot_covhist
from .plot_idhist import plot_idhis... |
f4cd6e4cc36afa01f8c0fb3c634bd2790a2309591671329a7074db1d422d8498 | Python | 16,552 | 579 | # Copyright 2026 ETH Zurich, Department of Chemistry and
# Applied Biosciences, Reiher Group.
# Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain ... |
89ab7794a3e3e7bd761213de57d3fc4a56f4ffeb508defd6ab41501a88428862 | Python | 16,557 | 404 | import logging
from typing import List
import numpy as np
from multiqc import config
from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound
from multiqc.plots.linegraph import Series
from multiqc.utils import mqc_colour
from multiqc.plots import table, linegraph
log = logging.getLogger(__name__)
... |
6a3f8d35f9cc8b4ddb1a1c6f9a0a408d42e0105a2e36ae81f61e371fdfe5ed45 | Python | 16,623 | 391 | #!/usr/bin/env python3
"""
Quick-Look Analysis: 从已有 checkpoint 提取关键数字
=====================================================
不改任何代码,不跑任何模型,纯读数据 + 计算。
输出一份文本报告到 results/analysis/quick_look_report.txt
Usage:
python experiments/mf_main/analysis/quick_look.py
"""
import json
import logging
import pickle
import sys
fro... |
16f73eada779b45c8f202a655417fef829761c6c80eefd108ff6bc917acc348e | Python | 16,657 | 479 | # 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,... |
9003451ae42c682508f35f1ef16a1e13c128f2ed2cbdefc7f8424a55cff110f9 | Python | 16,683 | 457 | from itertools import combinations
import os
import re
from loguru import logger
from sqlalchemy.sql import select
from sklearn.metrics.pairwise import cosine_similarity
import asyncio
from experiments.em_numbers import refs
import numpy as np
from scipy.spatial.distance import jensenshannon
from scipy import stats
fro... |
7320404e8b2b9ac55f1fcb03650b026bb0ed8d6b841adfff7c30523bc196de21 | Python | 16,707 | 322 | import numpy as np
import pandas as pd
import glob, os, sys, itertools, yaml, shutil
import Bio.SeqUtils
from sklearn.model_selection import train_test_split
import warnings
warnings.filterwarnings("ignore")
sys.path.append("utils")
from data_utils import *
h37Rv_genes = pd.read_csv("/n/data1/hms/dbmi/farhat/Sanjana/... |
db8904436df90af5e13c93cf1a79adb029d4681039ce6d101e3518ca1a970ecf | Python | 16,715 | 380 | """Layers to noramlize input images for 2D and 3D images"""
import tensorflow as tf
from tensorflow.python.framework import tensor_shape
from tensorflow.keras import backend as K
from tensorflow.keras import activations
from tensorflow.keras import constraints
from tensorflow.keras import initializers
from tensorflow... |
4ec02016073a9b3c472f7a8640f7a7b6d842ec4dd9fc247d5b332549994e939c | Python | 16,718 | 578 | """Components for standing up services for integration tests, including databases."""
## storage
### below from `py2neo.test.integration.conftest.py`
import os
from pathlib import Path
import logging
from grolt import Neo4jService, Neo4jDirectorySpec, docker
from grolt.security import install_self_signed_certificate... |
98e0b411d47132b433c6c12a3261bee2b285977f669725acdc8187e1037f138d | Python | 16,719 | 467 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import pytest
from gufe import LigandAtomMapping, ProtocolDAGResult
from gufe.settings import OpenMMSystemGeneratorFFSettings, ThermoSettings
from openff.units import unit as offunit
from op... |
acdac6491c27fcc8bb8934d22f43415904483e259aeec644550324c96974ee31 | Python | 16,721 | 363 | import traceback
from PySide6.QtWidgets import QWidget, QLabel, QHBoxLayout, QLineEdit, QComboBox, QGridLayout, QPushButton,\
QRadioButton, QMenu, QVBoxLayout, QMessageBox
from PySide6.QtCore import Qt, QSize, Signal, QPoint
from PySide6.QtGui import QPixmap, QIcon, QAction
import os
import logging
from gui.UtilsW... |
754345804e5721b44972b3b0fbf47e187dce73ce8912881fa197ee8666edd4bf | Python | 16,728 | 611 | import pytest
from click.testing import CliRunner
import time
import contextlib
import os
import traceback
import multiprocessing
import datetime
from datetime import timedelta
import yaml
import requests
from fastapi import FastAPI
from alchemiscale.tests.integration.utils import running_service
from alchemiscale.... |
89f3b017ba57aa6c938485dcddba1673deace0c0decea46b455a7b1700d8505b | Python | 16,728 | 289 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... |
258b64a619a06d5277b5a63f0186cf6c8fe3803286d405d802e32bdc8c9f7965 | Python | 16,736 | 493 | #!/usr/bin/env python3
"""
Combined configuration validation and database setup for ethopy control.
This script validates configuration, tests database connectivity, and optionally initializes the database.
"""
import getpass
import os
import secrets
import string
from pathlib import Path
def print_header(text):
... |
2c53c649149a4a82fe61317dada00033fa9f97a34cb16e242702fcabd7686a78 | Python | 16,745 | 452 | # This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
import MDAnalysis as mda
import numpy as np
from numpy.testing import assert_equal
import os
import pathlib
import pytest
import pooch
from openfe.protocols.restraint_utils.geometry.boresch.... |
866bd3a478a46dd5c0a2ae200efe23a79b7240fcd4c99f5fec05aaa9ae92ad99 | Python | 16,752 | 401 | #!/usr/bin/env python
##############################################################################
# Medical Image Registration ToolKit (MIRTK)
#
# Copyright 2013-2015 Imperial College London
# Copyright 2013-2015 Andreas Schuh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
9306256b3b4f07585943e60614f2181b5efd595d09891951d1c7814de6da671c | Python | 16,755 | 596 | import collections
import gc
import sys
import numpy as np
def getsizeof(data):
if isinstance(data, np.ndarray):
bt = sys.getsizeof(data) / (1024**2)
elif isinstance(data, (list, tuple)):
bt = 0.0
for d in data:
bt += getsizeof(d)
elif isinstance(data, dict):
bt... |
3b98f3e35e3dbc11e14c9a1bd549440961f067a2a5a89470388e00312742517b | Python | 16,769 | 423 | #!/usr/bin/env python3
"""Select ticket-relevant CLARA validation targets from stage-1 output.
Phase 2 is still a routing preview. This script reads `changes.json` from
`clara_workflow.stage1.extract` and emits a normalized `routing.json` payload
that identifies which downstream CLARA checks should run for the curren... |
f7b129d61e4c42db78d29c43d8d90266b9d9bc64c383980cea9a757dbb1d34be | Python | 16,769 | 318 | #!/usr/bin/env python
import argparse
import glob
import os
import pandas as pd
import numpy as np
import nibabel as nib
from scipy import ndimage
parser = argparse.ArgumentParser(description="Determine the postion of the DRT on AC-PC",
formatter_class=argparse.ArgumentDefaultsHelpFo... |
5e4c5759ab75778c6c0459772e8f335e046e04592c8bd829c6982517ba4f2e68 | Python | 16,778 | 431 | __VERSION__="ete2-2.2rev1026"
# -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the t... |
8a8c3578d3911a6ae353fe7313e80e672c12bb18dde9a894b64779bcaca7bbf2 | Python | 16,782 | 492 | import contextlib
import logging
import pathlib
import subprocess
import sys
from collections import namedtuple
from unittest.mock import Mock, patch
import pytest
try:
from psutil._ntuples import sdiskusage
except ImportError:
from psutil._common import sdiskusage
from openfe.utils.system_probe import (
... |
969eb3f21cc0c6767af7a6bac2eea53893d412777d3f0a74ce4849767f68c490 | Python | 16,786 | 551 | import os
from glob import glob
from collections import defaultdict
import numpy as np
import pandas as pd
import pickle
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import ttest_ind
from scipy.spatial.distance import pdist, squareform
from sklearn.metrics import (
davies_bouldin_score,
... |
891fa2d0db63b1c50bb0a88e293d64386d5a99d04b0352c45e2a24df9c24b0f4 | Python | 16,791 | 483 | """Build inclusion criteria for SST baseline."""
import sys
from os import listdir
from os.path import exists
from pathlib import Path
import numpy as np
import pandas as pd
from nilearn import image
from tqdm import tqdm
from scipy.io import loadmat
sys.path.append(str([p for p in Path(__file__).resolve().parent... |
92a9bd497e21ffa87be90c060c188d43b8be92d299ba766ec734d58e3b470eda | Python | 16,795 | 509 | """
TLS with SNI_-support for Python 2. Follow these instructions if you would
like to verify TLS certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* `pyOpenSSL`_ (teste... |
7425f4faf37932fc974ea91f86951c367f905d03975273c20220346be782b05f | Python | 16,800 | 431 | 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.... |
a34ee2fec9a0cc8ad824e00af439366445902f181e8e089d9af3c62724cf6916 | Python | 16,808 | 368 | """ @package forcebalance.abinitio_pairwise Ab-initio fitting module with pairwise energies.
@author Chapin Cavender
@date 05/2024
"""
from __future__ import division
from __future__ import print_function
from builtins import zip
from builtins import range
import os
import shutil
from forcebalance.abinitio import AbI... |
83db1193a1fe714513607256c04a13b8480288e6a94438cea557dc31a2a8c1d1 | Python | 16,813 | 476 | """Targets for calculating loss when training neural networks"""
import abc
import pathlib
import typing
import torch
from openff.nagl._base.metaregistry import create_registry_metaclass
from openff.nagl.molecule._dgl import DGLMoleculeOrBatch
from openff.nagl.training.metrics import MetricType #MetricMeta, BaseMetri... |
3e5b16242882d6d8195a5f1a982f06b91467b90a8aa6dbdffdbf6785048bc336 | Python | 16,820 | 613 | import pytest
from click.testing import CliRunner
import time
import contextlib
import os
import traceback
import multiprocessing
import datetime
from datetime import timedelta
import yaml
import requests
from fastapi import FastAPI
from alchemiscale.tests.integration.utils import running_service
from alchemiscale.... |
8b4738597876dccc0a851d05f2c468053180cd00b50e3aa1fcfd629374e6dd02 | Python | 16,831 | 509 | import contextlib
from collections import namedtuple
import logging
import pathlib
import subprocess
import sys
from unittest.mock import Mock, patch
import psutil
from psutil._common import sdiskusage
import pytest
from openfe.utils.system_probe import (
_get_disk_usage,
_get_gpu_info,
_get_hostname,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.