sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
da70fb690cfddeb410b3b14480acd45bf06d882fd3879331f3843adaf4ea8c50 | Python | 37,896 | 989 | """
This module defines the classes for different types of compartments in a neuron
model.
The `Compartment` class is a base class that provides the basic functionality for
a single compartment. It handles all differential equations and parameters needed
to describe a single compartment and any currents passing throug... |
d1c929e5813ff19009c01e827165ae07818a78fecfef85c7b2d9e4a9bf56332b | Python | 37,943 | 776 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
# Modifications Copyright 2018 Arman Cohan
#
# 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 Licens... |
db3778dd2a27a191b00d39f2576b9e602d2879cefddb0f44ba64e52fff86be70 | Python | 37,983 | 1,282 | # %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import warnings
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns
from anytree import LevelOr... |
dd04a1dc2c0fe495270ba6a8f0590e7485772c467c67714189db1362f2b8f943 | Python | 38,006 | 1,231 | # /usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright 2016-2019 Blaise Frederick
#
# 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/LICEN... |
5c9590bec4f509f54e17bd45592f265cd4d03919b0d37287c37e8d2c3ca96e98 | Python | 38,009 | 1,138 | # -*- coding: utf-8 -*-
"""
Graph Neural Network-Based Anomaly Detection.
References
----------
[1] Deng, Ailin, and Bryan Hooi. "Graph neural network-based anomaly detection in multivariate time series."
Proceedings of the AAAI conference on artificial intelligence. Vol. 35. No. 5. 2021.
[2] Buchhorn, Katie, et al. "... |
260e57be86fcfce5d60d5778d2d2826773f51dc297e4ec447c1e2a9f22b73a7c | Python | 38,085 | 1,057 | # Code written by: Maksim Imakaev (imakaev@mit.edu)
"""
Analyses of polymer conformations
------------------------------
This module presents a collection of utils to work with polymer conformations.
Tools for calculating contacts
------------------------------
The main function calculating contacts is: :py:func:`... |
d92865c057556d7d746e3bf1cb7ab51eda54d48d6c0978af2ee59f49fdd113c4 | Python | 38,108 | 1,112 | # -*- coding: utf-8 -*-
import collections, os, random
import re, subprocess, tempfile, warnings
import numpy as np
import tensorflow as tf
from six.moves import urllib, xrange
from tensorflow.python.platform import gfile
from . import _logging as logging
__all__ = [
'generate_skip_gram_batch',
'sample',
... |
b1424881030fa694ccf8eee16a28d10f50e075f8fb46bb71e7233202414eb5f4 | Python | 38,186 | 902 | import logging
import time
from collections import ChainMap
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass, field
from typing import Any, ClassVar, Dict, Iterable, Iterator, List, Optional, Tuple, Union
from urllib.parse import quote
import numpy as np
import pystow
import requests... |
cd5ca7c4b359238894c0a6485b5f6f470f6e334faa794b084f7de06545ab67e5 | Python | 38,247 | 1,163 | #!/usr/bin/env python
"""
plot.py -- simple plotting utilities for quot
"""
import sys
import os
# Numeric
import numpy as np
from scipy import ndimage as ndi
# Dataframes, for handling trajectories
import pandas as pd
# Core matplotlib library
import matplotlib.pyplot as plt
# Color schema
from matplotlib im... |
3fc18c1b02e51e43b4317c785a78fedeab75aa5405ff7f406bead4b5d3f9c92a | Python | 38,275 | 798 | """
========================================================================================================================
Auxiliary Module
========================================================================================================================
Utility functions that are frequently used in specific ex... |
9fc472ecdcfe2163347f9c3be9b4755b7d11cbdd9d4f5e906eebd8430c23053f | Python | 38,348 | 1,099 | """Representation and execution of complex boolean queries.
See also `<https://incatools.github.io/ontology-access-kit/howtos/use-oak-expression-language.html>`_.
"""
import itertools
import logging
import re
import secrets
import sys
from enum import Enum
from typing import IO, Any, Dict, Iterable, Iterator, List, O... |
fbbe3fb78fa47a690b2980d4d06721cc9ff7dd315fabd988e57ae07cd8ca1f5a | Python | 38,384 | 1,156 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""NDVar operations
NDVar methods should work on all NDVars; This module defines operations that
depend on the presence of specific dimensions as functions, as well as
operations that operate on more than one NDVar.
"""
from collections import defaultdict
from c... |
507f2d9b60b6141347489ba30f02347f053475e0c130056d166459151a5d7814 | Python | 38,464 | 905 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import math
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import cli... |
c72d12bd1df5a192d19df6e9bb83315c0731cb358759ea55d808e2f41a39fdb2 | Python | 38,483 | 897 | """Validate the wrapper's inputs and unwrap labeled (xarray) ones.
Resolves the semantic roles of DataArray dimensions, infers the sampling rate
and start time from a time coordinate, and extracts signal labels and
metadata, so the numerical core always receives positional arrays.
"""
import warnings
from collections... |
35425a507e9a3ef1e9e6acbbb91954a548143d3bf17824e5620047cfbc0b5774 | Python | 38,517 | 825 | import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
from .hyperparam import get_saved_config
from .utilities import build_predictions_df, check_na, switch_layer_to_traineval_mode, require_nonleaf_grad
from .data_preprocess import PESeqProcessor
fr... |
17c7986395cb588b0df3ed9944a3ea82ba04603d746afc50f4436a38d2bcc66b | Python | 38,569 | 1,127 | """Parcellation."""
from __future__ import annotations
import logging
import warnings
from pathlib import Path
import mne
import scipy
import numpy as np
import nibabel as nib
import matplotlib.pyplot as plt
from nilearn import plotting as nilearn_plotting
from osl_dynamics import files
from osl_dynamics.utils impo... |
44d9a88cb5c9b835426fa2399647ce1bf6f3b7f2520ea7a05b5d88493847fd30 | Python | 38,660 | 957 | import sys
import types
from math import ceil
from types import SimpleNamespace
import pytest
# Provide a minimal cython stub when the real package is unavailable.
if "cython" not in sys.modules:
cython_stub = types.ModuleType("cython")
def _identity_decorator(*args, **kwargs):
def decorate(func):
... |
63d3a68523044afa08a0bd2f7e7e243e81468e6a743174f4cbc0ba976371012a | Python | 38,693 | 878 | import torch.nn as nn
import torchvision.models as models
import cv2
import numpy as np
import cupy as cp
import torch
import torchvision.transforms as transforms
from numpy.fft import fft
import scipy
from typing import Union, Tuple, List
from pandas import DataFrame
from skimage.feature.peak import peak_local_max
fr... |
e0b4944c77ad154645d9502ee8437617fcec3c55e59067bf17eedd34c66c86a5 | Python | 38,740 | 1,191 | import os
import numpy as np
import math
import pandas as pd
import cv2
import pickle
import colorsys
import pyqtgraph as pg
from scipy.interpolate import interp1d, splprep, splev
from .uuuuuu import rotation_z, rotation_x, rotation_y
def get_closest_point_to_line(p0, r, p):
ap = p - p0
res = p0 + np.dot(ap, ... |
45a3aba3e40c67d4c514a47ba5f8fcb1dee4391721979a3b632ac00ebebb26a7 | Python | 38,750 | 936 | import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import os
import sys
import glob
import pandas as pd
import numpy as np
import gym
from gym import spaces
import sim_analysis
import tqdm
from pprint import pprint
import config
from scipy.spatial.distance import cdist
import sim_utils
... |
10b2355e1b12831679e9fc425f83cef59c9f094758017e1705dd465da679c0d6 | Python | 38,771 | 800 | # @Author: Thijs L van der Plas <thijs>
# @Date: 2020-11-25
# @Email: thijs.vanderplas@dtc.ox.ac.uk
# @Filename: analysis_functions.py
# @Last modified by: thijs
# @Last modified time: 2020-11-25
import numpy as np
from tqdm import tqdm
import pandas as pd
import matplotlib.pyplot as plt
import scipy.spatial, sci... |
0ffb9721a3eafd9b7e1b8f221c9fadf38c4f5f348d3fb636a59278822831df44 | Python | 38,777 | 835 | import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
from .hyperparam import get_saved_config
from .utilities import build_predictions_df, check_na, switch_layer_to_traineval_mode
from .data_preprocess import PESeqProcessor
from .dataset import cre... |
906a86ad6a0fe5d1b8cf9404684e40735bbbbfc934ca96db6966cecb7117f8d4 | Python | 38,817 | 917 | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# 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 agre... |
ef592e353e43c1f8ed06369f5655ca4079e90489c5c65f2160499eb267ca6521 | Python | 38,938 | 1,003 | """
Graph analysis for BrainAtlas
"""
import os,gc
import numpy as np
import pandas as pd
import rpy2
## Plots
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import seaborn as sns
import siVAE
from siVAE.model.output import output_handler
from siVAE.util ... |
1e8c6a3f2a2b5d26553d7853cda869b3e1310825ffa8d406cba1203d57f8366e | Python | 38,939 | 1,078 | """Base class for models."""
import logging
import os
import pickle
import re
import types
import uuid
import warnings
from abc import abstractmethod
from dataclasses import dataclass
from io import StringIO
from contextlib import contextmanager
from typing import Generator, List, Optional, Tuple, Union
import yaml
i... |
e3be85984b437622be4f28b2828644f664927a47736236b810cd6446e28d5d48 | Python | 38,944 | 964 | import logging
import re
import shutil
import sys
import tempfile
# https://github.com/althonos/pronto/issues/173
import warnings
from collections import defaultdict
from dataclasses import dataclass
from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Tuple, Union
import pronto
import sssom_sch... |
bc10e5a7419330473e961da14a0ab5d410af8e991a8cadbbe3d41c878bb8bded | Python | 38,968 | 1,436 | # %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import warnings
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns
from anytree import LevelOr... |
132af7c64cf9e73275f3b0520ca26b3f2e9fa199756c6d41af0f42d774666f03 | Python | 39,105 | 1,241 | import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
import matplotlib
plt.switch_backend('agg')
import sys
import pandas as pd
import os
import pickle
import cv2
import more_itertools as mit
from skimage import io
# import statsmodels.api as sm # need to downgrade to scipy==1.2
bsl_s=1
tail_s=1
... |
95ffeb038339799fc4fd0baedcaaa2a988308d74e2edfa50835861c092fa1feb | Python | 39,227 | 1,054 | """
This module provides the `TrainModel` class and supporting methods.
"""
import copy
import logging
import math
import os
import random
import shutil
import warnings
from time import time
import numpy as np
import tensorboard as tb
import torch
import torch.nn as nn
from selene_sdk.utils import (
PerformanceMet... |
72eb54cb72bf3a349e0fc6de95b389a6be3473bb6e8d783d93ca2518f7a9b4ee | Python | 39,322 | 1,140 | #!/usr/bin/env python
from __future__ import print_function
from optparse import OptionParser
from collections import namedtuple
import os
import sys
import shutil
import subprocess
import tempfile
import gzip
import math
import time
import re
import os
def is_nonempty_file(path):
return os.path.isfile(path) and (os... |
dbe8b4e927e77bd79077ab5df988040ae30ed7e2e9fbbd7da7025332990b97a4 | Python | 39,323 | 958 | # Copyright (c) 2026 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>.
"""Offline unit tests for the Autoware lanelet2 map generator's stop-sign
regulatory-element injecti... |
13f01149366eea2a8e13aba2f65698a6d696b79cc5ef8f5d4d685fa836551365 | Python | 39,326 | 1,068 | """HIVE (HMM with Integrated Variability Estimation).
See the :doc:`model description </models/hive>` for more details.
"""
import logging
from typing import List, Optional, Tuple, Union
from dataclasses import dataclass
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.... |
53d5e6d3302b010ef117cf46b6a303bc5171d2e9fda24bf4fc1078aa174e579d | Python | 39,370 | 1,044 | """
A simple library of functions that provide feature importances
for scikit-learn random forest regressors and classifiers.
MIT License
Terence Parr, http://parrt.cs.usfca.edu
Kerem Turgutlu, https://www.linkedin.com/in/kerem-turgutlu-12906b65
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as p... |
b12203f4d224fcc00841d83e7ade06d92c59b3ae420a489ce9f79255020caa6e | Python | 39,439 | 939 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, xavier_init
from mmcv.runner import force_fp32
from mmdet.core import build_sampler, fast_nms, images_to_levels, multi_apply
from ..builder import HEADS, build_loss
from .anchor_head import AnchorHead... |
da10e7a5a8b94ea515f71730f9b828a2c307218d6f823b4b10c4a1cdd160f5e2 | Python | 39,440 | 577 | """Full-clip hybrid run: ego follows the recorded trajectory, synthetic cars drive on the proxy road, every
frame = engine colour+distance+opacity at the camera pose + CARLA layer -> depth-tested composite with cast
shadow (hybrid_video_finish.py). The CARLA layer is path traced by `sensor.camera.rt_lens` in the record... |
87a56ca979f1840ce4e632f318565590642efa5bd9448f47e1f6ed4658ef6736 | Python | 39,474 | 604 | #!/usr/bin/env python
# This script is adapted from Xie's and Ulissi's scripts.
import numpy as np
from pymatgen.analysis.structure_analyzer import VoronoiConnectivity
from pymatgen.io.ase import AseAtomsAdaptor
class Voronoi:
'''
Parameters
----------
max_num_nbr: int
The maximum number... |
d79a8113a81f7a4d89a2293bd3fae1e71542a7c0df4db192f2d360d1b6e0e331 | Python | 39,614 | 705 | #!/usr/bin/env python3
"""
File: pre_process_TPM_expression_matrix.py
Created: 2021/11/23
Last Changed: 2022/10/18
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publishe... |
916f7556534f40efae03471ffc7a7f5383a9920977664cd85d751ba48d1ba6ea | Python | 39,637 | 954 | import itertools
from collections import OrderedDict
import numpy as np
import tensorflow as tf
from tensorflow import keras
from .Dataset import get_network_input_obs
def log_normal_pdf(sample, mean, logvar, raxis=1):
log2pi = tf.math.log(2. * np.pi)
lnp = -0.5 * ((sample - mean) ** 2. * tf.exp(-logvar) +... |
5894bbad08d8acb29bfa4728ccbfe84b4fefcb6d8cadb8159b82eebd032d65aa | Python | 39,642 | 1,101 | # This script is part of navis (http://www.github.com/schlegelp/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
7e7683b1a5886762305d29b82de2e74554e24c00afe0ba7a025f92076060497c | Python | 39,734 | 873 | """The NuRec bridge, checked against NVIDIA's shipped artifacts.
Everything here except the ``integration`` tests runs offline: the sample's ``.usdz`` carries
its own rig calibration, trajectory, OpenDRIVE map and one real frame per camera, and
``carla.Map`` builds a map from an xodr string without a server. The poin... |
9314626d18a2c9036aabc4121d1896a325ab5d14b12c8f833d99833982266aaa | Python | 39,754 | 1,108 | # cython: language_level=3
# Time-stamp: <2025-11-10 15:24:27 Tao Liu>
"""Module for FWTrack classes.
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file LICENSE included with
the distribution).
"""
# ------------------------------------
# python modu... |
da56d25fd55c7e2cdb76eacaa88e17965f7a5d8f72daf8dc17dd70fa26d18913 | Python | 39,775 | 1,080 | """
Functions to manipulate and calculate statistics for inferred mode/state
time courses.
"""
import logging
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple, Union
import mne
import numpy as np
import matplotlib.pyplot as plt
from scipy import cluster, spatial, optimize
from sklearn... |
79060171cd44c136de73fa98f1973ad4b723b0f774dfc08716b29e1e4828478b | Python | 39,936 | 874 | import h5py
import numpy as np
import logging
import os
import json
import getpass
import psutil as ps
import scipy.sparse
import scipy.interpolate as ip
from PyQt5 import QtCore, QtWidgets, QtGui, Qt
from Controls import AssignLoadedData, DsetConflictDialog
from pathlib import Path
from collections import defaultdict
... |
3fbd5de408e73215f3d9e508f8dc06582e880756cb1759e4913eb68837125119 | Python | 39,990 | 1,013 | from __future__ import print_function, division
import os
import time
import warnings
import random
import csv
from random import sample
from copy import deepcopy
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from sklearn import metrics
from torch.autograd import Variable
from torc... |
5e276e4bad10a9a9aa129910a3793a90392a077078429aa596b6a547fcc6ded9 | Python | 40,027 | 705 | # Auto generated from association.yaml by pythongen.py version: 0.0.1
# Generation date: 2025-04-15T10:08:18
# Schema: association
#
# id: https://w3id.org/oak/association
# description: A data model for representing generic associations and changes of these associations.
#
# The core data model is broad, encompassin... |
51ba5c56b77bebf817987e6032ba9d209c6b3fe7f9e15d4e68bb7fe817dc83c9 | Python | 40,112 | 1,351 | """Tests for Hero core."""
import logging
import time
import unittest
import flax
import jax
import jax.numpy as jnp
import core
import fn_lib
_ADAM_STRING = """
def train(w, m, v, gradient):
m = interpolate(m, gradient, 0.1)
g2 = square(gradient)
v = interpolate(v, g2, 0.001)
epsilon = 1e-8
sqrt_v = sqr... |
72e98a35a371613cf4b6397fda35ef99c0616698be1bbee752dd3553ed971415 | Python | 40,132 | 992 | import logging
import os
import shutil
import unittest
from unittest.mock import patch
import requests
from kgcl_schema.datamodel import kgcl
from linkml_runtime.dumpers import yaml_dumper
from linkml_runtime.loaders import yaml_loader
from semsql.sqla.semsql import Statements
from sqlalchemy import delete
from oakli... |
b40d5568da856a93c71cf8300ecf3f1594a944f94d0ab2c85d8502e5454be14d | Python | 40,135 | 1,017 | from __future__ import print_function, division
import os
import time
import warnings
import random
import csv
from random import sample
from copy import deepcopy
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.optim.lr_scheduler import ... |
aac913ea7f9fd45ba9657061c4d02e789ac5e8bdf99def8dd9f7b37ad42a72f6 | Python | 40,238 | 851 | import copy
from collections import defaultdict
from typing import Tuple, Optional
from jax import custom_vjp
import jax.numpy as jnp
from jax import value_and_grad, jit, lax
from jax.example_libraries.optimizers import adam
import numpy as np
import pandas as pd
import haiku as hk
# from pydantic.dataclasses import... |
d063a839bdae9aa71fc2a86b5697cb2fea7a1b01e82205aedefcb8b04eebb2ec | Python | 40,278 | 1,198 | __author__ = 'duarte'
"""
====================================================================================
Parameters Module
====================================================================================
(incomplete documentation)
Module for dealing with model parameters
Classes
-------
Parameter - simpl... |
5aaa22b3b1a22647ac855b28182056455923cb3821b2190fc8dd2b5ab95287c1 | Python | 40,298 | 1,010 | import numpy as np
import pytest
from pygenn import types
from pygenn import ParallelismHint, VarAccess
from pygenn import (create_neuron_model,
create_sparse_connect_init_snippet,
create_var_init_snippet,
create_weight_update_model,
init_... |
76c006e36901da1214b1bbdd8735be6adb1ea0e9e422a0dbd428fc2d8b961604 | Python | 40,510 | 974 | # -*- coding: utf-8 -*-
"""
@author: Yuxiu Shao
Statistics of the network connectivity;
Full-rank Gaussian Network and Rank-one Mixture of Gaussian Approximation;
Random component has reciprocal motifs
"""
''' HELP FUNCTIONS '''
import numpy as np
import matplotlib.pylab as plt
from numpy import linalg as la
# from... |
7ad3c2c55408662ad7d404a06a4e9d0c8ecc01a70c9049bd8dd470837103da2a | Python | 40,533 | 633 | #!/usr/bin/env python
'''
code written by Jin Lee (leepc12@gmail.com) in Anshul Kundaje lab at Stanford
April, 2017
'''
import argparse
from argparse import RawTextHelpFormatter
import os
import sys
import json
import re
from subprocess import check_output
from collections import OrderedDict
from collections import de... |
870899f6848e1410ea5299941ee3aea82ca595be7bc77f246bd4cc3235c31c94 | Python | 40,583 | 960 | import datetime
import json
import os
import descarteslabs as dl
from dateutil.relativedelta import relativedelta
import geopandas as gpd
import numpy as np
from scipy.stats import mode
import shapely
from tensorflow import keras
SENTINEL_BANDS = ['coastal-aerosol',
'blue',
'green'... |
b89d0c8f94c5dae9ab2e08abc528d8ac9b792c9cb10bfc60226ed0ca35a4a453 | Python | 40,678 | 867 | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# 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 agre... |
ce9198d707da67698ce9a84a93dac7e96d8e9f660e0c41a77d7861057771d94d | Python | 40,756 | 1,037 | from __future__ import print_function, division
import os
import time
import warnings
import random
import csv
from random import sample
from copy import deepcopy
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from sklearn import metrics
from torch.autograd import Variable
from torc... |
b9044df19c18d0341bb25160c1aba877df806cacd98d2a890a9740105d02aacc | Python | 40,883 | 1,087 | # This script is part of navis (http://www.github.com/schlegelp/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
9fddf6aae210cde6dd93cdddc1af120a10ec3e085e482df490736b85d543f71f | Python | 40,897 | 1,040 | # This script is part of navis (http://www.github.com/schlegelp/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... |
7a10f4c24dbf02089c5f2b782d3df4566a4da3c3be068ddc0a6505f04d9e80e9 | Python | 40,901 | 1,041 | from __future__ import print_function, division
import os
import time
import warnings
import random
import csv
from random import sample
from copy import deepcopy
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.optim.lr_scheduler import ... |
12773af9f2e645fa6a732a38fb0f57e0a4d14ffa738a4d789309e22a0a9be9df | Python | 41,095 | 1,038 | # This script is part of navis (http://www.github.com/navis-org/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
1f8398415a0095e22a2b1cf45ea9c626beec64165d197e1d61386b55fc900dff | Python | 41,158 | 668 | #! /usr/bin/env python3
"""Run the Cosmos mode matrix against a node and keep every video it returns.
One row per mode: what the model is conditioned on (which controls, with which
weights, with which classes masked out) and what the prompt asks for. Every row
is submitted through the Python API, waited for, and stor... |
9d79cf072dbb1073dd8918d3e0b84495cb4c8ff1d8e77cd5a65b5fa7b6a40d98 | Python | 41,274 | 966 | #!/usr/bin/env python
"""
Written by Vijay MK Namboodiri and Randall L Ung of the Stuber lab at UNC-CH
Disclaimer: Some of the structure of this code is borrowed from a similar
script included in Thunder (http://thunder-project.org/) for the set up of
a cluster on AWS. There is no actual or implied warranty for the ... |
d630ab65b322cb2bb7404b3a84bc6aaac4a97398a48bed6af76bbc9671c6e082 | Python | 41,275 | 999 | #!/usr/bin/env python
import os
import json
import argparse
import warnings
from qsprpred.models import QSPRModel
from qsprpred.tasks import ModelTasks
from drugex import VERSION
from drugex.data.corpus.vocabulary import VocGraph, VocSmiles
from drugex.data.datasets import (GraphFragDataSet, SmilesDataSet,
... |
e1128271ae555c7ffb7926bcb5588ed9099b8275f3998a3fff56c4a3d4592796 | Python | 41,325 | 1,111 | # This script is part of navis (http://www.github.com/schlegelp/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
0f66fde57414331c28e22760e9c11d9bc58081306ebd0be175f5e63ec30c5b48 | Python | 41,394 | 998 | import os
import time
import logging
# Tensorflow
import tensorflow as tf
import tensorflow_probability as tfp
import numpy as np
import pandas as pd
import math
from .layer import layer
from .layer import KL_divergence_normal
from .layer import create_variance
from .layer import Distribution
from ... |
637d68a6a298d591b5ab218796cdc1c8537229bc4376bc7530457d87eb7dab7a | Python | 41,455 | 932 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module for the frame-wise correction window widget.
The user can modify the results on a frame by frame basis on this page, e.g. by
changing the identities of ROIs, and/or adding/removing ROIs.
Created on Wed Jun 19 11:48:44 2019
@author: nicolas
"""
import os.path
... |
043d1f3569609bf5213a2d5c33f9294516e1e22fb4a4ab38828cd58378933949 | Python | 41,597 | 831 | #!/usr/bin/env python3
"""
File: interaction_mapper.py
Created: 2022/04/05
Last Changed: 2022/04/06
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free S... |
9801f5ba202faf90b2640735aeeb1d675339dee18283ba4b0c9a4da5217f8686 | Python | 41,637 | 1,077 | #!/usr/bin/env python3
"""Closed-loop CARLA demo for NVIDIA Alpamayo 2 Super.
The CARLA-camera backend attaches to the current world without loading a map or
deleting traffic. The NuRec backend loads the recording's OpenDRIVE world.
Either way, this process is the sole synchronous tick owner, captures canonical
Alpama... |
bbc9adcc5144fc9ff4c21e99279277638194a4d16c8ee1c95d559ebdf63becdf | Python | 41,777 | 1,178 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 5 09:19:08 2022
@author: spiros
"""
from neuron import h
from neuron.units import um
h.load_file("stdrun.hoc")
class PyramidalCell:
def __init__(self, gid):
self._gid = gid
self._setup_morphology()
self._setup_topolog... |
13e82037921b99cfc9c686a89b25668e1b3a095858e7fc192fcca861c55026b4 | Python | 42,072 | 1,027 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2026 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>.
"""Generates the catalogue pages in Docs/ from a runn... |
2e20f26abc5054f3e1bcd2a20c1ffb05e27b7ba5f7ee6fe53e8a3b2282d276bb | Python | 42,081 | 858 | # -*- coding: utf-8 -*-
"""
@author: Yuxiu Shao
Network with independent random components;
Full-rank Gaussian Network and Rank-one Mixture of Gaussian Approximation
Dynamics
"""
"""
Help Functions
"""
import numpy as np
import matplotlib.pylab as plt
# import seaborn as sb
from functools import partial
# from sympy ... |
74e91df42d557924b49c7335b486126392d99b9efacc5a0787118eb80b742609 | Python | 42,152 | 608 | # Copyright (c) 2016, Konstantinos Kamnitsas
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the BSD license. See the accompanying LICENSE file
# or read the terms at https://opensource.org/licenses/BSD-3-Clause.
'''
This script parses training lo... |
346e4eeaa3b4ad0e43273952c5e010c90086fd7c1f5875e92f7a170a162ff021 | Python | 42,205 | 1,059 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""Plot topographic maps of sensor space data."""
from collections.abc import Sequence
from itertools import repeat
from math import floor, sqrt
from typing import Union, Tuple
import matplotlib as mpl
import numpy as np
from scipy import interpolate, linalg
fro... |
539d2887dd27d738605578f0a55adbbf601790542bb451dec0d1ddba1e7a19f3 | Python | 42,237 | 863 | import tensorflow as tf
import tensorflow.keras.backend as K
from scipy.ndimage import generate_binary_structure
from sklearn.utils.extmath import cartesian
from ddmr.utils.operators import soft_threshold, min_max_norm, hard_threshold
from ddmr.utils.constants import EPS_tf
from ddmr.utils.misc import function_decorat... |
ceaaa022587dec064d11423145b9679e3235fe093f3abf157c4df2690eba0aee | Python | 42,266 | 1,070 | """Base classes for multiframe imaging data."""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from future.utils import iteritems, itervalues
from builtins import str
from builtins import zip
from builtins import range
from builtins import object
from past.... |
7b16618fdad8cff9b917a0e9887486f72c51da4b7677eb65b1f329b89fbd098e | Python | 42,577 | 1,209 | import logging
import os
import warnings
import sys
from typing import Dict, List, Optional, Tuple, Union
import anndata
import pickle
import rich
import numpy as np
import pandas as pd
from pandas.api.types import CategoricalDtype
from scipy.sparse import isspmatrix
from rich.console import Console
import scvi
from ... |
ffaf7fea9dd45903494dca7268dc82475cc167d1ce8fa1a2798680f3f9b16bab | Python | 42,606 | 1,047 | #!/usr/bin/env python
"""Module Description: Test MACS3.Commands.callvar_cmd and the
``macs3 callvar`` command: check_names, run, call_variants_at_range,
every command-line option and the option validation.
Inputs are small sorted and indexed BAM files written with pysam whose
reads carry MD tags computed against a d... |
d39cc5adaf178d6e33b23ce9eb662bae5345bb9b120a9f21ef347393039e1834 | Python | 42,612 | 1,086 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""PySurfer Brain subclass to embed in Eelbrain"""
from distutils.version import LooseVersion
from functools import partial
import os
import sys
from tempfile import mkdtemp
from time import time, sleep
from warnings import warn
from matplotlib.colors import Lis... |
a88f0c58733c986bc53e310fa4bbf5744541e376a79bce664ef5f68ac4aa600e | Python | 42,789 | 1,196 | """Classes for simulating Hidden Markov Models (HMMs)."""
import warnings
from typing import List, Optional, Union
import numpy as np
from osl_dynamics.simulation.obs_mod import (
MAR,
MVN,
MDyn_MVN,
MSess_MVN,
OscillatoryBursts,
Poisson,
Dirichlet,
TDECovs,
)
from osl_dynamics.simula... |
fe398673218e4b5f22b8a9b9e967ef94018750c7a36c20d4896dfb91aeb103a8 | Python | 42,937 | 852 | #!/usr/bin/env python3
"""
File: interaction_mapper_cf_as_dependent_variable.py
Created: 2022/04/05
Last Changed: 2022/04/06
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License a... |
ab9a88628399e79c7c6fb3deffe45bdaf97b373f57d5a37efe57430b6d322008 | Python | 43,004 | 1,188 | #! /usr/bin/env python3
import argparse
#from asyncio.sslproto import constants
import logging
from datetime import datetime
import os
from ssl import ALERT_DESCRIPTION_UNRECOGNIZED_NAME
import numpy as np
from math import pi
from src.fem.advection import solve_adv_diff_cyl as solve_adv_diff
from src.fem.fluid import... |
4ddf0a4675b7ef0ef4a4fbe0f38bf25b7e2597f7b95c6aa576466c9ce258fd27 | Python | 43,129 | 1,218 | import pickle
import numpy as np
#####################################################################################
# #
# Example usage from the Python command line (in the main ACE directory) #
# ... |
e07c1ac6b8f60ad5316b6beccbe4302d0f9731486e6971b98f84df3a2e6a7afa | Python | 43,387 | 1,085 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# 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 agreed to... |
de69aaba1c02de5a3a03966ab24a4733da7be3aaffec6d88929228b0c02d44cb | Python | 43,549 | 1,069 |
# This script is part of navis (http://www.github.com/schlegelp/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 o... |
257ce7e305fa6967dd8086ccd7643e302e6b1a81711bb2baa6f0f317f02eee1b | Python | 43,574 | 1,044 | import abc
import math
import numpy
import torch
import torch.nn as nn
from typing import Union, List, Optional, Tuple, Literal
# import the base class from torch-harmonics
try:
from torch_harmonics.quadrature import _precompute_grid
from torch_harmonics.filter_basis import (
PiecewiseLinearFilterBas... |
9b0e7e9de1c2ed0c94a3af8f01c40e8a3b45c5938836b4ead77eb480ece41d85 | Python | 43,601 | 1,134 | """
Detailed description of forces in polychrom
-------------------------------------------
This module defines forces commonly used in polychrom. Most forces are implemented using custom forces in openmm. The
force equations were generally derived such that the force and the first derivative both go to zero at the c... |
9c6b18c54113d54927badc5f65aeff3bd8874f46c591bfe7ad69dcd9070c0236 | Python | 43,712 | 1,005 | import torch.nn as nn
import torch.nn.functional as F
from math import floor
import torchvision.models as models
from utils.quantify import *
class Unquantified_2layer_CNN(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride, pooling_stride, feature_map_size):
super(Unqua... |
5273dfd6ad3e0150238053478eb7dc20d47512d9ca66e2a0732e7c6689dccfcd | Python | 43,787 | 953 | import copy
import time
import matplotlib.pyplot as plt
import numpy as np
import h5py
import scipy.signal
from analysis import *
from algorithms import *
from pre_processing import *
import pandas as pd
import scanpy as sc
from analysis import *
from evaluation import *
from scipy.stats import pearsonr
... |
a8b308d5cd5c1c8895c1cfdc958e734cd9c698dd3ee911947b8c738d4c1df877 | Python | 43,859 | 847 | # object for analysing and grouping celltypes
import numpy as np
import pandas as pd
import seaborn as sns
import sys
import pymaid
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import itertools
from upsetplot import plot
from upsetplot import from_contents
from upsetplot import from_member... |
c6949f6856a9cf98ada1133ea7e077263d1149606d7bcb8214436a6915622b1a | Python | 44,077 | 961 | import torch, os, json, re, nltk, scipy
from scipy.special import softmax
from transformers import PreTrainedTokenizerBase
from dataclasses import dataclass
import numpy as np
from tqdm import tqdm
from captum.attr import LayerIntegratedGradients
from captum.attr import visualization as viz
from collections.abc import ... |
fe6c0cd373758338042fa5c705de79a5a8d0ee93760b1bf324404cb53fcc63b5 | Python | 44,192 | 726 | import time
from datetime import date, datetime
from pydicom.dataset import Dataset
from pynetdicom import (AE, evt, debug_logger)
from pynetdicom.pdu_primitives import SOPClassExtendedNegotiation
from pynetdicom.sop_class import (Verification,
PatientRootQueryRetrieveInformationModelF... |
ee496a8104294d937d7f5042b2ecbec2f94b85af40368bb1d33ad3bfb9d56b05 | Python | 44,424 | 781 | # Copyright (c) 2016, Konstantinos Kamnitsas
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the BSD license. See the accompanying LICENSE file
# or read the terms at https://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_im... |
b209740698bc02cb1296ed9d86b70a3c6e7ae557b57925e86b9c9438f6a0572b | Python | 44,553 | 1,064 | # Dataset utils and dataloaders
import glob
import logging
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
import torch.nn.functional ... |
f1137b38f72b6c8b8613a555649808d2deb2de83fb8ce7008ca28381731397bc | Python | 44,612 | 1,355 | import os
import sys
import numpy as np
import math
from scipy import interpolate
import pandas as pd
from multiprocessing import Process
import matplotlib.pyplot as plt
plt.switch_backend('agg')
from skimage import io
import itertools
from itertools import groupby
import more_itertools as mit
import pickle
import h5p... |
a318eff5d16fb2dcfedaa9a9b61185a55712f4d48ff48addfe52e96bde65a02e | Python | 44,813 | 1,190 | """GUI for selecting topographical components"""
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
# Document: represents data
# ChangeAction: modifies Document
# Model: creates ChangeActions and applies them to the History
# Frame:
# - visualizaes Document
# - listens to Document changes
# - issues comma... |
3e399dd7101e19a9b95f06ff3927e080ca5a761380afe9cab3240a2e3a1c825f | Python | 44,899 | 801 | import os
import pandas as pd
import numpy as np
import torch
from sklearn import preprocessing
from sklearn.metrics import confusion_matrix, f1_score
from Utils import get_min_sample_count
from Losses import get_dist_and_masks
"""This script implements the analysis for the manuscript including computation of (test se... |
35998b83b41a34aeec1ce6ce13dcf6c1c111e11e93429ec671e7d794f68670e7 | Python | 44,909 | 1,041 | from math import ceil, log
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, bias_init_with_prob
from mmcv.ops import CornerPool, batched_nms
from mmdet.core import multi_apply
from ..builder import HEADS, build_loss
from ..utils import gaussian_radius, gen_gaussian_t... |
56e24613eb1802c06d459bea91fa1a03995fdd781e332438ed0d5a963b209589 | Python | 45,231 | 1,271 |
import torch
import numpy as np
from numpy import random
from scPrisma.pre_processing import *
def reconstruct_e(E_prob):
'''
Greedy algorithm to reconstruct permutation matrix from Bi-Stochastic matrix
Parameters
----------
E_prob: np.array
2D Bi-Stochastic matrix
Returns: np.array
... |
dd3ac510db4be46e33c615f1e2a7efdbc16e946ee0177e084585825b804e108f | Python | 45,350 | 1,244 | """Base classes inference models."""
import sys
import logging
from contextlib import contextmanager
from dataclasses import dataclass
from typing import List, Literal, Optional, Tuple, Union
import numpy as np
import tensorflow as tf
from scipy.special import xlogy, logsumexp
from osl_dynamics.simulation import HMM... |
34960f35bf1007c309ef16a3e6f91349d7cefa5b872441f87a2484c8e1ec2c91 | Python | 45,359 | 945 | #Copyright (C) 2019 Soeren Lukassen
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.