sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
62a6cc814b3b67934ba40bd1c10bd246359896186f4dbf7fa284cafdbce0f6b0 | Python | 19,065 | 471 | ##
# \file Slice.py
# \brief { item_description }
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date September 2015
#
import os
import numpy as np
import SimpleITK as sitk
import pysitk.python_helper as ph
import pysitk.simple_itk_helper as sitkh
import niftymic.base.data_writer as dw
impo... |
72c358474f6264ebbbe97bc81eac262f95224a1c4da82ab0d79d96c882f4d0c5 | Python | 19,084 | 500 | import pandas as pd
import numpy as np
import os, logging
from tqdm.auto import tqdm
from functools import lru_cache
@lru_cache(128)
def warn_once(msg: str):
logging.warning(msg)
from PIL import Image
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from collections import defaultdict, Orde... |
17e4b7d2ad9d7518a74d82c7780391a1b95e5261c8f64259b09be46c31253111 | Python | 19,091 | 456 | # Copyright (C) 2019 Computational Science Lab, UPF <http://www.compscience.org/>
# Copying and distribution is allowed under AGPLv3 license
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence
import numpy as np
from torch.autograd import Variable
import torch.nn.functional as F
impo... |
efa1f37d30ae0326bdf9224b7cbce30bc92e1b6c88784a3833e842aa83da6585 | Python | 19,100 | 509 | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import graph
import pddl
def parse_typed_list(alist, only_variables=False,
constructor=pddl.TypedObject,
default_type="object"):
result = []
while alist:
try:
separator_pos... |
f1e3f5f0a2c514441df80fba7c2d1204e16df93493601ff2d39df3903d618e03 | Python | 19,100 | 448 | from mnp.definitions import DATA_DIR
from mnp.utils.chemistry import many_smiles_to_morganfp
import torch
import numpy as np
from torch.utils.data import Dataset
import gzip
import pickle
from tqdm import tqdm
tqdm.pandas()
import pandas as pd
from typing import Union, List, Tuple, Optional
import math
class Fingerp... |
ff5f7a5f3b6517aed7fb4b7ec3235baaf8eb6235e8c9d51fa9edb3c29578e533 | Python | 19,105 | 583 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
595dc1d4e8259c4d16ed283d6062146d1044797188ad954ef324749c9e3fa6f0 | Python | 19,111 | 487 | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... |
b3a04e55c15ff7774dcf3f468ce3fe6aae2b527d25b7cea7a3fe765b3a9eadf0 | Python | 19,115 | 510 | #!/usr/bin/env python
# Copyright (c) 2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Summary of useful helper functions for scenarios
"""
import math
import shapely.geometry
import shapely.affinity
import numpy as np
... |
defec6cb0a1ec4b1280f97c07f743e2b18bbecafe3874c3c0e910604328f1234 | Python | 19,116 | 468 | """Field-aware orchestration of the vendored mousebrain registration stages.
Mirrors ``mousebrain/run_me.py::_process_slice`` but:
* injects a CCF-derived ``edge_atlas`` (bypassing ``atlas_segmentation``);
* resizes the moving image onto the CCF-slice canvas;
* composes the final Laplace warp from exported ... |
9ebafd77191db598fadf6a418147ee4d7f864a434176c493a0dfb803b7245ca2 | Python | 19,142 | 539 | import os
import glob
import torch
import torchvision
import numpy as np
import scanpy as sc
import pandas as pd
import scprep as scp
import anndata as ad
import seaborn as sns
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
import torch.nn.functional as F
import torchvision.transform... |
447c6cea0982c24805500069c63e6ba0d36e21fc1820a527f86414d851055477 | Python | 19,147 | 559 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... |
d2a6e2c05832d5d5e664d51b6ae997d9c55687551211bb06d387791fafe4de55 | Python | 19,148 | 494 | import math
import os
from functools import partial
import matplotlib.pyplot as plt
import numpy as np
import torch
from tqdm.auto import tqdm
from .posterior_mean_variance import get_mean_processor, get_var_processor
__SAMPLER__ = {}
def register_sampler(name: str):
def wrapper(cls):
if __SAMPLER__.ge... |
352a9a088ab6d19df7d19a764639014414c9319f72e6987bb7ffa39bb1fc7907 | Python | 19,149 | 397 | import glob
import json
import os
from typing import Callable, Dict, Tuple, Union
import mne
import numpy as np
import xmltodict
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
class MAHNOBDataset(BaseDataset):
r'''
MAHNOB-HCI is a multimodal database recorded in response to... |
6481b6a89d3edde3c9b51d1d3ffb36a58e8762818cc30d585601a457b2514001 | Python | 19,155 | 502 |
import numpy as np
import os
from scipy import sparse
from tqdm import tqdm
from sklearn.manifold import TSNE
import random
import itertools
from xgboost import XGBRegressor
import numpy as np
from cobolt.model.coboltmodel import CoboltModel
from cobolt.model.clustering import ClusterUtil
from cobolt.utils import Mult... |
7e192a15844688daa2bd85ae5087ee6f838cf3c9ecce253d3b3b5753e12cd559 | Python | 19,156 | 338 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.animation as animation
import time
import ray
import os
from neuron_model_parallel import NeuronSim
from elec_field import sparse_place_human
from pulse_train import PulseTrain_Sinusoid... |
d187b155d77b294ee7db8c6a0660b583ce9ec184415794e03dc548f75c318154 | Python | 19,159 | 469 | """Embedded pyqtgraph preview panel for the cellpose detection GUI.
Covers the shared load/downsample/orient helpers (``preview_io``), the pure
display worker (``compute_display``), the panel widget's Input/Detection modes,
and the tab wiring that drives it.
"""
import os
os.environ.setdefault("QT_QPA_PLATF... |
16528a2d32cb21f24321824061d8d43d2280bd77681546ae444d706f88c1f101 | Python | 19,183 | 491 | import os
import pickle
import copy
import numpy as np
import cupy as cp
from neuron import h
from network_learn_v4 import Network
from utils import *
from scipy import signal, interpolate
import matplotlib.pyplot as plt
import time
import json
OUTPUT_PATH = './trial10'
PREFIX = 'eworm'
SUFFIX = 'v4'
TARGET_MODE = 'c... |
7d2c16a82b3a134351fc116295059d8ec8ae867f6431dec273f3cf1b5c669bbf | Python | 19,190 | 443 | import numpy as np
import csv
import matplotlib.pyplot as plt
from glob import glob
from os import path
import scipy
from scipy import signal
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
import pickle
import os
import networkx as nx
import os
class DataUtils:
BASE_DIR = os.path.d... |
ce7e453716fc06819fb639d6af26bbd678755df4c57bd100eb72946d9e3f3a00 | Python | 19,192 | 529 | import torch
import torch.nn as nn
import torch.nn.functional as F
from egg.core import NTXentLoss, TopographicSimilarity
from config import Config
from data import DataLoader, collate_only_features, collate_with_distractors
from learning_experiment import LearningExp
from measures import binary_accuracy, generalizati... |
8f77a31930858e3da04706111523dc38081975b8f18c14ea7d8130a40c5e9807 | Python | 19,194 | 493 | import math
from argparse import ArgumentParser
from typing import Callable, Optional
import numpy as np
import pytorch_lightning as pl
import torch
#from pl_bolts.optimizers.lars_scheduling import LARSWrapper
from pytorch_lightning.core.optimizer import LightningOptimizer
from torch import nn
from torch.nn import fun... |
d4a9331522079e05b143763e583c6760656648833cf5f761871ad2169410c485 | Python | 19,197 | 390 | import numpy as np
import random
from collections import deque
class SCTA:
"""
Synchronization Cluster Tracking Algorithm
"""
MAX_CLUSTER_ID = 1000
MIN_CLUSTER_ID = 1
def __init__(self,
bin_conn,
local_order,
local_order_phase,
... |
3539fe4ae41c212a9312b954bb664a1c9f0b2f7a589c87246a89ed3017876a15 | Python | 19,198 | 576 | """Main deconvolution functions."""
import os
from fnmatch import fnmatch
from typing import Any, Iterator, List, Literal, Optional, Sequence, Tuple, Union, cast
import numpy as np
from . import lib
from .otf import TemporaryOTF
from .util import PathOrArray, _kwargs_for, imread
def rl_cleanup() -> None:
"""Re... |
9bc10385f926274266abd386c73f24a1f9f696e498f05ba3507a6da8dfb5ecf2 | Python | 19,204 | 618 | #!/usr/bin/env python
# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Support class of the MetricsManager to parse the information of
the CARLA... |
11c533b8eac26451db7e64d32ebfabec66226633fdb88ddab686e13c5b4b5f59 | Python | 19,205 | 356 | import os
import re
from typing import Any, Callable, Dict, List, Tuple, Union
import scipy.io as scio
from ...constants.emotion_recognition.amigos import (
AMIGOS_ADJACENCY_MATRIX, AMIGOS_CHANNEL_LOCATION_DICT)
from ..base_dataset import BaseDataset
class AMIGOSDataset(BaseDataset):
r'''
A dataset for ... |
830ca428cc152f43986309a56c65b3933bdc0829d53d1ede990103877095f5c2 | Python | 19,206 | 402 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .scVI_distribution import *
from .loss import *
import os
import copy
import random
import numpy as np
import pandas as pd
import scipy
import torch
from torch import nn, optim
import torch.nn.functional ... |
654f082907730473fef85119be235122ae52d0f1b1d50b95179f7f54e904bed5 | Python | 19,208 | 293 | """REST_STATE.py 2026-10-08. Pre-registration: 04-NOTES/PREREG-2026-10-08e-TWO-WAYS-TO-FAIL.md
Two ways to fail. Twin B machinery (TWIN.py, no depression): R1 the census at rest, R2 fly-like twins on fresh seeds, R3 the
phase diagram (background drive x excitatory share), D behaviour (Knaden et al. 2012 valence read ... |
72cf3996bad9bda823593feca4dab007da02400831431f41a3ffad347df5ddb2 | Python | 19,209 | 572 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
c0a9f73fc573f0121ac3deae204ad3c6c4db5ca9736817be4f83b4ef6591a94f | Python | 19,211 | 391 | import os
import unittest
from hed import schema
from hed.errors import ErrorContext, ErrorHandler
from hed.models import DefinitionDict, HedString
from hed.validator import DefValidator, HedValidator
class Test(unittest.TestCase):
basic_hed_string_with_def_first_paren = None
@classmethod
def setUpClass... |
2dfd24630b85d9db8c46cd8965713b6e07d4782bc17bb391177aff5a1b932feb | Python | 19,223 | 590 | ##
# \file solver.py
# \brief Base class to solve the SRR problem y_k = D_k B_k W_k x = A_k x
# for all slices k = 1, ..., K.
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date July 2016
#
# Import libraries
from abc import ABCMeta, abstractmethod
import sys
import itk
import Si... |
9a57bffd94dc65e93bf7cddf44333a6892be99bbfd8e0c23abdd9b422b1e8208 | Python | 19,225 | 423 | """
Generates a ListTomoParticle object from a input STAR file (translocon project version)
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import vtk
impor... |
8065fd7e35a7b5307fc1fa2ff991ec151f2d1dc0250391d0886b9ba381d0b046 | Python | 19,228 | 424 | """Functions that build the data input pipeline for the translation model."""
import re
import numpy as np
import tensorflow as tf
REGEX_SML = r'Cl|Br|[#%\)\(\+\-1032547698:=@CBFIHONPS\[\]cionps]'
REGEX_INCHI = r'Br|Cl|[\(\)\+,-/123456789CFHINOPSchpq]'
class InputPipeline():
"""Base input pipeline class.... |
2644f548941482d959ca3166caac7494e2f8e6d0dbf48f439f7f22cfdc926fe9 | Python | 19,232 | 530 | """distutils.command.sdist
Implements the Distutils 'sdist' command (create a source distribution)."""
import os
import sys
from glob import glob
from warnings import warn
from ..core import Command
from distutils import dir_util
from distutils import file_util
from distutils import archive_util
from ..text_file imp... |
9f2b413c3e8ddd25e68baeb41dd9ea627e5d3968d35c95e25447eadeea840c19 | Python | 19,241 | 390 | import tqdm
import os
import pickle
import random
import pandas as pd
import multiprocessing as mp
from time import time
from copy import deepcopy
import torch
import numpy as np
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader, Subset
from BEBE.models.model_superclass import Behav... |
d328d246e4e1552a8164d7e09a6239e5c5801dc768d9d3ee74422b1e6c4b7420 | Python | 19,242 | 370 |
import vtk
import math
import time
import numpy as np
from unittest import TestCase
from ..surface import ListShellNhood, ListSphereNhood
from ..utils import disperse_io, iso_surface, poly_decimate
from ..utils import points_to_poly
from matplotlib import pyplot as plt, rcParams
# Global variables
RAD = 50
SHELL_THIC... |
78cca16d1c9941d693642bd3c1d0144664d746e1cd5d10d884dae74c6e8cf2ac | Python | 19,248 | 457 | import warnings
import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import mudata as md
from geomloss import SamplesLoss
import ot
from scconfluence.base_module import BaseModule
from scconfluence.unimodal import AutoEncoder
from scconfluence.dataset_utils import (
format_batch,
inferen... |
775a16b90556c46a774373135e28bd4adf222c1b91f7d4291eb01d18105cc5b5 | Python | 19,254 | 421 | import os
import pybullet as p
import numpy as np
import time
from itertools import product
from .utils import unit_pose, safe_zip, multiply, Pose, AABB, create_box, set_pose, get_all_links, LockRenderer, \
get_aabb, pairwise_link_collision, remove_body, draw_aabb, get_box_geometry, create_shape, create_body, STAT... |
6b1b558b055db2ab8ace0578a1312edd07427358c7f54bce5a714feb40ffa7b5 | Python | 19,255 | 534 | """
Performs Univariate 2nd order analysis from a STAR file with a set of ListTomoParticles entries
Input: - A STAR file with a set of ListTomoParticles pickles
Output: - Plots with the analysis
- Matrix with the analysis for further post-processing
"""
################# Package import
im... |
889a72f670b3fecbd98cd76e4aa0a805eff8c08781cdef7362722d42c4e6f9cf | Python | 19,259 | 534 | """
Performs Univariate 2nd order analysis from a STAR file with a set of ListTomoParticles entries
Input: - A STAR file with a set of ListTomoParticles pickles
Output: - Plots with the analysis
- Matrix with the analysis for further post-processing
"""
################# Package import
im... |
6c8c41fcf64555781582f7456ed2e678974771437e8652ece2e2832604390dc4 | Python | 19,260 | 483 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... |
8becbc38f848fb5b6a8f38267b8cf001622be6352646975704b3c4cd9293456d | Python | 19,265 | 434 | import torch
from torch.utils.data.dataset import Dataset
import numpy as np
import os
import tqdm
import yaml
import pickle
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, Subset
import torchmetrics
import tqdm
from matplotlib import pyplot as plt
from matplotlib.ticker import MultipleLocat... |
f369a9840a425a6b740f1eb623b64d351f2c17e14573105de82fa2eff55807d6 | Python | 19,271 | 367 | """Coupling policies: WHEN the neural interface runs inside a forward pass, and the hook plan.
A coupling policy declares a hook plan (layer index -> callable, in registration order) and
its update semantics; the kernel (install_hooks) is the only code that touches transformer
layers. The mathematics is delegated to a... |
134b9b49a72027b26af5063944f5735c9de13669f0155578a1a910112413ef89 | Python | 19,280 | 401 | # coding=utf-8
# Copyright 2018 The Google Flax Team Authors and The HuggingFace Inc. team.
#
# 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
... |
b4bf483cbc75796ad53ced526b556ddd399b6ba37739524b07b67e9e79bdaa72 | Python | 19,283 | 514 | # -*- coding: utf-8 -*-
import json
import os
import shutil
from tempfile import TemporaryDirectory
from bids import BIDSLayout
from dcm2bids.dcm2bids_gen import Dcm2BidsGen
from dcm2bids.utils.utils import DEFAULT
from dcm2bids.utils.io import load_json
TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "dat... |
f9726b3edcff69630d6ee5f0ea5083884faedf050f98d64c7a1f47a135ea0665 | Python | 19,285 | 529 | """
Choosing which direction to look at a subject from.
:mod:`molecularnodes.framing` solves how close the camera has to be for a given
orientation. This module picks the orientation. Every method returns a camera
basis as rows ``(right, up, forward)``, the convention ``framing`` uses, so the
two compose: pick a direc... |
9667a3aa136c4cc7745e54bf0d6c50f4a49c8abe53bb8b79ef4af7902c21d9eb | Python | 19,301 | 580 | import typing
from pathlib import Path
from typing import TYPE_CHECKING
from mathutils import Vector
from MDAnalysis.core.groups import AtomGroup
from ...annotations.base import BaseAnnotation
from ...annotations.manager import BaseAnnotationManager
from ..annotations import Label2D, Label3D
from ..base import EntityTy... |
cbdc57b21f11dbfecaf47e68e3d2199f304eac59afa7642fb7dd265c53d578f0 | Python | 19,301 | 618 | #!/usr/bin/env python
"""
Contains functions often used in the scripts of this directory
$Id$
Author: Vladan Lucic
"""
from __future__ import unicode_literals
from builtins import zip
#from builtins import str
from past.builtins import basestring
__version__ = "$Revision$"
# ToDo: see if this should become a superc... |
092415ff57b9d1e26c233b35ea62f8ed743311eca15502b09a75083330cc7436 | Python | 19,303 | 616 | from __future__ import division
import numpy as np
import scipy
import scipy.signal
import scipy.optimize
import scipy.special
from .wavelets import Morlet
__all__ = ["cwt", "WaveletAnalysis", "WaveletTransform"]
def cwt(data, wavelet=None, widths=None, dt=1, frequency=False, axis=-1):
"""Continuous wavelet tr... |
a53b8b108365c8987cf5de9c6628f116f17a1ae79280957b86af5c97a071eee6 | Python | 19,305 | 511 | from atom3d.filters import filters
import os
import torch
import numpy as np
import pandas as pd
import random
import torch
import torch_geometric as tg
# import e3nn.point.data_helpers as dh
from transformers import BertTokenizer, BertForMaskedLM
import os
from eudockscore.utils.interface import get_pair_interface_... |
bc632575946fa2ebab522918e381a6aa6315ba9401910ac6e0306269ea46c3e8 | Python | 19,308 | 396 | # set QT_API environment variable
import os
os.environ["QT_API"] = "pyqt5"
import qtpy
# qt libraries
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from qtpy.QtGui import *
import control.utils as utils
from control._def import *
from control.core import *
import control.tracking as tracking
from queue imp... |
98e9f1c08cdcdf56f5049bb9ceeac110bece0c4f55d32dfc74389f4f17af7543 | Python | 19,316 | 575 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
d5cd4d9ff82c9095197afabc2ab4c58495a0c6da585e930720485af3d03d3839 | Python | 19,317 | 461 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... |
5bb6c303491297e4672ec8c68e261ea8e7fc69391aac27dd7999d10fb3b6e94e | Python | 19,326 | 418 | # flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... |
50d10d1dd870974a3acf9db2337f2f46c08237bbb2d1091b8afd4c7fb9467b19 | Python | 19,327 | 568 | """Various utility functions."""
import numpy as np
import scipy.sparse as sp
import torch
from typing import Union
import networkx as nx
import random
from sklearn.preprocessing import normalize, StandardScaler
from collections import Counter
from scipy.stats import norm
from sklearn.decomposition import TruncatedSVD
... |
eb1a35ec5c131c50d907a30c71d9a1efe7a071ec904db662339548040cf78cff | Python | 19,338 | 533 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
9cd924d658a06915c9d1a84fd8d4049d5bf59eeb0d90486591bc8591ae605099 | Python | 19,346 | 345 | #!/usr/bin/env python3
"""
Based on
https://github.com/BIDS-Apps/example/blob/aa0d4808974d79c9fbe54d56d3b47bb2cf4e0a0d/run.py
"""
import os
import os.path as op
import shutil
import subprocess
import argparse
from glob import glob
from nilearn import surface
from nilearn import plotting
from nilearn import datasets
fro... |
146cc9f98a924c4f33fefa163ddcef2d8e53abc8c4ff28231a333a757649f3e9 | Python | 19,351 | 521 | """
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from io import StringIO
from pip._vendor.pygments.formatter import Formatter
from pip._vendo... |
ee56cd564036ec4ed9026acfc95ca9f05cf172ac1fba8d868bae44f19def7f51 | Python | 19,352 | 520 | #
# Copyright Bradley Lowekamp
#
# 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.txt
#
# Unless required by applicable law or agreed ... |
316a3680dc6d72d8cd22578b4c818fcc88460f852a22b21bc0ef3127ea51f3f8 | Python | 19,353 | 430 | """
Classes for handling (running) the DisPerSe commands
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 16.10.14
"""
__author__ = 'martinez'
import time
import warnings
import subprocess
import logging
from astropy.io import fits
from . import disperse_io
import shutil
from pyto.i... |
b3857dea1ba79ba0714053ce9b248f47dac2bf3ba09d70f10d10ab82d0d6a152 | Python | 19,357 | 425 | import tensorflow as tf
import sonnet as snt
from tensorflow.contrib import slim
test_local_stats=False
#test_local_stats=True
def create_init_op():
init_op = tf.group(tf.global_variables_initializer(), tf.local_variables_initializer())
return init_op
def load_ckpt(sess, model_dir, variables_to_restore=None)... |
a00932689d66e16ed905e10761b6f6cf8d1835d2540104f1fe142d2d32aad640 | Python | 19,361 | 559 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
312c700d397b836d01787cc3104efd0ce7dae19df7815a41936270e0144768ae | Python | 19,362 | 433 | import src.training.train_utils
from helpers import *
import tensorflow as tf
import numpy as np
import os
from sklearn import metrics
from scipy import stats
from random import randint
from config import DATA_AUGMENTATION, LOCAL, DEBUG, REGRESSOR_MODE, BINNING, LABEL_FORMAT, VAL_BINNING, \
CLASSIFICATION_ENCODER... |
814b8d596148b334120bbbaa953bc03b41767baa25441a96c913b73eb3be4104 | Python | 19,368 | 507 | #
# Client orchestration utilities for ACME
#
# Copyright © 2026 Ernst Strüngmann Institute (ESI) of the Max Planck Society
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Builtin/3rd party package imports
import socket
import os
import sys
import time
import glob
import functools
import logging
import tqdm
import dask
... |
c202cce64a99aa3c081ec3ee7e7a6bea0cbd9a6dc416d353b569cd29e59dafbc | Python | 19,368 | 462 | """
Performs Bivariate 1st order analysis to a SetListTomograms object by tomograms with ListTomograms as reference
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms object... |
322262caf7eb0df36f39b1a792b0cb170193086fe21a5e24f54b46c7ea09b23b | Python | 19,371 | 408 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .scVI_distribution import *
from .loss import *
import os
import copy
import random
import numpy as np
import pandas as pd
import scipy
import torch
from torch import nn, optim
import torch.nn.functional ... |
d9f57f2999b721a37775684c58759f73f92787b56a1d5ab591f41e51e34e14d9 | Python | 19,379 | 510 | import time
import os
import subprocess
import sys
import re
import argparse
import collections
import gzip
import math
import shutil
import matplotlib.pyplot as plt
import wandb
import numpy as np
from datetime import datetime
import random
import multiprocessing
#import logging
#from silence_tensorflow import silen... |
b978d4ac38efbe1eb2ffacedfad51637fcd74458e88a05761496aa116bd2278e | Python | 19,381 | 559 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
cf3698bfb8909a4ca8dd59d9f2b6ccf04fb89b4c307dd108e366f16eb4ad8c6c | Python | 19,392 | 509 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
cc5f2b0e1a6e67d94c64b4f4e301639d0784046dcce3d38ea37fdfb7eae691ab | Python | 19,397 | 432 | """
Generates a ListTomoParticle object from a input STAR file (translocon project version)
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import vtk
impor... |
9e0385d491061ff43d74f25909f030d4d07111cf2e3b97a4528b03bf1d5c26a1 | Python | 19,403 | 539 | #!/usr/bin/env python
#================================================================
# Copyright (C) 2022 Yufeng Liu (Braintell, Southeast University). All rights reserved.
#
# Filename : valid.py
# Author : Yufeng Liu
# Date : 2022-08-06
# Description :
#
#=========================... |
ad3c313fc947c499cac1b8006824016f74b62b6f279cb3dfb9ba683feb2663be | Python | 19,412 | 446 | #===========================================================================
# Import, Set up MPI Variables, Load Necessary Files
#===========================================================================
from mpi4py import MPI
import time
tic_0 = time.perf_counter() #script runtime calculation value
import os
from o... |
ddb1c41d72d267d6a91c5437633a0e26e07bd91aa2b8165b3a47d45a50b199ce | Python | 19,413 | 492 | # -*- coding: utf-8 -*-
"""
Functions for cleaning and processing the AHBA microarray dataset
"""
import logging
import os
from pkg_resources import resource_filename
import nibabel as nib
import numpy as np
import pandas as pd
from . import io, transforms, utils
LGR = logging.getLogger('abagen')
# AHBA structure ... |
41da67a4aba1706635101955499084491e815bd6123f063d615a57e1adefa2f6 | Python | 19,422 | 475 | import os
import argparse
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import math
import pandas as pd
from sklearn.metrics import mean_absolute_error, r2_score, accuracy_score, roc_auc_score, f1_score
from dataset import MicroDataset
from model import MicroK... |
ab9dbeddf8adbdf0d0e13ee73e3e408b5c2ca778dbb56d820fef63385fa92fde | Python | 19,425 | 583 | """
Helper functions.
"""
import json, sys
import numpy as np
import warnings
from os import makedirs
from os.path import join, exists
from matplotlib.patches import Ellipse
import matplotlib.transforms as transforms
from mne.stats import permutation_cluster_test
def load_exp_variables(json_filename):
"""
... |
05bd6b262fab767e1bcc6aad3f38d1c22bb19a2f914b273974f2cf64f8bcbabe | Python | 19,427 | 510 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
e2336c68ced25f3b07155c28c155d439af68bfdd8173ad651632fe6a66b7e104 | Python | 19,427 | 544 | """tokenizer for output sequence"""
import os
import json
import random
import numpy as np
from SmilesPE.pretokenizer import atomwise_tokenizer
# Define special token IDs and corresponding strings
PAD_ID = 0
SOS_ID = 1
EOS_ID = 2
UNK_ID = 3
MASK_ID = 4
PAD = '<pad>'
SOS = '<sos>'
EOS = '<eos>'
UNK = '<unk>'
MASK = '<m... |
33b46930bd0aaad546a606c9940e0d53ffbb202daff82965114657b9e9d5aa46 | Python | 19,430 | 417 | """Tests for coronal TIFF export (module + simple GUI)."""
import json
import numpy as np
import pytest
import tifffile
nib = pytest.importorskip("nibabel")
from regtools.utils.io.coronal_tiff_export import export_coronal_tiffs
def _write_nii(path, data, affine=None):
if affine is None:
... |
84903440126e5ea6b86a06f15c35ec860171e761f5babd83cc250a656b9d585e | Python | 19,434 | 457 | # # Example 3: Protein phosphorylation and diffusion in 3D cell geometry
#
# Here, we implement the model of protein phosphorylation at the cell membrane and diffusion in the cytosol from [Meyers, Craig, and Odde 2006, Current Biology](https://doi.org/10.1016/j.cub.2006.07.056).
#
# This model geometry consists of 2 do... |
50b9fd206cff36122f38aee3d2f7881bdbd2ed23c2f17774c813b8e72cb3aa64 | Python | 19,451 | 516 | """
m6a_cnn.py
Author: Anupama Jha <anupamaj@uw.edu>
This module predicts whether an
adenine is methylated or not. The
model is trained with Fiber-seq
HiFi read sequence, inter-pulse
distance and pulse width signal
from pacbio. The model is a
convolution neural network.
"""
import torch
import numpy as np
import _pick... |
fa1963aaccc78516e1a2350feba5c0396bc872c8129eba39554faabcec2ad5b8 | Python | 19,458 | 603 | #
# Validation utilities for ACME configuration
#
# Copyright © 2026 Ernst Strüngmann Institute (ESI) of the Max Planck Society
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Builtin/3rd party package imports
import numbers
import numpy as np
import tempfile
import os
import sys
import datetime
import inspect
import ge... |
bfff11dd578bd8f609f02885f034298f2a9864a23ef9cc73af20d0d5439ad2f3 | Python | 19,466 | 346 | import sys
assert('neuron' not in sys.modules)
import os
nrn_options = "-nogui -NSTACK 100000 -NFRAME 20000"
os.environ["NEURON_MODULE_OPTIONS"] = nrn_options
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.animation as animation
imp... |
398dd424fed2a6a2a5169f3b89ca05c97258d8142ac265b9423fd17c475f4756 | Python | 19,471 | 431 | """
Generates a ListTomoParticle object from a input STAR file (translocon project version)
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import vtk
impor... |
0e8d775374fd35067d9cf84ad5a28937021d353b3e3074d252e8a24c3a60e4c6 | Python | 19,482 | 418 | from PyUtilities.setupFunctions import read_config_file
from PyUtilities.edit_add_bids_templates import copy_templates_to_bids_root, add_participants_ids_to_tsv, change_dataset_name
from PyUtilities.utility_functions import mkdir_if_not_exists, calculate_hash
import logging
import pandas as pd
import os
import shutil
... |
58d215507520685804c36bbc4a6585a09097649dadc2d15c7b815374b75a71af | Python | 19,488 | 503 | """Tests for DIALOGUE.
Unit tests for the internal helpers plus an end-to-end pipeline test.
The full pipeline is fit once per module so the heavy ``test_celltype_pairs`` step doesn't run repeatedly; a single dedicated test verifies dense and sparse ``adata.X`` produce identical outputs end-to-end.
"""
from __future_... |
05c9981538b688b66f477a2254e6284fb97c4aaef783f3f58c8edbe3562a1a21 | Python | 19,489 | 504 | """
m6A_ml_data.py
Author: Anupama Jha <anupamaj@uw.edu>
one-hot-encoding code adapted from bpnet-lite (https://github.com/jmschrei/bpnet-lite)
This module converts m6A SMRTMatrix format to training features and labels for ML modelling tasks.
"""
import pickle
import argparse
from tqdm import tqdm
import numpy as np
f... |
06accb16316afc51597de73ca764150f352b73f1da65dc4cd2c3f94fe3b63c55 | Python | 19,522 | 610 | """Generate conformers from SMILES or MOL2 files.
Author: Seth Axen
E-mail: seth.axen@gmail.com
"""
from __future__ import division, print_function
import sys
import os
import logging
import argparse
from rdkit.Chem import AllChem
from python_utilities.parallel import (
Parallelizer,
make_data_iterator,
A... |
866b1a41686a9ea61106c025ebe4f273773f3bd54f99076a937a5eb6596db59d | Python | 19,528 | 536 | """
Performs Univariate 2nd order analysis from a STAR file with a set of ListTomoParticles entries
Input: - A STAR file with a set of ListTomoParticles pickles
Output: - Plots with the analysis
- Matrix with the analysis for further post-processing
"""
################# Package import
im... |
6a730d6f35afa9a3ec0cf0e9d667cddf58e3914e61e7344e21a1e08695beb2bd | Python | 19,541 | 579 | # coding=utf-8
# Copyright 2026 The Google Research Authors.
#
# 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 applicab... |
84f55aad491f8f18ed0c14ad93f1837a2ab25c29172069d036b4d30b13010d0c | Python | 19,542 | 479 | """
Deprecated network.py module. This file only exists to support backwards-compatibility
with old pickle files. See lib/__init__.py for more information.
"""
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.par... |
7998cb080d00a11f6978077147466d99de89c38d875febd839a74c5ebc77bba8 | Python | 19,548 | 480 | from __future__ import division
from __future__ import print_function
import datetime
import json
import logging
import os
import pickle
import time
import numpy as np
import optimizers
import torch
import torch as th
from config import parser
from models.base_models import LPModel
from utils.data_utils import load_d... |
2be0ea78a8b00fde482d2cbe5b663df2711b957e3fa2f14459a4940ae13c152c | Python | 19,549 | 472 | #! /usr/bin/env python3
"""Build and publish a full APT conda / Docker / Apptainer complement, resumably.
Given a single tag -- the production environment name, which includes the date,
e.g. ``apt-20260801-tf215-pytorch21-hopper`` -- this builds the whole complement
in one command, and does so idempotently: every stag... |
f2cc8f80967205b65bbdb875c2a97de55b24be992f1d99f61aaed8877bbfc5d0 | Python | 19,549 | 476 | """Builds the base data object to be used in HMP, including preprocessing and projections.
BaseData is typically initialized through the function 'from_io'.
Option 1, first build an object with from_io(io_data), then apply operations
in the following order:
hmp_data = hmp.basedata.from_io(io_data)
hmp_data.crop_re... |
a225a0af50c271e3a8823d6146df29065c0acb0610e0195b8f42a90ca669c7c6 | Python | 19,550 | 428 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... |
0a09fc0592bf595d9538ad1325ca7959a9cf2c4dfa58be64bf8961f77ca79714 | Python | 19,553 | 556 | # FlyMovieFormat.py
# KMB 11/06/2008
import sys
import struct
import warnings
import os.path
import numpy as nx
from numpy import nan
import time
import math
# version 1 formats:
VERSION_FMT = '<I'
FORMAT_LEN_FMT = '<I'
BITS_PER_PIXEL_FMT = '<I'
FRAMESIZE_FMT = '<II'
CHUNKSIZE_FMT = '<Q'
N_FRAME_FMT = '<Q'
TIMEST... |
a319a9e528b25aea7ec85a79e394e8d517ef909fdebae63c13a8a60dc8a63425 | Python | 19,556 | 440 | import pandas as pd
import numpy as np
import warnings
warnings.filterwarnings(action='ignore')
import pandas as pd
from sklearn import metrics
from sklearn.preprocessing import MinMaxScaler
from sklearn.utils import class_weight
# from sklearn.decomposition import PCA
from sklearn.discriminant_analysis import LinearDi... |
80d294b5ab000af9606b02d1d43d35032675f44f98ea58eab36391aaf96941e3 | Python | 19,559 | 431 | """
Generates a ListTomoParticle object from a input STAR file (translocon project version)
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import vtk
impor... |
aa69ad77033853c711516fe34176305b0a1cf50ecd8999bae4572c7cafdc8ba2 | Python | 19,559 | 578 | """
oxasl.gui.widgets.py
Useful wx widgets for building the OXASL GUI
Copyright (c) 2008 University of Nottingham
"""
import os
import colorsys
import wx
import wx.grid
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure im... |
2b3b12406a7caf69cf50ac42c78cb62fe58c6fb5f3c0de34331187e5bbf525c5 | Python | 19,560 | 475 | """
Comparison test: old LGMRES Laplacian solver vs new CG+Jacobi solver.
Verifies that the current CG-based implementation in
regtools/registration/core/ produces deformation results that are
numerically close to the original LGMRES-based implementation stored in
regtools/tests/lgmres_laplacian/.
"""
import... |
b9bc07afe21bd7c4c5df59911dae30ffd8d3a3f0ae41f02db2a4bcf3fba9422d | Python | 19,561 | 465 |
"""
Performs Bivariate 1st order analysis to a SetListTomograms object by tomograms with ListTomograms as reference
Input: - A STAR file with a ListTomoParticles pickle (SetListTomograms object input) used as reference
- A STAR file with a set of ListTomoParticles pickles (SetListTomograms objec... |
8b761dfda820b04a6745203a97b7773524a4df5396fbcd548e20aa2e4ee2a3a5 | Python | 19,565 | 431 | """
Generates a ListTomoParticle object from a input STAR file (translocon project version)
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import vtk
impor... |
3eedf476123068af2410611e5905b0d3a7af31ed14cc821d42056005afefcc96 | Python | 19,566 | 431 | """
Generates a ListTomoParticle object from a input STAR file (translocon project version)
Input: - STAR file for pairing STAR files with particles and particles shapes
Output: - A ListTomoPaticles pickled object for every STAR file row
"""
################# Package import
import os
import vtk
impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.