sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
cb25ae1ac45ec5f856e0a2d39d17e95bcfd76120b9c28bb4cecba419847ea2df | Python | 794 | 27 | from .report_metrics import reportMetrics
from .choose_binary_threshold import chooseBinaryThreshold
from .metrics import roc_curve, precision_recall_curve, auc, balanced_accuracy_score
from .metrics import recall_score, precision_score, jaccard_score, f1_score, accuracy_score
from .metrics import auprc, auroc, brier_s... |
07f17130e5038d1c90b7b29a1821a6bbf1820ab011ba472b7e4342cf1abd5d97 | Python | 795 | 31 | from pycromanager import _Bridge
from pycromanager import JavaBackendAcquisition, multi_d_acquisition_events
def img_process_fn(image, metadata):
# modify the pixels by setting a 100 pixel square at the top left to 0
image[:100, :100] = 0
# propogate the image and metadata to the default viewer and sav... |
2cbb3ec7076bdec7319a450d1d13932b17c007bed3e20221fb6651a731218e3d | Python | 795 | 29 | from pycromanager import JavaBackendAcquisition, multi_d_acquisition_events
import numpy as np
# this hook function can control the micro-manager core
def img_process_fn(image, metadata, bridge, event_queue):
if not hasattr(img_process_fn, "counter"):
img_process_fn.counter = 0
if img_process_fn.cou... |
430ee5c7a4a12003345be1b6890594b824f42b9f49e248e32272da47369f3980 | Python | 796 | 31 | import os
import os.path as osp
import yaml
def _check_dir(dir, make_dir=True):
if not osp.exists(dir):
if make_dir:
print('Create directory {}'.format(dir))
os.mkdir(dir)
else:
raise Exception('Directory not exist: {}'.format(dir))
def get_train_config(config... |
c842e3e893d898422c3d1495ba54c4192e7b3def00bcb522fd4a3aad64f637ae | Python | 796 | 27 | import numpy as np
from PIL import Image
import os
from skimage.measure import label
"""
Generate tif mask files from the npy fil of Panuke dataset
"""
folder = "/home/cazorla/Images/Panuke/Part 1/Masks"
# Charger le fichier npy
data = np.load(os.path.join(folder, "masks.npy"))
# Boucle pour enregistrer chaque masq... |
daee21649852e26a058488b5d2b784391afb6b56142020d0ce6952c4904a73cb | Python | 796 | 29 | from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from .data import do_index
import base64
from io import BytesIO
import json
def index(request):
return render(request, 'example.html', {})
def display(request):
print('Got request')
data = {'err': False}
index = i... |
280d27e01bdb55a316bd4010c11d2f9eca792f3b4e56f862d69331213079ae94 | Python | 797 | 15 | # BASELINE WANDER EXTRACTION
# function for baseline wander extraction. Based on a moving average (MA) and median (MD) filter.
# the original signal is filtered with a MA filter, then with a MD filter, obtaining the baselinewonder.
# the filtered signal is the difference between the original signal and the double filte... |
463af28b7a5da3b29ba6cd4a6111a1bf677bc1063787cc233b56d6033a65e9bf | Python | 797 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import ReadFileTool
from langchain_community.tools.file_management.read import ReadFileInput
# Create a way to dynamically look up deprecated imports.
# Used to consolidat... |
8a3c9ab9723273447714f9f92387e99f120a1ebf49398a444ce21cf8d245e669 | Python | 797 | 13 | """
This package contains all the components that are used to construct system identification models.
This includes:
- cores: Modules used for extracting nonlinearly computed features shared among neurons.
- readouts: Linear layers added on top of the core output to predict neurons' responses.
- encoders: Classes... |
d41911a787b55bbc43284fe3bc65a6de7b7d3a782a72c39df049e19ec076afe6 | Python | 797 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import MoveFileTool
from langchain_community.tools.file_management.move import FileMoveInput
# Create a way to dynamically look up deprecated imports.
# Used to consolidat... |
e5ddbe380392c5258869c9b2bb019f3a7ac8e95d1d4a9167e3ef9a538f22a037 | Python | 797 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import CopyFileTool
from langchain_community.tools.file_management.copy import FileCopyInput
# Create a way to dynamically look up deprecated imports.
# Used to consolidat... |
f60d22f7693eb6b1265a7925d631ecbdf92552695cb7692b8e065ad096407020 | Python | 797 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.vectorstores import Neo4jVector
from langchain_community.vectorstores.neo4j_vector import SearchType
# Create a way to dynamically look up deprecated imports.
# Used to consolid... |
7c0cfcb4bd0a535b5d192b19f90478039aeed15df5f369417c56470da516b052 | Python | 798 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.vectorstores import PGVector
from langchain_community.vectorstores.pgvector import DistanceStrategy
# Create a way to dynamically look up deprecated imports.
# Used to consolida... |
e72680a77f6cbe22284d22f8d7464e2dcb018163f61e3b075173eea8b0fdea4f | Python | 798 | 26 | import napari
from RegistrationWidget import RegistrationWidget
viewer = napari.Viewer()
dock_widget = RegistrationWidget(viewer)
viewer.window.add_dock_widget(dock_widget)
@viewer.mouse_drag_callbacks.append
def get_event(viewer, event):
# on press
yield
# on release
for layer in viewer.layers.selec... |
6d1e52d692df0418de87e953f14eb91b2cca04aa98416c3e9c66f813483eec29 | Python | 799 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.litellm import (
ChatLiteLLM,
ChatLiteLLMException,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raisi... |
71372a324539312570532eb4e49546ee25a05071c197996a12ad9d5d2602fb82 | Python | 799 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import DocArrayRetriever
from langchain_community.retrievers.docarray import SearchType
# Create a way to dynamically look up deprecated imports.
# Used to consolidat... |
bfdbb150409994a0e7c148cc3b86d4e2776fa995e01cafca4c7f71ab0bb914cb | Python | 799 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.embeddings import (
DeterministicFakeEmbedding,
FakeEmbeddings,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raisi... |
c55fc7f49d9faba670b302e05fc45e90d9d347174d0dcda6340bbe1549806c4d | Python | 799 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import (
VectorStoreQATool,
VectorStoreQAWithSourcesTool,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raisi... |
10cdc1f761037cc0bb1a5c2904bc4883a1c5ed640fac50d7e07bd166ba3167a0 | Python | 800 | 27 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.query_constructors.milvus import (
MilvusTranslator,
process_value,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for r... |
188cee9568ed018f61fbd5da000824923d008f49c249d46cd251d40a2fc14f0d | Python | 800 | 31 | from langchain_classic import output_parsers
EXPECTED_ALL = [
"BooleanOutputParser",
"CombiningOutputParser",
"CommaSeparatedListOutputParser",
"DatetimeOutputParser",
"EnumOutputParser",
"GuardrailsOutputParser",
"ListOutputParser",
"MarkdownListOutputParser",
"NumberedListOutputPa... |
2a7828beeb4952de3663b9122932e0fa01dc328998b432e6f2f9958d3748eaf8 | Python | 800 | 27 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chains.graph_qa.cypher_utils import (
CypherQueryCorrector,
Schema,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for r... |
2ee63757563ccc3542e53f253f72fb9f406824f97b3b9f107a605850330bbb7f | Python | 801 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import GmailGetThread
from langchain_community.tools.gmail.get_thread import GetThreadSchema
# Create a way to dynamically look up deprecated imports.
# Used to consolidat... |
bca7b85f645c1f0a13eec40d7ddeb45bbbaa8700afb1fb61fc6eeff9cb1c1fac | Python | 801 | 30 | """Download SRA sequencing data for project PRJNA1117877."""
# imports
import subprocess
import shutil
import os
from tqdm import tqdm
import pandas as pd
output_dir = '.'
run_info_file = 'PRJNA1117877_run_info.csv'
run_info = pd.read_csv(run_info_file)
# download fastq files from the SRA
print('Downloading files... |
2c7a0b0ac47aa3709a342feab111d3f61424333657f715c88f2f92ec95819d0d | Python | 802 | 27 | """Run the pinned upstream CLI with optional input-driven RGI hooks."""
import importlib.util
import sys
from pathlib import Path
def main():
if len(sys.argv) < 2 or sys.argv[1] in {"-h", "--help"}:
print("Usage: python -m colabfold.rgi run_alphafold.py [upstream flags]")
return
script = Path... |
f1dd50b61e13607cc6dadbe8e364528f8ddb2304d01e6c144b41f61a2af44374 | Python | 802 | 22 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tffp.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... |
14122f7e597e791e8dc579956921ab537f8c1d9491c40281d578ae3427129e60 | Python | 803 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.vectorstores import LLMRails
from langchain_community.vectorstores.llm_rails import LLMRailsRetriever
# Create a way to dynamically look up deprecated imports.
# Used to consoli... |
dd90cb1c3aaf3543d5a965c47e803cc974abbbd6f0f4f19a27a4d64f9638f205 | Python | 803 | 27 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chains.openapi.prompts import (
REQUEST_TEMPLATE,
RESPONSE_TEMPLATE,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for ... |
e45a7b1f78bcb4d2ba3102c946129638faacb83c80862f92c18555dc41956041 | Python | 803 | 16 | from OCC.Display.SimpleGui import init_display
from OCC.Extend.DataExchange import write_step_file
from feature_test import Compound
new_compound, feature0, feature1, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, \
feature10, feature11, feature12, feature13, feature14, feature15,... |
18fdbfd3388b7ec3e266af54b602521dc03050e6833e2214c031a3eb1f2718f9 | Python | 804 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import ZillizRetriever
from langchain_community.retrievers.zilliz import ZillizRetreiver
# Create a way to dynamically look up deprecated imports.
# Used to consolida... |
36c212eaf2eb5901b2d7add74b0a87f8223a974d46f1a3a36f76526bd61451f1 | Python | 804 | 29 | import os
from django.db import models
from django.conf import settings
def get_upload_path(instance, filename):
return '/'.join(filter(None, ('pl2kilosort/files', instance.trial_type, filename)))
class Trial(models.Model):
TYPES = [
#('individual', 'Individual'),
('sequence', 'Sequence'),
... |
dcb2960aa147819e4b75bf8fb2643669f1f8da1da73ec61d83ec7ea4579757fb | Python | 804 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.graphs import ArangoGraph
from langchain_community.graphs.arangodb_graph import get_arangodb_client
# Create a way to dynamically look up deprecated imports.
# Used to consolida... |
e03e5166863f4e8a41b2a9053ddb70d10c035b777274927a33e330240307ce07 | Python | 804 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import MilvusRetriever
from langchain_community.retrievers.milvus import MilvusRetreiver
# Create a way to dynamically look up deprecated imports.
# Used to consolida... |
20a1907532de4e64cae0cdcc95a960ccb456a85c79c683a7d67e328bc0b4c3a0 | Python | 805 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import SearchAPIResults, SearchAPIRun
"""SearchApi.io API Toolkit."""
"""Tool for the SearchApi.io Google SERP API."""
# Create a way to dynamically look up deprecated import... |
8c41f5fe1ffd0393271074121ac35b727ccd0a02f99f83e6a46bba8bd63db61b | Python | 805 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.vectorstores import (
DocArrayHnswSearch,
DocArrayInMemorySearch,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for rai... |
b23aa64b839978239b9877aa86d1e7eaa060ba7d370ad0aa773a3f4bea486695 | Python | 805 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import WriteFileTool
from langchain_community.tools.file_management.write import WriteFileInput
# Create a way to dynamically look up deprecated imports.
# Used to consoli... |
c3b2b30bc642433265f7ef3c26ea9ebfff67b6475fb5a15195382f763b686067 | Python | 805 | 21 | import torch
import torch.nn as nn
# 定义一个简单的RNN模型
class RnnModel(nn.Module):
def __init__(self, input_size, hidden_size, num_layers, output_size):
super(RnnModel, self).__init__()
self.hidden_size = hidden_size
self.num_layers = num_layers
self.rnn = nn.GRU(input_size=inp... |
137dfca63a6e2125777236d820fdf0917fd2f8cd69cb1175ed2f6663a46c3ba3 | Python | 806 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.vectorstores import StarRocks
from langchain_community.vectorstores.starrocks import StarRocksSettings
# Create a way to dynamically look up deprecated imports.
# Used to consol... |
29fc59dd278ac771afeedbd680c9e030b28f6ad54a159a0356c916657d9cdea2 | Python | 806 | 27 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.query_constructors.vectara import (
VectaraTranslator,
process_value,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for... |
d0c658c38b6fc8c5af14f298441c76319f019b9025d70cc6ca2af47a60d87073 | Python | 806 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.vectorstores import ZepVectorStore
from langchain_community.vectorstores.zep import CollectionConfig
# Create a way to dynamically look up deprecated imports.
# Used to consolid... |
e1128c5bc194c89cc758823ce090ee78edb739c991bba5b5afb96930c3e40c0c | Python | 806 | 23 | """
This is a configuration file for PyTest.
This file is designed to be used with nbval: https://nbval.readthedocs.io/
The nbval-sanitize.cfg file is also for use with nbval.
"""
def pytest_collectstart(collector):
"""
Ignore certain outputs when validating documentation notebooks
See https://nbval.re... |
fff3e04f460846b8db992f98ca3a2891c2de752ea31179d80341146650b91ed9 | Python | 806 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import O365SendEvent
from langchain_community.tools.office365.send_event import SendEventSchema
# Create a way to dynamically look up deprecated imports.
# Used to consoli... |
1f28597a5f79d8ffcd7c611df338cd56d73f731c7ffcb52ba7249421aa8fcb41 | Python | 807 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import NavigateTool
from langchain_community.tools.playwright.navigate import NavigateToolInput
# Create a way to dynamically look up deprecated imports.
# Used to consoli... |
8e7ce215b34c360144756a44198de7b05eed17707d6ae7705ecb2bc6a0beaecd | Python | 807 | 27 | mport numpy as np
import torch
import os
from torch import nn
from torch.nn import functional as F
from alg.opt import get_optimizer
from alg.algs.ERM import ERM
from network.common_network import AugNet3D
from utils.contrastive_loss import SupConLoss
class L2D(ERM):
def __init__(self, args):
super(L2D, se... |
da0827e92a98edd59ff648b4e863d47f612f480f164483c464d1174a7718ab4d | Python | 807 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import SceneXplainTool
from langchain_community.tools.scenexplain.tool import SceneXplainInput
# Create a way to dynamically look up deprecated imports.
# Used to consolid... |
0a358367e67152c25f94ae1ff80d78386c554c7d5e4d769300c9e8da555896f7 | Python | 808 | 31 | from openff.toolkit.typing.engines.smirnoff.forcefield import (
ForceField,
get_available_force_fields,
)
from openff.toolkit.typing.engines.smirnoff.io import (
ParameterIOHandler,
XMLParameterIOHandler,
)
from openff.toolkit.typing.engines.smirnoff.parameters import (
AngleHandler,
BondHandler... |
0a90d1458fd49f45060ecb6af816e8b7759401358e66ee9ac627f3bd0619b464 | Python | 808 | 33 | import numpy as np
def laplacianSmoothing(edges, X, add_self_loops=True, iterations=1):
# pass an edge array or a mesh object
if not isinstance(edges, np.ndarray):
edges = edges.edges
# edges with self-loops
if add_self_loops:
Es = np.concatenate([
edges,
np... |
96af7caa777155435d6d3ee00c9f5bed34f7d4f988d61b0e2551088787596223 | Python | 808 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import (
LlamaIndexGraphRetriever,
LlamaIndexRetriever,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for ra... |
a8c0cbbadb88fe82f6c0283aa99eaa83c64be4e201ae413d814528c1f4c0c83c | Python | 808 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.callbacks.tracers.comet import (
CometTracer,
import_comet_llm_api,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for r... |
9d199ad1786e5e5933afe58eb23f86f3c22c6a5d647f59e4bee7f9ff87038212 | Python | 809 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import GmailGetMessage
from langchain_community.tools.gmail.get_message import SearchArgsSchema
# Create a way to dynamically look up deprecated imports.
# Used to consoli... |
ff1fc8471ae448a0b05e14721081e697655bd741ec4d1deb3d3cfb1111d8badb | Python | 809 | 24 | from utils.io import load_spectra_file
import matplotlib.pyplot as plt
import numpy as np
import glob
NUM_SELECTED_SPECTRA = 300000
PATH = r"H:\learned spectral unmixing\training_processed/"
for file in glob.glob(PATH + "*"):
base_filename = file.split("/")[-1].split("\\")[-1]
print(base_filename)
data =... |
5cc578a198e9df24114a26bd3a445f5d0d43b471483efa419a3630ea96fb9399 | Python | 811 | 15 | import pandas as pd
import numpy as np
def summary(o):
file_path = "./" + o
direct_res = pd.read_csv(file_path + '/direct_res.csv', header=0)
#direct_res = pd.read_csv('./results/direct_res.csv', header=0)
#pretrain_res = pd.read_csv(file_path + '/pretaining_res.csv', header=0)
fine_tuni... |
8ed6632219b850a4249604767261e348ead0982e46899fb33316cc87f3b789d4 | Python | 812 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.utilities import SearxSearchWrapper
from langchain_community.utilities.searx_search import SearxResults
# Create a way to dynamically look up deprecated imports.
# Used to conso... |
1bbb3b42c6aebdf3728c90a3df49e3bc84ff2dcca525276ea23e1c3db8f5ca4f | Python | 813 | 30 | from torch import nn
class DepthSeparableConv2d(nn.Sequential):
def __init__(
self,
in_channels,
out_channels,
kernel_size,
stride=1,
padding=0,
dilation=1,
bias=True,
):
super().__init__()
self.add_module("in_depth_conv", nn.Conv... |
51342dad0bec7770fd4b6539be9dd7915a22bc83173a04b0e650ca8f6d821618 | Python | 813 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import DeleteFileTool
from langchain_community.tools.file_management.delete import FileDeleteInput
# Create a way to dynamically look up deprecated imports.
# Used to cons... |
96625bcbf10d79371642cc9a81d974bf04e081c733239a19d5957e1ef0789940 | Python | 813 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.llms import VolcEngineMaasLLM
from langchain_community.llms.volcengine_maas import VolcEngineMaasBase
# Create a way to dynamically look up deprecated imports.
# Used to consoli... |
b3498bec492cb5980aa1d4739edd59ad7eb932a8f481730756ff92abb9bf3bdc | Python | 815 | 30 | from typing import Any
from typing_extensions import override
from langchain_classic.base_memory import BaseMemory
class SimpleMemory(BaseMemory):
"""Simple Memory.
Simple memory for storing context or other information that shouldn't
ever change between prompts.
"""
memories: dict[str, Any] =... |
1ee5e810a3286d8dac59cd24228bb01a4f5ad57090915c4b41c3141fdd5f6d02 | Python | 816 | 25 | import os
import pandas as pd
path = os.path.abspath(os.path.dirname(os.getcwd()))
train_path = path + r'\data\seq_data_train.csv'
test_path = path + r'\data\seq_data_test.csv'
val_path = path + r'\data\seq_data_validation.csv'
path = [train_path, test_path, val_path]
smi_char_frequency = {}
# get the frequency... |
3c1d442a157470b75b5b5f76c22300b19f2ad139c9a8d1301c8ac89f90adc6c0 | Python | 816 | 35 | from keras import layers
import tensorflow as tf
class ScalingLayer(layers.Layer):
'''rescales the input tensors values from [lower, upper] to [0, 1.].
Values outside are clipped.
'''
def __init__(self, lower, upper, **kwargs):
'''
'''
super().__init__(**kwargs)
asser... |
6c40547628a2d1997e4af0e66945681f256495ed01cef047b7fbd055ead75c40 | Python | 816 | 31 | """
Module that contains the command line app.
Why does this file exist, and why not put this in __main__?
You might be tempted to import things from __main__ later, but that will cause
problems: the code will get executed twice:
- When you run `python -momicscope` python will execute
``__main__.py`` as a ... |
8c37436012cc6b2c17500ae8c2aedee4038fed889d48da6982a57f798b310670 | Python | 816 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.llms import SagemakerEndpoint
from langchain_community.llms.sagemaker_endpoint import LLMContentHandler
# Create a way to dynamically look up deprecated imports.
# Used to conso... |
f0b7825ccef50d154e9f279390180414d614518fef21c74cc4b83ed6cde55537 | Python | 816 | 23 | import os
import setuptools
setuptools.setup(
name='varflow',
version="1.0",
author="Xingjian Shi",
author_email="xshiab@cse.ust.hk",
packages=setuptools.find_packages(),
description='Python Wrapper of VarFlow',
long_description=open(os.path.join(os.path.dirname(
os.path.abspath(__... |
2d5aa78eb17ab9b3e26594877951cd471e4708b283b0ccfd2b21b5d1cce0be31 | Python | 817 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.google_palm import (
ChatGooglePalm,
ChatGooglePalmError,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for... |
565ae397fcd275c020746d55b260f66f498f22c847d91e5cd092bf6084c68059 | Python | 817 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import GmailSendMessage
from langchain_community.tools.gmail.send_message import SendMessageSchema
# Create a way to dynamically look up deprecated imports.
# Used to cons... |
6bc07481a4e0614c3f553efa25c51beca016154734bad27028a4aee3065952ec | Python | 817 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import SlackSendMessage
from langchain_community.tools.slack.send_message import SendMessageSchema
# Create a way to dynamically look up deprecated imports.
# Used to cons... |
f6c5bb4f64b11c45318971344dc931643b0063037465355bcb35f1a91c727270 | Python | 817 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import GmailCreateDraft
from langchain_community.tools.gmail.create_draft import CreateDraftSchema
# Create a way to dynamically look up deprecated imports.
# Used to cons... |
9c008abf418b6c1a7b666169a9552c8e2b8e9dfe994102ff0757a92f6beeb5c0 | Python | 818 | 39 | from langchain_classic import chat_models
EXPECTED_ALL = [
"init_chat_model",
"ChatOpenAI",
"BedrockChat",
"AzureChatOpenAI",
"FakeListChatModel",
"PromptLayerChatOpenAI",
"ChatEverlyAI",
"ChatAnthropic",
"ChatCohere",
"ChatDatabricks",
"ChatGooglePalm",
"ChatMlflow",
... |
0dfad506013438708db4151b857dd8fd116cc4673d9cc71c70cae106616d54d3 | Python | 819 | 25 | # set the base filepath for the current user
import os
import json
import getpass
from pathlib import Path
def loadpaths(user=None):
# Where is this file?
__location__ = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__)))
json_path = os.path.join(Path(__location__).parent.pare... |
6082ca7dbf68763d39f4f701e0c661892176f6b023e0e2ed741aea355feac790 | Python | 819 | 28 | import tensorflow as tf
from tensorflow.keras import layers
class Envelope(layers.Layer):
"""
This code is extracted from dimenet (https://github.com/gasteigerjo/dimenet).
Envelope function that ensures a smooth cutoff.
"""
def __init__(
self,
exponent,
name='envelope'
... |
b54067e6ea48225e0d90da68e966a5a7bea257698222919558cafe6d13b6bbc9 | Python | 819 | 32 | conf = {}
# ## skip600000_hidden32_numinter6_lr1e-4_wd1e-5_wbindingsite_cutoff10_bs16
conf_model = {}
conf_model['cutoff'] = 10.0
conf_model['num_node_types'] = 46 # lig_types + rec_types
conf_model['num_lig_node_types'] = 27 # lig_types
conf_model['num_interactions'] = 6
conf_model['num_filters'] = 32
conf_model['... |
47a4fa27964b79bd1d542ed2434a1402c83a0b9ab01e29158ca6703a10476e9a | Python | 820 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders.helpers import (
FileEncoding,
detect_file_encodings,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic fo... |
aa86bdd1e7f906c886666e029ca55013fa8ad7b596ab7c95e5ca21fb3f16683a | Python | 820 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import GooglePlacesTool
from langchain_community.tools.google_places.tool import GooglePlacesSchema
# Create a way to dynamically look up deprecated imports.
# Used to con... |
6637dbbdee5783f8fe57cb9ddb417bc1a27aa42fa1fd60f75e138706448f99bf | Python | 821 | 31 | from pensa.features import hbond_features, atom_features
# Featurize water cavity hydrogen bonds
root_dir = './mor-data'
ref_file_a = root_dir + '/11427_dyn_151.psf'
pdb_file_a = root_dir + '/11426_dyn_151.pdb'
trj_file_a = root_dir + '/11423_trj_151.xtc'
names, data = hbond_features.read_water_site_h_bonds_quickly... |
51f25733ad997d2d35be98a3d4886004365f9938b804a9103c618c3922ca9a65 | Python | 822 | 32 | import os
import pandas as pd
def read_output(dataset, outdir, sample, exp_desc=''):
"""
Reads saved results output.
:param dataset: dataset name
:param outdir: output directory
:param sample: type of subsampling experiment
:param exp_desc: description of the experiment
:return:
L: sav... |
ec255f4598baa6e7adbc7ad6aca7a3e9df25517f4d375fc1620d3144421acf88 | Python | 822 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import O365SendMessage
from langchain_community.tools.office365.send_message import SendMessageSchema
# Create a way to dynamically look up deprecated imports.
# Used to c... |
f956b44da719eaa870e7d6685470b63f3b97d985f1630580fe663e317c4a6010 | Python | 822 | 30 | from __future__ import annotations
from typing import List
from libs.engine.ga import GA
from libs.engine.ns import NS
from libs.utils.generator import Generator
class NSGA2:
def __init__(
self, p: int, q: int, mutate_rate: float, remove_gain: float, overwrap: int, obj_var: List, generator: Generator
... |
7cd562de8c384d81d5a48970cddb10d2a507035753357feb9a56477b69202f52 | Python | 823 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.fake import (
FakeListChatModel,
FakeMessagesListChatModel,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic f... |
900c34a6760e488126ada8ac6ad7c5755bf597e51937afc1c8ff5b85917e5117 | Python | 823 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import FileSearchTool
from langchain_community.tools.file_management.file_search import FileSearchInput
# Create a way to dynamically look up deprecated imports.
# Used to... |
97ee9e3431f5bb8653131b9d6281f98b3d22b64f681d60322467c3fd4f8fc9a4 | Python | 823 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import GoogleSerperResults, GoogleSerperRun
"""Google Serper API Toolkit."""
"""Tool for the Serer.dev Google Search API."""
# Create a way to dynamically look up deprecated ... |
f6c777934d8dd2f10d524e7c60b3c78290a269308cef77bc349573d745f20e41 | Python | 823 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.mlflow_ai_gateway import (
ChatMLflowAIGateway,
ChatParams,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic f... |
6f18b105c2d2aab5f83a4e6bde12195024fde0e1ef8171706212a41b8fa9a93e | Python | 824 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import SlackGetMessage
from langchain_community.tools.slack.get_message import SlackGetMessageSchema
# Create a way to dynamically look up deprecated imports.
# Used to co... |
c75e6525161107bc7887ef45f3d97f79b8a34d9cb43ecca29ddaf1a9e0c13c0c | Python | 824 | 29 | import os
import argparse
import warnings
warnings.filterwarnings("ignore", module="matplotlib")
def parse_args():
parser = argparse.ArgumentParser(description='config')
parser.add_argument('--config',
nargs='?',
type=str,
default='confi... |
e4cd34e9f7246fd728854579d21b998eb579925ed164e532de5824552648760b | Python | 824 | 27 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.query_constructors.deeplake import (
DeepLakeTranslator,
can_cast_to_float,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate log... |
cd795f04fa46335cc4ce0f2854f5d7c845f8e03f83b1152e9611c951ebf4160d | Python | 825 | 45 | """Deep Learning modules for BERNN.
This subpackage contains the deep learning models and training code.
"""
# Model definitions
from .models.pytorch import (
AutoEncoder2,
SHAPAutoEncoder2,
KANAutoEncoder2,
SHAPKANAutoEncoder2,
AutoEncoder3,
SHAPAutoEncoder3,
)
# Training modules
from .train... |
b0614a8320f95fc189c80a2a0ed64e6f4d051a3546c92ac7ec65c349e58b1649 | Python | 826 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.agent_toolkits.openapi.toolkit import (
OpenAPIToolkit,
RequestsToolkit,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic ... |
b2992d00fb40490f5f138c33ea42d06d368413d7faf874c055a4f5d92acfd8dd | Python | 826 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import (
OutlookMessageLoader,
UnstructuredEmailLoader,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic ... |
b7264d465dea44e72eca67193b9d12fd96de649320e18f6cf28532be92bfdf1a | Python | 826 | 27 | from typing_extensions import override
from langchain_core.example_selectors import BaseExampleSelector
class DummyExampleSelector(BaseExampleSelector):
def __init__(self) -> None:
self.example: dict[str, str] | None = None
def add_example(self, example: dict[str, str]) -> None:
self.example... |
2c82dab51574f36a22083262473dcf9091a103a0e9bc847454216d183f3e81a9 | Python | 827 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import BM25Retriever
from langchain_community.retrievers.bm25 import default_preprocessing_func
# Create a way to dynamically look up deprecated imports.
# Used to co... |
2ce0dc7e4e59cf689ae368cfd095ab9e2af5513a990ff5c439b77ee97dc91386 | Python | 827 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import ChatGPTLoader
from langchain_community.document_loaders.chatgpt import concatenate_rows
# Create a way to dynamically look up deprecated imports.
# Used ... |
a5ec359dd26f1bf0d1cad83476eba680f17bd383beb427248ab75afcbf9390da | Python | 827 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import O365SearchEvents
from langchain_community.tools.office365.events_search import SearchEventsInput
# Create a way to dynamically look up deprecated imports.
# Used to... |
ac05c6c96504815269612681e0d3d1ed50135db932713fc9efcf9a79ef93cf38 | Python | 829 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.javelin_ai_gateway import (
ChatJavelinAIGateway,
ChatParams,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic... |
c6f8a13675df074d84b15e1e2345e895fdb4eabe65ea2d20592f04710a7cba89 | Python | 829 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders.parsers.docai import (
DocAIParser,
DocAIParsingResults,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic... |
f9e97f0b815551e6320b01e945c794cfc896eba960afc11882e6dd3195766e46 | Python | 829 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import (
Docx2txtLoader,
UnstructuredWordDocumentLoader,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic... |
b167ab4da7e476ccb31efc15d28ccc08b884e295e1640caccfa3b6219136c8c5 | Python | 830 | 41 | import numpy as np
import pandas as pd
import imgkit
options = {
'format': 'png',
'crop-h': '20',
'crop-w': '176',
'crop-x': '8',
'crop-y': '8',
'encoding': "UTF-8",
'custom-header' : [
('Accept-Encoding', 'gzip')
]
}
path = "filedownloads?parentAlias=ntnu"
data = np.asarray(p... |
6ab6d9dfa993bf943c025a136e2547977a07f47789320d0f9459b95ea2aedc3c | Python | 831 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import O365SearchEmails
from langchain_community.tools.office365.messages_search import SearchEmailsInput
# Create a way to dynamically look up deprecated imports.
# Used ... |
1f052cca446b7fa300f97dc85869ee7c76cdfa616836074570b0203177240846 | Python | 832 | 30 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import (
AzureAISearchRetriever,
AzureCognitiveSearchRetriever,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logi... |
9be3deff63a384caf9aa1369304c6353601d28e26178f649259828b3359274cb | Python | 832 | 24 | import importlib
from pathlib import Path
from pydantic import BaseModel
def test_all_models_built() -> None:
for path in Path("../core/langchain_core/").glob("*"):
module_name = path.stem
if (
not module_name.startswith(".")
and path.suffix != ".typed"
and mod... |
326bf762d412c8421ebdfbb40b40c62e0c8d203d05c5154f5e6eebba536ee79e | Python | 833 | 26 | """
exceptions.py
----------------
Borrowed from trimesh source code
"""
class ExceptionModule(object):
"""
Create a dummy module which will raise an exception when attributes
are accessed.
For soft dependencies we want to survive failing to import but
we would like to raise an appropriate error wh... |
5d3ae6493c555729ecc4882b8d80099ad121570a79e29a732ebc0ba934fea3f1 | Python | 833 | 29 | import pandas as pd
import mne
from config_chbp_eeg import bids_root, deriv_root
subjects_list = list(bids_root.glob('*'))
subjects_df = pd.read_csv(bids_root / "participants.tsv", sep='\t')
subjects = [sub for sub in subjects_df.participant_id if
(deriv_root / sub / 'eeg').exists()]
eeg_template_monta... |
6014af174c0690f635055f0e68f109f6710bd037c22a7bc0e6ba6246bbad592b | Python | 833 | 28 | from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import ConfluenceLoader
from langchain_community.document_loaders.confluence import ContentFormat
# Create a way to dynamically look up deprecated imports.
# Us... |
b999fab07ad315cb674355dafe96e1281816e2e52426d3a1a948fa97dcdd1d10 | Python | 833 | 16 | name = "pycromanager"
from pycromanager.acquisition.java_backend_acquisitions import (JavaBackendAcquisition, MagellanAcquisition,
XYTiledAcquisition, ExploreAcquisition)
from pycromanager.acquisition.acquisition_superclass import multi_d_acquisition_even... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.