prompt listlengths 1 1 | compression_prompt listlengths 1 1 | target stringlengths 1.03k 828k |
|---|---|---|
[
{
"content": "Here is the snippet:\n```python\n### extends 'class_empty.py'\n### block ClassImports\n# NOTICE: Do not edit anything here, it is generated code\nfrom . import gxapi_cy\nfrom geosoft.gxapi import GXContext, float_ref, int_ref, str_ref\n\n\n### endblock ClassImports\n\n### block Header\n# NOTICE: T... | [
{
"content": "Here is the snippet:\n<|memory_start|>```python\n### extends 'class_empty.py'\n### block ClassImports\n# NOTICE: Do not edit anything here, it is generated code\nfrom . import gxapi_cy\nfrom geosoft.gxapi import GXContext, float_ref, int_ref, str_ref\n\n\n### endblock ClassImports\n\n### block Hea... | ```python
### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the code in this blo... |
[
{
"content": "Reconstruct the code file line-for-line, unmodified:\n```python\nimport sqlite3 # sqlite 3 database\nimport file_check_ex # to check if there is a file\nimport database # creating, editing, deleting the database\nimport intCheck # check that it is an integar\n\n\noption = None # choose what manu o... | [
{
"content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\nimport sqlite3 # sqlite 3 database\nimport file_check_ex # to check if there is a file\nimport database # creating, editing, deleting the database\nimport intCheck # check that it is an integar\n\n\noption = None # ch... | ```python
import sqlite3 # sqlite 3 database
import file_check_ex # to check if there is a file
import database # creating, editing, deleting the database
import intCheck # check that it is an integar
option = None # choose what manu option they want
sqlite_file = "" # the name of the sqlite3 file
option_list = (0, 1... |
[
{
"content": "Produce an exact reconstruction of the code:\n```python\nfrom sympy.core import sympify, Lambda, Dummy, Integer, Rational, oo, Float, pi\nfrom sympy.functions import sqrt, exp, erf\nfrom sympy.printing import sstr\nimport random\n\n\nclass Sample(tuple):\n \"\"\"\n Sample([x1, x2, x3, ...]) ... | [
{
"content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\nfrom sympy.core import sympify, Lambda, Dummy, Integer, Rational, oo, Float, pi\nfrom sympy.functions import sqrt, exp, erf\nfrom sympy.printing import sstr\nimport random\n\n\nclass Sample(tuple):\n \"\"\"\n Sample([x1... | ```python
from sympy.core import sympify, Lambda, Dummy, Integer, Rational, oo, Float, pi
from sympy.functions import sqrt, exp, erf
from sympy.printing import sstr
import random
class Sample(tuple):
"""
Sample([x1, x2, x3, ...]) represents a collection of samples.
Sample parameters like mean, variance an... |
[
{
"content": "```python\n# Copyright (c) 2013 OpenStack Foundation\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apac... | [
{
"content": "<|memory_start|>```python\n# Copyright (c) 2013 OpenStack Foundation\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# ... | ```python
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
[
{
"content": "Here is the source code:\n```python\n# Written by Shlomi Fish, under the MIT Expat License.\n\nimport unittest\nfrom pysollib.acard import AbstractCard\nfrom pysollib.hint import FreeCellSolver_Hint, PySolHintLayoutImportError\nimport pysollib.stack\n\n\nclass MockItem:\n def __init__(self):\n ... | [
{
"content": "Here is the source code:\n<|memory_start|>```python\n# Written by Shlomi Fish, under the MIT Expat License.\n\nimport unittest\nfrom pysollib.acard import AbstractCard\nfrom pysollib.hint import FreeCellSolver_Hint, PySolHintLayoutImportError\nimport pysollib.stack\n\n\nclass MockItem:\n def __... | ```python
# Written by Shlomi Fish, under the MIT Expat License.
import unittest
from pysollib.acard import AbstractCard
from pysollib.hint import FreeCellSolver_Hint, PySolHintLayoutImportError
import pysollib.stack
class MockItem:
def __init__(self):
pass
def tkraise(self):
return
def... |
[
{
"content": "Reproduce the code exactly as provided (keep formatting):\n```python\nfrom subprocess import *\nfrom tempfile import TemporaryFile\n\nSHELL = '/bin/bash'\n\nclass Bench:\n workingDir = ''\n test = ''\n name = ''\n script = {}\n expected_result = None\n\n def __init__(self, workin... | [
{
"content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\nfrom subprocess import *\nfrom tempfile import TemporaryFile\n\nSHELL = '/bin/bash'\n\nclass Bench:\n workingDir = ''\n test = ''\n name = ''\n script = {}\n expected_result = None\n\n def __ini... | ```python
from subprocess import *
from tempfile import TemporaryFile
SHELL = '/bin/bash'
class Bench:
workingDir = ''
test = ''
name = ''
script = {}
expected_result = None
def __init__(self, workingDir, test, name, script, expected_result):
self.workingDir = workingDir
self.... |
[
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\nfrom typing import Deque, Union, Optional, List\n\nfrom hwt.code import Concat\nfrom hwt.hdl.types.bitsVal import BitsVal\nfrom hwt.hdl.types.struct import HStruct\nfrom hwt.hdl.types.structValBase import StructV... | [
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\nfrom typing import Deque, Union, Optional, List\n\nfrom hwt.code import Concat\nfrom hwt.hdl.types.bitsVal import BitsVal\nfrom hwt.hdl.types.struct import HStruct\nfrom hwt.hdl.types.structValBas... | ```python
from typing import Deque, Union, Optional, List
from hwt.code import Concat
from hwt.hdl.types.bitsVal import BitsVal
from hwt.hdl.types.struct import HStruct
from hwt.hdl.types.structValBase import StructValBase
from hwt.hdl.value import HValue
from hwt.synthesizer.rtlLevel.constants import NOT_SPECIFIED
fr... |
[
{
"content": "Provide an exact copy of the source code:\n```python\n# -*- coding: utf-8 -*-\r\nfrom django.utils.translation import ugettext as _\r\nfrom django.db import models\r\n\r\n#adapted from http://www.djangosnippets.org/snippets/494/\r\n#using UN country and 3 char code list from http://unstats.un.org/... | [
{
"content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\r\nfrom django.utils.translation import ugettext as _\r\nfrom django.db import models\r\n\r\n#adapted from http://www.djangosnippets.org/snippets/494/\r\n#using UN country and 3 char code list from http:/... | ```python
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext as _
from django.db import models
#adapted from http://www.djangosnippets.org/snippets/494/
#using UN country and 3 char code list from http://unstats.un.org/unsd/methods/m49/m49alpha.htm
#correct as of 17th October 2008
COUNTRIES... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\nfrom django import template\n\nregister = template.Library()\n\n\n@register.filter\ndef get_range(value):\n if value is not None:\n return range(value)\n else:\n return 0\n\n\n@register.filter\ndef absolute(value):\... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\nfrom django import template\n\nregister = template.Library()\n\n\n@register.filter\ndef get_range(value):\n if value is not None:\n return range(value)\n else:\n return 0\n\n\n@register.filter\ndef a... | ```python
from django import template
register = template.Library()
@register.filter
def get_range(value):
if value is not None:
return range(value)
else:
return 0
@register.filter
def absolute(value):
return abs(value)
@register.filter
def subtract(value, arg):
return value - arg... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\nimport os\nimport sys\nimport shutil\n\nfrom django_safe_project import safe_settings\n\nPY3 = sys.version_info.major > 2\n\nif PY3:\n basestring = str\n\nclass Template(object):\n \"\"\"Handles copying and modifying the project ... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\nimport os\nimport sys\nimport shutil\n\nfrom django_safe_project import safe_settings\n\nPY3 = sys.version_info.major > 2\n\nif PY3:\n basestring = str\n\nclass Template(object):\n \"\"\"Handles copying and modify... | ```python
import os
import sys
import shutil
from django_safe_project import safe_settings
PY3 = sys.version_info.major > 2
if PY3:
basestring = str
class Template(object):
"""Handles copying and modifying the project template.
:param source: Source path of the project template
:param dest: Destina... |
[
{
"content": "```python\n# -*- coding: utf-8 -*-\n\"\"\"\nMain group for naruto cli\n\"\"\"\nimport io\nimport logging\nimport os\nimport pathlib\nimport shutil\n\nimport click\n\nfrom naruto import NarutoLayer, LayerNotFound\n\nDEV_LOGGER = logging.getLogger(__name__)\nDEFAULT_NARUTO_HOME = pathlib.Path(os.pat... | [
{
"content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nMain group for naruto cli\n\"\"\"\nimport io\nimport logging\nimport os\nimport pathlib\nimport shutil\n\nimport click\n\nfrom naruto import NarutoLayer, LayerNotFound\n\nDEV_LOGGER = logging.getLogger(__name__)\nDEFAULT_NARUTO_HOME = pat... | ```python
# -*- coding: utf-8 -*-
"""
Main group for naruto cli
"""
import io
import logging
import os
import pathlib
import shutil
import click
from naruto import NarutoLayer, LayerNotFound
DEV_LOGGER = logging.getLogger(__name__)
DEFAULT_NARUTO_HOME = pathlib.Path(os.path.expanduser('~/.naruto'))
DEFAULT_LOG_LEVEL... |
[
{
"content": "Reconstruct the code exactly:\n```python\nimport os\nfrom django.test import TestCase\n\nfrom cyder.base.eav.models import Attribute\nfrom cyder.base.utils import copy_tree, remove_dir_contents\nfrom cyder.base.vcs import GitRepo, GitRepoManager, SanityCheckFailure\n\nfrom cyder.core.ctnr.models i... | [
{
"content": "Reconstruct the code exactly:\n<|memory_start|>```python\nimport os\nfrom django.test import TestCase\n\nfrom cyder.base.eav.models import Attribute\nfrom cyder.base.utils import copy_tree, remove_dir_contents\nfrom cyder.base.vcs import GitRepo, GitRepoManager, SanityCheckFailure\n\nfrom cyder.co... | ```python
import os
from django.test import TestCase
from cyder.base.eav.models import Attribute
from cyder.base.utils import copy_tree, remove_dir_contents
from cyder.base.vcs import GitRepo, GitRepoManager, SanityCheckFailure
from cyder.core.ctnr.models import Ctnr
from cyder.core.system.models import System
from ... |
[
{
"content": "```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import with_statement\n\nimport sys\nimport tarfile\n\nfrom .Extractor import ArchiveError, CRCError, Extractor\nfrom .misc import encode, fsjoin\n\n\nclass UnTar(Extractor):\n __name__ = \"UnTar\"\n __type__ = \"extractor\"\n __versio... | [
{
"content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import with_statement\n\nimport sys\nimport tarfile\n\nfrom .Extractor import ArchiveError, CRCError, Extractor\nfrom .misc import encode, fsjoin\n\n\nclass UnTar(Extractor):\n __name__ = \"UnTar\"\n __type__ = \"extractor... | ```python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import sys
import tarfile
from .Extractor import ArchiveError, CRCError, Extractor
from .misc import encode, fsjoin
class UnTar(Extractor):
__name__ = "UnTar"
__type__ = "extractor"
__version__ = "0.05"
__status__ = "stable"
... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\n################################################################################\n#\n# expr_examples.py\n#\n################################################################################\n\nfrom boole.core.model import *\n ... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n################################################################################\n#\n# expr_examples.py\n#\n################################################################################\n\nfrom boole.core.mode... | ```python
################################################################################
#
# expr_examples.py
#
################################################################################
from boole.core.model import *
################################################################################
#
#... |
[
{
"content": "Here is the source code:\n```python\n# This file is part of the GOsa framework.\n#\n# http://gosa-project.org\n#\n# Copyright:\n# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de\n#\n# See the LICENSE file in the project's top-level directory for details.\n\nimport dbus\nfrom gosa.common.co... | [
{
"content": "Here is the source code:\n<|memory_start|>```python\n# This file is part of the GOsa framework.\n#\n# http://gosa-project.org\n#\n# Copyright:\n# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de\n#\n# See the LICENSE file in the project's top-level directory for details.\n\nimport dbus\nfro... | ```python
# This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import dbus
from gosa.common.components.dbus_runner import DBusRunner
from logging import ... |
[
{
"content": "Recreate the original code text:\n```python\nfrom lib_openmolar.client.db_orm.client_address import AddressRecord, AddressObjects\n\nfrom lib_openmolar.client.db_orm.client_patient import PatientDB, PatientNotFoundError\nfrom lib_openmolar.client.db_orm.client_address import AddressObjects\nfrom l... | [
{
"content": "Recreate the original code text:\n<|memory_start|>```python\nfrom lib_openmolar.client.db_orm.client_address import AddressRecord, AddressObjects\n\nfrom lib_openmolar.client.db_orm.client_patient import PatientDB, PatientNotFoundError\nfrom lib_openmolar.client.db_orm.client_address import Addres... | ```python
from lib_openmolar.client.db_orm.client_address import AddressRecord, AddressObjects
from lib_openmolar.client.db_orm.client_patient import PatientDB, PatientNotFoundError
from lib_openmolar.client.db_orm.client_address import AddressObjects
from lib_openmolar.client.db_orm.client_telephone import TelephoneD... |
[
{
"content": "Repeat the code precisely as written (spacing intact):\n```python\nfrom dataclasses import dataclass\nfrom datetime import date, datetime, timedelta\nfrom operator import itemgetter\nfrom typing import Dict, List, Optional, Set, Tuple\nfrom pytz import timezone\nimport libarchive.public\nimport lo... | [
{
"content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\nfrom dataclasses import dataclass\nfrom datetime import date, datetime, timedelta\nfrom operator import itemgetter\nfrom typing import Dict, List, Optional, Set, Tuple\nfrom pytz import timezone\nimport libarchive.p... | ```python
from dataclasses import dataclass
from datetime import date, datetime, timedelta
from operator import itemgetter
from typing import Dict, List, Optional, Set, Tuple
from pytz import timezone
import libarchive.public
import logging
import ftplib
import json
import re
import os
from .const import DIR_DOWNLOAD,... |
[
{
"content": "Here is the script:\n```python\n#!/usr/bin/env python\n#\n# Kenwood Morse Beacon - turns a Kenwood TS-480 into a heli beacon\n#\n# Copyright (C) 2016 by Mir Rodriguez <mir.rodriguez@greenpeace.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms ... | [
{
"content": "Here is the script:\n<|memory_start|>```python\n#!/usr/bin/env python\n#\n# Kenwood Morse Beacon - turns a Kenwood TS-480 into a heli beacon\n#\n# Copyright (C) 2016 by Mir Rodriguez <mir.rodriguez@greenpeace.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it ... | ```python
#!/usr/bin/env python
#
# Kenwood Morse Beacon - turns a Kenwood TS-480 into a heli beacon
#
# Copyright (C) 2016 by Mir Rodriguez <mir.rodriguez@greenpeace.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#... |
[
{
"content": "Provide an exact copy of the source code:\n```python\n# -*- coding: utf-8 -*-\n\n# Form implementation generated from reading ui file '/home/tedlaz/python_work/meta_manager/fmeta_main2.ui'\n#\n# Created by: PyQt4 UI code generator 4.11.4\n#\n# WARNING! All changes made in this file will be lost!\n... | [
{
"content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n# Form implementation generated from reading ui file '/home/tedlaz/python_work/meta_manager/fmeta_main2.ui'\n#\n# Created by: PyQt4 UI code generator 4.11.4\n#\n# WARNING! All changes made in this file... | ```python
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/tedlaz/python_work/meta_manager/fmeta_main2.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fro... |
[
{
"content": "Here is a code file:\n```python\nimport socket\nimport sys\nimport RPi.GPIO as gpio\nimport time\n\nHOST = '192.168.0.9' # RC카 라즈베리파이 IP값으로 변경필요\nPORT = 10000\nTIME_OUT = 100\n\n#Motor 1 GPIO Pin\nIC1A = 22\nIC2A = 27\n\n#Motor 2 GPIO Pin\nIC3A = 4\nIC4A = 17\n\ngpio.cleanup()\n\ngpio.setmode(gpio... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\nimport socket\nimport sys\nimport RPi.GPIO as gpio\nimport time\n\nHOST = '192.168.0.9' # RC카 라즈베리파이 IP값으로 변경필요\nPORT = 10000\nTIME_OUT = 100\n\n#Motor 1 GPIO Pin\nIC1A = 22\nIC2A = 27\n\n#Motor 2 GPIO Pin\nIC3A = 4\nIC4A = 17\n\ngpio.cleanup()\n\ng... | ```python
import socket
import sys
import RPi.GPIO as gpio
import time
HOST = '192.168.0.9' # RC카 라즈베리파이 IP값으로 변경필요
PORT = 10000
TIME_OUT = 100
#Motor 1 GPIO Pin
IC1A = 22
IC2A = 27
#Motor 2 GPIO Pin
IC3A = 4
IC4A = 17
gpio.cleanup()
gpio.setmode(gpio.BCM)
#Motor Pin Setup
gpio.setup(IC1A, gpio.OUT)
gpio.setup(IC... |
[
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\nimport os\nimport sys\n\n\nclass ConfigHelper():\n \"\"\"\n Manage all configuration information for the application\n \"\"\"\n def __init__(self):\n TRUE = \"True\"\n FALSE = \"Fals... | [
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\nimport os\nimport sys\n\n\nclass ConfigHelper():\n \"\"\"\n Manage all configuration information for the application\n \"\"\"\n def __init__(self):\n TRUE = \"True\"\n ... | ```python
import os
import sys
class ConfigHelper():
"""
Manage all configuration information for the application
"""
def __init__(self):
TRUE = "True"
FALSE = "False"
ERROR = 1
self.halo_key = os.getenv("HALO_API_KEY")
self.halo_secret = os.getenv("HALO_AP... |
[
{
"content": "Repeat the code exactly:\n```python\n#!/usr/bin/env python\n\nfrom scheduler.job import *\nfrom scheduler.fcfs import *\nfrom scheduler.sjf import *\nfrom scheduler.srjf import *\nfrom scheduler.priority import *\nfrom scheduler.preemptive_priority import *\nfrom scheduler.round_robin import *\n\n... | [
{
"content": "Repeat the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom scheduler.job import *\nfrom scheduler.fcfs import *\nfrom scheduler.sjf import *\nfrom scheduler.srjf import *\nfrom scheduler.priority import *\nfrom scheduler.preemptive_priority import *\nfrom scheduler.round_ro... | ```python
#!/usr/bin/env python
from scheduler.job import *
from scheduler.fcfs import *
from scheduler.sjf import *
from scheduler.srjf import *
from scheduler.priority import *
from scheduler.preemptive_priority import *
from scheduler.round_robin import *
from PyQt4 import QtCore, QtGui
from random import randint
... |
[
{
"content": "```python\nimport os\nimport os.path\nimport sys\n\nfrom fabric import Connection, Config\nfrom click import echo, secho\n\nfrom drift.management import get_ec2_instances\nfrom drift.utils import get_config\n\nEC2_USERNAME = 'ubuntu'\nUWSGI_LOGFILE = \"/var/log/uwsgi/uwsgi.log\"\n\n\ndef get_optio... | [
{
"content": "<|memory_start|>```python\nimport os\nimport os.path\nimport sys\n\nfrom fabric import Connection, Config\nfrom click import echo, secho\n\nfrom drift.management import get_ec2_instances\nfrom drift.utils import get_config\n\nEC2_USERNAME = 'ubuntu'\nUWSGI_LOGFILE = \"/var/log/uwsgi/uwsgi.log\"\n\... | ```python
import os
import os.path
import sys
from fabric import Connection, Config
from click import echo, secho
from drift.management import get_ec2_instances
from drift.utils import get_config
EC2_USERNAME = 'ubuntu'
UWSGI_LOGFILE = "/var/log/uwsgi/uwsgi.log"
def get_options(parser):
parser.add_argument(
... |
[
{
"content": "Here is a code file:\n```python\nimport os\nimport sys\nimport shutil\nimport glob\nfrom os.path import join, realpath, dirname, normpath, normcase\nfrom operator import methodcaller\ntry:\n from urlparse import urlparse\nexcept ImportError:\n from urllib.parse import urlparse\n\nimport clic... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\nimport os\nimport sys\nimport shutil\nimport glob\nfrom os.path import join, realpath, dirname, normpath, normcase\nfrom operator import methodcaller\ntry:\n from urlparse import urlparse\nexcept ImportError:\n from urllib.parse import urlpars... | ```python
import os
import sys
import shutil
import glob
from os.path import join, realpath, dirname, normpath, normcase
from operator import methodcaller
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import click
from pkg_resources import Requirement
try:
Window... |
[
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\nimport logging\nfrom ..parsers import DictParser\n\nfrom base_scraper import TwittrScrapr\n\nlog = logging.getLogger('scrapers.TimelineScrapr')\n\n\nclass TimelineScrapr(TwittrScrapr):\n def __init__(self, api... | [
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\nimport logging\nfrom ..parsers import DictParser\n\nfrom base_scraper import TwittrScrapr\n\nlog = logging.getLogger('scrapers.TimelineScrapr')\n\n\nclass TimelineScrapr(TwittrScrapr):\n def __... | ```python
import logging
from ..parsers import DictParser
from base_scraper import TwittrScrapr
log = logging.getLogger('scrapers.TimelineScrapr')
class TimelineScrapr(TwittrScrapr):
def __init__(self, api_keys, writer):
super(TimelineScrapr, self).__init__(api_keys, writer)
def _fetch_user_timelin... |
[
{
"content": "Here is the snippet:\n```python\n# This file is part of the Hotwire Shell project API.\n\n# Copyright (C) 2007 Colin Walters <walters@verbum.org>\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy \n# of this software and associated documentation files (the \"Softwar... | [
{
"content": "Here is the snippet:\n<|memory_start|>```python\n# This file is part of the Hotwire Shell project API.\n\n# Copyright (C) 2007 Colin Walters <walters@verbum.org>\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy \n# of this software and associated documentation file... | ```python
# This file is part of the Hotwire Shell project API.
# Copyright (C) 2007 Colin Walters <walters@verbum.org>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction... |
[
{
"content": "Replicate the source code:\n```python\nimport subprocess \nimport numpy as np\nimport os\nimport numpy.ma as ma\nimport re\nfrom tempfile import mkstemp, mkdtemp\nimport shutil\nimport scipy.constants\n\n#########################################\n#replace will search through a file for a specific ... | [
{
"content": "Replicate the source code:\n<|memory_start|>```python\nimport subprocess \nimport numpy as np\nimport os\nimport numpy.ma as ma\nimport re\nfrom tempfile import mkstemp, mkdtemp\nimport shutil\nimport scipy.constants\n\n#########################################\n#replace will search through a file... | ```python
import subprocess
import numpy as np
import os
import numpy.ma as ma
import re
from tempfile import mkstemp, mkdtemp
import shutil
import scipy.constants
#########################################
#replace will search through a file for a specific word an then replace that line
def replace(file, pattern, sub... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"This module defines I/O routines with CASTEP files.\nThe key idea is that all function accept or return atoms objects.\nCASTEP specific parameters will be returned through the <atoms>.calc\nattrib... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"This module defines I/O routines with CASTEP files.\nThe key idea is that all function accept or return atoms objects.\nCASTEP specific parameters will be returned through the <ato... | ```python
# -*- coding: utf-8 -*-
"""This module defines I/O routines with CASTEP files.
The key idea is that all function accept or return atoms objects.
CASTEP specific parameters will be returned through the <atoms>.calc
attribute.
"""
from numpy import sqrt, radians, sin, cos, matrix, array, cross, float32, dot
i... |
[
{
"content": "Return the code unaltered:\n```python\n\"\"\"Helper methods for various modules.\"\"\"\nfrom collections.abc import MutableSet\nfrom itertools import chain\nimport threading\nimport queue\nfrom datetime import datetime\nimport re\nimport enum\nimport socket\nimport random\nimport string\nfrom func... | [
{
"content": "Return the code unaltered:\n<|memory_start|>```python\n\"\"\"Helper methods for various modules.\"\"\"\nfrom collections.abc import MutableSet\nfrom itertools import chain\nimport threading\nimport queue\nfrom datetime import datetime\nimport re\nimport enum\nimport socket\nimport random\nimport s... | ```python
"""Helper methods for various modules."""
from collections.abc import MutableSet
from itertools import chain
import threading
import queue
from datetime import datetime
import re
import enum
import socket
import random
import string
from functools import wraps
from types import MappingProxyType
from typing i... |
[
{
"content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# Copyright 2010 United States Government as represented by the\n# Administrator of the National Aeronautics and Space Administration.\n# Copyright 2011 Justin Santa Barbara\n# All Rights Reserved.\n#\n# Licensed under the Apache ... | [
{
"content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# Copyright 2010 United States Government as represented by the\n# Administrator of the National Aeronautics and Space Administration.\n# Copyright 2011 Justin Santa Barbara\n# All Rights Reserved.\n#\n# Licensed u... | ```python
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in com... |
[
{
"content": "Return the code exactly, with no changes:\n```python\nfrom __future__ import absolute_import\n\nimport pytest\n\nfrom datetime import datetime, timedelta\n\nfrom sentry.constants import MAX_VERSION_LENGTH, MAX_CULPRIT_LENGTH\nfrom sentry.event_manager import EventManager\n\n\ndef validate_and_norm... | [
{
"content": "Return the code exactly, with no changes:\n<|memory_start|>```python\nfrom __future__ import absolute_import\n\nimport pytest\n\nfrom datetime import datetime, timedelta\n\nfrom sentry.constants import MAX_VERSION_LENGTH, MAX_CULPRIT_LENGTH\nfrom sentry.event_manager import EventManager\n\n\ndef v... | ```python
from __future__ import absolute_import
import pytest
from datetime import datetime, timedelta
from sentry.constants import MAX_VERSION_LENGTH, MAX_CULPRIT_LENGTH
from sentry.event_manager import EventManager
def validate_and_normalize(data):
manager = EventManager(data)
manager.normalize()
re... |
[
{
"content": "Here is the code block:\n```python\n# -*- coding: utf-8 -*-\n#########################################################################\n#\n# Copyright (C) 2018 OSGeo\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License a... | [
{
"content": "Here is the code block:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#########################################################################\n#\n# Copyright (C) 2018 OSGeo\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General ... | ```python
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2018 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... |
[
{
"content": "Here is a code file:\n```python\n# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-\n# ex: set expandtab softtabstop=4 shiftwidth=4:\n#\n# Copyright (C) 2008-2016,2018 Contributor\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in comp... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-\n# ex: set expandtab softtabstop=4 shiftwidth=4:\n#\n# Copyright (C) 2008-2016,2018 Contributor\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this fil... | ```python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008-2016,2018 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of t... |
[
{
"content": "```python\n\"\"\"\n Priority Queue with Binary Heaps:\n ---------------------------------\n\nIntroduction:\n------------\n A priority queue acts like a queue in that you can dequeue and item by\nremoving it from the front. However, in a priority queue... | [
{
"content": "<|memory_start|>```python\n\"\"\"\n Priority Queue with Binary Heaps:\n ---------------------------------\n\nIntroduction:\n------------\n A priority queue acts like a queue in that you can dequeue and item by\nremoving it from the front. However, in ... | ```python
"""
Priority Queue with Binary Heaps:
---------------------------------
Introduction:
------------
A priority queue acts like a queue in that you can dequeue and item by
removing it from the front. However, in a priority queue the logical order
of items insid... |
[
{
"content": "```python\n#Full working with icon working too.\n\n\nfrom distutils.core import setup\nimport py2exe\nimport os\n\nMFCDIR = r\"C:\\Python27\\Lib\\site-packages\\pythonwin\"\nMFCFILES = [\"mfc90.dll\", \"mfc90u.dll\", \"mfcm90.dll\", \"mfcm90u.dll\",\n \"Microsoft.VC90.MFC.manifest\"]\nm... | [
{
"content": "<|memory_start|>```python\n#Full working with icon working too.\n\n\nfrom distutils.core import setup\nimport py2exe\nimport os\n\nMFCDIR = r\"C:\\Python27\\Lib\\site-packages\\pythonwin\"\nMFCFILES = [\"mfc90.dll\", \"mfc90u.dll\", \"mfcm90.dll\", \"mfcm90u.dll\",\n \"Microsoft.VC90.MF... | ```python
#Full working with icon working too.
from distutils.core import setup
import py2exe
import os
MFCDIR = r"C:\Python27\Lib\site-packages\pythonwin"
MFCFILES = ["mfc90.dll", "mfc90u.dll", "mfcm90.dll", "mfcm90u.dll",
"Microsoft.VC90.MFC.manifest"]
mfcfiles = map(lambda x: os.path.join(MFCDIR, x), ... |
[
{
"content": "Write the code verbatim:\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n=============================================\nManifold Learning methods on a severed sphere\n=============================================\n\nAn application of the different :ref:`manifold` techniques\non a... | [
{
"content": "Write the code verbatim:\n<|memory_start|>```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n=============================================\nManifold Learning methods on a severed sphere\n=============================================\n\nAn application of the different :ref:`manifold` ... | ```python
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=============================================
Manifold Learning methods on a severed sphere
=============================================
An application of the different :ref:`manifold` techniques
on a spherical data-set. Here one can see the use of
dimensionali... |
[
{
"content": "Reconstruct the code exactly:\n```python\n#!/usr/bin/python\n#\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.a... | [
{
"content": "Reconstruct the code exactly:\n<|memory_start|>```python\n#!/usr/bin/python\n#\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | ```python
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
[
{
"content": "Here is a code file:\n```python\n# -*- coding: utf-8 -*-\n\n\nfrom django.db import migrations, models\nimport rdrf.models.definition.models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('rdrf', '0026_auto_20160314_1127'),\n ]\n\n operations = [\n migra... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n\nfrom django.db import migrations, models\nimport rdrf.models.definition.models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('rdrf', '0026_auto_20160314_1127'),\n ]\n\n operations = ... | ```python
# -*- coding: utf-8 -*-
from django.db import migrations, models
import rdrf.models.definition.models
class Migration(migrations.Migration):
dependencies = [
('rdrf', '0026_auto_20160314_1127'),
]
operations = [
migrations.CreateModel(
name='CDEFile',
... |
[
{
"content": "Here is some code:\n```python\n### Code for running Hadoop clusters on the model endpoints\n### then using the cumulative summing script to sum the endpoint and area by tcd threshold.\n### Also, sample code for copying results from spot machine to s3 for two endpoints.\n\n### git clone https://git... | [
{
"content": "Here is some code:\n<|memory_start|>```python\n### Code for running Hadoop clusters on the model endpoints\n### then using the cumulative summing script to sum the endpoint and area by tcd threshold.\n### Also, sample code for copying results from spot machine to s3 for two endpoints.\n\n### git c... | ```python
### Code for running Hadoop clusters on the model endpoints
### then using the cumulative summing script to sum the endpoint and area by tcd threshold.
### Also, sample code for copying results from spot machine to s3 for two endpoints.
### git clone https://github.com/wri/gfw-annual-loss-processing
'''
For... |
[
{
"content": "Replicate the source code:\n```python\n#Mohammad Afshar, @mafshar, ma2510@nyu.edu\n\n\"\"\"\nDjango settings for app project.\n\nGenerated by 'django-admin startproject' using Django 1.10.3.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.10/topics/settings/\n\nFor t... | [
{
"content": "Replicate the source code:\n<|memory_start|>```python\n#Mohammad Afshar, @mafshar, ma2510@nyu.edu\n\n\"\"\"\nDjango settings for app project.\n\nGenerated by 'django-admin startproject' using Django 1.10.3.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.10/topics/se... | ```python
#Mohammad Afshar, @mafshar, ma2510@nyu.edu
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djan... |
[
{
"content": "Produce an exact reconstruction of the code:\n```python\nimport requests\nimport os\nimport re\nimport time\nfrom selenium import webdriver\nimport multiprocessing\nimport sys\nfrom socket import error as SocketError\nimport errno\nimport argparse\nimport imghdr\nimport uuid\nimport csv\nimport co... | [
{
"content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\nimport requests\nimport os\nimport re\nimport time\nfrom selenium import webdriver\nimport multiprocessing\nimport sys\nfrom socket import error as SocketError\nimport errno\nimport argparse\nimport imghdr\nimport uuid\nimpor... | ```python
import requests
import os
import re
import time
from selenium import webdriver
import multiprocessing
import sys
from socket import error as SocketError
import errno
import argparse
import imghdr
import uuid
import csv
import codecs
import platform
import downloader
# define default chrome download path
glob... |
[
{
"content": "Here is the snippet:\n```python\n# -*- coding: utf-8 -*-\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n\nclass Migration(SchemaMigration):\n\n def forwards(self, orm):\n # Adding model 'FriendJoinedEmailLog'\n db.c... | [
{
"content": "Here is the snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n\nclass Migration(SchemaMigration):\n\n def forwards(self, orm):\n # Adding model 'FriendJoinedEmailLo... | ```python
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'FriendJoinedEmailLog'
db.create_table('custom_friendjoinedemaillog', (
... |
[
{
"content": "Return the code exactly, with no changes:\n```python\n# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Li... | [
{
"content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain ... | ```python
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
[
{
"content": "Return the code exactly, with no changes:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.9.3 on 2016-03-10 07:40\nfrom __future__ import unicode_literals\n\nimport django.contrib.auth.models\nimport django.core.validators\nfrom django.db import migrations, models\nimport django.utils... | [
{
"content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.9.3 on 2016-03-10 07:40\nfrom __future__ import unicode_literals\n\nimport django.contrib.auth.models\nimport django.core.validators\nfrom django.db import migrations, models\nimp... | ```python
# -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2016-03-10 07:40
from __future__ import unicode_literals
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
... |
[
{
"content": "Reconstruct the code exactly:\n```python\n# -*- coding: utf-8 -*-\nimport pytest\nfrom insert_sort import insert_sort\n\n\ndef test_sorted():\n my_list = list(range(100))\n insert_sort(my_list)\n assert my_list == list(range(100))\n\n\ndef test_reverse():\n my_list = list(range(100))[:... | [
{
"content": "Reconstruct the code exactly:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport pytest\nfrom insert_sort import insert_sort\n\n\ndef test_sorted():\n my_list = list(range(100))\n insert_sort(my_list)\n assert my_list == list(range(100))\n\n\ndef test_reverse():\n my_list = li... | ```python
# -*- coding: utf-8 -*-
import pytest
from insert_sort import insert_sort
def test_sorted():
my_list = list(range(100))
insert_sort(my_list)
assert my_list == list(range(100))
def test_reverse():
my_list = list(range(100))[::-1]
insert_sort(my_list)
assert my_list == list(range(100... |
[
{
"content": "Produce an exact reconstruction of the code:\n```python\n#!/usr/bin/env python2\n\n##\n# autosign\n# https://github.com/leosartaj/autosign.git\n# \n# copyright (c) 2014 sartaj singh\n# licensed under the mit license.\n##\n\nimport unittest\nimport os, shutil\nimport helper\nfrom autosign.main impo... | [
{
"content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n#!/usr/bin/env python2\n\n##\n# autosign\n# https://github.com/leosartaj/autosign.git\n# \n# copyright (c) 2014 sartaj singh\n# licensed under the mit license.\n##\n\nimport unittest\nimport os, shutil\nimport helper\nfrom au... | ```python
#!/usr/bin/env python2
##
# autosign
# https://github.com/leosartaj/autosign.git
#
# copyright (c) 2014 sartaj singh
# licensed under the mit license.
##
import unittest
import os, shutil
import helper
from autosign.main import removeSign, isSign
from autosign.exce import UnsignedError
class TestremoveSig... |
[
{
"content": "```python\nclass InitModule:\n def init(self, viewer):\n raise Exception(\"init has not been implemented.\")\n\n\nclass InteractiveModule:\n def _handle(self, viewer, ch):\n raise Exception(\"_handle has not been implemented.\")\n\n def _handle_help(self, viewer, buf):\n ... | [
{
"content": "<|memory_start|>```python\nclass InitModule:\n def init(self, viewer):\n raise Exception(\"init has not been implemented.\")\n\n\nclass InteractiveModule:\n def _handle(self, viewer, ch):\n raise Exception(\"_handle has not been implemented.\")\n\n def _handle_help(self, vie... | ```python
class InitModule:
def init(self, viewer):
raise Exception("init has not been implemented.")
class InteractiveModule:
def _handle(self, viewer, ch):
raise Exception("_handle has not been implemented.")
def _handle_help(self, viewer, buf):
raise Exception("_handle_help has... |
[
{
"content": "Return the code unaltered:\n```python\n#!/usr/bin/env python\nimport kalipi\nfrom kalipi import *\n\n\n#############################\n## Local Functions ##\n\n## Local Functions ##\n#############################\n\n\n#############################\n## Buttons ##\n\n#... | [
{
"content": "Return the code unaltered:\n<|memory_start|>```python\n#!/usr/bin/env python\nimport kalipi\nfrom kalipi import *\n\n\n#############################\n## Local Functions ##\n\n## Local Functions ##\n#############################\n\n\n#############################\n## Buttons ... | ```python
#!/usr/bin/env python
import kalipi
from kalipi import *
#############################
## Local Functions ##
## Local Functions ##
#############################
#############################
## Buttons ##
# define all of the buttons
label1 = Button(labelPadding * " " + " ... |
[
{
"content": "Here is the source code:\n```python\nimport numpy as np\nfrom IOHandler import loadMultipart\n\n##### Diff between particle data, data should be stored as x column xp column y column yp\nfirstdata = raw_input('Enter first multipart datafile name:')\nseconddata = raw_input('Enter second multipart d... | [
{
"content": "Here is the source code:\n<|memory_start|>```python\nimport numpy as np\nfrom IOHandler import loadMultipart\n\n##### Diff between particle data, data should be stored as x column xp column y column yp\nfirstdata = raw_input('Enter first multipart datafile name:')\nseconddata = raw_input('Enter se... | ```python
import numpy as np
from IOHandler import loadMultipart
##### Diff between particle data, data should be stored as x column xp column y column yp
firstdata = raw_input('Enter first multipart datafile name:')
seconddata = raw_input('Enter second multipart datafile name:')
firstmultipart = loadMultipart(firstd... |
[
{
"content": "Repeat the full code snippet:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom datetime import datetime\nimport hmac\nimport base64\nimport hashlib\n\nfrom requests import Request\n\nfrom paytrail.settings import BASE_API_URL, PAYTRAIL_AUTH_KEY, PAYTRAIL_ID, PAYTR... | [
{
"content": "Repeat the full code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom datetime import datetime\nimport hmac\nimport base64\nimport hashlib\n\nfrom requests import Request\n\nfrom paytrail.settings import BASE_API_URL, PAYTRAIL_AUTH_KEY, PA... | ```python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
import hmac
import base64
import hashlib
from requests import Request
from paytrail.settings import BASE_API_URL, PAYTRAIL_AUTH_KEY, PAYTRAIL_ID, PAYTRAIL_SECRET
class PaytrailConnectAPIRequest(Request):
def ... |
[
{
"content": "Here is the snippet:\n```python\n#!/usr/bin/env python\n\n# Copyright 2012 (Alexandre Zani)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apac... | [
{
"content": "Here is the snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n# Copyright 2012 (Alexandre Zani)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | ```python
#!/usr/bin/env python
# Copyright 2012 (Alexandre Zani)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
[
{
"content": "Here is the code block:\n```python\n# -*- encoding: utf-8 -*-\rfrom __future__ import unicode_literals\r\rimport codecs\rimport datetime\rimport locale\rfrom decimal import Decimal\r\rfrom django.utils import six\rfrom django.utils.functional import Promise\rfrom django.utils.six.moves.urllib.pars... | [
{
"content": "Here is the code block:\n<|memory_start|>```python\n# -*- encoding: utf-8 -*-\rfrom __future__ import unicode_literals\r\rimport codecs\rimport datetime\rimport locale\rfrom decimal import Decimal\r\rfrom django.utils import six\rfrom django.utils.functional import Promise\rfrom django.utils.six.m... | ```python
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import datetime
import locale
from decimal import Decimal
from django.utils import six
from django.utils.functional import Promise
from django.utils.six.moves.urllib.parse import quote, unquote
if six.PY3:
from urllib.parse... |
[
{
"content": "Provide a verbatim copy of the code:\n```python\n#!/usr/bin/env python2.7\n# -*- coding: utf-8 -*-\n\nimport json\nimport requests\nimport re\nimport random\nimport time\nimport sys\nimport csv\nfrom genericKB import genericHandler\nfrom esHealth import esHealthHandler\nfrom wikiFinder import find... | [
{
"content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n#!/usr/bin/env python2.7\n# -*- coding: utf-8 -*-\n\nimport json\nimport requests\nimport re\nimport random\nimport time\nimport sys\nimport csv\nfrom genericKB import genericHandler\nfrom esHealth import esHealthHandler\nfrom wikiFi... | ```python
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import json
import requests
import re
import random
import time
import sys
import csv
from genericKB import genericHandler
from esHealth import esHealthHandler
from wikiFinder import findWikiEn
#from io import open
import codecs
#from pttChat import pttHandler... |
[
{
"content": "```python\n##############################################################################\n#\n# Copyright (c) 2006 Zope Corporation and Contributors.\n# All Rights Reserved.\n#\n# This software is subject to the provisions of the Zope Public License,\n# Version 2.1 (ZPL). A copy of the ZPL should... | [
{
"content": "<|memory_start|>```python\n##############################################################################\n#\n# Copyright (c) 2006 Zope Corporation and Contributors.\n# All Rights Reserved.\n#\n# This software is subject to the provisions of the Zope Public License,\n# Version 2.1 (ZPL). A copy o... | ```python
##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.... |
[
{
"content": "Here is the code content:\n```python\nfrom unittest import TestCase\nfrom nose_parameterized import parameterized\nfrom collections import OrderedDict\nimport os\nimport gzip\n\nfrom pandas import (\n Series,\n DataFrame,\n date_range,\n Timestamp,\n read_csv\n)\nfrom pandas.util.te... | [
{
"content": "Here is the code content:\n<|memory_start|>```python\nfrom unittest import TestCase\nfrom nose_parameterized import parameterized\nfrom collections import OrderedDict\nimport os\nimport gzip\n\nfrom pandas import (\n Series,\n DataFrame,\n date_range,\n Timestamp,\n read_csv\n)\nfro... | ```python
from unittest import TestCase
from nose_parameterized import parameterized
from collections import OrderedDict
import os
import gzip
from pandas import (
Series,
DataFrame,
date_range,
Timestamp,
read_csv
)
from pandas.util.testing import assert_frame_equal
from numpy import (
arange... |
[
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\nimport numpy as np\r\nimport tensorflow as tf\r\nfrom PIL import Image\r\n\r\ndef save_img(sess, tensor, name):\r\n tensor0 = tf.transpose(tensor, perm=[1, 2, 0])\r\n res = sess.run(tensor0)\r\n tensor1 = tens... | [
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\nimport numpy as np\r\nimport tensorflow as tf\r\nfrom PIL import Image\r\n\r\ndef save_img(sess, tensor, name):\r\n tensor0 = tf.transpose(tensor, perm=[1, 2, 0])\r\n res = sess.run(tensor0)\r\n ... | ```python
import numpy as np
import tensorflow as tf
from PIL import Image
def save_img(sess, tensor, name):
tensor0 = tf.transpose(tensor, perm=[1, 2, 0])
res = sess.run(tensor0)
tensor1 = tensor0.eval()
im = Image.fromarray(tensor1.astype('uint8'))
im.save(name)
'''
im = Image.open("... |
[
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n\"\"\"\n Author: ikosenn\n\n This is a program to eliminate stale git branches.\n It checks last commits and based on the staleness threshold\n eliminates all stale branches\n\n Another CL function is pr... | [
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n\"\"\"\n Author: ikosenn\n\n This is a program to eliminate stale git branches.\n It checks last commits and based on the staleness threshold\n eliminates all stale branches\n\n Another C... | ```python
"""
Author: ikosenn
This is a program to eliminate stale git branches.
It checks last commits and based on the staleness threshold
eliminates all stale branches
Another CL function is provided to eliminate all available branches.
You can also remove all branches that have already be... |
[
{
"content": "Repeat the following code:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nThis module contains provisional support for SOCKS proxies from within\nurllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and\nSOCKS5. To enable its functionality, either install PySocks or install this\n... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nThis module contains provisional support for SOCKS proxies from within\nurllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and\nSOCKS5. To enable its functionality, either install PySocks o... | ```python
# -*- coding: utf-8 -*-
"""
This module contains provisional support for SOCKS proxies from within
urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and
SOCKS5. To enable its functionality, either install PySocks or install this
module with the ``socks`` extra.
The SOCKS implementation ... |
[
{
"content": "```python\nimport json\nimport datetime\nimport re\nimport os\nimport psycopg2 as dbapi2\n\nfrom flask import Flask\nfrom flask import render_template\nfrom flask import redirect\nfrom flask import request\nfrom flask.helpers import url_for\n\nclass Dil:\n def __init__(self, name, ulkesi, photo... | [
{
"content": "<|memory_start|>```python\nimport json\nimport datetime\nimport re\nimport os\nimport psycopg2 as dbapi2\n\nfrom flask import Flask\nfrom flask import render_template\nfrom flask import redirect\nfrom flask import request\nfrom flask.helpers import url_for\n\nclass Dil:\n def __init__(self, nam... | ```python
import json
import datetime
import re
import os
import psycopg2 as dbapi2
from flask import Flask
from flask import render_template
from flask import redirect
from flask import request
from flask.helpers import url_for
class Dil:
def __init__(self, name, ulkesi, photo, bilenler):
self.name = nam... |
[
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n#!/usr/bin/env python3\n\n# Generate Italic calligraphy SVG images and OpenDocument documents according\n# to the specified parameters.\n#\n# Written in 2014 by Jordan Vaughan\n#\n# To the extent possible under l... | [
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n#!/usr/bin/env python3\n\n# Generate Italic calligraphy SVG images and OpenDocument documents according\n# to the specified parameters.\n#\n# Written in 2014 by Jordan Vaughan\n#\n# To the extent ... | ```python
#!/usr/bin/env python3
# Generate Italic calligraphy SVG images and OpenDocument documents according
# to the specified parameters.
#
# Written in 2014 by Jordan Vaughan
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to t... |
[
{
"content": "Return the code exactly, with no changes:\n```python\n# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license info... | [
{
"content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for... | ```python
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
... |
[
{
"content": "Return the code exactly, with no changes:\n```python\n# -*- coding: utf-8 -*-\n\n# Copyright (C) 2014 Osmo Salomaa\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, eit... | [
{
"content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n# Copyright (C) 2014 Osmo Salomaa\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software... | ```python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Osmo Salomaa
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... |
[
{
"content": "Here is the source code:\n```python\n# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n#\n# Co... | [
{
"content": "Here is the source code:\n<|memory_start|>```python\n# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license infor... | ```python
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
... |
[
{
"content": "Here is the source code:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.db import models\nfrom .validators import validate_printable\nimport os\n\nclass JobSession(models.Model):\n status = models.CharField(max_length=3000)\n all_status = models.CharField(max_length=48000)\n attachedf... | [
{
"content": "Here is the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nfrom django.db import models\nfrom .validators import validate_printable\nimport os\n\nclass JobSession(models.Model):\n status = models.CharField(max_length=3000)\n all_status = models.CharField(max_length=48000... | ```python
# -*- coding: utf-8 -*-
from django.db import models
from .validators import validate_printable
import os
class JobSession(models.Model):
status = models.CharField(max_length=3000)
all_status = models.CharField(max_length=48000)
attachedfile = models.FileField(
upload_to='imprimo',
... |
[
{
"content": "Reproduce the code exactly as provided (keep formatting):\n```python\n#!/usr/bin/env python\nimport sys\nimport os\n# setup.py largely based on\n# http://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/\n# Also see Jeet Sukumaran's DendroPy\n\n##################################... | [
{
"content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n#!/usr/bin/env python\nimport sys\nimport os\n# setup.py largely based on\n# http://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/\n# Also see Jeet Sukumaran's DendroPy\n\n##################... | ```python
#!/usr/bin/env python
import sys
import os
# setup.py largely based on
# http://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
# Also see Jeet Sukumaran's DendroPy
###############################################################################
# setuptools/distutils/etc. import and conf... |
[
{
"content": "```python\nimport subprocess\nimport sys\nimport os\nimport win32com.client\nimport time\n\noutlook = None\nnameAliasDict = {}\ncontacts = None\nnumEntries = None\nfile = None\nmail_schema = \"http://schemas.microsoft.com/mapi/proptag/0x800F101F\"\nalias_schema = \"http://schemas.microsoft.com/map... | [
{
"content": "<|memory_start|>```python\nimport subprocess\nimport sys\nimport os\nimport win32com.client\nimport time\n\noutlook = None\nnameAliasDict = {}\ncontacts = None\nnumEntries = None\nfile = None\nmail_schema = \"http://schemas.microsoft.com/mapi/proptag/0x800F101F\"\nalias_schema = \"http://schemas.m... | ```python
import subprocess
import sys
import os
import win32com.client
import time
outlook = None
nameAliasDict = {}
contacts = None
numEntries = None
file = None
mail_schema = "http://schemas.microsoft.com/mapi/proptag/0x800F101F"
alias_schema = "http://schemas.microsoft.com/mapi/proptag/0x3A00001F"
criticalCommit =... |
[
{
"content": "```python\nimport os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README')).read()\n\nsetup(\n\t\tzip_safe=False,\n\t\tname='django-lavaflow',\n\t\tversion='1.1',\n\t\tpackages=['lavaFlow'],\n\t\tinclude_package_data=True,\t\n\t\tlicense=\"GPL 3\",\n\t\td... | [
{
"content": "<|memory_start|>```python\nimport os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README')).read()\n\nsetup(\n\t\tzip_safe=False,\n\t\tname='django-lavaflow',\n\t\tversion='1.1',\n\t\tpackages=['lavaFlow'],\n\t\tinclude_package_data=True,\t\n\t\tlicense=\... | ```python
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README')).read()
setup(
zip_safe=False,
name='django-lavaflow',
version='1.1',
packages=['lavaFlow'],
include_package_data=True,
license="GPL 3",
description="LavaFlow creates useful reports on the u... |
[
{
"content": "```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2009-2010 CloudSizzle Team\n#\n# Permission is hereby granted, free of charge, to any person\n# obtaining a copy of this software and associated documentation\n# files (the \"Software\"), to deal in the Software without\n# restriction, includi... | [
{
"content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2009-2010 CloudSizzle Team\n#\n# Permission is hereby granted, free of charge, to any person\n# obtaining a copy of this software and associated documentation\n# files (the \"Software\"), to deal in the Software without\n# rest... | ```python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009-2010 CloudSizzle Team
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights... |
[
{
"content": "Produce an exact reconstruction of the code:\n```python\n# -*- coding: utf-8 -*-\n#\n# period documentation build configuration file, created by\n# sphinx-quickstart on Tue Jul 10 18:37:45 2012.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that no... | [
{
"content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# period documentation build configuration file, created by\n# sphinx-quickstart on Tue Jul 10 18:37:45 2012.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#... | ```python
# -*- coding: utf-8 -*-
#
# period documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 10 18:37:45 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... |
[
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# coding=utf-8\n# This file is part of SickRage.\n#\n# URL: https://sick-rage.github.io\n# Git: https://github.com/Sick-Rage/Sick-Rage.git\n#\n# SickRage is free software: you can redistribute it and/or modify\n# it un... | [
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# coding=utf-8\n# This file is part of SickRage.\n#\n# URL: https://sick-rage.github.io\n# Git: https://github.com/Sick-Rage/Sick-Rage.git\n#\n# SickRage is free software: you can redistribute it and/or... | ```python
# coding=utf-8
# This file is part of SickRage.
#
# URL: https://sick-rage.github.io
# Git: https://github.com/Sick-Rage/Sick-Rage.git
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eit... |
[
{
"content": "Here is the script:\n```python\n\"\"\"\n COPYRIGHT (C) 2014 AFRICASTALKING LTD <www.africastalking.com> #\n \n AFRICAStALKING SMS GATEWAY CLASS IS A FREE SOFTWARE IE. CAN BE MODIFIED AND/OR REDISTRIBUTED \n UNDER THER TERMS OF GNU GENERA... | [
{
"content": "Here is the script:\n<|memory_start|>```python\n\"\"\"\n COPYRIGHT (C) 2014 AFRICASTALKING LTD <www.africastalking.com> #\n \n AFRICAStALKING SMS GATEWAY CLASS IS A FREE SOFTWARE IE. CAN BE MODIFIED AND/OR REDISTRIBUTED \n UNDER THER TER... | ```python
"""
COPYRIGHT (C) 2014 AFRICASTALKING LTD <www.africastalking.com> #
AFRICAStALKING SMS GATEWAY CLASS IS A FREE SOFTWARE IE. CAN BE MODIFIED AND/OR REDISTRIBUTED
UNDER THER TERMS OF GNU GENERAL PUBLIC LICENCES AS PUBLISHED BY THE ... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\n''' ---------------------------------------------------------------------------------------------------------------- '''\n''' These below are the membership groups and their membership customized replies. Edit this area to expand the b... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n''' ---------------------------------------------------------------------------------------------------------------- '''\n''' These below are the membership groups and their membership customized replies. Edit this area... | ```python
''' ---------------------------------------------------------------------------------------------------------------- '''
''' These below are the membership groups and their membership customized replies. Edit this area to expand the bot. '''
''' ----------------------------------------------------------------... |
[
{
"content": "Repeat the code exactly as the original, including blank lines:\n```python\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nimport datetime\ni... | [
{
"content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nim... | ```python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import re
from elasticsearch_dsl import Search, A, F, Q
from elasticsearch.exceptions import N... |
[
{
"content": "Repeat the code exactly as the original, including blank lines:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nCreates or regenerates a Makefile with special planex-init comments\n\"\"\"\n\nimport os\nimport logging\n\nMAKEFILE_PATH = \"/usr/share/planex\"\n\n\ndef create_makefile():\n \"\"\" Che... | [
{
"content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n\"\"\"\nCreates or regenerates a Makefile with special planex-init comments\n\"\"\"\n\nimport os\nimport logging\n\nMAKEFILE_PATH = \"/usr/share/planex\"\n\n\ndef create_makefile():... | ```python
#!/usr/bin/env python
"""
Creates or regenerates a Makefile with special planex-init comments
"""
import os
import logging
MAKEFILE_PATH = "/usr/share/planex"
def create_makefile():
""" Checks if a Makefile exists with special planex-init comments in it.
If not, it creates or regenerates the Make... |
[
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n#!/usr/bin/env python3\n# Copyright (c) 2017 Genome Research Ltd.\n# Author: Alistair Dunham\n# This program is free software: you can redistribute it and/or modify it under\n# the terms of the GNU Gene... | [
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n#!/usr/bin/env python3\n# Copyright (c) 2017 Genome Research Ltd.\n# Author: Alistair Dunham\n# This program is free software: you can redistribute it and/or modify it under\n# the terms o... | ```python
#!/usr/bin/env python3
# Copyright (c) 2017 Genome Research Ltd.
# Author: Alistair Dunham
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of t... |
[
{
"content": "Repeat the code precisely:\n```python\n\"\"\"\n Author: Denis Nutiu <denis.nutiu@gmail.com>\n This file is part of scoreboard-benchmark.\n\n scoreboard-benchmark is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published... | [
{
"content": "Repeat the code precisely:\n<|memory_start|>```python\n\"\"\"\n Author: Denis Nutiu <denis.nutiu@gmail.com>\n This file is part of scoreboard-benchmark.\n\n scoreboard-benchmark is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public Lice... | ```python
"""
Author: Denis Nutiu <denis.nutiu@gmail.com>
This file is part of scoreboard-benchmark.
scoreboard-benchmark is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of t... |
[
{
"content": "Repeat the following code:\n```python\n#!/usr/bin/env python\n\n# ptp_fuzz.py - Fuzz a PTP implementation\n# Copyright (C) 2016 Matthias Kruk\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Fr... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n# ptp_fuzz.py - Fuzz a PTP implementation\n# Copyright (C) 2016 Matthias Kruk\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as publis... | ```python
#!/usr/bin/env python
# ptp_fuzz.py - Fuzz a PTP implementation
# Copyright (C) 2016 Matthias Kruk
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... |
[
{
"content": "```python\n#!/usr/bin/env python\n# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai\nfrom __future__ import with_statement\n\n__license__ = 'GPL v3'\n__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'\n__docformat__ = 'restructuredtext en'\n\nfrom PyQt4.Qt import Qt, QAbstractListModel,... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/env python\n# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai\nfrom __future__ import with_statement\n\n__license__ = 'GPL v3'\n__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'\n__docformat__ = 'restructuredtext en'\n\nfrom PyQt4.Qt import Qt, QAb... | ```python
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt4.Qt import Qt, QAbstractListModel, QVariant, SIGNAL
from calibre... |
[
{
"content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# -*- coding: utf-8 -*-\n\nimport datetime\nimport logging\n\nimport bleach\n\nfrom django import http\nfrom django.contrib import messages\nfrom django.contrib.auth.decorators import login_required\nfrom django.core import exception... | [
{
"content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nimport datetime\nimport logging\n\nimport bleach\n\nfrom django import http\nfrom django.contrib import messages\nfrom django.contrib.auth.decorators import login_required\nfrom django.core ... | ```python
# -*- coding: utf-8 -*-
import datetime
import logging
import bleach
from django import http
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core import exceptions
from django.shortcuts import get_object_or_404, redirect, render
from .forms import ... |
[
{
"content": "Here is the code block:\n```python\n# coding=utf-8\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle... | [
{
"content": "Here is the code block:\n<|memory_start|>```python\n# coding=utf-8\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENS... | ```python
# coding=utf-8
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
[
{
"content": "Here is the code content:\n```python\n# Find the sum of all the positive integers which\r\n# cannot be written as the sum of two abundant numbers.\r\n#\r\n# Facts:\r\n# All integers greater than 28123 can be\r\n# written as the sum of two abundant numbers.\r\n# Abundant number = sum of proper divi... | [
{
"content": "Here is the code content:\n<|memory_start|>```python\n# Find the sum of all the positive integers which\r\n# cannot be written as the sum of two abundant numbers.\r\n#\r\n# Facts:\r\n# All integers greater than 28123 can be\r\n# written as the sum of two abundant numbers.\r\n# Abundant number = su... | ```python
# Find the sum of all the positive integers which
# cannot be written as the sum of two abundant numbers.
#
# Facts:
# All integers greater than 28123 can be
# written as the sum of two abundant numbers.
# Abundant number = sum of proper divisors of n exceed n.
#
# Find all abundant numbers up to and ... |
[
{
"content": "```python\n# -*- encoding: utf-8 -*-\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under t... | [
{
"content": "<|memory_start|>```python\n# -*- encoding: utf-8 -*-\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this fil... | ```python
# -*- encoding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2... |
[
{
"content": "Here is a code snippet:\n```python\nimport unittest\nimport sys\n\nfrom PySide.QtGui import QStandardItemModel, QWidget, QStandardItem\n\nfrom helper import UsesQApplication\n\nclass QStandardItemModelTest(UsesQApplication):\n\n def setUp(self):\n super(QStandardItemModelTest, self).setUp... | [
{
"content": "Here is a code snippet:\n<|memory_start|>```python\nimport unittest\nimport sys\n\nfrom PySide.QtGui import QStandardItemModel, QWidget, QStandardItem\n\nfrom helper import UsesQApplication\n\nclass QStandardItemModelTest(UsesQApplication):\n\n def setUp(self):\n super(QStandardItemModelT... | ```python
import unittest
import sys
from PySide.QtGui import QStandardItemModel, QWidget, QStandardItem
from helper import UsesQApplication
class QStandardItemModelTest(UsesQApplication):
def setUp(self):
super(QStandardItemModelTest, self).setUp()
self.window = QWidget()
self.model = QSta... |
[
{
"content": "```python\n#!/usr/bin/env python\n# Python 3\n# LinkFinder\n# By Gerben_Javado\n\n# Fix webbrowser bug for MacOS\nimport os\nos.environ[\"BROWSER\"] = \"open\"\n\n# Import libraries\nimport re, sys, glob, html, argparse, jsbeautifier, webbrowser, subprocess, base64, ssl, xml.etree.ElementTree\n\nf... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/env python\n# Python 3\n# LinkFinder\n# By Gerben_Javado\n\n# Fix webbrowser bug for MacOS\nimport os\nos.environ[\"BROWSER\"] = \"open\"\n\n# Import libraries\nimport re, sys, glob, html, argparse, jsbeautifier, webbrowser, subprocess, base64, ssl, xml.etree.... | ```python
#!/usr/bin/env python
# Python 3
# LinkFinder
# By Gerben_Javado
# Fix webbrowser bug for MacOS
import os
os.environ["BROWSER"] = "open"
# Import libraries
import re, sys, glob, html, argparse, jsbeautifier, webbrowser, subprocess, base64, ssl, xml.etree.ElementTree
from gzip import GzipFile
from string im... |
[
{
"content": "Repeat the code precisely:\n```python\n#!/usr/bin/env python\n\nfrom .util import Spec\n\n\nclass File(Spec):\n\n STATES = [\n \"directory\", \"file\",\n \"owned_by\",\n \"smaller_than\", \"larger_than\"\n ]\n\n def __init__(self, path):\n self.path = path\n ... | [
{
"content": "Repeat the code precisely:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom .util import Spec\n\n\nclass File(Spec):\n\n STATES = [\n \"directory\", \"file\",\n \"owned_by\",\n \"smaller_than\", \"larger_than\"\n ]\n\n def __init__(self, path):\n self.... | ```python
#!/usr/bin/env python
from .util import Spec
class File(Spec):
STATES = [
"directory", "file",
"owned_by",
"smaller_than", "larger_than"
]
def __init__(self, path):
self.path = path
self.state = {}
self.get_state()
self.WIN = "File %s is... |
[
{
"content": "```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nExamples for Python-nvd3 is a Python wrapper for NVD3 graph library.\nNVD3 is an attempt to build re-usable charts and chart components\nfor d3.js without taking away the power that d3.js gives you.\n\nProject location : https://gith... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nExamples for Python-nvd3 is a Python wrapper for NVD3 graph library.\nNVD3 is an attempt to build re-usable charts and chart components\nfor d3.js without taking away the power that d3.js gives you.\n\nProject locatio... | ```python
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Examples for Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
"""
fro... |
[
{
"content": "Here is the snippet:\n```python\n#!/usr/bin/env python\n# -*- coding:gbk -*-\nimport sys\nimport re\nimport os\nimport time\nimport string\nimport datetime\nimport tushare as ts\nfrom internal.ts_common import *\nfrom decimal import Decimal\n\ntoday = datetime.date.today()\n\n#˵Ã÷show_flag\n#0£º²... | [
{
"content": "Here is the snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding:gbk -*-\nimport sys\nimport re\nimport os\nimport time\nimport string\nimport datetime\nimport tushare as ts\nfrom internal.ts_common import *\nfrom decimal import Decimal\n\ntoday = datetime.date.today()\n\n#˵Ã÷... | ```python
#!/usr/bin/env python
# -*- coding:gbk -*-
import sys
import re
import os
import time
import string
import datetime
import tushare as ts
from internal.ts_common import *
from decimal import Decimal
today = datetime.date.today()
#˵Ã÷show_flag
#0£º²»»ñµÃÿһֻµÄÁ÷ͨÅÌ£¬²»»á¼ÆËã»»ÊÖÂÊ
#1£º»ñµÃÿһֻµÄÁ÷ͨÅÌ£¬... |
[
{
"content": "```python\n# --------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for license information.\n# --------------------------------... | [
{
"content": "<|memory_start|>```python\n# --------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for license information.\n# ----------------... | ```python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ----------------------------------------------------------... |
[
{
"content": "```python\n#!/usr/bin/python -tt\n\n\"\"\"Junos Interface Troubleshooting library.\"\"\"\n\nimport re\nimport warnings\nimport helpers\n\nfrom napalm import get_network_driver\nfrom jnpr.junos.exception import ConnectRefusedError, ConnectAuthError\n\n# JUNOS MAC table RE\nRE_VLAN = r'\\s+([\\w\\d-... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/python -tt\n\n\"\"\"Junos Interface Troubleshooting library.\"\"\"\n\nimport re\nimport warnings\nimport helpers\n\nfrom napalm import get_network_driver\nfrom jnpr.junos.exception import ConnectRefusedError, ConnectAuthError\n\n# JUNOS MAC table RE\nRE_VLAN =... | ```python
#!/usr/bin/python -tt
"""Junos Interface Troubleshooting library."""
import re
import warnings
import helpers
from napalm import get_network_driver
from jnpr.junos.exception import ConnectRefusedError, ConnectAuthError
# JUNOS MAC table RE
RE_VLAN = r'\s+([\w\d-]+)\s+'
RE_MAC = r'\s?([*\w\d:]+)\s+'
RE_TYP... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\n# ----------------------------------------------------------------------\n# LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator\n# http://lammps.sandia.gov, Sandia National Laboratories\n# Steve Plimpton, sj... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# ----------------------------------------------------------------------\n# LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator\n# http://lammps.sandia.gov, Sandia National Laboratories\n# St... | ```python
# ----------------------------------------------------------------------
# LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
# http://lammps.sandia.gov, Sandia National Laboratories
# Steve Plimpton, sjplimp@sandia.gov
#
# Copyright (2003) Sandia Corporation. Under the terms of Contr... |
[
{
"content": "Here is a code snippet:\n```python\nimport os\nimport re\nfrom functools import wraps\nfrom urlparse import urlparse\nimport math\n\nfrom elasticutils import S\nfrom elasticgit.search import RepoHelper\n\n\ndefault_excluded_paths = ['/health/', '/api/notify/']\n\n\ndef is_excluded_path(path, exclu... | [
{
"content": "Here is a code snippet:\n<|memory_start|>```python\nimport os\nimport re\nfrom functools import wraps\nfrom urlparse import urlparse\nimport math\n\nfrom elasticutils import S\nfrom elasticgit.search import RepoHelper\n\n\ndefault_excluded_paths = ['/health/', '/api/notify/']\n\n\ndef is_excluded_... | ```python
import os
import re
from functools import wraps
from urlparse import urlparse
import math
from elasticutils import S
from elasticgit.search import RepoHelper
default_excluded_paths = ['/health/', '/api/notify/']
def is_excluded_path(path, excluded_paths):
excl_paths = config_list(excluded_paths) + de... |
[
{
"content": "```python\nfrom lib.data.message import Message\nfrom tests.unittest.base_custom import TestCustomField\n\n# Needs to be imported last\nfrom ..custom import query\n\n\nclass TestCustomCommandCustomQuery(TestCustomField):\n def setUp(self):\n super().setUp()\n self.args = self.args... | [
{
"content": "<|memory_start|>```python\nfrom lib.data.message import Message\nfrom tests.unittest.base_custom import TestCustomField\n\n# Needs to be imported last\nfrom ..custom import query\n\n\nclass TestCustomCommandCustomQuery(TestCustomField):\n def setUp(self):\n super().setUp()\n self.... | ```python
from lib.data.message import Message
from tests.unittest.base_custom import TestCustomField
# Needs to be imported last
from ..custom import query
class TestCustomCommandCustomQuery(TestCustomField):
def setUp(self):
super().setUp()
self.args = self.args._replace(field='query', message=... |
[
{
"content": "Recreate the original code text:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.9.1 on 2016-05-02 14:13\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nimport django.core.validators\nfrom django.db import migrations, models\nimport django.db.models.delet... | [
{
"content": "Recreate the original code text:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.9.1 on 2016-05-02 14:13\nfrom __future__ import unicode_literals\n\nfrom django.conf import settings\nimport django.core.validators\nfrom django.db import migrations, models\nimport django... | ```python
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-05-02 14:13
from __future__ import unicode_literals
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import sharingcars.helpers.User
class Migration(migrations... |
[
{
"content": "Here is some code:\n```python\nimport datetime\nimport logging\nimport re\nimport socket\nimport subprocess\nimport os\n\nfrom django.conf import settings\n\nfrom . import exceptions as dakku_exception\n\nlogger = logging.getLogger(__name__)\n\n\nclass BackupBase(object):\n\n def deletefile(sel... | [
{
"content": "Here is some code:\n<|memory_start|>```python\nimport datetime\nimport logging\nimport re\nimport socket\nimport subprocess\nimport os\n\nfrom django.conf import settings\n\nfrom . import exceptions as dakku_exception\n\nlogger = logging.getLogger(__name__)\n\n\nclass BackupBase(object):\n\n de... | ```python
import datetime
import logging
import re
import socket
import subprocess
import os
from django.conf import settings
from . import exceptions as dakku_exception
logger = logging.getLogger(__name__)
class BackupBase(object):
def deletefile(self, date_str):
"""Given a date in YYYYMMDD check if ... |
[
{
"content": "```python\nimport logging\nfrom HTMLParser import HTMLParser\nfrom lxml.html.clean import Cleaner\nfrom lxml.etree import XMLSyntaxError\n\nclass HTMLSanitizer:\n\n\n\n @classmethod\n def sanitize_and_parse(cls, data):\n if data is not None:\n sanitized = HTMLSanitizer._san... | [
{
"content": "<|memory_start|>```python\nimport logging\nfrom HTMLParser import HTMLParser\nfrom lxml.html.clean import Cleaner\nfrom lxml.etree import XMLSyntaxError\n\nclass HTMLSanitizer:\n\n\n\n @classmethod\n def sanitize_and_parse(cls, data):\n if data is not None:\n sanitized = HT... | ```python
import logging
from HTMLParser import HTMLParser
from lxml.html.clean import Cleaner
from lxml.etree import XMLSyntaxError
class HTMLSanitizer:
@classmethod
def sanitize_and_parse(cls, data):
if data is not None:
sanitized = HTMLSanitizer._sanitize(data)
parsed = HT... |
[
{
"content": "Produce an exact reconstruction of the code:\n```python\nfrom troposphere import GetAtt, If, Join, Output, Ref\nfrom troposphere import elasticloadbalancing as elb\n\nfrom . import USE_ECS, USE_GOVCLOUD\nfrom .security_groups import load_balancer_security_group\nfrom .template import template\nfro... | [
{
"content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\nfrom troposphere import GetAtt, If, Join, Output, Ref\nfrom troposphere import elasticloadbalancing as elb\n\nfrom . import USE_ECS, USE_GOVCLOUD\nfrom .security_groups import load_balancer_security_group\nfrom .template impo... | ```python
from troposphere import GetAtt, If, Join, Output, Ref
from troposphere import elasticloadbalancing as elb
from . import USE_ECS, USE_GOVCLOUD
from .security_groups import load_balancer_security_group
from .template import template
from .utils import ParameterWithDefaults as Parameter
from .vpc import public_... |
[
{
"content": "Repeat the full code snippet:\n```python\n\"\"\"\nevents.py\n\nDefines a simple event handler system similar to that used in C#. Events allow\nmulticast delegates and arbitrary message passing. They use weak references so\nthey don't keep their handlers alive if they are otherwise out of scope.\n... | [
{
"content": "Repeat the full code snippet:\n<|memory_start|>```python\n\"\"\"\nevents.py\n\nDefines a simple event handler system similar to that used in C#. Events allow\nmulticast delegates and arbitrary message passing. They use weak references so\nthey don't keep their handlers alive if they are otherwise... | ```python
"""
events.py
Defines a simple event handler system similar to that used in C#. Events allow
multicast delegates and arbitrary message passing. They use weak references so
they don't keep their handlers alive if they are otherwise out of scope.
"""
import weakref
import maya.utils
from functools import par... |
[
{
"content": "Write the code verbatim:\n```python\nr\"\"\"JSON (JavaScript Object Notation) <http://json.org> is a subset of\r\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\r\ninterchange format.\r\n\r\n:mod:`simplejson` exposes an API familiar to users of the standard library\r\n:mod:`ma... | [
{
"content": "Write the code verbatim:\n<|memory_start|>```python\nr\"\"\"JSON (JavaScript Object Notation) <http://json.org> is a subset of\r\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\r\ninterchange format.\r\n\r\n:mod:`simplejson` exposes an API familiar to users of the standard lib... | ```python
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintai... |
[
{
"content": "Repeat the following code:\n```python\n# -*- coding: utf-8 -*-\n#\n# goo-server api documentation build configuration file, created by\n# sphinx-quickstart on Wed Dec 19 10:15:12 2012.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all poss... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# goo-server api documentation build configuration file, created by\n# sphinx-quickstart on Wed Dec 19 10:15:12 2012.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note t... | ```python
# -*- coding: utf-8 -*-
#
# goo-server api documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 19 10:15:12 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... |
[
{
"content": "```python\nimport sys\nimport math\nimport time\nimport random\n\nfrom bzrc import BZRC, Command\n\nclass PigeonAgent(object):\n \n def __init__(self, bzrc, mode, time):\n self.bzrc = bzrc\n self.mode = mode\n self.num_tanks = 1\n self.cur_time = time\n \n ... | [
{
"content": "<|memory_start|>```python\nimport sys\nimport math\nimport time\nimport random\n\nfrom bzrc import BZRC, Command\n\nclass PigeonAgent(object):\n \n def __init__(self, bzrc, mode, time):\n self.bzrc = bzrc\n self.mode = mode\n self.num_tanks = 1\n self.cur_time = t... | ```python
import sys
import math
import time
import random
from bzrc import BZRC, Command
class PigeonAgent(object):
def __init__(self, bzrc, mode, time):
self.bzrc = bzrc
self.mode = mode
self.num_tanks = 1
self.cur_time = time
self.const_velocity = .5
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.