sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
71a304dfc0e40a6462595f74e9de2870cdcfddbd3439a39eb4e4e52cd3551eff | Python | 29,918 | 845 | # IMPORT MODULES
from __future__ import division
from copy import deepcopy
from itertools import product
import pickle
import numpy as np
from tqdm import tqdm, trange
from .Tools import timeToIntVec, timeToIndex
from .Tools import (
validate_array_ndim,
validate_matching_axis_lengths,
raiseExpectedGot,
... |
1cd8f21591e29a841a0098d21fe06963b6b591993ed9d86154204326a2aa970a | Python | 29,953 | 758 | import numpy as np
import os
import nibabel as nib
import re
import warnings
from os.path import join as jph
# --- text-files utils ---
def unique_words_in_string(in_string):
ulist = []
[ulist.append(s) for s in in_string.split() if s not in ulist]
return ulist[0]
def indians_file_parser(s, sh=None):
... |
edf5839a4c9b05d3351f177f823a8cd1708fffe1c1eaa372f51a4a9df5d8e09c | Python | 29,972 | 731 | import logging
from abc import ABC
from collections import defaultdict
from dataclasses import dataclass, field
from enum import Enum, unique
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple
from oaklib.datamodels.association import (
Association,
PairwiseCoAssociation,
PositiveOrNeg... |
5f2ab2e455ebee17401fa455fd1af34515c0d0e7c333e588eeac4648bd4e7518 | Python | 29,992 | 630 | #!/usr/bin/env python
import os
import sys
import json
import argparse
import warnings
from drugex.data.corpus.vocabulary import VocGraph, VocSmiles, VocGPT
from drugex.data.datasets import SmilesDataSet, SmilesFragDataSet, GraphFragDataSet
from drugex.data.utils import getDataPaths, getVocPaths
from drugex.logs.utils... |
690f6244e9bdd145716b030127d2d57cb7307dc6822b1b3012839816a415ff26 | Python | 30,004 | 633 | #%%
from pymaid_creds import url, name, password, token
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
import connectome_tools.process_matrix as pm
import connectome_tools.celltype as ct
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
import numpy.r... |
3b02490ccf0894c342646cf6da050304ee100a31f3ae9997d2803d1dc89fa5a8 | Python | 30,059 | 794 | from __future__ import print_function, division
import os
import time
import warnings
import random
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 torch.optim.lr_... |
ed8de684d5fb31590c9510d25f6cf53224f3a97dbc081708c761abde2ee0891f | Python | 30,075 | 695 | import json
import os
from tempfile import TemporaryDirectory
import pickle
from typing import List, Optional, Tuple
from typing_extensions import Literal
import torch
# pip install typed-argument-parser (https://github.com/swansonk14/typed-argument-parser)
from tap import Tap
import chemprop.data.utils
from chemprop... |
32a60ba2f80cc4b8d18fcb2e223285d95bb65ae4b4a49335926fbba4cf86ebf8 | Python | 30,117 | 730 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module for the model correction window widget.
This GUI page allows the user to modify the model of the tracker to improve the
axon's identities (e.g.: by fusing, cutting, or discarding ROIs).
Created on Wed Jun 19 11:48:44 2019
@author: nicolas
"""
import os
import... |
b61519cc8e26fa31312b8a842a8dcad28cd0f7459df5421ba2e30aafc553c1d6 | Python | 30,134 | 827 | from abc import ABCMeta, abstractmethod
import cv2
import mmcv
import numpy as np
import pycocotools.mask as maskUtils
import torch
from mmcv.ops.roi_align import roi_align
class BaseInstanceMasks(metaclass=ABCMeta):
"""Base class for instance masks."""
@abstractmethod
def rescale(self, scale, interpola... |
5fec8a8ad92eb62acc14baecbb91b88c60ab1781150babf1901276a8b9e03b2d | Python | 30,136 | 759 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import numpy as np
from lib.nn import SynchronizedBatchNorm2d
from smoothgrad import generate_smooth_grad
from guided_backprop import GuidedBackprop
from vanilla_backprop import VanillaBackprop
from misc_functions import (get_example_... |
b08e25eb2d4f5760717f563b7675aff78ec9ba29c74907d91935354f0cc1d1b2 | Python | 30,136 | 666 | #!/usr/bin/env python3
"""
File: eqtl_mapper.py
Created: 2022/04/01
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 Software... |
1184b2b76b058065c78f400c5084ba6546731c7fcc04273351707d8c6fda55c6 | Python | 30,172 | 759 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import numpy as np
from lib.nn import SynchronizedBatchNorm2d
from smoothgrad import generate_smooth_grad
from guided_backprop import GuidedBackprop
from vanilla_backprop import VanillaBackprop
from misc_functions import (get_example_... |
254c21a721b5cd0cc28b3d1b0da089cd9d7ff98ea82aa30d905ed61a89427bb3 | Python | 30,251 | 625 | #!/usr/bin/env python
"""Import a walker mesh and build its blueprint, from inside UE4Editor.
Not an entry point. Run by ../import_walker.py as the FIRST of two boots:
UE4Editor CarlaUE4.uproject -run=pythonscript -Script="<this file>"
The job description is read from the file named by $CARLA_WALKER_SPEC — argum... |
0af48d84b0dd6b6aa4147044694b242b20e94503b039c69ad15ac8b027e1f5c4 | Python | 30,284 | 671 | #!/usr/bin/env python3
"""
File: visualise_interaction_eqtl.py
Created: 2022/04/07
Last Changed: 2022/04/13
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
th... |
406ffd1040dc4bfb066487998ef2ec8cde9ba65fce893d76aad52b1e6275f28e | Python | 30,390 | 669 | """
Copyright 2020 - by Jerome Tubiana (jertubiana@gmail.com)
All rights reserved
Permission is granted for anyone to copy, use, or modify this
software for any uncommercial purposes, provided this copyright
notice is retained, and note is made of any changes that have
been made. This softwar... |
4315e1f98db9ae785faab7d648559063a7ed7c76b92c4573da39a500fa3078fd | Python | 30,416 | 739 | # -*- coding: utf-8 -*-
import logging
import tensorflow as tf
__all__ = [
'cross_entropy',
'sigmoid_cross_entropy',
'binary_cross_entropy',
'mean_squared_error',
'normalized_mean_square_error',
'absolute_difference_error',
'dice_coe',
'dice_hard_coe',
'iou_coe',
'cross_entropy... |
acc182fb18e41b90634767a25915c82aae50c5292a0adda0d61613823b7825d3 | Python | 30,434 | 749 | import numpy as np
import sys
import warnings
from tqdm import tqdm
from collections import namedtuple
from itertools import product
import threading
from scipy.ndimage import zoom
from scipy.ndimage.filters import maximum_filter
from functools import lru_cache
import tensorflow as tf
from concurrent.futures import Th... |
09e0f25be8d486924b2d42a2af1c57ffa94c8957deaad2e2aae9423d38204b48 | Python | 30,481 | 661 |
# -*- coding: utf-8 -*-
"""
Copyright 2020 - by Jerome Tubiana (jertubiana@gmail.com)
All rights reserved
Permission is granted for anyone to copy, use, or modify this
software for any uncommercial purposes, provided this copyright
notice is retained, and note is made of any changes that have
... |
aadc0e2330367a8ee3960609ae3aafb28ad31562646d700a344076af0f09677e | Python | 30,523 | 812 | import logging
import re
import shutil
from collections import defaultdict
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Type
import rdflib
import sqlalchemy.orm
from linkml_runtime import SchemaView
from linkml_runtime.dumper... |
0a7e17b50381fd2efbe45ce6c8bcd359a038720fbb1a625e5ad6994e0f2bf3e7 | Python | 30,726 | 704 | from base.backend.app import App as BaseApp
from base.backend.app import parser as base_parser
from base.backend.paths import get_models_path
import hmac
import os
import secrets
import shutil
import signal
import tempfile
import urllib.parse
import flask
from werkzeug.exceptions import HTTPException
import backend
i... |
0b2c3de1ba0cfd7cf9041f3c4cbac388111e560a26644cbf7caca362c0133f50 | Python | 30,768 | 773 | """
PyTorch and PyTorch-geometric dataset classes for graph-based data.
"""
import numpy as np
import bisect
import math
import random
import networkx as nx
from networkx.readwrite import json_graph
import json, os
import torch
import torch_geometric
assert int(torch_geometric.__version__.split('.')[0]) == 2
from tor... |
b93efe578a3c496ab01d36976c853f7c2e0311ad302a6ecd4575d06c2ea5f60e | Python | 30,769 | 724 | import numpy as np
from math import pi, sin, cos
from cv2 import warpPerspective, INTER_CUBIC
from imresize import imresize
from shutil import copy
from time import strftime, localtime
import os
import glob
from scipy.ndimage import measurements, interpolation
from scipy.io import loadmat
import torch
import cv2
import... |
de818a32c0cf8aa9feadaf26073260d0eaed8ac7efd67557edca6fa84907170e | Python | 30,770 | 724 | import numpy as np
from math import pi, sin, cos
from cv2 import warpPerspective, INTER_CUBIC
from .imresize import imresize
from shutil import copy
from time import strftime, localtime
import os
import glob
from scipy.ndimage import measurements, interpolation
from scipy.io import loadmat
import torch
import cv2
impor... |
5c99436203be742b19f1645a060b0529155b52a7492e02c279119cf98850ec54 | Python | 30,800 | 769 | # Copyright 2020 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
48c99b6fb9ee6b0fcff589507d921c991a5a578fcc5837addd7b50e1e1531e5a | Python | 30,811 | 567 | import os
import tensorflow as tf
# import tensorflow_addons as tfa
from tensorflow.keras import layers, models, initializers, regularizers, callbacks
import numpy as np
from sklearn.metrics import roc_auc_score
from sklearn.metrics import average_precision_score
from load import data_loader
"""Abstract base model.
... |
4497d323f57bed3eb12473388393466678f0f93d2a7c858f27ee3f20661a68cb | Python | 30,813 | 1,038 | #%% Imports and file loading
import json
import os
import pprint
import sys
import time
from collections import defaultdict
from datetime import timedelta
from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import navis
import pymaid
from src.pymaid im... |
4ddedaa7124684b710a1a6b2561ec5c665aa0aa4c94ca262878ed085f520e645 | Python | 30,813 | 1,038 | #%% Imports and file loading
import json
import os
import pprint
import sys
import time
from collections import defaultdict
from datetime import timedelta
from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import navis
import pymaid
from src.pymaid im... |
d66f61784d9a5c364738c0850a676112f71289318bb23d85cb48642cd2852a6b | Python | 30,827 | 732 | #!/usr/bin/env python3
"""
File: sn_replication.py
Created: 2022/02/10
Last Changed: 2022/05/26
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 Softw... |
bce72cf67dc90ea0a14d0f080e5af16b179416841288be601923bb8b5a125436 | Python | 30,858 | 1,036 | #%% Imports and file loading
import json
import os
import pprint
import sys
import time
from collections import defaultdict
from datetime import timedelta
from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
from requests.exceptions import ChunkedEncodin... |
e9d10ce73dc7e4198a18d397b70d984a2c89ebf3d523923a15f065564c6a9efc | Python | 30,942 | 561 | import numpy as np
import itertools
import os
import pandas as pd
from sklearn import preprocessing
import torch
from torch.utils.data import WeightedRandomSampler
import torch.optim as optim
from PrePro import sep_eight_channels, standardize
from DataLoaders import DataLoaderLabels, DataLoaderNoLabels, init_data_loade... |
69e5969c310a042a468efa0f9e7e6b5231d9c4bc7c528b2eeca7bf623d1a6444 | Python | 30,972 | 810 | from math import ceil, floor
import os
from pathlib import Path
import re
import packaging.version
import warnings
import numpy as np
import scipy as sp
from scipy.spatial.distance import cdist
import mne
from mne.label import Label, BiHemiLabel
from mne.utils import get_subjects_dir
from nibabel.freesurfer import re... |
d5aae7ac518244f528e6d4312a1f4c62d8ca5438ef5dcaebe79538f6099e6f37 | Python | 30,997 | 777 | #!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2022--, Bojing Jia.
#
# Distributed under the terms of the GPLv3 license.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------------... |
6eca782281298e28beb600871b81e81d3abe0d15ddced74af85e9f3449172596 | Python | 31,027 | 855 | """
Boosting as described by David et al. (2007).
Versions
--------
7: Accept segmented data, respect segmentation (don't concatenate data)
Profiling
---------
ds = datasets._get_continuous()
y = ds['y']
x1 = ds['x1']
x2 = ds['x2']
%prun -s cumulative res = boosting(y, x1, 0, 1)
"""
import inspect
from itertools i... |
d2fcf0e3a9750a79fd91aaaa81519d6631aab3c7e3d91a16e6d3e5da0524dc8e | Python | 31,077 | 1,044 | #%% Imports and file loading
import json
import os
import pprint
import sys
import time
from collections import defaultdict
from datetime import timedelta
from pathlib import Path
from pickle import dump
import matplotlib.pyplot as plt
import navis
import networkx as nx
import numpy as np
import pandas as pd
import py... |
6b79a89df8d4462113bc8c07db1ce34ed67606ce48c11a2f11f4813a1be37dff | Python | 31,078 | 1,044 | #%% Imports and file loading
import json
import os
import pprint
import sys
import time
from collections import defaultdict
from datetime import timedelta
from pathlib import Path
from pickle import dump
import matplotlib.pyplot as plt
import navis
import networkx as nx
import numpy as np
import pandas as pd
import py... |
569546ceae62cd0abebc6dc263e3dd1a697cf51af157002bf86d4f0cf79836ff | Python | 31,079 | 772 | """
Motion correction of image sequences by 'efficient subpixel image registration
by cross correlation'. A reference image is iteratively computed by aligning
and averaging a subset of images/frames.
2015 Lloyd Russell, Christoph Schmidt-Hieber
*************************************************************************... |
f7c2b24d93b1ad1c1d877b461ab8d3a6cd67ad0640be6d9cb2357450bf3f5d9a | Python | 31,107 | 681 | import torch
import torch.nn as nn
from mmcv.cnn import normal_init
from mmcv.runner import force_fp32
from mmdet.core import (anchor_inside_flags, build_anchor_generator,
build_assigner, build_bbox_coder, build_sampler,
images_to_levels, multi_apply, multiclass_nms, unm... |
b80f5aaae03af36fcdb84a461d68c7279b50e615a1bdd6436e8e19597c66a222 | Python | 31,111 | 980 | import tempfile
import os
import os.path as op
import shutil
import subprocess
import gc
import random
import concurrent.futures
import toml
import numpy as np
import numpy.testing as npt
import pytest
import pandas as pd
from pandas.testing import assert_series_equal
import nibabel as nib
import tempfile
import d... |
3dc21d5201d9d284a255f58b6b5818841a8eee7331fc2fc4ddda17bc473774fe | Python | 31,147 | 699 | import os, time, importlib, errno
import matplotlib.pyplot as plt
import numpy as np
# from dt_utils import Timer
#from networks import HebbDiags
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import TensorDataset
#%%##... |
4656c37f870c2c4252919054099bd54c9ce5bede0ed67979e6e5e12cbed9d4b4 | Python | 31,153 | 611 | # Import libraries
import os
import numpy as np
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
from PIL import Image
import cv2
import math
import mplcursors
#from nilearn.image import resample_img
from skimage import io, transform
import pickle
from six.moves import input
from skspatial.... |
88f2d210ca75c53f7a4864e4df16c3179f9454bfddbc7d5f2eae9075b5e30bd1 | Python | 31,164 | 726 | ###################################################################
####
#### Version: 1.1.7
#### Date: 6/24/2023
#### Description: This file contains handler functions for all UI elements
#### Author: Evan Cobb
####
###################################################################
import sys
from PyQt5.QtWidgets i... |
10439a91dec5dc41d448c73eaf4af665d085a95869c08b7bbb40693082b81160 | Python | 31,167 | 728 | import mmcv
import numpy as np
import torch
from torch.nn.modules.utils import _pair
from .builder import ANCHOR_GENERATORS
@ANCHOR_GENERATORS.register_module()
class AnchorGenerator(object):
"""Standard anchor generator for 2D anchor-based detectors.
Args:
strides (list[int] | list[tuple[int, int]]... |
6c0668616394194324578b2efb39963dd8691c2410be1b4f2f061da0081379b9 | Python | 31,192 | 823 | from __future__ import print_function, division
import os
import time
import warnings
import random
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 MultiStepLR... |
25b928445b1c86f7a32260de9c5aecc8d893cc3d30a593b5223bd4e3c8c50e11 | Python | 31,224 | 714 | import numpy as np
import sys
from modules.parameters import ParameterSet, copy_dict
from defaults.paths import paths
def set_kernel_defaults(run_type='local', data_label='', **system_pars):
"""
Return pre-defined kernel parameters dictionary
:param default_set:
:return:
"""
keys = ['nodes', '... |
b6213275cb1db2b1ccaf279d0c13e8068c36f78c36f682c39e3ca47f73b98c1a | Python | 31,293 | 820 | 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 import reduce_dimensions
from sklearn... |
b2282393a9b36c20e8de0b340e00563667a47be0e0f4d44558ea25a9cd727004 | Python | 31,299 | 858 | #! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import os
import numpy as np
import re
import sys
import tarfile
import gzip
import zipfile
from . import visualize
from . import nlp
import pickle
from six.moves import urllib
from six.moves import cPickle
from six.moves import zip
from tensorflow.pyt... |
c53f9c1ba9095f4830fd394a42a5a5d4571920007405768ef0c9e77b193c7b83 | Python | 31,300 | 805 | #!/usr/bin/env python
# Read annotation file, plot exons for each transcript of a specified gene.
# The plot shows blocks of contiguous exonic sequence, and eliminates
# regions which are not included in any transcript (IsoSeq cluster or
# annotation). in order to devote more plot real estate to the exons.
import os... |
b4b49438743223d309f5469114f2d52c54aee92cfe4793f2bf55a64811c09c8d | Python | 31,308 | 733 | import os
import time
import logging
import itertools
# Math
import pandas as pd
import numpy as np
# Plotting
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from matplotlib.backends.backend_pdf import PdfPages
import seaborn as sns
# sklearn
from sklearn.deco... |
c131e2e6e495a88799af6a900ad3cdebe9b2373c2871c132b6f1c59c8bb9d481 | Python | 31,323 | 738 | import itertools
import time
import statistics
from rdkit.Chem import GraphDescriptors, Lipinski, AllChem
from rdkit.Chem.rdSLNParse import MolFromSLN
from rdkit.Chem.rdmolfiles import MolFromSmiles
import torch
import torch.nn as nn
import torch.optim as optim
import pandas as pd
import numpy as np
from rdkit import ... |
558c348435660c81d23a1327e03fc14fbe7282b34a2d6329e27d28fdabffaf22 | Python | 31,360 | 775 | """Script to render a video using a trained pi-GAN model."""
import argparse
import math
import os
from cv2 import IMWRITE_JPEG_RST_INTERVAL, data
from torch.serialization import save
from torchvision import transforms
from torchvision.utils import save_image
import glob
import torch
import numpy as np
from PIL impor... |
4a56eb95c1630184772320584898d0f271aa3b8234c530b60793f546673f7b3c | Python | 31,419 | 658 | import os
import sys
import csv
import shutil
import requests
import json
import re
import time
import logging
import random
import multiprocessing
import slideflow as sf
from slideflow.dataset import Dataset
from slideflow.util import log, ProgressBar
from slideflow.util.spinner import Spinner
from slideflow.stats im... |
86bdf89eac4bc29ba7ca564769bcc9481fd4a893c5440bb3ac394cc08a232b16 | Python | 31,456 | 613 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'buildv3.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt5agg impor... |
d648e13d7f171ea81500b3465e512e614c00af4d58f6340e5db4453fd0bfef89 | Python | 31,499 | 983 | # %% [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 mpl_toolkits.mplot3d i... |
c466dd56679ef9930804fa995adeaa6a96b939cfa213bc599dc056e1243a907b | Python | 31,528 | 706 | import os, torch, random, re, torchtext, sys, time
import numpy as np
import nltk, csv, json
import pandas as pd
from nltk import sent_tokenize, word_tokenize
from tqdm import tqdm
from typing import List, Tuple
from torchtext.data import TabularDataset, Field, NestedField, BucketIterator
from transformers import Dis... |
a410f705d86cc81ff6df86af098055893ed0c319d92015fcd0c6b6d36391eeb0 | Python | 31,577 | 857 | import numpy as np
from numpy import linalg as la
from scipy import linalg as scpla
import scipy
# import seaborn as sb
from mpl_toolkits.axes_grid1 import make_axes_locatable
from cmath import *
from mpl_toolkits.mplot3d import Axes3D
from scipy.optimize import fsolve,leastsq,minimize
import scipy.integrate
from math ... |
ec1bd04a3ac98d60a7d8b0133ceabd31c2839070bcc5805e4a78cb60bbc41670 | Python | 31,608 | 806 | # 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... |
f4e14a1fdb7f5eebb03fe32904bdb9b98a2f39053c89e75ba91ce9e02c238a38 | Python | 31,612 | 958 | import math
import warnings
from copy import deepcopy
import matplotlib.pyplot as plt
import numpy as np
import numba as nb
import weave
from scipy import optimize
from .GIF import GIF
from .Filter_Rect import Filter_Rect_LogSpaced
from . import Tools
from .Tools import reprint
# DEFINE AUGMENTED GIF CLASS
class ... |
51dd7b20887e843d6d6600bf536d59161f3e482065200ab39c54e5309ce14758 | Python | 31,613 | 782 | import numpy as np
import os
import pandas as pd
import shutil
import subprocess
import time
from biopandas.pdb import PandasPdb
from functools import cmp_to_key
from utils.SGCN.common import checks, covalent, format, names, utils
TARGET_SCORES_DF_NAMES = ['chain_id', 'residue_number', '#2', '#3', '#4', 'residue_nam... |
f7b07a107340627cd36774121f2694fd3d65f78708b276aa0d3935b88f9e01ba | Python | 31,657 | 842 | ## System
import os
import gc
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # no debugging from TF
os.environ['TF_CPP_MIN_VLOG_LEVEL'] = '3'
import time
import copy
from tqdm import tqdm
## sklearn
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
## Maths
import math
import numpy as np
import pan... |
38108aa009ab64774b07900098cc938403a897d88482e02cc23cdcbda0726fb6 | Python | 31,660 | 1,059 | #%% Imports and file loading
import json
import os
import pprint
import sys
import time
from collections import defaultdict
from datetime import timedelta
from pathlib import Path
from pickle import dump
import matplotlib.pyplot as plt
import navis
import networkx as nx
import numpy as np
import pandas as pd
import py... |
b7232ad0ca855cf71f4bfeb86332cf2775f6d3070e3fea654d62f73c8d4c1440 | Python | 31,684 | 763 | # Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
#
# 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
#... |
da769717efc4f550cae77bc493539cf35ab0c1ba4b377dfcbd02fef2d61585ba | Python | 31,721 | 778 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from itertools import product
import pickle
import logging
import pytest
import sys
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
import eelbrain
from eelbrain import Dataset, NDVar, Categorial, Scalar, UTS, Sensor, configure,... |
ceab1ebd53f817c17472eed343120b24272c533ac226ec1c19ed95304cd3138e | Python | 31,722 | 1,109 | # %% [markdown]
# ##
import os
import warnings
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 joblib import Parallel, delayed
from sklearn.exceptions import ConvergenceWarning
from sklearn.manifold im... |
b496a56851b591c7f5d3d14c61969cd4e7921948a8fa0fdde06f2d1edcb59403 | Python | 31,733 | 941 | """
Utils to plot graphs with arrows
"""
import matplotlib.transforms
import matplotlib.patches
import matplotlib.colors
import matplotlib.cm
import numpy as np
import pandas as pd
import logging
from tctx.util import plot
def _clip_arrows(arrows, tail_offset, head_offset):
"""
shorten head & tail so the ... |
66fe93bff7e68d2c60a0e095fb0452dff8ec6ce002f23370a1bf0058d0bcfb31 | Python | 31,761 | 1,042 | # %% [markdown]
# ##
import os
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import poisson
from graspy.embed import OmnibusEmbed, selectSVD
from graspy.match import GraphMatch
from graspy.models import DCSBMEstimator... |
b8d66882d5ea00002cb3f295aa840629888c47a1fdc859382569589c738f0992 | Python | 31,917 | 709 | import os
import math
from PIL import Image
from dash import Patch, ALL
from dash_extensions.enrich import Serverside, Output, Input, State, callback, clientside_callback
from dash.exceptions import PreventUpdate
import plotly.graph_objects as go
from plotly_resampler import FigureResampler
from plotly_resampler.aggr... |
ad42954e200b10add2e79adfc0d5e9d63d1988a26e6190231f0a7741dac55aa1 | Python | 31,970 | 764 | # Builtin
from pathlib import Path
from argparse import ArgumentError
import copy
import sys
import shutil
import pdb
from math import nan
# Analysis
import numpy as np
import pandas as pd
from cxsystem2.core.tools import change_anat_file_header_value, read_config_file
class ProjectUtilities:
"""
Utilities ... |
22849285c67e3355089e932c9acb012659a381e41470c6ede2619af5d9f0dcae | Python | 31,974 | 746 | """Pydantic models shared between the carla-cosmos client and server.
A :class:`BackendContract` describes what a generation backend accepts
(controls, camera views, fps, frame counts, resolution buckets). The server
publishes its contracts on ``GET /v1/models``; the client validates a
:class:`JobRequest` against the... |
1ed63843875dc8c5c29ec246c79378652b9e3ade5d65b0e8fee2fd94259ebcb6 | Python | 32,008 | 610 | #%%
from pymaid_creds import url, name, password, token
from data_settings import pairs_path, data_date
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
import cmasher as cmr
# allows text to be editable... |
1f14e2cc1b6a5fe7f30c5892066f4fe3cae16ea551ed9ff64b62563d6df1e176 | Python | 32,014 | 895 | # Copyright 2021 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... |
177de12f8fa0aec633c2521264252f71aeb11a4b1fe69fbb8a1b9d9d0e09c92d | Python | 32,020 | 638 | import json, time, random, datetime
import os, sys, glob, csv, re, argparse
import numpy as np
import networkx as nx
from collections import defaultdict
from scipy.sparse import csr_matrix, lil_matrix, save_npz, load_npz
from collections import defaultdict
import nltk
# nltk.download('punkt')
sys.path.append("..")
imp... |
f91dbf4bf75bfbd6a0f97b36eb59fa1fbd9d1730982c3747d10fae24e5a7bb0c | Python | 32,175 | 955 | """ A file full of useful functions """
import collections
import copy
import functools
import json
import pickle
from pathlib import Path
import random
from typing import Any, Dict, Set, Text, Union, List, Tuple
import h5py as h5
import neptune.new as neptune
import numpy as np
import pandas as pd
import torch
impor... |
21b0657c07447807ae1c9bcab53b7e9e404f268888203edfd651d4cfaca3a1a1 | Python | 32,204 | 1,211 | # ty: ignore[unresolved-attribute]
import copy
import gzip
import logging
from collections.abc import Iterable, Iterator
from io import StringIO
from pathlib import Path
from typing import Any
import numpy as np
from rdkit import Chem, RDLogger # type: ignore[import-untyped]
from rdkit.Chem import AllChem, Draw, rdF... |
2f316b35055a494c5d1c8cf3a4d13b305de87d59ff16c8a19e8a8b56f4505400 | Python | 32,243 | 1,034 | #!/usr/bin/env python
"""
track.py -- reconnect localizations into trajectories
"""
# Numeric
import numpy as np
# Dataframes
import pandas as pd
# Distance between two sets of 2D points
from scipy.spatial import distance_matrix
# Hungarian algorithm
from munkres import Munkres
from scipy.optimize import linear_sum... |
1893729c6512977257fa5b5675a6aa6d51a83764e7f6c597a05c9c3aa4061fd0 | Python | 32,249 | 740 | import json
import os
from tempfile import TemporaryDirectory
import pickle
from typing import List, Optional, Tuple
from typing_extensions import Literal
import torch
from tap import Tap
import chemprop.data.utils
from chemprop.data import set_cache_mol, empty_cache
from chemprop.features import get_available_featur... |
e6d1f103ffd36363c030daf87374cb9640227bc8937fc3a4ed75a5f5a30f19fe | Python | 32,487 | 722 | import os, time, importlib, errno
import matplotlib.pyplot as plt
import numpy as np
# from dt_utils import Timer
#from networks import HebbDiags
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import TensorDataset
#%%##... |
1d430e53bff1144321d487b65fd05beae8fe87321525cb029b8564235e865565 | Python | 32,583 | 692 | #!/usr/bin/env python3
import numpy as np
import pandas as pd
import re
import scipy
import os
import argparse
import time
import matplotlib.pyplot as plt
from typing import Union
import warnings
import tensorflow as tf
import spektral
from spektral.transforms.normalize_adj import NormalizeAdj
import MDAnalysis as mda
... |
0074a4ac2118f3c92722b29bdde673104ddc607453140719964ed9fb1a997d3f | Python | 32,599 | 1,072 | #%% Imports and file loading
import glob
import json
import os
import pprint
import shutil
import sys
import time
from collections import defaultdict
from datetime import timedelta
from pathlib import Path
from pickle import dump
import matplotlib.pyplot as plt
import navis
import networkx as nx
import numpy as np
imp... |
51aa53ca7ff611569edf5a66dcef907f75ce0c73e1e9d18aa7937104f14622d5 | Python | 32,613 | 775 | #!/usr/bin/env python3
"""
File: decon_eqtl_permutation_fdr.py
Created: 2021/06/07
Last Changed: 2022/02/10
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
th... |
74046b5d2027de7249c419b32529a5ba6b8cab3f4b337be16fb8232ef9c1c0a6 | Python | 32,667 | 754 | import itertools
import unittest
from unittest.mock import MagicMock, patch
import requests
from oaklib.datamodels.search import SearchConfiguration, SearchProperty
from oaklib.datamodels.vocabulary import IS_A, PART_OF
from oaklib.implementations.ols.ols_implementation import OlsImplementation
from oaklib.resource i... |
301d146982a74076a4414631c287b47394b880ca241a6c34f0338bd9103562e5 | Python | 32,678 | 831 | """
This module provides the `TrainModel` class and supporting methods.
"""
import logging
import math
import os
import shutil
from time import strftime, time
import numpy as np
import torch
import torch.nn as nn
from selene_sdk.utils import (
PerformanceMetrics,
initialize_logger,
load_model_from_state_di... |
9ca89cb2f0a4274c8532d78dd07c2c4b97d474c1d7de3f5a2f09fb6b3f7ba1cf | Python | 32,741 | 779 | #!/usr/bin/env python
# Basic wxPython frame to hold a matplotlib figure for plotting
# It defines some basic menu items with bindings to functions to execute
import sys, os, glob, time, math, bz2
# import needed wxPython modules
import wx
import wx.html
import wx.lib.dialogs
from wx.lib.stattext impor... |
9a09eb1fb5ad9101fe6dc31bdbcf5b8ff3bbc00fbe5e2d6c9aa3a6a530af561a | Python | 32,754 | 937 | #! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import os
from sys import platform as _platform
import collections
import random
import numpy as np
import warnings
from six.moves import xrange
from tensorflow.python.platform import gfile
import re
## Iteration functions
def generate_skip_gram_bat... |
40544be17c6c651160eadd7d9a9094af4bf441bdb0b10c6c167cf7107e034cac | Python | 32,773 | 670 | # Time-stamp: <2025-07-24 12:46:43 Tao Liu>
"""Description: Main HMMR command
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 modules
# ------------------... |
7fa0e870b35d40775f9c2af62a457b0990161f9baaf74f49c44dd9e8f2260769 | Python | 32,812 | 1,021 | """
Utilities for the OBOGraph Datamodel
------------------------------------
See :ref:`datamodels`
"""
import io
import json
import logging
import os
import shutil
import subprocess
import sys
import tempfile
from collections import defaultdict
from copy import copy, deepcopy
from enum import Enum
from pathlib impo... |
e5b61011c4e7ec724e54870852e1165ea7c8f627c7c7f11381adcddf78edc1c5 | Python | 32,889 | 845 | """
This module provides the methods for visualizing different ouputs
from selene analysis methods.
"""
from collections import defaultdict
from copy import deepcopy
import os
import re
import warnings
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import transforms
from matplotlib.path import Pat... |
234b923c80e425918b07d83bb56d48bbe0fc70f4d3e6fce65413eca60e7d7a91 | Python | 32,892 | 872 | import numpy as np
from time import time
import h5py
import os
# torch import
import torch
import torch.nn as nn
from torch.nn import MSELoss
import torch.nn.functional as F
from torch_geometric.data import DataLoader
# deeprank_gnn import
from .DataSet import HDF5DataSet, DivideDataSet, PreCluster
from .Metrics impo... |
151f10439f776982412e975651b890e0240f963049982c2adecd06a3aff4a5fd | Python | 32,922 | 783 | #!/usr/bin/env python
# Basic wxPython frame to hold a matplotlib figure for plotting
# It defines some basic menu items with bindings to functions to execute
import sys, os, glob, time, math, bz2
# import needed wxPython modules
import wx
import wx.html
import wx.lib.dialogs
from wx.lib.stattext impor... |
cfece4740c48f5f9b865234d34b40ccd79c4399d6b26537c3d017ff31c45ca9a | Python | 33,002 | 703 | import random, sys
from typing import Union, List
import os
from networkx.classes.function import to_undirected
import networkx as nx
import ipdb
import torch
import numpy as np
import matplotlib.pyplot as plt
import torch.nn.functional as F
from numpy import ndarray
from torch_geometric.utils import to_networkx
from ... |
f88832e1ae372554f07b0ea84b221cefa4a171e6a30947cb21099f6e6f67c791 | Python | 33,013 | 1,109 | #%% [markdown]
# # Joint embedding of connectivity and morphology
# > Here I try to accomplish this on the maggot data using the MASE approach.
#
# - toc: true
# - badges: true
# - categories: [pedigo, maggot, graspologic]
# - hide: false
# - search_exclude: false
#%%
# collapse
import logging
import os
import time
fro... |
19db66d4048c9bad59134b1052ec2aeb47f009ee309682f9720d996aca06f3b9 | Python | 33,110 | 518 | # 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... |
6c458569c8ee3555edae8abc8986db6a094c23825b4847917d629759de75bf18 | Python | 33,160 | 584 | """Train double latent & semantic pi-GAN. Supports distributed training."""
import argparse
import os
import numpy as np
import math
from collections import deque
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modul... |
6a61dbb3ba10e20f3c4afa4b4cea190f34dbef6e8ac95a81b3db6df596d5e474 | Python | 33,185 | 577 | import os
import pysam
import operator
import yaml
from debarcer.utilities import get_umi_from_name
def find_closest(pos, L):
'''
(int, list) -> tuple
:param pos: Position of interest along chromosome 0-based
:param L: List of (positions, counts)
Returns a tuple (i, k) corresponding to ... |
346d437bd06fab945e2f10d6109504c3c8884afd3f595ab47c1118c1441d7eb1 | Python | 33,201 | 871 | # 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... |
8362307518732b08e45a08f17f87a8e7cd1887cbfd0aa6c90c4f685b4847c091 | Python | 33,324 | 1,028 | #!/usr/bin/env python
# coding: utf-8
import math
import re
import pandas as pd
pd.set_option('display.max_columns', 100)
import numpy as np
np.set_printoptions(np.inf)
from scipy import stats
import seaborn as sns
from sklearn.decomposition import PCA
import matplotlib as mpl
import matplotlib.pyplot as plt
from mat... |
bfe1b8d359ade62ef56fce3879a2e5a5c3796623552f892fd6e63b2b87f20cfc | Python | 33,367 | 929 | import math
import json
import os, sys
import re
import string
import subprocess
import urllib
from abc import abstractmethod, ABCMeta
from decimal import Decimal
import datetime
from scipy.optimize import curve_fit
from math import sqrt
import numpy as np
import nmldbutils
import shutil
from runtimer import RunTimer
f... |
2801ae7ff4513e099165dd08d3e24a10da381dc0999e9a3140b654394b497f10 | Python | 33,416 | 1,010 | import collections
from typing import Iterable, List
import torch
from torch import nn as nn
from torch.distributions import Normal
from torch.nn import ModuleList
from ..utils import one_hot
def reparameterize_gaussian(mu, var):
return Normal(mu, var.sqrt()).rsample()
def identity(x):
return x
class FC... |
e5d3ebc435eff6e19870c88a69b7967b2351fd5fe3d660580df7d2d97400f393 | Python | 33,435 | 684 | '''Submodule that includes models, trainers, and tools for intermediate layer activations.
Supports both PyTorch and Tensorflow backends, importing either model.tensorflow or model.pytorch based on
the active backend given by the environmental variable SF_BACKEND.
'''
import sys
import os
import csv
import pickle
imp... |
ba759de5aa0d47d56c842e5d123b53dd3e8559fe3a592cd0759436de366f5ce2 | Python | 33,436 | 1,010 | import collections
from typing import Iterable, List
import torch
from torch import nn as nn
from torch.distributions import Normal
from torch.nn import ModuleList
from ..utils import one_hot
def reparameterize_gaussian(mu, var):
return Normal(mu, var.sqrt()).rsample()
def identity(x):
return x
class FC... |
9f0b8d613122067f308634df6f2a0cf503b0fd4712ab56ec0323ff8463246525 | Python | 33,497 | 1,193 | """Adaptive Multipole Model (AMM) for OPM interference rejection.
Consolidates spherical harmonics, spheroid fitting, prolate coordinate
transforms, internal/external harmonic bases, and the AMM denoising pipeline.
Translated from spm_opm_amm.m and supporting SPM functions.
Examples
--------
Apply AMM denoising to O... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.