sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
229f65cb74df876a23b1f17f6fb5ae63b408b0f3602cc56e13f914aec05e5748 | Python | 33,713 | 613 | #!/usr/bin/env python
# coding: utf-8
# # FeTS Challenge
#
# Contributing Authors (alphabetical order):
# - Brandon Edwards (Intel)
# - Patrick Foley (Intel)
# - Alexey Gruzdev (Intel)
# - Sarthak Pati (University of Pennsylvania)
# - Micah Sheller (Intel)
# - Ilya Trushkin (Intel)
import os
import numpy as np
fro... |
20c452baa4aef8a45d2bb87182db766a0f40cf84c21a151ff5892e7f6aa24ddf | Python | 33,753 | 858 | # -*- coding: utf-8 -*-
import json
import numpy as np
from typing import Any, Dict, List
from django.http import HttpRequest, JsonResponse
from django.db import connection
from django.shortcuts import get_object_or_404
from catmaid.models import UserRole, Relation, Class, ClassClass, Restriction, \
Cardinal... |
96c69ce83ff9245ad2cfc9d4cf94ad96ff876c0653ea69899a67ba2a683d3e8e | Python | 33,768 | 948 | import os
import yaml
import pickle
import torch
import torchaudio
import torch.nn as nn
import numpy as np
import cupy as cp
import pandas as pd
import matplotlib.pylab as plt
# local
# from auditory_cortex import session_to_coordinates#, #CMAP_2D
from auditory_cortex import aux_dir, saved_corr_dir
import sys
import... |
b292cf9a8c049b1efc5bb72826d4acf73d3a619e01aa0c0460baa564c03b2313 | Python | 33,796 | 634 | import argparse
import math
import os
import random
import sys
import time
from copy import deepcopy
from datetime import datetime
from pathlib import Path
import numpy as np
import torch
import torch.distributed as dist
import torch.nn as nn
import yaml
from torch.optim import lr_scheduler
from tqdm import tqdm
FILE... |
4358d67467846f4aadaa83442e766bb21c1889f353e9423ac4c5d6d311dc3b8f | Python | 33,803 | 859 | import matplotlib.pyplot as plt
import matplotlib
import numpy
from importlib import reload
import sys
import os
import importlib
import types
# print(sys.modules.keys())
import multiprocessing
import multiprocessing.pool
original_packs = sys.modules.copy()
try:
import cPickle as pickle
except:
import pickle
im... |
c26053c68b20bdce83acc8d625e3411889e3a20ad47a9bbfb93fd4e757ef86e3 | Python | 33,829 | 636 | import argparse
import math
import os
import random
import sys
import time
from copy import deepcopy
from datetime import datetime
from pathlib import Path
import numpy as np
import torch
import torch.distributed as dist
import torch.nn as nn
import yaml
from torch.optim import lr_scheduler
from tqdm import tqdm
FILE... |
e651886b73d931538651ba425b8b68d1e078a953dfdc34c1ccfb1685e1589f33 | Python | 33,847 | 782 | import pytest
import numpy as np
import keras
from keras import losses
from keras import backend as K
from keras.utils import losses_utils
from keras.utils.generic_utils import custom_object_scope
all_functions = [losses.mean_squared_error,
losses.mean_absolute_error,
losses.mean_ab... |
073bcebe8617a4e0f4bef84d93ff4e38216c75f002c2b6d66978f758496d2b1d | Python | 33,890 | 646 | import argparse
import math
import os
import random
import sys
import time
from copy import deepcopy
from datetime import datetime
from pathlib import Path
import numpy as np
import torch
import torch.distributed as dist
import torch.nn as nn
import yaml
from torch.optim import lr_scheduler
from tqdm import tqdm
FILE... |
226a2393b76b1a1ad18678ffbb50a32740198c6436e77cf2259a27ca029046ab | Python | 33,897 | 751 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... |
adab1c6dce5ce0f3ff35c50e613fe31f7a1eab53e35d2766198683959327554d | Python | 33,920 | 723 | """
Loads a pre-trained model and evaluates it on a new dataset.
Optionally, subsequent finetuning is performed on the new dataset.
Note: Requires consistent graph_attrs and context_attrs between
the pretrained and new datasets.
Author: Hanna Tolle
Date: 2025-01-12
License: BSD-3-Clause
"""
import matplotlib
matplo... |
266eb0cd69722465b6d60a11b4899b4ed672c81cc69d92a6ff0304722eccaf2d | Python | 33,921 | 1,007 | import io
import pytest
import os
import h5py
import tempfile
import warnings
from contextlib import contextmanager
import numpy as np
from numpy.testing import assert_allclose
from numpy.testing import assert_raises
from keras import backend as K
from keras.engine.saving import preprocess_weights_for_loading
from ker... |
9f73c58456c860c613fac6241b04d941b3c8c17123c57fc3937a587fc3061a7c | Python | 33,970 | 647 | import argparse
import math
import os
import random
import sys
import time
from copy import deepcopy
from datetime import datetime
from pathlib import Path
import numpy as np
import torch
import torch.distributed as dist
import torch.nn as nn
import yaml
from torch.optim import lr_scheduler
from tqdm import tqdm
FILE... |
838eec91777cb73edb9fe55c1b9f2b417c81b8ffd5a60de99997c4fc6b86d21d | Python | 34,046 | 871 | from __future__ import annotations
import datetime
import inspect
import os
import random
import shutil
import time
from typing import TYPE_CHECKING, Literal, get_args
import numpy as np
import torch
from torch import Tensor, nn
from torch.optim.lr_scheduler import (
CosineAnnealingLR,
CosineAnnealingWarmRest... |
b4ee157f67f54062f00adcd581488c6226fc8a61218213379a1a1f1f4fda4e5c | Python | 34,075 | 726 | from collections import defaultdict
from time import sleep
from tqdm import tqdm
from src.babel_utils import norm
from src.triplestore import TripleStore
from src.util import Text, get_logger
SLEEP_BETWEEN_UBERGRAPH_QUERIES = 5 # seconds
# Hierarchy predicates for the get_subclasses_* query family (see the note i... |
d37ca3e0e720031c7f79bff72dfd6ec19d9fb33d05a949b1f0b42905afaa993c | Python | 34,094 | 782 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
from matplotlib.patches import Rectangle
def individual_imshow(data, title=None, save_path=None, vmin=None, vmax=None,
replace_nan=False, show_colorbar=False, cmap='gray',
text... |
ef29a584530c610ad66de41283d77de5035ac9568b70a28c835380ed36fbe217 | Python | 34,109 | 975 | from abc import abstractmethod
import math
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
from .fp16_util import convert_module_to_f16, convert_module_to_f32
from .nn import (
checkpoint,
conv_nd,
linear,
avg_pool_nd,
zero_module,
normalization,
... |
af09743bd684093f96b20b75dec08663b947f046ee253676adb78ec503cd7c8c | Python | 34,198 | 873 | """Built-in optimizer classes.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
import copy
import numpy as np
from six.moves import zip
from . import backend as K
from .utils.generic_utils import serialize_keras_object
from .utils.generic_uti... |
e1e721e2aee33b98a8038c16ccbc4f2249e3005e90ff276aedc3b26e5da8ed55 | Python | 34,206 | 747 | import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import nni
import torch
import mlflow
import shutil
import numpy as np
from tqdm import tqdm
from pathlib import Path
from model.util import compute_accuracy
from utils.std_logger import Logger
from utils.utils import i... |
156156850dc8666ee65af1993bbb787dfa381c2762e89ff28d756c9c5d434270 | Python | 34,212 | 880 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import Adam,AdamW
from torch.optim.lr_scheduler import ExponentialLR, StepLR, LinearLR
import torch.nn.functional as F
import torch.nn.init as init
import matplotlib.pyplot as plt
import torchvision
from torchvision.transforms import tran... |
195b4c0aebaabdd6d8e7f4732363051582ba2dd8c6ee304eede77128f8a6f76f | Python | 34,286 | 962 | """
Functions that all other modules use.
- save_fig
- get_* for calculating things
- format conversion functions
- other handy lil functions
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os, json
import seaborn as sns
sns.set_style('ticks')
sns.set_context('paper')... |
36bd9a0dc66a957e1ec0eaef3b80b3e03e6b9f743c54809c193075e3591a26e7 | Python | 34,308 | 904 | """
Module to present a base neuroimaging scan, currently T1 mri, without any overlay.
"""
import argparse
import sys
import textwrap
import warnings
from abc import ABC
from os.path import join as pjoin, realpath
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.widgets import CheckButtons, R... |
f8256234bad98c7232a0bf2a2c5026d5dc2fb67ec1d3f4979316ea67f361f22a | Python | 34,312 | 644 | import argparse
import math
import os
import random
import sys
import time
from copy import deepcopy
from datetime import datetime
from pathlib import Path
import numpy as np
import torch
import torch.distributed as dist
import torch.nn as nn
import yaml
from torch.optim import lr_scheduler
from tqdm import tqdm
FILE... |
0c2d1e11a646087bd4b99f32f143c5ca8d618cbbdc031d4c198f14cfbbcb4aa4 | Python | 34,323 | 629 | import os
import tqdm
import torch
import torch.nn as nn
import numpy as np
import argparse
import json
import cv2
import scipy.io as sio
import torch.nn.functional as F
from scipy.interpolate import interp1d
from skimage import io
from PIL import Image
from nns.model import ISOSNet
from utils import fix_random_seeds
f... |
961d8c51dbe2b033d49ba563cfbd38c0c2c2029e57cebe57a6df78a99db13451 | Python | 34,346 | 772 | import itertools
import json
import os
import sqlite3
from collections import defaultdict
from urllib.parse import urlparse
import curies
from src.LabeledID import LabeledID
from src.predicates import HAS_EXACT_SYNONYM
from src.prefixes import PUBCHEMCOMPOUND
from src.synonyms.filter import get_synonym_filter
from sr... |
747ad4d52eeaf439aefc3767f0c2b89eb392c0c4ea8036ee867b9da2f8039bbd | Python | 34,347 | 717 | #!/usr/bin/env python
import numpy as np
import pandas as pd
import os, glob, re, json
from os.path import join
from pathlib import Path
import logging
import subprocess
import argparse
__author__ = "Heejung Jung"
__copyright__ = "Spatial Topology Project"
__credits__ = ["Heejung"]
__license__ = "MIT"
__version__ = "... |
33c8abd0dea2219c1d9f0a8c3e976af8b18b8633f26ddb8791eb6b448c7802e5 | Python | 34,377 | 939 | import os
import subprocess
import h5py
import torch
import merlinth
import numpy as np
import wandb
import matplotlib.pyplot as plt
import ants
import nibabel as nib
from skimage.metrics import peak_signal_noise_ratio, structural_similarity
import piq
from lpips import LPIPS
import itertools
from scipy.stats import wi... |
5390473765b5a90dd0d8f3b32cabd132c6386f48be7089a1c035a1f3c3359eab | Python | 34,432 | 975 | """################################################################################
> # **Introduction**
> The notebook is divided into 4 major parts :
* **Part I** : voxelization of the architected materials
* **Part II** : define DANTE algorithm
* **Part III** : define and train the CNN model
* **Part IV** :... |
043bc02188ee053534797ca97586e7b4de3d162bba5b34710fde2be31f8226b6 | Python | 34,461 | 1,072 | # === BEGIN: align/align_landmarks.py =========================================
from __future__ import annotations
import os
import shutil
import subprocess
from glob import glob
import ants
import numpy as np
import pandas as pd
from brainbuilder.utils import ants_nibabel as nib
from brainbuilder.utils import utils
... |
5bc72428d19def899ed7d47cf33ff6f0a26bf5627b9468cffa90057a15c08a0f | Python | 34,470 | 850 | # -*- coding: utf-8 -*-
import json
from catmaid.models import Connector, TreenodeConnector
from catmaid.state import make_nocheck_state
from .common import CatmaidApiTestCase, with_dict
class ConnectorsApiTests(CatmaidApiTestCase):
def test_list_connector_types(self):
self.fake_authentication()
... |
899f9150fcb52be4963290788cec9011ba43a9dae948ed9bae2ed0106bed4d05 | Python | 34,537 | 634 | import os
import tqdm
import torch
import torch.nn as nn
import numpy as np
import argparse
import json
import cv2
import scipy.io as sio
import torch.nn.functional as F
from scipy.interpolate import interp1d
from skimage import io
from PIL import Image
from nns.model import ISOSNet
from utils import fix_random_seeds
f... |
3859ef1c5e130b033b26f58ff1f2deafca41af66f5d914b0ebb3fb50189dea54 | Python | 34,565 | 754 | """Panel widget for editing one session's NWB metadata (channel-centric, schema-driven).
GuPPy fixes the fiber-photometry channels (rows) from ``storesList.csv``; the user
annotates each channel with wavelengths and device links (dropdowns), and defines a
device library once. Field labels, required markers, and help t... |
9e58d6773a7677fc925ba3a513acfaa534fc3c04c9a7cd2c06d5fe946b3d6a98 | Python | 34,565 | 800 | # Segmentation methods
# Author: David Young, 2018, 2019
"""Segment regions based on blobs, labels, and underlying features.
"""
from time import time
from typing import Any, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
from scipy import ndimage
from skimage import feature
from skimage import f... |
d07ca17cd60dcb0e829f4e3f6b9779b78b544698bcd7e2d31a3fca57af040d3a | Python | 34,573 | 812 | import torch
import torch.nn as nn
import torch.nn.functional as F
import copy
from utils import segment_data, segment_length, map_activation_str_to_layer, batch_convert_len_to_mask
from basemodel import EdgeSeqModel
_INF = -1e30
class PositionalEmbedding(nn.Module):
def __init__(self, d_emb):
super(Posit... |
a9ad38bfad6757ddd402eb2e25a28b1401fbd7f5d7cbe3d81d707b449b5ce6eb | Python | 34,621 | 686 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... |
fb53ae559c6d6794780b156c7ad28a381b1a5f8efaf832043495499c3217d60e | Python | 34,624 | 884 | from __future__ import annotations
import functools
import os
import random
import warnings
from typing import TYPE_CHECKING
import numpy as np
import torch
from pymatgen.core.structure import Structure
from torch import Tensor
from torch.utils.data import DataLoader, Dataset
from torch.utils.data.sampler import Subs... |
f9ceeecd7e1916bd6fb2077343edddcbfca61eea4bf9ae4958841c3e090b8b95 | Python | 34,642 | 921 | #!/usr/bin/env python
# Stats for MagellanMapper
# Author: David Young, 2018, 2020
"""Stats calculations and text output for MagellanMapper.
Attributes:
"""
from enum import Enum
import os
from typing import Callable, Dict, List, Optional, Sequence, Union
import warnings
import numpy as np
import pandas as pd
from ... |
b6c06e9b5f4e2d771a7a04913fa026511b7fa178e9ed98e72d443115306fb7e7 | Python | 34,664 | 1,055 | import h5py
import numpy as np
from scipy.signal import find_peaks as findPeaks
from scipy.stats import pearsonr, sem
from matplotlib import pyplot as plt
from myphdlib.figures.analysis import g, convertGratingMotionToSaccadeDirection, convertSaccadeDirectionToGratingMotion
from myphdlib.figures.bootstrap import Bootst... |
fbe2c0eb607045ca143b1f5e67ddaf7ff903bfe533ee823cc9c9e871afd50ff4 | Python | 34,664 | 875 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import Adam,AdamW
from torch.optim.lr_scheduler import ExponentialLR, StepLR, LinearLR
import torch.nn.functional as F
import torch.nn.init as init
import matplotlib.pyplot as plt
import torchvision
from torchvision.transforms import tran... |
ee21c5a22e3fb7f8f4469b110ff21f9da2c53d6ac53388dc118b6759e4b1802d | Python | 34,671 | 877 | import matplotlib.pyplot as plt
import matplotlib
import numpy
from importlib import reload
import sys
import os
import importlib
import types
# print(sys.modules.keys())
import multiprocessing
import multiprocessing.pool
original_packs = sys.modules.copy()
try:
import cPickle as pickle
except:
import pickle
im... |
8cef48d1b883641d7468215c3f191d92aa0dd51b92bd8189cf7adef79731b347 | Python | 34,725 | 924 | ###########################################################################################
# Training utils
# Authors: David Kovacs, Ilyes Batatia
# This program is distributed under the MIT License (see MIT.md)
###########################################################################################
import argpars... |
4af48dd8b6d3506f334fb52455cee1cc9519a75c2f2908f4bfc6b3932ef8497a | Python | 34,726 | 915 | import json
import pathlib
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
from guppy.utils.utils import (
GROUP_MEMBERS_FILENAME,
NPM_PARAM_KEYS,
common_parent_directory,
discover_group_folders,
discover_run_folders,
event_labels_for_analysis,
get_all_stores_... |
231d5c0a55452aad0333211c79c29564ff951ab6efa87c0fcbe4c8c7a4d1af9c | Python | 34,729 | 818 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.distributions.normal import Normal
import torch.nn.functional as F
import numpy as np
import random
from sklearn import preprocessing
import os
from pprint import pprint
from csv import reader
import csv, os, argparse, sys
from sklearn.cluster ... |
41e19aeef6f55e755ccf0b2ea6edc15cfa1823117e583cdd526b9b0f627d2d41 | Python | 34,813 | 883 | import matplotlib.pyplot as plt
import matplotlib
import numpy
from importlib import reload
import sys
import os
import importlib
import types
# print(sys.modules.keys())
import multiprocessing
import multiprocessing.pool
original_packs = sys.modules.copy()
try:
import cPickle as pickle
except:
import pickle
im... |
ff144b8a8a687aa02e96f32d730f03fc5e0f654a8a5a24126a4946dc86b629c0 | Python | 34,839 | 637 | #!/usr/bin/env python3
import os, sys, time, traceback
import argparse, multiprocessing
if sys.version_info < (3, 9):
sys.exit('Sorry, Python < 3.9 is not supported.')
# get the path of this script and add it to the "pythonpath"
SCRIPT_PATH = os.path.split(os.path.realpath(os.path.abspath(__file__)))[0]
sys.... |
b1c602ce0394f19f22477190f51ffbf5dd1d80235142f559d1a8dc708a0fdcf4 | Python | 34,842 | 881 | # Author: Huaxu Yu
# A module to align features (characterized by unique m/z and retention time) from different files.
# imports
import numpy as np
import pandas as pd
import re
import os
from tqdm import tqdm
from scipy.interpolate import interp1d
import pickle
from .params import Params
from .raw_data_utils impor... |
7940a52c0a5ff3b0be92a6255b059c06715a07b097a997bfe072a1c06c29d781 | Python | 34,845 | 907 | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Implements support for high-level access to ... |
831e1d3b2458659a74a6f7b68e49d2c6283719948116261a5a132b54878d8a07 | Python | 34,845 | 901 | """
Module to inspect the accuracy of spatial alignment (registration).
"""
import argparse
import asyncio
import sys
import textwrap
import time
import warnings
from abc import ABC
from functools import partial
import matplotlib
import numpy as np
matplotlib.interactive(True)
from matplotlib import pyplot as plt... |
1ae298f3a713a448d29c1783a1a4891892f4eee0bc4574110c2a38c608164cbb | Python | 34,883 | 713 | # Analysis Imports
import math
import sys
import numpy as np
from scipy.signal.windows import dpss
from scipy.signal import detrend
from scipy.fft import rfft as scipy_rfft # Tier D: multithreaded FFT
# Logistical Imports
import warnings
import timeit
from joblib import Parallel, delayed, cpu_count
# Visualization imp... |
f13068faad31941e3f2de05754eb40130ac1c7afa793a2a2558485d614ed0076 | Python | 34,889 | 663 | """
Functions processing segmentation data
Copyright (c) 2019 Polytechnique Montreal <www.neuro.polymtl.ca>
License: see the file LICENSE
"""
import math
import platform
import numpy as np
from skimage import measure, transform
import skimage
from scipy.ndimage import map_coordinates, gaussian_filter1d, zoom
import l... |
c8152d5e87d9fb2c654532b968ea0baf9d6444c229d85da3259637d5aad5a8a5 | Python | 34,944 | 905 | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import logging
import os
from collections import defaultdict
from typing import Dict, Optional
import numpy as np
import numpy.typing as npt... |
5b96c8933b97bea10db6fe5227c9c9da01bf87bbbcb1b89fe7eb0fd2eb8b98ec | Python | 34,969 | 939 | """
Graph Variational Autoencoder (GraphVAE) Modules
This module implements the core neural network architectures for GNODEVAE's
GraphVAE models. It provides flexible encoder and decoder components that can
be combined to create various VAE architectures for single-cell data analysis.
Key Components:
- GraphEncoder: ... |
ce53252b1a777946471b742a32a5f07e5bf02b7335e5a9da21241009ac69a661 | Python | 35,056 | 874 | # coding=utf-8
#########################################################################################
# This code provides SCT integration into FSLeyes for the following tools:
#
# - sct_propseg
# - sct_deepseg_gm
# - sct_deepseg_sc
# - sct_label_vertebrae
# - sct_register_to_template
# - sct_proce... |
ac1dc3536043a50f4763e9471673fb146f8c46b2e894fe4b7c1d19f7164a7e2d | Python | 35,087 | 997 | """
Copyright (c) Meta, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import logging
import time
from typing import List
import torch
import torch.nn as nn
from ocpmodels.common.registry import registry
from ocpmo... |
d8316ca98dfe61f7fd17f26f4e829a4cbc613f1fa48e14e12dd3f175d0c90245 | Python | 35,096 | 856 | # Set of classes and functions to operate and modify postprocessed image stacks
# post processed previously in matlab.
from ast import IsNot
from pylab import *
from chungotools import *
import pickle
import h5py
import csv
import time
import matplotlib.image as img
#import matplotlib.pyplot as plt
from scipy.ndimage ... |
934b114bc5c3c55c7f7da727796822acfecf501878880d700ae634714fb41eab | Python | 35,125 | 766 | # /// script
# requires-python = ">=3.10"
# dependencies = [
# "matplotlib",
# "numpy",
# ]
# ///
"""Generate SVG figures for the transient detection explanation page.
Figures are pedagogical synthetic traces, not real GuPPy outputs. The detector
behaviour they illustrate mirrors the algorithm in src/guppy/ana... |
8bdb49bd8666207fb6b9d8af73280338a5b973a980ee6bf080b1f1f1563920e4 | Python | 35,202 | 923 | #!/usr/bin/env python3
#
# Copyright 2016, Daehwan Kim <infphilo@gmail.com>
#
# This file is part of HISAT 2.
#
# HISAT 2 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
# (... |
408889226e06d10d14b7e97baa3b7754846f0223a603ef9c3804ebd7b00d60fd | Python | 35,215 | 971 | #!/usr/bin/env python3
#
# Copyright 2015, Daehwan Kim <infphilo@gmail.com>
#
# This file is part of HISAT 2.
#
# HISAT 2 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
# (... |
4be762420737c2815f49704507ba3ed09d8eff24e1399624183986f73dc0d454 | Python | 35,227 | 1,039 | # -*- coding: utf-8 -*-
# encodermap/plot/utils.py
################################################################################
# EncoderMap: A python library for dimensionality reduction.
#
# Copyright 2019-2024 University of Konstanz and the Authors
#
# Authors:
# Kevin Sawade
#
# Encodermap is free software: you... |
25aab82bb5b1f35010185233e17ea176eda0123cbdcf696624aecc06ac27d874 | Python | 35,290 | 702 | #!/usr/bin/env python
#
# This command-line tool is the interface for the deepseg API that performs
# segmentation using deep learning from the ivadomed package.
#
# Copyright (c) 2020 Polytechnique Montreal <www.neuro.polymtl.ca>
# License: see the file LICENSE
# TODO: Add link to example image so users can decide wet... |
a12019815f652c01b904a1833e0a9c16b73ff2c77c61ee98230700b4d0690a85 | Python | 35,320 | 742 | import csv
import json
import logging
import sys
import time
from collections import defaultdict
import jsonlines
from humanfriendly import format_timespan
from src.babel_utils import get_numerical_curie_suffix, glom
from src.categories import CHEMICAL_ENTITY
from src.metadata.provenance import write_combined_metadat... |
ffb9fc79dff16790c91c1e597cb327ef0f15ed2988b2c57575ac701de4738b11 | Python | 35,326 | 634 | """
Functions dealing with spinal cord straightening
Copyright (c) 2019 Polytechnique Montreal <www.neuro.polymtl.ca>
License: see the file LICENSE
"""
# TODO: only input Image instead of file names
import os
import time
import logging
import bisect
import numpy as np
from spinalcordtoolbox.types import Centerline... |
fb16302b87cc7abef5b2058d3b612ce2094d50bf8adc9165d97620d0674211b6 | Python | 35,336 | 916 | import numpy as np
from collections import namedtuple
from abc import ABC, abstractmethod
from collections import defaultdict
import math
import random
#######################################################
'DOTS'
#######################################################
class DOTS:
def __init__(self... |
5594ada4cfbadff4f9f8788b6939cddbca4faf5ab095e30a7a8afef701b9cb2d | Python | 35,337 | 951 | #!/usr/bin/env python
#same script as make_lib2b but with short and long name annotations added
#import seaborn as sns
#sns.set_context('poster')
#sns.set_style('white')
import numpy as np
# from arnie.pfunc import pfunc
# from arnie.free_energy import free_energy
# from arnie.bpps import bpps
# from arnie.mfe impor... |
19cc778d7e52c0175b0a3a8b4007e1fd02564aa12e1295b7043d2ef4c4b55932 | Python | 35,387 | 891 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import Adam,AdamW
from torch.optim.lr_scheduler import ExponentialLR, StepLR, LinearLR
from torchvision.datasets import STL10
import torch.nn.functional as F
import torch.nn.init as init
import matplotlib.pyplot as plt
import torchvision
... |
c5390ff0be0eddfc942d239b7dadf9e7488b96923753bc3e9396499835e3bdc9 | Python | 35,460 | 644 | # coding=utf-8
# Copyright 2021 The IDEA Authors. 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 a... |
dfee13e4ec23ae0171832260b0d7e81b81dec30f59571360c4791dfb17bd080f | Python | 35,515 | 996 | import os
import multiprocessing
import numpy as np
import pytest
from numpy.testing import assert_allclose
from csv import reader
from csv import Sniffer
import shutil
from collections import defaultdict
from keras import optimizers
from keras import initializers
from keras import callbacks
from keras.models import S... |
42ec690e26e884f9cb1070fb65e5c4af30f9da6a06a496f8d0cca021b366c9ce | Python | 35,568 | 741 | """Contract tests for NpmRecordingExtractor."""
import shutil
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
from guppy.extractors.npm_recording_extractor import NpmRecordingExtractor
from .recording_extractor_test_mixin import RecordingExtractorTestMixin
# --------------------------... |
99093930b7ac913d6523137d44f5659e3f4acbc1a55b60f7a3579485a60ed12c | Python | 35,725 | 898 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import Adam,AdamW
from torch.optim.lr_scheduler import ExponentialLR, StepLR, LinearLR, CosineAnnealingLR
import torchvision.datasets as datasets
import torch.nn.functional as F
import torch.nn.init as init
import matplotlib.pyplot as plt
... |
498954a6b78fa14cb4375cef053ef65c60d9add47aaedd4d321240aad4cbb6ce | Python | 35,761 | 642 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... |
556afe145685ffe5022974e7de5208fbbb3f3f5b0ebad6438d889233cef64954 | Python | 35,889 | 1,203 | import pytest
import time
from medperf.web_ui.tests import config as tests_config
from medperf.web_ui.tests.pages.base_page import BasePage
from medperf.web_ui.tests.pages.security_page import SecurityPage
from medperf.web_ui.tests.pages.settings_page import SettingsPage
from medperf.web_ui.tests.pages.login_page impo... |
8c022c79578898e23ca40ed397dc7adcfaf3ada5764ce3ae86924c6f7155bd88 | Python | 36,065 | 1,119 | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
File object test module.
Tests all aspe... |
79d68ce8a6014c652a36895f8c12424c3d71689783a5a35e225c946ba110cb31 | Python | 36,179 | 922 | from __future__ import annotations
import contextlib
import inspect
import io
import pickle
import sys
import warnings
from typing import TYPE_CHECKING, Literal
import numpy as np
from ase import Atoms, units
from ase.calculators.calculator import (
BaseCalculator,
Calculator,
all_changes,
all_propert... |
ed87de86a6240e7818b4438c3501099742389cd0409d0c3d4343ac95c2039df5 | Python | 36,314 | 1,008 | """
Translator Reasoner API 'meta-knowledge-graph' endpoint analogous graph summary module.
"""
from typing import Dict, List, Optional, Any, Callable, Set, Tuple
import re
import yaml
from json import dump
from json.encoder import JSONEncoder
from deprecation import deprecated
from kgx.error_detection import ErrorT... |
d890eace5040d191ff50fd687083118b01334a812252d2f4004ccfdc48c2d33d | Python | 36,350 | 1,135 | """Interpolate missing values over cortical surfaces."""
import argparse
import os
import re
import nibabel as nb_surf
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
import brainbuilder.utils.ants_nibabel as nib
from brainbuilder.interp.acqvolume import (
create_thickened_volumes,
... |
b826def9132fbf3c57df16d5bb63688350d0326ef50b845f09881140e431fd4b | Python | 36,370 | 901 | import os
import yaml
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from abc import ABC, abstractmethod
#local
import auditory_cortex.utils as utils
from auditory_cortex.neural_data import NormalizerCalculator
from auditory_cortex.neural_data import create_neural_metadata
from auditory_cortex... |
43a56e3c363b8070902305e09744a5de6816c4c9bd96fd3ddffcc4a8dfc8f212 | Python | 36,490 | 910 | #! usr/bin/env python3
# -*- coding:utf-8 -*-
"""
This code is adapted from the kyzhouhzau/BERT-NER repo with several modifications.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import collections
import os
import math
impor... |
1b575abfdb09276e255ad48610a1b3b81c985b717777d4bed8e0aa1da3c5d1d8 | Python | 36,709 | 810 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import warnings
from ..engine import Layer, InputSpec
from .. import backend as K
from ..utils import conv_utils
from ..utils.generic_utils import to_list
from .. import regularizers
from ..... |
0ef606d951d1978f5389ee5014e09ad40fc844ab1f555715b7f033cafecbbde5 | Python | 36,733 | 922 | import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import Adam,AdamW
from torch.optim.lr_scheduler import ExponentialLR, StepLR, LinearLR
import torch.nn.functional as F
import torch.nn.init as init
import matplotlib.pyplot as plt
import torchvision
from torchvision.transforms import tran... |
bd708ad0e0492f04ad557ee871abebf02ef2b44d36082a2c6c9c56622dbf0556 | Python | 36,743 | 738 | #!/usr/bin/env python
#
# Wrapper to processing scripts, which loops across subjects. Data should be
# organized according to the BIDS structure and the processing script should
# make use of the some of the environment variables passed here. More details
# at: https://spine-generic.readthedocs.io/en/latest/
#
# Copyri... |
45fc2588f319bf2f080fe4fa16a5296a628eaa8a4ad9508143e375eadbdeded4 | Python | 36,989 | 915 | from __future__ import annotations
import math
import os
from collections.abc import Sequence
from dataclasses import dataclass
from typing import TYPE_CHECKING, Literal, get_args
import torch
from pymatgen.core import Structure
from torch import Tensor, nn
from chgnet import PredTask
from chgnet.graph import Crysta... |
fea7fd13eedd575f6b7c234944283e6f9683bc175b421f6e5773803ddf26850d | Python | 37,061 | 637 | # detect mutations in bam files.
import os
import pysam
import gzip
import numpy as np
from scipy.stats import hypergeom
from collections import Counter, namedtuple
from parse_gene_anno import parse_gff_tree
from sc_longread import blocks_to_junctions, get_gene_flat, get_gene_blocks
def get_fa(fn):
ch = ""
se... |
a8a0c2b54a4b44354fafa8926add6327cf092998ababd2afd24c9e94963101da | Python | 37,180 | 1,011 |
"""################################################################################
> # **Introduction**
> **This notebook introduces the pipeline to design compositionally complex alloys, specifically, 6 element alloys with higher magnetic properties**
> The notebook is divided into 4 major parts :
* **Part I** :... |
e99ce3ef818d7b1eae07dcf83c3f0ab113067acd5adaab6af44ed7f9faaecac3 | Python | 37,185 | 804 | #!/usr/bin/env python3
"""Draft a combined Babel/NodeNorm/NameRes release note.
Babel ships to Translator as a build plus the NodeNorm and NameRes versions deployed against it, so
a release note has to cover all three repositories. This assembles the mechanical parts of that note
-- the pull request list, the version ... |
4c476890cfeb0c389f1df5875cb41d834660aba6740ddb50c9f15f33165000b0 | Python | 37,189 | 1,098 | """Command line argument parsing for cwltool."""
import argparse
import os
import re
import sys
import urllib
from collections.abc import Callable, MutableSequence, Sequence
from typing import Any, cast
import rich.markup
from rich.table import Table
from rich_argparse import HelpPreviewAction, RichHelpFormatter
from... |
709e12a012f993a02fe8d66e513c28c5a68f373ff17c83814f1f4f03341d7c77 | Python | 37,223 | 693 | #!/usr/bin/env python
#
# Perform various types of processing from the spinal cord segmentation (e.g. extract centerline, compute CSA, etc.).
# (extract_centerline) extract the spinal cord centerline from the segmentation. Output file is an image in the same
# space as the segmentation.
#
# Copyright (c) 2014 Polytechn... |
8310ba0252d0633daf64d619fce7b525175b2f4a4e4ca414b978eba494cc4aa7 | Python | 37,235 | 860 | import logging
import shutil
from pathlib import Path
from typing import Any
import numpy as np
import pandas as pd
import panel as pn
from guppy.extractors import CsvRecordingExtractor
from guppy.extractors.detect_acquisition_formats import (
_classify_csv_file,
_is_event_csv,
)
pn.extension()
logger = log... |
eb546faab95aca88e287409f1c84b757210f078b85dddfd41ca7ce8ef966e6be | Python | 37,251 | 1,000 | from einops import rearrange
from copy import deepcopy
# from nnformer.utilities.nd_softmax import softmax_helper
from torch import nn
import torch
import numpy as np
# from nnformer.network_architecture.initialization import InitWeights_He
# from nnformer.network_architecture.neural_network import SegmentationNetwork
... |
20f7581eddb4b05975ecc5736d4c49b464fd84d196d1eb6284867540d33e2fd2 | Python | 37,286 | 970 | # -*- coding: utf-8 -*-
"""Core Keras layers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import copy
import types as python_types
import warnings
from .. import backend as K
from .. import activations
from .. import initializers... |
82749a6fee1c29fe0631f88f2032f9bdad8d94dd2cb75311635df5c028e9c53e | Python | 37,286 | 776 | import os
import torch
import yaml
import argparse
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage import binary_fill_holes
from dl_utils.config_utils import set_seed
from data.t2star_loader import *
from projects.moco_t2star.utils import *
from mr_utils.parameter_fitting import T2StarFit, CalcSus... |
78f27206d701b8856beebfa3823485a86328908ee01ab653d6093104a48d945b | Python | 37,364 | 1,068 | '''
All communication to the neuPrint server is peformed using a
:py:class:`Client` object, which holds your authorization
credentials, the dataset name to use, and other connection settings.
(To obtain your authorization credentials, see the :ref:`quickstart`.)
For commonly used queries, see :ref:`queries`.
Or you c... |
af47861992f1384a9cd1c99e026d959b8e620b5d11c6501ff69325f591d1668a | Python | 37,393 | 1,015 |
"""################################################################################
> # **Introduction**
> **This notebook introduces the pipeline to design compositionally complex alloys, specifically, 6 element alloys with higher magnetic properties**
> The notebook is divided into 4 major parts :
* **Part I** :... |
b330fb1f3313fcbfe737bae230e485eac20fcf002830d97c837b2dc2caff4893 | Python | 37,399 | 774 | '''
In this experiment, we train t-learners (separate models for each condition)
by loading a pre-trained VGAE and training Ridge regression heads on the
latent representations + clinical data for each condition separately.
Dependencies:
- data/raw/{study}/annotations.csv
- Pre-trained VGAE weights in weights_dir
A... |
5b26e5bdbbc6d26bf70b7304e362ad6f8301cc1aaeef0f60e57eae9b7f8d98b0 | Python | 37,493 | 785 |
##############################################################################################
# Load Data
##############################################################################################
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
import matplotlib.pyplot as plt
import matplot... |
911f5c4bd6a8b8c38b9cf800735a002a327fa179f0fe2f5af7009176faa977b9 | Python | 37,493 | 1,070 | # -*- coding: utf-8 -*-
"""
Functions for calculating and manipulating spatial autocorrelation
Author: Ross Markello, netneurolab
"""
import os
import tempfile
from pathlib import Path
import matplotlib.pyplot as plt
import nibabel as nib
import numpy as np
from scipy import fftpack, stats as sstats
from scipy.spatia... |
c0236516615b925921b734579d5631e75566db3ce0cb7bd80c17d1eabbb0025a | Python | 37,493 | 1,001 | # Author: Hauxu Yu
# A module to read and process the raw MS data
# imports
from pyteomics import mzml, mzxml
import numpy as np
import os
import matplotlib.pyplot as plt
import pandas as pd
from .params import Params, find_ms_info
from .feature_detection import detect_features, segment_feature
from .mzpkl import co... |
013d0dd007c252e80a8394e5aed7a70e5ec520a1f0abd3b7ca127f8dc5b0bc30 | Python | 37,565 | 893 | # -*- coding: utf-8 -*-
# encodermap/parameters/parameters.py
################################################################################
# EncoderMap: A python library for dimensionality reduction.
#
# Copyright 2019-2024 University of Konstanz and the Authors
#
# Authors:
# Kevin Sawade, Tobias Lemke
#
# Encoder... |
54ea044022ffbd5b9b4e0cda01620c2f04554bd69ac9e176bff77c12df49d04f | Python | 37,633 | 828 |
###########################################################################################
# Step 0.5
# Pre-FUNPACK
# Extracting columns
# -----------------NOTES---------------------------------------------------------------------
# For whatever reason, FUNPACK is struggling to extract
# (1) only subjects from the ... |
d34d763bbebf202bb1d063913d72c71bfbf64e9f9c7a8fc3aa2383b1cd55a407 | Python | 37,705 | 1,266 | """Mesh utilities."""
import os
from typing import Dict, List, Optional, Tuple
import matplotlib
import matplotlib.pyplot as plt
import nibabel as nb
import pandas as pd
import seaborn as sns
from joblib import Parallel, delayed
from sklearn.metrics import pairwise_distances
import brainbuilder.utils.ants_nibabel as ... |
f1a1ba817040d557d50749b0af0d25b2c7723f5726fd8da0363fd4c610bbdd0e | Python | 37,766 | 915 | """Session-scoped fixtures for pipeline tests.
Processing fixtures write intermediate ID files to the same stable paths that Snakemake
uses: {intermediate_directory}/{snakemake_dir}/ids/{vocab}, where snakemake_dir is the
compendium name unless overridden by compendium_directories in config.yaml (e.g.
diseasephenotype... |
f5a5dc10ff0d03d9377eccb87a9d802ae84e28afd9dc5f9eef3daf8643bb9b4d | Python | 37,871 | 1,012 | from collections import namedtuple
import torch
from Utils_ImageNet.models import *
import numpy as np
import datetime
import pandas as pd
import xlsxwriter
from sklearn import metrics
import time
import shutil
import os
import wandb
from Utils_ImageNet.dataloader import *
from Utils_ImageNet.config import loaderConfig... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.