sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
4251fcb799984925703d05c2ef4b1d8f695b9af9fcba387e566f6ebf9eb8cb0c | Python | 30,023 | 494 | """
To extract all useful data into a unique csv file.
"""
import pandas as pd
import numpy as np
import os
# motor
def extract_updrs1(version):
col_updrs1 = ["PATNO", "EVENT_ID", "ORIG_ENTRY", "NP1COG", "NP1HALL", "NP1DPRS", "NP1ANXS", "NP1APAT", "NP1DDS"]
updrs1 = pd.read_csv("../"+version+"/_Motor_Assess... |
26c5bd45ad15e456e02c617508273b8a987c1882cb1a4d60757731086c964ddf | Python | 30,040 | 704 | r"""
This module implements the data storage functionality.
"""
import numpy
from parameters import ParameterSet
from neo.core.block import Block
from neo.core import Segment
#from neo.io.hdf5io import NeoHdf5IO
import mozaik
from mozaik.core import ParametrizedObject
from .neo_neurotools_wrapper import MozaikSegment,... |
86c68bb37e890ab4b33b7e31ced52b49663a417348f2478204c4311c5c370a38 | Python | 30,047 | 695 | import json
import os
from tempfile import TemporaryDirectory
import pickle
from typing import List, Optional, Tuple
from typing_extensions import Literal
import torch
# pip install typed-argument-parser (https://github.com/swansonk14/typed-argument-parser)
from tap import Tap
import GR_pKa.data.utils
from GR_pKa.dat... |
225af5e93fb6d2c8199aec95f6c3b861c62c682ef62cfe1d4e6c3cec68bfa45c | Python | 30,049 | 787 | #!/usr/bin/env python3
"""
CLI Interface Wrapper - Run simpleaf via command-line with a function-style API
This module provides a Python interface that wraps the ``simpleaf`` command line
tool (from the COMBINE-lab ecosystem), so that the simpleaf / salmon /
alevin-fry single-cell RNA-seq quantification workflow can b... |
6c9e1f890a981a924b6fb645eb3e229d647c55c163f97f9b6667aaca20250add | Python | 30,080 | 757 | """Tests for skorch.llm.classifier"""
import re
import timeit
import numpy as np
import pytest
from sklearn.exceptions import NotFittedError
class TestZeroShotClassifier:
@pytest.fixture(scope='class')
def model(self):
from transformers import AutoModelForSeq2SeqLM
return AutoModelForSeq2Seq... |
b33d4fa2246f055923edf9f1954986df29c147397371016eb4e7a70ae02e5c4f | Python | 30,083 | 764 | """
CTNet: A Convolution-Transformer Network for EEG-Based Motor Imagery Classification
author: zhaowei701@163.com
Cite this work
Zhao, W., Jiang, X., Zhang, B. et al. CTNet: a convolutional transformer network for EEG-based motor imagery classification. Sci Rep 14, 20237 (2024). https://doi.org/10.1038/s41598-... |
9690850efb205de9ec55a1a71a9ba77425061af5a2c5a2bde3e95d6b1a0466b0 | Python | 30,106 | 899 | """
Session-scoped runtime state for Claude-style OVAgent tools.
"""
from __future__ import annotations
import io
import os
import subprocess
import threading
import time
import uuid
from dataclasses import asdict, dataclass, field
from pathlib import Path
from typing import Any, Iterable, Literal, Optional
from .to... |
0edd739ef02e8579f916f70366182f57549153b089d9c1b40c407cbfe3934f0b | Python | 30,189 | 923 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023, 2024 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#... |
3c5d7223346fe9a35097b14b1fa36836b3d358e8089a3488d65d87f098c6553b | Python | 30,192 | 756 | """Sandbox execution helpers for agent-generated code.
Extracted from ``analysis_executor.py`` during Phase 4 decomposition.
Contains sandbox globals construction, the main execution entry point,
read-only snippet execution, approval gating, doublet harmonization,
figure autosave injection, and context-directive proce... |
c8b4aab4372966246a9a02ed78bb2726f2d7f24cab5aabfed24a511a3a238670 | Python | 30,216 | 679 | import os
import pickle
import itertools
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors
from netgraph import Graph
import networkx as nx
from networkx import NetworkXError
from networkx.algorithms.community.community_utils import is_partition
from networkx.utils import py_random_state
... |
bee6d4e779a11f431fc0cff9605dcb4af0a60b267bcaa88bfcb92510eead0167 | Python | 30,221 | 724 | import asyncio
import copy
import uuid
import warnings
from itertools import chain
from typing import (
Any,
Callable,
Dict,
List,
Literal,
Optional,
Tuple,
TypeVar,
Union,
)
import ray
from ray.dag.base import DAGNodeBase
from ray.dag.compiled_dag_node import build_compiled_dag_fro... |
6607c8ae63ecaa543d73eadfe266a5b7d2ee612a3a7d2fc2cdf09146f6ffeede | Python | 30,237 | 799 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
6786112fdd4bfc88c5a7d075cb3434885d99c85447fde1ce5fdeb868a4f5dd91 | Python | 30,265 | 763 | """
Module to read an iceberg table into a Ray Dataset, by using the Ray Datasource API.
"""
import heapq
import itertools
import logging
from dataclasses import dataclass
from functools import partial
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple, Union
import pyarrow as pa
from p... |
c9ae2aa3cf6100bfc8aaef916ce7a5c4b8a38de4522c8b789e932607c632d531 | Python | 30,281 | 859 | from numpy.random import choice, rand, randn
import numpy as np
import lea # probability calculations, see https://pypi.org/project/lea/
from collections import defaultdict
from sklearn import linear_model
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
from dataclasses impo... |
c24d1725053946aa3916f5f04b24d8535f1518c1e1a17ac4500bc0d02f96d780 | Python | 30,312 | 701 | import logging
import math
from concurrent.futures import ThreadPoolExecutor
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterator,
List,
Optional,
Sequence,
Set,
)
import pyarrow as pa
import pyarrow.dataset as pds
import pyarrow.parquet as pq
from pyarrow.fs import FileSystem
from t... |
451d2b517e4be08f22fc9d15c556c3e60d980012596d47b4be713478aa036ddd | Python | 30,339 | 926 | # Copyright 2024 Google LLC
#
# 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 agreed to in writing, ... |
c599f4d60116f343b222ce824f3ef84133694d00b93bcfccaad45411bf24ef01 | Python | 30,356 | 838 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=broad-except
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=multiple-statements
# pylint: disable=too-many-lines
#-------------------------------------------------------------------------------
'''
This source define th... |
20c8f683259124429ceecf509bfd0e0bf6bbc1fe07f6306f01774439bd64d1d8 | Python | 30,381 | 879 | # Copyright (C) 2018-2022 Intel Corporation
# Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
"""
Django settings for CVAT project.
Generated by 'django-admin startproject' using Django 2.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the fu... |
953332e2ad6fba3d2acf6cd02fc0c26ea3a167ea4eed88894d75f242f67210b1 | Python | 30,382 | 862 | from numpy.random import choice, rand, randn
import numpy as np
import lea # probability calculations, see https://pypi.org/project/lea/
from collections import defaultdict
from sklearn import linear_model
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
from dataclasses impo... |
96fe747640bfa43ccd0db991a0aba1f06f6f284f8a7dc1814fef11ab453e2980 | Python | 30,384 | 728 | import logging
import os
import warnings
from collections import Counter, defaultdict
from dataclasses import _MISSING_TYPE, dataclass, fields
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
List,
Mapping,
Optional,
Tuple,
Union,
)
import pyarrow.fs... |
b4eee296702bcc08f7a12bf59a2b943449f42af352a34ebab4dd57cd2a4849de | Python | 30,424 | 935 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Tile helpers for aihwkit tests."""
# pylint: disable=missing-function-docstring,too-few-public-methods
from aihwkit.simulator.configs.devices import (
I... |
08ffaf02e082d28e097b4414882cb1eae90a0dcc4cd2af75563c3c7b93a17c1d | Python | 30,428 | 778 | """Google Gemini adapter helpers for OmicVerseLLMBackend.
Internal module — import from ``omicverse.utils.agent_backend`` instead.
"""
from __future__ import annotations
import json
import logging
import ssl
import uuid
from typing import Any, Dict, List, Optional
from urllib import request as urllib_request
from url... |
efe0520c8a73288e26c03cb09d15fa9a1c41c4f2a08953f4c03d6d1055347045 | Python | 30,457 | 649 | from runpy import run_module
import numpy as np; np.set_printoptions(precision=2); np.random.seed(0)
import torch; torch.set_printoptions(precision=2)
import torch.nn as nn
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.font_manager import FontProperties
from mpl_toolkits import mplot3d
import seab... |
060db1c1b0e1abda465d6fac9eef5818fb294905c7cef1ce7618ccc94801f4e0 | Python | 30,461 | 855 |
from ._dynamicTree import cutreeHybrid
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn import linear_model
from scipy import stats
import networkx as nx
import datetime
import seaborn as sns
from scipy.cluster import hierarchy
from sklearn import decomposition as skldec
from mat... |
17633f121d676e5a8d21bc1413bedc072091b9ba1e587a1c34fd9c4dfdc1c481 | Python | 30,462 | 766 | import asyncio
import json
import logging
import time
from dataclasses import asdict, dataclass, replace
from enum import Enum
from typing import Any, Dict, Optional, Tuple, Union
from ray._common.observability.config import is_python_ray_event_enabled
from ray._common.runtime_env_package import (
PACKAGE_UPLOAD_E... |
225b2d01a9c7cf5ae070ad1c3014cd3a9bff9c2e0e2809e256d110787d59f74f | Python | 30,476 | 708 | from __future__ import annotations
import inspect
import warnings
from typing import Any, Callable, Dict, Optional, Tuple
from ..pp import scale,pca
import scanpy as sc
import numpy as np
import anndata
from .._settings import add_reference,settings
from .._registry import register_function
from .._monitor import mon... |
22b18b21210140971095db7a8d7fa0923603f1f0db7a71dc37842b7c37b4af57 | Python | 30,503 | 709 | import asyncio
import copy
import logging
import os
import random
import string
import time
import traceback
from typing import Any, AsyncIterator, Dict, Optional, Union
import ray
import ray._private.ray_constants as ray_constants
from ray._common.utils import Timer, run_background_task
from ray._private.accelerators... |
d486801bef8a17a062ccff32d88c923c7d88f8a8d53d7850999606b33b8cda9d | Python | 30,514 | 741 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. 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/LI... |
eac4aab7556f395a47dcb68e46a4519071a9a7d113f6b8fb1f163dab5afe65c7 | Python | 30,550 | 794 | """
AgentContextInjector - Inject prerequisite state into LLM system prompts.
This module provides the AgentContextInjector class which enhances LLM system
prompts with current data state, executed functions, prerequisite information,
and filesystem-based context, making the agent context-aware and proactive.
The fil... |
aa49c3606627135234a95496a4bdb51b228f9b7d08607d816e734d66a55955bf | Python | 30,555 | 650 | ################################################################################
# -- Preprocessing and analysis of the simulation results
################################################################################
import numpy as np;
import pylab as pl;
import os, pickle
import matplotlib.pyplot as plt
from scip... |
9c7ca80c225b6957fa7b943afe8a189ae41d63bf95f48d63e9ace567aa400646 | Python | 30,579 | 793 | import asyncio
import dataclasses
import enum
import json
import logging
import os
import time
import traceback
from datetime import datetime
from typing import AsyncIterator, Dict, Optional, Tuple
import aiohttp.web
from aiohttp.client import ClientResponse
from aiohttp.web import Request, Response, StreamResponse
i... |
7d56eeda2ab042b7418bf762fbc98bd7b432d79810cf1fce7321cbb0ec998c10 | Python | 30,597 | 662 | # Copyright 2021 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
# and Applied Computer Vision Lab, Helmholtz Imaging Platform
#
# 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 L... |
00da234250be37c9ca5d8cefcc0ce109e25686aec4667bf73df7cb53cb56f809 | Python | 30,604 | 793 | """
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.
Ray cluster utilities for SLURM and local environments.
This module provides context managers for starting and managing Ray clusters:
- get_sl... |
1715d898b06465bcce114894d3172fac41f16d3b9def9f239d51ed337f56c44d | Python | 30,605 | 849 | """
iMessage channel for OmicVerse Jarvis via ``imsg rpc``.
"""
from __future__ import annotations
import asyncio
import json
import logging
import os
import re
import shutil
import tempfile
import time
import threading
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, List, Opti... |
5ffd7d2d007778350326298465f6e28eea0f8b2f0ed2706879474cf48f9ef7be | Python | 30,611 | 719 | import asyncio
import logging
import os
import threading
from collections import OrderedDict
from datetime import datetime
from typing import Any, Callable, Dict, List, Optional, Set
from google.protobuf.timestamp_pb2 import Timestamp
from ray.core.generated.events_base_event_pb2 import RayEvent
from ray.core.generat... |
9c55c479d8202fd6bb1389febf67c135f8b5ccbc7a236ee607c924fe1e7efbd8 | Python | 30,665 | 624 | #!/usr/bin/env python
# ================================
# @auther: Rongbin Zheng
# @email: Rongbin.Zheng@childrens.harvard.edu
# @date: May 2022
# ================================
import os,sys
import pandas as pd
import numpy as np
import json
import pickle as pk
import collections
import scanpy as sc
from scipy.st... |
38138008a4a2d175b3da69b1bf702ad78299856c35ce4760c39de02a8fc273c5 | Python | 30,762 | 693 | #!/usr/bin/env python
# prepare_reference_transcript_gtf
import numpy as np
import pandas as pd
import sys
import os
import subprocess
import shutil
import logging
from gtfparse import read_gtf
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning) #gtfparse future warnings
logger = logging.... |
7b2713b269e86c8abadcc7c32291a33040f3b1cfbf275e59c1552ff0c541d6f4 | Python | 30,794 | 912 | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 12 10:59:39 2020
@author: DELL
"""
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 20 14:13:48 2020
@author: Akib
"""
import pandas as pd
import matplotlib.pyplot as plt
import pickle
import seaborn as sns
sns.set_style("whitegrid")
import altair as alt... |
41d1c7dea0b9174fcd77dd45b7bc1b1825c4a111a0981930e365a06a9ed7b220 | Python | 30,811 | 995 | import os
import sys
import time
# coding: utf-8
from dataclasses import dataclass
from typing import Callable, List, Optional, Tuple
import pytest
import ray
import ray._private.ray_constants as ray_constants
from ray._common.test_utils import wait_for_condition
from ray._private import authentication_test_utils
fr... |
0ea7af5ffd61ea2106f3bbaaa500ca6ffae614f064cb2d3121bdf8189cbb9763 | Python | 30,822 | 779 | # Ultralytics YOLO 🚀, GPL-3.0 license
import math
import random
from copy import deepcopy
import cv2
import numpy as np
import torch
import torchvision.transforms as T
from ..utils import LOGGER, colorstr
from ..utils.checks import check_version
from ..utils.instance import Instances
from ..utils.metrics import bbo... |
ef578731cadaf8853e6d4ec9956f9c21c99e5599beb2f2ff320970cfab1e8672 | Python | 30,860 | 736 | import json
import logging
import re
import time
from decimal import Decimal
from typing import Any, Dict, List, Optional, Tuple, Union
import jsonschema
from ray._raylet import GcsClient
from ray.autoscaler._private.kuberay.node_provider import (
KUBERAY_KIND_HEAD,
KUBERAY_KIND_WORKER,
KUBERAY_LABEL_KEY_... |
4ef8f5de454d16f4fc2d09de81fa71a937b7e391f135efcf356464a11f4668ea | Python | 30,875 | 731 | from __future__ import annotations
import warnings
from math import ceil
from typing import Sequence
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from .._registry import register_function
from .._settings import Colors, EMOJI
def _normalize_gene_list(genes, fitted) -> list[str]:
avail... |
36252417f968ea24ee8c3a166faac92ddda0303c61c8904b43b54ce8002327ad | Python | 30,879 | 917 | """
Module to initialise a bioFAM model
"""
import numpy as np
import scipy.stats as stats
from sys import path
import sklearn.decomposition
from sklearn.impute import SimpleImputer
from ..core.nodes import *
class initModel(object):
def __init__(self, dim, data, lik, groups, seed):
"""
PARAMETER... |
bef59401aaae54de9864685d16441783783827bc200c6a9ff455a6413671caab | Python | 30,914 | 883 | """
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.
Tests: Validation that the UMA-S fast-GPU execution backend correctly
accepts/rejects model configurations, plus unit tests for the
... |
df2541676c25d27ec9ec3177e69b2d00fddb49e143fbb40b7b29624f00f7a37f | Python | 30,938 | 672 | # coding: utf-8
import argparse
import time
import math
import os
import copy
import sys
import torch
import torch.onnx
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
import numpy as np
import torch.nn.functional as F
import logging
from torch.utils.data... |
95e6d3954457635aa4ae4401d3095db0faa7579196e1093ce6ab424dd42a6e95 | Python | 30,956 | 874 | # Copyright 2024 Google LLC
#
# 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 agreed to in writing, ... |
eed1bc5c648c37a39a572835ccb25b7dce85b3612207b4d72a1018a09745544e | Python | 31,001 | 746 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
936c31d9eb0cc9d3f62a47e084b717efd77c520b3373f1ab9adf621f08b4f38c | Python | 31,028 | 776 | import asyncio
import json
import logging
import time
from collections import defaultdict, deque
from concurrent.futures import ThreadPoolExecutor
from itertools import chain
from typing import Any, AsyncGenerator, Dict, Iterable, List, Optional, Set
import aiohttp.web
import grpc
import ray._private.utils
import ray... |
2d126186328f60975755d21edcb141cf577a7f75d71c9b8a84287011a34a00a2 | Python | 31,072 | 976 | """
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.
"""
from __future__ import annotations
import json
from dataclasses import dataclass
from typing import (
Any,
Final,
Generic,
... |
7dff87e4cd02f383fba259ea7e8f782fca7e5b9d3eef6592fce82cf726f38984 | Python | 31,110 | 733 | r"""Pathway thermodynamics: reaction ΔG and the Max-min Driving Force (MDF).
Thermodynamics decides whether a designed pathway can actually run and which
step is the bottleneck:
* :func:`reaction_dg` — transformed Gibbs energy ΔG'° of a reaction. Uses the
`eQuilibrator <https://equilibrator.weizmann.ac.il>`_ API w... |
70ee609bfe4e6cfb2427cc211f7dbaa86006a5c6795f2bd78228b48762ed2fd3 | Python | 31,144 | 771 | # Ultralytics YOLO 🚀, GPL-3.0 license
"""
Model validation metrics
"""
import math
import warnings
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
from ultralytics.yolo.utils import LOGGER, TryExcept
# boxes
def box_area(box):
# box = xyxy(4,n)
... |
4b6dca5010ead3a53258ffaaac4c7612ffc2d41dbfaafd74dffb0b702a728e17 | Python | 31,177 | 761 | # coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# 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... |
32aeab066cf595125e00bdb07b904cb6e7eb4ee5956eddc6997ef1c3af36e9a5 | Python | 31,180 | 710 | import pandas as pd
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
import seaborn as sns
import scanpy as sc
import base64
from io import BytesIO
import warnings
import os
from .._registry import register_function
warnings.filterwarnings('ignore')
from ..pl import *
class HTMLReport... |
7117a4715d166f9f52212b673dc9235023698bf40bfbad09e6b6eaddcdb30238 | Python | 31,203 | 768 | #!/usr/bin/env python
## Intersections with CN34 peaks
## SV's present in unaffected individuals removed (remove SV ID)
## Results for large pedigrees filtered (remove hits in large pedigrees)
## Remove results that are present in a family w/o matching inher pattern (remove SV ID); identify variants present only 1x in... |
dd4aec6e8f755af2f06ce8cae4bfda6d3d3f63b068faf6ef5d0a64a995fff33e | Python | 31,205 | 716 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.normal import Normal
import matplotlib.pyplot as plt
import matplotlib
#matplotlib.use('TkAgg') # MUST BE CALLED BEFORE IMPORTING plt, or qt4agg
from vxm_model.py.utils import default_unet_features, jacobian... |
0df604ae305b3b0c32b91bfd590c9c6f1e9ab9d9235c038bfac8079b9a288a9a | Python | 31,245 | 894 | """
Run the "canonical" TE-Dependent ANAlysis workflow.
"""
import argparse
import datetime
import json
import logging
import os
import os.path as op
import shutil
from glob import glob
import numpy as np
import pandas as pd
from nilearn.masking import compute_epi_mask
from scipy import stats
from threadpoolctl import... |
af43e74bfa1243267e79a0ea8b940c18d137222daed7fb45378d5a30e06d35b8 | Python | 31,279 | 818 | import pandas as pd
import random
import numpy as np
import torch
#from deepforest import CascadeForestClassifier
from sklearn.neighbors import NearestNeighbors
from scipy.linalg import solve
from sklearn.neighbors import KDTree
from scipy.optimize import nnls
import anndata
import os
from collections import defaultdi... |
70481c22560f2934e41b8e4ba2b00c4db3237ab065f75ec78b58c415f7409432 | Python | 31,296 | 683 | # This file is part of PyEMMA.
#
# Copyright (c) 2014-2016 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either versio... |
be84d98f4e27061fc1834f7d325cee02a4955bfe571630968126e5456d07bb58 | Python | 31,311 | 646 | import importlib
import os
import pkgutil
import sys
from contextlib import contextmanager
from typing import Dict, List, Set, Tuple
import click
from ci.ray_ci.doc.api import API, _is_directly_annotated
from ci.ray_ci.doc.autodoc import Autodoc
from ci.ray_ci.doc.module import Module
# Each team config carries two ... |
b2bd14071e2e9b7ee08ee006a843a4f2eaf8190512a56273693c52a7ec2951a9 | Python | 31,319 | 633 | import itertools as it
import json
import logging
import os
import random
import sys
from statistics import fmean
import numpy as np
import pandas as pd
import rdkit.Chem as Chem
import torch
from tqdm.auto import tqdm
from src.chemical_properties import compare_compounds, get_smiles_from_mol2
from src... |
b6ac71cdacc1d6a00b38ed50beeb07d403ffda01203aaf55ebbeff7d2334a284 | Python | 31,330 | 919 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
73b75d0ea8980a6092f269a8dcedcc46d31dc52a810f23f8bf0a4eb3b00daf24 | Python | 31,368 | 750 | import dis
import hashlib
import importlib
import inspect
import json
import logging
import os
import sys
import threading
import time
import traceback
from collections import defaultdict, namedtuple
from typing import Callable, Optional
import ray
import ray._private.profiling as profiling
from ray import cloudpickle... |
2a106d0424d7cfd087991041dc0f4dcdfd36ab558c654a121cdd7bf15987cbf6 | Python | 31,401 | 684 | from __future__ import print_function
import os
import matplotlib as mpl
if os.environ.get('DISPLAY', '') == '':
print('no display found. Using non-interactive Agg backend')
mpl.use('Agg')
import matplotlib.pyplot as plt
import sys
import torch
import torch.nn as nn
import torch.optim as optim
impo... |
14c40c3b9f2db96d3efffe65a2630838b2682837f2ea41565ea145d7c3a72b10 | Python | 31,415 | 722 | from __future__ import print_function
import os
import matplotlib as mpl
# if os.environ.get('DISPLAY', '') == '':
# print('no display found. Using non-interactive Agg backend')
# mpl.use('Agg')
import matplotlib.pyplot as plt
import sys
import torch
import torch.nn as nn
import torch.optim as optim... |
c7281c00fd8a1a7c3ff3dfb2fad936447e0fdfd00774e065a4243b74cd791243 | Python | 31,429 | 857 | """I/O for single-extracellular-vesicle (single-EV) proteomics data.
Single-EV proteomics measures the protein content of *individual* extracellular
vesicles (EVs). The natural data structure is an **EV x protein matrix** —
directly analogous to a single-cell *cell x gene* matrix, where a vesicle plays
the role of a c... |
fb1581edcc3fb738d42c164cee5afb8d31793fb5859940febc8aa4bcbf11dff6 | Python | 31,512 | 769 | import copy
import pickle
import logging
import os
import sys
from typing import Any, Dict, List, Optional, Set, Tuple, Union
import yaml
import random
from pathlib import Path
from scipy.stats import halfnorm, norm, bernoulli, dirichlet
from scipy.special import logit
import torch.nn.functional as F
import dask.data... |
c70cfc56febfc2b88cb2547bf137d8db464984f6bf9ae949551f89cb4d88b87b | Python | 31,541 | 724 | import eelbrain as eel
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import matplotlib, scipy, statsmodels, pathlib
from tqdm import tqdm
from pathnames import *
colors = [(0, 0.2, 0.7), (0, 0.5, 0.8), (0.4, 0.8, 1), (0.4, 0.9, 0.7)]
def get_trfs(speechfolder, pr... |
245b67f70a53024c49ba2c3d0098c1e904bf34ef8b33cc2fdabea2e5cd33950a | Python | 31,545 | 548 | from typing import Any, Tuple, List, Callable
import os
import csv
import time
import copy
import dill
import os.path
import shutil
import random
import tqdm
import torch
import torch.nn
import numpy as np
import sak
import sak.torch
import sak.torch.data
def get_batch_ssl(loader_labeled,loader_unlabeled):
# Set ... |
5a1d054f801bc9e2002ffd1c60c7292dd0b99c68776db85c7b855307a18f68a8 | Python | 31,556 | 799 | r"""Single-cell metabolism inference (scMetabolism / Compass / scFEA / MEBOCOST).
Two :func:`register_function`-decorated entry points, mirroring
:class:`omicverse.single.CNV`:
* :class:`Metabolism` — per-cell **metabolic state** with
``method='scmetabolism' | 'compass' | 'scfea'`` dispatch. All three
backends sh... |
820fc771e01cf92ec239b9e7e550d7647f0789fce7bb058edda8b1f6176b93bc | Python | 31,561 | 920 | """Tests for dataset.py."""
import unittest
from unittest.mock import Mock
import numpy as np
import pytest
from scipy import sparse
from sklearn.datasets import make_classification
import torch
import torch.utils.data
from torch import nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from ... |
103ec0f9ef4c501fac295693b1e9857654750b9f93b6b44d010fcc3404153a0a | Python | 31,578 | 833 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Tests for layer abstractions."""
from unittest import SkipTest
import pytest
from torch import randn
from torch.nn import (
Conv1d as torch_Conv1d,
... |
842e0df7608417f63595fcdb500ca52032d54b90a966d5d6d4ce869a6cc81370 | Python | 31,649 | 771 | #
# \file generator.py
#
# \brief Generates the CUTLASS Library's instances
#
import enum
import os.path
import shutil
import functools
import operator
from library import *
###################################################################################################
#
# Data structure modeli... |
4babf2d3597e77377c58de76d1482f1ca5f560344bfa97386cd5e030b6919864 | Python | 31,653 | 672 | """
Geneformer collator for gene and cell classification.
Huggingface data collator modified to accommodate single-cell transcriptomics data for gene and cell classification.
"""
import warnings
from enum import Enum
from typing import Dict, List, Optional, Union
import numpy as np
import torch
from transformers impo... |
7e8d47302b2701007a37fc505502d17159d98f0f5210be05ce7945780fd45d56 | Python | 31,660 | 805 | from typing import Optional, Union
import sys
import anndata
import numpy as np
import pandas as pd
import scanpy as sc
from matplotlib import cm
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.lines import Line2D
import plotly
import seaborn as sns
from scipy import sparse
from scipy.spatial i... |
abf9666df6cf5cbd6abb0bb950cf47a5bbf619dde2db85ee5b4a3997cf3c5a78 | Python | 31,664 | 643 | import os
import time
from subprocess import call
import numpy as np
import pandas as pd
import seaborn as sns
from scipy import stats
import seaborn as sns
import matplotlib.pyplot as plt
import scipy as sc
from matplotlib.colors import ListedColormap
import scipy.sparse as sparse
import importlib
import copy
import ... |
6a48825ee5e7c3d4533f01d3d59f84e2fadaca58a858ae7ba2ec9bd427601b35 | Python | 31,673 | 695 | import os
import argparse
import pandas as pd
import multiprocessing
import subprocess
import tqdm
# base directory where the code is
#BASE_DIR = os.path.dirname(os.path.abspath(__file__))
BASE_DIR = os.getcwd()
# Strains that have both core and mini fasta files: eg <strain>.core.fasta and <strain>.mini.fasta
STRAINS... |
8063fb19d590779ad8cd38dbfacf15dbe1249b532a74b933d0103ae2819b2671 | Python | 31,783 | 666 | ### Dependencies
# Base Dependencies
import argparse
import colorsys
from io import BytesIO
import os
import random
import requests
import sys
# LinAlg / Stats / Plotting Dependencies
import cv2
import h5py
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
import numpy as np
from... |
147e960c2fdb21b80081a6cac0b33d19056936434864916cd05257470336dc71 | Python | 31,817 | 866 | # Copyright 2023 The HuggingFace Team. 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 applicabl... |
6af23867eb649689830f889d0cf112f7e9fc146df8dcfe80b74c46973105e5cd | Python | 31,836 | 639 | """
Loading and plotting module for analysis of survey responses.
author: @RonyHirsch
"""
import re
import os
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
FINAL_PAGE = 3 # the last page in the survey, every participant who finished the survey landed here
FINAL_PAGE_COLN... |
7083d52ae845243f0bfbe49c866db98e6ab8fdc35f97eb0732b2c6e9aec0ba5a | Python | 31,846 | 827 | # -------------------------------------------------------------------------------------------------------------------------------------
# Following code curated for Bio-Diffusion (https://github.com/BioinfoMachineLearning/bio-diffusion):
# --------------------------------------------------------------------------------... |
2a568d9c884466deedad1d497288b5a7f3881467c0cdd9489f8042d512cf5784 | Python | 31,870 | 668 | ####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... |
2ae5b7ee4ec4c4554a29dcaa334f2c28feb2009923223e7c089959502bf910aa | Python | 31,924 | 750 | # -*- coding: utf-8 -*-
"""
Created on Fri May 10 12:01:37 2024
@author: nlancaster
"""
#Sup Fig 3A-C
#% Combined FLR and Quant Eval Plot Data Prep beginning
import pandas as pd
import numpy as np
standards = pd.read_csv('P:/Projects/NML_TPC_2023_ThermoFisher_Phosphoproteomics_q-OT-Astral/SyntheticPhospho/SyntheticPho... |
71576db0163473500e41a080a8737ccf546d0f8ebb354e846a8135bd64b18fd2 | Python | 31,934 | 829 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader, TensorDataset
import numpy as np
import pandas as pd
import scanpy as sc
import scipy
from scipy.stats import norm
from scipy.stats import dweibull
from tqdm import tqdm
class scLTN... |
3b87fcd3252e6e1b62fd1419c2aca2237171a758ee141f635139dfcba75907dd | Python | 31,935 | 668 | # Copyright 2023 The HuggingFace Team. 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 applicabl... |
ff38883b4e9babf1ef1db57663e24a499008392ccf48801c7b70800fb4d34b62 | Python | 31,941 | 869 | # Copyright 2024 Google LLC
#
# 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 agreed to in writing, ... |
04424eabb2c6eee5d310fa1b1927a326838b6f22f6e74298365d7541a50fd72c | Python | 31,956 | 704 | # coding: utf-8
import argparse
import time
import math
import os
import copy
import sys
import torch
import torch.onnx
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
import torch.nn.functional as F
import numpy as np
import logging
from torch.utils.data... |
9a0e85d3ce495a621b7f1a5fafedfb12bf938c572313a465d111db69cc60da52 | Python | 31,979 | 732 | from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Literal, Any, Tuple
import numpy as np
from scipy.sparse import issparse
import scanpy as sc
from anndata import AnnData
import pandas as pd
from functools import lru_cache
import pathlib
from pathlib import Path
import lo... |
b98a60e2a03c98d7837ed827e6d324fac3e9da452ef28170fee8aa842180b5ba | Python | 31,982 | 691 | ########################################################
######### Philipp R. Steen #########
######### Jungmann Lab #########
######### Max Planck Institute of Biochemistry #########
######### Ludwig Maximilian University #########
######### 2024 ... |
82c6f9c75a35a7714f90f1f6750388b12c8f0975572642cf42b5adae2cd3d6e8 | Python | 32,065 | 908 | # -*- coding: utf-8 -*-
# (C) Copyright 2026 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
"""Visualization utilities.
This module includes plotting and visualization utilities for ``aihwkit``.
Using this module has extra dependencies that can be inst... |
23a733db5d8fd06f2e022b1e31cf5bcf07db215bed9710a7fea5590387e12fff | Python | 32,105 | 891 | import os
import csv
import argparse
import numpy as np
import pydicom as dicom
from pathlib import Path
from time import strftime
from tqdm.auto import tqdm
from functools import partial
from shutil import copyfile
from skimage import io as skio
from scipy.ndimage import binary_fill_holes
import matplotlib.pylab as p... |
e015d8ed04f6c42d0889b03033dad0ee4e2bd57d11a7b0b9763c5887b48116eb | Python | 32,118 | 840 | # Copyright 2023 Google LLC
#
# 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 agreed to in writing, ... |
eb172be7db1727a2b1af9f4211c2e1a8655004e8602a4db677e56702a3dfeb43 | Python | 32,126 | 885 | # pylint: disable=dangerous-default-value
"""
Deep mechanistic network module.
"""
from __future__ import annotations
import logging
import warnings
from contextlib import contextmanager
from typing import Any, Callable, Dict, Iterable, Literal, Optional, Union
import numpy as np
import torch
import torch.nn as nn
f... |
594b57c46c37d6316a4410d1c8199d90219964acd2d0e1f86e56723a72c542e8 | Python | 32,139 | 934 | import os
import cv2
import json
import numpy as np
import pandas as pd
import scanpy as sc
import torch
import torch.nn as nn
import torch.optim as optim
from scipy.stats import median_abs_deviation
from torch.utils.data import DataLoader
import sys
# Module import
from ._starfysh import LOGGER
from .dataloader ... |
e9c0da1cdc000ee7b3561fc22ccc68c52f2df6d8746fb32fecb6cbf968fe2fef | Python | 32,148 | 933 | from pathlib import Path
import pandas as pd
import pytest
from click.testing import CliRunner
from pandas.testing import assert_frame_equal
from deeprvat.annotations.annotations import cli as annotations_cli
script_dir = Path(__file__).resolve().parent
tests_data_dir = script_dir / "test_data"
@pytest.mark.paramet... |
5326f2b553366fb22b813bab5c5931790ef5243392a5aef5b309affd591184c2 | Python | 32,165 | 935 | import datetime
import enum
import io
import os
import struct
import zipfile
from collections.abc import Generator
from typing import (
IO,
TYPE_CHECKING,
Any,
Literal as L, # noqa: N817
cast,
)
from xml.etree import ElementTree as ET
import numpy as np
# typing.assert_never requires Python 3.11;... |
af453f26fc6d58a6fff0b9b5e99e6387f1dca941ba59f86fefe7101c1bd0789e | Python | 32,176 | 776 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
python %prog study.file population.file gene-association.file
This program returns P-values for functional enrichment in a cluster of
study genes using Fisher's exact test, and corrected for multiple testing
(including Bonferroni, Holm, Sidak, and false discovery rate... |
06f23d9d956a2062c78c17f1f7ebec2601d73feb666541c1c71f8565d39371ea | Python | 32,277 | 879 | """
Gemini CLI OAuth helpers for Jarvis.
"""
from __future__ import annotations
import base64
import hashlib
import json
import logging
import os
import re
import secrets
import threading
import time
import webbrowser
from datetime import datetime, timezone
from http.server import BaseHTTPRequestHandler, ThreadingHTTP... |
21273549b52da358a7ea414bf5dfe8ada9a2b2f388591054f9c87e6746fbe0a1 | Python | 32,328 | 875 | r"""Plotting helpers for :class:`omicverse.single.CNV` outputs.
Three functions, all reading the unified ``adata.obsm['X_cnv']`` /
``adata.uns['cnv']`` schema that both CopyKAT and inferCNV write into:
* :func:`cnv_heatmap` — cells × genomic-position heatmap with a
chromosome ideogram bar on top (alternating black/... |
9db010160e04c5a9142f698249ca9a00a8bf3ff453a9e44977390b90ee20ffb9 | Python | 32,378 | 1,152 |
from gym.envs.registration import registry, register, make, spec
from gym_sted import defaults
# Control environment
register(
id='STEDsum-v0',
entry_point='gym_sted.envs:STEDEnv',
max_episode_steps=10,
kwargs={
"reward_calculator" : "SumRewardCalculator"
}
)
register(
id='STEDmultipl... |
fadccd8047e29cdd7b8263c320c7c14f76dc6c0ec74ca5dfefde6c8f844052c6 | Python | 32,396 | 922 | """The io module handles most file input and output in the `tedana` workflow.
Other functions in the module help write outputs which require multiple
data sources, assist in writing per-echo verbose outputs, or act as helper
functions for any of the above.
"""
import json
import logging
import os
import os.path as op
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.