sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
58d6a50ce931de96eff657b854a1f8eb4dd165331f86a212b26edee068d5d259
Python
21,379
583
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import logging import tempfile from itertools import product from string import ascii_uppercase import numpy as np import numpy.typing as npt from gufe import Component, ProteinComponent, Sm...
21938b3566b68aa3f4f2925e9f7f0a77a4425bdc13bae737696a3d1f6fb03182
Python
21,384
583
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import logging import tempfile from itertools import product from string import ascii_uppercase import numpy as np import numpy.typing as npt from gufe import Component, ProteinComponent, Sm...
86babbd7c9907197e7c80bde71b53efbe709fd9876d7e6270e3d9400d996588c
Python
21,387
464
import pandas as pd import numpy as np import glob, os, yaml, sparse, itertools, subprocess, sys, argparse, pickle, tracemalloc from Bio import SeqIO, Seq import scipy.stats as st import warnings warnings.filterwarnings("ignore") # load all utils functions sys.path.append("utils") from data_utils import * from analys...
b3764d2973bafeddb7650320f3396edb43cc4aaada4f8f79f92fe6118ff5f5a9
Python
21,396
602
from __future__ import absolute_import import email import logging import re import time import warnings from collections import namedtuple from itertools import takewhile from ..exceptions import ( ConnectTimeoutError, InvalidHeader, MaxRetryError, ProtocolError, ProxyError, ReadTimeoutError,...
f0e10ef2acbf7fcd933649d29cce144b9f2faf5a4d789e30619e643ffd43e179
Python
21,409
566
from configparser import ConfigParser import json import os # ============================================================================= # ADAPT THE FOLLOWING VARIABLES WHICH ARE SHARED ACROSS CONFIGS config = ConfigParser() # ADAPT ROOT_DIR! root_dir = "/scratch/alexandel91/mid_level_features" # ===============...
e706d117176fdfa753183e1ed0db4e74819fe5a904a0f61be49c90ce0589f70c
Python
21,429
626
# 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...
bec33ef99ce9688fb73875cadea31ea6e54d4b4448593fda2f82b417cfb9ef5b
Python
21,440
606
""" 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, QtGui, QtWidgets from qtpy.QtWidgets import ( QAbstractItemView, QButtonGroup, QDialog, QGraphicsPathItem, QGridLayout, QLabel,...
d3dfe1e67ccf09681bb49ba1ed41016fad8ce98501b5c6e517b7ec1dc43fdd5d
Python
21,456
540
import logging import os from collections.abc import Iterable from concurrent.futures import ThreadPoolExecutor, as_completed from io import StringIO from typing import Dict, List, Optional from xml.etree import cElementTree as ET import pandas as pd import requests from gseapy.utils import log_init, mkdirs, retry ...
4c7630c95b3c7303e59c5ab1b0d5d446c4a4df72d90e5091925b579c4137f1d8
Python
21,459
568
import json import shlex import pandas as pd from queue import Queue from collections import defaultdict def read_lines(filename): """Generator to read lines of a file""" with open(filename, 'r') as fin: for line in fin.readlines(): yield line def get_term_keys(obo_file): """ Ret...
38ffad742da727886fbc3367cda2c686e067c3ea1d2e4686388bdb8917556310
Python
21,471
775
#!/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. # ------------------------------------------...
2215994aed85fd74a7afe70b199b59a69d1e6198a2cd92e53d5504aaa4cdebf9
Python
21,483
628
# 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,...
9c12b6d48a69af99797c07714b02214020c60980db4cd72eb9b9c2330c9f35b5
Python
21,485
718
""" Utility functions for the EEG encoding analysis. """ from sklearn.decomposition import PCA from sklearn.decomposition import KernelPCA from sklearn.preprocessing import StandardScaler import cv2 as cv from scipy.ndimage import convolve, gaussian_filter from PIL import Image import numpy as np import torch import o...
de56ceb6c2f057c598a57c865e38b3581f57a07016cabfb300eeaa4c903bff05
Python
21,513
562
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """ Result classes for the Absolute Free Energy Protocols ===================================================== This module implements :class:`gufe.ProtocolResult` classes for the absolute f...
dd69a5acb42db5ddbfda244f86ef2b6be5a4f897eee9686fc1b3f5274289b9ed
Python
21,550
469
# 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,...
c78e7c5cbe4f23c584a0245e7cffce96f64d14725f58902b6ed0ff5811e03ed6
Python
21,552
648
""" Kinetic Monte Carlo (KMC) classes and functions. In our system, the reaction rate r = (deterministic) reaction constant k = stochastic reaction constant c (from gillespie 1977) = propensity a (from Anderson 2007) because of the fundamental premise of chemical kinetics and because we have one reactant molecule """ ...
672aa93bd4d805783e4bf99e4039cb45bac640176a547806cd2f6fd756bed165
Python
21,576
646
import sys import string import simplejson import pandas as pd import networkx as nx from itertools import chain from yaml.scanner import ScannerError from collections import defaultdict, Counter # Multiple imports depending on if command line or import from script try: from pathtester import PathTester, ALLOWED_C...
422e183205e5d93d72da3f8acb49a096a20ff9f80c168060b17ac690b35b7530
Python
21,626
496
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 11 02:45:20 2025 @author: saiful """ import random import numpy as np import torch import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder, StandardScaler from sklearn.metrics import acc...
3857a801e8635fad09a8d627944fd59559b43234c3f5bfdde76ea4471e712c8c
Python
21,680
479
import logging import traceback from PySide6.QtWidgets import QWidget, QDialog, QHBoxLayout, QVBoxLayout, QDialogButtonBox, QGroupBox, QLabel,\ QLineEdit, QListWidget, QListWidgetItem, QTableWidget, QTableWidgetItem, QSpacerItem from PySide6.QtCore import Qt, QSize, Signal import nibabel as nib import numpy as np ...
bd9f6f56c1b11981d059ddb160267a3dcfedf2b0d70a8222eaef1f12e5873131
Python
21,682
555
import glob import gzip import os import pathlib from unittest import mock import pandas as pd import pooch import pytest from click.testing import CliRunner from openfecli.commands.gather import ( _get_column, _get_legs_from_result_jsons, _load_valid_result_json, format_estimate_uncertainty, gath...
13277ab447336b52bfdae4775dce90accec4fa1c496ee5af109abece56e63b75
Python
21,701
420
""" Authors: Zheng Wang, John Griffiths, Andrew Clappison, Hussain Ather, Kevin Kadak Neural Mass Model fitting module for model fitting using pytorch """ import numpy as np # for numerical operations import torch import torch.optim as optim from ..datatypes import Timeseries as Recording # JG: rename this to...
69b2423a41199b549f06d4cddb5a49f519fdd6c2d2b32bc31495229ca32752a3
Python
21,711
500
"""Tests for bases2fastq module: parsers and integration.""" import json from pathlib import Path from typing import Any, List from unittest.mock import patch import pytest from multiqc import report, config from multiqc.base_module import ModuleNoSamplesFound from multiqc.types import LoadedFileDict from multiqc.m...
e0848ac0c21138d53bfedb2ee5fa5d6cdd61852e58ddc69b49970ee7f8d33607
Python
21,772
560
import datetime from uuid import UUID import matplotlib.pyplot as plt import pandas as pd from truesight import plot_utils, stats_utils from truesight.db.session import get_session from loguru import logger from truesight.db.models import DbEvaluation, DbLLM from truesight.evaluation import services as evaluation_servi...
a8612f7f65896eff041e1b8e2809eb86b140c42305a65f0bfa2dca72869a86d2
Python
21,797
504
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 11 02:45:20 2025 @author: saiful """ import random import numpy as np import torch import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder, StandardScaler from sklearn.metrics import acc...
03c4c591d3d65c354f70ae401681584f596cc33a11407558c852ed5cb5944be0
Python
21,805
510
import sys sys.path.append('/home/tconstab1/kg98_scratch2/oldscratch/Toby/python_venv/lib/python3.9/site-packages/ptitprince/') import PtitPrince as pt import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns #Display FCI first SE_FCI= pd.read_csv('/home/tconstab1/kg98_sc...
18077c96d9f8ab38f093da16477ff76eab00e16b98280360ba03ae751edc6f5c
Python
21,835
522
"""Interface with checkmol.""" import functools import warnings from enum import Enum from openff.toolkit.utils.exceptions import AtomMappingWarning from openff.utilities import MissingOptionalDependencyError class MissingCheckmolError(MissingOptionalDependencyError): """Checkmol is not installed.""" def _...
1966a039891039ed4deda8598f49db39539b6539020891c9166f5b002de1724a
Python
21,835
522
"""Interface with checkmol.""" import functools import warnings from enum import Enum from openff.toolkit.utils.exceptions import AtomMappingWarning from openff.utilities import MissingOptionalDependencyError class MissingCheckmolError(MissingOptionalDependencyError): """Checkmol is not installed.""" def _...
477989fefc2375d17dd1ba376ef2bb6bcadcc0047c352046a1220f5e765a8eea
Python
21,849
505
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 11 02:45:20 2025 @author: saiful """ import random import numpy as np import torch import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder, StandardScaler from sklearn.metrics import acc...
ba46364e435a7b998fe34d8d777ec723942690bcf73ab37449dc9fc12d0808ec
Python
21,866
496
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Author: Caro Nettekoven """ import numpy as np import TaskRest.paths as indiv_paths import Functional_Fusion.atlas_map as am import numpy as np import scipy.ndimage as ndimage import matplotlib.pyplot as plt import Functional_Fusion.dataset as ds import nibabel as nb i...
34cdb8d0e9b803cdc3054391db035d2ea26fd404ae198922b536905ff3438584
Python
21,901
445
from dna_features_viewer import BiopythonTranslator, GraphicFeature, GraphicRecord from dna_features_viewer.biotools import annotate_biopython_record import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import glob, os, yaml, sparse, itertools, sys from Bio import SeqIO from Bio....
b7a3ed87dbde2bd28a12ddbbc8da5871162296c36802207e66530cfebd801195
Python
21,907
504
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 11 02:45:20 2025 @author: saiful """ import random import numpy as np import torch import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder, StandardScaler from sklearn.metrics import acc...
419c32d5f8fdc6d3f405c56ff2d624c2013fe3c319d98e5c3f19a639f90f81d7
Python
21,952
536
from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QSpacerItem, QGridLayout, QComboBox, QPushButton,\ QStackedWidget, QGroupBox, QLabel from PySide6.QtCore import Qt, QSize, Signal from PySide6.QtGui import QColor, QPixmap, QIcon import os import logging from utils.software_config import SoftwareConf...
ba3fb249a977d9a8abfda2d7a8a1ecdb7212bd4efaa8fc39087bff4cc3d69c33
Python
21,966
494
"""Tests for data_utils""" import os import json import tarfile import tempfile import numpy as np from tensorflow.keras import backend as K from tensorflow.python.platform import test from deepcell.utils import data_utils class TestDataUtils(test.TestCase): def _write_test_trks(self, path): img_w, im...
e2d785417f54872bda5639cd02acb7317135080d2d9f1c05293b5edf6dfa2079
Python
21,987
568
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe """OpenMM Equilibrium Binding AFE Protocol --- :mod:`openfe.protocols.openmm_afe.equil_binding_afe_method` ====================================================================================...
184cd5bf1f930d5aa8789017c577e08dc6d8319934df1d8e55cac54b022f2437
Python
21,989
438
from aenum import Enum, unique import logging import os from os.path import expanduser import shutil import datetime import dateutil import json import traceback from copy import deepcopy from typing import Union, Any, Tuple, List class UserPreferencesStructure: """ """ __instance = None _preferences_...
b865c3505dab456de777696f49d98fb9f8b5992105a858a64fe825d3e6791e4e
Python
21,996
564
"""Functions for training convolutional neural networks""" import datetime import os import numpy as np import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.optimizers import SGD from tensorflow.keras.losses import MSE from tensorflow.python.data import Dataset from deepcell impor...
35e00ebb60d0599a2989a6daca9753a72ecad5e771eaa9dad488cd7aece73164
Python
22,018
426
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2014 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 publish...
31b8bbd0f01dd6f987bd544a938b35bc79c6f8224aa5d2a30f9a637781477f17
Python
22,041
451
# This script plots the analyses of sentence-loudness and instructed breath tasks during which a breath belt was worn by the participant. # This script plots the breath belt expansion during both tasks, psths from example electrodes and decoding accuracy under different task conditions. import argparse import os impor...
9c1211c922a37d1076e712022589de85cdc19b94f51c1189995bba18bb3c1174
Python
22,042
666
"Classes for handling featurized molecule data to train GNN models" from collections import defaultdict import functools import glob import hashlib import io import logging import pickle import tempfile import typing import json import tqdm import torch from openff.utilities import requires_package from torch.utils.d...
c04fb9128d10f29121dbc5a7f43f9871fea60efd00acc134e8147d50fef6f015
Python
22,073
571
from typing import Optional, Tuple, Dict, List import os import pandas as pd import random import time import h5py import numpy as np from Bio import PDB from Bio.PDB import PDBParser, NeighborSearch import torch from torch.utils.data import Dataset import warnings from Bio import BiopythonWarning from dataclasses impo...
f189c58fa3efe54ee4d7e85cd0633c8e09c06cca6bb574a40eb5c8dc9b8d8330
Python
22,112
660
import tempfile from collections.abc import Callable, Mapping from dataclasses import dataclass from pathlib import Path from typing import Any import torch from ptmelt.models import ( ArtificialNeuralNetwork, BayesianNeuralNetwork, RecurrentNeuralNetwork, ResidualNeuralNetwork, TemporalTransforme...
6a1e4db8c6a352294d78138e4d85470dd1ceba363ed33b7205e7b686f763a4bd
Python
22,171
460
import os import configparser import platform import traceback from os.path import expanduser import numpy as np from typing import Union, Any, List, Optional import names from PySide6.QtCore import QSize import logging import json from utils.data_structures.PatientParametersStructure import PatientParameters from uti...
2f4d9a993617301ebcc84df6f99604c93c17807097426a719b4bee38c024c808
Python
22,175
588
import argparse import os from typing import Callable, Optional, Tuple import numpy as np import pandas as pd import torch import pickle from sklearn.decomposition import PCA from sklearn.neighbors import NearestNeighbors from lifelines.utils import concordance_index from lifelines import CoxPHFitter from statsmodel...
46a30f8a0baab3088188c90094a597feff562dd62cbfa4ffbd1280bfc16cf608
Python
22,180
498
import logging import re from multiqc import config from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, linegraph, violin log = logging.getLogger(__name__) # Log parsing regexes regexes = { "alignment": { "total_reads": r"Sequence(?:s| pairs) analys...
51632b70d0ec0f08301929bbf330a65fa7642be888a1f4619b981ff5c6ee3c35
Python
22,206
447
#!/usr/local/bin/env python # ============================================================================== # MODULE DOCSTRING # ============================================================================== """ ReplicaExchangeSampler ====================== Derived multi-thermodynamic state multistate class with ex...
494e1005f128cc07a4bb64e17955080b31c997d572369b17a9ed2ac8156a558f
Python
22,210
626
import warnings from typing import Any import torch import torch.nn as nn from ptmelt.layers import MELTBatchNorm, MELTBayesianDenseFlipOut, PositionalEncoding def _get_initializer(initializer: str): """Get the initializer function.""" if not initializer.endswith("_"): initializer += "_" if in...
51c3b5fb6efa0c571e3cad33e873765795cd2f379a27052a7dbdf46eaf0a8995
Python
22,249
431
#!/usr/bin/env python # # MIT License # # Copyright (c) 2018 Volker Hovestadt # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the r...
c10662750776d5574ec972c2ffa73068d443ade0c0c23a5aaf023ecc03a65208
Python
22,267
583
import logging import multiprocessing as mp import os import time from abc import ABC, abstractmethod from datetime import datetime from queue import Empty from typing import Any, Dict, Optional, Tuple try: import cv2 IMPORT_CV2 = True except ImportError: IMPORT_CV2 = False import numpy as np try: fro...
6bf4bd76a6f9975f2f96a7b906b537d37a99e9e1686a00b93d98d8c11617fe6c
Python
22,279
715
import ast import io import os import sys import warnings import functools import importlib from collections import defaultdict from functools import partial from functools import wraps import contextlib from distutils.errors import DistutilsOptionError, DistutilsFileError from setuptools.extern.packaging.version imp...
fe775b0710039df321adcc915b52f427ac6670de5be7754c743872689af06421
Python
22,350
437
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from pyminc.volumes.factory import * from numpy import * from argparse import ArgumentParser import tempfile import os import functools import signal import shutil import subprocess import sys import math def get_tempfile(suffix): counter = 0 pid = os.getpid() ...
b41e629ccd8f2a4314f6d0b9cdf7589575d007c37af1136004a3bc1baf60c678
Python
22,392
451
#!/usr/local/bin/env python # ============================================================================== # MODULE DOCSTRING # ============================================================================== """ ReplicaExchangeSampler ====================== Derived multi-thermodynamic state multistate class with ex...
7fe5809073f3379e00c39933d426c0891a4d9fba32a99bf2332e2e768ad973e1
Python
22,401
638
# 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,...
17fa8357e04dbea012191098204615faf1b484582efd59df9134e3d9cbd1462b
Python
22,467
461
# -*- coding: utf-8 -*- """ Created on Thu Sep 8 11:00:11 2016 @author: david """ import numpy as np from scipy.special import beta """ T - topology of the tree B - set of branches in the tree D - set of all duplications, {d_i | i \in B} d_i - the duplications on branch i = (x_i, y_i) O_i(j), where i, j \in B if th...
659390abf987f724b085c02dc7832f9d62aed4fc4eba97bdfb7ccfbed5831006
Python
22,479
719
# 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,...
0f8dd94bd62e5dacda4486f7d7b96d9b6ed0947ee38d61df6bceb6547da01c1c
Python
22,536
749
""" The main function to run MultiQC. Primarily called by multiqc.__main__.py Imported by __init__.py so available as multiqc.run() """ import logging import os import subprocess import sys import time import traceback from typing import Optional, Tuple import rich_click as click from multiqc import config, report, ...
29af17e118195a13bc181b517b0ed2570ae939d8491be5abc1236aa6f2992c6d
Python
22,576
550
import json import logging import re from multiqc.base_module import BaseMultiqcModule, ModuleNoSamplesFound from multiqc.plots import bargraph, linegraph, table log = logging.getLogger(__name__) class MultiqcModule(BaseMultiqcModule): """ The module parses the reports from an assembly run. As a bare minimu...
f8df527ec258e39b10baa91241e421be98c00809bb084718cf16f9512e3542f5
Python
22,590
520
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 11 02:45:20 2025 @author: saiful """ import random import numpy as np import torch import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder, StandardScaler from sklearn.metrics import acc...
9cfbc9dc6337a858639b0f7003750c3971b143386e0f941b938cd3d7f966c904
Python
22,615
611
# Imports from torch.nn.functional import normalize import os # import os os.environ["CUDA_VISIBLE_DEVICES"]="7" os.environ["DGLBACKEND"] = "pytorch" import sys sys.stdout = open("final_console_outputs/console_output_lr-2_all_graph_bioembed_gat_run1_no_normedge.txt", "w") # sys.stdout = open("console_outputs/console_ou...
e6a7883eb4368fe31a6c5e14bd5db304b61421a79e169fc24a09a619fa58b4a0
Python
22,636
568
"""MultiQC functions to plot a scatter plot""" import copy import json import logging import math from collections import defaultdict from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union, cast import numpy as np import polars as pl from plotly import graph_objects as go # type: ignore from multi...
83b6444695b7a4e22bae7da9ed8799a2d672d80c61e56c4ecb275b30dbb8dbc5
Python
22,638
463
from PySide6.QtWidgets import QGraphicsView, QGraphicsScene, QGraphicsPixmapItem, QGraphicsOpacityEffect from PySide6.QtGui import QPixmap, QImage, QPen, QColor, QTransform from PySide6.QtCore import Qt, Signal, QPoint, QSize import numpy as np import os import logging from scipy.ndimage import rotate from utils.soft...
b5932159e62bd3e05d8c5562d44e8082205cabacd005c430418c4266ab294ae1
Python
22,650
603
import os import numpy as np import torch from scipy import sparse from scipy.sparse import csr_matrix from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from .model.model import protoCloud from .model.train import run_model, get_predictions, get_log_likelihood from .m...
4b8a0b099441596698ea7ca0e359001f9f7ffc1a82de0b6be20ec4ac89f9910c
Python
22,679
675
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import click import os import pathlib import pandas as pd import sys from typing import Literal, List from openfecli import OFECommandPlugin from openfecli.clicktypes import HyphenAwareChoi...
2b3b1d8f933ab6c46aa24cdea75784fd6ff84f71be599a07c022377ee119a579
Python
22,717
636
# Example Models - for full, closed form inference via junction tree algorithm # Or loopy belief propagation import numpy as np from numpy import exp,sqrt,log import matplotlib.pyplot as plt import copy import emissions as em import arrangements as ar import spatial as sp from full_model import FullModel import pandas...
f8ba4277663418a6cf703dd1939d402506a9e866e0638ee14883af0afcb53f3a
Python
22,728
745
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import os import time import numpy as np import torch from scipy.interpolate import interp1d from scipy.linalg import eigh from scipy.ndimage import gaussian_filter1d from sklearn.decomposition import PCA from torch.n...
0fe5e3c36464f77e3297a747a64a0f4388fa5f0be53e032815b6cdc52ba90f27
Python
22,733
559
#import os #import cv2 #import numpy as np #import tensorflow as tf #from glob import glob #from keras.utils import Sequence #from keras.models import load_model #from keras.models import Model #from project import ViT, ClassToken # Ensure these are correctly imported according to your project structure # ## Define hy...
6fba0a59d41c5522e8226c2120b93ba9f3bf0cf8673f15ce0e863e8040a6bd6a
Python
22,734
588
#!/usr/bin/env python3 """ Parallel MRI Registration and Brain Extraction Pipeline ====================================================== This script processes brain MRI data in parallel by: 1. Registering T1WI and T2WI images to FLAIR space using FSL FLIRT 2. Performing brain extraction on FLAIR images using FSL BET ...
514b040210c31c0bb01b948143fac6df497ab4bc0c4c2ee9c791cf8879228e9e
Python
22,735
674
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import json import logging import pathlib import sys from unittest import mock import gufe import numpy as np import openmm import pytest from gufe import ChemicalSystem, LigandAtomMapping, ...
cc9850eb99b2f4435a3ce83f573c81fb55b9c860005f207f59ed8b79bed862ab
Python
22,741
589
""" SFF_ELM_model.py Sector Fruit Fly based Extreme Learning Machine (SFF-ELM) for UCS prediction of geopolymer-stabilized clays. This file contains: - Baseline ELM - FOA-ELM (Fruit Fly Optimization Algorithm) - SFF-ELM (Sector Fruit Fly Optimization) - Training, prediction, evaluation, and visualization Author: Moha...
9953f5941ae114e39d025584c3dbc2c19c3b3916f818d8e0b2cc84a308cc321b
Python
22,755
656
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations import os from functools import cached_property, lru_cache from pathlib import Path from threading import Lock from typing import TYPE_CHECKING, Any, Dict, NamedTuple, Optional, Tuple, Union import dask.array as da import numpy as np imp...
02c775919d61e486d76d6966267670dce86ad46d90d023420e7a1358699c2e3e
Python
22,779
519
from typing import Any, Dict, List, Optional, cast from natsort import natsorted from multiqc.plots import bargraph, linegraph, table from multiqc.plots.table_object import ColumnDict from multiqc import config from multiqc.types import SectionAlert def _drop_low_samples(data: Dict[str, Dict[Any, float]], threshold...
1842704f30fa52f19ba7c4c446cba8e49c560170fa6f3dc0e4705dc4f13213ea
Python
22,808
697
""" All read_<...> and write_<...> functions. """ import csv import json import logging import os from datetime import datetime from itertools import takewhile from pathlib import Path from typing import Optional, TypeAlias, TypedDict, Union import numpy as np from kimmdy.utils import get_gmx_dir logger = logging.g...
a039429085657f3e9a5b110710f1f34ab2fcaec02d97a00d3579057054c5b61a
Python
22,863
660
import queue import random import numpy as np import numpy.ma as ma from numpy.linalg import norm import glm import trimesh import open3d as o3d import pickle import matplotlib.pyplot as plt # TODO: remove and plot with nemsi from FyeldGenerator import generate_field from scipy.spatial import cKDTree plt.style.use("d...
65af1a18b7223b5a3b373d25c58446d08c2f50e60a3dff1632471443972569f1
Python
22,877
818
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.ElementTree as ET from pathlib import Path from tempfile import TemporaryDirectory from typing import Any, Dict, List, Optional, Tuple, Union from unittest.mock import MagicMock, patch import numpy as np import pytest from _aicspylibczi import PylibCZI_CD...
25369121d174da051b0d945121a6f994f2c9e0703deec18e176111533d952606
Python
22,881
662
""" :mod:`alchemiscale.base.client` --- base class for API clients ============================================================== """ import asyncio import time import random from itertools import islice import json from urllib.parse import urljoin from functools import wraps import gzip from pathlib import Path impo...
3b1fbf559af75548ed854a6d82f8c77179b8e3b6aefa77869a2f0ff4339c0f8b
Python
23,003
565
#!/usr/bin/env python3 """ qc_video.py — minimal QC viewer for facial keypoints (2-D overlays + skeletons) -------------------------------------------------------------------------------------- Focus: 1) Load 3D keypoints from pose_3d/*.csv 2) Optionally apply per-frame head->world transform (M_ij, center_k) 3) ...
7a7da6b5c5f7bee63408b4192eca35e61b23f5a85b013672ac4a29c60ef76261
Python
23,013
587
""" bootstrap_snn_evaluation.py #1628074 用途: - 对每个癌种进行 B 次 bootstrap 重训练(有放回抽样) - 每轮训练在 D_boot 上训练模型,在未抽中的 OOB 上评估 - 在 OOB 上计算 C-index(sksurv) - 汇总每种癌症的中位数/均值/Std/95%CI 并保存结果 注意: - 请实现 `fit_snn_on_bootstrap(train_df, seed)` 和 `predict_risk_scores(model, df_oob)` 两个函数: - fit_snn_on_bootstrap: 接受训练 DataFrame,返回已训练模型...
89d90e2d94c672c5d54e1bd7edc6e77d968fe76f1d4284f4bc93b5a3c878a7e7
Python
23,025
718
# 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,...
83e0068e7889ff44589ac50ba0798de6fa52ef85e16417f9f1e29f72c40ede28
Python
23,036
437
""" Special case MultiQC module to load multiqc.parquet It allows rerunning MultiQC when original data is gone, as well as extend existing reports with new data. """ import json import logging from datetime import datetime from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union, cast impor...
cf0b8faf45a1b7fab4a3c1c521623c0762e2f9d7375b20ba9a9acd2142747342
Python
23,039
587
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch import Tensor from typing import List, Tuple import math from functools import partial from torch import nn, einsum, diagonal from math import log2, ceil import pdb from sympy import Poly, legendre, Symbol, chebyshevt from ...
46190a3664da00bcf3838582092c1c1f06f89acc729fd20a8d4bda76da7939ff
Python
23,050
538
#!/usr/local/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test all test systems on different platforms to ensure differences in potenti...
6bf5193ac8d9ea187e8d1ac7ac94c9df09ca60ea8acadd545154a11e02935f2f
Python
23,056
470
from PySide6.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QScrollArea, QPushButton, QLabel, QSpacerItem,\ QGridLayout, QMenu, QMessageBox from PySide6.QtCore import QSize, Qt, Signal, QPoint from PySide6.QtGui import QIcon, QPixmap, QAction import os import logging from gui.SinglePatientComponent.PatientResu...
51cbc6310467f3fea4448fe4ef3c8ad4223866de9bc1ca1063416e3d99f72821
Python
23,069
601
#!/usr/bin/env python # -*- coding: utf-8 -*- import warnings from typing import Any, Dict, List, Optional, Tuple, Union import dask.array as da import numpy as np import xarray as xr from dask import delayed from fsspec.spec import AbstractFileSystem from tifffile import TIFF, TiffFile, TiffFileError, imread from ti...
14729ec64f3717e52b40db1dff8e66df589cf5d06e92929847cc9a3a26c08055
Python
23,084
539
#!/usr/local/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test all test systems on different platforms to ensure differences in potenti...
37ad1348c6d3afbf400f347ad410ab93c62881441c0419cd68b8093d37d7b1f7
Python
23,086
715
"""Handles all VCS (version control) support""" import logging import os import shutil import sys import urllib.parse from typing import ( Any, Dict, Iterable, Iterator, List, Mapping, Optional, Tuple, Type, Union, ) from pip._internal.cli.spinners import SpinnerInterface from ...
c3be05662d0d49fbf33df2aac4d5eb9df6df4c4d9a515052c6a0ac585e877cd4
Python
23,089
558
# Inital setup for stratified splitting of AnnData objects and verification of the splits. Needs to be run before training the models. import logging from pathlib import Path import anndata import numpy as np from timeflies.core import ConfigManager # Configure logging for better control over output logging.basicCo...
f7bdf1f72c23f79ff02b0fdafdeba7b48b5cde2df062ea6b87c34ee9215ab4a8
Python
23,121
546
""" Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Atika Syeda. """ import os import typing import numpy as np from qtpy import QtCore from qtpy.QtCore import Qt from qtpy.QtGui import QPixmap, QGuiApplication from qtpy.QtWidgets import ( QDialog, QGroupBox, QHBoxLayout, ...
6c91efc55bfc1f31ff6cd5c6232766d4929d86620c002ec0e45e8c4c237938b7
Python
23,160
654
import math import os import time from multiprocessing.shared_memory import SharedMemory 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, ClockOb...
1d6a95e065ea2e9feb262a5ad7dcb1f7cdd4a3dc6c8c5b223ee4eb6fb22eb1a1
Python
23,176
446
import numpy as np from matplotlib.figure import Figure import matplotlib.gridspec as gridspec from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg import matplotlib.cm as cm import logging, wx, threading class RedirectText(object): def __init__(self, text_ctrl): self.text_ctrl = text_ctrl d...
6dc9c5e7a33f1427778802fa27edfafa5a931da2e0c50310535af459928c2e05
Python
23,223
629
# Imports from torch.nn.functional import normalize import os # import os os.environ["CUDA_VISIBLE_DEVICES"]="1" os.environ["DGLBACKEND"] = "pytorch" import sys # sys.stdout = open("console_outputs/inference_output", "w") # ============================================================================= # # ============...
eb02c996b2e37e40a52c71d500f0075bf815105b7a17b9f698075f09452d8f64
Python
23,229
612
import os import logging import time import glob import numpy as np import tqdm import torch import torch.utils.data as data from datasets import get_dataset, data_transform, inverse_data_transform from functions.ckpt_util import get_ckpt_path, download # from functions.svd_ddnm import ddnm_diffusion, ddnm_plus_diffu...
edcb6ac96cc9ee002976ab51da28b4059ce57a7e70326824c47fa8c7840b39da
Python
23,248
629
import matplotlib.pylab as plt import numpy as np import pytest from openff.units import unit from cinnabar import FEMap, plotting from cinnabar.measurements import ReferenceState @pytest.fixture(scope="function") def show_called(monkeypatch): """Fixture to mock plt.show() and track if it was called.""" call...
6cc0f97e0dcfd45d66460caa8a808974e28d1fc9676146525b65f6498534ec12
Python
23,260
390
#!/usr/bin/env python3 # https://neurostars.org/t/extract-voxel-coordinates/7282 # http://blog.chrisgorgolewski.org/2014/12/how-to-convert-between-voxel-and-mm.html # https://stackoverflow.com/questions/6967463/iterating-over-a-numpy-array # https://stackabuse.com/calculating-euclidean-distance-with-numpy/ # https://n...
71632b460b040971ada5d1458ba5be5140177fe3b3a1a18ab1436968d81b914e
Python
23,268
599
import numpy as np import pandas as pd from scipy.spatial import ConvexHull def compute_euclidean_dist(a, b): """Compute the Euclidean distance between two 3D points. ### Arguments - `a`, `b`: the 3D vectors as arrays of shape `(batch..., 3)` ### Returns The distance as an array of shape `(batch....
ff485ed293dff76f315d707a7c52c600f02767ec6a9a8342a3469c2e92246295
Python
23,269
552
import numpy as np import pandas as pd import seaborn as sns import networkx as nx import matplotlib.pyplot as plt import matplotlib.patheffects as pe from collections import defaultdict from scipy.spatial import distance __all__ = ['shift_centers_to_min_distance', 'darken_hex_color', 'determine_text_color', 'pre...
3866312f50ae2700f582cf553e22ed41016ee72c372006bfb4df5266a5a246a5
Python
23,299
563
"""MultiQC functions to plot a box plot""" import copy import json import logging from typing import Any, Dict, List, Mapping, Optional, OrderedDict, Tuple, Union, cast import plotly.graph_objects as go # type: ignore import polars as pl from natsort import natsorted from multiqc import config, report from multiqc....
ffe78503a16d55d27a94a33aa4b0201a469b49ae7a9a5ed822e90e6153030aae
Python
23,308
486
from config import TESTING_MODE from ctypes import c_int, c_void_p, c_char_p, c_float, c_uint16, c_uint32, c_uint8 from ctypes import Structure, byref import os, time, json, sys, warnings, ctypes, logging, threading, h5py, Queue import numpy as np import multiprocessing as mp from util import now,now2 if TESTING_MODE:...
17b2c36fa3d02309e26302dcce1536a520321d9f5b9d3553d7223f39db98877c
Python
23,315
821
# The following comment should be removed at some point in the future. # mypy: strict-optional=False import contextlib import errno import getpass import hashlib import io import logging import os import posixpath import shutil import stat import sys import urllib.parse from io import StringIO from itertools import fi...
41b0697290ea802fdbd8205294dded94a85d3fd035db47770b80b0d6bd8d4ca2
Python
23,319
542
import pandas as pd import numpy as np import glob, os, yaml, sparse, itertools, subprocess, sys, argparse, pickle, tracemalloc from Bio import SeqIO, Seq import scipy.stats as st import warnings warnings.filterwarnings("ignore") # load all utils functions # sys.path.append(os.path.join(os.path.dirname(os.getcwd()), ...
56e429931099230da72ee16385beb27fe6f102c8528a5badaeb7d4e8e8b219e8
Python
23,319
537
import yaml import random from datasets import load_dataset from sqlalchemy import select from refs import llm_base_refs from truesight.db.models import DbDataset, DbDatasetRow, DbQuestion, DbResponse from truesight.db.session import get_session from truesight.experiment.services import EvaluationRef, JudgmentRef from ...
6ca400c7a7438a4264dcf3151cc9c7affdc29deaad3d5f25a0e1ba2968d03ad4
Python
23,343
771
"""See test_creation_indices.py for tests with 'indices' parameter.""" import numpy as np import pytest from numpy.testing import assert_array_equal import shapely # Note: Point is not imported because it is overridden for testing from shapely import ( GeometryCollection, GeometryType, LinearRing, Li...
c0509f645ae4d94198c2f25d490790d5dc70b871288fe30f776d6ad3b1a62657
Python
23,349
532
''' Custom Blue Orange Color Map set cmap = blueOrangeCmap() ''' import numpy as np; np.random.seed(0) import seaborn as sns; sns.set() import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap, LinearSegmentedColormap import matplotlib.colors as colors import numpy as np import warn...