sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
9a07ac8867166e35ae5e18bad169e843a12a1df228d62b12539f885305ac2e5e | Python | 40,832 | 1,111 | """A vector store stores embedded data and performs vector search.
One of the most common ways to store and search over unstructured data is to
embed it and store the resulting embedding vectors, and then query the store
and retrieve the data that are 'most similar' to the embedded query.
"""
from __future__ import a... |
017443fc5038101b15d9d6857f94eddea32f15475a2240e58a76d53ff0debfa6 | Python | 40,841 | 1,096 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="2"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
702f3e3bb0be9ba423f091eb0fc5c697234f63f21620c158c9f57e61447fa7c9 | Python | 40,855 | 978 | import io
import unittest
import xml.etree.ElementTree as etree
import numpy as np
import numpy.testing as np_test
from pgmpy.factors.discrete import TabularCPD
from pgmpy.models import DiscreteBayesianNetwork
from pgmpy.readwrite import XMLBeliefNetwork
class TestXBNReader(unittest.TestCase):
def setUp(self):
... |
f04032fe4cbbd7a63766df910eca008f6011ea346329d0ca75ab5a0286a08e1a | Python | 40,938 | 969 | from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import logging
import math
import os
import shutil
import tarfile
import tempfile
import sys
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import CrossEntropyLoss
from model.utils import ca... |
378c1f7e045975f567c494fc7160c3c1abdc42856e7d277a79e5bf5a012f53c2 | Python | 40,967 | 1,196 | # Copyright (c) 2023 Shihao Ma, Haotian Cui, WangLab @ U of T
# inference and visualization
from io import StringIO
import os
import shutil
import sys
import yaml
import numpy as np
import pandas as pd
from datetime import datetime
import torch
from torch import nn
import torch.nn.functional as F
from torch.utils.ten... |
4c35bc4409039493c1f43e112896e0c29f21b4693389ea7cb17b537c4d5dcfe9 | Python | 41,001 | 1,070 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
3ddf3684271b135b4770d490907c93120412999111330fdeff5adb619080f625 | Python | 41,057 | 1,096 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="2"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
70baa567bd8d458678247071b6fc27c9a87de6af58bcf130e2881f15695fe6fe | Python | 41,083 | 1,075 | #******************************************************************************
# TTFontFile class
#
# This class is based on The ReportLab Open Source PDF library
... |
c6c2368c91a5d8384dedc1c1dbdbdc4cfedd32955228709ec658ebc15959380b | Python | 41,097 | 1,056 | """A de novo peptide sequencing model."""
import collections
import heapq
import logging
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
import depthcharge.masses
import einops
import torch
import numpy as np
import lightning.pytorch as pl
from torch.utils.tensorboard import SummaryWriter
from dep... |
7e84a3feeb8884db3af109a7ef1a48d30f99e1d7c2975346057f004f8427f1e9 | Python | 41,283 | 1,160 | # -*- coding: utf-8 -*-
import os
from pathlib import Path
from typing import Sequence, Union, Mapping, List, Optional # , Callable
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import scanpy as sc
from scipy import sparse
import torch
import logging
from . import (... |
1c5475b635d0c1072daf366924dc1a8b409edab5584ce7056a0bd85c64daa5f5 | Python | 41,292 | 1,000 | """Program for assessing mice in the piPaw cage with the amplitude methodology.
The main criteria for reward in this version is the amplitude of the pull
(i.e. the maximum position of the lever during the trial). This testing
methodology consists of two training phases followed by a testing phase
and an optional re... |
9929464479435b295975de6207e38de60d209380eab26a78cc940e484bce2d94 | Python | 41,305 | 1,164 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 20 20:11:08 2021
@author: Xingyan Liu
"""
import os
from pathlib import Path
from typing import Sequence, Union, Mapping, List, Optional # , Callable
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import scanpy as sc
fr... |
71e94814e678e85e4add6ef2cdb47cc3149c809f080edee07b8aae2df34eb6f8 | Python | 41,449 | 1,187 | from typing import Union
import yaml
import os
import numpy
import pandas
import matplotlib.pyplot as plt
import networkx as nx
from fractions import Fraction
def convert_fractions(item):
if isinstance(item, str) and '/' in item:
try:
return float(Fraction(item))
except ValueError:
... |
3e9f18b21477c17b4afa3ce5272de261f54f92a3377afccee9af5d12a51f822e | Python | 41,500 | 1,338 | # Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
5fd4f3f10d6625e7dbafee552843aae6a7001a6a37955448675ee073295a7bcb | Python | 41,548 | 1,146 | '''
Counts.py - methods for manipulating counts data frames
==========================================================
:Tags: Python
Utility functions for dealing with counts data frames
Requirements:
Code
----
'''
import cgatcore.experiment as E
import cgatcore.iotools as iotools
import pandas as pd
from rpy2.rob... |
65d3f88052e4f30423880935f0e433b65fbbb2e43e22cbdffa4092f70116af97 | Python | 41,637 | 959 | import tensorflow as tf
import numpy as np
from utils.ProcessData import get_maxDims, gen_smiles2graph
from sklearn.neighbors import KernelDensity
from sklearn.utils import gen_batches
from utils.TestModel import perform_validation, perform_validationPPB, perform_validationCL, perform_validation_class, perform_validati... |
3344a5b658c1ea0602e4f4e5e74f1abd032e5aa0c7104b5420eae23a373dd108 | Python | 41,650 | 860 | from KineticAssembly_AD.vectorized_rxn_net import VectorizedRxnNet
from KineticAssembly_AD import ReactionNetwork
import numpy as np
from torch import DoubleTensor as Tensor
from torch.nn import functional as F
import torch
import pandas as pd
from matplotlib import pyplot as plt
import matplotlib.colors as mcolors
im... |
b0b0fd6b4425e202e931f7d945466d6c598f9148d37f347a626ba7dff067699e | Python | 41,667 | 744 | import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Lambda
from .skeletons import TwoDofArm, PointMass
from .muscles import CompliantTendonHillMuscle, ReluMuscle
from typing import Union
class Plant:
"""Base class for `Plant` objects.
Args:
skeleton: A :class:`motornet.plan... |
d8bc6f85b241153fbcb87f652ae46184a0fcfba7b375fb04c56546a8ec1fa45e | Python | 41,703 | 994 | # flake8: noqa
"""
Tools for generating library of substructures from the Chemical Component
Dictionary (CCD).
"""
import copy
import json
from collections import OrderedDict, defaultdict
from copy import deepcopy
import rdkit
from CifFile import ReadCif
from openff.units.elements import SYMBOLS
from rdkit import Che... |
5b188d9e1c3ad4ae2643f8999864d3c2674a33217e53fbd0ecabb02f3ccdd159 | Python | 41,707 | 1,099 | # Copyright 2024 DeepMind Technologies Limited
#
# AlphaFold 3 source code is 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... |
382c65936f264e4f69f74655e075556408430d3938934044c0da73dd3cee9bc6 | Python | 41,769 | 1,044 | """Human in the loop middleware."""
from __future__ import annotations
import json
from dataclasses import replace
from typing import (
TYPE_CHECKING,
Annotated,
Any,
Literal,
Protocol,
Union,
cast,
get_args,
)
from langchain_core.messages import AIMessage, ToolCall, ToolMessage
from ... |
b93351bed0189994f5f826b92d9aa9b21d97fd0b8e5f387ba77c9b3f3eefdaeb | Python | 41,772 | 915 | import json
import model_learner as model
import numpy as np
import os
import os.path as op
import pandas as pd
import pickle
# Make sure that the current working directory is set to the root directory of the repository,
# add it to the search path for modules if necessary, and make sure that the data folder can be fo... |
cdf91efffbfd73df03d53b04f2b65c539574d9abababe1977eddaf4e59792b7b | Python | 41,814 | 973 | """
Defines model classes to store embedding data in both high-dimensional and
dimensionally-reduced spaces.
"""
import numpy as np
import pandas as pd
from sklearn.metrics.pairwise import cosine_distances, euclidean_distances
from sklearn.neighbors import NearestNeighbors
from sklearn.manifold import TSNE
from sklear... |
131bfd55e14facbba9b8d1da1b8e573f9edbf1b63df6e082b2a41fb5f95e88e0 | Python | 41,824 | 1,266 | from copy import deepcopy
from functools import partial
from pathlib import Path
from datetime import datetime as dt
import json
from rich.console import Console
from rich.table import Table
from rich.pretty import Pretty
from tqdm import tqdm
import numpy as np
import pandas as pd
from siuba import _ as s
from siub... |
8aab2950d86b81072edef098f24b3447694568a478ad4102eb3c6ee9d25d2f06 | Python | 41,871 | 1,091 | #!/usr/bin/python
#############################################################################
#Package: stamp
#Updated by Yiqin Wang
#Usage:
#
#
##############################################################################
import sys, os
from argparse import ArgumentParser
#basic file readers and parsers
from Seq... |
c14830768be9d7348c63e9736b36204bbb494c96b1ae90ef6a2dda75e562b6c1 | Python | 41,929 | 699 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This file define the KINNTREX class that include
Parameters:
cLSV_W: Weight matrix multiplying left singular vectors data to get the
intermediates DED maps.
Conc_W: Weights matrix multiplying the intermedates DED layer to reca... |
9cfa8a25a7d195ed53426c558627e6065aa96e15ed402ffe64c904d22b625b59 | Python | 42,010 | 1,107 | # Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
d17bc9c327535bb1ad9e0c1c8e373c389134314e9def339ddaccb164df068d5d | Python | 42,045 | 1,068 | # This script is part of pymaid (http://www.github.com/navis-org/pymaid).
# Copyright (C) 2017 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of ... |
0534462a62cbe8c8fb862a021f82b04328bc187bd084baa9557b4c2943186ec9 | Python | 42,079 | 1,035 | # Import MKL for multi threading
try:
import mkl
# Set number of thrads to use
mkl.set_num_threads(4)
except:
print("MKL not found, please pip install for best performance.")
import numpy as numx
from os.path import isfile
import sys, os
# Needed to load existing files, otherwise modules structure is n... |
69996adc54a83187fec0f9c486f7680a9ec80693167bec36dc6de915099bb223 | Python | 42,291 | 1,089 | """Derivations of standard content blocks from OpenAI content."""
from __future__ import annotations
import json
import warnings
from typing import TYPE_CHECKING, Any, Literal, cast
from langchain_core.language_models._utils import (
_parse_data_uri,
is_openai_data_block,
)
from langchain_core.messages impor... |
0437317c90b9cfa7c3106eddc95e7c6a436ef240b5a7f03c2a654188beeeb9e6 | Python | 42,338 | 1,021 | # library of convenience plotting funcs that are used for making various plots for all optical photostimulation/imaging experiments
# imports
import os
from typing import Union
import mpl_point_clicker
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import tifffile as t... |
e1f33843a1341c174583f3c055357543c159336ec0df0b00b24518c3441c3684 | Python | 42,375 | 1,285 | """
====================
MeDIP-Seq pipeline
====================
:Author: David Sims
:Release: $Id$
:Date: |today|
:Tags: Python
1. Align to genome using gapped alignment (BWA)
2. Calculate alignment and coverage statistics (BAMStats)
3. Identify differentially methylated regions (DMRs)
4. Filter DMRs
... |
b1455233513c4823399830b062dcef83e48350b3518cac3d553cc5d9ab2e3013 | Python | 42,409 | 1,488 | """Standard, multimodal content blocks for Large Language Model I/O.
This module provides standardized data structures for representing inputs to and outputs
from LLMs. The core abstraction is the **Content Block**, a `TypedDict`.
**Rationale**
Different LLM providers use distinct and incompatible API schemas. This ... |
5b3be9392760250a757fb899b4eab54ff9cadf8c85a026a4bdbd9d16ea923079 | Python | 42,412 | 1,547 | from collections.abc import AsyncIterator, Iterable, Iterator, Sequence
from datetime import datetime, timezone
from typing import (
Any,
)
from unittest.mock import patch
import pytest
import pytest_asyncio
from langchain_core.document_loaders import BaseLoader
from langchain_core.documents import Document
from l... |
3ac02751beb77c800133821dad0b4a1443c428a182acd8e322e3f32173c5d19c | Python | 42,441 | 1,147 | # Copyright (C) 2017 Philipp Schlegel
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program... |
814957f25f71e3ec7c9a43bc85debfa5cfd2f1f011e7a7cb0125f06943ef7d77 | Python | 42,448 | 1,106 | import torch
import numpy as np
import matplotlib.pyplot as plt
from functools import reduce
from copy import deepcopy
from torch.optim import Optimizer
def is_legal(v):
"""
Checks that tensor is not NaN or Inf.
Inputs:
v (tensor): tensor to be checked
"""
legal = not torch.isnan(v).any(... |
8056b1a1101dee47ae7d4e2ba63c9c7a93aebd61fc7ac853a2551ba3ec73f111 | Python | 42,515 | 998 | #!/usr/bin/env python3
import argparse
import pandas as pd
import json
import os
import subprocess
import re
from pathlib import Path
from collections import defaultdict
from google.cloud import storage
from typing import Any
class ConfigSummaryTracker:
"""Track summary statistics for each config file"""
def... |
d8e21746d09dc6c36067cc89bc07bafecfb6321b43ac0375fd6a9c1964958356 | Python | 42,550 | 1,023 | from io import open
import json
import logging
from hashlib import sha256
from pathlib import Path
import os
import shutil
import sys
import tempfile
from urllib.parse import urlparse
from functools import partial, wraps
import boto3
import requests
from botocore.exceptions import ClientError
from tqdm import tqdm
fro... |
0f5eb222a175a400bb8f3983a8a1fc0b0bc8cd92ca3077feac77cc317d253404 | Python | 42,622 | 1,281 | """Tests for ChatModelStream, AsyncChatModelStream, and projections."""
from __future__ import annotations
import asyncio
from typing import TYPE_CHECKING, Any, cast
import pytest
from typing_extensions import assert_type
from langchain_core.language_models.chat_model_stream import (
AsyncChatModelStream,
A... |
f792c91d197fa5d41fb7c461200b06963de048a95a1b409f38b3c233d7781d03 | Python | 42,665 | 1,120 | # Copyright Generate Biomedicines, Inc.
#
# 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 ... |
a32ebb0395d2c086cc98a7f268191097ff7c1cf7b3f23d3031f5b1070fb24080 | Python | 42,690 | 803 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
cf62e25dfff0d68a017b40b996447bddd33545a10774f4ec06774fc21c771f16 | Python | 42,838 | 805 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
da54142fafcf3f3ea95dc35c16c4ebabafbae0ef019339f5a50d2b6ed9fb244a | Python | 42,854 | 1,057 | # This script is part of pymaid (http://www.github.com/navis-org/pymaid).
# Copyright (C) 2017 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of ... |
ac4898512d8f7afdac8c70dae9fa76cc96758b25eca79c7c5442da7f0b5d171e | Python | 42,909 | 1,117 | #!/usr/bin/env python2.7
"""Marks/removes PCR introduced duplicate molecules based on the molecular tagging
technology used in NuGEN products.
For SINGLE END reads, duplicates are marked if they fulfill the following
criteria: a) start at the same genomic coordinate b) have the same strand
orientation c) have the same... |
a17ca5c5560b9feefaf891dc826dcc50ac07f782c299c0ab9ac63fa94c669743 | Python | 42,943 | 1,348 | """====================
rrbs pipeline
====================
######## UPDATE THIS SECTION ############
(See the readqc pipeline for details of the readqc functions
(target ``readqc``).)
The purpose of this pipeline is to pre-process reads (target ``full``).
Implemented tasks are:
* :meth:`removeContaminants` - r... |
54fadf4ccc3e9199e8cdb368c1e68aff63dacd6c1d9ca94ac07d541e36305349 | Python | 42,950 | 1,123 | # Copyright (c) DP Technology.
# 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.
"""
Train a network across multiple GPUs.
"""
import contextlib
import logging
import os
import sys
import tim... |
137b1a1e5e8e58f1d9efa93001fac8dbb096f516dbc9bad212f2f6e15dd8436f | Python | 43,167 | 1,038 | ################################################
# A lot of this code is taken from Mike.
# Thanks Mike!!
################################################
import sys
sys.path.append('/home/dlteif/mri-surv-dev/')
sys.path.append('/home/dlteif/mri-surv-dev/mri_surv/')
import pandas as pd
import re
import os
import n... |
8bfe64f3b202293e4e50da7cbb0cfb88f5975235dad2ed0568de9d7ec482298a | Python | 43,193 | 794 | import traceback
from concurrent.futures import Future
from concurrent.futures import ThreadPoolExecutor
import time
import datetime
from pycromanager.acquisition.acq_eng_py.main.acquisition_event import AcquisitionEvent
from pycromanager.acquisition.acq_eng_py.main.acq_eng_metadata import AcqEngMetadata
from pycroman... |
e26eb37786ec2e075a8132b8f136595124f1f8cb8154fcfd2cc3658553cf2593 | Python | 43,315 | 949 | ''' Test module for RBM models.
:Version:
1.1.0
:Date:
12.04.2017
:Author:
Jan Melchior
:Contact:
JanMelchior@gmx.de
:License:
Copyright (C) 2017 Jan Melchior
This file is part of the Python library PyDeep.
PyDeep is free softwa... |
195a1901685b4412f5786ceefc76d5ad982167da5e3c7a073837a4a0dd5825dd | Python | 43,357 | 852 | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this sof... |
0e2593d983b0fefebb856331a86bfc4560b1bcd9429f32731a8c8c8063a8fb9c | Python | 43,359 | 810 | import torch
from torch.nn import functional as F
import numpy as np
import matplotlib.pyplot as plt
import psutil
from KineticAssembly_AD import VecSim
from KineticAssembly_AD import VectorizedRxnNet
from torch.optim.lr_scheduler import StepLR
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.optim.lr_... |
4fc19f963a0fd713624b7e2806ef368f1fdab844d0ef48adcfcffd4d3736ce4b | Python | 43,403 | 1,184 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
f4608486aaebcd19f084d39d18edae5c2b860b59be796f9d8b4ea6214e639a40 | Python | 43,411 | 1,108 | # Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
163e9dbf7418e7cb883cdf75928a284a0ff074e3a0d5cf2a31c43b286b0a47ee | Python | 43,532 | 1,229 | '''==============================
Long non-coding RNA pipeline
==============================
Overview
========
The pipeline_rnaseqLncRNA.py pipeline aims to predict lncRNAs from an ab initio
assembly of transcripts.
It requires that raw reads have been mapped to a reference
transcriptome and assembled into transcr... |
ea54dbac2a880ea43800f032976370aa999fc96fbb9c8a43f1c793ab0685c14a | Python | 43,587 | 1,153 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="2"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
1c761c168c53a6b29ad64cc750a37229f696a0a6127796d2ebd5528f7fcdeda8 | Python | 43,591 | 941 | import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.optim import lr_scheduler
import numpy as np
###############################################################################
# Helper Functions
###############################################################################
from u... |
8b9e905866e968094bd2a824e63607c17c920f8728e1fb3372181807e8351458 | Python | 43,670 | 1,329 | """Unit tests for agents."""
import asyncio
import json
import operator
from functools import reduce
from itertools import cycle
from typing import Any, cast
from langchain_core.agents import (
AgentAction,
AgentFinish,
AgentStep,
)
from langchain_core.callbacks.manager import CallbackManagerForLLMRun
fro... |
757316423a5b1f95b14b1ebaac56e612af026bb50f06c1748e688e65a8a17b67 | Python | 43,820 | 1,079 | """Factory functions for chat models."""
from __future__ import annotations
import functools
import importlib
import warnings
from typing import (
TYPE_CHECKING,
Any,
Literal,
TypeAlias,
cast,
overload,
)
from langchain_core.language_models import BaseChatModel, LanguageModelInput
from langch... |
56f4bfce8303cfe5c965347e5a0407245b55eb4a16cae64973003a020c2b49d7 | Python | 43,869 | 828 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
6e987607aad1e79a434234f9605fdec5ba52946791dd1bedaf8a6641b67f2386 | Python | 43,872 | 1,189 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="3"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
4d1ec18bf712db669774d556573ecb6a3027b650adef69c5d45c9a7effdf9c95 | Python | 43,887 | 1,046 | """Summarization middleware."""
import logging
import uuid
import warnings
from collections.abc import Callable, Coroutine, Iterable, Mapping
from functools import partial
from typing import Any, Literal, TypedDict, cast
from langchain_core.exceptions import ContextOverflowError
from langchain_core.messages import (
... |
74083a7a95124df2f25a6c2249d0c2214ed07326bd6a824c9eecfc257bdc4a97 | Python | 43,991 | 1,193 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
0ecb9e229efb67d2643312d39f947e5e73b37693d4ddbc31c73d12971fcc2b2e | Python | 44,008 | 1,084 | """
Use Pytorch neural network to predict reflectance from cell classifications
"""
from numpy import ndarray
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler, MinMaxScaler, LabelEncoder, OneHotEncoder
import torch
from torch import nn
from tqdm import tqdm
import copy
import seaborn ... |
88177a8db8017e0e3493905d575961e56306e8a2a20124b4185b85b4724e6738 | Python | 44,072 | 1,206 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
d209b67faac9a2ef522203376c5a9206531adf3bb9148fc92cd754b966af8b9d | Python | 44,076 | 1,206 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
fd12a274918de4e2ba921c3e7e464ebbd2db9b2720aa466e3a2fd5ad6356c147 | Python | 44,083 | 1,206 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="2"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
236a98f060ae0b4b4d5beea4a09be49b1240154c81b0fd0b6bf81c8f8853fca7 | Python | 44,255 | 1,195 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
e1dfc60dd8cb747973569537eca792001c472af0ad3ce78c112d1a238718d544 | Python | 44,362 | 732 | from __future__ import absolute_import
from perses.utils.openeye import createOEMolFromSDF, extractPositionsFromOEMol
from perses.annihilation.relative import HybridTopologyFactory, RepartitionedHybridTopologyFactory, RESTCapableHybridTopologyFactory
from perses.rjmc.topology_proposal import PointMutationEngine
from p... |
1b1720d25091cecac3bbda878005abc1a0b68344a44c3c807e8e1a7c8ad3499d | Python | 44,380 | 732 | from __future__ import absolute_import
from perses.utils.openeye import createOEMolFromSDF, extractPositionsFromOEMol
from perses.annihilation.relative import HybridTopologyFactory, RepartitionedHybridTopologyFactory, RESTCapableHybridTopologyFactory
from perses.rjmc.topology_proposal import PointMutationEngine
from p... |
d1601d73116e21e03b0edbceb91013f1f3d08ff2f08bc7dd8c85037683e065b1 | Python | 44,410 | 1,154 | import logging
import time
from pathlib import Path
from typing import Literal, Union
import humanize
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from matplotlib import pyplot as plt
from sklearn.model_selection import train_test_split
from torch.nn.utils.rnn import pad_packed_seq... |
c95aa4f426708a7f211ee54a2f0aa27d07c84cae3f914fbbe2d8b0a5e3b05399 | Python | 44,429 | 1,173 | from __future__ import annotations
import logging
import warnings
from functools import partial
from typing import TYPE_CHECKING
import anndata
import joblib
import numpy as np
import pandas as pd
import torch
from anndata import AnnData
from rich import print
from scvi import REGISTRY_KEYS, settings
from scvi.data ... |
fd9e2d4bc3834a891b1d8f0e84db2997c9813e00ad609872af37f9f06e8c648d | Python | 44,434 | 910 | """the actual pipeline: register -> harmonize -> analyze.
glues together registration, clipping, remesh, craniometrics and asymmetry,
same steps as the old gui_methods.py register/cranial_cut/facial_clip/
craniometrics/calculate_asymmetry did, just as plain functions that pass
meshes around in memory - no disk round-t... |
f611b5d62752044ff521ba178a8bd91ce37bf2b3fb410d12ed2c6ddeb85648f0 | Python | 44,507 | 1,260 | import inspect
import json
import warnings
from typing import Any
import pytest
from pydantic import BaseModel, ConfigDict, Field, SecretStr
from pydantic.fields import FieldInfo
from pydantic_core import PydanticUndefined
from langchain_core._api import LangChainDeprecationWarning
from langchain_core._api.deprecatio... |
9789e9b95b164bcb8b82c75e69053ea60740e724ce343c51ce1eaff3aef607bc | Python | 44,587 | 1,234 | """
======================
Exome Cancer pipeline
======================
.. todo::
*Final filtering if SNPs/INDELs is currently done in the
reporting. This should be handled by the pipeline. The SNP output
would also then be passed to the mutational signature task
*Document
*fully make phone home/key o... |
beecc6c0e644c369dfe92181f41b6eeb2869e0c5442b7273a157ae4dac28446f | Python | 44,613 | 1,233 | import re
import os
import copy
import pandas as pd
import cgatcore.iotools as iotools
import sqlite3
import rpy2.robjects as robjects
import rpy2.interactive as r
import rpy2.interactive.packages
import scipy.stats as stats
from cgatcore.pipeline import cluster_runnable
import cgatcore.experiment as E
import ast as as... |
1c7cbdf9aabb04851ce79347b1401ca9b26c66bfd0150c97eb94dbd7f76783ba | Python | 44,619 | 1,122 | # Copyright Generate Biomedicines, Inc.
#
# 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 ... |
65dc0aace6eea571f3daeb4e4f4823138dc56391bdad95f908b36f0b73b097a7 | Python | 44,633 | 1,054 | import numpy as numx
from scipy.signal import convolve2d
import pydeep.base.numpyextension as numxExt
from pydeep.base.activationfunction import Sigmoid
from sklearn.linear_model import LogisticRegression
class Weight_layer(object):
''' This class implements a weight layer that connects one unit
layer to ... |
06d1eeb864df213ac1d9104758e4ddb5a07bfd060b35ed62113fe046abcf8aec | Python | 44,719 | 930 | #!/usr/bin/python3
import matplotlib
from bernn.utils.pool_metrics import log_pool_metrics
matplotlib.use('Agg')
CUDA_VISIBLE_DEVICES = ""
import uuid
import shutil
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import random
import json
import copy
import torch
from torch import nn
import os... |
14126a5e59973adfa48d4165bb722d7569df7375da67e744ccbb02a9962eedcc | Python | 44,746 | 1,207 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
12791442514ebd24683f4553d3e0adf08c5c2597c4508e2d35eeba9d5c2f7184 | Python | 44,751 | 1,207 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
a386c6cad863987632305bd6330d8abad41f40c8078128d7e5b8796508ac2d76 | Python | 44,792 | 1,214 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
42aadf13b317112e72f0ed3fec1a137a5f4c4bb643a1022a4a7fbd29576ffc36 | Python | 44,835 | 955 | import simtk.openmm as openmm
import openmmtools.cache as cache
import os
import copy
import openmmtools.mcmc as mcmc
from openmmtools import cache
import openmmtools.integrators as integrators
import openmmtools.states as states
import numpy as np
import mdtraj as md
from perses.annihilation.relative import HybridTop... |
581864bcce8318dbcaa4b0b5be41c43f7b9ad7c027bf779c319bb46b3995cdb3 | Python | 44,872 | 1,218 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
04ad84e0fce614f4d556687d4844d953a488d807897a10d24ae9c41a58f96785 | Python | 44,875 | 1,225 | """
Tests for the RQA2_ml class.
Covers: build_feature_table, supervised_benchmark, nested_cv_benchmark,
surrogate_baseline, compare_scores, feature_importance,
unsupervised_benchmark (enhanced), cluster_stability,
and all visualisation helpers.
"""
from SMdRQA.RQA2 import RQA2, RQA2_ml
import... |
c7be43c7c12d9c7b3ab1522d003126179fcfbb9dff475b26264e07b243fed721 | Python | 44,879 | 1,218 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="2"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
cea6ee61ed77531712b26f850e3c60c127cd8eaab6706b12d9258b62c93d327e | Python | 44,879 | 956 | import simtk.openmm as openmm
import openmmtools.cache as cache
import os
import copy
import openmmtools.mcmc as mcmc
from openmmtools import cache
import openmmtools.integrators as integrators
import openmmtools.states as states
import numpy as np
import mdtraj as md
from perses.annihilation.relative import HybridTop... |
ec159dc804d8fa99f4bbf466b548262a01267b1bf3ff7ead263ef80baddeb28f | Python | 44,923 | 1,218 |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
import sys
sys.path.insert(0,"/examples")
from modulusDL.models.arch import (
CustomModuleArch,
FullyConnectedFlexiLayerSizeArch,
CaseIDtoFeatureArch,
CaseIDArch,
FixedFeatureArch,
MaxPoolArch,
MatrixMultiplicationArch,
SumMultiplication... |
1e103a8c9f5353f0817623e821a57f15bbbc8eaa0a2f7974787594fa0e21d3c2 | Python | 44,965 | 1,512 | """
=========================
Benchmark: RNASeq-Mapping
=========================
:Author: Andreas Heger, Nicholas Ilott
:Release: $Id$
:Date: |today|
:Tags: Python
This pipeline takes one or more fastq formatted file from an RNASeq experiment
and rus various mappers on it. The focus is here on sensitivity versus spe... |
14c3216c12470a99466c9e02a075cb97ff981ff469ff182e351c45484280cd33 | Python | 45,102 | 960 | #!/usr/bin/env python
# Imports
import math
import unittest
import os.path
import sys
import subprocess
import tempfile
import filecmp
from itertools import chain
path_to_script = os.path.join(os.path.dirname(os.path.realpath(__file__)),'..','bin','enrichm')
path_to_data = os.path.join(os.path.dirname(os.path.realpath... |
074e26dae8f5bb933903aa454e81e993f8c1e2955e75506698302b82aa79ff4c | Python | 45,122 | 1,093 | from distributed import LocalCluster, Client
from dask import delayed
import tqdm
from dask.distributed import as_completed
import logging
import joblib
import networkx
import pandas
from fractions import Fraction
import numpy
import os
import sys
import copy
import pathlib
import dask.dataframe as dd
#from joblib imp... |
fce82402a1df1791466aea8006c36f27081739db31a43e293152956995095288 | Python | 45,132 | 1,550 | '''
Stats.py - statistical utility functions
========================================
:Tags: Python
Code
----
'''
import math
import numpy
import scipy
import scipy.stats
import scipy.interpolate
import collections
from functools import reduce
def getSignificance(pvalue, thresholds=[0.05, 0.01, 0.001]):
"""ret... |
2c960cf01b869770b0786d9bf961948d0acb82fab5833036cfcdd2a73dd23516 | Python | 45,190 | 1,036 | """
Samplers for perses automated molecular design.
TODO
----
* Determine where `System` object should be stored: In `SamplerState` or in `Thermodynamic State`, or both, or neither?
* Can we create a generalized, extensible `SamplerState` that also stores chemical/thermodynamic state information?
* Can we create a gen... |
58a9915c1d9094eaab296358581c4d7c0fc2410218fc4647ab12587705921f77 | Python | 45,196 | 1,037 | """
Samplers for perses automated molecular design.
TODO
----
* Determine where `System` object should be stored: In `SamplerState` or in `Thermodynamic State`, or both, or neither?
* Can we create a generalized, extensible `SamplerState` that also stores chemical/thermodynamic state information?
* Can we create a gen... |
26c5cbe5275fa7b9cab5a02fdcaf4cb9282746ae201dec607b8df1ba3b6cb923 | Python | 45,234 | 903 | import random
import numpy as np
import torch
from torch import nn, cuda
from torch.nn.parallel import DataParallel
from torch.utils.data import TensorDataset, DataLoader, Dataset
from torch.utils.data.sampler import WeightedRandomSampler, Sampler
from torch.optim.lr_scheduler import CosineAnnealingLR, CosineAnnealingW... |
d9c21558e366753c7d72af5287bfeae2b466bac5323882f875b826a72e9efb15 | Python | 45,323 | 1,067 | """
Lightning module: conditional flow matching or Schrödinger-bridge (Gaussian) training on
GTO coefficients (SAD -> ground truth).
Requires ``gt_coeffs`` on the batch. ``bridge_mode`` selects ``cfm`` (linear bridge) or ``sb``
(Gaussian bridge score). On CFM, ``flow_loss_mode`` selects direct velocity matching or
QHF... |
3119e3e0807872f0a03076460b2593da0c05d8cb174cd35cead9778b63745503 | Python | 45,324 | 1,296 | # -*- coding: utf-8 -*-
# author: Felix Repp felix.repp@mpikg.mpg.de
# !/usr/bin/env python
import os
import numpy as np
import pdb
import networkx as nx
from scipy.interpolate import splprep, splev
import tina_main
import tinaskel
import lib
import sys
"""@package tinanet
%This module provides the tools work with the ... |
39cb08bc8266200dba2698fa155380607130eb8a3a9589ec6e49e3a2f4c1ab59 | Python | 45,342 | 1,278 | """
exome.py - Tasks for variant calling
============================================
Reference
---------
"""
# Import modules
import os
import cgatcore.iotools as iotools
from cgatcore import pipeline as P
import cgatcore.experiment as E
from cgatcore.pipeline import cluster_runnable
import numpy as np
import pandas... |
b197b00906ea8945db6d6333c00140f54414bbf9f3db392595fe51402f8e0f5a | Python | 45,370 | 903 | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
f3e0bdf6a97f21b029f89a0e437fabcb610d31ab2c8a9c2f6c488d1f9f084385 | Python | 45,477 | 1,303 | from __future__ import annotations
import asyncio
import concurrent.futures
import json
import sys
import threading
import uuid
from inspect import isasyncgenfunction
from typing import TYPE_CHECKING, Any, Literal
from unittest.mock import MagicMock, patch
import pytest
from langsmith import Client, RunTree, get_curr... |
4e2b3858351fbee0e316e1851297f500ea40fc62c983d7516cad167dfabeaccf | Python | 45,513 | 1,448 | # Copyright 2021 AlQuraishi Laboratory
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.