sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
966eeb3258184bf9fee9dca657bc07ef09b95cde5b644961e246ad1ceb137a76
Python
58,007
1,219
# Flat versions of objective functions described in Tiago P. Peixoto # Nonparametric Bayesian inference of the microcanonical stochastic block model # for more see in peixotos_hierarchical_sbm.py # @formatter:off import math from .objective_functions import ObjectiveFunction from .peixotos_hierarchical_sbm_tools imp...
c41cb5ba09a12365fe11328f9fe6de795bc43d3d55d86b2aa148faa886be8316
Python
58,104
1,370
# 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 json from collections.abc import Iterable, Sequence from logging import Logger from typing import Any, cast, Literal, ...
d9c15d1a05103407cbe157861c98b1cc6945cae2eb76fc9b3c90dd9512a28774
Python
58,333
1,511
#!/usr/bin/env python import matplotlib.pyplot as plt from matplotlib.lines import Line2D import numpy as np import imageio import sys import os from matplotlib.widgets import Slider, Button, RadioButtons, TextBox from matplotlib.backend_bases import MouseButton import time import argparse from gc_segment.utils import...
98e61ea5fc62938a3864729ae5be20296da831c6fa32cdb42a94986949c58933
Python
58,432
1,388
#!/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 math import warnings from collections.abc import Mapping, S...
a6f7b4659e9b51748fa7db94b21348bc947562550d88c7f6766e86257df415ee
Python
58,841
1,167
""" Offload jobs to a Kubernetes cluster. """ import json # for debugging of API objects import logging import math import os import re from dataclasses import dataclass from datetime import datetime from typing import ( Any, TYPE_CHECKING, TypedDict, Union, ) import yaml from galaxy import model fr...
824e2afc1d2e1d9673502caee4c0bb163101bd982440793450b81d978e497e0a
Python
58,933
1,635
# Copyright (C) 2022 Intel Corporation # Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations from collections.abc import Sequence from enum import StrEnum from typing import TYPE_CHECKING, Any, cast from django.conf import settings from django.shortcuts import get_ob...
689b301c8deffe529e78537b80e19aef588a34fe5404ecf9e3367ad2d59233d1
Python
58,939
1,505
"""This module contains a linting functions for tool inputs.""" import ast import re import warnings from copy import deepcopy from typing import ( Iterator, Optional, Tuple, TYPE_CHECKING, ) from packaging.version import Version from galaxy.tool_util.lint import Linter from galaxy.tool_util_models.p...
c68a20df9fa1f56e59cabebcee07f1fb8a1876b7b8b082972d66a35722726234
Python
59,142
1,527
#!/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 warnings from collections.abc import Iterable, Mapping, Mut...
65139e1ec54123720eb80858a9732e3053eaa95a55e5d7ce5644df9aed0c49c3
Python
59,396
1,313
import argparse import random import os from os import getcwd from yaml import dump from maxatac.utilities.system_tools import (get_version, get_absolute_path, get_cpu_count, Mute, ...
c74743dbde16ae6437d56b5d5378212931beb5935ab9d9322f16d6231b5218c8
Python
59,438
1,350
#!/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 import time from collections import OrderedDict from collections.abc import Mapping, MutableMapping, S...
f377610abeff1d322bebabf5818c908f0941b1cf9028f12e749f52989de2afbc
Python
59,440
1,591
#!/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 math from abc import ABCMeta, abstractmethod from copy impo...
578fdc463849ced88c4669b414d54387a9f77e3a5bc2f298bee963103687f8d8
Python
59,466
1,712
import copy import math import pytest import torch from spikingjelly.activation_based import functional, lava_exchange, neuron, surrogate def _surrogate(): return surrogate.Sigmoid(alpha=4.0) def _assert_close(actual, expected): assert torch.allclose(actual, expected, atol=1e-6, rtol=1e-6) @pytest.mark....
83028be607892a6b51e06788527a0c0168ec3cf1b7b553ff985c70fd2c7e8ac7
Python
59,681
1,756
# # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import socket try: import ssl ...
3bd37cd4afdf21c553f70a3d1026555c6888227bdbfb86c4086641360d84748f
Python
59,849
1,461
from __future__ import annotations import warnings from collections.abc import Callable, Iterable, Mapping, Sequence from functools import partial from numbers import Real from typing import Any, Literal import numpy as np import pandas as pd import scanpy as sc from anndata import AnnData from fast_array_utils.conv ...
546157e458989116e04aaef611c7d4365b054059fa817df4268f44823e55bc2a
Python
60,005
1,394
#!/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 import warnings from collections.abc import Iterable from functools import partial from itertools impo...
2d63ceacdc581a43306cb812529ad0aa1a841c736cc6c65eb7141b6ba1d9f5bf
Python
60,026
1,460
# 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...
4f12761521a23352e7eb4735af5899b2ed6af1d43a40906c5c2389d3a711d4a5
Python
60,050
1,483
import math from pathlib import Path import time import sys from typing import Any, Literal, Sequence, overload 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 learnMSA.hmm.tf.layer import PHMMLayer from l...
832290f25fc71e0eb906f00f22e737a8d5f4669513cd176f7be63f879f88eb96
Python
60,071
1,350
#!/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 from collections.abc import Callable, Mapping, Sequence from copy ...
1326a8bbb77a0111237e49e725ae81ee3a64222750647a6558b6af3924bf4ab2
Python
60,075
1,517
#!/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 itertools import logging from collections.abc import Callab...
88313a8ace0c9c8d31731e74fb2774144f05d3754ee68aed7c65e4501353fcee
Python
60,623
1,906
import operator from typing import AbstractSet import numpy as np import pytest from ...datalog import Fact from nl_expr.exceptions import NonLiftableException, UnsupportedSolverError from nl_expr.expressions import Constant, Symbol from nl_expr.logic import Conjunction, Implication, Negation, Union from ...relationa...
1a2c9b9e41517145cbb847f42e4f6102f514cac12e27276229bafc6de4e40bf6
Python
60,777
1,924
from __future__ import annotations import warnings from collections.abc import Hashable from contextlib import nullcontext from copy import deepcopy from functools import partial, singledispatch from importlib.metadata import version from importlib.util import find_spec from itertools import chain, permutations, produ...
3b0f7d38b8376fdcdc702818789d5e21af2eef16adb348c43b78ac277e22d325
Python
60,859
1,707
#!/home/arnab/atomate/pyenv395/bin/python from pymatgen.io.vasp.sets import MPRelaxSet, MPStaticSet, MPSOCSet from pymatgen.core import Structure from pymatgen.core.periodic_table import Element from pymatgen.analysis.magnetism.analyzer import MagneticStructureEnumerator, CollinearMagneticStructureAnalyzer from pymatg...
48b31c149af911f229954abc6da9e3527e7e04032ad40172ad34e021bb80bf54
Python
60,943
1,452
from __future__ import division import os from fanc.config import config from abc import abstractmethod, ABCMeta import numpy as np from scipy.stats import poisson from collections import defaultdict, OrderedDict import tables as t from fanc.legacy.data.genomic import AccessOptimisedRegionMatrixTable, Edge, LazyEdge fr...
85f072af3af759d8552f1fd495ed5d41a6a386c5dd664fb798fd8a322e62b885
Python
61,170
1,448
"""Utilities defining "Galaxy Flavored Markdown". This is an extension of markdown designed to allow rendering Galaxy object references. The core "Galaxy Flavored Markdown" format should just reference objects by encoded IDs - but preprocessing should allow for instance workflow objects to be referenced relative to t...
49e20a8123800be2c74681177de3f4e864bd12e83005f21429c4d95c6ccc2175
Python
61,226
1,505
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.""" import logging from core.mixins import GetParentObjectMixin from core.permissions import ViewClassPermission, all_permissions from core.utils.comm...
6de7352cd603eced4f23569753bad9321b466a0e8227281b64d06aaa50d404a3
Python
61,318
1,113
import pandas as pd import numpy as np import h5py import pathlib from sklearn.model_selection import train_test_split from sklearn.model_selection import StratifiedKFold from pandas_plink import read_plink1_bin from ..utils import helper_functions from . import encoding_functions as enc def prepare_data_files(data_...
7337e52b09df7caa1d4a3def0990f279164311cbde61d87899391669f043a0fc
Python
61,349
1,728
"""Clearing house for generic text datatypes that are not XML or tabular.""" import gzip import json import logging import os import re import shlex import subprocess import tempfile from html.parser import HTMLParser from typing import ( IO, Optional, ) import ijson import yaml from galaxy.datatypes.data im...
0f09803f91761e057f8dcb9ad2258af7378f329bd3499a54285df3ded6621cb1
Python
61,360
1,325
""" Galaxy job handler, prepares, runs, tracks, and finishes Galaxy jobs """ import abc import datetime import os from collections import defaultdict from queue import ( Empty, Queue, ) from typing import ( Any, Optional, TYPE_CHECKING, Union, ) from sqlalchemy.exc import OperationalError from...
28a8859110b6de669c6cbf98f954940c939675519f566510b6533bcc87128c7e
Python
61,562
1,298
# 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...
f6fa2721bdebe7f9adc363ce18ad2bdd052c57db7db8a2f7e525e29a824db08d
Python
61,578
1,771
""" Morphology module. """ # This is a note to myself, should expand into docs: # # It goes ``morphology-on-file`` into ``repository`` that the ``storage`` needs to provide # support for. Then after a placement job has placed cells for a chunk, the positions are # sent to a ``distributor`` that is supposed to use the ...
45265db4b1dc52d6cad96f203c7fd420d98dec3a0903b870ba164b200913e628
Python
61,613
1,502
""" Sequence classes """ import json import logging import math import os import re import string import subprocess from collections.abc import ( Callable, Iterable, ) from itertools import islice from typing import ( Any, Optional, ) import bx.align.maf from markupsafe import escape from galaxy impo...
11e6afa64a234d242daf567ffb74b010472945d78795bbf5f7f690b14911619b
Python
61,912
1,378
"""Job runner used to execute Galaxy jobs through Pulsar. More information on Pulsar can be found at https://pulsar.readthedocs.io/ . """ import copy import errno import logging import os import re import subprocess from time import sleep from typing import ( Any, Optional, TYPE_CHECKING, Union, ) im...
c034c906d8cd79d20d707c2432a1982a7d486f5776de6f2a822adccd6eac80fa
Python
61,951
1,493
# 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...
4b6e0c9febab4ee68a868723174e107280b74abb43390d186de65298ec0e9637
Python
62,109
1,879
import atexit import os import sys import pickle import shutil import tempfile import textwrap import unittest import numpy as np import pytest try: import ipytree except ImportError: # pragma: no cover ipytree = None from numcodecs import Zlib from numpy.testing import assert_array_equal from zarr._storag...
4529a6724938ba124abae0fca948815f647bdf1694f6795d8513f583622b766e
Python
62,111
1,822
""" Declarative engine registry for the neurolang-query CLI. Engines are declared in :file:`engines/engines.yaml`, into whose entries the files :file:`engines/<engine>/*.yaml` (their example queries and the query assistant's guidance) are merged with OmegaConf. Each engine may define: * a **Python initialisation scr...
20b666186157526d75ed8e5969e0ec8017e42a8e8f084ec31c9ef3eb4d8b5a81
Python
62,840
1,485
import json import logging import mimetypes import os import shutil import string import tempfile from collections.abc import ( Callable, Generator, Iterable, ) from inspect import isclass from typing import ( Any, IO, Literal, Optional, TYPE_CHECKING, Union, ) from markupsafe impor...
8315e0894362be5d1d9e2cc5d96ed706c3bccf013818118e1ae4115a154bf60e
Python
62,965
1,584
#!/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 collections import OrderedDict from collections.abc import Iterable, Mapping from copy import dee...
7689933866a9e8d0e0df179ac51c858e6bc68d0e5ba999b6e8c3a8e909221cdc
Python
63,027
1,795
import pytest import os from maxatac.utilities.system_tools import get_files from maxatac.utilities.parser import ( get_synced_chroms, parse_arguments ) DATA_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), "temp")) @pytest.mark.parametrize( "chroms, filenames, ignore_regions, control_s...
dc78ef162e4095a55392ef7342eb951ad3cd9e2997d9fbe4d26c095cb47f2dce
Python
63,058
1,502
import matplotlib import matplotlib.pyplot as plt import numpy as np import pickle as pk import glob import sys sys.path.append("/home/cat/code/widefield/") # Adds higher directory to python modules path. import string, re from scipy.signal import butter, filtfilt, cheby1 from sklearn.decomposition import PCA impor...
820d3a9601774db04573eba8518830e0cacf95fa86289afae74656be47071736
Python
63,196
1,653
# 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...
8f37cc8289f57c4e7246f7af39dda59ed54f3e98328c18c817a4894454ab9933
Python
63,281
1,511
#!/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 import dataclasses import warnings from collections import OrderedDict from typing import Any from uni...
9849acecbdc533bcb57c6ce08416b031698a2cd7a38829cd353026c8f16081b4
Python
63,824
1,667
# -*- coding: utf-8 -*- """ HDBSCAN: Hierarchical Density-Based Spatial Clustering of Applications with Noise """ import numpy as np from sklearn.base import BaseEstimator, ClusterMixin from sklearn.metrics import pairwise_distances from scipy.sparse import issparse from sklearn.neighbors import KDTree, Ball...
cb30af8fb124ce374f2c93b203b2d79cd15fe2f24ed4656798627513abce4472
Python
64,411
1,173
import os, sys, fnmatch, struct, cdflib, configparser, logging import xml.etree.ElementTree as ET from .metadata import Metadata from .fringe import Fringe from ..utils import * cp, np, convolve, gpuAvailable, freeMemory, e = checkForCupy() def dataFormat(directory: str) -> str: """ Check the format of the data w...
9a46f97f75e30c5c235c0228c1da6abeb93513d0ddcb025321e1fc29d4ed9ac2
Python
64,424
1,615
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.""" import base64 import datetime import logging import numbers import os import random import traceback import uuid from typing import Any, Mapping, O...
2df86ad19ed00bd6542c7b1d783b165442394a1d099ed7be30b47bedcd434991
Python
64,521
1,563
#!/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 import copy import datetime import json import re import warnings from collections import OrderedDict ...
82a7fb77c87d9326af51f80cd9a9f3ae4bfde2999d48ae6ef7bcc901c00bcebc
Python
64,521
1,867
# 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...
4d353366b075fc07b360c3ff9fee092c82ecb2c4aea9de34b6c8bda365cc8d91
Python
64,733
1,556
from __future__ import division import os from .config import config from abc import abstractmethod, ABCMeta import numpy as np from scipy.stats import poisson from collections import defaultdict, OrderedDict import tables as t from .matrix import RegionMatrixTable, Edge, LazyEdge from .general import MaskFilter import...
fec5b74b50dbaac3a3f4f12947b9dfcbf64292f7c8df434be5d8148a404bd2d1
Python
65,029
1,131
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @title: Chemical classes @description: classes for chemical objects, calculations, and simulations @author: chrisarcadia @created: 2018/06/03 """ # units # monoisotopic mass : Dalton [Da] # concentration : moles per liter [mol/L] = [M] # volume : liters [L] # ...
01ff2d5363ecbdaf7d7021e25ce006567db2afa884054eac55a9eef0a815f4fc
Python
65,153
1,534
# 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...
5395a0744ea31a37cd8699a7b90595b0325375c99ba4b25a599f5b4739e09643
Python
65,548
1,895
""" Code for merging/ concatenating AnnData objects. """ from __future__ import annotations import uuid import warnings from collections import OrderedDict from collections.abc import Mapping, MutableSet from functools import partial, reduce, singledispatch from itertools import repeat from operator import and_, or_,...
ef957867f82e70e27e2e90a18981e5fe61e58091d6b8c326ee87dd17d2a75854
Python
65,760
1,576
# 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...
09f3e1750bb0947df0cb550d2092d1169ab24b840d9d24239dff996610937b1e
Python
65,773
1,220
# -*- coding: utf-8 -*- """ Created on Sun Aug 18 16:52:50 2019 @author: schelskim """ # -*- coding: utf-8 -*- """ Created on Fri Jul 5 13:12:33 2019 @author: schelskim """ from .generaltools import generalTools import numpy as np from matplotlib import pyplot as plt from skimage import morphology as morph from sk...
a905e16ef398d56f7e74143eaa96d8640dd04fbe2aafc95fe736fca37cf8f7ab
Python
65,971
1,693
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import math import textwrap from collections.abc import Iterable, Iterator, Mapping from enum import Enum from typing import Any from django.conf import settings as django_settings from django.db import models as django_models from django.db import ...
27ed49e6038e400e26b9702bf758a03696b96392ec02e30439f562352876ee5b
Python
66,314
1,416
#!/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 """ References .. [Daulton2026bonsai] S. Daulton, D. Eriksson, M. Balandat, and E. Bakshy. BONSAI...
2efdcb139406a0e0a17e233aaca99338407266f04cf379eda5203f1f08d07f84
Python
66,349
1,783
""" Saving and viewing of query results in the interactive REPL. ``.save PATH`` writes the last result as a table, or as a NIfTI image when PATH ends with ``.nii`` or ``.nii.gz``; ``.view PATH`` shows a NIfTI image, or the last result, in a browser: an HTML page of :mod:`~neurolang_apps.utils.tui.brain_viewer`, whose ...
d5ec59fdc93dde08b1cea6e4b35771ebfcd27e86f1469df38fe1da6abd94d6d5
Python
66,477
2,041
""" ****** Layout ****** Node positioning algorithms for graph drawing. For `random_layout()` the possible resulting shape is a square of side [0, scale] (default: [0, 1]) Changing `center` shifts the layout by that amount. For the other layout routines, the extent is [center - scale, center + scale] (default: [-1, ...
a4ba525d997168cbc2f2f8349e2e1f0c9bb157ed40850313091556a8001c3ae6
Python
66,507
1,608
"""Experimental settings Functions --------- get_settings(experiment_name) """ __author__ = "Elizabeth A. Barnes and Noah Diffenbaugh" __date__ = "25 March 2022" def get_settings(experiment_name): experiments = { # ---------------------- MAIN SIMULATIONS --------------------------- "exp15C_245":...
c0be63c56e7e89a09c1d62c5e200452c9339215057671951d539842afc2dd594
Python
66,609
1,207
# -*- coding: utf-8 -*- """ Created on Sun Aug 18 16:52:50 2019 @author: schelskim """ # -*- coding: utf-8 -*- """ Created on Fri Jul 5 13:12:33 2019 @author: schelskim """ from .generaltools import generalTools import numpy as np from matplotlib import pyplot as plt from skimage import morphology...
e21e7285f8c47cdf8b60f4bfa117bbe933b4a3806ce912e0c513e889b2d8c658
Python
66,629
1,731
# Copyright (C) 2022 Intel Corporation # Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import io import itertools import json import operator import xml.etree.ElementTree as ET import zipfile from copy import deepcopy from datetime import datetime from http import HTTPStatus from io import BytesIO...
69614bd1cea8c0678c7defa115956d363a4b379bb207d1443e7d1949c314112e
Python
67,528
1,594
#!/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 import re import warnings from collections import defaultdict from collections.abc import Callable fro...
c2ccbb4cf9a0ff7dd4b237b166c896d6ba6eeca233efd38818852136d1007efa
Python
67,650
1,755
# 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...
7cdca3a40ea981a459b1ee0cd8745e53292ab8c46b426178a94aa204e4be17c6
Python
67,742
1,904
"""Tests for the neurolang-query CLI module.""" import json import pytest from nl_expr.exceptions import NeuroLangException, SymbolNotFoundError from nl_expr.expressions import Constant, Symbol from nl_core.datalog.pretty_printer import DatalogPrettyPrinter from neurolang.frontend.datalog.squall_syntax_lark import p...
52bb017d0012f9d202a1a3176265aca8615ad327d9d042a9ebee6f2c6656fce8
Python
67,780
1,688
#!/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 import dataclasses import warnings import pandas as pd from ax.core.arm import Arm from ax.core.obser...
9d43b132652dfd3bf02090b810c21df27e57e60e5686f1869c65cc1cf5f3b2de
Python
67,824
1,723
#!/usr/bin/env python # -*- coding: utf-8 -*- """A graph generator based on the PC algorithm [Kalisch2007]. [Kalisch2007] Markus Kalisch and Peter Bhlmann. Estimating high-dimensional directed acyclic graphs with the pc-algorithm. In The Journal of Machine Learning Research, Vol. 8, pp. 613-636, 2007. License: BSD ""...
e7080668a93074d6c2ae5cff40bed0711aec0b487078a56d8f08ffcfee36782d
Python
68,256
1,546
import io import pytest import networkx as nx from networkx.readwrite.graphml import GraphMLWriter from networkx.utils import edges_equal, nodes_equal class BaseGraphML: @classmethod def setup_class(cls): cls.simple_directed_data = """<?xml version="1.0" encoding="UTF-8"?> <!-- This file was written...
640ff41e84533018e80bcff9590888767efc0d8d8bb79d78f386abbae99f6da5
Python
68,484
1,668
from collections.abc import ( Callable, Iterable, ) from dataclasses import dataclass from datetime import timedelta from pathlib import Path from types import SimpleNamespace from typing import ( cast, Optional, TYPE_CHECKING, Union, ) from uuid import UUID from sqlalchemy import ( delete,...
94db7e783dd5dd78c12bf495a78c082d026ec84fb6b8d7bfc857697e5f873086
Python
69,047
1,727
import itertools import json import logging import math import os import re import uuid from typing import ( Any, cast, Dict, Iterable, List, Optional, Sequence, Tuple, TYPE_CHECKING, ) from packaging.version import Version from pydantic import TypeAdapter from galaxy.tool_util.dep...
17ad783cbb80e376954bc5129570da7ecc03038c85f87a40f6dce39bf592fae2
Python
69,248
1,407
# 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...
3d07792aedbfb7ab0154a0d96bfa673d09bf13910ea5d757c27e06954fead75a
Python
69,328
1,473
# -*- coding: utf-8 -*- """ Created on Sun Jul 14 09:22:35 2019 @author: sche...
248b15f1f2a3f067abfb41147c27691576ce56280f83c61db48aba2c0b5780ab
Python
69,756
1,722
# Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT from __future__ import annotations import itertools import math from collections import OrderedDict from collections.abc import Callable, Hashable, Sequence from functools import partial from typing import Any, NamedTuple, TypeAlias, TypedDict, Type...
1161114b3812d1d42ed377c4a290e049d1af9eaea6e427cd6c0886a597dbbaa9
Python
69,980
1,693
#!/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 import warnings from collections.abc import Callable from copy import deepcopy from random import rand...
8d6d54f074fab33388e4a4eee60b33171bf064b747e2dab6f0c7d7a9c35bdad5
Python
70,085
2,116
# affinitymat.py # Authors: Jacob Schreiber <jmschreiber91@gmail.com> # adapted from code written by Avanti Shrikumar import math from concurrent.futures import ThreadPoolExecutor import numpy as np import scipy from scipy.sparse import coo_matrix import numba from numba import njit from numba import prange from ...
9f2a186df7c36e1e55e65c18bbc7edabbc4f035b700525ab0e14ac4107713863
Python
70,645
1,791
#!/usr/bin/env python # -*- coding: utf-8 -*- """A graph generator based on the PC algorithm [Kalisch2007]. [Kalisch2007] Markus Kalisch and Peter Bhlmann. Estimating high-dimensional directed acyclic graphs with the pc-algorithm. In The Journal of Machine Learning Research, Vol. 8, pp. 613-636, 2007. License: BSD "...
eb351c89a087b1937652376f11c0a7353942a32b61f0728158a947e3321590e7
Python
70,910
1,688
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.""" import logging import re from dataclasses import dataclass from datetime import datetime from decimal import Decimal, InvalidOperation from functoo...
055b552948710fc9648db00f9a783f2ca8a1dd61402c3eff5acda67346dd4ee1
Python
71,011
1,738
# 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 dataclasses import itertools import logging import tempfile from datetime import datetime from itertools import produc...
43ee006c083b467272f011510f71bb547ee9dd6a64ce83b3e684778d4151584b
Python
71,028
1,482
# -*- coding: utf-8 -*- """ Created on Sun Jul 14 09:22:35 2019 @author: ...
42c0197ef310881bf07b078c6031e6a6d35fd551e77c4ac43b36bcba58f51011
Python
71,044
2,052
"""Base class for undirected graphs. The Graph class allows any hashable object as a node and can associate key/value attribute pairs with each undirected edge. Self-loops are allowed but multiple edges are not (see MultiGraph). For directed graphs see DiGraph and MultiDiGraph. """ from copy import deepcopy from fu...
be0eb0d4003d46356afc5de8a7e065110e3113a9301cf4f2d3cec84c27661b2c
Python
71,337
1,554
""" ISMAGS Algorithm ================ Provides a Python implementation of the ISMAGS algorithm. [1]_ ISMAGS does a symmetry analysis to find the constraints on isomorphisms if we preclude yielding isomorphisms that differ by a symmetry of the subgraph. For example, if the subgraph contains a 4-cycle, every isomorphis...
f85079673c7fe1e97fac225a3fc1d5ef550e6d2cbe5463844c7d14240cd5a9ba
Python
71,522
1,312
#### script to make various plots for this project import os import numpy as np import pandas as pd import seaborn as sns import nibabel as nib import matplotlib.pyplot as plt ### thalpy is a lab-wide library for common funcitons we use in our lab ### see: https://github.com/HwangLabNeuroCogDynamics/thalpy from thalpy....
f4064bd075b8381dcd4e32dd06d2593d49b0caec40aa65d05c86be18ad62e5e4
Python
71,658
1,578
""" Universe configuration builder. """ # absolute_import needed for tool_shed package. import configparser import copy import json import locale import logging import logging.config import os import re import socket import string import sys import tempfile import threading from collections.abc import Callable from d...
0602041ea54731c0c50e0729bb34d3bfc70c03ef108a019c4b3bfe54ce65efc7
Python
72,683
2,107
"""Functions measuring similarity using graph edit distance. The graph edit distance is the number of edge/node changes needed to make two graphs isomorphic. The default algorithm/implementation is sub-optimal for some graphs. The problem of finding the exact Graph Edit Distance (GED) is NP-hard so it is often slow. ...
57c56ebd080d577a165e9d59a02b0bf1632a411a35ae7aaff45624577ede8b8e
Python
72,825
2,308
import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import gridspec import parmap import numpy as np import pandas as pd import os import shutil import cv2 import scipy.io as sio import scipy.signal import csv from tqdm import trange import glob, h5py fr...
e3d42b54b7d47cdc507baa64364e719d67094edae5da3523252aa6b973e75009
Python
73,202
1,797
import argparse import collections import copy import json import logging import math import os import re import sys from functools import reduce from typing import ( Optional, TYPE_CHECKING, Union, ) import numpy as np import yaml from galaxy.util import parse_xml if TYPE_CHECKING: from galaxy.model...
8a9c2cf6a55bb9c69ac51d611e04c9e079516c62f18cb823b6c2c748dd0411ce
Python
73,498
1,644
import abc import errno import logging import os import string import time from collections import namedtuple from errno import ENOENT from typing import ( Any, Dict, FrozenSet, List, Optional, Tuple, TYPE_CHECKING, Union, ) from urllib.parse import urlparse from uuid import UUID from m...
80dbaae19cc99cd9d6748adfab3a0316c2e5a5b07dd3fd09908df1a0e9beb653
Python
73,652
1,825
#!/usr/bin/env python # -*- coding: utf-8 -*- """A graph generator based on the PC algorithm [Kalisch2007]. [Kalisch2007] Markus Kalisch and Peter Bhlmann. Estimating high-dimensional directed acyclic graphs with the pc-algorithm. In The Journal of Machine Learning Research, Vol. 8, pp. 613-636, 2007. Licen...
c1680d9ea7bd89a0145d5d3248849c6aabf63a13c41e8db8a41f1260fc6db445
Python
74,147
1,983
"""Polars backend for NeuroLang's Relational Algebra Set (RAS) system. Uses pl.LazyFrame internally to defer materialization, allowing Polars' query optimizer to handle chained operations efficiently. """ import builtins from collections import OrderedDict, namedtuple from typing import ( Callable, Dict, ...
06822bdb1de4edfd13fdc2cc219a15e75b4a0183f5107a44502985b8b34c004d
Python
74,384
1,524
import time import networkx as nx import csv from MolRep.Interactions.link_models.CFLP.pysbm import sbm from MolRep.Interactions.link_models.CFLP.pysbm.parallel_execution import parallel_execution from MolRep.Interactions.link_models.CFLP.pysbm.parallel_execution import TEMP_DIRECTORY from MolRep.Interactions.link_mo...
de8505f06ee44dc292d77872c6452d9d36fa0d420bd37e7065acce2fed9ead8e
Python
74,439
1,530
import math import random as rd from unittest import TestCase import networkx as nx from pysbm import sbm from pysbm.sbm.nxpartitiongraphbased import NxPartitionGraphBased from pysbm.sbm.peixotos_flat_sbm import DeltaModelLogLikelihoodOfFlatMicrocanonicalDegreeCorrectedSbm from pysbm.sbm.peixotos_flat_sbm import LogL...
2f47c61cf341a3e48b81bf6d9924cafd0e71b7c7d07289d751cde110642019bb
Python
74,605
2,236
import copy import importlib.metadata import inspect import json import os.path import pathlib import pickle import sys import tempfile import unittest import numpy as np from bsb_test import ( RandomStorageFixture, get_data_path, get_test_config, list_test_configs, ) from bsb_test.configs import get_t...
2a57a037a7f2adacc1ffe803fe2b221bd734cea7013d78742941d9afb6865958
Python
75,215
2,397
import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import gridspec import parmap import numpy as np import pandas as pd import os import shutil import cv2 import scipy.io as sio import scipy.signal import csv from tqdm import trange import glob, h5py i...
d5eb6c07e3e709ab4f57fcd7f4d108acc65b7252314c3ec8390eab906ecc7d41
Python
75,254
2,398
import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import gridspec import parmap import numpy as np import pandas as pd import os import shutil import cv2 import scipy.io as sio import scipy.signal import csv from tqdm import trange import glob, h5py fr...
eecfc99bad95be72fe3e285129fc5485297fc9cf4620dd4bb0300c499d91c8cc
Python
75,456
1,797
""" Manage tool data tables, which store (at the application level) data that is used by tools, for example in the generation of dynamic options. Tables are loaded and stored by names which tools use to refer to them. This allows users to configure data tables for a local Galaxy instance without needing to modify the t...
8e7f0e62d0a190e210d3d2aa34cee731cd0cb8c6525f01eae49723a86b6b3d9c
Python
76,651
2,089
# Copyright (C) 2021-2022 Intel Corporation # Copyright (C) CVAT.ai Corporation # # SPDX-License-Identifier: MIT import io import json import math import operator import os import xml.etree.ElementTree as ET import zipfile from copy import deepcopy from datetime import datetime from http import HTTPStatus from io impo...
028a9894fd8ee94acca4a042ab7a0a09253ffeb10ac5e154dd9002819541e9ad
Python
77,558
1,596
# 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...
e90932686b2eecfe74ee5287aa5325fa242200ee7b9a162ca560af696763c4b3
Python
79,009
2,079
# 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 json import math import random import tempfile from collections.abc import Mapping from pathlib import Path from typin...
77080e2e5c57dd9e304ec36c36a20d10b0447017b4eedfa598ff9246a75a1a8b
Python
79,180
2,146
"""\ Main class and helper functions. """ from __future__ import annotations from collections import OrderedDict, defaultdict from collections.abc import Mapping, MutableMapping, Sequence from copy import copy, deepcopy from functools import singledispatchmethod from pathlib import Path from textwrap import dedent fr...
a567f15841e6c8d411282a474551d9c402c3cfdeb1e0242390c7f9cb6db995fd
Python
79,394
1,813
import sys from openbabel import pybel, openbabel from openbabel.openbabel import OBAtomAtomIter import scipy from collections import defaultdict import os from itertools import chain import pandas as pd import time import itertools import random import math from copy import deepcopy class OutputGrabber(object): ...
d8e81b91e003dab2e4717a9b72fa1fdc9e51ee54708cd2e80724b24e406d2a77
Python
79,852
2,419
# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """A fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. """ from __future__ import unicode_literals import itertools import struct __version...
bd50beebd2f73fec6ebbad3e5efc5428b22a8186864e260396ba5e106f88e641
Python
80,332
1,754
import math import torch from torch.autograd.function import once_differentiable from .._ops.first_spike import _cubic_value from .._ops.tempotron import _roots, _states, _weight_gradient from .._ops.tempotron.reference import _phi, _psp, _stationary, _voltage from . import solver __all__ = ["tempotron", "srm", "cu...
774cd34b91a2f6fb7a2a92fd1f5dcf0c2fb6c09991dce63befac1c5c45806a21
Python
80,348
1,774
import matplotlib.pyplot as plt from scipy.optimize import curve_fit from pylab import * import numpy as np import random import math import time import os import glob # change the default font family plt.rcParams.update({'font.family':'Arial'}) set_sigma_errors = False #True data_sigma_errors = True # False thismax...