sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d1dc96a0c417760cb3902d8e79aa2641e93751f0a1337bbc855a3997c8c6c4c1
Python
22,059
566
'''' Main function for traininng DAG-GNN ''' from __future__ import division from __future__ import print_function import time import argparse import pickle import os import datetime # import torch import torch.optim as optim from torch.optim import lr_scheduler import math # import numpy as np from utils import...
7f0fc2e557ac61a95ce48caff078c2c5b8c61327d58971a39c733282dd968e32
Python
22,075
576
""" GTN Search Library - Interface to the GTN SQLite database. Provides search over Galaxy Training Network tutorials and FAQs using SQLite FTS5 full-text search with BM25 ranking. """ import http.client import logging import os import re import shutil import sqlite3 import urllib.request from dataclasses import data...
287b970c2e597557f64d60816e0bc8e94ee4f22197e142b80f080d500b8806db
Python
22,090
520
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # ...
c844f086f79504853b8ba44e993a8a00432a335695622a7de20ef9d39b4e7c54
Python
22,092
579
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict """Support functions for tests""" import contextlib import cProfile import io import linecache import...
9e98f8affcf44271d9ed411fa7e605bc12da16f6c93f8ef5504223a1cce70849
Python
22,103
504
import pandas as pd import os def get_cluster_results(savepath_all_users_results_full): path_to_users_groups = "../postprocess_all_products/" path_to_results_all_users = savepath_all_users_results_full dict_cluster_metrics = {'cluster': [], 'RF_F1_mean': [], ...
45f730e2ff9432c8450396928da563a6af239fbe1982c4c81de99ac4413fa205
Python
22,106
655
from abc import ABC, abstractmethod from sklearn.base import BaseEstimator, RegressorMixin, MultiOutputMixin from sklearn.utils.validation import check_is_fitted from ._solvers import RIDGE_SOLVERS from ._random_search import GROUP_RIDGE_SOLVERS from ._random_search import solve_ridge_cv_svd from ..validation import...
a12637951ec41fa7c5eb9061cfd9bb8b44c614826971c7a1b1797ccc9dafb328
Python
22,124
489
""" Job control via the DRMAA API. """ import json import logging import os import shlex import string import time from typing import ( TYPE_CHECKING, TypeAlias, Union, ) from galaxy import model from galaxy.jobs.handler import DEFAULT_JOB_RUNNER_FAILURE_MESSAGE from galaxy.jobs.job_destination import Job...
fc2548cf7793e31b391d714508d1a58fa250bf6d60b3899352e699657bb0821b
Python
22,160
569
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from __future__ import annotations import dataclasses from unittest.mock import patch import torch f...
c4575e63fe3e6e35c8e078fb18e6a736e5a41f3fd38eade4469015144f78d994
Python
22,168
620
""" Unit tests for overall cell density computation """ import warnings from pathlib import Path import numpy as np import pandas as pd import pandas.testing as pdt import pytest from voxcell import RegionMap import atlas_densities.densities.fitting as tested from atlas_densities.densities import utils from atlas_den...
b074fe417624d7652253e7e65a4253d7ebc71b164aea893e556764f58c0bb5f2
Python
22,174
530
# Copyright (c) MONAI Consortium # 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 in writing, so...
ce9047ceca6d48a7de688714473b663dab949526d7cf9f0bcff3db763446318f
Python
22,186
581
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
ceea9feae04bf70264ad0901f01429ab7a9ae92d1712f9a114a7e4f0a86dbf3b
Python
22,208
666
from pathlib import Path from nilearn import datasets import numpy as np import pytest from numpy import random import nibabel as nib from ..aabb_tree import AABB from ..CD_relations import (cardinal_relation, cardinal_relation_prepare_regions, direction_matrix,...
209c7e6cce964daf97e260ace825063930edf9992a51d04f030d44a16c1c1cb2
Python
22,216
572
from collections.abc import Sequence import sys if sys.version_info >= (3, 12): from typing import override else: from typing_extensions import override import numpy as np import tensorflow as tf from hidten.hmm import HMMConfig as HidtenHMMConfig from hidten.prior import Prior from hidten.tf.transitioner impo...
5b5a360774a20ba10dc0e4753e7e650f06bc2384ce541f97f7fff5f8cf998c7a
Python
22,217
429
import torch from torch.nn import functional as F from models.fc.layers import fc_layer from models.fc.nets import MLP from models.conv.nets import ConvLayers from models.cl.memory_buffer import MemoryBuffer from models.cl.continual_learner import ContinualLearner from models.utils import loss_functions as lf, modules ...
518a3f2c982855770cd622cc5ecc0cda0e23bd4266bf1967ddee5b55f5f1435d
Python
22,253
687
""" Link prediction algorithms. """ from math import log import networkx as nx from networkx.utils import not_implemented_for __all__ = [ "resource_allocation_index", "jaccard_coefficient", "adamic_adar_index", "preferential_attachment", "cn_soundarajan_hopcroft", "ra_index_soundarajan_hopcro...
c3d8c9baf46f489a97370cd84c0138e20c2bc82d8d9a20c81df57c4b8153c864
Python
22,261
517
""" Copyright (c) 2019 10x Genomics, Inc. All rights reserved. Consume multiple fastq files and spit out a pooled fastq file with targeted adapters removed from the ends of the reads. """ from __future__ import division import itertools import json import random from subprocess import PIPE from barcodes import load_...
441cb79e0eb27de80564c854b897162bfc1d531f3c4ae34995110451b67d44b5
Python
22,265
725
import itertools import math import operator import re import warnings import numpy import pytest from nl_core.datalog.basic_representation import DatalogProgram from nl_expr.exceptions import UnsupportedProgramError from nl_expr.expressions import Constant, Symbol from nl_expr.logic import Conjunction, Implication f...
a5959d1703c3c3aac63bbd0d7573d017c00498c22a1352f5fb19c7e94cf2b77c
Python
22,284
562
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from datetime import datetime from unittest.mock import patch import pandas as pd from ax.adapter.base import Adapter from ...
0616f8e0c5bba5ac02310828d69e9163966925c699ca6b185cc39350e6874141
Python
22,289
598
# -*- coding:utf-8 -*- import collections import copy import hashlib import time from functools import partial import numpy as np import pandas as pd from sklearn.compose import ColumnTransformer from sklearn.pipeline import make_pipeline from hypernets.tabular import sklearn_ex as skex, get_tool_box, is_dask_instal...
e07a5b8633384b54233f01e6771fede9c28dbf6782ebfe98c1ca3d9f6b1cf751
Python
22,295
564
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import logging import unittest from copy import deepcopy from unittest import mock import numpy as np import numpy.typing a...
5e3a3fe8a8e24d58fb23607e03496766caf7645910279f0566a11cc555ad2234
Python
22,298
550
import logging import re from typing import ( Optional, TYPE_CHECKING, Union, ) from sqlalchemy.dialects.postgresql import insert as postgresql_insert from sqlalchemy.dialects.sqlite import insert as sqlite_insert from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import ( scoped_session, ...
4e22428ba1ed6f29cf7ea48d8781ca63d6d3fba6b45863f1b6833a993bc6f163
Python
22,303
657
from __future__ import annotations import warnings import weakref from collections import defaultdict from typing import Any, Callable import torch import torch.nn as nn from torch.overrides import resolve_name from ..neuron.base_node import BaseNode from ._sparse_memory import active_element_count, dense_bytes, is_...
9222f4492cac648549b647405cf0b2a544e24dd1d01ebde735311eefd70a580f
Python
22,311
567
import warnings import ipywidgets as widgets import matplotlib.patheffects as path_effects import matplotlib.pyplot as plt import numpy as np import seaborn as sns from IPython.display import display from scipy.cluster.hierarchy import dendrogram from scipy.stats import zscore from .colormap_helper import distinct_cm...
138d9e5338fd6962a112d36c1a724a5febf9a3a52a046b9bdad7cc5d59f84499
Python
22,315
586
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from __future__ import annotations from collections import OrderedDict from unittest import TestCase from unittest.mock impo...
91c995d4db0fc54b440a4f1e7f5f51794534339340c5c19a3e44015a96e77a47
Python
22,330
379
# -*- coding: utf-8 -*- """ Created on Fri Jul 5 10:13:28 2019 @author: schelskim """ import os import numpy as np import pandas as pd from skimage import io import copy import math from skimage.draw import line_aa import re class Analyzers(): @staticmethod def analyzeIntensities(dat...
314dcc4b1286fb72c62fec84250e3eafe4bfeb55cde8df553990c7ad0f2f2951
Python
22,335
431
import torch from torch.nn import functional as F from models.fc.layers import fc_layer from models.fc.nets import MLP from models.conv.nets import ConvLayers from models.cl.memory_buffer import MemoryBuffer from models.cl.continual_learner import ContinualLearner from models.utils import loss_functions as lf, modules ...
e9474e2277297006c43acd7d5889d59a3b52bd29df2c1ad95fd21ca91fc43235
Python
22,337
707
"""Optimisers rewriting and pushing selections.""" import operator from nl_expr import expression_walker as ew from nl_expr.expressions import Constant, FunctionApplication from ..relational_algebra import ( Column, ColumnInt, ColumnStr, EquiJoin, ExtendedProjection, FullOuterNaturalJoin, ...
b2c6d5fba48c3f04c7d1bc1532124ae12dcec8ca4f801b58bc4e35ef794df198
Python
22,374
517
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
d20af360a3ad68c37735c1bac1f919d654ac244725fd696ef98773c123e03a17
Python
22,397
574
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
eaac472d67081c01e4b69e2729a169eb23948fb258b2e283d3b4569f86b6a2ea
Python
22,411
617
# -*- coding: utf-8 -*- """ Created on Mon Dec 2 14:28:44 2019 @author: aaussel """ #import matplotlib #matplotlib.use('Agg') from brian2 import * start_scope() from scipy import signal from cells.RS_LIP_alte import * from cells.FS_LIP_alte import * from cells.SI_LIP import * from cells.IB_soma_LIP import * from c...
9d55016ed4de2d21ec82d4ac16604d0bfae9fcd13e97d626496ddd43b0e82c6e
Python
22,418
534
# Copyright (c) MONAI Consortium # 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 in writing, so...
86dd63c4adb8a5b4e285ae6bd0ee1762cf25b4a7773819861aed0ada90e9cdf9
Python
22,432
525
import warnings import numbers import numpy as np from ..backend import get_backend from ..backend._utils import _dtype_to_str from ..progress_bar import bar from ..scoring import l2_neg_loss from ..validation import check_random_state from ..validation import check_cv from ..kernel_ridge import generate_dirichlet_sa...
53db8d22c7c0e416c7ef9cb370e648b19235c7fc5c349a2e1ba49640293c4a93
Python
22,437
533
import hashlib import json import logging import pathlib import shutil from datetime import datetime from functools import reduce from core.redis import redis_connected, start_job_async_or_sync from core.utils.common import batch from core.utils.io import ( get_all_dirs_from_dir, get_all_files_from_dir, ge...
dd81db2e3ea23c5c9b7df12d8b6f313f64542dccb8860d972ecc1edc52df76b0
Python
22,440
554
import os import tempfile from copy import deepcopy import feather import numpy as np import pandas as pd import pytest import ark.phenotyping.cell_cluster_utils as cell_cluster_utils import ark.phenotyping.cluster_helpers as cluster_helpers import ark.phenotyping.weighted_channel_comp as weighted_channel_comp def ...
a9a2098158f6dbc46e6f17e421b3646f0c8e10d546385eab92422de93b944684
Python
22,446
638
import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D import os import glob from scipy.stats import zscore import importlib import zipfile import math import utils import scipy as sp from scipy import io import scipy.signal from scipy.sparse.linalg import eigsh import csv impor...
e38ebd963743cf94a03d204ebe90acb75cdc8fccd4c05668616f09098e728827
Python
22,465
579
# Copyright (c) MONAI Consortium # 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 in writing, so...
c68e01ef750f09b3302f0eff2f2974c0d091e2a5dba0da5b9dc0f23b69f454cb
Python
22,470
618
"""Optimisers flattening, simplifying and reordering joins and products.""" from functools import reduce from itertools import combinations from nl_expr import expression_walker as ew from nl_expr.expressions import Constant from ..relational_algebra import ( NameColumns, NaturalJoin, NaryNaturalJoin, ...
19727414589d7e6d0edbb2462a5946be5d129b57acfae48d1d592fd026be5c1d
Python
22,479
488
# This file is now part of the Galaxy Project, but due to historical reasons # reflecting time developed outside of the Galaxy Project, this file is under # the MIT license. # # The MIT License (MIT) # Copyright (c) 2012,2013,2014,2015,2016 Peter Cock # Copyright (c) 2012 Edward Kirton # Copyright (c) 2013 Nicola Soran...
4a0d57ee275d3967d841688d75abf677fceaf7341c6bec63478822a532e8a2b7
Python
22,483
589
import numpy as np class PHMMTransitionIndexSet: """ Indices for accessing groups of values in a PHMM transition matrix. Uses the state order\\ M1 ... ML I1 ... IL-1 D1 ... DL LF B E C RF T\\ if not folded, and otherwise\\ M1 ... ML I1 ... IL-1 LF C RF T. Attributes: L: Number of matc...
77fb17852b8dc66d0f6511d771032b53902be718c009333e82eb2a08c8f64dc1
Python
22,520
507
import numpy as np from astropy.convolution import Gaussian2DKernel,AiryDisk2DKernel import cv2 import scipy import copy from collections import namedtuple import tensorflow as tf import tensorflow_addons as tfa class Kernel(): def __init__(self): self.px_size = 100 seed = 42 # switch seed ...
76106ff0e467048ad2697130c036fe59cfb85bd53752251707c971064449318f
Python
22,530
557
# MIT License # # Copyright (c) 2019-2024 The PyQMC Developers # # 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, m...
6c8be69c528fc69f3a831dc4b4f3448e9b7b9d533567d9975b738295d2ccadb4
Python
22,541
585
"""Galaxy job runners to use Amazon AWS native compute resources, such as AWS Batch.""" import bisect import hashlib import json import logging import os import re from typing import ( Any, TYPE_CHECKING, Union, ) from galaxy import model from galaxy.job_execution.output_collect import default_exit_code_f...
ee10327fa691b3ac9438eccb4b5751b4ece016d42eccb1678ef0e138bc81e5d8
Python
22,547
647
from __future__ import annotations from collections.abc import Iterable, Sequence from enum import Enum from functools import singledispatch, wraps from itertools import repeat from types import EllipsisType from typing import TYPE_CHECKING, Literal, NamedTuple, cast, overload import h5py import numpy as np import pa...
6475cfdb945d75b1e82adbcca17b98b6ff84f0d0a1c40531b7f302954941f0de
Python
22,576
521
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
3aa2f26c1c13855d0846ad31c2796c10d58107dfa1c3c0dcbf9a543e0e50b4ac
Python
22,580
566
from __future__ import absolute_import import errno import logging import operator import os import shutil from optparse import SUPPRESS_HELP from pip._vendor import pkg_resources from pip._internal.cache import WheelCache from pip._internal.cli import cmdoptions from pip._internal.cli.base_command import Requiremen...
f9a864cba22bcdc82cea3f33f0f5b41e3a236269ba2cc7d58446353537d066b4
Python
22,588
704
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations from collections.abc import Sequence from dataclasses import dataclass from enum import Enum from functools import cached_property from typing import TYPE_CHECKING, Any from django.conf import settings from django...
61887934e566dba4f0da598b5378e85898b8c83b8f36638b741d7178dc78aa17
Python
22,592
668
from __future__ import annotations from abc import ABC, abstractmethod from collections.abc import MutableMapping from copy import copy from dataclasses import dataclass, field from itertools import chain from typing import TYPE_CHECKING, cast, overload import h5py import numpy as np import pandas as pd import zarr f...
9f6753f9901e6a193df67f1c2188821d4fe90f2327ce4947260b81c2b9909db6
Python
22,593
581
""" Tests for Group Centrality Measures """ import itertools from functools import partial import pytest import networkx as nx class TestGroupBetweennessCentrality: def test_group_betweenness_single_node(self): """ Group betweenness centrality for single node group """ G = nx.pa...
698be01c72d1aa9cbd48f13e1fd980287b2a2c13a266284ed5e3b3386737ea17
Python
22,617
701
#!/usr/bin/env python # # Copyright (c) 2016 10X Genomics, Inc. All rights reserved. # # # Determine the locations of the cell barcode, cDNA sequence, UMI, sample index. # from collections import OrderedDict import copy import tenkit.constants as tk_constants import tenkit.fasta as tk_fasta import tenkit.stats as tk_st...
e9cd92f1134bb42c5a5f19840a9333aab45b74b05e4ec7bfd3acf0f38981b071
Python
22,644
539
from brian2 import Synapses, ms import re import numpy as np from .parameter_checks import * from .constants import synapse_sign_mode class LoihiSynapses(Synapses): """ The LoihiSynapses extends the Synapses class from Brian2. This class provides Loihi parameters for delay and pre- and post-synaptic t...
4fc9f557fc7e3f963beb8fac19d00b81fe2d3ea2d0c1d8c3bf8b825631e75a47
Python
22,656
486
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See the COPYING file distributed along with the smile package for the # copyright and license terms. # # ## ### ### ### ### ### ...
7bf1612e4956a420cff2e4c9d6ea23ca31833f368428fc84714bb1cea27a72c8
Python
22,673
619
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache Licen...
a7f8ea7df262bfdca1eccf4ef75aff797a692ac9e91c04a788d582e6e89f8259
Python
22,680
583
# coding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"...
53a120aa7805b85d321ad6fb4b677b12b4265fea7ae7e87d962d08e693cc78a4
Python
22,699
683
""" This module contains all classes and functions required to run the scaffold from the command line. """ import sys, os import configparser import builtins import argparse import traceback from types import ModuleType ## ## This is the package entry point API and REPL. ## def scaffold_cli(): """ c...
9c55505ffd0c6b15193bf1b50b42b126d6dfe66331d8e148c86c1f198773aa6d
Python
22,719
656
# Copyright 2020 DeepMind Technologies Limited. # # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
f240f28e7c0897f12d1cad6f9c88353af590645465156c8bf9533652780ea6c2
Python
22,748
568
"""Test the find_noisy_channels module.""" # Authors: The PyPREP developers # SPDX-License-Identifier: MIT import logging import numpy as np import pytest from pyprep.find_noisy_channels import NoisyChannels from pyprep.ransac import find_bad_by_ransac from pyprep.removeTrend import removeTrend # Set a fixed rando...
de8be2d291f4312114ed8e75fd33a650cf53cc5da1e07de417ff9b72e0cbf93e
Python
22,763
570
# Copyright 2010-2015 by Haibao Tang. All rights reserved. # # This code is part of the goatools distribution and goverend by its # license. Please see the LICENSE file included with goatools. """Read and store Gene Ontology's obo file.""" # -*- coding: UTF-8 -*- from __future__ import print_function import sys impor...
c987662e4d4370fbaeca2245154663833a1b841ac42235dd68ff9b4fab696e69
Python
22,784
476
""" Created on Feb 22, 2024. @author: voodoocode """ import os import shutil import mne import numpy as np import nibabel.freesurfer import warnings import matplotlib.pyplot as plt import finnpy.misc.external_calls as ex_c # @UnresolvedImport def init_paths(freesurfer_path, anatomy_path, fastsurfer_...
4f84b686d4a625c632a04771e923571c6c05d95e1cdf8a764fe7272770fb5469
Python
22,787
576
""" Module Docstring """ # Standard Imports from time import time # Third Party Imports import torch import numpy as np from scipy import spatial from sklearn.utils.extmath import randomized_svd # Custom Module Imports from .video import RegionMetadata from .video import LowRankVideo from .demix import HalsNMF from ....
6e59c5be022e8198a3c4f01391f023f7781f0db2efce0a03ba54aa56cff464b1
Python
22,817
625
""" Copyright © 2025 Howard Hughes Medical Institute, Authored by Carsen Stringer , Michael Rariden and Marius Pachitariu. """ import os, gc import numpy as np import cv2 import fastremap from ..io import imread, imread_2D, imread_3D, imsave, outlines_to_text, add_model, remove_model, save_rois from ..models import no...
1eda473544e9a022f44c94c9339817f8210a06dcf502e5e4db52539d632e6353
Python
22,837
610
import hashlib import logging import os import shutil from typing import Optional try: import rucio.common from rucio.client import Client from rucio.client.downloadclient import DownloadClient from rucio.client.uploadclient import UploadClient from .rucio_extra_clients import ( DeleteClie...
26680a14fff063bdfa8e234b234a3cc117ea7f9bf563101e7d6d64d94a3083ea
Python
22,841
560
# -*- coding: utf-8 -*- """ Created on 2020.05.19 @author: Jiahua Rao, Weiming Li, Hui Yang, Jiancong Xie Code based on: Yang et al "Analyzing Learned Molecular Representations for Property Prediction" & "A Deep Learning Approach to Antibiotic Discovery" -> https://github.com/chemprop/chemprop Song et al "Communicati...
1555dcce30dd68a62163d71ab4c50c06004b66cfcca64794ba7da7dd491367a0
Python
22,898
682
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
46b5f6efe93c7dd1bccd60574415aa4f6a69dc00095ac50985a26e060ed0b762
Python
22,902
563
#!/usr/bin/env python # # Copyright (c) 2015 10X Genomics, Inc. All rights reserved. # import collections import itertools import json import numpy as np import os import re import sys import tenkit.constants as tk_constants import tenkit.fasta as tk_fasta import tenkit.safe_json as tk_safe_json import tenkit.seq as tk...
ab2f0d7779389a99b71b8bfa25bec657dc12c101a24243dce50be94d09c0708e
Python
22,910
699
from typing import ( Annotated, Any, Literal, Optional, Union, ) from pydantic import ( Field, model_validator, RootModel, ) from galaxy.util.config_templates import ( ConfiguredOAuth2Sources, EnvironmentDict, expand_raw_config, get_oauth2_config_from, ImplicitConfi...
a86fc39216512e193b1e5df80f402c01ec14fa77c876ade5dc000ec8d90c5bc8
Python
22,925
726
import operator from typing import AbstractSet import numpy as np import pytest from nl_expr.expressions import Constant, Symbol from nl_expr.exceptions import RelationalAlgebraError from ..probabilistic.cplogic import testing from ..relational_algebra import ( ColumnInt, ColumnStr, NaturalJoin, Produ...
13ca4802cc31c077e81b9b813a1193b0234c0a2a4d6946de375c326d7fb185eb
Python
22,932
659
import numpy as np import pytest import tensorflow as tf from pathlib import Path import learnMSA.model.training_util as training_util import tests.hmm.ref as ref from learnMSA.config import Configuration, TrainingConfig, TreeConfig from learnMSA.config.hmm import PHMMPriorConfig from learnMSA.model.tf.model import Le...
ab47eb051e2cc0fb2f888ac286d1ac9d888462467a0c610a9242122f4548f602
Python
22,943
589
import os.path as op import pickle import sys from pathlib import Path # Need this to make sure that ants.registration is available for mocking in tests import ants.registration # ruff: ignore[F401] import mne import nibabel as nib import numpy as np import pytest from mne.datasets import sample from nibabel import N...
6c39de2541991c43479ebea3686e8f3c43d92b567b2230cfa4d5cf81e1be998c
Python
22,950
582
""" A server collecting the answers of the query assistant and their ratings. The assistants that share their answers (``feedback`` in the LLM configuration, see :mod:`.feedback`) post them here; people rate them correct, incorrect or unsure and correct their query, from the REPL (``.rate``, ``.refine``) or the review...
47c874884190b5c2316dd3535d221ee30b01b034d36c6556225a8109809291e9
Python
22,953
555
import os import os.path import resource import shutil import subprocess import sys import pysam import pandas as pd import numpy as np import tenkit.log_subprocess as tk_subproc import tools.regions as regtools from collections import namedtuple, Counter from cellranger.h5_constants import GZIP_SUFFIX, LZ4_SUFFIX fro...
ded3380337a837515245a66fa9101e047f6473076c340b10d733c88a88c8498b
Python
22,980
655
r""" .. codeauthor:: Yanqi Chen <chyq@pku.edu.cn>, Ismail Khalfaoui Hassani <ismail.khalfaoui-hassani@univ-tlse3.fr> A reproduction of the paper `Technical report: supervised training of convolutional spiking neural networks with PyTorch <https://arxiv.org/pdf/1911.10124.pdf>`_\ . This code reproduces an audio recogn...
4bbe5878f74c4e52aff7900946ec506f82997d1fc2c7fd87dade469001717582
Python
22,999
562
from __future__ import division import math import random as rd import networkx as nx import numpy as np # from pysbm import sbm from MolRep.Interactions.link_models.CFLP.pysbm import sbm class NetworkSuppplier(object): """ Create different types of graphs""" STANDARD_SEED = 42 def __init__(self): ...
3f9be04df034be98bce3e0975411e9bfd3b8d32424a7d6b41bd86e7b55eb87c7
Python
23,008
582
import numpy as np import warnings import math from tqdm import tqdm from skimage.measure import regionprops from skimage.draw import polygon from csbdeep.utils import _raise, axes_check_and_normalize, axes_dict from itertools import product from .geometry import polygons_to_label OBJECT_KEYS = set(('prob', 'points...
7d9fb26bb33419b03dcb8fa52eb3a8e24783503091002a1983945bded52434e1
Python
23,020
582
import numpy as np import warnings import math from tqdm import tqdm from skimage.measure import regionprops from skimage.draw import polygon from csbdeep.utils import _raise, axes_check_and_normalize, axes_dict from itertools import product from .geometry import polygons_to_label OBJECT_KEYS = set(('prob', 'points...
8c5be97d7ad3021088d0e5ec7da27ecf1e2bb918a08d834a201febe4d345552e
Python
23,074
593
import imageio import numpy as np from hidten.visualize import Figure, SubFigure, plot_emissions, plot_transition_graph from matplotlib import pyplot as plt from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec from learnMSA.util import SequenceDataset from learnMSA.hmm.tf.layer import PHMMLayer def phmm...
e84cca6c33df12d7235c5a9386f738d8819361460e5cd94048e6919afade86e2
Python
23,085
561
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from contextlib import ExitStack from copy import deepcopy from unittest import mock from unittest.moc...
5d9bf2cbf42a05c1404cc72f121ea94ff466a2075f112c7144457b5248a14f8d
Python
23,103
613
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from collections.abc import Mapping, Sequence from logging import Logger from typing import Any, final import numpy as np im...
7af55a106332545a68eb2b4452cdb94a9a4688d8c16e8b86e9b5b936e795b7ee
Python
23,110
584
#!/usr/bin/python3 """ Implementation of the grammatical evolution Author: Leonardo Lucio Custode Creation Date: 04-04-2020 Last modified: mer 6 mag 2020, 16:30:41 """ import re import os import sys import deap import random from deap.algorithms import varAnd os.environ['OPENBLAS_NUM_THREADS'] = '1' import numpy as np...
6efea2f136a2d55b93466949a47f8a914a666b5ffd26846420bc79f5d20b821f
Python
23,122
559
import json import errr import numpy as np from bsb import CellType, Chunk, DatasetNotFoundError, chunklist from bsb import ConnectivitySet as IConnectivitySet from .resource import ( HANDLED, Resource, handles_class_handles, handles_handles, handles_static_handles, ) _root = "/connectivity/" c...
3aebde829bf38b9cce7f63cd5246eef2bc48bc762877316c713b819ac8f17e3b
Python
23,136
677
import numpy as np import warnings import numbers import scipy import matplotlib.pyplot as plt from abc import ABC, abstractmethod from sklearn.neighbors import NearestNeighbors class YourCustomKNN(ABC): """ Template class helper for custom knn """ def __init__(self, your_custom_param): self.your_cus...
2c1b9b98c69805829e342962ff6fe05ea9dddcf14974d5441db1acdc27443e20
Python
23,141
548
"""GTN Training Agent - searches Galaxy Training Network tutorials and FAQs.""" import json import logging import re from pathlib import Path from typing import ( Any, Optional, ) from pydantic import ( BaseModel, Field, ) from pydantic_ai import ( Agent, RunContext, ) from galaxy.schema.agen...
d53d72598f0ca269b634cbbcac13c7f199c09663d6ab5707a64119be1e96923c
Python
23,141
554
from typing import ( Any, cast, Dict, List, Optional, TYPE_CHECKING, Union, ) from typing_extensions import TypedDict from galaxy.tool_util.parser.interface import ( InputSource, PageSource, PagesSource, ToolSource, ) from galaxy.tool_util.parser.parameter_validators import...
f60f0a1146b3eb66b87d1801f90070b19a616257835d0539519a46203ac205b6
Python
23,141
561
""" Graph summarization finds smaller representations of graphs resulting in faster runtime of algorithms, reduced storage needs, and noise reduction. Summarization has applications in areas such as visualization, pattern mining, clustering and community detection, and more. Core graph summarization techniques are gro...
1eaefd97f713d04190cfbc0de615e74a5855acc9f991fa4ea970af3a21f0f167
Python
23,142
735
import pytest from seqeval.scheme import (BILOU, IOB1, IOB2, IOBES, IOE1, IOE2, Entities, Entity, Prefix, Token, Tokens, auto_detect) def test_entity_repr(): data = (0, 0, 0, 0) entity = Entity(*data) assert str(data) == str(entity) @pytest.mark.parametrize( 'data1, data...
0c893ff417b71f4f559b31e60b6c1ceb56beb89e6bc0b71952749c4a421ce938
Python
23,147
448
import function as func import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as mtick import seaborn as sns import pdb import os import re import math import vcf import pysam import sys import lockfile import datetime from time import sleep from os.path import exists ## Varia...
dd32dd1ec8fdd1e75197386ea42ab691daea7ddcfcc01bc888a539bbe3474fef
Python
23,147
503
# real non truncating division (same behaviour as in python 3) from __future__ import division import math from .peixotos_hierarchical_sbm_tools import log_binom # from pysbm import sbm from MolRep.Interactions.link_models.CFLP.pysbm import sbm import networkx as nx def minimum_description_length_peixoto_first(par...
eebe58dc0fadacb86658bed8c471c922a64bcaecedcb39482f7bbd7a35fed238
Python
23,173
564
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
88ab0fff79946f298ea58b464b7cce3f4528bd6f367eb0f24f5ee0d813a31ee7
Python
23,180
546
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import pandas as pd import random import pickle import math from Model.DRPreter import DRPreter from torch.utils.data import Dataset, DataLoader from torch_geometric.data import Batch from sklearn.model_selection import tra...
389b66f2e5110fbbac1274b91c28506e23a4502aa775fc0233194e743074b08b
Python
23,189
645
from collections import namedtuple from itertools import chain, tee import logging from nl_expr.logic import Union from operator import contains, eq from typing import Iterable, List, Tuple, Type from nl_expr.exceptions import ( NeuroLangException, NoValidChaseClassForStratumException, ) from nl_expr.expressio...
2429d10fe3422d7d3645468d01727fc79a615621143da942fd42f35b3851c002
Python
23,200
635
"""Tests of the LLM query assistant in the REPL: ``.ask`` and ``.llm``.""" import io import json import pytest pytest.importorskip("prompt_toolkit") pytest.importorskip("rich") pytest.importorskip("httpx") from rich.console import Console # noqa: E402 from neurolang_apps.utils.llm.config import parse_config # no...
472bbbb4b4ce0520fa2678b69c0ad43a99d60dc2a70f0d35ca0fc1e33427cdfc
Python
23,214
565
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from collections.abc import Mapping, Sequence from functools import partial from typing import final import pandas as pd fr...
f986494b6453ae10ee61566c0323f15d23f7c2c2e2f3264a7a12359598a5a3d5
Python
23,226
597
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import inspect from collections import Counter from datetime import datetime from typing import Any, get_type_hints from ax....
579d4b0c48f6e2cb99b49fef1f051c719867276e295a6959757f983608f07cd3
Python
23,249
596
"""Betweenness centrality measures.""" import math from collections import deque from heapq import heappop, heappush from itertools import count import networkx as nx from networkx.algorithms.shortest_paths.weighted import _weight_function from networkx.utils import py_random_state from networkx.utils.decorators impo...
1d6005b6df3e6cb0ce2b486c5efcaa1bb31b7174dddb27614c601c2fa8471068
Python
23,262
658
from warnings import warn import numpy as np from numcodecs.registry import codec_registry from zarr._storage.store import DEFAULT_ZARR_VERSION from zarr.core import Array from zarr.errors import ( ArrayNotFoundError, ContainsArrayError, ContainsGroupError, ) from zarr.storage import (contains_array, cont...
32d57bfd38d6a5bda92efbb47b808db0a8fbdc1d334d83dd20ae69aa88a1d194
Python
23,268
614
"""Tests for lazy loading annotations feature (FIT-720). This module tests the AnnotationStubSerializer and the annotations_stub query parameter for the TaskAPI endpoint. """ from organizations.tests.factories import OrganizationFactory from projects.tests.factories import ProjectFactory from rest_framework.test impo...
966e4dc47c7c6970873d9a022069b09b58b11ab1d5fcefd2cb6e171225e60aac
Python
23,292
573
import itertools import os import pathlib from typing import Dict, Optional, Union import matplotlib.pyplot as plt from matplotlib import colormaps import natsort as ns import numpy as np import pandas as pd import scipy.ndimage as ndi import skimage.io as io from alpineer import image_utils, io_utils, load_utils, mis...
2a3aecad9bf1388863b28ad6d836434957686ba4c6aa118f238fc1949bc7d5e9
Python
23,301
623
# -*- coding: utf-8 -*- """ Created on Mon Dec 2 14:28:44 2019 @author: aaussel """ #import matplotlib #matplotlib.use('Agg') from brian2 import * start_scope() from scipy import signal from cells.RS_LIP import * from cells.FS_LIP import * from cells.SI_LIP import * from cells.IB_soma_LIP import * from cells.IB_ax...
167e19f16c7b213f6ad6b5777fc8240cda971d61aac820d1f6849aeed879022d
Python
23,307
660
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.module import Module from torch.nn.parameter import Parameter from .. import BaseModel from cogdl.utils import spmm class GraphConvolutionBS(Module): """ GCN Layer with BN, Self-loop and Res connection. ...
fc512ec0a5fa2657b1957738d2c0f049df3c5f510c97cf6e0581f5654e1c8de8
Python
23,307
459
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
d5d3b2efecb2e839cb6e1deae3d724a4b89e871f97ca566385e952f7c507b726
Python
23,316
624
# -*- coding: utf-8 -*- """ Created on Mon Dec 2 14:28:44 2019 @author: aaussel """ #import matplotlib #matplotlib.use('Agg') from brian2 import * start_scope() from scipy import signal from cells.RS_LIP import * from cells.FS_LIP import * #from cells.SI_LIP import * from cells.SI_LIP_alt import * from cells.IB_so...