repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3.py | test_s3_readwrite_text | assert | variable | 59 | from __future__ import unicode_literals
import contextlib
import io
import os
import random
import string
import boto3
import smart_open
_BUCKET = os.environ.get('SO_BUCKET')
_KEY = os.environ.get('SO_KEY')
def _random_string(length=8):
alphabet = string.ascii_lowercase + string.digits
return ''.join(random... | text | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3.py | test_s3_readwrite_binary | assert | variable | 59 | from __future__ import unicode_literals
import contextlib
import io
import os
import random
import string
import boto3
import smart_open
_BUCKET = os.environ.get('SO_BUCKET')
_KEY = os.environ.get('SO_KEY')
def _random_string(length=8):
alphabet = string.ascii_lowercase + string.digits
return ''.join(random... | binary | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3.py | test_s3_performance | assert | variable | 63 | from __future__ import unicode_literals
import contextlib
import io
import os
import random
import string
import boto3
import smart_open
_BUCKET = os.environ.get('SO_BUCKET')
_KEY = os.environ.get('SO_KEY')
def _random_string(length=8):
alphabet = string.ascii_lowercase + string.digits
return ''.join(random... | one_megabyte | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3.py | test_s3_performance_small_reads | assert | variable | 68 | from __future__ import unicode_literals
import contextlib
import io
import os
import random
import string
import boto3
import smart_open
_BUCKET = os.environ.get('SO_BUCKET')
_KEY = os.environ.get('SO_KEY')
def _random_string(length=8):
alphabet = string.ascii_lowercase + string.digits
return ''.join(random... | one_megabyte_of_msgs | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_buffering.py | test | assert | variable | 22 | from smart_open import open
def read_bytes(url, limit):
bytes_ = []
with open(url, 'rb') as fin:
for i in range(limit):
bytes_.append(fin.read(1))
return bytes_
def test(benchmark):
#
# This file is around 850MB.
#
url = (
's3://commoncrawl/crawl-data/CC-MAIN-2... | limit | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_ported.py | test_seek_start | self.assertEqual | numeric_literal | 33 | import contextlib
import gzip
import io
import unittest
import uuid
import warnings
import boto3
import pytest
import smart_open
import smart_open.concurrency
import smart_open.constants
from initialize_s3_bucket import CONTENTS
BUCKET_NAME = 'smartopen-integration-tests'
def setUpModule():
assert boto3.resourc... | 6) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_ported.py | test_multipart | self.assertEqual | numeric_literal | 43 | import contextlib
import gzip
import io
import unittest
import uuid
import warnings
import boto3
import pytest
import smart_open
import smart_open.concurrency
import smart_open.constants
from initialize_s3_bucket import CONTENTS
BUCKET_NAME = 'smartopen-integration-tests'
def setUpModule():
assert boto3.resourc... | 4) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_ported.py | test_multipart | self.assertEqual | numeric_literal | 46 | import contextlib
import gzip
import io
import unittest
import uuid
import warnings
import boto3
import pytest
import smart_open
import smart_open.concurrency
import smart_open.constants
from initialize_s3_bucket import CONTENTS
BUCKET_NAME = 'smartopen-integration-tests'
def setUpModule():
assert boto3.resourc... | 9) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_ported.py | test_multipart | self.assertEqual | numeric_literal | 47 | import contextlib
import gzip
import io
import unittest
import uuid
import warnings
import boto3
import pytest
import smart_open
import smart_open.concurrency
import smart_open.constants
from initialize_s3_bucket import CONTENTS
BUCKET_NAME = 'smartopen-integration-tests'
def setUpModule():
assert boto3.resourc... | 0) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_ported.py | test_multipart | self.assertEqual | numeric_literal | 51 | import contextlib
import gzip
import io
import unittest
import uuid
import warnings
import boto3
import pytest
import smart_open
import smart_open.concurrency
import smart_open.constants
from initialize_s3_bucket import CONTENTS
BUCKET_NAME = 'smartopen-integration-tests'
def setUpModule():
assert boto3.resourc... | 1) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_ported.py | test_read0_does_not_return_data | self.assertEqual | string_literal | 33 | import contextlib
import gzip
import io
import unittest
import uuid
import warnings
import boto3
import pytest
import smart_open
import smart_open.concurrency
import smart_open.constants
from initialize_s3_bucket import CONTENTS
BUCKET_NAME = 'smartopen-integration-tests'
def setUpModule():
assert boto3.resourc... | b'') | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_ported.py | test_buffered_writer_wrapper_works | self.assertEqual | variable | 51 | import contextlib
import gzip
import io
import unittest
import uuid
import warnings
import boto3
import pytest
import smart_open
import smart_open.concurrency
import smart_open.constants
from initialize_s3_bucket import CONTENTS
BUCKET_NAME = 'smartopen-integration-tests'
def setUpModule():
assert boto3.resourc... | text) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_ported.py | test_workers | assert | variable | 49 | import contextlib
import gzip
import io
import unittest
import uuid
import warnings
import boto3
import pytest
import smart_open
import smart_open.concurrency
import smart_open.constants
from initialize_s3_bucket import CONTENTS
BUCKET_NAME = 'smartopen-integration-tests'
def setUpModule():
assert boto3.resourc... | actual | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_ported.py | test_iter | self.assertEqual | variable | 36 | import contextlib
import gzip
import io
import unittest
import uuid
import warnings
import boto3
import pytest
import smart_open
import smart_open.concurrency
import smart_open.constants
from initialize_s3_bucket import CONTENTS
BUCKET_NAME = 'smartopen-integration-tests'
def setUpModule():
assert boto3.resourc... | actual) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_s3_readline.py | test | assert | variable | 24 | from smart_open import open
def read_lines(url, limit):
lines = []
with open(url, 'r', errors='ignore') as fin:
for i, l in enumerate(fin):
if i == limit:
break
lines.append(l)
return lines
def test(benchmark):
#
# This file is around 850MB.
#
... | limit | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_ssh.py | test | assert | variable | 31 | import os
import tempfile
import pytest
import smart_open
import smart_open.ssh
def explode(*args, **kwargs):
raise RuntimeError("this function should never have been called")
@pytest.mark.skipif("SMART_OPEN_SSH" not in os.environ, reason="this test only works on the dev machine")
def test():
with smart_open... | howto | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_ssh.py | test | assert | variable | 17 | import os
import tempfile
import pytest
import smart_open
import smart_open.ssh
def explode(*args, **kwargs):
raise RuntimeError("this function should never have been called")
@pytest.mark.skipif("SMART_OPEN_SSH" not in os.environ, reason="this test only works on the dev machine")
def test():
with smart_open... | readme | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_ssh.py | test | assert | complex_expr | 22 | import os
import tempfile
import pytest
import smart_open
import smart_open.ssh
def explode(*args, **kwargs):
raise RuntimeError("this function should never have been called")
@pytest.mark.skipif("SMART_OPEN_SSH" not in os.environ, reason="this test only works on the dev machine")
def test():
with smart_open... | smart_open.ssh._SSH | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_version_id.py | assert_equal | assert | variable | 10 | import boto3
from smart_open import open
BUCKET, KEY = 'smart-open-versioned', 'demo.txt'
URL = 's3://%s/%s' % (BUCKET, KEY)
def assert_equal(a, b):
assert a == | b | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_version_id.py | main | assert_* | variable | 20 | import boto3
from smart_open import open
BUCKET, KEY = 'smart-open-versioned', 'demo.txt'
URL = 's3://%s/%s' % (BUCKET, KEY)
def assert_equal(a, b):
assert a == b, '%r != %r' % (a, b)
def main():
versions = [
v.id for v in boto3.resource('s3').Bucket(BUCKET).object_versions.filter(Prefix=KEY)
]
... | expected_versions) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_version_id.py | main | assert_* | variable | 27 | import boto3
from smart_open import open
BUCKET, KEY = 'smart-open-versioned', 'demo.txt'
URL = 's3://%s/%s' % (BUCKET, KEY)
def assert_equal(a, b):
assert a == b, '%r != %r' % (a, b)
def main():
versions = [
v.id for v in boto3.resource('s3').Bucket(BUCKET).object_versions.filter(Prefix=KEY)
]
... | expected_contents) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_version_id.py | main | assert_* | complex_expr | 31 | import boto3
from smart_open import open
BUCKET, KEY = 'smart-open-versioned', 'demo.txt'
URL = 's3://%s/%s' % (BUCKET, KEY)
def assert_equal(a, b):
assert a == b, '%r != %r' % (a, b)
def main():
versions = [
v.id for v in boto3.resource('s3').Bucket(BUCKET).object_versions.filter(Prefix=KEY)
]
... | expected_contents[0]) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_webhdfs.py | test_not_found | assert | numeric_literal | 19 | import json
import os
import smart_open
from smart_open.webhdfs import WebHdfsException
import pytest
_SO_WEBHDFS_BASE_URL = os.environ.get("SO_WEBHDFS_BASE_URL")
def make_url(path):
return "{base_url}/{path}".format(
base_url=_SO_WEBHDFS_BASE_URL.rstrip("/"), path=path.lstrip("/")
)
def test_not_fou... | 404 | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_webhdfs.py | test_quoted_path | assert | variable | 24 | import json
import os
import smart_open
from smart_open.webhdfs import WebHdfsException
import pytest
_SO_WEBHDFS_BASE_URL = os.environ.get("SO_WEBHDFS_BASE_URL")
def make_url(path):
return "{base_url}/{path}".format(
base_url=_SO_WEBHDFS_BASE_URL.rstrip("/"), path=path.lstrip("/")
)
def test_quoted_... | filenames | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_webhdfs.py | test_write_and_read | assert | string_literal | 19 | import json
import os
import smart_open
from smart_open.webhdfs import WebHdfsException
import pytest
_SO_WEBHDFS_BASE_URL = os.environ.get("SO_WEBHDFS_BASE_URL")
def make_url(path):
return "{base_url}/{path}".format(
base_url=_SO_WEBHDFS_BASE_URL.rstrip("/"), path=path.lstrip("/")
)
def test_write_a... | "write_test\n" | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_webhdfs.py | test_not_found | pytest.raises | variable | 16 | import json
import os
import smart_open
from smart_open.webhdfs import WebHdfsException
import pytest
_SO_WEBHDFS_BASE_URL = os.environ.get("SO_WEBHDFS_BASE_URL")
def make_url(path):
return "{base_url}/{path}".format(
base_url=_SO_WEBHDFS_BASE_URL.rstrip("/"), path=path.lstrip("/")
)
def test_not_fou... | WebHdfsException) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | integration-tests/test_webhdfs.py | test_binary_write_and_read | assert | string_literal | 19 | import json
import os
import smart_open
from smart_open.webhdfs import WebHdfsException
import pytest
_SO_WEBHDFS_BASE_URL = os.environ.get("SO_WEBHDFS_BASE_URL")
def make_url(path):
return "{base_url}/{path}".format(
base_url=_SO_WEBHDFS_BASE_URL.rstrip("/"), path=path.lstrip("/")
)
def test_binary_... | b"binary_write_test\n" | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_azure.py | test_seek_start | self.assertEqual | numeric_literal | 86 | import gzip
import io
import logging
import os
import time
import uuid
import unittest
from collections import OrderedDict
import smart_open
import smart_open.constants
import azure.storage.blob
import azure.common
import azure.core.exceptions
CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME =... | 6) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_azure.py | test_write_03 | self.assertEqual | numeric_literal | 98 | import gzip
import io
import logging
import os
import time
import uuid
import unittest
from collections import OrderedDict
import smart_open
import smart_open.constants
import azure.storage.blob
import azure.common
import azure.core.exceptions
CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME =... | 0) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_azure.py | test_write_03 | self.assertEqual | numeric_literal | 104 | import gzip
import io
import logging
import os
import time
import uuid
import unittest
from collections import OrderedDict
import smart_open
import smart_open.constants
import azure.storage.blob
import azure.common
import azure.core.exceptions
CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME =... | 1) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_azure.py | test_write_03a | self.assertEqual | variable | 93 | import gzip
import io
import logging
import os
import time
import uuid
import unittest
from collections import OrderedDict
import smart_open
import smart_open.constants
import azure.storage.blob
import azure.common
import azure.core.exceptions
CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME =... | i) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_azure.py | test_delete_blob | self.assertEqual | collection | 42 | import gzip
import io
import logging
import os
import time
import uuid
import unittest
from collections import OrderedDict
import smart_open
import smart_open.constants
import azure.storage.blob
import azure.common
import azure.core.exceptions
CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME =... | []) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_azure.py | test_write_02 | self.assertEqual | numeric_literal | 86 | import gzip
import io
import logging
import os
import time
import uuid
import unittest
from collections import OrderedDict
import smart_open
import smart_open.constants
import azure.storage.blob
import azure.common
import azure.core.exceptions
CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME =... | 14) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_azure.py | test_read0_does_not_return_data | self.assertEqual | string_literal | 86 | import gzip
import io
import logging
import os
import time
import uuid
import unittest
from collections import OrderedDict
import smart_open
import smart_open.constants
import azure.storage.blob
import azure.common
import azure.core.exceptions
CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME =... | b'') | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_azure.py | test_upload_blob | self.assertEqual | variable | 41 | import gzip
import io
import logging
import os
import time
import uuid
import unittest
from collections import OrderedDict
import smart_open
import smart_open.constants
import azure.storage.blob
import azure.common
import azure.core.exceptions
CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME =... | data) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_azure.py | test_read_container_client | assert | variable | 88 | import gzip
import io
import logging
import os
import time
import uuid
import unittest
from collections import OrderedDict
import smart_open
import smart_open.constants
import azure.storage.blob
import azure.common
import azure.core.exceptions
CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME =... | content | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_bytebuffer.py | test_len | self.assertEqual | numeric_literal | 28 | import io
import random
import unittest
import smart_open.bytebuffer
CHUNK_SIZE = 1024
def int2byte(i):
return bytes((i, ))
def random_byte_string(length=CHUNK_SIZE):
rand_bytes = [int2byte(random.randint(0, 255)) for _ in range(length)]
return b''.join(rand_bytes)
def bytebuffer_and_random_contents():... | 0) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_bytebuffer.py | test_read | self.assertEqual | string_literal | 32 | import io
import random
import unittest
import smart_open.bytebuffer
CHUNK_SIZE = 1024
def int2byte(i):
return bytes((i, ))
def random_byte_string(length=CHUNK_SIZE):
rand_bytes = [int2byte(random.randint(0, 255)) for _ in range(length)]
return b''.join(rand_bytes)
def bytebuffer_and_random_contents():... | b'') | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_bytebuffer.py | test_readline_terminator | self.assertEqual | variable | 33 | import io
import random
import unittest
import smart_open.bytebuffer
CHUNK_SIZE = 1024
def int2byte(i):
return bytes((i, ))
def random_byte_string(length=CHUNK_SIZE):
rand_bytes = [int2byte(random.randint(0, 255)) for _ in range(length)]
return b''.join(rand_bytes)
def bytebuffer_and_random_contents():... | actual) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_bytebuffer.py | test_fill_from_reader | self.assertEqual | variable | 35 | import io
import random
import unittest
import smart_open.bytebuffer
CHUNK_SIZE = 1024
def int2byte(i):
return bytes((i, ))
def random_byte_string(length=CHUNK_SIZE):
rand_bytes = [int2byte(random.randint(0, 255)) for _ in range(length)]
return b''.join(rand_bytes)
def bytebuffer_and_random_contents():... | contents) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_bytebuffer.py | test_fill_size | self.assertEqual | variable | 35 | import io
import random
import unittest
import smart_open.bytebuffer
CHUNK_SIZE = 1024
def int2byte(i):
return bytes((i, ))
def random_byte_string(length=CHUNK_SIZE):
rand_bytes = [int2byte(random.randint(0, 255)) for _ in range(length)]
return b''.join(rand_bytes)
def bytebuffer_and_random_contents():... | fill_size) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_bytebuffer.py | test_fill_from_reader | self.assertEqual | variable | 33 | import io
import random
import unittest
import smart_open.bytebuffer
CHUNK_SIZE = 1024
def int2byte(i):
return bytes((i, ))
def random_byte_string(length=CHUNK_SIZE):
rand_bytes = [int2byte(random.randint(0, 255)) for _ in range(length)]
return b''.join(rand_bytes)
def bytebuffer_and_random_contents():... | CHUNK_SIZE) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_compression.py | test_compression_wrapper_read | assert | variable | 30 | import io
import gzip
import pytest
import smart_open.compression
plain = 'доброе утро планета!'.encode()
def label(thing, name):
setattr(thing, 'name', name)
return thing
@pytest.mark.parametrize(
'fileobj,compression,filename',
[
(io.BytesIO(plain), 'disable', None),
(io.BytesIO(pl... | plain | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_size | self.assertEqual | numeric_literal | 47 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | 4) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_seek_start | self.assertEqual | numeric_literal | 149 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | 6) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_write_03 | self.assertEqual | numeric_literal | 158 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | 0) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_write_03 | self.assertEqual | numeric_literal | 169 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | 1) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_write_03a | self.assertEqual | variable | 152 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | i) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_delete | self.assertEqual | collection | 47 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | []) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_delete | self.assertDictEqual | collection | 50 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | {}) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_write_02 | self.assertEqual | numeric_literal | 146 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | 14) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_unfinished_put_does_not_write_to_blob | self.assertEqual | string_literal | 57 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | b'') | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_finished_put_writes_to_blob | self.assertEqual | numeric_literal | 54 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | 200) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_gcs.py | test_read_never_returns_none | self.assertEqual | string_literal | 148 | import gzip
import inspect
import io
import logging
import os
import pickle
import time
import uuid
import unittest
from unittest import mock
import warnings
from collections import OrderedDict
import google.cloud
import google.api_core.exceptions
import smart_open
import smart_open.constants
BUCKET_NAME = 'test-sma... | b"") | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_hdfs.py | test_sanity_read_bytes | assert | numeric_literal | 24 | import gzip
import os
import os.path as P
import subprocess
from unittest import mock
import sys
import pytest
import smart_open.hdfs
CURR_DIR = P.dirname(P.abspath(__file__))
def cat(path=None):
command = [sys.executable, P.abspath(__file__)]
if path:
command.append(path)
return subprocess.Pope... | 3 | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_hdfs.py | test_sanity_read_text | assert | variable | 26 | import gzip
import os
import os.path as P
import subprocess
from unittest import mock
import sys
import pytest
import smart_open.hdfs
CURR_DIR = P.dirname(P.abspath(__file__))
def cat(path=None):
command = [sys.executable, P.abspath(__file__)]
if path:
command.append(path)
return subprocess.Pope... | expected | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_hdfs.py | test_read | assert | variable | 33 | import gzip
import os
import os.path as P
import subprocess
from unittest import mock
import sys
import pytest
import smart_open.hdfs
CURR_DIR = P.dirname(P.abspath(__file__))
def cat(path=None):
command = [sys.executable, P.abspath(__file__)]
if path:
command.append(path)
return subprocess.Pope... | CRIME_AND_PUNISHMENT | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_hdfs.py | test_read_75 | assert | func_call | 28 | import gzip
import os
import os.path as P
import subprocess
from unittest import mock
import sys
import pytest
import smart_open.hdfs
CURR_DIR = P.dirname(P.abspath(__file__))
def cat(path=None):
command = [sys.executable, P.abspath(__file__)]
if path:
command.append(path)
return subprocess.Pope... | CRIME_AND_PUNISHMENT[:len(as_text)] | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_seek_from_start | self.assertEqual | numeric_literal | 43 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | 10) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_seek_from_start | self.assertEqual | numeric_literal | 45 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | 20) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_seek_from_current | self.assertEqual | numeric_literal | 48 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | 30) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_seek_from_current | self.assertEqual | numeric_literal | 50 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | 40) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_seek_implicitly_enabled | assert | variable | 45 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | second | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_headers | self.assertEqual | string_literal | 42 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | 'bar') | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_timeout_attribute | assert | variable | 43 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | timeout | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_seek_implicitly_disabled | pytest.raises | variable | 43 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | OSError) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_read_all | self.assertEqual | variable | 42 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | read_bytes) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_seek_from_end | self.assertEqual | func_call | 45 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | len(BYTES)) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_http.py | test_https_seek_start | self.assertEqual | variable | 46 | import functools
import os
import unittest
import pytest
import responses
import smart_open.http
import smart_open.s3
import smart_open.constants
BYTES = b'i tried so hard and got so far but in the end it doesn\'t even matter'
URL = 'http://localhost'
HTTPS_URL = 'https://localhost'
HEADERS = {
'Content-Length':... | read_bytes_2) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_package.py | test_aws_raises_helpful_error_with_missing_deps | pytest.raises | complex_expr | 15 | import os
import unittest
import pytest
from smart_open import open
skip_tests = "SMART_OPEN_TEST_MISSING_DEPS" not in os.environ
class PackageTests(unittest.TestCase):
@pytest.mark.skipif(skip_tests, reason="requires missing dependencies")
def test_aws_raises_helpful_error_with_missing_deps(self):
... | ImportError, match=match) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_package.py | test_gcs_raises_helpful_error_with_missing_deps | pytest.raises | complex_expr | 14 | import os
import unittest
import pytest
from smart_open import open
skip_tests = "SMART_OPEN_TEST_MISSING_DEPS" not in os.environ
class PackageTests(unittest.TestCase):
@pytest.mark.skipif(skip_tests, reason="requires missing dependencies")
def test_gcs_raises_helpful_error_with_missing_deps(self):
... | ImportError, match=r"pip install smart_open\[gcs\]") | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_package.py | test_azure_raises_helpful_error_with_missing_deps | pytest.raises | complex_expr | 14 | import os
import unittest
import pytest
from smart_open import open
skip_tests = "SMART_OPEN_TEST_MISSING_DEPS" not in os.environ
class PackageTests(unittest.TestCase):
@pytest.mark.skipif(skip_tests, reason="requires missing dependencies")
def test_azure_raises_helpful_error_with_missing_deps(self):
... | ImportError, match=r"pip install smart_open\[azure\]") | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_deprecated_top_level_s3_iter_bucket | assert | numeric_literal | 75 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | 1 | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_every_second_read_fails | assert_* | numeric_literal | 72 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | 1) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_write_03 | self.assertEqual | numeric_literal | 77 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | 4) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_write_03 | self.assertEqual | numeric_literal | 80 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | 9) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_write_03 | self.assertEqual | numeric_literal | 81 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | 0) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_failure | self.assertEqual | numeric_literal | 77 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | 3) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_seek_start | self.assertEqual | numeric_literal | 86 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | 6) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_write_04 | self.assertEqual | collection | 79 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | []) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_iter_bucket | self.assertEqual | numeric_literal | 75 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | 10) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3.py | test_write_02 | self.assertEqual | numeric_literal | 76 | from collections import defaultdict
import functools
import gzip
import io
import logging
import os
import tempfile
import unittest
import warnings
from contextlib import contextmanager
from unittest import mock
import sys
import boto3
import botocore.client
import botocore.endpoint
import moto
import pytest
import s... | 14) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3_version.py | setUp | assert | numeric_literal | 55 | import functools
import logging
import unittest
import uuid
import time
import boto3
import moto
from smart_open import open
BUCKET_NAME = 'test-smartopen'
KEY_NAME = 'test-key'
logger = logging.getLogger(__name__)
_resource = functools.partial(boto3.resource, region_name='us-east-1')
def get_versions(bucket, key... | 2 | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3_version.py | test_bad_id | self.assertRaises | variable | 60 | import functools
import logging
import unittest
import uuid
import time
import boto3
import moto
from smart_open import open
BUCKET_NAME = 'test-smartopen'
KEY_NAME = 'test-key'
logger = logging.getLogger(__name__)
_resource = functools.partial(boto3.resource, region_name='us-east-1')
def get_versions(bucket, key... | IOError) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3_version.py | test_bad_mode | self.assertRaises | variable | 60 | import functools
import logging
import unittest
import uuid
import time
import boto3
import moto
from smart_open import open
BUCKET_NAME = 'test-smartopen'
KEY_NAME = 'test-key'
logger = logging.getLogger(__name__)
_resource = functools.partial(boto3.resource, region_name='us-east-1')
def get_versions(bucket, key... | ValueError) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3_version.py | test_good_id | self.assertEqual | complex_expr | 62 | import functools
import logging
import unittest
import uuid
import time
import boto3
import moto
from smart_open import open
BUCKET_NAME = 'test-smartopen'
KEY_NAME = 'test-key'
logger = logging.getLogger(__name__)
_resource = functools.partial(boto3.resource, region_name='us-east-1')
def get_versions(bucket, key... | self.test_ver1) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_s3_version.py | test_no_version | self.assertEqual | complex_expr | 61 | import functools
import logging
import unittest
import uuid
import time
import boto3
import moto
from smart_open import open
BUCKET_NAME = 'test-smartopen'
KEY_NAME = 'test-key'
logger = logging.getLogger(__name__)
_resource = functools.partial(boto3.resource, region_name='us-east-1')
def get_versions(bucket, key... | self.test_ver2) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_initialize_write | assert | numeric_literal | 78 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | 2 | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_write | assert | numeric_literal | 93 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | 4 | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_http_pass | self.assertEqual | numeric_literal | 66 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | 1) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_s3_iter_lines | self.assertEqual | numeric_literal | 72 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | 2) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_pathlib_monkeypatch_read_gz | self.assertEqual | numeric_literal | 74 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | 3) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_s3_tell | self.assertEqual | numeric_literal | 69 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | 4) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_uri_from_issue_223_works | self.assertEqual | string_literal | 65 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | "") | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_scp | self.assertEqual | numeric_literal | 66 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | 22) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_transport_params_is_not_mutable | assert | none_literal | 85 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | None | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_s3_uri_has_atmark_in_key_name3 | self.assertEqual | numeric_literal | 67 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | 443) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_shortcut | assert_* | string_literal | 63 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | 'r') | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_smart_open.py | test_read_never_returns_none | self.assertEqual | string_literal | 71 | import bz2
import csv
import contextlib
import functools
import io
import gzip
import hashlib
import logging
import os
from smart_open.compression import INFER_FROM_EXTENSION, NO_COMPRESSION
import tempfile
import unittest
from unittest import mock
import warnings
import boto3
import moto
import pytest
import response... | b"") | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
piskvorky/smart_open | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | train | train | smart_open/tests/test_ssh.py | test_open | assert_* | numeric_literal | 23 | import logging
import unittest
from unittest import mock
from paramiko import SSHException
import smart_open.ssh
def mock_ssh(func):
def wrapper(*args, **kwargs):
smart_open.ssh._SSH.clear()
return func(*args, **kwargs)
return mock.patch("paramiko.SSHClient.get_transport")(
mock.patc... | 22) | 1cfe4acc8ed350564944aca2ca768b9b4448fd73 | 183 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.