repo_id
stringclasses
20 values
file_path
stringlengths
44
119
content
stringlengths
460
28.1k
__index_level_0__
int64
0
0
index
int64
90
4.01k
secrets
stringlengths
68
2.61k
has_secrets
bool
1 class
number_secrets
int64
1
28
new_content
stringlengths
454
28.4k
modified
bool
1 class
references
stringlengths
469
28.8k
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/unit_tests
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/unit_tests/document_loaders/test_confluence.py
import unittest from typing import Dict from unittest.mock import MagicMock, patch import pytest import requests from langchain.docstore.document import Document from langchain.document_loaders.confluence import ConfluenceLoader, ContentFormat @pytest.fixture def mock_confluence(): # type: ignore with patch("a...
0
1,929
[{"tag": "EMAIL", "value": "user@gmail.com", "start": 551, "end": 565}, {"tag": "EMAIL", "value": "user@gmail.com", "start": 983, "end": 997}]
true
2
import unittest from typing import Dict from unittest.mock import MagicMock, patch import pytest import requests from langchain.docstore.document import Document from langchain.document_loaders.confluence import ConfluenceLoader, ContentFormat @pytest.fixture def mock_confluence(): # type: ignore with patch("a...
true
import unittest from typing import Dict from unittest.mock import MagicMock, patch import pytest import requests from langchain.docstore.document import Document from langchain.document_loaders.confluence import ConfluenceLoader, ContentFormat @pytest.fixture def mock_confluence(): # type: ignore with patch("a...
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain/llms/replicate.py
from __future__ import annotations import logging from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional from langchain.callbacks.manager import CallbackManagerForLLMRun from langchain.llms.base import LLM from langchain.pydantic_v1 import Extra, Field, root_validator from langchain.schema.output impor...
0
2,192
[{"tag": "KEY", "value": "27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478", "start": 1136, "end": 1200}]
true
1
from __future__ import annotations import logging from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional from langchain.callbacks.manager import CallbackManagerForLLMRun from langchain.llms.base import LLM from langchain.pydantic_v1 import Extra, Field, root_validator from langchain.schema.output impor...
true
from __future__ import annotations import logging from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional from langchain.callbacks.manager import CallbackManagerForLLMRun from langchain.llms.base import LLM from langchain.pydantic_v1 import Extra, Field, root_validator from langchain.schema.output impor...
hf_public_repos/gkamradt/langchain-tutorials/data
hf_public_repos/gkamradt/langchain-tutorials/data/thefuzz/setup.py
#!/usr/bin/env python # Copyright (c) 2014 SeatGeek # This file is part of thefuzz. from thefuzz import __version__ import os try: from setuptools import setup except ImportError: from distutils.core import setup def open_file(fname): return open(os.path.join(os.path.dirname(__file__), fname)) setup...
0
136
[{"tag": "EMAIL", "value": "adam@seatgeek.com", "start": 410, "end": 427}]
true
1
#!/usr/bin/env python # Copyright (c) 2014 SeatGeek # This file is part of thefuzz. from thefuzz import __version__ import os try: from setuptools import setup except ImportError: from distutils.core import setup def open_file(fname): return open(os.path.join(os.path.dirname(__file__), fname)) setup...
true
#!/usr/bin/env python # Copyright (c) 2014 SeatGeek # This file is part of thefuzz. from thefuzz import __version__ import os try: from setuptools import setup except ImportError: from distutils.core import setup def open_file(fname): return open(os.path.join(os.path.dirname(__file__), fname)) setup...
hf_public_repos/zilliztech/GPTCache/tests/unit_tests
hf_public_repos/zilliztech/GPTCache/tests/unit_tests/processor/test_context.py
from tempfile import TemporaryDirectory from typing import Any, Dict from unittest.mock import patch from gptcache import cache from gptcache.adapter import openai from gptcache.manager import manager_factory from gptcache.processor import ContextProcess from gptcache.processor.pre import all_content from gptcache.uti...
0
866
[{"tag": "KEY", "value": "chatcmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 1561, "end": 1599}]
true
1
from tempfile import TemporaryDirectory from typing import Any, Dict from unittest.mock import patch from gptcache import cache from gptcache.adapter import openai from gptcache.manager import manager_factory from gptcache.processor import ContextProcess from gptcache.processor.pre import all_content from gptcache.uti...
true
from tempfile import TemporaryDirectory from typing import Any, Dict from unittest.mock import patch from gptcache import cache from gptcache.adapter import openai from gptcache.manager import manager_factory from gptcache.processor import ContextProcess from gptcache.processor.pre import all_content from gptcache.uti...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/vectorstores/vearch.ipynb
from langchain.document_loaders import TextLoader from langchain.embeddings.huggingface import HuggingFaceEmbeddings from langchain.text_splitter import RecursiveCharacterTextSplitter from transformers import AutoModel, AutoTokenizer from langchain.vectorstores.vearch import Vearch # repalce to your local model path m...
0
3,535
[{"tag": "KEY", "value": "2776754da8fc4bb58d3e482006010716", "start": 5018, "end": 5050}, {"tag": "KEY", "value": "2776754da8fc4bb58d3e482006010716", "start": 5692, "end": 5724}, {"tag": "KEY", "value": "9776bccfdd8643a8b219ccee0596f370", "start": 5977, "end": 6009}, {"tag": "KEY", "value": "9223acd6d89d4c2c84ff42677ac...
true
6
from langchain.document_loaders import TextLoader from langchain.embeddings.huggingface import HuggingFaceEmbeddings from langchain.text_splitter import RecursiveCharacterTextSplitter from transformers import AutoModel, AutoTokenizer from langchain.vectorstores.vearch import Vearch # repalce to your local model path m...
true
from langchain.document_loaders import TextLoader from langchain.embeddings.huggingface import HuggingFaceEmbeddings from langchain.text_splitter import RecursiveCharacterTextSplitter from transformers import AutoModel, AutoTokenizer from langchain.vectorstores.vearch import Vearch # repalce to your local model path m...
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain/retrievers/you.py
from typing import Any, Dict, List, Optional from langchain.callbacks.manager import CallbackManagerForRetrieverRun from langchain.pydantic_v1 import root_validator from langchain.schema import BaseRetriever, Document from langchain.utils import get_from_dict_or_env class YouRetriever(BaseRetriever): """`You` re...
0
2,956
[{"tag": "EMAIL", "value": "api@you.com", "start": 449, "end": 460}]
true
1
from typing import Any, Dict, List, Optional from langchain.callbacks.manager import CallbackManagerForRetrieverRun from langchain.pydantic_v1 import root_validator from langchain.schema import BaseRetriever, Document from langchain.utils import get_from_dict_or_env class YouRetriever(BaseRetriever): """`You` re...
true
from typing import Any, Dict, List, Optional from langchain.callbacks.manager import CallbackManagerForRetrieverRun from langchain.pydantic_v1 import root_validator from langchain.schema import BaseRetriever, Document from langchain.utils import get_from_dict_or_env class YouRetriever(BaseRetriever): """`You` re...
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/unit_tests
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/unit_tests/document_loaders/test_git.py
import os import py import pytest from langchain.document_loaders import GitLoader def init_repo(tmpdir: py.path.local, dir_name: str) -> str: from git import Repo repo_dir = tmpdir.mkdir(dir_name) repo = Repo.init(repo_dir) git = repo.git git.checkout(b="main") git.config("user.name", "Te...
0
1,938
[{"tag": "EMAIL", "value": "test@example.com", "start": 360, "end": 376}]
true
1
import os import py import pytest from langchain.document_loaders import GitLoader def init_repo(tmpdir: py.path.local, dir_name: str) -> str: from git import Repo repo_dir = tmpdir.mkdir(dir_name) repo = Repo.init(repo_dir) git = repo.git git.checkout(b="main") git.config("user.name", "Te...
true
import os import py import pytest from langchain.document_loaders import GitLoader def init_repo(tmpdir: py.path.local, dir_name: str) -> str: from git import Repo repo_dir = tmpdir.mkdir(dir_name) repo = Repo.init(repo_dir) git = repo.git git.checkout(b="main") git.config("user.name", "Te...
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/integration_tests
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/integration_tests/vectorstores/test_atlas.py
"""Test Atlas functionality.""" import time from langchain.vectorstores import AtlasDB from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings ATLAS_TEST_API_KEY = "7xDPkYXSYDc1_ErdTPIcoAR9RNd8YDlkS3nVNXcVoIMZ6" def test_atlas() -> None: """Test end to end construction and search.""" ...
0
1,441
[{"tag": "KEY", "value": "7xDPkYXSYDc1_ErdTPIcoAR9RNd8YDlkS3nVNXcVoIMZ6", "start": 191, "end": 236}]
true
1
"""Test Atlas functionality.""" import time from langchain.vectorstores import AtlasDB from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings ATLAS_TEST_API_KEY = "ax5kh6jaqkcd2tiexxs8v6xjo8yv8a6b" def test_atlas() -> None: """Test end to end construction and search.""" texts = ["fo...
true
"""Test Atlas functionality.""" import time from langchain.vectorstores import AtlasDB from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings ATLAS_TEST_API_KEY = "PI:KEY:ax5kh6jaqkcd2tiexxs8v6xjo8yv8a6bEND_PI" def test_atlas() -> None: """Test end to end construction and search.""" ...
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain/utilities/pubmed.py
import json import logging import time import urllib.error import urllib.parse import urllib.request from typing import Any, Dict, Iterator, List from langchain.pydantic_v1 import BaseModel, root_validator from langchain.schema import Document logger = logging.getLogger(__name__) class PubMedAPIWrapper(BaseModel): ...
0
2,689
[{"tag": "EMAIL", "value": "your_email@example.com", "start": 1576, "end": 1598}]
true
1
import json import logging import time import urllib.error import urllib.parse import urllib.request from typing import Any, Dict, Iterator, List from langchain.pydantic_v1 import BaseModel, root_validator from langchain.schema import Document logger = logging.getLogger(__name__) class PubMedAPIWrapper(BaseModel): ...
true
import json import logging import time import urllib.error import urllib.parse import urllib.request from typing import Any, Dict, Iterator, List from langchain.pydantic_v1 import BaseModel, root_validator from langchain.schema import Document logger = logging.getLogger(__name__) class PubMedAPIWrapper(BaseModel): ...
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/integration_tests
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/integration_tests/document_loaders/test_mastodon.py
"""Tests for the Mastodon toots loader""" from langchain.document_loaders import MastodonTootsLoader def test_mastodon_toots_loader() -> None: """Test Mastodon toots loader with an external query.""" # Query the Mastodon CEO's account loader = MastodonTootsLoader( mastodon_accounts=["@Gargron@mast...
0
1,633
[{"tag": "EMAIL", "value": "Gargron@mastodon.social", "start": 308, "end": 331}]
true
1
"""Tests for the Mastodon toots loader""" from langchain.document_loaders import MastodonTootsLoader def test_mastodon_toots_loader() -> None: """Test Mastodon toots loader with an external query.""" # Query the Mastodon CEO's account loader = MastodonTootsLoader( mastodon_accounts=["@kenaa@exampl...
true
"""Tests for the Mastodon toots loader""" from langchain.document_loaders import MastodonTootsLoader def test_mastodon_toots_loader() -> None: """Test Mastodon toots loader with an external query.""" # Query the Mastodon CEO's account loader = MastodonTootsLoader( mastodon_accounts=["@PI:EMAIL:ken...
hf_public_repos/zilliztech/GPTCache/tests/unit_tests
hf_public_repos/zilliztech/GPTCache/tests/unit_tests/adapter/test_langchain_models.py
import asyncio import os import random from unittest.mock import patch from gptcache import Cache, Config from gptcache.adapter import openai from gptcache.adapter.api import init_similar_cache, get from gptcache.adapter.langchain_models import LangChainLLMs, LangChainChat, _cache_msg_data_convert from gptcache.proces...
0
859
[{"tag": "KEY", "value": "chatcmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 5596, "end": 5634}, {"tag": "KEY", "value": "chatcmpl-6ptKqrhgRoVchm58Bby0UvJzq2ZuQ", "start": 1446, "end": 1484}, {"tag": "KEY", "value": "chatcmpl-6ptKqrhgRoVchm58Bby0UvJzq2ZuQ", "start": 3146, "end": 3184}, {"tag": "KEY", "value": "chatcmpl-...
true
4
import asyncio import os import random from unittest.mock import patch from gptcache import Cache, Config from gptcache.adapter import openai from gptcache.adapter.api import init_similar_cache, get from gptcache.adapter.langchain_models import LangChainLLMs, LangChainChat, _cache_msg_data_convert from gptcache.proces...
true
import asyncio import os import random from unittest.mock import patch from gptcache import Cache, Config from gptcache.adapter import openai from gptcache.adapter.api import init_similar_cache, get from gptcache.adapter.langchain_models import LangChainLLMs, LangChainChat, _cache_msg_data_convert from gptcache.proces...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/document_loaders/mastodon.ipynb
from langchain.document_loaders import MastodonTootsLoader#!pip install Mastodon.pyloader = MastodonTootsLoader( mastodon_accounts=["@Gargron@mastodon.social"], number_toots=50, # Default value is 100 ) # Or set up access information to use a Mastodon app. # Note that the access token can either be passed int...
0
3,916
[{"tag": "EMAIL", "value": "Gargron@mastodon.social", "start": 138, "end": 161}, {"tag": "EMAIL", "value": "Gargron@mastodon.social", "start": 566, "end": 589}]
true
2
from langchain.document_loaders import MastodonTootsLoader#!pip install Mastodon.pyloader = MastodonTootsLoader( mastodon_accounts=["@anpch@example.com"], number_toots=50, # Default value is 100 ) # Or set up access information to use a Mastodon app. # Note that the access token can either be passed into # co...
true
from langchain.document_loaders import MastodonTootsLoader#!pip install Mastodon.pyloader = MastodonTootsLoader( mastodon_accounts=["@PI:EMAIL:anpch@example.comEND_PI"], number_toots=50, # Default value is 100 ) # Or set up access information to use a Mastodon app. # Note that the access token can either be p...
hf_public_repos/zilliztech
hf_public_repos/zilliztech/GPTCache/setup.py
import codecs import os import re from typing import List import setuptools from setuptools import find_packages here = os.path.abspath(os.path.dirname(__file__)) with open("README.md", "r") as fh: long_description = fh.read() def parse_requirements(file_name: str) -> List[str]: with open(file_name) as f:...
0
782
[{"tag": "EMAIL", "value": "bang.fu@zilliz.com", "start": 1000, "end": 1018}]
true
1
import codecs import os import re from typing import List import setuptools from setuptools import find_packages here = os.path.abspath(os.path.dirname(__file__)) with open("README.md", "r") as fh: long_description = fh.read() def parse_requirements(file_name: str) -> List[str]: with open(file_name) as f:...
true
import codecs import os import re from typing import List import setuptools from setuptools import find_packages here = os.path.abspath(os.path.dirname(__file__)) with open("README.md", "r") as fh: long_description = fh.read() def parse_requirements(file_name: str) -> List[str]: with open(file_name) as f:...
hf_public_repos/langchain-ai/langchain/libs/experimental/tests
hf_public_repos/langchain-ai/langchain/libs/experimental/tests/unit_tests/test_reversible_data_anonymizer.py
import os from typing import Iterator, List import pytest from . import is_libcublas_available @pytest.fixture(scope="module", autouse=True) def check_spacy_model() -> Iterator[None]: import spacy if not spacy.util.is_package("en_core_web_lg"): pytest.skip(reason="Spacy model 'en_core_web_lg' not i...
0
1,319
[{"tag": "EMAIL", "value": "johnsmith@gmail.com", "start": 2213, "end": 2232}, {"tag": "EMAIL", "value": "johnsmith@gmail.com", "start": 2381, "end": 2400}, {"tag": "EMAIL", "value": "jane@gmail.com", "start": 6241, "end": 6255}, {"tag": "EMAIL", "value": "jane@gmail.com", "start": 6593, "end": 6607}]
true
4
import os from typing import Iterator, List import pytest from . import is_libcublas_available @pytest.fixture(scope="module", autouse=True) def check_spacy_model() -> Iterator[None]: import spacy if not spacy.util.is_package("en_core_web_lg"): pytest.skip(reason="Spacy model 'en_core_web_lg' not i...
true
import os from typing import Iterator, List import pytest from . import is_libcublas_available @pytest.fixture(scope="module", autouse=True) def check_spacy_model() -> Iterator[None]: import spacy if not spacy.util.is_package("en_core_web_lg"): pytest.skip(reason="Spacy model 'en_core_web_lg' not i...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/vectorstores/atlas.ipynb
import time from langchain.embeddings.openai import OpenAIEmbeddings from langchain.text_splitter import SpacyTextSplitter from langchain.vectorstores import AtlasDB from langchain.document_loaders import TextLoaderATLAS_TEST_API_KEY = "7xDPkYXSYDc1_ErdTPIcoAR9RNd8YDlkS3nVNXcVoIMZ6"loader = TextLoader("../../modules/st...
0
3,538
[{"tag": "KEY", "value": "7xDPkYXSYDc1_ErdTPIcoAR9RNd8YDlkS3nVNXcVoIMZ6", "start": 237, "end": 282}]
true
1
import time from langchain.embeddings.openai import OpenAIEmbeddings from langchain.text_splitter import SpacyTextSplitter from langchain.vectorstores import AtlasDB from langchain.document_loaders import TextLoaderATLAS_TEST_API_KEY = "ngw6fo1pu3tjgnp9jnlp7vnwvfqb9yn7"loader = TextLoader("../../modules/state_of_the_un...
true
import time from langchain.embeddings.openai import OpenAIEmbeddings from langchain.text_splitter import SpacyTextSplitter from langchain.vectorstores import AtlasDB from langchain.document_loaders import TextLoaderATLAS_TEST_API_KEY = "PI:KEY:ngw6fo1pu3tjgnp9jnlp7vnwvfqb9yn7END_PI"loader = TextLoader("../../modules/st...
hf_public_repos/langchain-ai/langchain/docs/docs/guides
hf_public_repos/langchain-ai/langchain/docs/docs/guides/safety/amazon_comprehend_chain.ipynb
%pip install boto3 nltk%pip install -U langchain_experimental%pip install -U langchain pydanticimport boto3 import os comprehend_client = boto3.client("comprehend", region_name="us-east-1")from langchain_experimental.comprehend_moderation import AmazonComprehendModerationChain comprehend_moderation = AmazonComprehend...
0
4,006
[{"tag": "EMAIL", "value": "john.doe@email.com", "start": 4529, "end": 4547}, {"tag": "EMAIL", "value": "johndoe@example.com", "start": 7770, "end": 7789}, {"tag": "EMAIL", "value": "johndoe@example.com", "start": 9392, "end": 9411}]
true
3
%pip install boto3 nltk%pip install -U langchain_experimental%pip install -U langchain pydanticimport boto3 import os comprehend_client = boto3.client("comprehend", region_name="us-east-1")from langchain_experimental.comprehend_moderation import AmazonComprehendModerationChain comprehend_moderation = AmazonComprehend...
true
%pip install boto3 nltk%pip install -U langchain_experimental%pip install -U langchain pydanticimport boto3 import os comprehend_client = boto3.client("comprehend", region_name="us-east-1")from langchain_experimental.comprehend_moderation import AmazonComprehendModerationChain comprehend_moderation = AmazonComprehend...
hf_public_repos/gkamradt/langchain-tutorials
hf_public_repos/gkamradt/langchain-tutorials/agents/Agents + ZapierToolkit.ipynb
from langchain.llms import OpenAI from langchain.agents import initialize_agent from langchain.agents.agent_toolkits import ZapierToolkit from langchain.utilities.zapier import ZapierNLAWrapper import osos.environ["OPENAI_API_KEY"] = 'YourAPIKey' os.environ["ZAPIER_NLA_API_KEY"] = 'YourAPIKey'llm = OpenAI(temperature=0...
0
147
[{"tag": "EMAIL", "value": "greg@DataIndependent.com", "start": 1088, "end": 1112}]
true
1
from langchain.llms import OpenAI from langchain.agents import initialize_agent from langchain.agents.agent_toolkits import ZapierToolkit from langchain.utilities.zapier import ZapierNLAWrapper import osos.environ["OPENAI_API_KEY"] = 'YourAPIKey' os.environ["ZAPIER_NLA_API_KEY"] = 'YourAPIKey'llm = OpenAI(temperature=0...
true
from langchain.llms import OpenAI from langchain.agents import initialize_agent from langchain.agents.agent_toolkits import ZapierToolkit from langchain.utilities.zapier import ZapierNLAWrapper import osos.environ["OPENAI_API_KEY"] = 'YourAPIKey' os.environ["ZAPIER_NLA_API_KEY"] = 'YourAPIKey'llm = OpenAI(temperature=0...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/document_transformers/doctran_translate_document.ipynb
from langchain.schema import Document from langchain.document_transformers import DoctranTextTranslatorfrom dotenv import load_dotenv load_dotenv()sample_text = """[Generated with ChatGPT] Confidential Document - For Internal Use Only Date: July 1, 2023 Subject: Updates and Discussions on Various Topics Dear Team,...
0
3,791
[{"tag": "EMAIL", "value": "john.doe@example.com", "start": 781, "end": 801}, {"tag": "EMAIL", "value": "security@example.com", "start": 1124, "end": 1144}, {"tag": "EMAIL", "value": "michael.johnson@example.com", "start": 1728, "end": 1755}, {"tag": "EMAIL", "value": "david.rodriguez@example.com", "start": 2551, "end"...
true
5
from langchain.schema import Document from langchain.document_transformers import DoctranTextTranslatorfrom dotenv import load_dotenv load_dotenv()sample_text = """[Generated with ChatGPT] Confidential Document - For Internal Use Only Date: July 1, 2023 Subject: Updates and Discussions on Various Topics Dear Team,...
true
from langchain.schema import Document from langchain.document_transformers import DoctranTextTranslatorfrom dotenv import load_dotenv load_dotenv()sample_text = """[Generated with ChatGPT] Confidential Document - For Internal Use Only Date: July 1, 2023 Subject: Updates and Discussions on Various Topics Dear Team,...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/document_transformers/doctran_extract_properties.ipynb
import json from langchain.schema import Document from langchain.document_transformers import DoctranPropertyExtractorfrom dotenv import load_dotenv load_dotenv()sample_text = """[Generated with ChatGPT] Confidential Document - For Internal Use Only Date: July 1, 2023 Subject: Updates and Discussions on Various Top...
0
3,792
[{"tag": "EMAIL", "value": "john.doe@example.com", "start": 796, "end": 816}, {"tag": "EMAIL", "value": "security@example.com", "start": 1139, "end": 1159}, {"tag": "EMAIL", "value": "michael.johnson@example.com", "start": 1743, "end": 1770}, {"tag": "EMAIL", "value": "david.rodriguez@example.com", "start": 2566, "end"...
true
5
import json from langchain.schema import Document from langchain.document_transformers import DoctranPropertyExtractorfrom dotenv import load_dotenv load_dotenv()sample_text = """[Generated with ChatGPT] Confidential Document - For Internal Use Only Date: July 1, 2023 Subject: Updates and Discussions on Various Top...
true
import json from langchain.schema import Document from langchain.document_transformers import DoctranPropertyExtractorfrom dotenv import load_dotenv load_dotenv()sample_text = """[Generated with ChatGPT] Confidential Document - For Internal Use Only Date: July 1, 2023 Subject: Updates and Discussions on Various Top...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/document_transformers/doctran_interrogate_document.ipynb
import json from langchain.schema import Document from langchain.document_transformers import DoctranQATransformerfrom dotenv import load_dotenv load_dotenv()sample_text = """[Generated with ChatGPT] Confidential Document - For Internal Use Only Date: July 1, 2023 Subject: Updates and Discussions on Various Topics ...
0
3,793
[{"tag": "EMAIL", "value": "john.doe@example.com", "start": 792, "end": 812}, {"tag": "EMAIL", "value": "security@example.com", "start": 1135, "end": 1155}, {"tag": "EMAIL", "value": "michael.johnson@example.com", "start": 1739, "end": 1766}, {"tag": "EMAIL", "value": "david.rodriguez@example.com", "start": 2562, "end"...
true
5
import json from langchain.schema import Document from langchain.document_transformers import DoctranQATransformerfrom dotenv import load_dotenv load_dotenv()sample_text = """[Generated with ChatGPT] Confidential Document - For Internal Use Only Date: July 1, 2023 Subject: Updates and Discussions on Various Topics ...
true
import json from langchain.schema import Document from langchain.document_transformers import DoctranQATransformerfrom dotenv import load_dotenv load_dotenv()sample_text = """[Generated with ChatGPT] Confidential Document - For Internal Use Only Date: July 1, 2023 Subject: Updates and Discussions on Various Topics ...
hf_public_repos/langchain-ai/langchain/libs/experimental/tests
hf_public_repos/langchain-ai/langchain/libs/experimental/tests/unit_tests/test_data_anonymizer.py
from typing import Iterator, List import pytest from . import is_libcublas_available @pytest.fixture(scope="module", autouse=True) def check_spacy_model() -> Iterator[None]: import spacy if not spacy.util.is_package("en_core_web_lg"): pytest.skip(reason="Spacy model 'en_core_web_lg' not installed")...
0
1,314
[{"tag": "EMAIL", "value": "johnsmith@gmail.com", "start": 2153, "end": 2172}, {"tag": "EMAIL", "value": "johnsmith@gmail.com", "start": 2311, "end": 2330}, {"tag": "EMAIL", "value": "wdavis@example.net", "start": 6008, "end": 6026}, {"tag": "EMAIL", "value": "real.slim.shady@gmail.com", "start": 6030, "end": 6055}, {"...
true
11
from typing import Iterator, List import pytest from . import is_libcublas_available @pytest.fixture(scope="module", autouse=True) def check_spacy_model() -> Iterator[None]: import spacy if not spacy.util.is_package("en_core_web_lg"): pytest.skip(reason="Spacy model 'en_core_web_lg' not installed")...
true
from typing import Iterator, List import pytest from . import is_libcublas_available @pytest.fixture(scope="module", autouse=True) def check_spacy_model() -> Iterator[None]: import spacy if not spacy.util.is_package("en_core_web_lg"): pytest.skip(reason="Spacy model 'en_core_web_lg' not installed")...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/memory/sql_chat_message_history.ipynb
from langchain.memory.chat_message_histories import SQLChatMessageHistory chat_message_history = SQLChatMessageHistory( session_id="test_session", connection_string="sqlite:///sqlite.db" ) chat_message_history.add_user_message("Hello") chat_message_history.add_ai_message("Hi")chat_message_history.messagesfrom dat...
0
3,696
[{"tag": "EMAIL", "value": "test@example.com", "start": 2180, "end": 2196}]
true
1
from langchain.memory.chat_message_histories import SQLChatMessageHistory chat_message_history = SQLChatMessageHistory( session_id="test_session", connection_string="sqlite:///sqlite.db" ) chat_message_history.add_user_message("Hello") chat_message_history.add_ai_message("Hi")chat_message_history.messagesfrom dat...
true
from langchain.memory.chat_message_histories import SQLChatMessageHistory chat_message_history = SQLChatMessageHistory( session_id="test_session", connection_string="sqlite:///sqlite.db" ) chat_message_history.add_user_message("Hello") chat_message_history.add_ai_message("Hi")chat_message_history.messagesfrom dat...
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain/tools
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain/tools/office365/messages_search.py
"""Util that Searches email messages in Office 365. Free, but setup is required. See link below. https://learn.microsoft.com/en-us/graph/auth/ """ from typing import Any, Dict, List, Optional, Type from langchain.callbacks.manager import CallbackManagerForToolRun from langchain.pydantic_v1 import BaseModel, Extra, F...
0
2,611
[{"tag": "EMAIL", "value": "samanthab@contoso.com", "start": 1359, "end": 1380}, {"tag": "EMAIL", "value": "samanthab@contoso.com", "start": 1386, "end": 1407}]
true
2
"""Util that Searches email messages in Office 365. Free, but setup is required. See link below. https://learn.microsoft.com/en-us/graph/auth/ """ from typing import Any, Dict, List, Optional, Type from langchain.callbacks.manager import CallbackManagerForToolRun from langchain.pydantic_v1 import BaseModel, Extra, F...
true
"""Util that Searches email messages in Office 365. Free, but setup is required. See link below. https://learn.microsoft.com/en-us/graph/auth/ """ from typing import Any, Dict, List, Optional, Type from langchain.callbacks.manager import CallbackManagerForToolRun from langchain.pydantic_v1 import BaseModel, Extra, F...
hf_public_repos/eosphoros-ai
hf_public_repos/eosphoros-ai/DB-GPT/setup.py
from typing import List, Tuple import setuptools import platform import subprocess import os from enum import Enum import urllib.request from urllib.parse import urlparse, quote import re import shutil from setuptools import find_packages with open("README.md", mode="r", encoding="utf-8") as fh: long_description ...
0
248
[{"tag": "EMAIL", "value": "cfqcsunny@gmail.com", "start": 13595, "end": 13614}]
true
1
from typing import List, Tuple import setuptools import platform import subprocess import os from enum import Enum import urllib.request from urllib.parse import urlparse, quote import re import shutil from setuptools import find_packages with open("README.md", mode="r", encoding="utf-8") as fh: long_description ...
true
from typing import List, Tuple import setuptools import platform import subprocess import os from enum import Enum import urllib.request from urllib.parse import urlparse, quote import re import shutil from setuptools import find_packages with open("README.md", mode="r", encoding="utf-8") as fh: long_description ...
hf_public_repos/zilliztech/GPTCache/tests
hf_public_repos/zilliztech/GPTCache/tests/integration_tests/test_redis_onnx.py
import random from unittest.mock import patch from gptcache import Cache from gptcache.adapter import openai from gptcache.adapter.api import init_similar_cache from gptcache.embedding import Onnx from gptcache.manager import manager_factory from gptcache.processor.pre import last_content from gptcache.utils.response ...
0
805
[{"tag": "KEY", "value": "chatcmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 1737, "end": 1775}]
true
1
import random from unittest.mock import patch from gptcache import Cache from gptcache.adapter import openai from gptcache.adapter.api import init_similar_cache from gptcache.embedding import Onnx from gptcache.manager import manager_factory from gptcache.processor.pre import last_content from gptcache.utils.response ...
true
import random from unittest.mock import patch from gptcache import Cache from gptcache.adapter import openai from gptcache.adapter.api import init_similar_cache from gptcache.embedding import Onnx from gptcache.manager import manager_factory from gptcache.processor.pre import last_content from gptcache.utils.response ...
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain/utilities/zapier.py
"""Util that can interact with Zapier NLA. Full docs here: https://nla.zapier.com/start/ Note: this wrapper currently only implemented the `api_key` auth method for testing and server-side production use cases (using the developer's connected accounts on Zapier.com) For use-cases where LangChain + Zapier NLA is powe...
0
2,670
[{"tag": "EMAIL", "value": "nla@zapier.com", "start": 501, "end": 515}]
true
1
"""Util that can interact with Zapier NLA. Full docs here: https://nla.zapier.com/start/ Note: this wrapper currently only implemented the `api_key` auth method for testing and server-side production use cases (using the developer's connected accounts on Zapier.com) For use-cases where LangChain + Zapier NLA is powe...
true
"""Util that can interact with Zapier NLA. Full docs here: https://nla.zapier.com/start/ Note: this wrapper currently only implemented the `api_key` auth method for testing and server-side production use cases (using the developer's connected accounts on Zapier.com) For use-cases where LangChain + Zapier NLA is powe...
hf_public_repos/langchain-ai/langchain/docs/docs/guides/privacy
hf_public_repos/langchain-ai/langchain/docs/docs/guides/privacy/presidio_data_anonymization/reversible.ipynb
# Install necessary packages # ! pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker # ! python -m spacy download en_core_web_lgfrom langchain_experimental.data_anonymizer import PresidioReversibleAnonymizer anonymizer = PresidioReversibleAnonymizer( analyzed_field...
0
4,002
[{"tag": "EMAIL", "value": "real.slim.shady@gmail.com", "start": 690, "end": 715}, {"tag": "EMAIL", "value": "jamesmichael@example.com", "start": 899, "end": 923}, {"tag": "EMAIL", "value": "real.slim.shady@gmail.com", "start": 2589, "end": 2614}, {"tag": "EMAIL", "value": "wdavis@example.net", "start": 4689, "end": 47...
true
4
# Install necessary packages # ! pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker # ! python -m spacy download en_core_web_lgfrom langchain_experimental.data_anonymizer import PresidioReversibleAnonymizer anonymizer = PresidioReversibleAnonymizer( analyzed_field...
true
# Install necessary packages # ! pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker # ! python -m spacy download en_core_web_lgfrom langchain_experimental.data_anonymizer import PresidioReversibleAnonymizer anonymizer = PresidioReversibleAnonymizer( analyzed_field...
hf_public_repos/zilliztech/GPTCache/tests
hf_public_repos/zilliztech/GPTCache/tests/unit_tests/test_session.py
import unittest from unittest.mock import patch from openai.error import AuthenticationError from gptcache import cache from gptcache.adapter import openai from gptcache.manager import manager_factory from gptcache.session import Session from gptcache.processor.pre import get_prompt from gptcache.embedding import Onnx...
0
817
[{"tag": "KEY", "value": "cmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 1361, "end": 1395}, {"tag": "KEY", "value": "cmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 2362, "end": 2396}, {"tag": "KEY", "value": "cmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 4280, "end": 4314}]
true
3
import unittest from unittest.mock import patch from openai.error import AuthenticationError from gptcache import cache from gptcache.adapter import openai from gptcache.manager import manager_factory from gptcache.session import Session from gptcache.processor.pre import get_prompt from gptcache.embedding import Onnx...
true
import unittest from unittest.mock import patch from openai.error import AuthenticationError from gptcache import cache from gptcache.adapter import openai from gptcache.manager import manager_factory from gptcache.session import Session from gptcache.processor.pre import get_prompt from gptcache.embedding import Onnx...
hf_public_repos/zilliztech/GPTCache/tests/unit_tests
hf_public_repos/zilliztech/GPTCache/tests/unit_tests/utils/test_response.py
from gptcache.utils.response import ( get_message_from_openai_answer, get_stream_message_from_openai_answer, ) def test_get_message_from_openai_answer(): message = get_message_from_openai_answer( { "choices": [ { "finish_reason": "stop", ...
0
862
[{"tag": "KEY", "value": "chatcmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 1119, "end": 1157}, {"tag": "KEY", "value": "chatcmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 1498, "end": 1536}, {"tag": "KEY", "value": "chatcmpl-6ptKqrhgRoVchm58Bby0UvJzq2ZuQ", "start": 501, "end": 539}]
true
3
from gptcache.utils.response import ( get_message_from_openai_answer, get_stream_message_from_openai_answer, ) def test_get_message_from_openai_answer(): message = get_message_from_openai_answer( { "choices": [ { "finish_reason": "stop", ...
true
from gptcache.utils.response import ( get_message_from_openai_answer, get_stream_message_from_openai_answer, ) def test_get_message_from_openai_answer(): message = get_message_from_openai_answer( { "choices": [ { "finish_reason": "stop", ...
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/integration_tests
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/integration_tests/llms/test_opaqueprompts.py
import langchain.utilities.opaqueprompts as op from langchain.chains.llm import LLMChain from langchain.llms import OpenAI from langchain.llms.opaqueprompts import OpaquePrompts from langchain.memory import ConversationBufferWindowMemory from langchain.prompts import PromptTemplate from langchain.schema.output_parser i...
0
1,503
[{"tag": "EMAIL", "value": "johndoe@example.com", "start": 1323, "end": 1342}, {"tag": "IP_ADDRESS", "value": "192.168.1.1", "start": 2242, "end": 2253}]
true
2
import langchain.utilities.opaqueprompts as op from langchain.chains.llm import LLMChain from langchain.llms import OpenAI from langchain.llms.opaqueprompts import OpaquePrompts from langchain.memory import ConversationBufferWindowMemory from langchain.prompts import PromptTemplate from langchain.schema.output_parser i...
true
import langchain.utilities.opaqueprompts as op from langchain.chains.llm import LLMChain from langchain.llms import OpenAI from langchain.llms.opaqueprompts import OpaquePrompts from langchain.memory import ConversationBufferWindowMemory from langchain.prompts import PromptTemplate from langchain.schema.output_parser i...
hf_public_repos/zilliztech/GPTCache/tests/unit_tests
hf_public_repos/zilliztech/GPTCache/tests/unit_tests/adapter/test_llama_cpp.py
import os import sys import unittest from unittest.mock import patch, MagicMock from tempfile import TemporaryDirectory from gptcache import Cache from gptcache.processor.pre import get_prompt from gptcache.manager.factory import manager_factory from gptcache.embedding import Onnx question = "test_llama_cpp" expect_a...
0
853
[{"tag": "KEY", "value": "chatcmpl-6ptKqrhgRoVchm58Bby0UvJzq2ZuQ", "start": 740, "end": 778}]
true
1
import os import sys import unittest from unittest.mock import patch, MagicMock from tempfile import TemporaryDirectory from gptcache import Cache from gptcache.processor.pre import get_prompt from gptcache.manager.factory import manager_factory from gptcache.embedding import Onnx question = "test_llama_cpp" expect_a...
true
import os import sys import unittest from unittest.mock import patch, MagicMock from tempfile import TemporaryDirectory from gptcache import Cache from gptcache.processor.pre import get_prompt from gptcache.manager.factory import manager_factory from gptcache.embedding import Onnx question = "test_llama_cpp" expect_a...
hf_public_repos/melih-unsal/DemoGPT
hf_public_repos/melih-unsal/DemoGPT/demogpt/app.py
import logging import os import signal import sys import streamlit as st import streamlit.components.v1 as components current_file_path = os.path.abspath(__file__) current_directory = os.path.dirname(current_file_path) parent_directory = os.path.dirname(current_directory) grandparent_directory = os.path.dirname(paren...
0
571
[{"tag": "EMAIL", "value": "example@example.com", "start": 6319, "end": 6338}]
true
1
import logging import os import signal import sys import streamlit as st import streamlit.components.v1 as components current_file_path = os.path.abspath(__file__) current_directory = os.path.dirname(current_file_path) parent_directory = os.path.dirname(current_directory) grandparent_directory = os.path.dirname(paren...
true
import logging import os import signal import sys import streamlit as st import streamlit.components.v1 as components current_file_path = os.path.abspath(__file__) current_directory = os.path.dirname(current_file_path) parent_directory = os.path.dirname(current_directory) grandparent_directory = os.path.dirname(paren...
hf_public_repos/eosphoros-ai/DB-GPT/pilot/base_modules
hf_public_repos/eosphoros-ai/DB-GPT/pilot/base_modules/agent/plugins_util.py
"""加载组件""" import json import os import glob import zipfile import fnmatch import requests import git import threading import datetime import logging from pathlib import Path from typing import List from urllib.parse import urlparse from zipimport import zipimporter import requests from auto_gpt_plugin_template impor...
0
512
[{"tag": "KEY", "value": "ghp", "start": 2827, "end": 2830}, {"tag": "KEY", "value": "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", "start": 2827, "end": 2867}]
true
2
"""加载组件""" import json import os import glob import zipfile import fnmatch import requests import git import threading import datetime import logging from pathlib import Path from typing import List from urllib.parse import urlparse from zipimport import zipimporter import requests from auto_gpt_plugin_template impor...
true
"""加载组件""" import json import os import glob import zipfile import fnmatch import requests import git import threading import datetime import logging from pathlib import Path from typing import List from urllib.parse import urlparse from zipimport import zipimporter import requests from auto_gpt_plugin_template impor...
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/integration_tests
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/integration_tests/document_loaders/test_email.py
from pathlib import Path from langchain.document_loaders import OutlookMessageLoader, UnstructuredEmailLoader def test_outlook_message_loader() -> None: """Test OutlookMessageLoader.""" file_path = Path(__file__).parent.parent / "examples/hello.msg" loader = OutlookMessageLoader(str(file_path)) docs ...
0
1,615
[{"tag": "EMAIL", "value": "brizhou@gmail.com", "start": 480, "end": 497}]
true
1
from pathlib import Path from langchain.document_loaders import OutlookMessageLoader, UnstructuredEmailLoader def test_outlook_message_loader() -> None: """Test OutlookMessageLoader.""" file_path = Path(__file__).parent.parent / "examples/hello.msg" loader = OutlookMessageLoader(str(file_path)) docs ...
true
from pathlib import Path from langchain.document_loaders import OutlookMessageLoader, UnstructuredEmailLoader def test_outlook_message_loader() -> None: """Test OutlookMessageLoader.""" file_path = Path(__file__).parent.parent / "examples/hello.msg" loader = OutlookMessageLoader(str(file_path)) docs ...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/llms/opaqueprompts.ipynb
# install the opaqueprompts and langchain packages ! pip install opaqueprompts langchainimport os # Set API keys os.environ["OPAQUEPROMPTS_API_KEY"] = "<OPAQUEPROMPTS_API_KEY>" os.environ["OPENAI_API_KEY"] = "<OPENAI_API_KEY>"from langchain.chains import LLMChain from langchain.prompts import PromptTemplate from lang...
0
3,621
[{"tag": "EMAIL", "value": "johndoe@example.com", "start": 1524, "end": 1543}, {"tag": "IP_ADDRESS", "value": "192.168.1.1", "start": 2443, "end": 2454}]
true
2
# install the opaqueprompts and langchain packages ! pip install opaqueprompts langchainimport os # Set API keys os.environ["OPAQUEPROMPTS_API_KEY"] = "<OPAQUEPROMPTS_API_KEY>" os.environ["OPENAI_API_KEY"] = "<OPENAI_API_KEY>"from langchain.chains import LLMChain from langchain.prompts import PromptTemplate from lang...
true
# install the opaqueprompts and langchain packages ! pip install opaqueprompts langchainimport os # Set API keys os.environ["OPAQUEPROMPTS_API_KEY"] = "<OPAQUEPROMPTS_API_KEY>" os.environ["OPENAI_API_KEY"] = "<OPENAI_API_KEY>"from langchain.chains import LLMChain from langchain.prompts import PromptTemplate from lang...
hf_public_repos/langchain-ai/langchain/docs/docs/guides/privacy
hf_public_repos/langchain-ai/langchain/docs/docs/guides/privacy/presidio_data_anonymization/index.ipynb
# Install necessary packages # ! pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker # ! python -m spacy download en_core_web_lgfrom langchain_experimental.data_anonymizer import PresidioAnonymizer anonymizer = PresidioAnonymizer() anonymizer.anonymize( "My name i...
0
4,001
[{"tag": "EMAIL", "value": "real.slim.shady@gmail.com", "start": 373, "end": 398}, {"tag": "EMAIL", "value": "real.slim.shady@gmail.com", "start": 1292, "end": 1317}, {"tag": "EMAIL", "value": "real.slim.shady@gmail.com", "start": 1485, "end": 1510}, {"tag": "EMAIL", "value": "real.slim.shady@gmail.com", "start": 1636,...
true
4
# Install necessary packages # ! pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker # ! python -m spacy download en_core_web_lgfrom langchain_experimental.data_anonymizer import PresidioAnonymizer anonymizer = PresidioAnonymizer() anonymizer.anonymize( "My name i...
true
# Install necessary packages # ! pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker # ! python -m spacy download en_core_web_lgfrom langchain_experimental.data_anonymizer import PresidioAnonymizer anonymizer = PresidioAnonymizer() anonymizer.anonymize( "My name i...
hf_public_repos/langchain-ai/langchain/docs/docs/guides/privacy
hf_public_repos/langchain-ai/langchain/docs/docs/guides/privacy/presidio_data_anonymization/qa_privacy_protection.ipynb
# Install necessary packages # !pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker faiss-cpu tiktoken # ! python -m spacy download en_core_web_lgdocument_content = """Date: October 19, 2021 Witness: John Doe Subject: Testimony Regarding the Loss of Wallet Testimony...
0
4,003
[{"tag": "EMAIL", "value": "johndoe@example.com", "start": 1169, "end": 1188}, {"tag": "EMAIL", "value": "support@bankname.com", "start": 1436, "end": 1456}]
true
2
# Install necessary packages # !pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker faiss-cpu tiktoken # ! python -m spacy download en_core_web_lgdocument_content = """Date: October 19, 2021 Witness: John Doe Subject: Testimony Regarding the Loss of Wallet Testimony...
true
# Install necessary packages # !pip install langchain langchain-experimental openai presidio-analyzer presidio-anonymizer spacy Faker faiss-cpu tiktoken # ! python -m spacy download en_core_web_lgdocument_content = """Date: October 19, 2021 Witness: John Doe Subject: Testimony Regarding the Loss of Wallet Testimony...
hf_public_repos/davila7/langchain-101
hf_public_repos/davila7/langchain-101/functions_callings/talk_send_message_vanilla.py
import streamlit as st from bokeh.models.widgets import Button from bokeh.models import CustomJS from streamlit_bokeh_events import streamlit_bokeh_events from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail import openai import json import os from dotenv import load_dotenv load_dotenv() def ...
0
749
[{"tag": "EMAIL", "value": "daniel@judini.ai", "start": 587, "end": 603}, {"tag": "EMAIL", "value": "dan.avila7@gmail.com", "start": 1330, "end": 1350}]
true
2
import streamlit as st from bokeh.models.widgets import Button from bokeh.models import CustomJS from streamlit_bokeh_events import streamlit_bokeh_events from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail import openai import json import os from dotenv import load_dotenv load_dotenv() def ...
true
import streamlit as st from bokeh.models.widgets import Button from bokeh.models import CustomJS from streamlit_bokeh_events import streamlit_bokeh_events from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail import openai import json import os from dotenv import load_dotenv load_dotenv() def ...
hf_public_repos/zilliztech/GPTCache/tests/unit_tests
hf_public_repos/zilliztech/GPTCache/tests/unit_tests/adapter/test_openai.py
import asyncio import base64 import os import random from io import BytesIO from unittest.mock import AsyncMock, patch from urllib.request import urlopen import pytest from gptcache import Cache, cache from gptcache.adapter import openai from gptcache.adapter.api import init_similar_cache from gptcache.config import ...
0
856
[{"tag": "KEY", "value": "chatcmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 1643, "end": 1681}, {"tag": "KEY", "value": "chatcmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 3269, "end": 3307}, {"tag": "KEY", "value": "chatcmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 4576, "end": 4614}, {"tag": "KEY", "value": "chatcmpl-...
true
28
import asyncio import base64 import os import random from io import BytesIO from unittest.mock import AsyncMock, patch from urllib.request import urlopen import pytest from gptcache import Cache, cache from gptcache.adapter import openai from gptcache.adapter.api import init_similar_cache from gptcache.config import ...
true
import asyncio import base64 import os import random from io import BytesIO from unittest.mock import AsyncMock, patch from urllib.request import urlopen import pytest from gptcache import Cache, cache from gptcache.adapter import openai from gptcache.adapter.api import init_similar_cache from gptcache.config import ...
hf_public_repos/zilliztech/GPTCache/tests/unit_tests
hf_public_repos/zilliztech/GPTCache/tests/unit_tests/adapter/test_api.py
# pylint: disable=wrong-import-position import os from pathlib import Path from unittest.mock import patch from gptcache import cache, Config, Cache from gptcache.adapter import openai from gptcache.adapter.api import put, get, init_similar_cache, init_similar_cache_from_config from gptcache.embedding import Onnx as E...
0
860
[{"tag": "KEY", "value": "chatcmpl-6ptKyqKOGXZT6iQnqiXAH8adNLUzD", "start": 4642, "end": 4680}]
true
1
# pylint: disable=wrong-import-position import os from pathlib import Path from unittest.mock import patch from gptcache import cache, Config, Cache from gptcache.adapter import openai from gptcache.adapter.api import put, get, init_similar_cache, init_similar_cache_from_config from gptcache.embedding import Onnx as E...
true
# pylint: disable=wrong-import-position import os from pathlib import Path from unittest.mock import patch from gptcache import cache, Config, Cache from gptcache.adapter import openai from gptcache.adapter.api import put, get, init_similar_cache, init_similar_cache_from_config from gptcache.embedding import Onnx as E...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/tools/awslambda.ipynb
from langchain.llms import OpenAI from langchain.agents import load_tools, initialize_agent, AgentType llm = OpenAI(temperature=0) tools = load_tools( ["awslambda"], awslambda_tool_name="email-sender", awslambda_tool_description="sends an email with the specified content to test@testing123.com", funct...
0
3,721
[{"tag": "EMAIL", "value": "test@testing123.com", "start": 289, "end": 308}, {"tag": "EMAIL", "value": "test@testing123.com", "start": 480, "end": 499}]
true
2
from langchain.llms import OpenAI from langchain.agents import load_tools, initialize_agent, AgentType llm = OpenAI(temperature=0) tools = load_tools( ["awslambda"], awslambda_tool_name="email-sender", awslambda_tool_description="sends an email with the specified content to lyhxr@example.com", functio...
true
from langchain.llms import OpenAI from langchain.agents import load_tools, initialize_agent, AgentType llm = OpenAI(temperature=0) tools = load_tools( ["awslambda"], awslambda_tool_name="email-sender", awslambda_tool_description="sends an email with the specified content to PI:EMAIL:lyhxr@example.comEND_P...
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/unit_tests
hf_public_repos/langchain-ai/langchain/libs/langchain/tests/unit_tests/document_loaders/test_trello.py
import unittest from collections import namedtuple from typing import Any, Optional from unittest.mock import patch import pytest from langchain.document_loaders.trello import TrelloLoader def list_to_objects(dict_list: list) -> list: """Helper to convert dict objects.""" return [ namedtuple("Object...
0
1,924
[{"tag": "KEY", "value": "5555059b74c03b3a9e362cd0", "start": 1373, "end": 1397}, {"tag": "KEY", "value": "55559f6002dd973ad8cdbfb7", "start": 5305, "end": 5329}, {"tag": "KEY", "value": "5555cacbc4daa90564b34cf2", "start": 1273, "end": 1297}, {"tag": "KEY", "value": "555505a3427fd688c1ca5ebd", "start": 1455, "end": 14...
true
7
import unittest from collections import namedtuple from typing import Any, Optional from unittest.mock import patch import pytest from langchain.document_loaders.trello import TrelloLoader def list_to_objects(dict_list: list) -> list: """Helper to convert dict objects.""" return [ namedtuple("Object...
true
import unittest from collections import namedtuple from typing import Any, Optional from unittest.mock import patch import pytest from langchain.document_loaders.trello import TrelloLoader def list_to_objects(dict_list: list) -> list: """Helper to convert dict objects.""" return [ namedtuple("Object...
hf_public_repos/radi-cho
hf_public_repos/radi-cho/datasetGPT/setup.py
from distutils.core import setup from setuptools import find_packages with open("README.md", "r", encoding = "utf-8") as readme: long_description = readme.read() setup( name="datasetGPT", version="0.0.4", description="Generate textual and conversational datasets with LLMs.", long_description = lon...
0
90
[{"tag": "EMAIL", "value": "radicho123@gmail.com", "start": 438, "end": 458}]
true
1
from distutils.core import setup from setuptools import find_packages with open("README.md", "r", encoding = "utf-8") as readme: long_description = readme.read() setup( name="datasetGPT", version="0.0.4", description="Generate textual and conversational datasets with LLMs.", long_description = lon...
true
from distutils.core import setup from setuptools import find_packages with open("README.md", "r", encoding = "utf-8") as readme: long_description = readme.read() setup( name="datasetGPT", version="0.0.4", description="Generate textual and conversational datasets with LLMs.", long_description = lon...
hf_public_repos/langchain-ai/langchain/docs/docs/integrations
hf_public_repos/langchain-ai/langchain/docs/docs/integrations/chat_loaders/gmail.ipynb
import os.path import base64 import json import re import time from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build import logging import requests SCOPES = ["https://www.go...
0
3,673
[{"tag": "EMAIL", "value": "hchase@langchain.com", "start": 1536, "end": 1556}, {"tag": "EMAIL", "value": "hchase@langchain.com", "start": 1723, "end": 1743}]
true
2
import os.path import base64 import json import re import time from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build import logging import requests SCOPES = ["https://www.go...
true
import os.path import base64 import json import re import time from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build import logging import requests SCOPES = ["https://www.go...
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain/chains
hf_public_repos/langchain-ai/langchain/libs/langchain/langchain/chains/graph_qa/prompts.py
# flake8: noqa from langchain.prompts.prompt import PromptTemplate _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = """Extract all entities from the following text. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places. Return the output as a single comma-separated list, or N...
0
2,326
[{"tag": "EMAIL", "value": "jane.doe@foo.bar", "start": 6550, "end": 6566}, {"tag": "EMAIL", "value": "jane.doe@foo.bar", "start": 6743, "end": 6759}]
true
2
# flake8: noqa from langchain.prompts.prompt import PromptTemplate _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = """Extract all entities from the following text. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places. Return the output as a single comma-separated list, or N...
true
# flake8: noqa from langchain.prompts.prompt import PromptTemplate _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = """Extract all entities from the following text. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places. Return the output as a single comma-separated list, or N...
hf_public_repos/JorisdeJong123/7-Days-of-LangChain
hf_public_repos/JorisdeJong123/7-Days-of-LangChain/day_4/scientific_newsletter.py
""" This script shows how to create a newsletter based on the latest Arxiv articles. We're using an easy LangChain implementation to show how to use the different components of LangChain. This is part of my '7 Days of LangChain' series. Check out the explanation about the code on my Twitter (@JorisTechTalk) """ fro...
0
102
[{"tag": "EMAIL", "value": "jorisdejong456@gmail.com", "start": 2878, "end": 2902}]
true
1
""" This script shows how to create a newsletter based on the latest Arxiv articles. We're using an easy LangChain implementation to show how to use the different components of LangChain. This is part of my '7 Days of LangChain' series. Check out the explanation about the code on my Twitter (@JorisTechTalk) """ fro...
true
""" This script shows how to create a newsletter based on the latest Arxiv articles. We're using an easy LangChain implementation to show how to use the different components of LangChain. This is part of my '7 Days of LangChain' series. Check out the explanation about the code on my Twitter (@JorisTechTalk) """ fro...