sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
033af2702fae634df4495290fdff5928a7f15467bc1224313e3e57a3f99b03d3 | Python | 23,491 | 467 | # Auto generated from validation_datamodel.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-05-30T15:33:38
# Schema: validaton-results
#
# id: https://w3id.org/linkml/validation_results
# description: A datamodel for data validation results.
# license: https://creativecommons.org/publicdomain/zero/1.0/
impo... |
985d5a8efab76831789870471df441a3438c6feb2146dd85106533f8ff27feaa | Python | 23,506 | 702 | # Code written by: Maksim Imakaev (imakaev@mit.edu)
# Anton Goloborodko (golobor@mit.edu)
# Legacy code, unlikely to be used these days and may require refactoring
"""This class is a collection of functions for showing data with pymol. Note that the limit of pymol is 100k
monomers, therefore interpol... |
9e4ac8c5e9a40b33f97e5d6ec8abf8d0ef7bbeb45fe81e6486980bb3ae2fb987 | Python | 23,521 | 531 | # 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>.
from __future__ import print_function
import unittest
import glob
import os
import sys
import carla... |
8a0c6f4b1b9dadb403f1e2b84617ba7fa975510b86ea59ffe76ee3358a86bf8b | Python | 23,525 | 653 | # 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... |
a1d05fb82fd3433e2abc269cb175a4a0220b3c72523ceed4f4f9f30a4e06126d | Python | 23,531 | 662 | __author__ = "Jianfeng Sun"
__version__ = "v1.0"
__copyright__ = "Copyright 2023"
__license__ = "GPL v3.0"
__email__ = "jianfeng.sunmt@gmail.com"
__maintainer__ = "Jianfeng Sun"
import numpy as np
import pandas as pd
from tmkit.seqnetrr.combo.Separation import Separation as ppssep
from tmkit.seqnetrr.ComputLib import... |
199e8a9426bd9deaffee8578df0380292945795420157847f978108da9e6d936 | Python | 23,535 | 653 | import os
num_threads = 4
os.environ["MKL_NUM_THREADS"] = "%s" % num_threads
os.environ["NUMEXPR_NUM_THREADS"] = "%s" % num_threads
os.environ["OMP_NUM_THREADS"] = "%s" % num_threads
os.environ["OPENBLAS_NUM_THREADS"] = "%s" % num_threads
os.environ["VECLIB_MAXIMUM_THREADS"] = "%s" % num_threads
os.environ["NUMB... |
fb45a080675d849117d9487ce36999385a4c092d81e3160c095e1df389f9c11d | Python | 23,582 | 530 | # 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... |
15aaee5fa30cd21024909e96aa4044c9119dc90bcf060546388a31daa38ac73e | Python | 23,601 | 587 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 7 14:21:29 2021
@author: Alexandra Vallet
This scritps is used to post-process the traces of the linescan data.
The raw data consists in the position of the two borders of the vessel and the two borders of the atrocytes with time.
Here we comp... |
26b7448c61f40934e130120a3cf68a5e1e2a08f1285816db2944edf713598e8b | Python | 23,624 | 702 | from warnings import warn
import numpy as np
import matplotlib.pyplot as plt
import cPickle as pkl
import quantities as pq
from neo import AxonIO
from .SpikeTrainComparator import SpikeTrainComparator
from .Trace import Trace, filterTimesByROI
from .AEC import AEC_Dummy
from . import ReadIBW
from .Tools import raiseE... |
9f305caacfa48be36f26cfba708a75774dfcfb246030b220ddefbd33c5cfb6e6 | Python | 23,631 | 483 | # %%
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 editabl... |
6d0fd3e038f13ab37224421b6988ee3d26e443c915e9d210677977d0641a9f4b | Python | 23,647 | 593 | # 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... |
8121bb104578c4e496c3c0b2a2029ec4586b182771bc0709b972dd860b20a350 | Python | 23,673 | 539 | import torch
import torch.nn.functional as F
from mmdet.core import (bbox2result, bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, multiclass_nms)
from ..builder import HEADS, build_head, build_roi_extractor
from .cascade_roi_head import CascadeRoIHead
@HEADS.register_module()
class... |
c0d82e075d8e24e2ea41792773733d1606b0416509506ae9d449d33866128c87 | Python | 23,678 | 413 | # 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... |
3d68d48ca6395cd1769a82007d93cc9d0dff0a9a408031ec2e1b4f1efcf17ed4 | Python | 23,708 | 607 | import numpy as np
import pytest
import torch
from mmdet.core import BitmapMasks, PolygonMasks
def dummy_raw_bitmap_masks(size):
"""
Args:
size (tuple): expected shape of dummy masks, (H, W) or (N, H, W)
Return:
ndarray: dummy mask
"""
return np.random.randint(0, 2, size, dtype=n... |
997367103135fb165f2980b7e4412e493036f0da07629487d52c595a36299bac | Python | 23,712 | 577 | # Copyright 2021-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... |
e9520918632b339dc1fcc217bb5fff911e711217e45e2235023e5dc4ade26844 | Python | 23,712 | 501 | from functools import lru_cache
import jax
import numpy as np
import jax.numpy as jnp
from .grid import YeeGrid
from .mode import ModeSolver, ModeLibrary
from .parse import parse_excitation
from .typing import Excitation, Spacing, Shape, Union, Size, Optional, List, Tuple, Size2, Dict, Size3, \
Callable, \
Me... |
a9139a966816d0e7a6a97fed811d20092c8b26f8f8d65ddc9ed859920beaa2ed | Python | 23,719 | 751 | # %% [markdown]
# # THE MIND OF A MAGGOT
import matplotlib as mpl
mpl.use("Agg")
import matplotlib.pyplot as plt
# %% [markdown]
# ## Imports
import os
import time
import warnings
import colorcet as cc
#
# import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as... |
375a187b67986c56770cc64c9f37977b910de3e5a97ef42a528ea9f0311db1ed | Python | 23,754 | 768 | #%% [markdown]
## Modeling the distribution of neural networks
# > An attempt to characterize the distribution of neural network parameters that are learned on the same task
# - toc: true
# - badges: true
# - categories: [pedigo, graspologic]
# - hide: false
# - search_exclude: false
#%%
# collapse
import os
import wa... |
66addb56891a1e89b5dbad8597f76b574a3df2a80afddfe4c3d4e65ffb24779d | Python | 23,762 | 538 | #!/usr/bin/env python3
"""
File: visualise_ct_mediated_eqtl.py
Created: 2020/09/23
Last Changed: 2021/02/22
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... |
84aa77505bc20df6fe601c346ab9ffabf2b9e4976670d1fffa484a5f8933e414 | Python | 23,786 | 685 | # /// script
# requires-python = ">=3.12"
# dependencies = [
# "h5py>=3.10",
# "numpy>=2.0",
# "pyarrow>=15",
# "pandas>=2",
# "tqdm>=4.67",
# ]
# ///
"""Build the public, slimmed-down SOR-Arch tabular benchmark from consolidated h5 files.
Drops per-epoch features (the bulk of the file size) and most predict... |
2b7eb07d6c943ce333dcfbdba55eb0f8bf85e9b101db10ff62e7a13d93f0a64b | Python | 23,809 | 627 | """
Adaptive values are parameter list. list reflect time-scale layer,
each variable's size is [data_size, z_dim[layer], time_step].
Lowest (index = 0) layer is fast context. In detail, see _generation
method.
"""
import torch
import torch.nn as nn
from model.cell import MaskMaker
from model.component import Inferenc... |
221c8e0759cadef7ac63fe0b3f2fb74ae75bf7fb8304000c523eb23d5b06bcca | Python | 23,814 | 634 | """
Sinusoidal Embeddings
====================
Inputs to deep learning models often represent positions on a spatial, temporal, or
spatio-temporal grid. To enrich these coordinates, positional embeddings can be introduced
to improve a model's capacity to generalize across the domain. In this tutorial, we focus
on sinu... |
805cb57bee2fbded97e68e1d1b74bf5490b921da5e28f5fed536c34ea2f895bb | Python | 23,842 | 531 | #Authors : Maria-Anna Trapotsi, Layla Hosseini-Gerami and Lewis Mervin
#Contact: mat64@cam.ac.uk and lh605@cam.ac.uk
#Supervisor : Dr. A. Bender
#All rights reserved 2021
#Protein Target Prediction using SAR data from PubChem and ChEMBL_28
#Molecular Descriptors : 2048bit circular Binary Fingerprints (Rdkit) - ECFP_4
#... |
7a245ddd76833cd16656d55aca995158f1664ebf99d4a89fcf36c762f9a181b5 | Python | 23,845 | 499 | """
The `train_multitask` subcommand that can be used to train the model in the multitask fashion
It requires a configuration file and a directory in
which to write the results.
.. code-block:: bash
$ allennlp train --help
usage: allennlp train [-h] -s SERIALIZATION_DIR [-r] [-o OVERRIDES]
... |
0458504c21ed722bf750dc873c03e1f5a598bffa67a2c467edfc9238fd2e9234 | Python | 23,876 | 543 | # tn_mismatch_clustering.py
import pandas as pd
import numpy as np
import statsmodels.api as sm
from sklearn.preprocessing import StandardScaler
from scipy.cluster.hierarchy import linkage, dendrogram, fcluster
from scipy.stats import pearsonr
from scipy.spatial.distance import pdist
import matplotlib.pyplot as plt
im... |
12c831b1f544a8c3be8564b304e00f9b2c7c21b6b863dd0fa3973d899ebfff85 | Python | 23,882 | 696 | ####################################################################################################
# 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 ... |
2f6b6ec26a088bef61c2121f83ec87f0cb016b26fa58f9ed2e43cf2a472570a5 | Python | 23,913 | 606 | # %%
# significant portions below are from Ben Pedigo's script found here: https://github.com/neurodata/maggot_models/blob/052af5d5999b2ae689b9d4a8d398748858acfd3a/data/process_scripts/process_maggot_brain_connectome_2021-05-24.py
# parts of this script have been modified to make it more general
import json
import os
... |
c77839d10174874376d61b21f8dc0a3a5180b72a8320dbeb49710919c59c3252 | Python | 23,913 | 580 | """Parsers for handling different parliament documents published after 2015."""
import re
from typing import Any
from typing import List
from typing import Optional
from typing import Tuple
from lxml import etree
from fi_parliament_tools.parsing.data_structures import MP
from fi_parliament_tools.parsing.data_structur... |
ba0114d5ede856c23de2f1664e5bc02738bafd54338afbd4467e4307624f0263 | Python | 23,924 | 559 | import pytest
import os
import tempfile
import subprocess
from pathlib import Path
import numpy as np
import textwrap
from io import StringIO
from collections import Counter
import ase
import ase.build
import ase.io
import torch
from nequip.data import AtomicDataDict, from_ase, compute_neighborlist_
from nequip.nn ... |
3beb2cffe463fb7ccfb3d38a567d1216e30590915d349c45637a6ed4c1298251 | Python | 23,970 | 807 | import sys
import nrrd
from skimage import io
import os, os.path
import math
import h5py
import time
import numpy as np
import pandas as pd
import pickle
import more_itertools as mit
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import pandas as pd
import csv
import scipy
import utils.general_utils as gen... |
dce5c51c6e3eaf3f1909e3a800a401481d8a23aa11adefa483ddbac241a4075c | Python | 23,983 | 723 | """ROI and ROIList classes for storing and manipulating
regions of interests (ROIs).
ROI.ROI objects allow for storing of ROIs as either as a boolean mask of
included pixels, or as multiple polygons. Masks need not be continuous and
an ROI can be defined by multiple non-adjacent polygons.
In addition, each ROI can be ... |
549c678ec55f7910b0a769073b0df906cf64bd0052e785d67130811aefb93d89 | Python | 23,984 | 511 | #!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 8 12:18:35 2021
@author: paulmueller
"""
import pandas as pd
from datetime import datetime, timedelta, time
import time
import numpy as np
import os
# =============================
# Extract electrode data from txt
# ==========================... |
6f032a53f3d6db19a243b8f7d4dccf29c355170585476f5c8bcac129cdf57b12 | Python | 23,985 | 523 | # Editor-side content repair for World Partition maps whose external actors reference
# MaterialInstanceDynamic objects that live outside their own package (typically outered
# to the persistent UWorld, e.g. created with KismetMaterialLibrary.CreateDynamicMaterialInstance
# with the editor world as world-context). Suc... |
4baf79366087536693210100bd857a89a1fcd38bd7d573a41f12af98bee4f260 | Python | 23,998 | 641 |
import os
import sys
import argparse
import glob
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.gridspec import GridSpec
import pandas as pd
import tensorflow as tf
import ndsvae as ndsv
def paramplot2d(ax, treg, title, xlabel, ylabel, scalar):
cmap = matplotlib.cm.magma
... |
95b9c37e37f03ef00093db42e8dc1d42af41c2ede647c459474c48ad897ad90a | Python | 24,031 | 558 | # -*- coding: utf-8 -*-
"""
@author: Yuxiu Shao
Statistics of the network connectivity
Full-rank Gaussian Network and Rank-one Mixture of Gaussian Approximation
Connectivity, Dynamics
"""
''' HELP FUNCTIONS '''
import numpy as np
import matplotlib.pylab as plt
from numpy import linalg as la
# import seaborn as sb
#... |
4fb74a09fd0e5bb798b619f76b723c86a0d68c4d2802b3014b5b7c9e06ec28aa | Python | 24,041 | 585 | #!/usr/bin/env python3
"""
File: visualise_inter_eqtl.py
Created: 2020/10/27
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 F... |
1c3a5b75b6067e010677459971fd72b4eaefba94a260a9e3a9442b2ddad7f6ae | Python | 24,051 | 585 | #!/usr/bin/env python3
"""
File: visualise_inter_eqtl.py
Created: 2020/10/27
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
the Free... |
533c61fe78d21ee9da649e19106dc6df818c344e0ca6654a96e923757a059235 | Python | 24,055 | 577 | import logging
from abc import ABC
from collections import defaultdict
from dataclasses import dataclass, field
from typing import List, Iterable, Tuple, Optional, Union, Iterator, Dict
import SPARQLWrapper
import rdflib
import sssom
from SPARQLWrapper import JSON
from oaklib.datamodels import obograph
from oaklib.dat... |
0b2b0dd262cef9d8c691e8cc58e9e4fc93949f97fa45fe1495ba61f43fe349e5 | Python | 24,059 | 587 | from typing import List, Optional, Union
import warnings
import torch
from torch import nn
import torch.nn.functional as F
from .channel_mlp import ChannelMLP
from .fno_block import SubModule
from .differential_conv import FiniteDifferenceConvolution
from .discrete_continuous_convolution import EquidistantDiscreteCon... |
eda93885b4aae54e1f98f6480c35c8a87b1b1509a0e5a03f601d9d86e6b3a41e | Python | 24,074 | 701 | # Instantiate pyrosetta
from pyrosetta import *
init(extra_options = "-constant_seed -mute all")
# Import necessary libraries
import numpy as np
import math
import scipy
import scipy.spatial
import time
from .pyprotein import *
from .dataProcessingUtils import *
# In: pose, Out: backbone-to-backbone hydrogen bonds
de... |
a7131cd5e0dc2453d55d74da06032de969b18c4911d10984012d3935bc3d63fd | Python | 24,078 | 580 | import os
import sys
import numpy as np
import pyqtgraph as pg
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from pyqtgraph.Qt import QtGui, QtCore
from qtrangeslider import QRangeSlider
import scipy.interpolate
# from scipy.interpolate import interp1d
import cv2
from .image_stac... |
03363d2810528d7de7ff8716929fc25dbcd9c2d5bcd720d573b43ed58ba95f3e | Python | 24,130 | 613 | from functools import partial
from typing import List, Union
import torch
from torch import nn
import torch.nn.functional as F
from .channel_mlp import ChannelMLP
from .complex import CGELU, ctanh, ComplexValued
from .normalization_layers import AdaIN, InstanceNorm, BatchNorm
from .skip_connections import skip_connec... |
5d747b2a2675afdb91f1eab7672eef606408a39372dd411c1710f2e0d40fb77c | Python | 24,143 | 534 | __author__ = 'tsungyi'
import numpy as np
import datetime
import time
from collections import defaultdict
from . import mask as maskUtils
import copy
class COCOeval:
# Interface for evaluating detection on the Microsoft COCO dataset.
#
# The usage for CocoEval is as follows:
# cocoGt=..., cocoDt=... ... |
0400d2e33397e07d96d09366a46d526be01087d08255e7a62619b9a55befa2b8 | Python | 24,145 | 652 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 7 18:47:46 2021
@author: Fuyuki Asano
"""
import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import sys
import os
from scipy import signal
import csv
import math
import statistics
import scipy
#mac
#pa... |
d10f0a587d2345b541ddf2d8821917ac6d969e819dacc443cf05d212cc0b3879 | Python | 24,172 | 650 | ####################################################################################################
# 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 ... |
037a26bd06fe02e3e253bf879fcd933b11a81d52cbbf5d650a06f2ca5e0ef30e | Python | 24,195 | 617 | """
# Adapted from: https://github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail
ENV=BipedalWalker-v3
NUMPROC=4 # 1800 FPS for 12, 3000 FPS for 24
python main.py --env-name $ENV --algo ppo --use-gae --log-interval 1 --num-steps 2048 --num-processes $NUMPROC --lr 3e-4 --entropy-coef 0 --value-loss-coef 0.5 --ppo-epoch 10 -... |
e3beca980c9b51a5a057b581cfee69a8e21cb668b0c91bf87283d6ad213a7ae9 | Python | 24,210 | 685 | import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import (build_conv_layer, build_norm_layer, build_plugin_layer,
constant_init, kaiming_init)
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from mmdet.utils import get_root_logger
fr... |
47568538e0ed5bd3fc6d1cd7d1eb37ea29df5451cf9d7eab034027ead4910b28 | Python | 24,212 | 662 | ####################################################################################################
# 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 library is free ... |
0d225b716bac3dfac3b8307391b7a974199128b74f8e4d1095dbfba23c2b80be | Python | 24,216 | 433 | # 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... |
30c5ab3fac2cec0a28b211f2987379402a18658c434db3e7a1063cd535de8f60 | Python | 24,220 | 638 | # Copyright 2019 The TensorFlow Authors, Pavel Yakubovskiy, Björn Barz. 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... |
f7c243ec73b23b6cd96b6e84d8825ddaf547908736f2ad2a332b532a0ee1c25c | Python | 24,234 | 576 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Functions to generate the synthetic dataset for the training.
/!\ There are a lot of hard coded numbers. These were empirically tuned so that
the synthetic data looks like real data.
Created on Thu Nov 22 10:01:56 2018
@author: nicolas
"""
import os, pickle
import ... |
667ef346c81853cca307c2bc0fb1883562d4921649d732e56eb19eddc0cef4ba | Python | 24,250 | 473 | # 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... |
fb000f1d043536bce69c7635be527564c28681486d44771948450b539936f77d | Python | 24,250 | 660 | # Auto generated from cross_ontology_diff.yaml by pythongen.py version: 0.9.0
# Generation date: 2023-02-27T09:56:36
# Schema: cross-ontology-diff
#
# id: https://w3id.org/oak/cross-ontology-diff
# description: A datamodel for representing the results of relational diffs across a pair of ontologies connected
# ... |
68e7f1c311dbb0bcfc72b9687a6a23591f34db74554b4b8fc01afd777844dfdf | Python | 24,262 | 709 | # 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... |
f28647c74a63ae5da6f5da988065f980e55e14a7f66093d6408c42ee6207ffe5 | Python | 24,263 | 601 | # 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... |
efebab727de1a890282b4811c872466093f283f78480efb2339f0cc2cbea972c | Python | 24,324 | 493 | # functions compatible with tensorflow.contrib
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
import tensorflow as tf
from tensorflow.contrib import slim
from tensorflow.contrib.framework.python.ops import add_arg_scope
from tensorflow.contri... |
e1fe503e2d9fb59f387d62dbd65ee5ca9a5979d7051b24512c66c78421e9c799 | Python | 24,328 | 451 | # Auto generated from mapping_rules_datamodel.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-03-31T13:26:26
# Schema: mapping-rules
#
# id: https://w3id.org/linkml/mapping_rules_datamodel
# description: A datamodel for specifying lexical mapping rules. NOTE -- this may move to another package
# license: ht... |
51204163ee117f2afbdda58382ca49f0fc83e90a7c1e2bb50724f8c875a2101c | Python | 24,347 | 532 | from typing import Tuple, List, Union, Literal
Number = Union[float, int]
import torch
import torch.nn as nn
import torch.nn.functional as F
# Set warning filter to show each warning only once
import warnings
warnings.filterwarnings("once", category=UserWarning)
from ..layers.rno_block import RNOBlock
from ..layer... |
5609cc3f57e9a71acf325b7d0e55be149e7e72cf1e2a4b462783f5b36ca9efe2 | Python | 24,349 | 784 | import math
import torch
from torch import nn
import torch.nn.functional as F
from .op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
class PixelNorm(nn.Module):
"""Pixel normalization layer.
Normalizes feature maps along the pixel dimension. Used to prevent explosion of pixel magnitude.
"""
d... |
ba18949c9e5e3a3fccc8941f557d5b91a3ee3fcd617f957ee792e0c832e7ca28 | Python | 24,391 | 445 | # Auto generated from search_datamodel.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-05-07T21:49:17
# Schema: search-datamodel
#
# id: https://w3id.org/linkml/search_datamodel
# description: A datamodel for representing a search configuration and results. This is intended to provide a
# unifi... |
8185826a499eaca62d4bbae9c091e25f86b24f0cc409f9a4f10888d3b63b1f00 | Python | 24,446 | 634 | #!/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>.
"""Import Assets to Carla"""
from __future__ import print_function
import e... |
14863624fc85e48160cd010cc51b7b5bf6ff7ff20d1d1a95be25b7a91832308f | Python | 24,452 | 561 | from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import pyqtgraph as pg
import numpy as np
from pyqtgraph.Qt import QtGui, QtCore
class ToolBox(QObject):
def __init__(self):
QObject.__init__(self)
self.pencil_mask = np.ones((3, 3), 'uint8')
self.is_clos... |
bd8723696393aaa40c464655125b29c5ee08e62160d20db37a5599083627f8fb | Python | 24,455 | 641 | # -*- coding: utf-8 -*-
import os, random, subprocess, sys, time
from sys import exit as _exit
from sys import platform as _platform
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from . import _logging as logging
from . import iterate
__all__ = [
'fit',
'test',
'predict',
'evaluat... |
a41b0b476b4afc17d223ab27f05fb25f966edbc1627b8593aa074f85994d0355 | Python | 24,458 | 617 | from networkx.classes import graph
import torch
import torch_geometric
import networkx as nx
import matplotlib
import matplotlib.pyplot as plt
from torch_geometric.utils import from_networkx, k_hop_subgraph, subgraph
from torch_geometric.data import Data
import graphxai.utils as gxai_utils
from graphxai.utils.nx_conv... |
811a9c6533234f99a97b519cdd082f3fb12f8850e90e8bb2b6ad06ec68cd1881 | Python | 24,477 | 525 | """Runtime profiles: which workers to start, on which GPUs, in which venv.
``COSMOS_PROFILE=auto`` (the default) **plans** a layout from the detected GPUs
(count and memory of each, ``nvidia-smi``), the weights baked into the image
(``nano`` / ``full`` / ``none``) and the server **mode** (see :func:`plan_layout`):
* ... |
9f782515c2cad6ea273c7fa9fe525d44c5a9bd0e879a8b63877f4391d5f6aac5 | Python | 24,500 | 623 | import os
import pickle
import numpy as np
import simtk.openmm as openmm
import simtk.unit as units
import simtk.unit.nanometer as nm
"""
This is a collection of old forces that are likely no longer used
These were a part of openmmlib before April 2019, but were removed during spring cleaning.
They should be importa... |
3abff2cca8b46302cb4984546be999b52d7ad9316277a8dda151e6530123c973 | Python | 24,511 | 728 | """
This module provides the `Genome` class. This class wraps the indexed
FASTA file for an organism's genomic sequence. It supports retrieving
parts of the sequence and converting these parts into their one-hot
encodings.
"""
import numpy as np
import pkg_resources
import pyfaidx
import tabix
from .sequence import S... |
0531b5d94953f9218d53073e6cd44ffa012ed1d110dc8b9d334f7acdd3f13854 | Python | 24,522 | 556 | #!/usr/bin/env python3
"""
File: afr_replication.py
Created: 2021/06/24
Last Changed: 2021/09/02
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 Soft... |
311ddf1afc6e007cdf8773e7037340de96c2a1269a4f311a4d14f1cca76efefd | Python | 24,539 | 432 | import roboscientist.solver.solver_base as rs_solver_base
import roboscientist.solver.vae_solver_lib.optimize_constants as rs_optimize_constants
import roboscientist.solver.vae_solver_lib.config as rs_config
import roboscientist.solver.vae_solver_lib.model as rs_model
import roboscientist.solver.vae_solver_lib.train as... |
85c6facfdbdf28ba6b24304dc762370e997e0a2b5317e8842eac7fe41e3bce0a | Python | 24,548 | 713 | # 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 th... |
65fbd87dea8b5c13d2dca748a6c09ae387e582980c1e4f0eb14233e54ed91181 | Python | 24,558 | 611 | import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from algorithms import *
from sklearn.manifold import LocallyLinearEmbedding , TSNE , Isomap
import seaborn as sns
from sklearn.metrics.pairwise import euclidean_distances
import scanpy as sc
def plot_diag(D):
T = D.diagonal()
... |
7d10a80bbe2ed73ea29287ba08c5b19f2d293b66b8256e9aa8c4cca896d55289 | Python | 24,563 | 735 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 10:01:31 2021
@author: th
"""
import numpy as np
import neo
import quantities as pq
import elephant
from itertools import combinations
from elephant.statistics import time_histogram
from elephant.conversion import BinnedSpikeTrain
from vizipha... |
76bb672b894fe2a256309a61e754bd1195b7ee7e5863566bd1a75268c4320dd8 | Python | 24,584 | 753 | # This script is part of navis (http://www.github.com/navis-org/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
a8fc42073cec98b28a6c9d42aeb91d514568e88b70f6404d4ce027cc5255e9a4 | Python | 24,596 | 718 | # 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 th... |
549300874ab092a1d90ade96ababd4e8cd830df8fa2deec432978618f9597786 | Python | 24,636 | 627 | import matplotlib.pyplot as plt
import numpy as np
import pathlib
import json
import seaborn as sns
from datetime import datetime
from helper.misc import infer_and_accuracy, clear_print, inference
from helper.data import load_data, get_architecture
from helper.fairness import equalized_odds, demographic_parity
from mip... |
51b509f642c03b1398446318c553df6aa14f05ec5dbb2dcc627cdf27174939f4 | Python | 24,652 | 413 | #%%
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... |
872bec38b18b2e3642e88677c52492a7b19edebd3af1dfcc2a2cfc3a0e4b8b16 | Python | 24,658 | 634 | import pydicom
import os.path
import numpy as np
from PIL import Image
import cv2
import torch
import torch.nn as nn
from torch.utils import data
from .augmentations import Compose, RandomRotate, PaddingCenterCrop
import random
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import ga... |
51416e083fdb8faa9b0d6276a6c3aa56d7f989fec13685e77c46b44e97a91d91 | Python | 24,700 | 547 | # This file is part of me-features-to-mol-ID-mapping.
#
#
# Copyright © 2021-2022 Blue Brain Project/EPFL
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the APACHE-2 License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... |
ff8d9b59d4a462990a0905436fe0537278421423f9543623e8ccd5fcb0ab7b7c | Python | 24,794 | 735 | """
Unit testing forward-mode automatic differentiation.
"""
from __future__ import (division, print_function, unicode_literals)
import numpy as np
import tensorflow as tf
from tensorflow_forward_ad import logger
from tensorflow_forward_ad.fwgrad import forward_gradients
log = logger.get()
tf.logging.set_verbosity(... |
3d89f21c4bd78afbf51c8869b3011f3ecca9ebf5ea9774b2101060a708b505c1 | Python | 24,795 | 789 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
wave_classification.py
----------------------
Script to classify 'surrogate-LFP' data of
simulated network activity of
2D rate model of motor cortex, see paper
Kang, Ranft & Hakim. eLife (2023).
To analyse specific simulation output,
change parameters/data filenam... |
1e4ae50f53363103b1479c0d3b2076c5b43808b1bfbe04b19a19fa0f3d17e755 | Python | 24,890 | 650 | ## 2018/12/02
# Gene Regulatory Network Simulation Using Simple Multivariate Gaussian
# Take input through argparse
## Plots
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib import offsetbox
from matplotlib import cm
import seabor... |
c72e0a7d380bda9110f3ed545b14ab8635357b0924599814dfe2ba497a1a306c | Python | 24,891 | 704 | """Dynamic Network States (DyNeStE).
See the :doc:`model description </models/dyneste>` for more details.
"""
import logging
from contextlib import contextmanager
from dataclasses import dataclass
from typing import List, Literal, Optional, Tuple
import numpy as np
import tensorflow as tf
import tensorflow_probabili... |
3c7b1b6f2688b3ab0293ccdf86ac00aa77eb04c47e37beb8b5d5a273d45e20ac | Python | 24,953 | 711 | import os
import sys
import time
import datetime
from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QDesktopWidget, QLabel, QLineEdit, QGridLayout, QCheckBox, QButtonGroup, QLCDNumber, QFileDialog, QRadioButton)
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import QTimer
from PyQt5 import QtNetwork
impo... |
a960af5ce674de5fc097878fcf1d40cf693b3679f4276435188ab143f8df3778 | Python | 24,964 | 829 | """
FBNet model builder
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import logging
import math
from collections import OrderedDict
import torch
import torch.nn as nn
from maskrcnn_benchmark.layers import (
BatchNorm2d,
Conv2d,
FrozenBatchNorm2d,
... |
f2f4c30833502654c0f69ecdcfceaca5f180effe44a7da247bdcd64275231519 | Python | 24,978 | 458 | 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... |
ef1f72ecef6c26dc2ccc59abe9a4bc2c0112e0c74b7b71dc93200ae36fd4dff4 | Python | 24,990 | 559 | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import Scale, normal_init
from mmdet.core import distance2bbox, force_fp32, multi_apply, multiclass_nms
from ..builder import HEADS, build_loss
from .anchor_free_head import AnchorFreeHead
INF = 1e8
@HEADS.register_module()
class FCOSH... |
94f8fbfe3f324d4b6bf5c8e1400714c947327599bf106b79481896e337649a68 | Python | 24,997 | 623 | # 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... |
c0b611b1de931b92c7cb2d82b1f9e6ee683e6f399e4ec399ed59f524bcd56a12 | Python | 25,020 | 696 | """
StyleMapGAN
Copyright (c) 2021-present NAVER Corp.
This work is licensed under the Creative Commons Attribution-NonCommercial
4.0 International License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
Creative Commons, PO Box 1866, Mountain View, CA 94042, U... |
92f45588d6a0b7be5c8b21503ceea9c904e2fb579991ff6bef3e1fdf4c39278f | Python | 25,077 | 841 | #%% [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... |
68677d9a5bcbe99515ca4310a08e8d9c79a240673e2475bdb0bb9a794a7c2a97 | Python | 25,133 | 604 | # YOLOv5 general utils
import glob
import logging
import math
import os
import platform
import random
import re
import subprocess
import time
from pathlib import Path
import cv2
import numpy as np
import pandas as pd
import torch
import torchvision
import yaml
from utils.google_utils import gsutil_getsize
from utils... |
06bd2a9afe3ad6f15f2ad49a19524859dc7274ac8946159735babe8679970417 | Python | 25,140 | 766 | import csv
import typing
from thefuzz import process as fw_process, fuzz
import json
from abc import ABC, abstractmethod
import inspect
_MAPPINGS = set()
class Dropper:
def __init__(self):
with open("data/deleted.txt", "r") as fin:
self.deleted_documents = [int(d.strip()) for d in fin]
... |
ff099d8de5534ea211b6d49e2c6d5955b9881380937d37ef39f56b91734aea3e | Python | 25,146 | 562 | from functools import partial
import torch
import torch.nn.functional as F
import time
# Set warning filter to show each warning only once
import warnings
warnings.filterwarnings("once", category=UserWarning)
from .base_model import BaseModel
from ..layers.channel_mlp import ChannelMLP
from ..layers.embeddings imp... |
0a2c04c019a54b9f6c405dc2dc8559925fc76eaa9e850726d8cd7545e4e73cf0 | Python | 25,157 | 715 | # Auto generated from search_datamodel.yaml by pythongen.py version: 0.9.0
# Generation date: 2023-02-27T09:56:32
# Schema: search-datamodel
#
# id: https://w3id.org/oak/search-datamodel
# description: A datamodel for representing a search configuration and results. This is intended to provide a
# unified ... |
e35e5c1ff441620287d98bb7947a6fb82ad5416b71a63b3633ed6e177d0f8a56 | Python | 25,172 | 705 | """Functions to calculate and save network power maps."""
import os
import logging
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
import nibabel as nib
import matplotlib.pyplot as plt
from osl_dynamics import files
from osl_dynamics.analysis.spectral import get_freq... |
995b31e61f6fc2ecaabaefe2c85f78e59421925d143002147e0228dde9a9133f | Python | 25,190 | 690 | import mmcv
import torch
from mmdet.core import bbox2roi, build_assigner, build_sampler
from mmdet.models.dense_heads import (AnchorHead, CornerHead, FCOSHead,
FSAFHead, GuidedAnchorHead)
from mmdet.models.roi_heads.bbox_heads import BBoxHead
from mmdet.models.roi_heads.mask_heads... |
d94d06ac772f1e270290b91eeb0bed2f0dfb694982b666c6203f6c6e9581c820 | Python | 25,195 | 607 | from collections import OrderedDict
import csv
from logging import Logger
import pickle
from random import Random
from typing import List, Optional, Set, Tuple, Union
import os
from rdkit import Chem
import numpy as np
from tqdm import tqdm
from .data import MoleculeDatapoint, MoleculeDataset
from .scaffold import lo... |
24b42178cb72c85e1f823fec9eb96e583190be029643f377381eeb1c0c34d253 | Python | 25,238 | 584 | # tn_mismatch_clustering.py
import pandas as pd
import numpy as np
import statsmodels.api as sm
from sklearn.preprocessing import StandardScaler
from scipy.cluster.hierarchy import linkage, dendrogram, fcluster
from scipy.stats import pearsonr
from scipy.spatial.distance import pdist
import matplotlib.pyplot as plt
im... |
38fbcbdff92bd2cfb9e64a37584d03f0714f4e63f52237f96ea255cb8ae9b774 | Python | 25,259 | 611 | from argparse import Namespace
import csv
from datetime import timedelta
from functools import wraps
import logging
import math
import os
import pickle
import re
from time import time
from typing import Any, Callable, List, Tuple, Union
from sklearn.metrics import auc, mean_absolute_error, mean_squared_error, precisio... |
30f5c3c05e1a1732499f2b5ac7daa3683e5f1b5edd58dfdb058d908ee5400e17 | Python | 25,279 | 529 | import imghdr
import os
import shutil
import logging
import slideflow as sf
import numpy as np
from tqdm import tqdm
from os import listdir
from os.path import isfile, isdir, join, exists
from random import shuffle, randint
from slideflow.util import log
from glob import glob
logging.getLogger("tensorflow").setLevel(... |
c2537ea83b23bec12883560978e8d2bc5475e37498d484d80a6d6955def0c58d | Python | 25,295 | 634 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.