sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
49842b8436a7608bf48d2fa9c8c2d090641b22be0ff6dc4429c1b629f0216128 | Python | 24,628 | 521 | """Deformable registration of two images of the same tissue section.
Built for the common multi-round case -- a nuclear fluorescence image (DAPI)
against a later H&E of the same slide, or two rounds of any stain -- where the
frames differ by a global similarity, partial overlap, and a smooth non-rigid
deformation that... |
70fabf3ac7d37c35e66e398f23caf6c07e1ae34a6a74c333bee520858bc2ca02 | Python | 24,655 | 682 | import time
from functools import partial
from copy import deepcopy
import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
def time_to_string(time_val):
"""
Function to convert from a time number to a printable string that
represents time in hours minutes and seconds.
:p... |
fa4e2fdfc90024d1d364bb422455c54f8715f852ded6cc22a1ba032a40d0e33a | Python | 24,673 | 628 | import difflib
import os
import platform
import shlex
import shutil
import subprocess
import sys
import tempfile
from pathlib import Path
from typing import List, Optional
import click
import runfiles
from networkx import DiGraph, ancestors as networkx_ancestors, topological_sort
from pip_requirements_parser import Re... |
2833179339175ec9fdecc42e2f4e43fe75c2f5b8d0fedf7281d3c84a7fd97047 | Python | 24,689 | 507 | # ML4H is released under the following BSD 3-Clause License:
#
# Copyright (c) 2020, Broad Institute, Inc. and The General Hospital Corporation.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#... |
4c169d7291f7142fd072f8a4ce6a17755826b284045656177385ebf27ba834d9 | Python | 24,701 | 677 | from anndata import AnnData
import scanpy as sc
import numpy as np
import pandas as pd
from scipy import sparse
from typing import Iterable, Union, Optional
from .._settings import add_reference
from .._registry import register_function
### Refer to: https://github.com/theislab/scanpy/blob/5533b644e796379fd146bf8e659... |
7676e9f8ea222bdb75c0789229353e846b92bffbb06ce4ea4706610a7c2562b9 | Python | 24,703 | 566 | # 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... |
00df1925813a4bbf7a710c4fedc19a021842815275145a9fa4406bc344215c2f | Python | 24,709 | 597 | from PIL import Image
import numpy as np
from ctypes import *
import ctypes
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import cv2
import time
import pdb
import socket
import pickle
import scipy
import scipy.ndimage
import PySpin
import matplotlib.pyplot as ... |
20aedcef3511bdee7647317c4544859d6b8deff2fe1145023cda233152251577 | Python | 24,717 | 758 | import io
import pathlib
import struct
import numpy as np
import pytest
from stl import (
mesh,
ply,
stl as stl_module,
)
PLY_ASCII_PATH = pathlib.Path(__file__).parent / 'ply_ascii'
PLY_BINARY_PATH = pathlib.Path(__file__).parent / 'ply_binary'
CUBE_VERTICES = np.array(
[
[-1, -1, -1],
... |
d9db2f5364b3572a6fcf0e9f545f4a6c9ffc61bb51fe96c323c34234d5c59ead | Python | 24,733 | 490 | # coding: utf-8
"""
# # SCRIPT: FIRST LEVEL GLM IN FMRI-BASED REST REACTIVATION
# # PROJECT: FMRIREPLAY
# # WRITTEN BY QI HUANG 2022
# # CONTACT: STATE KEY LABORATORY OF COGNITIVE NEUROSCIENCE AND LEARNING, BEIJING NORMAL UNIVERSITY
"""
# In[1]: import relevant packages
import os
import copy
import warnings
import num... |
1c5a882a90a5d728ab08e1cea0d5ab460f475e25152d382901123f8d2f4fd2e0 | Python | 24,750 | 652 | import csv
import datetime
import math
import os
import sys
import cv2
import face_alignment
import matplotlib.pyplot as plt
import numpy as np
import torch
from PyQt5.QtWidgets import (QApplication, QCheckBox, QDesktopWidget,
QVBoxLayout, QWidget)
from scipy import stats
# Open a video c... |
a73d92135c45eff9b2b3eeb589067daf7ba817d9ef90405eaf4100723f885dda | Python | 24,757 | 689 | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import datetime
import errno
import json
import logging
import os
import random
import subprocess
from abc import ABC, abstractmethod
from col... |
36e3aa49757c67540f13a3d7baca45bac72b935f38f448955d866427516b04c3 | Python | 24,763 | 639 | ''' Get event-related avergaes per stimulus duration '''
import os
import glob
import nibabel as nb
import numpy as np
import subprocess
import pandas as pd
import re
import matplotlib.pyplot as plt
from scipy import interpolate
import sys
sys.path.append('./code/misc')
from findTr import *
ROOT = '/Users/sebastian... |
665b48d577437f7e32b24b44d1ea209cc06c9302297ff9a5ad4cf37a43774296 | Python | 24,766 | 562 | from typing import Callable, Optional, Union, Tuple, Iterator
import numpy as np
import torch
from torch import nn as nn, autocast
from torch.nn import functional as F
from convex_optim_base.prox_optim import ProxSolverParams
from new_style_optim.accelerated_unconstrained_optim import _optim_unconstrained_FISTA
from ... |
0f1ccb0765d274ee8efbae66a31b19bfbbf293f37b949882b1f178ed69ec6636 | Python | 24,779 | 606 | import argparse
import inspect
import logging
import math
import os
from pathlib import Path
from typing import Optional
import datasets
import torch
import torch.nn.functional as F
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils import ProjectConfiguration
from datas... |
d31ff962deafb9131262d029581765bcbf6028745488255b00f299a3f885d378 | Python | 24,792 | 619 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------
# Created By : Kangjoo Lee (kangjoo.lee@yale.edu)
# Last Updated: 08/06/2024
# -------------------------------------------------------------------------
# =========================================... |
7e9dc0e93ef23531fb3941786f8cd2ca4ef494f253975931705db3189a232f43 | Python | 24,807 | 523 | #!/usr/bin/env python
"""
Example script to test a VoxelMorph model.
You will likely have to customize this script slightly to accommodate your own data. All images
should be appropriately cropped and scaled to values between 0 and 1.
If an atlas file is provided with the --atlas flag, then scan-to-atlas training is... |
ae6b2c646c012cd940b7631dc4c84a20ce637c53fab7132391389e52c67180eb | Python | 24,831 | 477 | # 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... |
f40e229f1d6a01a16c6776ff4d8d2f6f2c52f3716cd8977b2fd7ef37edee36e9 | Python | 24,837 | 705 | """
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.
Test RayCluster functionality by mocking out submitit to avoid actual SLURM job submission.
"""
from __future__ import annotations
import jso... |
5c7891b537a81942b571d357fe70925b66af4290c6a1a5200fefcaa814a969c3 | Python | 24,842 | 596 | from typing import Callable, Tuple, List, Union
from time import time
from logging import Logger
import numpy as np
import matplotlib.pyplot as plt
from .utils import get_distances, estimate_interaction
from .cooling import AdaptiveSchedule
from .scope import Scope
from .feature import Feature
from .mosaic import Mos... |
03bc4da2b05abfc1a16db6864273b41b3ff6f53e5960d6dbbe1273f4de857b84 | Python | 24,864 | 564 | import argparse
import pickle
from collections import namedtuple
from enum import Enum
from typing import Dict, List, Tuple, Callable, Union
import numpy as np
import torch
import torch.multiprocessing as mp
import tqdm
import visionloader as vl
from whitenoise import RandomNoiseFrameGenerator
import lib.data_utils.d... |
0b657f53edc157df9eed2cfd375bd2fa65958c230209c09d8c135f867fa8c010 | Python | 24,865 | 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... |
fba50cdb226167789d882e9551377ed97379564d1dea1a333999a334abf14653 | Python | 24,874 | 656 | import asyncio
import binascii
import errno
import importlib
import inspect
import logging
import os
import random
import string
import sys
import tempfile
import time
from abc import ABC, abstractmethod
from inspect import signature
from types import ModuleType
from typing import Any, Coroutine, Dict, Optional, Tuple
... |
a8d152c4af5d0564ef443a7b83957981bc0c6fa7795456d802c7ec572ea75345 | Python | 24,897 | 695 | import json
import logging
import os
import shlex
import sys
import tempfile
from contextlib import contextmanager
from pathlib import Path
from subprocess import list2cmdline
from typing import Optional
from unittest import mock
import pytest
import yaml
from click.testing import CliRunner
from ray.dashboard.modules... |
417649bdeafe16c59274a67e8e7aafb9a01c7274b9e5ac52a54709cfb941a64c | Python | 24,916 | 694 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 20 11:33:35 2016
@author: agiovann
"""
from builtins import map
from builtins import str
from builtins import range
from past.builtins import basestring
from past.utils import old_div
import ipyparallel as parallel
from itertools import chain
impor... |
2185cf07abca1935424c0b10d4667a5f27d6b371487b0f8df28192637a226a54 | Python | 24,920 | 598 | """Convex Hull of Admissible Modularity Partitions — ``ov.pp.champ``.
Implementation of Weir, Emmons, Wakefield, Hopkins & Mucha (2017),
"Post-processing partitions to identify domains of modularity
optimization" (*Algorithms* 10(3):93). The key observation is purely
geometric: for any **fixed** partition :math:`P`, N... |
b16cccdc06bfb262c84dbf3621a093865378331cec1cf72caed367c02f4ad670 | Python | 24,935 | 494 | # coding: utf-8
"""
# # SCRIPT: FIRST LEVEL GLM IN EEG-BASED ON REST REACTIVATION
# # PROJECT: FMRIREPLAY
# # WRITTEN BY QI HUANG 2022
# # CONTACT: STATE KEY LABORATORY OF COGNITIVE NEUROSCIENCE AND LEARNING, BEIJING NORMAL UNIVERSITY
"""
# In[1]: import relevant packages
import os
import copy
import warnings
import n... |
f725ebd5c95031f0e35f60e78e5bb9194fa56e013c7e401541452b91f7643c87 | Python | 24,949 | 600 | #!/usr/bin/env python3
"""Class for handling modules and graph objects."""
# Internal imports:
from .graph import gene_graph, adjacency_matrix
from .utils import (
# Correlation, covariates, multigraph:
calculate_correlation,
calculate_correlation_estimate,
calculate_correlation_estimate_sd,
calcula... |
ada5b48c9e395e1964b5960b22969c94619e3a3bd2e243c6db111d5d625f93be | Python | 24,959 | 569 | ####################################################################################################
# Copyright (c) 2023, 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 free softw... |
1c85cf5ce9c2fb9a976a81dda5273cd3e0adabb4509f11847b8bcf6578db8090 | Python | 24,974 | 672 | # Copyright 2025 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, ... |
6b311ae1f4249db34009c4ae4296ea4375714697155781a963f2f11148399076 | Python | 24,984 | 508 | # -*- coding: utf-8 -*-
"""
# # SCRIPT: DECODING CORRELATION BETWEEN EEG AND FMRI
# # PROJECT: FMRIREPLAY
# # WRITTEN BY QI HUANG 2022
# # CONTACT: STATE KEY LABORATORY OF COGNITIVE NEUROSCIENCE AND LEARNING, BEIJING NORMAL UNIVERSITY
"""
# In[1]: import relevant packages
import os
import glob
import warnings
import n... |
cfb0ba0d80c317539c400618ed7449d851cc2064de9027fbb07135329158c0a5 | Python | 25,006 | 690 | """
Checkpointing version of the lazy function for memory-efficient processing
of large single-cell datasets.
"""
import os
import anndata
import numpy as np
import scanpy as sc
from .._settings import add_reference, settings
from ..pp import (
neighbors,
pca,
preprocess,
qc,
scale,
score_gen... |
89760364038e4e6bb594238eff995909c7f5a8042d0bdf3196fd11259e5c7aeb | Python | 25,009 | 749 | """
DataContainer class for linking directories containing different sorts of data.
This is meant to make plotting and analysis easier.
TO DO
-----
- request random subsets.
- make sure input directories are iterable
- add features to existing files.
"""
__date__ = "July 2019 - November 2020"
import h5py
try: # Num... |
3073215ac01421dbfc0df90567baa03bf5dbe5911fccc1150c05212af17123f6 | Python | 25,014 | 625 | """
Pre-execution security analysis and runtime sandbox hardening for OmicVerse Agent.
Inspired by OpenCode's two-layer defense pattern (AST analysis + runtime restrictions),
adapted for bioinformatics use cases where file I/O and data-science libraries are
essential but shell access and system manipulation are not.
... |
c0a3fa24449104d55e1dc603539bfedcebb64d7af55957532f1b9928075bcb3d | Python | 25,016 | 554 | """Cell-to-cell correspondence between two segmentations of the same tissue.
The same physical section imaged twice -- DAPI in an in-situ run, H&E in a
later staining pass, or two rounds of any nuclear stain -- gives two lists of
cell centroids in two coordinate frames. They differ by a global similarity
(shift, rotat... |
97f721bdac65270b38d12987919c86c241a00c9f86dbd22140df22ea8d6b79ec | Python | 25,024 | 539 | # -*- coding: utf-8 -*-
"""
# # SCRIPT: THE FUNCTIONS OF DECODING
# # PROJECT: FMRIREPLAY
# # WRITTEN BY QI HUANG 2023
# # CONTACT: STATE KEY LABORATORY OF COGNITIVE NEUROSCIENCE AND LEARNING, BEIJING NORMAL UNIVERSITY
"""
# set the class labels based on marker:
def classlabel(Marker):
if Marker == 11 or Marker =... |
827b8a8c45b1556b96d951272d68f3ca5c516cbe0b671f8239d3da0d5e5aed0f | Python | 25,044 | 685 | # 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, ... |
9f46fb6ffa78049768fdde3dda8aebc641ad37e863954ff2fce6dc413da4a5af | Python | 25,050 | 632 |
# coding: utf-8
# In[1]:
import math
from sklearn import metrics
from sklearn import preprocessing
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import re
import time
import datetime
import random
random.seed(1234)
from scipy import interp
import warnings
warnings.filterwarnings("ignore")
... |
fde761b039446cfb7d127a138cc198126d1e340ed85b6c66a2ab52d8c5678c9f | Python | 25,078 | 694 | """
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 itertools
from collections import defaultdict
import numpy as np
from ase.build import minimize... |
a9283e54fa54ef39d5520c7789590d3221d45e84fd7c213e0450edd8f3cedbe6 | Python | 25,100 | 667 | # Copyright 2022 The Music Spectrogram Diffusion Authors.
# 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... |
a4fc5650a9713ab050f9865817caf9b3f0034386c6e2afebbb2d1b9ebb153ddf | Python | 25,109 | 611 | ####################################################################################################
# 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... |
7be1a81423bdf3b9bb8a9a3a106fd949a57786ce798cc55cf7b06b4140f901cf | Python | 25,128 | 697 | """'Transduction' of cartesian pixels to hexals on a regular hexagonal lattice."""
from itertools import product
from typing import Iterator, List, Literal, Optional, Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn.functional as F
import torchvision.transforms.functional a... |
650085f400345e499df6907147d880bc77c9853aaa54818b5ec600aba1fa6114 | Python | 25,132 | 625 | #!/usr/bin/env python
from __future__ import print_function
# import
## batteries
import os
import re
import shutil
import tarfile
import argparse
import logging
import random
import urllib.request
import functools
import multiprocessing as mp
from collections import Counter
## 3rd party
import networkx as nx
from netw... |
c27d0f5876e415e653699d74d30f23686ff50240d6c023f506aa8a1590742586 | Python | 25,135 | 638 | """
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 math
from typing import TYPE_CHECKING
import torch
from torch import nn
from torch.nn import fu... |
4f3cd2071e739ce3d5e5582fcbe3949e22a27b66ef1f5ee3799ac433294ded18 | Python | 25,152 | 631 | ####################################################################################################
# Copyright (c) 2020, 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 free softw... |
26e2d4c55d0db21cfea3e1f1bb7749f067c5f3c457a926c8c61128f80428224b | Python | 25,153 | 558 | # biolgca is a Python package for simulating different kinds of lattice-gas
# cellular automata (LGCA) in the biological context.
# Copyright (C) 2018-2022 Technische Universität Dresden, Germany.
# The full license notice is found in the file lgca/__init__.py.
"""
Classes for two-dimensional LGCA on a hexagonal arm-s... |
b7dd1c586c594ade106a32ea1578afefea73f765682061b8d71ee52cca7ff929 | Python | 25,157 | 696 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.data import Dataset, DataLoader
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import argparse
import pdb
import os
import sys
import... |
cc7fe7c72fa5520a64bdfcdc7ddd3a11c80e97b28c0ed9a1c319305b47b8a617 | Python | 25,164 | 604 | #聚类
from sklearn.mixture import GaussianMixture
from sklearn.cluster import KMeans
import scanpy as sc
import pandas as pd
import numpy as np
import anndata
from .._settings import add_reference
from .._registry import register_function
from ..external._pymclustr import fit_pymclustr
mira_install=False
def global_impo... |
1ef9875bb033f9104e24e035e1780f4a38627845493c5ab6762d1c6c01256142 | Python | 25,169 | 662 | r"""
This module contains extension of the `param <http://ioam.github.io/param/>`_ package,
and a collection of functions that allow for powerfull filtering of sets
of :class:`.MozaikParametrized` instances based on the values of their parameters.
When parametrizing *mozaik* objects we will allow only SNumber, SIntege... |
812699f9214c1d718b9423063b06a8120358689c399f5bcd7523c4e351a9924a | Python | 25,179 | 662 | import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.data import Dataset, DataLoader
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import argparse
import pdb
import os
import sys
import scipy.io
from scipy.sparse impo... |
39b8ed2ef9353c60b83df4eb43fad0e5e67a2a737f3371d7511ccb5b21bef6de | Python | 25,180 | 673 | # -*- coding: utf-8 -*-
"""Smat home data (AI/ML algorithms) Analysis code.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1VBlRtBuVXmfFKT2sE20KTkZNuN_Nwjw0
"""
#Apply Isolation Forest algorithm on the dataset
import pandas as pd
import numpy as np
imp... |
e14534a9d18fa4c819e6649bbc5e51d9b472957270a5c91454375403e4ede8bf | Python | 25,196 | 620 | r"""Display transforms for cytometry — logicle, hyperlog, asinh, log, linear.
WHY THESE ARE WRITTEN HERE RATHER THAN WRAPPED
----------------------------------------------
Fluorescence data cannot be shown on a linear axis: after compensation a real
population sits partly BELOW zero, and a log axis cannot represent th... |
511532a2c7d0dfd0f814383541df1ebacc9437ada01ee9cd1593db090d18ae43 | Python | 25,203 | 432 | import numpy as np
def process_transitions(exp_steps, block_vector_exp_compare,
reward_vector_exp_compare,
stimulus_vector_exp_compare,
action_vector_exp_compare,
context_record, mismatch_error_record,
... |
40c17ff3ea1c05bf7ae30749ec2164a3028ced4fb7dc0bce671b008439f9279f | Python | 25,205 | 643 | import os
import math
import pandas
import numpy as np
import keras
from importlib import import_module
from sak.logger import conditional_makedir
from sak.transforms import DataAugmentationTransform
# convert series to supervised learning
def series_to_supervised(data, n_length, n_stride=1):
data = np.pad(data,(... |
d66dc68303528802df657e7f5f6db91e08f1979507d9b4bd57f95329979018d9 | Python | 25,206 | 571 | from typing import Optional, Union
import numpy as np
import pandas as pd
import networkx as nx
from tqdm import trange
# from tqdm.auto import tqdm
import math
from scanpy import AnnData
import torch
from torch import Tensor, nn
import torch.nn.functional as F
from torch import multiprocessing as mp
from functools i... |
23306d97f9283e96e77ac403d0ce123c08789504ea2751e23cbf552cb5f64771 | Python | 25,213 | 546 | from dataclasses import dataclass, field
import os
import json
import plotly.express as px
from torch import tensor
from torch.utils.data.sampler import RandomSampler
from torch.utils.data.dataset import Dataset, TensorDataset
from torch.utils.data.dataloader import DataLoader
from optuna import Trial
# from transfor... |
3e9b19d917815f875f6310a5e4839ae6c3095b985eaf2b85e0e5ddb2846e0f66 | Python | 25,215 | 611 | from argparse import Namespace
import csv
from datetime import timedelta
from functools import wraps
import logging
import math
import os
import pickle
import re
from time import time
from typing import Any, Callable, List, Tuple, Union
from sklearn.metrics import auc, mean_absolute_error, mean_squared_error, precisio... |
c2cb91808bd0fbd4748604ae0d59d5e57c97234abdf2f9a44e031f81a69a2e50 | Python | 25,226 | 708 | """
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 itertools
import json
from collections import defaultdict
from contextlib import contextmanager
... |
9c3c0de7dc7615ed5f465d1d5a5174dafcaaa893d43cd64e9b6249662890730f | Python | 25,239 | 627 | import os
import sys
from typing import Any, Dict
import pytest
import torch
import ray
from ray.dag import InputNode
from ray.exceptions import RaySystemError, RayTaskError
from ray.tests.conftest import * # noqa
if sys.platform != "linux" and sys.platform != "darwin":
pytest.skip("Skipping, requires Linux or ... |
010b765d2bd6d3fed90adad1bbe37e2fcac58178f8a763cbbb2a125137c0e3ed | Python | 25,240 | 611 | from sklearn.metrics import homogeneity_score
from sklearn.metrics import completeness_score
from sklearn.metrics import v_measure_score
from sklearn.metrics import adjusted_rand_score as ARI
from sklearn.metrics import normalized_mutual_info_score as NMI
from math import inf
import os
import logging
import anndata as ... |
3263226863079c2060707334a9f8f2fcb229cf5886bd85d387e6114fb83a65e6 | Python | 25,273 | 629 | from collections import OrderedDict
import csv
from logging import Logger
import pickle
from random import Random
from typing import List, Optional, Set, Tuple, Union
import os
from rdkit import Chem
import numpy as np
from tqdm import tqdm
from .data import MoleculeDatapoint, MoleculeDataset
from .scaffold import lo... |
9b66ad161d39252800d4f6ec0ef17a356c671cad6bc9c1ee998326bd95260787 | Python | 25,286 | 598 | ####################################################################################################
# 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... |
4927bbce62c46a50846d4575006fcd537203077f9b977a38e13628c3c91e53f8 | Python | 25,293 | 641 | import copy
import itertools
import logging
import math
import pickle
import os
import sys
import zarr
import re
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
from pprint import pformat, pprint
import glob
import pytorch_lightning as pl
import click
import numpy as np
import pandas as ... |
ff43d75999dcded52b11fec1f53e0b36ca8222659b14662e34db0a6e24361509 | Python | 25,330 | 533 | """
_*_ coding: utf-8 _*_
"""
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
import pickle as pkl
import copy
import scipy.stats
fea_dict_df = pd.read_csv('[your directory]/validation/processed_data/features_dict_PPMI.csv')
fea_dict = fea_dict_df.set_index('PPMI Codes')['Data Element... |
7b547a31fd312308ee4d12a3536b46d587f4da9ce0f2a22c588618055ba035e1 | Python | 25,338 | 467 | import os
import numpy as np
import pandas as pd
def process_and_concatenate_all_tasks(task_names, task_files, path_results):
## Define all variables
# make a copy, should be enough since the objects are strings
check_used_tasks = task_files[:]
# list of dataframes
dataframe_list = []
# d... |
715e4163945fa5649ccad938c6cc1f7eb6330cbb3322fb5c9d3fe1baa8c0f869 | Python | 25,350 | 626 | import numpy
import scipy.integrate
import bisect
from tqdm import tqdm
import operator
import matplotlib
import seaborn
from matplotlib import pyplot
from matplotlib import colors
from matplotlib import patches
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.backends.backend_pdf import PdfPages... |
6d18c5bd238da0537904610d1f27596cc4daf02cafebb3f9367f684bfff6ff32 | Python | 25,360 | 642 | import argparse
import errno
import glob
import logging
import logging.handlers
import os
import platform
import re
import shutil
import sys
import time
import traceback
from typing import Callable, List, Optional, Set
import ray._private.ray_constants as ray_constants
import ray._private.utils
from ray._private impor... |
7eab9cc409b45c9ed04d678e47feeecfa3de68cd97826ba2cf3af2a7117d8365 | Python | 25,360 | 636 | '''
Extracting data without interpolation
'''
import nibabel as nb
import numpy as np
import glob
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import os
from itertools import permutations
from scipy import signal
import re
import math
# Set derivatives directory
ROOT = '/Users/sebastian... |
3bfc4121d82e273934b4380f32666d64c65fa5b704274d1746ec48dff9845ddb | Python | 25,361 | 583 | import datetime
import os
import time
import torch
from torch.utils.data import DataLoader
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
from torch.cuda import amp
from models import spiking_resnet
from modules import neuron
import argparse
from spikingjelly.clo... |
63ac959190ef7c3b2d645ad249a0e07b8ab5d44c58c1590910867f079598b66f | Python | 25,363 | 732 | #
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# 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 ... |
f9916bdf0cbf4bd64bbda3fc7361a3ab112a24f6578a5d8c956fece2617a15d7 | Python | 25,368 | 705 | """
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.
Crystal Structure Evaluation Module
Evaluate predicted crystal structures against experimental references using:
- CSD Python API for packing ... |
4c7d4033c5c95ec54d6e2e58136b15d1c05bdc2fd7170b95f06288070b99ee78 | Python | 25,372 | 581 | #!/usr/bin/python
"""Class for computing modules on adata object."""
# Internal:
from .graph import gene_graph
from .correlation import correlation
from .auxiliary import calculate_svd_covar_corr
from .plotting import plot_umap_grid, plot_svd_corr
from .utils_multigraph import make_graphlist, partition_graphlist
impo... |
fc7c5cc571e600f5c880bf1d2e942e9f5dabb25f46a987d87e1ef22d35dffbd6 | Python | 25,380 | 685 | import os
import numpy as np
import pandas as pd
import scanpy as sc
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.pyplot import cm
from scipy.spatial.distance import cdist, euclidean
from sklearn.neighbors import NearestNeighbors
from ._starfysh import LOGGER
class ArchetypalAnalysis:
... |
a69ced8674907bee9e10e1f98da0108c9529371d521e816dc6b0650c4b253617 | Python | 25,382 | 662 | import logging
import sys
from collections import OrderedDict
from pprint import pprint
from typing import Any, Dict, List, Optional
import torch
import torch.nn as nn
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelSummary
from deeprvat.metrics import (
PearsonCorr,
PearsonCorrTor... |
de3e63171cb6c92f439ee156d123c46f41d05ab94d68752cc6c942c379bfcc25 | Python | 25,385 | 590 | import torch
from torch.optim import LBFGS
import numpy as np
from typing import Tuple, List
from convex_optim_base.optim_base import SingleUnconstrainedProblem, BatchParallelUnconstrainedProblem
class UnconstrainedSolverParams:
pass
class GradientSolverParams(UnconstrainedSolverParams):
def __init__(sel... |
ceb1c43698091e3eb5bbbf170433acf25f41428204bb39b9ed1aed7738bda020 | Python | 25,394 | 701 | """
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 re
import numpy as np
import pandas as pd
from fairchem.applications.ocx.core.voltage import ge... |
ac1e7ebd6c79753512fe3968811b67786730bb5be44889fbe3d1f1e4dd8e77e2 | Python | 25,399 | 646 |
SAVE_DIR = 'C:/Users/mmall/Documents/uni/columbia/multiclassification/saves/'
import os, sys, re
import pickle
JEFF_CODE_DIR = '/Users/wjj/Dropbox/research/analysis/repler/src/'
MATTEO_CODE_DIR = 'C:/Users/mmall/Documents/github/repler/src/'
if os.path.isdir(JEFF_CODE_DIR):
CODE_DIR = JEFF_CODE_DIR
elif os.path... |
d1df7ed08531c12fdf3904348ec413319f19b00d17e4c0411e619de66bed4bfb | Python | 25,401 | 499 | import logging
import fnmatch
import os
import time
from datetime import datetime
from agent.data.entities.config import ROOT_LOGGER_ID
from agent.classifiers.transformer_classifier import transformer_classifier
from agent.classifiers.transformer_classifier_text_trainer import train_loop as text_train_loop
from agent... |
360b5fd9041962fe1679cbdeff77277ffaee583360113e831008efd3624e44c4 | Python | 25,409 | 652 | import collections.abc
import logging
from bisect import bisect_right
from copy import deepcopy
from enum import Enum
from typing import Callable, Union, Dict, Optional, List, Tuple
import numpy as np
import torch
from ignite.engine import Engine, Events
from monai.engines import Trainer
from monai.data.utils import c... |
de8b15a92bdb12092b90f1c6f56fb9c08a2e1a821f98ab4be75da1665d02dfd8 | Python | 25,411 | 457 | import torch as th
import torch.nn as nn
from torch.nn import functional as F
from .dataloader import Dataset
from .utils import normalize, sparse_mx_to_torch_sparse_tensor, batch_func
from .trainer import set_adj
import os
import numpy as np
import matplotlib.pyplot as plt
import anndata as ad
import scvelo as scv
# ... |
ef062a4676b0aca4b717bd5ce3cb7d14a245736727aa69d42e0c72a3ff00251e | Python | 25,438 | 576 | import logging
import os
import subprocess
import time
import traceback
from threading import Thread
from typing import Any, Dict, List, Optional
import click
from ray._common.usage import usage_constants, usage_lib
from ray.autoscaler._private import subprocess_output_util as cmd_output_util
from ray.autoscaler._pri... |
f1fdde9cf9c1ed6475fa4c400724e51b7f0ad998566e1f576320d1f66a41a1e1 | Python | 25,440 | 638 | ####################################################################################################
# Copyright (c) 2020, 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 free softw... |
73f5ca8f42034d654c8df1fa29e7f2348d3b21930c69af5999304e0a58b9eec5 | Python | 25,444 | 676 | import abc
import logging
import os
import random
import shutil
import time
import urllib
import uuid
from collections import namedtuple
from typing import IO, List, Optional, Tuple, Union
import ray
from ray._private.ray_constants import DEFAULT_OBJECT_PREFIX
from ray._raylet import ObjectRef
ParsedURL = namedtuple(... |
fd17e06f79080b63b35f1e9031fba83426560cbdd54398f98ce911712f756dce | Python | 25,447 | 668 | import argparse
import logging
import math
import os
import random
from pathlib import Path
from typing import Optional
import jax
import jax.numpy as jnp
import numpy as np
import optax
import PIL
import torch
import torch.utils.checkpoint
import transformers
from flax import jax_utils
from flax.training import train... |
4649ec053eaf702d7890328e3c6ba50ba9004068383b934822ebfbb46b3fd538 | Python | 25,464 | 671 | import logging
import sys
from collections import OrderedDict
from pprint import pprint
from typing import Any, Dict, List, Optional
import torch
import torch.nn as nn
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelSummary
from deeprvat.metrics import (
PearsonCorr,
PearsonCorrTor... |
cf53dfbfa5545bf8ca728f888f475d8cc5e33122d77ad90026b2a65a921cf761 | Python | 25,474 | 768 | import logging
import pickle
import sys
import os
import re
import math
import time
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import copy
import click
import numpy as np
import pandas as pd
import yaml
from scipy.stats import beta
from scipy.sparse import spmatrix
from torch.utils.d... |
8fd1a6f02d56a398488438cd6f0fd2374f70840282b373cfae4cb9feea6df93a | Python | 25,492 | 568 | from copy import deepcopy
from typing import Callable, Literal, Optional, Union
import pyro.distributions as dist
import torch
from pyro.distributions.distribution import Distribution
from pyro.distributions.transforms import SoftplusTransform
from pyro.infer.autoguide import AutoHierarchicalNormalMessenger
from pyro.... |
00ad5b009b6e734da065b1c475a73ff5fad788a6ecd4230a074eaa67fe25ac75 | Python | 25,494 | 891 | # Look at multi-region data - ncells etc:
import glob
import h5py
from scipy import sparse
import re
from sklearn.utils import sparsefuncs
from sklearn.decomposition import IncrementalPCA
import gzip
import pickle
from inc_pca import IncPCA
import numpy as np
import pandas as pd
import time
import gc
import fbpca
# Fo... |
3e8aec1474b18c087d543a344f04b6198ac00833599797229ee2d7b4bed701ff | Python | 25,515 | 526 | import torch
from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler, random_split
import pandas as pd
import numpy as np
import os
import random
from collections import defaultdict, Counter
from itertools import combinations
import json
import torch.nn as nn
import torch.nn.functional as F
from sklearn.m... |
c8841a91e0b6848112716a4990ab818a76056d6e47e9b0c64be422f232a4ffad | Python | 25,525 | 528 | import torch
from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler, random_split
import pandas as pd
import numpy as np
import os
import random
from collections import defaultdict, Counter
from itertools import combinations
import json
import torch.nn as nn
import torch.nn.functional as F
from sklearn.m... |
1bf22aa8aabef33d7040c04ea9198f4022b7d83784386fddf91eb2b89e0309e3 | Python | 25,552 | 569 | from __future__ import print_function, unicode_literals, absolute_import, division
from six.moves import range, zip, map, reduce, filter
import numpy as np
import os
import warnings
import shutil
import datetime
from importlib import import_module
from tensorflow import __version__ as _tf_version
IS_TF_1 = _tf_versio... |
db19ed003c82cb09f1777bb1fb9ccec91c555c7339d444bf6b6643c9b5588f09 | Python | 25,562 | 631 | import sys
# sys.path.append('../baysian_neural_decoding/')
# import baysian_neural_decoding as bnd
# sys.path.remove('../baysian_neural_decoding/')
#sys.path.append('../../AL_data_analysis/')
#import AL_data_analysis as alda
#sys.path.remove('../../AL_data_analysis/')
sys.path.append('..')
from RNN_helpers import pa... |
dc52af56ec3653a28d1aeaeea2cc97140f51458b1ee94cf632bc818716ff6e2a | Python | 25,564 | 606 | # Differential celltype abundance analysis using pertpy
import scanpy as sc
from anndata import AnnData
import numpy as np
from scipy.sparse import issparse
import pandas as pd
from .._settings import EMOJI,add_reference
from .._registry import register_function
@register_function(
aliases=["差异组成分析", "DCT", "diff... |
b50a9735014c16dc689d265eca8e525bac97eedad59768f54d0d9bcb8c1d6ce8 | Python | 25,574 | 573 | import inspect
from typing import List, Optional, Tuple, Union
import torch
from torch.nn import functional as F
from transformers import CLIPTextModelWithProjection, CLIPTokenizer
from transformers.models.clip.modeling_clip import CLIPTextModelOutput
from diffusers import (
DiffusionPipeline,
ImagePipelineOu... |
7ed1cb5f12d1657aa1636d179a9e9bdbb88a0a3f8a04ff9707168d6621107207 | Python | 25,598 | 650 | from pathlib import Path
from time import time
import random
from collections import defaultdict
import argparse
import warnings
from tqdm import tqdm
import numpy as np
import torch
from Bio.PDB import PDBParser
from Bio.PDB.Polypeptide import three_to_one, is_aa
from Bio.PDB import PDBIO
from openbabel import openba... |
d6b7c7053a8f7a0cbf81022631ae3e6044995d1031edf9feba07d5dffd44fd65 | Python | 25,618 | 612 | import sys
import time
import scipy
import pandas as pd
import scanpy as sc
import numpy as np
import sklearn
from sklearn import preprocessing
import scipy.sparse as sp
from anndata import AnnData
from tqdm import tqdm
from typing import Optional
from ..._anndata_compat import as_dtype as _as_dtype
# Chromatin stru... |
831909892f90676fa106412b3953fb44824d395f74e5390ce3ef347d80052204 | Python | 25,641 | 512 | import argparse
import datetime
import json
import logging
import os
import numpy as np
import pandas as pd
import tensorflow as tf
from data_descriptions.echo import LmdbEchoStudyVideoDataDescription
from data_descriptions.wide_file import EcholabDataDescription
from echo_defines import category_dictionaries
from mo... |
43f0623f8dbed9cbad7d17a391f70d2e35133164657ec5ea0c2cc292b3553950 | Python | 25,697 | 649 | import argparse
import itertools
import math
import os
import random
from pathlib import Path
from typing import Optional
import intel_extension_for_pytorch as ipex
import numpy as np
import PIL
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerat... |
aea1fed3ee9e8c5d05b9a9167557cb9c44904747a40f2d9ae71b1922a0e91140 | Python | 25,699 | 558 | import argparse
import datetime
import pickle
import sys
import time
import numpy as np
import os
from torch.utils.data import DataLoader, Dataset
from torchnet import meter
import torch
from sklearn.model_selection import train_test_split
from model import AIMP
# from model_prefeature import AIMP
# fr... |
a7d90292589d0be2d8f435281060d541c5df1a1a04dc1831c4b0717918747958 | Python | 25,730 | 764 | # Copyright 2024 The bayesnf Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
f56e7af3a171fceea50b1bd74e41e4096960ef39b9ee2a482b13272f9b235660 | Python | 25,735 | 562 | # coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
# Copyright (c) 2022, NVIDIA CORPORATION. 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.a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.