sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
38a80b7f43b8ed5e102a5b38259cd0fe29153e0f892cdfacae34e2bf09925769 | Python | 45,920 | 891 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 25 16:18:32 2020
This script plot the results of the cross validation of the possible models of behavior
simulated with ModelCressValidation.py
The 279 subjects have been considered in this analysis.
We have two types of models : bayesian models and... |
c80d46b09591c839a5a806f04eb2045aafd2ff079fc01edc531dec92547b8f15 | Python | 46,175 | 1,323 | from typing import cast
import bpy
from bpy.types import UILayout
from ..entities import Molecule, StreamingTrajectory, molecule
from ..entities.base import EntityType
from ..nodes._utils import get_star_node
from ..session import get_session
from .ops import MN_OT_add_selection_to_style
from .props import TrajectorySe... |
4608671b988bc8f435377c8d2f80186c464ee0ed0dffb5462e730fc2864bf19f | Python | 46,223 | 950 | import time
import os
from os.path import dirname, abspath
import sys
import shutil
import warnings
import numpy as np
from collections import namedtuple
import json
import h5py
from tqdm import tqdm
import torch
from torch import optim
from torch.utils.data import SubsetRandomSampler, DataLoader
from torch.utils.tens... |
a7e5548e8370d7bec7845903e67041908fcb58726690028c1bfdabf3c0510d0c | Python | 46,311 | 1,031 | from collections import deque
import torch.nn.functional as F
import cv2
from utils import *
from transfuser import TransfuserBackbone, SegDecoder, DepthDecoder
from geometric_fusion import GeometricFusionBackbone
from late_fusion import LateFusionBackbone
from latentTF import latentTFBackbone
from copy import deepcop... |
21e147b9bedc4bb2e01623d71daa75f4d29330dec71acf7764ab1aa4136327dd | Python | 46,329 | 1,120 | import csv
import matplotlib.pyplot as plt
import numpy as np
import math
import os
from collections import defaultdict
from scipy.stats import zscore
import copy
class Item:
def __init__(self, filename, assessment_id, id, score, visible, right_place, drawn_correctly):
self.filename = filename
sel... |
0778bb18206705bbe5ed69e2843e90a71d4e1966e96b2eaeb5cb7558e96af4b1 | Python | 46,375 | 1,501 | # 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... |
dee686175089ca9935aa2b6644b244c174419f11bd43d8701cdf63c37799e792 | Python | 46,424 | 898 | # 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... |
17b6eb5548b09c2256a734ab724fa653d5b64b0944993af28e7b77ab3ed98ede | Python | 46,430 | 933 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import seaborn as sns
import re
from sklearn.decomposition import PCA
from sklearn.preprocessi... |
99ae6fcf15a8f702c26df53f6364652c6c3f2b36d06719bff2ba59dae4a7f5d1 | Python | 46,451 | 1,136 | import platform
import serial
import sys
import serial.tools.list_ports
import time
import numpy as np
import threading
from crc import CrcCalculator, Crc8
from control._def import *
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from qtpy.QtGui import *
# add user to the dialout group to avoid the need to u... |
6f45934b190e709451d324cbc8215c5e7a9bf7cff93f560df3fb538d55c9e0fa | Python | 46,495 | 1,035 | """
Atlas registry - canonical paths and metadata for built-in brain atlases.
Each atlas is described by an :class:`AtlasInfo` dataclass that pairs the
template volume with its annotation, region-graph CSV, and (optional)
summary-structures CSV. Downstream code should use :func:`get_atlas`
or :data:`ATLAS_REGIS... |
0454ed2493ede3abc5d2dd35b377994ef3be4cb5ffe9bb72f4b0e5d86ea16104 | Python | 46,557 | 1,050 | import pathlib
import os
import sys
from mmcv import Config
import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.runner import get_dist_info, init_dist
from mmcv.utils import get_git_hash
import mmdet
from mmdet import __version__
from mmdet.apis import set_random_seed, train_detector
from mmdet.dat... |
3b98ff1752b598dc5167008078a7dd6ea63f2b1396130710d4e8736bca35f1a0 | Python | 46,559 | 1,156 | ''' So, ahem, this code is ugly. Quite ugly. And frankly very little is my fault. It is entirely to agonizingly bad project management by tensorflow. From distressingly incomplete documentation, haphazarad functionality finally topped with ever changing framework, the code couldn't be any better when trying to be backw... |
1e2bdaf4ebbb8fb69a0e3e041fdc60e94210bf11ae042cb541a8bd20ee067714 | Python | 46,596 | 958 | import time
import os
from os.path import dirname, abspath
import sys
import shutil
import warnings
import numpy as np
from collections import namedtuple
import json
import h5py
from tqdm import tqdm
import torch
from torch import optim
from torch.utils.data import SubsetRandomSampler, DataLoader
from torch.utils.tens... |
41f328a5606d609d6e5a4ab592801e44c0b687f8f115726b4db752f5344d84c9 | Python | 46,602 | 1,018 | from __future__ import annotations
import contextlib
import itertools
import warnings
from typing import TYPE_CHECKING, Literal
import numpy as np
import pandas as pd
import scanpy as sc
from anndata import AnnData
from fast_array_utils.conv import to_dense
from joblib import delayed, effective_n_jobs
from numba impo... |
f80fc2c9ce35845f6807998ca6e395af49d77515a5773b4c63c249220104c1bd | Python | 46,716 | 1,262 | import importlib.util
import json
from pathlib import Path
import sys
import numpy as np
import pytest
ROOT = Path(__file__).resolve().parents[2]
HELPER = ROOT / "notebooks" / "waxholm_hemisphere_split" / "hemisphere_split.py"
def _notebook_source():
path = ROOT / "notebooks" / "waxholm_hemisphere_... |
05ba9c0a0514e0e9b265d092aa0e7f950f934db665cd073751177704397ffecf | Python | 46,783 | 1,139 | """
Copy of pylearn2's sgd.py, hacked to support doing steps on
discriminator separately from the generator. Ideally this would
be accomplished using pylearn2's FixedVarDescr implementation,
but it is currently not very well supported.
"""
from __future__ import division
__authors__ = "Ian Goodfellow"
__copyright__ = ... |
690d609bfbadca35f914bc3f70205a468675c54d043fc7177e1aa50ae24f904f | Python | 46,805 | 1,271 | # 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... |
756e40b3758571a49c5bb5b975e515198b130b52ed5d350db687249eb545ad18 | Python | 46,843 | 680 | """Interpolate GKs to cube centres for MonoAlg3D simulations"""
import os
import sys
from warnings import warn
import math
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from datetime import datetime
if __name__ == '__main__':
if len(sys.argv) < 2:
anatomy_subject_name = 'DT... |
b574c027d922b64c04fbb4b5335614b368cf99cb48bcfc5126a672222d8665c0 | Python | 46,852 | 884 | import copy
import os
import unittest
import pandas as pd
from hed import load_schema, load_schema_version
from hed.schema import HedKey, HedSectionKey, from_string
from hed.schema.schema_comparer import SchemaComparer
from hed.schema.schema_io.df_constants import EXTERNAL_ANNOTATION_KEY, PREFIXES_KEY, SOURCES_KEY
fr... |
05e8106b74c508c299a3a0514d39b43b23f6695334aca86686389de233f4fa7d | Python | 46,856 | 1,029 | """
OXASL - Classes for representing ASL data and constructing instances from command line parameters
Copyright (c) 2008 University of Nottingham
"""
import collections
import json
import os
import sys
import warnings
import six
import numpy as np
import scipy.linalg
from fsl.data.image import Image
from .options ... |
f65e2d0e48e9719a625b5974304136ca3c99ceb0b4c9b97dfeaa501e13802ee6 | Python | 46,921 | 1,151 | """
Copy of pylearn2's sgd.py, hacked to support alternating between
epochs of updating only the discriminator and epochs of updating
both discriminator and generator. Ideally this would
be accomplished using pylearn2's FixedVarDescr implementation,
but it is currently not very well supported.
"""
from __future__ impor... |
058912c8e4478b1586b404143fe3caff1e5305a726d1f1621b8d67bc464d1ac6 | Python | 46,966 | 2,627 | from __future__ import annotations
from math import ceil
from pathlib import Path
from typing import Sequence
import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import matplotlib.patheffects as path_effects
from matplotlib.lines import Line2D
from mpl_toolkits.... |
238eeffca2284e9e68fc81464be797e6efeded0ada381490bf6ac9aad23a2d33 | Python | 46,987 | 709 | """This script visualises the results from the inference of repolarisation properties from the T wave"""
import os
import sys
from warnings import warn
import math
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from datetime import datetime
if __name__ == '__main__':
if len(sys.argv) ... |
125464ebeecd4d21b48c8a15cb400233e9138240f537fbf3719d0272a1816713 | Python | 47,014 | 875 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pickle
import dill
import os
import glob
import seaborn as sns
from sklearn.decomposition import PCA
from skl... |
31a8cfe55acbba066d5bf08b22f091951cf23251fbacdc4bf19f552bb737d5b5 | Python | 47,034 | 673 | """This script visualises the results from the inference of repolarisation properties from the T wave"""
import os
import sys
from warnings import warn
import math
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from datetime import datetime
if __name__ == '__main__':
if len(sys.argv) ... |
2f4b746302945f1c333e56913f4aee4660b7e4f9a77d59a7d5def490043b44b4 | Python | 47,065 | 1,262 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
6246e4a07066527da20910e6f7d303a44c0d4853a775cdf6a33c55148313c1ba | Python | 47,202 | 912 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import dill
import os
import time
import glob
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import auc
import statsmodels.ap... |
dabd681c2605ad395f7ef6af5fa70a95ce9d099b674eb4a2d3d18110b29a1e98 | Python | 47,239 | 1,182 | from __future__ import annotations
import itertools
from collections import Counter, OrderedDict, defaultdict
from copy import deepcopy
from itertools import combinations
from pathlib import Path
import sklearn
from numpy.random import RandomState
from sklearn.model_selection import StratifiedKFold, StratifiedShuffl... |
9795b9559e8d6bac53b5b8b226f0551a6a80ceafdc4f6a904d868846ecf8c933 | Python | 47,281 | 1,172 | # 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... |
2622066cb891af82eb87a58867f0a9e40c3cb948659620f0fccd79352e636d44 | Python | 47,284 | 975 | """
Performs Univariate 1st order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
Output: - Plots by tomograms:
+ Plots by list:
* Univariate 1st order analysis against ran... |
d363cdbd6e9e0fff04769fb4cea434bb71fcb97da2762e9e69cd1eb6f7012c3b | Python | 47,304 | 976 | """
Performs Univariate 1st order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
Output: - Plots by tomograms:
+ Plots by list:
* Univariate 1st order analysis against ran... |
f0e37ac590764f7c82ef512be11c8b2399aac6ded6b6f1b0afa221e3d8940499 | Python | 47,318 | 1,123 | """
Based on
https://github.com/IvanDrokin/torch-conv-kan
"""
import math
import torch.nn.functional as F
from typing import Tuple, Union
import torch
import torch.nn as nn
from torch.nn.functional import conv3d, conv2d, conv1d
class WaveletConvND(nn.Module):
def __init__(self, conv_class, input_dim, output_... |
265707798d34e1f593b52fdf47d75f85ef304736b2dd61a49a82aca43763904e | Python | 47,334 | 913 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import dill
import os
import time
import glob
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import auc
import statsmodels.ap... |
39dab036b6e7e3a6debea30b13937d9be71e960045fa4c0150693c14e91b3b4d | Python | 47,391 | 1,319 | """
Contains class Image that defines basic properties of an (gray-scale, integer,
...) image represented by an ndarray.
This is a base class for specialized classes dealing with different types
of images. This class should not be instantiated
# Author: Vladan Lucic (Max Planck Institute for Biochemistry)
# $Id$
""... |
39d3fae1f2b9ade79b8a4562eb4cfd853a4782c492491cb4eaff9227017ab4c3 | Python | 47,495 | 1,739 | """
Improved support for Microsoft Visual C++ compilers.
Known supported compilers:
--------------------------
Microsoft Visual C++ 14.X:
Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)
Microsoft Visual Studio Build Tools 2019 (x86, x64,... |
285db0456e039f1cc81cc40f7502ad27936528e5e472dfcab591d2eb401413a7 | Python | 47,548 | 1,047 | import pathlib
import os
#from urllib.request import HTTPPasswordMgrWithDefaultRealm
#import sys
#sys.path.append(os.path.join(pathlib.Path(__file__).parent.resolve(),'mmpose'))
import mmcv
#from mmcv import Config
import mmpose
#from mmpose.models import build_posenet
import poseConfig
import copy
#from mmpose import ... |
49217d24f6ab9fe368ba4a9060b90a73b3e1303aabcc7c2a7e05d76678fe0cde | Python | 47,650 | 1,219 | """CCF region contour vectorization with shared boundaries.
Extracts oblique 2D slices from a 3D integer-label volume and produces
topology-correct contours where boundaries shared between adjacent regions
are *literally identical* vertex sequences (not snapped, not approximated).
Public API:
extract_obliq... |
26b4100d3fd91ecaab8e943da11eb690a1997830ac7aca7203dfae5d6b140fe9 | Python | 47,657 | 1,023 | from data.constants import IMAGE_DATA_MEAN, IMAGE_DATA_STDDEV, NUM_DURATIONS, NUM_CLASSES, CLASS_FREQUENCIES
from losses.losses import CoxPH, focal_binary_cross_entropy, MultilabelBCELoss
from parser.parser import Parser
from data.ImageDatasets import ImageDatasetByUIDs
import argparse
import json
import loggin... |
ae90ecc109c4f6f7cc2cf6f76e39fe4724632eb65f65f74a689608a1733513c1 | Python | 47,683 | 977 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import time
import glob
import re
import seaborn as sns
from sklearn.decomposition import PCA
... |
ab24770519a1b49b74787cec9421c72892a806a3c0f2ca82a06a42b178e2832b | Python | 47,734 | 858 | from best_cut_node import best_cut_node
import numpy as np
from sklearn import datasets
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
import pandas as pd
import random
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
import time
... |
fe357c11c2f9169bbb66f4125ac4e2e6cdab75620f29c2ef74c7f3aba0818267 | Python | 47,834 | 1,171 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 19 16:24:35 2018
@author: Laure Spieser and Boris Burle
Laboratoire de Neurosciences Cognitives
UMR 7291, CNRS, Aix-Marseille Université
3, Place Victor Hugo
13331 Marseille cedex 3
This file is part of Myonset.
Myonset is free software: you can redistribute it and/or m... |
106133ef3f12724cc30a406ecfd39ba843593f2936833178515fdd1b12be37f8 | Python | 47,836 | 1,284 | """Definition of the main widgets, with recordings.
"""
from datetime import time, datetime, timedelta
from functools import partial
from logging import getLogger
from re import compile
from numpy import (abs, amax, arange, argmin, around, asarray, ceil, empty, floor,
in1d, max, min, linspace, log2,... |
909844d432029da1702e7154d047b0edc49a5b44b942d8f91ba019a20579d65d | Python | 47,857 | 1,184 | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
6f4af92799fd256d8bb157ff014a6fe946045eb4c58f5ee3f696c2ef1b78c5c9 | Python | 47,983 | 1,328 | '''
Classes for representing tomograms with filaments
'''
import os
import copy
import numpy as np
import scipy as sp
from shutil import rmtree
from .utils import *
from pyorg import pexceptions, sub
from pyorg.globals.utils import unpickle_obj, trilin3d
from pyorg import globals as gl
from pyorg.diff_geom import Sp... |
09ae04edd387e1ce11958ef64d0a42308ceb36891a8137fb9c1736d9cb6ae26a | Python | 48,086 | 1,137 | """Definition of ``EventModel`` class.
The ``EventModel`` class is the base model for estimating
hidden multivariate pattern models.
"""
import multiprocessing as mp
from itertools import product
from typing import Any
from warnings import warn
import numpy as np
import xarray as xr
from hmp.basedata import BaseDat... |
383e3848c26783b888819aeb3c68b42a77d2cc6c42840187a8b6dc17181103a4 | Python | 48,091 | 701 | """Generate history figure after Twave personalisation"""
import os
import sys
from warnings import warn
import math
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from datetime import datetime
if __name__ == '__main__':
anatomy_subject_name_list = ['DTI024', 'DTI004', 'DTI032']
f... |
ed11e941658a53ef9a8c86c5efe19bf8bc19e7491b4d5f358b55797a84b08c5c | Python | 48,105 | 1,343 | """Profile the memory usage of a Python program"""
# .. we'll use this to pass it to the child script ..
_CLEAN_GLOBALS = globals().copy()
__version__ = '0.61.0'
_CMD_USAGE = "python -m memory_profiler script_file.py"
from contextlib import contextmanager
from functools import partial, wraps
from inspect import isc... |
d3cc6ac407393392b421623ec9f725f4f20ae7bf3da619480ef6073da69c8e08 | Python | 48,108 | 1,088 | # Copyright (c) 2020, Ko Sugawara
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
6dbfbf02a71d285c96c073630b629dd674b0811f5af51e0e960691aaa03424a5 | Python | 48,110 | 1,076 | """Unit tests for the multi-format point-reorient tool.
Covers:
- detect_file_kind: extension-based + NPY shape-based discrimination.
- load_any / save_any round-trip for TIFF, NPY-as-image, NPY-as-points,
CSV (cellpose 2D and 3D styles), TXT.
- apply_op_to_image / apply_op_to_points equivalence to the exi... |
5755ad84674518df42ecd76a92ca4ba58609d18598c146d16c15cc7f145f60f5 | Python | 48,173 | 979 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import seaborn as sns
from sklearn.decomposition import PCA
from sklearn.preprocessing import ... |
2e33b919e5166f7efdbcb89a2c59b340c8be5b195318366644ea08af346e4d5f | Python | 48,256 | 1,360 | """Acquisition functions for Bayesian Optimization.
The acquisition functions in this module can be grouped the following way:
- One of the base acquisition functions
(:py:class:`UpperConfidenceBound<bayes_opt.acquisition.UpperConfidenceBound>`,
:py:class:`ProbabilityOfImprovement<bayes_opt.acquisition.Probabilit... |
df7919ced5f7c81d6c493235420e173c9f9fcf22a9a1a2ce601a0a3503690c6a | Python | 48,507 | 810 | import binascii
import glob
import hashlib
import os
import pickle
from collections import defaultdict
from multiprocessing import Pool
import random
import copy
import pandas as pd
import numpy as np
# from biopandas.pdb import PandasPdb
from Bio.PDB import PDBParser,MMCIFParser
import torch
from rdkit.Chem import Mol... |
7ba0720e4c3fe83bafdf6df120be1b0499106dc3cce9c35f95a2919ad1c23715 | Python | 48,517 | 904 | import os
import multiprocessing
import random
import numpy as np
os.environ['TF_ENABLE_EAGER_CLIENT_STREAMING_ENQUEUE']='False'
import tensorflow as tf
from tensorflow import strings as tfs
import src.metrics as metrics
import src.utils
from src.losses import poisson_multinomial
from scipy.stats import zscore as zsc... |
2be596999c16717b3d16f5f49f9df496689a04f71306eb43c03eb65db8275f0a | Python | 48,603 | 1,526 | import importlib, functools
import builtins
import datetime
import math
import multiprocessing
import sys, os
import time, json, shutil, string, subprocess
import timeit
import traceback
import numpy
from tqdm import tqdm
import yaml
import random
import pandas as pd
import warnings
try:
import StringIO
excep... |
877f9ee52b9f8cb90b32ca3653401c760245587450ac969d90cc3f0fcfc69462 | Python | 48,610 | 1,558 | """Plotting
-----------
Functions starting with 'plot_' plot to a gridspec cell and are used in
figures.py.
"""
from mesocircuit.parameterization.base_plotting_params import rcParams
from re import I
import matplotlib.patheffects as PathEffects
from matplotlib.patches import Rectangle
from matplotlib.ticker import Ma... |
ae72ccfb530c4205a6fa530e1f3f5aed727460044fd719ee0805a4418d17b034 | Python | 48,643 | 1,254 | """distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
import sys
import os
import re
import warnings
from .errors import (
CompileError,
LinkError,
UnknownFileError,
DistutilsPlatformError,
DistutilsModuleErro... |
159ec7b533dfa2ef2bae9338b6537c578ac320e14af6eeb544b52241f172d0fa | Python | 48,791 | 1,215 | import contextlib
import math
from abc import ABC, abstractmethod
from collections.abc import Iterable, Mapping, Sequence
from html import escape
from itertools import zip_longest
from types import MappingProxyType
from typing import cast
import adjustText
import anndata as ad
import matplotlib.patheffects as PathEffe... |
2141417211276021495e2ee037ab3a159328ae33a9c39af709088e9474603443 | Python | 48,812 | 1,174 | ##
# \file intra_stack_registration_test.py
# \brief Class containing unit tests for module IntraStackRegistration
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date October 2016
# Import libraries
import SimpleITK as sitk
import itk
import numpy as np
import unittest
import sys
import os
from scipy.n... |
54ac0c7993448cb75f5d211365cf1604ad6353527e3b8f4240b9467167e08245 | Python | 48,875 | 1,009 | """
Performs Univariate 1st order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
Output: - Plots by tomograms:
+ Plots by list:
* Univariate 1st order analysis against ran... |
5cff216b5399419d52a5b8a425cb35abdaade81594ff4f2823db60723237445a | Python | 48,929 | 791 | import multiprocessing
import os
import sys
from warnings import warn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from datetime import datetime
if __name__ == '__main__':
if len(sys.argv) < 2:
anatomy_subject_name = 'DTI032'
ecg_subject_name = 'DTI032' # Allows using a ... |
5c6607ae1065eb3c252cc8f0014b7e56ef12e5a5f8485dd122a5223811521dd5 | Python | 48,974 | 1,637 | """Classes and methods for chemical fingerprint storage and comparison.
Author: Seth Axen
E-mail: seth.axen@gmail.com
"""
from __future__ import division, print_function
from collections import defaultdict
import pickle as pkl
import numpy as np
from scipy.sparse import issparse, csr_matrix
try:
from rdkit.Data... |
59a5db85766326a1159181da46e27f6ce7c428db3cb326c0ffe33e5265b6ba31 | Python | 49,008 | 900 | """
DeepLabCut2.0 Toolbox (deeplabcut.org)
copyright A. & M. Mathis Labs
https://github.com/AlexEMG/DeepLabCut
Please see AUTHORS for contributors.
https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS
Licensed under GNU Lesser General Public License v3.0
"""
import os
import os.path
import glob
import cv2
import... |
117b37f469cee96bb659660822bf01c8fdc1ff025176bf4bf922737681f4b6a2 | Python | 49,034 | 1,208 | import platform
import serial
import sys
import serial.tools.list_ports
import time
import numpy as np
import threading
from crc import CrcCalculator, Crc8
from control._def import *
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from qtpy.QtGui import *
# add user to the dialout group to avoid the need to u... |
10a8b31d733386c7c7b449315ed318fb5b9815ad5bfc8f030d34ee28b1fd7066 | Python | 49,039 | 1,122 | """
Basic greyscale analysis of aligned frames and original (non-aligned)
frame stacks.
Contains:
- analyze_frame(): function that displays the analysis results
- class FrameSeries: getting and analysing aligned and original frames
# Author: Vladan Lucic (Max Planck Institute for Biochemistry)
# $Id$
"""
from __f... |
e598205eb31ddb97bdf5b763818ad91fcef7251567201cc4ce50c6302194fdfa | Python | 49,043 | 1,035 | """
Performs Univariate 1st order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
Output: - Plots by tomograms:
+ Plots by list:
* Univariate 1st order analysis against ran... |
63e0c4c3a6d86ff14ae5d8b3b27876e9cf1c70fef760ec7fbc200472318485c8 | Python | 49,058 | 1,033 | """
Performs Univariate 1st order analysis to a SetListTomograms object by tomograms
Input: - A STAR file with a set of ListTomoParticles pickles (SetListTomograms object input)
Output: - Plots by tomograms:
+ Plots by list:
* Univariate 1st order analysis against ran... |
4ff01d602a5ceae9bc41938a8ae2aa6818a8ad6790ddc8f38fc47cfcdc152a5a | Python | 49,123 | 1,050 | """The midsagittal plane: one model shared by every hemisphere consumer.
The plane is parameterised by the voxel axis that carries world-X rather than
by a hardcoded axis order, so a single implementation covers the Allen CCF
(PIR, medio-lateral on axis 2), Waxholm (RAS, axis 0), and any custom template.
``slop... |
5193b52e3221b4508c7656e2cf7f608f7ada57e0267f7481c331b37c0a62307c | Python | 49,330 | 1,399 | #!/usr/bin/env python
# Copyright 2015,2016,2017 Nir Cohen
#
# 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... |
1b0a381506dc45ae972dcccc413c2d6c868f0614309ee40f9322ce707110feca | Python | 49,363 | 1,458 | # 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... |
5163dbad8ae9e1e337969b4b20b9753e2de238b84e32faed039338eb7bcde946 | Python | 49,364 | 1,082 | from scipy import signal, stats, io
import xarray as xr
import matplotlib.pyplot as plt
from neurolib.models.wc import WCModel
from neurolib.utils.collections import dotdict
from .boldIntegration import simulateBOLD
from .read_utils import generate_sw_matrices_from_mat
from .read_utils import read_onsets_from_mat
impor... |
c471657d269b5411c6aac8a26924fab11af25386a12f7f930eadbee0e713e3e8 | Python | 49,379 | 1,225 | import os
import csv
import math
import lmdb
import pickle
import logging
import warnings
from collections import defaultdict
from collections.abc import Sequence
from tqdm import tqdm
import numpy as np
from rdkit import Chem
from rdkit.Chem.Scaffolds import MurckoScaffold
import torch
from torch.utils import data ... |
9b221c16739b30a767fe29a8e048634520cb35e37dfba6b52e9dc40339ad04b0 | Python | 49,603 | 1,147 | """
Multiple functions or classes that can be used to interact with the Wikibase instance.
"""
from __future__ import annotations
import datetime
import json
import logging
import re
import threading
import warnings
from time import sleep
from typing import TYPE_CHECKING, Any
from urllib.parse import urlp... |
f2183307c1618fad693f2913bb9e65133153ea8a66086dd7812d4752b3f48dac | Python | 49,735 | 1,066 | from typing import List, Union, Tuple, Optional
import pandas as pd
from mnp.definitions import (DATA_DIR,
DOCKSTRING_DATAPOINT_SPLIT_DICT,
DOCKSTRING_FUNCTION_SPLIT_DICT)
from mnp.datasets.graphs import (MolecularGraphMetaDataset, MolecularGraphSimpleDataset)
f... |
934cfa6ddc2917ab0261f05b84f0a5751ca4fac21ec8b7727fc9a6fc692a98c4 | Python | 49,823 | 1,427 | import os
import shutil
import tempfile
from contextlib import ExitStack, contextmanager
from enum import StrEnum
from pathlib import Path
from typing import Literal, Sequence, Tuple
import bpy
import numpy as np
import numpy.typing as npt
from mathutils import Vector
from mathutils.bvhtree import BVHTree
from tqdm.aut... |
fb2286d330eff7b61e3b596eb3b10bc89da0d75647e378a6e079eff0aae55103 | Python | 49,843 | 1,127 | import numpy as np
from envs import *
from learners import *
import matplotlib.pyplot as plt
import seaborn as sns
from copy import deepcopy
import os
np.random.seed(123)
sns.set_theme('talk', font_scale=1.2)
# plt.rcParams['figure.figsize'] = (np.array([6.4, 4.8])/3).tolist()
cmap = sns.color_palette('... |
f81d964fb402e0d9f89f09f600dff45d9e69379f51be8d57588ddadfe1e6cc8a | Python | 49,992 | 1,080 | """
Created on Wed Mar 30 12:13:39 2022
@author: Haotian Teng
"""
import torch
import itertools
from torch.nn.functional import normalize,one_hot
import numpy as np
from typing import List,Union
class GaussianEmissions(torch.nn.Module):
def __init__(self, means:np.array,cov:np.array, trainable:np.array = None, fix... |
5da4ed27d2e62b849cbb2448a8db16210915309f3948574185ed7f39e7fb4f02 | Python | 50,150 | 1,120 | options = dict(
verbose=True,
model_extensions=[
'h2o.model.extensions.ScoringHistoryTrees',
'h2o.model.extensions.VariableImportance',
'h2o.model.extensions.FeatureInteraction',
'h2o.model.extensions.Trees',
'h2o.model.extensions.SupervisedTrees',
'h2o.model.exte... |
f9ab66a817df1f3a935f96d2b1df0f921f35eb7d7c5210c07bb75ac49dcb5c14 | Python | 50,171 | 1,280 | # 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... |
614e8e78b7563c358c83e19109eca44f6d5f3a9ecfc40627d6ec27a11a48fae3 | Python | 50,174 | 1,287 | """distutils.dist
Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
"""
import sys
import os
import re
import pathlib
import contextlib
import logging
from email import message_from_file
try:
import warnings
except ImportError:
warnings = None
from ... |
75b78dff5af55b45a5326eb28b3567ba0a69e22e375b89cd126c6baf5744cd02 | Python | 50,182 | 1,290 | """
Code for "Generative Adversarial Networks". Please cite the ArXiv paper in
any published research work making use of this code.
"""
import functools
wraps = functools.wraps
import itertools
import numpy
np = numpy
import theano
import warnings
from theano.compat import OrderedDict
from theano.sandbox.rng_mrg impor... |
a35da0c38544a58d2fc16a6b11aa830f58f320f478f303dbd40fb75d619402f4 | Python | 50,184 | 1,301 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
628a687991a8a7c5f67f071d079609c6ba8914159b21d0335b4811ada4dcaf63 | Python | 50,252 | 954 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import dill
import os
import time
import glob
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import auc
import statsmodels.ap... |
c54f780a4bac2cccbb29885b74dd466a999b3237ea7f8e0d75ed145a32f0a468 | Python | 50,253 | 1,275 | import pytest
import numpy as np
from ase import Atoms
from ase.build import molecule
from scipy.spatial.transform import Rotation as SciPyRotation
import sella.internal as internal_module
from sella.internal import (
Bond, Angle, Dihedral, Displacement, Rotation, Constraints, Internals
)
def res(pos: np.ndarra... |
a6710e1b1456bf0719aba2a8063cdfe07fa640d7362ceceb36d070addadc3c2d | Python | 50,382 | 844 | import binascii
import glob
import hashlib
import os
import pickle
from collections import defaultdict
from multiprocessing import Pool
import random
import copy
import pandas as pd
import numpy as np
# from biopandas.pdb import PandasPdb
from Bio.PDB import PDBParser,MMCIFParser
import torch
from rdkit.Chem import Mol... |
e77615fcc0ed7a9e7ab74be9f13d81d87c1625021c81d1d983fe1aa47df694b3 | Python | 50,405 | 1,163 | import argparse
import cv2
import time
import numpy as np
import PySpin
from control._def import *
class ReadType:
"""
Use the following constants to determine whether nodes are read
as Value nodes or their individual types.
"""
VALUE = 0,
INDIVIDUAL = 1
try:
if CHOSEN_READ == 'VALUE':
... |
d6b4281095e0a2ed8da0936fff1c2fb0d6083f4c2155ddec40112d1d412b38db | Python | 50,429 | 2,374 | from __future__ import annotations
import cv2
import numpy as np
from skimage import filters as sk_filters
from skimage.measure import label
from skimage.morphology import remove_small_objects
from skimage import filters as sk_filters
from skimage import morphology
from skimage import measure
from skimage.measure imp... |
b3918e9203c449721704cc7a809604555c77d74b2a232e220da06f6822efa28a | Python | 50,430 | 1,355 | from __future__ import annotations
import warnings
import numpy as np
import pandas as pd
import torch
from scipy.interpolate import PchipInterpolator, interp1d
from sklearn.isotonic import isotonic_regression
from SurvivalEVAL.evaluations.custom_types import Numeric, NumericArrayLike
def _check_control_definition... |
f27898ae899a6d6cd0da4ab2912418e772a080e96228caafc79f3927381f1d7c | Python | 50,453 | 1,230 | """
Set of classes for dealing with a STAR files (Relion's format)
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 1.06.16
"""
__author__ = 'Antonio Martinez-Sanchez'
import copy
import pyto
import errno
from pyorg.globals import *
# from plist import TomoPeaks
from .plist import ... |
77e339be0c62cce18b127f44842ceb00e79982b8f2f97121f2e317633794a25d | Python | 50,512 | 1,292 | ##
# \file stack.py
# \brief { item_description }
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date September 2015
#
import os
import re
import numpy as np
import SimpleITK as sitk
import pysitk.python_helper as ph
import pysitk.simple_itk_helper as sitkh
import simplereg.resampler
impor... |
860cab9058f98655a67a42f6bdd7af88ca106c7a269cb2598c47efd54896757b | Python | 50,518 | 952 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import dill
import os
import time
import glob
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import auc
import statsmodels.ap... |
b7478d10e2ccfdb22128867e137f16f55b687e9c225065e91bcbd6bb9e6c0352 | Python | 50,518 | 1,058 | # New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt,
# and (in the case of viridis) Eric Firing.
#
# This file and the colormaps in it are released under the CC0 license /
# public domain dedication. We would appreciate credit if you use or
# redistribute these colormaps, but do not impose any legal r... |
60c7e88be80a33c496364b92da92f0614f8a6b8d4180d7130eb54832b1b0171b | Python | 50,549 | 915 | # 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... |
648e710375b3d9f50e27f266762464e8412491da6eb6e9696762604501ca5130 | Python | 50,629 | 1,186 | # coding=utf-8
# Copyright 2018 The Microsoft Research Asia LayoutLM 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/... |
b29ee3451abf73d8a74849d586827bc4ce5de419e39fbc3215534120d2fa6664 | Python | 50,638 | 1,253 | r"""Test OpenBabel Python bindings
On Windows or Linux, you can run these tests at the commandline
in the build folder with:
"C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake
-R pybindtest -VV
The runtime directory is ${CMAKE_SRC_DIR}/test.
You could also "c... |
ae6b0eace50f431d39565ae1954fbeaf7ee03f5d73764f770a381f7c5bfaa9ed | Python | 50,640 | 954 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 08:00:51 2020
@author: daltonm
"""
#%matplotlib notebook
import numpy as np
import pandas as pd
import dill
import os
import time
import glob
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import auc
import statsmodels.ap... |
b08f158f489b5d89743320a94dd68e93c16824f60d322148fcd31755b182dd85 | Python | 50,674 | 1,524 | #!/usr/bin/env python3
#******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
... |
327ff5159979a26e6a3fba5d8c178d3a06127a39083542a715c1ab4ba0e256e2 | Python | 50,746 | 918 | #!/usr/bin/env python
import argparse
import logging
import os
import sys
import numpy as np
from shutil import copyfile, rmtree
from ase import units
import torch
import torch.nn as nn
from torch.optim import Adam
from torch.utils.data.sampler import RandomSampler
import schnetpack as spk
from schnetpack.utils.script_... |
4a48c04005e96f644a64dd1cd906dcf69908e574056a700d3accf291d23ea2cf | Python | 50,883 | 1,096 | """Infrastructure for caching HED schema from remote repositories."""
from __future__ import annotations
import functools
import json
import os
import re
import shutil
import time
import urllib
from hashlib import sha1
from pathlib import Path
from shutil import copyfile
from urllib.error import URLError
from semant... |
f2f89915f2e15e2515f9ff35e14989e12aecdd4b1782614b5013516c98d894c5 | Python | 50,890 | 1,164 | """
Tests module observations
# Author: Vladan Lucic
# $Id$
"""
from __future__ import unicode_literals
from __future__ import division
from builtins import zip
from builtins import range
#from past.utils import old_div
__version__ = "$Revision$"
import sys
from copy import copy, deepcopy
import pickle
import os.p... |
ec220516d8f4749ff6aa2e82a3b4863e0344982badc68bc7ed639098e54e9ef7 | Python | 50,975 | 1,351 | #!/usr/bin/env python3
# ******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.