sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
bbc9b7511ccac58b2a0189c9c00b6028c47837b3aaad5962e48c6ca5e288b250 | Python | 18,468 | 481 | import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import gym
import pandas as pd
import matplotlib.pyplot as plt
import time
import matplotlib.path as mpath
import matplotlib.lines as mlines
import matplotlib.patches as mpatches
from matplotlib.collections import PatchC... |
4ffca71c1881459e5669e77995f661281b46c9ebff97d1f7476915c048c2e5e7 | Python | 18,469 | 571 | # Copyright 2020 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... |
c68ee4b0405f9cc40c23595fc92fd07e78ffc21245a4cc545d633e3d56e815ac | Python | 18,497 | 511 | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
61a0183ac2be8bf2bea50bd97c38ff516b892a74a594830cefc7ce001d9721a1 | Python | 18,498 | 474 | import jax
import jax.numpy as jnp
import numpy as np
from typing import Tuple
from alphafold.common import residue_constants
# this is mostly Justas magic with some Phil hacks at the end
# some of this code is repurposed from the alphafold package
pdb_key_list = ['atom14_atom_exists',
'residx_atom14_... |
834c508c851291e07d80ff14245e8f57281694ab8d65723baa61a2ff743e255a | Python | 18,512 | 520 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
e831d2c188287f895b8d74bedf757ae96222460e22a1de16f104c70db2443ed6 | Python | 18,516 | 458 | from multiprocessing import Pool
import mmcv
import numpy as np
from mmcv.utils import print_log
from terminaltables import AsciiTable
from .bbox_overlaps import bbox_overlaps
from .class_names import get_classes
def average_precision(recalls, precisions, mode='area'):
"""Calculate average precision (for single... |
8a255a7d1d356e08e145afdb9075499ca05949b7a10922ce272f0c511815374f | Python | 18,538 | 591 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright 2020 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/LICENSE-2.... |
8bb91ce918cdb67f20720306fb31c4bbb0111f21e5772fb727dffd25827ee30d | Python | 18,542 | 438 | __author__ = "Jianfeng Sun"
__version__ = "v1.0"
__copyright__ = "Copyright 2023"
__license__ = "GPL v3.0"
__email__ = "jianfeng.sunmt@gmail.com"
__maintainer__ = "Jianfeng Sun"
import time
import numpy as np
from tmkit.seqnetrr.net.Reader import Reader as prrcreader
from tmkit.seqnetrr.window.base import Pair as ec... |
7daccd23204c98576cb405f8ace4400fd584be78e923cf6a619beed0f923ca0d | Python | 18,553 | 637 | #%% [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
im... |
4acdbfe750609dfe5681fef958f57e3f1597a626608c5aeeb117ee583c481681 | Python | 18,554 | 573 | import tempfile
import os.path as op
import logging
import numpy as np
import AFQ.viz.utils as vut
from dipy.tracking.streamline import set_number_of_points
try:
from dipy.viz import window, actor, ui
from fury.colormap import line_colors
import IPython.display as display
except (ImportError, ModuleNotF... |
1fefa6b540eaf3d3151d32dbdc797d5a6ea5009650d547c9bc67b7b88c1a9cac | Python | 18,559 | 673 | import math
import random
import torch
from torch import nn
from torch.nn import functional as F
from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
class PixelNorm(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input):
return input * torch.rsqrt... |
5505a8a26003fce5b09320700293336bb1e2e3fec1509b47bb86e0771da68012 | Python | 18,559 | 418 | """Local persistence of job results — every file that comes back is kept on disk.
Layout (``results root`` = explicit path, ``$COSMOS_RESULTS`` or ``./cosmos-results``)::
<results_root>/
index.json every job this machine knows about
<clip_id>/<job_id>/
<view>.mp4 ... ... |
89f8e59a72f942e081691bb8b246c0c62ca709de3b10d0f253ff0434dddc4dd2 | Python | 18,562 | 503 | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
1373a5443daf4969782f3b9fbafc268f07a335549dd49d4c6c0622a9f85911d3 | Python | 18,569 | 524 | # coding: utf-8
# 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 ... |
bf2a6b08005d5be07a8f5ab5d6732ce805526b1a885a0aef58cb5b7b415cf165 | Python | 18,597 | 389 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import time
import cv2
import os
import sys
import csv
import numpy as np
import matplotlib.pyplot as plt
import slideflow as sf
from random import shuffle
from matplotlib import patches
from mult... |
9e8b1d0b4f5e9c35568e86108a6d90e933b8d4a9ea15f2b7810e29f4bb191026 | Python | 18,606 | 522 | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
567db8dbb2c72b25206455dd07c423269fdfdf2fabf38e1388bb09eb6a562179 | Python | 18,610 | 403 | #!/usr/bin/env python3
"""
File: julienbryois2021_replication_plot.py
Created: 2022/01/12
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 publishe... |
f36d0f7345ebb797a9c6a476a04f7b4e2d1eda732db5c609e8ebb19086c845de | Python | 18,612 | 439 | #!/usr/bin/env python3
"""
File: compare_bulk_and_sn_zscores_with_decon.py
Created: 2020/11/04
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 pub... |
42ea7d32c80642b0dd17b67f3ac3d22a2c72f7e7d46e697fbeff39053a70fa81 | Python | 18,614 | 418 | import numpy as np
import torch
from mmcv.cnn import normal_init
from mmcv.runner import force_fp32
from mmdet.core import (anchor_inside_flags, images_to_levels, multi_apply,
unmap)
from ..builder import HEADS
from ..losses.accuracy import accuracy
from ..losses.utils import weight_reduce_loss... |
51703aeb0b0d281d62f26824c43409d34e7a1091c3a9258a609a16a8f5a83911 | Python | 18,614 | 505 | import pandas as pd
from scipy.io import loadmat
import xml.etree.ElementTree as ET
import numpy as np
import logging
from scipy.stats import binomtest
def mapping_is_complete(mapping: dict, is3D: bool = False):
for c in ["x", "y", "n"]:
if c not in mapping:
return False
if ("t" not in map... |
bdbd25597d4ac8718e9a996bc604e2b0492bea09c6591f5f8c3713e20a2179ec | Python | 18,619 | 309 | from scipy import sparse
import scipy.io
import sys
import pandas as pd
import numpy as np
from shutil import copyfile
import re
import os
script_dir = os.path.dirname(os.path.realpath(__file__))
metadata_dir = os.path.join(script_dir, "../../data/metadata/")
ref_gene_dir = os.path.join(script_dir, "../../data/")
curr... |
e927c32d4bae1b353f947b18fd8287d12a51efaa1a858f8a75cd104e7ccc6447 | Python | 18,621 | 492 | # 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... |
4aa1632cc45ef3520084c727929e344b3ce3a86b7d573aa09f232a87f95295c0 | Python | 18,622 | 438 | #!/usr/bin/env python3
"""Download CARLA — an official release, a nightly, a source checkout, or a Docker image.
Commands:
list published versions and what each one offers
resolve [--version 0.9.16] print the real download URL(s) + sizes, download nothing
release [--version late... |
21c20678aed012d51f17c41b511485384a1a3dd66d73903e1a67768652e4b90d | Python | 18,623 | 464 | """CROPro resample pipeline: align ADC/HBV scans and masks onto the T2W grid.
CROPro crops T2W, ADC and HBV at the same slice index and (x, y) origin, which
only works when the three sequences share an identical geometry. In many prostate
MRI datasets the sequences are acquired independently and differ in
slice count ... |
be17e51cb901d810276fc50b60c11b8920d5ea936b4dd12a4cfb603e5211a7ed | Python | 18,624 | 430 | #!/usr/bin/env python3
"""Scaffold and validate a CARLA Leaderboard agent.
agent_tools.py scaffold --name MyAgent --track SENSORS --out ~/team_code
agent_tools.py validate --agent ~/team_code/my_agent.py [--track SENSORS]
agent_tools.py budget [--track SENSORS]
`validate` calls the *real* validate_senso... |
3b8ee7082997e9ef6c6b40856b7d572e17af3cca40594da5a0166306d9618322 | Python | 18,628 | 515 | ####################################################################################################
# Copyright (c) 2019 - 2023, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free ... |
f0b8dc58352a5f4cafbb81a2fc935af3f3f898704a520ed23b1692e5b79660d6 | Python | 18,656 | 548 | # -*- coding: utf-8 -*-
"""
Spyder Editor.
"""
import time, sys
from neuron import h
import numpy as np
from opt import myinit
from cell_models import CCKCell, PyramidalCell, OLMCell, VIPCCKCell, VIPCRCell
t1sim = time.time()
# Load the console parameters
reps = int(sys.argv[1]) # repetitions
trials = int(sys.argv[... |
ef1c6fe06e8fa25215789c9206745824f9026556bd2719be70337c8338c2d8b5 | Python | 18,662 | 496 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from itertools import repeat
from pathlib import Path
import numpy as np
from numpy import newaxis
from numpy.testing import assert_allclose
import pytest
from eelbrain import datasets, load, test, testnd, Dataset, Factor, NDVar, Var
from eelbrain._data_obj imp... |
adcd4e32f2fec5de74ff158e54ef31a3b34c461cb5045650ba6a55f4482e3c7b | Python | 18,675 | 395 | """Live check that sensor.camera.rt_lens delivers deterministically in synchronous mode.
(a) latency: a prop moves 1 m per tick across the view; the rt_lens centroid at tick k must
correspond to the instance-segmentation mask centroid at tick k (a blocking raster sensor
at the same pose), not to the one from t... |
87bd6cb86f4bf72f5cb2baec45349b2db68217148c65ae61d58186a4b120e175 | Python | 18,682 | 548 | # -*- coding: utf-8 -*-
"""
Spyder Editor.
"""
import time, sys
from neuron import h
import numpy as np
from opt import myinit
from cell_models import CCKCell, PyramidalCell, OLMCell, VIPCCKCell, VIPCRCell
t1sim = time.time()
# Load the console parameters
reps = int(sys.argv[1]) # repetitions
trials = int(sys.argv[... |
f9ad5d6c696bd47905ec22f2431c204d4d033b2ba0ab98feb9b2f5729b7740d3 | Python | 18,684 | 438 | import argparse
import csv
import logging
from pathlib import Path
from typing import Dict, List, Tuple
import datasets
import torch
import torch.nn as nn
from datasets import load_dataset
from torchmetrics.functional import f1_score, mean_absolute_error
from tqdm import tqdm
from transformers import AutoTokenizer
fr... |
cd6074e632cd024ac82f9fe7e478c82c635d1b5552c9d51f5ba6e9f627eeaf1e | Python | 18,699 | 418 | import numpy as np
import torch
from mmcv.cnn import normal_init
from mmdet.core import (anchor_inside_flags, force_fp32, images_to_levels,
multi_apply, unmap)
from ..builder import HEADS
from ..losses.accuracy import accuracy
from ..losses.utils import weight_reduce_loss
from .retina_head impo... |
dcb4031eb34a6d537808248cc19605566ced49dbc87f81e59d8082849d8d4c9b | Python | 18,707 | 503 | # coding: utf-8
# 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 ... |
79259ceb4a610e9d7c5b817d4f210387b71fa0b8eedc101c8deb9f6236ec9a1e | Python | 18,717 | 353 | #%%
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from pymaid_creds import url, name, password, token
from data_settings import data_date, pairs_path
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
from contools import Celltype, Celltype_Analyzer, P... |
f26b9c6e2706debf26829f2f736cea6015af0d40f09022ed9f6adba4d367873d | Python | 18,772 | 467 | #
# Copyright (c) 2018 Institute for Basic Science
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... |
88a26ef8122f7254fac465a439830a828c33112832fa4eff362e5b68d5c35036 | Python | 18,785 | 468 | import logging
from collections import defaultdict
from copy import copy
from dataclasses import dataclass, field
from typing import Collection, Dict, Iterator, List, Mapping, Optional, Set, Tuple
from oaklib.datamodels.association import Association, AssociationChange
from oaklib.datamodels.vocabulary import IS_A, PA... |
86698e55675a5182f8e0cc61867866aad4d2cc63ec5d511f01d6b576f993de77 | Python | 18,788 | 473 | #!/usr/bin/env python3
"""
File: compare_eqtl_results.py
Created: 2022/04/01
Last Changed:
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 ... |
88abea7c6a801f5f6b54f1b66b9a03b9617b95805597f2d5ff1085749c0e120b | Python | 18,793 | 577 | import cv2
import copy
import torch
import numpy as np
from maskrcnn_benchmark.layers.misc import interpolate
from maskrcnn_benchmark.utils import cv2_util
import pycocotools.mask as mask_utils
# transpose
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
""" ABSTRACT
Segmentations come in either:
1) Binary masks
2) Polygons
... |
31ab16f65bd0cb41c6d5e4c91af1dc8e9e6dd828f615e0c2aae39c4745841764 | Python | 18,797 | 358 | import torch
import torch.nn.functional as F
import argparse, time, datetime, shutil
import sys, os, glob, json, random
import warnings
warnings.filterwarnings("ignore")
import numpy as np
import pandas as pd
import networkx as nx
from scipy.sparse import csr_matrix, lil_matrix, save_npz, load_npz
from sklearn.metrics... |
952aadfc07e99ee2fec08334848bee9470aefef81b0e78f9beaa81efaa164ede | Python | 18,808 | 480 | from functools import partial
import logging
import numpy as np
import torch
import torch
import math
from torch import nn
import torch.nn.functional as F
from .resample import resample
from .fno_block import FNOBlocks
from .spectral_convolution import SpectralConv
einsum_symbols = "abcdefghijklmnopqrstuvwxyzABCDEFGHI... |
349bbefb0164cafc49b5b86e762fe3f7f62f20c0630ffc689ab83a1bf36218a8 | Python | 18,818 | 497 | """
File: visualiser.py
Created: 2020/06/29
Last Changed: 2021/10/19
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 Foundation, either vers... |
6790a0a2aac395637e13f9110f1cf77f95e6fc3711bb944806ffd3cd3f228362 | Python | 18,821 | 489 | #!/usr/bin/python
####################################################################################################
# Copyright (c) 2016 - 2020, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# Thi... |
f13d6486766190d646f927aed05e7bdabee98c7cb033dedee5241a31ef19f9a2 | Python | 18,823 | 543 | import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import scipy.optimize as optimize
from scipy.special import erfc, erfcinv
import joblib
import torch
from torch import nn
from net_utils import load_from_file
from data import generate_recog_data, recog_chance
def plot_loss_acc(net, chanc... |
fbccb7ad63ae31cc54629c8f726ddfe425fc5bc8c68da7e2b7743504f1ff890e | Python | 18,860 | 453 | import torch
import torch.nn as nn
import numpy as np
from numpy.polynomial.legendre import Legendre
import warnings
from pathlib import Path
import tensorly as tl
class FourierContinuation(nn.Module):
"""Base class for Fourier Continuation implementations.
Fourier Continuation is a technique for extending n... |
a823ca689935df28bd8ca2cd869a07163a80cadafbb1b087f668d58e28dae43f | Python | 18,875 | 406 | import logging
import math
from collections import defaultdict
from dataclasses import dataclass
from enum import Enum
from typing import Iterable, Tuple, List, Union, Optional, Iterator
from oaklib.datamodels import obograph
from oaklib.datamodels.similarity import TermPairwiseSimilarity
from oaklib.implementations.s... |
e8a3bd5fcb0a2b97563af01fa46e14cc5835b1216d5bf0c2b4f1ba42de530f4c | Python | 18,880 | 550 | import numpy as np
import scipy.linalg as lin
import h5py
import pandas as pd
import os
from FBEM.various import path_to_string, Path
# Read input file
def read_tolerance(folder):
'''
read the 7nth thing from a line, replace D with E (e.g. in "0.1D-1"), transform to a float
'''
with open(os.path.join(... |
7806d7f51006ca7eb37ac8f1895400637e591d01c787f7dccaa1b581f3c2d44d | Python | 18,891 | 659 | #%% Imports
from operator import itemgetter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from graspy.cluster import GaussianCluster, KMeansCluster
from graspy.embed import AdjacencySpectralEmbed, LaplacianSpectralEmbed, OmnibusEmbed
from graspy.models import DCSBMEstimat... |
31273714fb3981ded5b1b92d4bcc109bca8d396e328e66b6c7cb75bc80788739 | Python | 18,894 | 614 | """Generate a QC summary HTML report from the pipeline's QC files.
The report is a table with one row per session, holding the numbers each step
saves (bad segments, MNI registration, coregistration error, ...), next to the
QC plots of the selected session. Sort the table by a metric to see the worst
sessions first. O... |
c6e68f54a073900fda0e300df0d351005916f557bb63965cac6f2057fce1089d | Python | 18,898 | 433 | class PQNModel:
# available mode list
MODE_LIST=['RSexci', 'RSinhi', 'FS', 'LTS', 'IB', 'EB', 'PB', 'Class2']
# init
def __init__(self, mode='RSexci'):
self.PARAM={}
self.Y={}
self.state_variable_v=0
self.state_variable_n=0
self.state_variable_q=0
self.st... |
acf6f8297f7a4ba8f2f301330e6c8436ef3f6ddc2b093414d5b7431dd892e445 | Python | 18,906 | 462 | #!/usr/bin/env python3
"""
File: compare_bulk_and_sn_zscores_with_decon.py
Created: 2020/11/04
Last Changed: 2020/12/16
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 pub... |
6c5dcc98811b60fc63a120405f72c3d367c113536aa584868a7ad23cdace4a87 | Python | 18,910 | 432 | #!/usr/bin/env python
# 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>.
"""Multi-camera rig throughput benchmark with a two-pass video recording.
Pa... |
c3ee7e44c624c6135c8f47f343f33f4a7451e0710ae3df3cbeeb876caad5bfaf | Python | 18,924 | 133 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: nre/grpc/protos/sensorsim.proto
# Protobuf Python Version: 5.29.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descrip... |
1f2e82bf432ac248fdb291ff1d9bf8d046b8c5845b8b439cfbfe9aefff8135c7 | Python | 18,930 | 547 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Implementation of nipype interfaces for QUIT utilities.
Requires that the QUIT tools are in your your system path
"""
from json import dump, loads
from os import path
from nipype.interfaces.base import CommandLine, TraitedSpec, File, traits, isdefined
from . import ... |
1880d0988e57b8d5d3d5f9b83212804635b89a5e484f2f70d46932f75fcb325b | Python | 18,939 | 417 | """
This benchmark compares the performance of different models in
predicting tissue based on gene expression
"""
import argparse
import copy
import json
import os
from typing import Tuple
import optuna
import sklearn.metrics
import torch
import yaml
import utils
import datasets
import models
# Note, the arguments w... |
952b486b37bbd41bff2b3f4850d740295ef11a73a7ffea77b15bc00490cee1ec | Python | 18,939 | 504 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import os
from yacs.config import CfgNode as CN
# -----------------------------------------------------------------------------
# Convention about Training / Test specific parameters
# ------------------------------------------------------------... |
dcdecd47e1f2b70deb7c3aaa01357f63d8b11e295f5adc95ed969b63d8b1828b | Python | 18,950 | 462 | """
MEG: Preprocessing, Source Reconstruction, Parcellation
=======================================================
This tutorial walks through the full MEG processing pipeline step by step:
1. Preprocessing — Filter, downsample, detect bad segments/channels, ICA artefact rejection.
2. Surface Extraction — Extract sk... |
6fd602e1c64c068154d3936311bdf0ac038b8eafa745ed241cc8085565f977ac | Python | 18,954 | 513 | import os
import sys
import numpy as np
import pyqtgraph as pg
import pyqtgraph.functions as fn
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import cv2
from .wtiles import *
btm_style = '''
QPushButton {
border : None;
background: transparent;
margin: 0px;
pad... |
e530cd8954cea6bd914cc8782f8c6461781ea2dbf10976e53f05fad67b295d38 | Python | 18,962 | 520 | """Provides various functions related to GROMACS. NOTE: Functions are only tested for specific applications. """
#TODO cleanup
from math import floor
from contextlib import suppress
from bisect import bisect_left, bisect_right
import functools
import os
import core.system as system
#import u... |
48c4e0b71bf9df68bc563b0422366a1d8af6f14508c9b38d07acb06bdaf3ad44 | Python | 18,976 | 495 | #!/usr/bin/env python
# Interface to an annotation .gtf file (e.g., GENCODE).
import os
import sys
import re # for regular expressions
import cPickle as pickle
from tt_log import logger
VERSION = '20150611.01'
logger.debug('version %s loaded' % VERSION)
class Annotation (object):
def __i... |
ae2b39d1041523d5e6addae752500b80c6513d34cb8bdb7241787992973f0fc7 | Python | 18,983 | 435 | import torch
import torch.nn.functional as F
from torch_geometric.datasets import Reddit
from torch_geometric.data import ClusterData, ClusterLoader, Data
from torch_geometric.nn import SAGEConv, GCNConv
import argparse, time, datetime, shutil
import sys, os, glob, json
import warnings
warnings.filterwarnings("ignore... |
9724753f686f8412736f3bb2e67407c2cf8ba9cd41d2eaea18dbafb2909f4042 | Python | 18,985 | 377 | import os, sys
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir) # PYTHON > 3.3 does not allow relative referencing
from datetime import datetime
from tensorflow.keras.callbacks import ModelCheckpoint, TensorBoard, EarlyStopping, ReduceLROnPl... |
8383270e941b393e9b28d3092392d7f05ad5d8c6084089d9ccae99d8a08b5e61 | Python | 19,010 | 455 | # 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... |
fe34ada2c3899ff5357a164110c1345cdf69a0e78a34fe68099138742a5e1e47 | Python | 19,012 | 511 | import configparser
import pathlib
import random as rng
import sys
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import numpy as np
import SimpleITK as sitk
seedValue = rng.randrange(sys.maxsize)
rng.seed(seedValue)
DEFAULT_MODALITY_NAMES = {
"T2W": "T2W",
"ADC": "ADC",
"HBV": "HBV",
}
PROJ... |
34904c9a094f77529bf4b232aae6f060014c3096c2b3789996f3e21e9854c21b | Python | 19,036 | 374 | # Time-stamp: <2024-10-11 10:28:07 Tao Liu>
"""Description: Call variants directly
Copyright (c) 2017-2023 Tao Liu <vladimir.liu@gmail.com>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included
with the distribution).
@status: release ... |
e571eefce420b7383a3605438b77d176ddaa552cd8dc59924379d865bf6d0e4c | Python | 19,036 | 449 | """
The BatchSequence class implements the primary mode of access to batches of
sampled data from a list of SleepStudy objects.
See docstring below.
"""
import logging
import numpy as np
from utime.sequences.base_sequence import BaseSequence, requires_all_loaded
from psg_utils.errors import MarginError
logger = logg... |
04138711e72507e6f5d338331394f838ca5dc212f93d41c80c93559b6ca6d01c | Python | 19,038 | 518 | ####################################################################################################
# Copyright (c) 2021, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free softwar... |
74883600b38f35d954ff11e39041a9d7df289e2e656db8c37a015e05102af09e | Python | 19,050 | 680 | #%% [markdown]
## Maggot embedding alignment
# > Investigating alignments of the maggot data embeddings
#
# - toc: false
# - badges: false
# - categories: [pedigo, graspologic, maggot]
# - hide: false
# - search_exclude: false
# %%
# collapse
import os
import pprint
import time
import matplotlib.pyplot as plt
import n... |
b9ba0e7ce006a8aa34dcd2d637f90ca2e3cab2b392a50130d533c9a8462e5568 | Python | 19,053 | 550 | """
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... |
fc01490a442c53819f7e0727c96eb50cf30fa763fe23372c32c051c67a002459 | Python | 19,060 | 523 | from __future__ import absolute_import
from __future__ import division
from builtins import next
from builtins import zip
from builtins import map
from builtins import range
from past.utils import old_div
from builtins import object
import itertools as it
import multiprocessing
import warnings
import numpy as np
try:
... |
ba9f199b3868dac485a8a31e33ea1e81aa87c19c86039ad23cf127d2d853c54e | Python | 19,071 | 432 | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from ..layers.spectral_convolution import SpectralConv
from ..layers.fno_block import FNOBlocks
from ..layers.complex import cselu
class RNOCell(nn.Module):
"""N-Dimensional Recurrent Neural Operator cell. The RNO cell takes in... |
280fefe197664a9fd7ddd43bbc5097a7b7e581476f1aa57eb9a7152c57b7b728 | Python | 19,086 | 408 | #!/usr/bin/env python3
"""
File: comnpare_cf_predictions.py
Created: 2021/11/22
Last Changed:
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 Softwa... |
f096a217e8a29454982edce80244cb903bcadb5f6d6eb7c147b2fbda2d4ece3c | Python | 19,086 | 429 | """
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... |
07f122917db8946dcc9298e9381506610de145c23caab093d56ee1740d098cb3 | Python | 19,087 | 503 | """
Mask R-CNN
Display and Visualization Functions.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import os
import sys
import random
import itertools
import colorsys
import numpy as np
from skimage.measure import find_contours
import matplo... |
e32d4fa679d159aa65badd87e4ca5a7df357f9215dfc210ff21637c38df64606 | Python | 19,091 | 624 | from warnings import warn
import matplotlib.pyplot as plt
import numpy as np
import numba as nb
from scipy import signal
from .Tools import timeToIndex, raiseExpectedGot
class Trace:
"""
An experiments includes many experimental traces.
A Trace contains the experimental data acquired during a single cu... |
95602b586a7789be0c527fdbeb8ba3624991204f4db4810e26d2016c758c2b40 | Python | 19,098 | 523 | """A recipe example for preprocessing Finnish parliament transcripts to a kaldi text file."""
import re
from pathlib import Path
from typing import Any
from typing import Dict
from typing import List
from typing import Match
from typing import Tuple
import aalto_asr_preprocessor.fi.numbers.expansion as num_fi
SUFFIX... |
fd2b0c5a3605392d07e697ea0e668026e6eeae49c22ab1627e6da80601d81b51 | Python | 19,107 | 553 | # 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... |
f96a7f770f80d517708f025fbe09af6890800165dbe8895395e21ae368b1ab4c | Python | 19,142 | 536 | import logging
import time
from abc import abstractmethod
from collections import OrderedDict, defaultdict
from itertools import cycle
from typing import List
import anndata
import numpy as np
import torch
from sklearn.model_selection._split import _validate_shuffle_split
from torch.utils.data.sampler import SubsetRan... |
40a7e9a99d0df6a8e7c7ca1335399d5d1771f42b4db004f642aa733220be4a12 | Python | 19,152 | 440 | # cython: language_level=3
# Time-stamp: <2024-10-24 15:20:26 Tao Liu>
"""Module Description: Detect peaks, main module
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).
"""
# ---------------------------------... |
cb491872b7ff5fc71ee4416c7580a74cdf264cbe77b4d72f5973196a0935cdd1 | Python | 19,175 | 460 | import argparse
import os
import sys
from types import ModuleType
from typing import Dict
from typing import Tuple
from typing import Union
import numpy as np
import pandas as pd
import SimpleITK as sitk
import tensorflow as tf
from tensorflow.keras.models import load_model
import PrognosAIs.Constants
import Progno... |
5a4eec4d9886852c1a61354f0c6a7d15d6543151a2b136706d996e325d76e3e9 | Python | 19,179 | 534 | import numpy as np
import torch
from slideflow.clam.utils import *
import os
from slideflow.clam.datasets.dataset_generic import save_splits
from slideflow.clam.models.model_mil import MIL_fc, MIL_fc_mc
from slideflow.clam.models.model_clam import CLAM_MB, CLAM_SB
from sklearn.preprocessing import label_binarize
from s... |
8c6d8291ae4ed61c4eb02464b3618fc3772991faa67159692beee24eb3d1726d | Python | 19,195 | 417 | # 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... |
79c65d5bd928e0e41d17f76195186f786a5d6e375b3abc170a12eaf3c857a97e | Python | 19,219 | 616 | # %% [markdown]
# ##
import os
import warnings
import matplotlib as mpl
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import poisson
from sklearn.exceptions import ConvergenceWarning
from sklearn.manifold import MDS,... |
aaee440d2e52ced4db4f3e586f22e609f8924b02166f7728b4657a0548c49bf8 | Python | 19,220 | 429 | #!/usr/bin/python
#
# Copyright (c) 2017-2020 Intel Corporation
#
# Helper script for code formatting using clang-format-3.9 and autopep
import argparse
import filecmp
import os
import re
import sets
import subprocess
import sys
from termcolor import cprint
SCRIPT_VERSION = "1.3"
class CodeFormatter:
def __in... |
d686656635440240dafaefadfb8709b00cdcdf2c5fe9568dc89d362d72743f94 | Python | 19,221 | 373 | #coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import nltk
import os
import random
import sys
import time
import json
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
... |
535f02976c6c56854c5131792b867692a25114c8928ccd4616863ae5a4fb3b81 | Python | 19,253 | 483 | import difflib
import json
from datetime import datetime, timedelta
import polars as pl
import multiqc
from multiqc.core import tmp_dir
from multiqc.core.plot_data_store import flush_to_parquet
from multiqc.core.special_case_modules.load_multiqc_data import create_plot_input_data_only
from multiqc.core.update_config ... |
a56b1f5c75d43a6403130eec344a9d4c3189b666254270fd2c307124c9077ba0 | Python | 19,253 | 413 | """Job scheduler: per-backend FIFO with priority, one job per worker, one job per GPU.
The loop wakes on every submission/cancellation/worker-state change (or once a
second), and for every idle worker claims the best queued job among the
backends that worker serves: ``interactive`` before ``batch``, then oldest
first.... |
6d49b4e12dcdc6373acce9eb13684d033b0c399cfcc1ffe9c99e998152a6af30 | Python | 19,258 | 566 | """
=================================================
Making videos the different stages of tractometry
=================================================
Two-dimensional figures of anatomical data are somewhat limited, because of the
complex three-dimensional configuration of the brain. Therefored, dynamic
videos of a... |
62e92ad034ddd5d429edb8e1d5f092d7d6f285e4a05e66f4140c049ab9bdc22b | Python | 19,291 | 566 | """
Core functions for scHumanNet analysis.
This module contains the main functions for cell-type-specific network analysis,
including centrality calculations, hub gene identification, and differential
network analysis.
"""
import numpy as np
import pandas as pd
import networkx as nx
from scipy import stats
from skle... |
a07e86570c8fb171654a2adc9891cfcfb01986105badba7b47699974760132a7 | Python | 19,322 | 364 | # 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... |
c4d568c5510a48638a4711716a5f18e8374a772b3791d40bb1130c15104877e7 | Python | 19,348 | 705 | import math
import random
import torch
from torch import nn
from torch.nn import functional as F
from model.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
class PixelNorm(nn.Module):
def __init__(self):
super().__init__()
def forward(self, input):
return input * torch.rsqrt... |
9ab0cb68db881b1a611484aa6e4399967fa9caa564dad325b3930d39d8049e01 | Python | 19,366 | 469 | import argparse
import time
import os
import csv
import json
import numpy as np
import pandas as pd
import random
import shutil
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.backends.cudnn as cudnn
import matplotlib.pyplot as plt
from skimage.metrics import... |
122f3306c831f069cdd870ff5a2c7956fccca43b4125e1a0009e13533f4a2a44 | Python | 19,371 | 460 | """Change Handler Class."""
from dataclasses import dataclass
from typing import Dict, List
from kgcl_schema.datamodel.kgcl import Change
@dataclass
class ChangeHandler:
def __init__(self, oi, file):
self.file = file
self.oi = oi
def write_markdown_collapsible(self, title: str, content_line... |
72258a099bd47b98214341068b781ee1e89894d8827907f274154f39331e53d7 | Python | 19,379 | 506 | #
# Copyright (c) 2018 Institute for Basic Science
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... |
d6f8fb85b058c747502cd4259f78989a390fb3672a5b466a33da717ef0634eb0 | Python | 19,397 | 577 | # 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... |
faa06370f3848c44f1e735e18b2478f945666b6f06f91651ed2927c545989ef1 | Python | 19,405 | 451 | import json
import os
import re
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk.corpus import stopwords
import pandas as pd
import argparse
from util import files_in_dir
from ArticleDataSample import CommonSectionNames
class DataCreator:
"""
A class for converting json files of scientific pa... |
b148b5de039d7317ecb5f7c63f0d992e3ccb9719dd1bbaabb4a277c427cecf1a | Python | 19,417 | 733 | #%% [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... |
c932098d61e5fba78a83b89d12a42726c85c8bad8fe1effcce9248c56e679655 | Python | 19,432 | 605 | import logging
import re
from dataclasses import dataclass
from typing import (
Any,
Dict,
Iterable,
Iterator,
List,
Mapping,
Optional,
TextIO,
Tuple,
Union,
)
from kgcl_schema.datamodel import kgcl
from pydantic import BaseModel
from oaklib.datamodels.search import SearchConfi... |
c256e51e3880aeabccd14199d77f4dc941e2b1395e4ea03414878d7d882d8c08 | Python | 19,433 | 488 | import itertools
import logging
import os.path as osp
import tempfile
import mmcv
import numpy as np
from mmcv.utils import print_log
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from mmdet.core import eval_recalls
from .builder import DATASETS
from... |
e796b9b4f49da7efeec10cff5e28457ecec14492f0684ad12e62f898bb965af8 | Python | 19,433 | 446 | import numpy as np
import torch
import torch.nn as nn
import tqdm
import time
from typing import Optional
from torch_geometric.utils import k_hop_subgraph
from torch_geometric.data import Data
from torch_geometric.nn import GCNConv, GINConv
from graphxai.explainers._base import _BaseExplainer
from graphxai.utils impo... |
1f8e66d72bc20ae2b29841fa43d93a1a2276f8b440ff42d814a2ac18388a2c99 | Python | 19,441 | 557 | ####################################################################################################
# Copyright (c) 2019 - 2023, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.