prompt
listlengths
1
1
compression_prompt
listlengths
1
1
target
stringlengths
1.03k
828k
[ { "content": "Here is the source code:\n```python\n#!/usr/bin/env python\n\n\"\"\"@See preprocessed data\n\"\"\"\nfrom numpy import*\nimport matplotlib.pyplot as plt\nfrom GestureModel import*\nfrom Creator import*\nfrom Classifier import*\n\n\n\ndef plotResults(gr_points,gr_sig, b_points,b_sig,name_model):\n ...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n\"\"\"@See preprocessed data\n\"\"\"\nfrom numpy import*\nimport matplotlib.pyplot as plt\nfrom GestureModel import*\nfrom Creator import*\nfrom Classifier import*\n\n\n\ndef plotResults(gr_points,gr_sig, b_points,b_sig,...
```python #!/usr/bin/env python """@See preprocessed data """ from numpy import* import matplotlib.pyplot as plt from GestureModel import* from Creator import* from Classifier import* def plotResults(gr_points,gr_sig, b_points,b_sig,name_model): from scipy import linalg import matplotlib.pyplot as plt ...
[ { "content": "```python\n#!/usr/bin/env python\nimport logging\nimport math\nimport os\n\nimport monetdb.sql as db\n\nfrom src.errors import SourceException, ImageStateError\nfrom src.gsmconnectionmanager import GSMConnectionManager\nfrom src.gsmlogger import get_gsm_logger\nfrom src.sqllist import get_sql, get...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\nimport logging\nimport math\nimport os\n\nimport monetdb.sql as db\n\nfrom src.errors import SourceException, ImageStateError\nfrom src.gsmconnectionmanager import GSMConnectionManager\nfrom src.gsmlogger import get_gsm_logger\nfrom src.sqllist imp...
```python #!/usr/bin/env python import logging import math import os import monetdb.sql as db from src.errors import SourceException, ImageStateError from src.gsmconnectionmanager import GSMConnectionManager from src.gsmlogger import get_gsm_logger from src.sqllist import get_sql, get_svn_version, GLOBALS from src.gr...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\nimport warnings\n\nimport numpy as np\nimport six\n\nfrom .._externals.ppca import PPCA\nfrom .._shared.helpers import get_type\n\n\ndef format_data(x, vectorizer='CountVectorizer',\n semantic='LatentDirichletAllocat...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\nimport warnings\n\nimport numpy as np\nimport six\n\nfrom .._externals.ppca import PPCA\nfrom .._shared.helpers import get_type\n\n\ndef format_data(x, vectorizer='CountVectorizer',\n semantic='Latent...
```python import warnings import numpy as np import six from .._externals.ppca import PPCA from .._shared.helpers import get_type def format_data(x, vectorizer='CountVectorizer', semantic='LatentDirichletAllocation', corpus='wiki', ppca=True, text_align='hyper'): """ Formats data into a list...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n## begin license ##\n#\n# \"Weightless\" is a High Performance Asynchronous Networking Library. See http://weightless.io\n#\n# Copyright (C) 2010-2011 Seek You Too (CQ2) http://www.cq2.nl\n# Copyright (C) 2011-2015, 2020-2021 Seecr (Seek You Too B.V.) https://se...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n## begin license ##\n#\n# \"Weightless\" is a High Performance Asynchronous Networking Library. See http://weightless.io\n#\n# Copyright (C) 2010-2011 Seek You Too (CQ2) http://www.cq2.nl\n# Copyright (C) 2011-2015, 2020-2021 Seecr (Seek You Too ...
```python # -*- coding: utf-8 -*- ## begin license ## # # "Weightless" is a High Performance Asynchronous Networking Library. See http://weightless.io # # Copyright (C) 2010-2011 Seek You Too (CQ2) http://www.cq2.nl # Copyright (C) 2011-2015, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl # Copyright (C) 2015 Kon...
[ { "content": "Return the code unaltered:\n```python\nimport warnings\n\nfrom django.conf import settings\nfrom django.contrib.auth.models import User, Group, Permission, AnonymousUser\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.test import TestCase\n\n\nclass BackendTest(TestCase):\...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\nimport warnings\n\nfrom django.conf import settings\nfrom django.contrib.auth.models import User, Group, Permission, AnonymousUser\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.test import TestCase\n\n\nclass Backend...
```python import warnings from django.conf import settings from django.contrib.auth.models import User, Group, Permission, AnonymousUser from django.contrib.contenttypes.models import ContentType from django.test import TestCase class BackendTest(TestCase): backend = 'django.contrib.auth.backends.ModelBackend' ...
[ { "content": "Here is a code snippet:\n```python\n# -*- coding: utf-8 -*-\nfrom pybythec import utils\nfrom pybythec.utils import f\nfrom pybythec.utils import PybythecError\nfrom pybythec.BuildStatus import BuildStatus\nfrom pybythec.BuildElements import BuildElements\n\nimport os\nimport sys\nimport time\nfro...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom pybythec import utils\nfrom pybythec.utils import f\nfrom pybythec.utils import PybythecError\nfrom pybythec.BuildStatus import BuildStatus\nfrom pybythec.BuildElements import BuildElements\n\nimport os\nimport sys\n...
```python # -*- coding: utf-8 -*- from pybythec import utils from pybythec.utils import f from pybythec.utils import PybythecError from pybythec.BuildStatus import BuildStatus from pybythec.BuildElements import BuildElements import os import sys import time from threading import Thread log = utils.Logger('pybythec') ...
[ { "content": "Here is a code file:\n```python\n# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.\n# License: GNU General Public License v3. See license.txt\n\nfrom __future__ import unicode_literals\nimport webnotes\nfrom webnotes import _, msgprint\nfrom webnotes.utils import flt\nimport time\nfrom accoun...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.\n# License: GNU General Public License v3. See license.txt\n\nfrom __future__ import unicode_literals\nimport webnotes\nfrom webnotes import _, msgprint\nfrom webnotes.utils import flt\nimport t...
```python # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes import _, msgprint from webnotes.utils import flt import time from accounts.utils import get_fiscal_year from controllers.tren...
[ { "content": "Here is the code block:\n```python\n# -*- coding: utf-8 -*-\n# flake8: noqa\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 'Cluster'\n ...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# flake8: noqa\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 '...
```python # -*- coding: utf-8 -*- # flake8: noqa 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 'Cluster' db.create_table('documents_cluster', ( ('id', ...
[ { "content": "Return the code exactly, with no changes:\n```python\nimport os\n\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom django.template.defaultfilters import slugify\n\n\nclass RecordTracking(models.Model):\n user = models.CharField(\n null=True, blank=True,\n ...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\nimport os\n\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom django.template.defaultfilters import slugify\n\n\nclass RecordTracking(models.Model):\n user = models.CharField(\n null=True...
```python import os from django.db import models from django.contrib.auth.models import User from django.template.defaultfilters import slugify class RecordTracking(models.Model): user = models.CharField( null=True, blank=True, max_length=64, verbose_name='Usuário') time = models.DateTimeFiel...
[ { "content": "```python\n\"\"\"Import and export collision data\"\"\"\n\nclass TestBhkCollisionSphereShape(TestBaseGeometry, TestBhkCollision):\n n_name = \"collisions/base_bhkcollision_sphere\" #name of nif\n b_name = \"Cube\" #name of blender mesh object\n\n def b_create_object(self):\n b_obj ...
[ { "content": "<|memory_start|>```python\n\"\"\"Import and export collision data\"\"\"\n\nclass TestBhkCollisionSphereShape(TestBaseGeometry, TestBhkCollision):\n n_name = \"collisions/base_bhkcollision_sphere\" #name of nif\n b_name = \"Cube\" #name of blender mesh object\n\n def b_create_object(self):...
```python """Import and export collision data""" class TestBhkCollisionSphereShape(TestBaseGeometry, TestBhkCollision): n_name = "collisions/base_bhkcollision_sphere" #name of nif b_name = "Cube" #name of blender mesh object def b_create_object(self): b_obj = TestBaseGeometry.b_create_object(self)...
[ { "content": "```python\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_almost_equal, assert_array_almost_equal\nfrom pycpd import AffineRegistration\n\n\ndef test_2D():\n B = np.array([[1.0, 0.5], [0, 1.0]])\n t = np.array([0.5, 1.0])\n\n Y = np.loadtxt('data/fish_target.txt')\n ...
[ { "content": "<|memory_start|>```python\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_almost_equal, assert_array_almost_equal\nfrom pycpd import AffineRegistration\n\n\ndef test_2D():\n B = np.array([[1.0, 0.5], [0, 1.0]])\n t = np.array([0.5, 1.0])\n\n Y = np.loadtxt('data/fish_...
```python import pytest import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal from pycpd import AffineRegistration def test_2D(): B = np.array([[1.0, 0.5], [0, 1.0]]) t = np.array([0.5, 1.0]) Y = np.loadtxt('data/fish_target.txt') X = np.dot(Y, B) + np.tile(t, (n...
[ { "content": "```python\n# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as 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 field 'DatabaseMigrate.origin...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as 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 field 'Databa...
```python # -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'DatabaseMigrate.origin_environment' db.add_colu...
[ { "content": "Here is a code file:\n```python\n\"\"\"INSTEON Climate Control Device Class.\"\"\"\nimport logging\n\nfrom insteonplm.devices import Device\nfrom insteonplm.constants import COMMAND_EXTENDED_GET_SET_0X2E_0X00\nfrom insteonplm.messages.extendedSend import ExtendedSend\nfrom insteonplm.messages.user...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n\"\"\"INSTEON Climate Control Device Class.\"\"\"\nimport logging\n\nfrom insteonplm.devices import Device\nfrom insteonplm.constants import COMMAND_EXTENDED_GET_SET_0X2E_0X00\nfrom insteonplm.messages.extendedSend import ExtendedSend\nfrom insteonp...
```python """INSTEON Climate Control Device Class.""" import logging from insteonplm.devices import Device from insteonplm.constants import COMMAND_EXTENDED_GET_SET_0X2E_0X00 from insteonplm.messages.extendedSend import ExtendedSend from insteonplm.messages.userdata import Userdata from insteonplm.states.thermostat im...
[ { "content": "Repeat the full code snippet:\n```python\nfrom apscheduler.schedulers.blocking import BlockingScheduler\nfrom bamslips.fund.fund_realtime_info import paralle_get_fund_realtime_info_according_fund_code\nfrom bamslips.conf.fund_code_list import code_list\n\n\nsched = BlockingScheduler()\n\n#@sched.s...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\nfrom apscheduler.schedulers.blocking import BlockingScheduler\nfrom bamslips.fund.fund_realtime_info import paralle_get_fund_realtime_info_according_fund_code\nfrom bamslips.conf.fund_code_list import code_list\n\n\nsched = BlockingSchedule...
```python from apscheduler.schedulers.blocking import BlockingScheduler from bamslips.fund.fund_realtime_info import paralle_get_fund_realtime_info_according_fund_code from bamslips.conf.fund_code_list import code_list sched = BlockingScheduler() #@sched.scheduled_job('cron',id='fund_realtime_fun_info_job',hour='0-4...
[ { "content": "Here is some code:\n```python\n# -*- coding: utf-8 -*-\n# Part of Odoo. See LICENSE file for full copyright and licensing details.\n\nimport base64\nimport logging\nimport psycopg2\nimport werkzeug.utils\nimport werkzeug.wrappers\n\nfrom werkzeug.urls import url_encode\n\nfrom odoo import api, htt...
[ { "content": "Here is some code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Part of Odoo. See LICENSE file for full copyright and licensing details.\n\nimport base64\nimport logging\nimport psycopg2\nimport werkzeug.utils\nimport werkzeug.wrappers\n\nfrom werkzeug.urls import url_encode\n\nfrom odoo...
```python # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import logging import psycopg2 import werkzeug.utils import werkzeug.wrappers from werkzeug.urls import url_encode from odoo import api, http, registry, SUPERUSER_ID, _ from odoo.exceptions impo...
[ { "content": "```python\n\"\"\"\nResystem Scheduling Service.\nReleased under New BSD License.\nCopyright © 2015, Vadim Markovtsev :: Angry Developers LLC\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions...
[ { "content": "<|memory_start|>```python\n\"\"\"\nResystem Scheduling Service.\nReleased under New BSD License.\nCopyright © 2015, Vadim Markovtsev :: Angry Developers LLC\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the foll...
```python """ Resystem Scheduling Service. Released under New BSD License. Copyright © 2015, Vadim Markovtsev :: Angry Developers LLC All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions ...
[ { "content": "Recreate the original code text:\n```python\n#! /usr/bin/env python3\n\nimport sys, os\nimport unittest\nimport yaml\nimport json\n\nsys.path.append(os.path.join(os.path.dirname(__file__), '..'))\nimport tammy\n\nclass PeerJ(unittest.TestCase):\n def test_pubtype(self):\n self.assertRais...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\n#! /usr/bin/env python3\n\nimport sys, os\nimport unittest\nimport yaml\nimport json\n\nsys.path.append(os.path.join(os.path.dirname(__file__), '..'))\nimport tammy\n\nclass PeerJ(unittest.TestCase):\n def test_pubtype(self):\n ...
```python #! /usr/bin/env python3 import sys, os import unittest import yaml import json sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import tammy class PeerJ(unittest.TestCase): def test_pubtype(self): self.assertRaises(ValueError, tammy.from_peerj, 200, 'paper') def test_argtype(s...
[ { "content": "Here is the source code:\n```python\ndef find_rigid_transform(a, b, visualize=False):\n \"\"\"\n Args:\n a: a 3xN array of vertex locations\n b: a 3xN array of vertex locations\n\n Returns: (R,T) such that R.dot(a)+T ~= b\n Based on Arun et al, \"Least-squares fitting of ...
[ { "content": "Here is the source code:\n<|memory_start|>```python\ndef find_rigid_transform(a, b, visualize=False):\n \"\"\"\n Args:\n a: a 3xN array of vertex locations\n b: a 3xN array of vertex locations\n\n Returns: (R,T) such that R.dot(a)+T ~= b\n Based on Arun et al, \"Least-squ...
```python def find_rigid_transform(a, b, visualize=False): """ Args: a: a 3xN array of vertex locations b: a 3xN array of vertex locations Returns: (R,T) such that R.dot(a)+T ~= b Based on Arun et al, "Least-squares fitting of two 3-D point sets," 1987. See also Eggert et al, "Estim...
[ { "content": "Repeat the code precisely as written (spacing intact):\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 li...
[ { "content": "Repeat the code precisely as written (spacing intact):\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 pro...
```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. # Ch...
[ { "content": "Provide a verbatim copy of the code:\n```python\nimport clientConfig as cConf\nfrom mmp_tracer_api import objID\nfrom comsol_api import MMPComsolDummy\nfrom mupif import *\nimport logging\nlogger = logging.getLogger()\n\nimport time as timeTime\nstart = timeTime.time()\nlogger.info('Timer started'...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\nimport clientConfig as cConf\nfrom mmp_tracer_api import objID\nfrom comsol_api import MMPComsolDummy\nfrom mupif import *\nimport logging\nlogger = logging.getLogger()\n\nimport time as timeTime\nstart = timeTime.time()\nlogger.info...
```python import clientConfig as cConf from mmp_tracer_api import objID from comsol_api import MMPComsolDummy from mupif import * import logging logger = logging.getLogger() import time as timeTime start = timeTime.time() logger.info('Timer started') # locate nameserver ns = PyroUtil.connectNameServer( nshost=cCo...
[ { "content": "Here is a code file:\n```python\n# -*- coding: utf-8 -*-\n\nimport wx\n\nfrom ..common.path import resource_filename\nfrom .translator import Translator\nfrom ..common.i18n import N_\n\n\nclass BaseView(Translator):\n \"\"\"Base class for all views.\n\n This class come with helper functions ...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nimport wx\n\nfrom ..common.path import resource_filename\nfrom .translator import Translator\nfrom ..common.i18n import N_\n\n\nclass BaseView(Translator):\n \"\"\"Base class for all views.\n\n This class come with h...
```python # -*- coding: utf-8 -*- import wx from ..common.path import resource_filename from .translator import Translator from ..common.i18n import N_ class BaseView(Translator): """Base class for all views. This class come with helper functions to configure the view. Class Attributes: LIGHT_...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\n# -*- coding: utf-8 -*-\nimport sys\nimport json\nimport six\nfrom funcy import select_keys, cached_property, once, once_per, monkey, wraps\nfrom funcy.py2 import mapcat, map\nfrom .cross import pickle, md5\n\nimport django\nfro...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport sys\nimport json\nimport six\nfrom funcy import select_keys, cached_property, once, once_per, monkey, wraps\nfrom funcy.py2 import mapcat, map\nfrom .cross import pickle, md5\n\nim...
```python # -*- coding: utf-8 -*- import sys import json import six from funcy import select_keys, cached_property, once, once_per, monkey, wraps from funcy.py2 import mapcat, map from .cross import pickle, md5 import django from django.utils.encoding import smart_str from django.core.exceptions import ImproperlyConfi...
[ { "content": "```python\nfrom unittest.mock import patch, Mock\n\nimport pytest\nimport yaml\n\nfrom asphalt.core import command\n\nDerivedApplication = None\n\n\ndef test_quickstart_application(monkeypatch, tmpdir, capsys):\n def mock_input(text):\n if text == 'Project name: ':\n return 'E...
[ { "content": "<|memory_start|>```python\nfrom unittest.mock import patch, Mock\n\nimport pytest\nimport yaml\n\nfrom asphalt.core import command\n\nDerivedApplication = None\n\n\ndef test_quickstart_application(monkeypatch, tmpdir, capsys):\n def mock_input(text):\n if text == 'Project name: ':\n ...
```python from unittest.mock import patch, Mock import pytest import yaml from asphalt.core import command DerivedApplication = None def test_quickstart_application(monkeypatch, tmpdir, capsys): def mock_input(text): if text == 'Project name: ': return 'Example Project' elif text ==...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\n#-*- coding: utf-8 -*-\r\n'''\r\nCreated on 2016. 11. 19\r\nUpdated on 2016. 01. 09\r\n\r\n'''\r\nfrom __future__ import print_function\r\nimport os\r\nimport re\r\nfrom utils import PrettyStringBuilder\r\nfrom utils import Progres...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n#-*- coding: utf-8 -*-\r\n'''\r\nCreated on 2016. 11. 19\r\nUpdated on 2016. 01. 09\r\n\r\n'''\r\nfrom __future__ import print_function\r\nimport os\r\nimport re\r\nfrom utils import PrettyStringBuilder\r\nfrom util...
```python #-*- coding: utf-8 -*- ''' Created on 2016. 11. 19 Updated on 2016. 01. 09 ''' from __future__ import print_function import os import re from utils import PrettyStringBuilder from utils import Progress import javalang class Resource(object): Stopwords = None EngDictionary = None @static...
[ { "content": "Here is a code snippet:\n```python\nimport toto\nimport zmq\nimport cPickle as pickle\nimport zlib\nimport logging\nfrom toto.exceptions import *\nfrom toto.workerconnection import WorkerConnection\nfrom threading import Thread\nfrom tornado.options import options\nfrom tornado.gen import Task\nfr...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\nimport toto\nimport zmq\nimport cPickle as pickle\nimport zlib\nimport logging\nfrom toto.exceptions import *\nfrom toto.workerconnection import WorkerConnection\nfrom threading import Thread\nfrom tornado.options import options\nfrom tornado.gen...
```python import toto import zmq import cPickle as pickle import zlib import logging from toto.exceptions import * from toto.workerconnection import WorkerConnection from threading import Thread from tornado.options import options from tornado.gen import Task from collections import deque from zmq.eventloop.ioloop impo...
[ { "content": "Here is a code file:\n```python\nfrom math import ceil\n\nfrom django.db import IntegrityError, connection, models\nfrom django.db.models.deletion import Collector\nfrom django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE\nfrom django.test import TestCase, skipIfDBFeature, skipUnlessDBFe...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nfrom math import ceil\n\nfrom django.db import IntegrityError, connection, models\nfrom django.db.models.deletion import Collector\nfrom django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE\nfrom django.test import TestCase, skipIfDBFeature...
```python from math import ceil from django.db import IntegrityError, connection, models from django.db.models.deletion import Collector from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from .models import ( MR, A, Avatar, Ba...
[ { "content": "```python\nimport os\r\nimport subprocess\r\nfrom collections import defaultdict\r\nfrom datetime import datetime\r\nimport csv\r\nfrom csv import DictReader\r\nimport math\r\nfrom glob import glob\r\n\r\n# Data locations\r\nloc_train = \"../data/train.csv\"\r\nloc_test = \"../data/test.csv\"\r\nl...
[ { "content": "<|memory_start|>```python\nimport os\r\nimport subprocess\r\nfrom collections import defaultdict\r\nfrom datetime import datetime\r\nimport csv\r\nfrom csv import DictReader\r\nimport math\r\nfrom glob import glob\r\n\r\n# Data locations\r\nloc_train = \"../data/train.csv\"\r\nloc_test = \"../data...
```python import os import subprocess from collections import defaultdict from datetime import datetime import csv from csv import DictReader import math from glob import glob # Data locations loc_train = "../data/train.csv" loc_test = "../data/test.csv" loc_labels = "../data/trainLabels.csv" loc_best = "...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n# ~*~ coding: utf-8 ~*~\n\"\"\"Module that defines a Marshmallow field for Peewee's foreign keys.\"\"\"\n\nfrom marshmallow import fields\n\nfrom .mixin import FleakerFieldMixin\n\n\nclass ForeignKeyField(fields....
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n# ~*~ coding: utf-8 ~*~\n\"\"\"Module that defines a Marshmallow field for Peewee's foreign keys.\"\"\"\n\nfrom marshmallow import fields\n\nfrom .mixin import FleakerFieldMixin\n\n\nclass Foreign...
```python # ~*~ coding: utf-8 ~*~ """Module that defines a Marshmallow field for Peewee's foreign keys.""" from marshmallow import fields from .mixin import FleakerFieldMixin class ForeignKeyField(fields.Integer, FleakerFieldMixin): """Marshmallow field that can be used with Peewee's foreign key setup. Tur...
[ { "content": "Repeat the full code snippet:\n```python\nfrom flask import current_app\n\nfrom changes.backends.base import UnrecoverableException\nfrom changes.config import db\nfrom changes.constants import Status, Result\nfrom changes.jobs.sync_job import sync_job\nfrom changes.models import Job, JobPlan\nfro...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\nfrom flask import current_app\n\nfrom changes.backends.base import UnrecoverableException\nfrom changes.config import db\nfrom changes.constants import Status, Result\nfrom changes.jobs.sync_job import sync_job\nfrom changes.models import J...
```python from flask import current_app from changes.backends.base import UnrecoverableException from changes.config import db from changes.constants import Status, Result from changes.jobs.sync_job import sync_job from changes.models import Job, JobPlan from changes.queue.task import tracked_task def abort_create(t...
[ { "content": "Here is a code file:\n```python\nimport numpy as np\n\nimport unicodecsv\nimport codecs\nimport goslate\nimport sqlite3\n\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.metrics.pairwise import linear_kernel\n\n\ndef imp_load(filename):\n\n texts = []\n books = []\...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nimport numpy as np\n\nimport unicodecsv\nimport codecs\nimport goslate\nimport sqlite3\n\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.metrics.pairwise import linear_kernel\n\n\ndef imp_load(filename):\n\n texts = []\...
```python import numpy as np import unicodecsv import codecs import goslate import sqlite3 from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import linear_kernel def imp_load(filename): texts = [] books = [] chapters = [] verses = [] # Read in a whole bi...
[ { "content": "Repeat the code exactly:\n```python\n# coding=utf-8\n#\n# Copyright 2017 Google Inc. All Rights Reserved.\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# ...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n# coding=utf-8\n#\n# Copyright 2017 Google Inc. All Rights Reserved.\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 Lice...
```python # coding=utf-8 # # Copyright 2017 Google Inc. 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 # # Unless requ...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\nimport os\nimport sys\n\n\ndef is_active():\n return True\n\n\ndef get_name():\n return \"iOS\"\n\n\ndef can_build():\n\n import sys\n import os\n if sys.platform == 'darwin' or os.environ.has_key(...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\nimport os\nimport sys\n\n\ndef is_active():\n return True\n\n\ndef get_name():\n return \"iOS\"\n\n\ndef can_build():\n\n import sys\n import os\n if sys.platform == 'darwin' or os....
```python import os import sys def is_active(): return True def get_name(): return "iOS" def can_build(): import sys import os if sys.platform == 'darwin' or os.environ.has_key("OSXCROSS_IOS"): return True return False def get_opts(): return [ ('IPHONEPLATFORM', 'n...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\nimport os\nfrom PyQt5.QtCore import pyqtSignal, pyqtProperty, qDebug, pyqtSlot\n\nfrom dice.dice_extras.core_app import CoreApp\nfrom dice.dice_extras.tools.json_sync import JsonList\n\n\nclass Home(CoreApp):\n def __init__(self...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\nimport os\nfrom PyQt5.QtCore import pyqtSignal, pyqtProperty, qDebug, pyqtSlot\n\nfrom dice.dice_extras.core_app import CoreApp\nfrom dice.dice_extras.tools.json_sync import JsonList\n\n\nclass Home(CoreApp):\n d...
```python import os from PyQt5.QtCore import pyqtSignal, pyqtProperty, qDebug, pyqtSlot from dice.dice_extras.core_app import CoreApp from dice.dice_extras.tools.json_sync import JsonList class Home(CoreApp): def __init__(self, parent=None): super(Home, self).__init__(parent) settings_folder = o...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n#!/usr/bin/env python3\r\n\"\"\"\r\nTo run: python3 nb2to3.py notebook-or-directory\r\n\"\"\"\r\n# Authors: Thomas Kluyver, Fernando Perez\r\n# See: https://gist.github.com/takluyver/c8839593c615bb2f6e80\r\n\r\n# found at https://sta...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n#!/usr/bin/env python3\r\n\"\"\"\r\nTo run: python3 nb2to3.py notebook-or-directory\r\n\"\"\"\r\n# Authors: Thomas Kluyver, Fernando Perez\r\n# See: https://gist.github.com/takluyver/c8839593c615bb2f6e80\r\n\r\n# foun...
```python #!/usr/bin/env python3 """ To run: python3 nb2to3.py notebook-or-directory """ # Authors: Thomas Kluyver, Fernando Perez # See: https://gist.github.com/takluyver/c8839593c615bb2f6e80 # found at https://stackoverflow.com/questions/20651502/ipython-code-migration-from-python-2-to-python-3 import argp...
[ { "content": "```python\n#!/usr/bin/env python\n# encoding: utf8\nimport imaplib\nimport optparse\nimport MySQLdb\nimport memcache\nimport ldb\nimport os\nimport re\nimport subprocess\nimport sys\nfrom samba.param import LoadParm\nfrom samba.samdb import SamDB\nfrom samba.auth import system_session\n\n\nclass S...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n# encoding: utf8\nimport imaplib\nimport optparse\nimport MySQLdb\nimport memcache\nimport ldb\nimport os\nimport re\nimport subprocess\nimport sys\nfrom samba.param import LoadParm\nfrom samba.samdb import SamDB\nfrom samba.auth import system_sess...
```python #!/usr/bin/env python # encoding: utf8 import imaplib import optparse import MySQLdb import memcache import ldb import os import re import subprocess import sys from samba.param import LoadParm from samba.samdb import SamDB from samba.auth import system_session class SambaOCHelper(object): def __init__(...
[ { "content": "Reconstruct the code exactly:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n###############################################################################\n# $Id: ogr_couchdb.py 33793 2016-03-26 13:02:07Z goatbar $\n#\n# Project: GDAL/OGR Test Suite\n# Purpose: CouchDB driver test...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n###############################################################################\n# $Id: ogr_couchdb.py 33793 2016-03-26 13:02:07Z goatbar $\n#\n# Project: GDAL/OGR Test Suite\n# Purpose: Cou...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # $Id: ogr_couchdb.py 33793 2016-03-26 13:02:07Z goatbar $ # # Project: GDAL/OGR Test Suite # Purpose: CouchDB driver testing. # Author: Even Rouault <even dot rouault at mines das...
[ { "content": "Replicate the source code:\n```python\nimport unittest\n\nfrom dart.client.python.dart_client import Dart\nfrom dart.engine.no_op.metadata import NoOpActionTypes\nfrom dart.model.action import ActionData, Action, ActionState\nfrom dart.model.datastore import Datastore, DatastoreData, DatastoreStat...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\nimport unittest\n\nfrom dart.client.python.dart_client import Dart\nfrom dart.engine.no_op.metadata import NoOpActionTypes\nfrom dart.model.action import ActionData, Action, ActionState\nfrom dart.model.datastore import Datastore, DatastoreDat...
```python import unittest from dart.client.python.dart_client import Dart from dart.engine.no_op.metadata import NoOpActionTypes from dart.model.action import ActionData, Action, ActionState from dart.model.datastore import Datastore, DatastoreData, DatastoreState from dart.model.trigger import Trigger, TriggerState f...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\nimport cointipbot, traceback, time\n\nclass Main():\n cb = None\n\n def __init__(self):\n '''\n Unfortunately, we cannot instantiate CointipBot only once due to the way pifkoin works. \n\n Pifkoin will open a...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\nimport cointipbot, traceback, time\n\nclass Main():\n cb = None\n\n def __init__(self):\n '''\n Unfortunately, we cannot instantiate CointipBot only once due to the way pifkoin works. \n\n Pif...
```python import cointipbot, traceback, time class Main(): cb = None def __init__(self): ''' Unfortunately, we cannot instantiate CointipBot only once due to the way pifkoin works. Pifkoin will open an HTTP connection to the RPC client which will eventually close when the bot complet...
[ { "content": "Write the code verbatim:\n```python\nfrom enigma import eRCInput, getPrevAsciiCode\nfrom Screens.Screen import Screen\nfrom Screens.MessageBox import MessageBox\nfrom Screens.VirtualKeyBoard import VirtualKeyBoard\nfrom Components.ActionMap import NumberActionMap\nfrom Components.Label import Labe...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\nfrom enigma import eRCInput, getPrevAsciiCode\nfrom Screens.Screen import Screen\nfrom Screens.MessageBox import MessageBox\nfrom Screens.VirtualKeyBoard import VirtualKeyBoard\nfrom Components.ActionMap import NumberActionMap\nfrom Components.L...
```python from enigma import eRCInput, getPrevAsciiCode from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.VirtualKeyBoard import VirtualKeyBoard from Components.ActionMap import NumberActionMap from Components.Label import Label from Components.Input import Input from Components.P...
[ { "content": "Here is a code snippet:\n```python\n# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\nclass Migration(SchemaMigration):\n \n def forwards(self, orm):\n \n # Adding model 'Classifier'\n db.cr...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\nclass Migration(SchemaMigration):\n \n def forwards(self, orm):\n \n # Adding model 'Classifier...
```python # encoding: 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 'Classifier' db.create_table('userpypi_classifier', ( ('id', self...
[ { "content": "Replicate the source code:\n```python\nfrom typing import Dict\n\nfrom Src.BioAnalyzer.DataAccess.Entities.GenePrioritization.DifferentialValueBase import DifferentialValueBase\nfrom Src.Core.Entity.EntityBase import EntityBase\n\n\nclass DifferentialMicroRnaExpressionLevelValue(DifferentialValueB...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\nfrom typing import Dict\n\nfrom Src.BioAnalyzer.DataAccess.Entities.GenePrioritization.DifferentialValueBase import DifferentialValueBase\nfrom Src.Core.Entity.EntityBase import EntityBase\n\n\nclass DifferentialMicroRnaExpressionLevelValue(Di...
```python from typing import Dict from Src.BioAnalyzer.DataAccess.Entities.GenePrioritization.DifferentialValueBase import DifferentialValueBase from Src.Core.Entity.EntityBase import EntityBase class DifferentialMicroRnaExpressionLevelValue(DifferentialValueBase, EntityBase): """description of class""" def ...
[ { "content": "```python\n\"\"\"The description for an FMOD Studio Event.\"\"\"\n\nfrom ctypes import byref, c_int, c_void_p, create_string_buffer\n\nfrom .event_instance import EventInstance\nfrom .studio_object import StudioObject\nfrom .enums import LOADING_STATE\n\nclass EventDescription(StudioObject):\n ...
[ { "content": "<|memory_start|>```python\n\"\"\"The description for an FMOD Studio Event.\"\"\"\n\nfrom ctypes import byref, c_int, c_void_p, create_string_buffer\n\nfrom .event_instance import EventInstance\nfrom .studio_object import StudioObject\nfrom .enums import LOADING_STATE\n\nclass EventDescription(Stud...
```python """The description for an FMOD Studio Event.""" from ctypes import byref, c_int, c_void_p, create_string_buffer from .event_instance import EventInstance from .studio_object import StudioObject from .enums import LOADING_STATE class EventDescription(StudioObject): """The description for an FMOD Studio ...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n#\n# matrigram documentation build configuration file, created by\n# sphinx-quickstart on Tue Dec 20 11:09:38 2016.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are ...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# matrigram documentation build configuration file, created by\n# sphinx-quickstart on Tue Dec 20 11:09:38 2016.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configura...
```python # -*- coding: utf-8 -*- # # matrigram documentation build configuration file, created by # sphinx-quickstart on Tue Dec 20 11:09:38 2016. # # 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...
[ { "content": "Here is some code:\n```python\n#!/usr/bin/env python2.3\n\n# Fix one or all canary records by replacing all medline metadata\n# with results of a fresh pubmed query.\n#\n# $Id$\n\nfrom optparse import OptionParser\nimport pprint\nimport time\n\nimport canary.context\nfrom canary.loader import Pars...
[ { "content": "Here is some code:\n<|memory_start|>```python\n#!/usr/bin/env python2.3\n\n# Fix one or all canary records by replacing all medline metadata\n# with results of a fresh pubmed query.\n#\n# $Id$\n\nfrom optparse import OptionParser\nimport pprint\nimport time\n\nimport canary.context\nfrom canary.lo...
```python #!/usr/bin/env python2.3 # Fix one or all canary records by replacing all medline metadata # with results of a fresh pubmed query. # # $Id$ from optparse import OptionParser import pprint import time import canary.context from canary.loader import Parser, QueuedRecord from canary.search import PubmedSearch...
[ { "content": "Replicate the source code:\n```python\n# Copyright 1998-2007 Gentoo Foundation\n# Distributed under the terms of the GNU General Public License v2\n\nimport codecs\nimport errno\nimport sys\nfrom portage import os\nfrom portage import _encodings\nfrom portage import _unicode_encode\nfrom portage.t...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n# Copyright 1998-2007 Gentoo Foundation\n# Distributed under the terms of the GNU General Public License v2\n\nimport codecs\nimport errno\nimport sys\nfrom portage import os\nfrom portage import _encodings\nfrom portage import _unicode_encode...
```python # Copyright 1998-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import codecs import errno import sys from portage import os from portage import _encodings from portage import _unicode_encode from portage.tests import TestCase class SpawnTestCase(TestCase): def t...
[ { "content": "Repeat the following code:\n```python\nfrom flask import Flask, render_template, json, request, redirect, session\nfrom flask.ext.mysql import MySQL\nfrom werkzeug import generate_password_hash, check_password_hash\nfrom flask_googlemaps import GoogleMaps\nfrom flask_googlemaps import Map\nimport ...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\nfrom flask import Flask, render_template, json, request, redirect, session\nfrom flask.ext.mysql import MySQL\nfrom werkzeug import generate_password_hash, check_password_hash\nfrom flask_googlemaps import GoogleMaps\nfrom flask_googlemaps imp...
```python from flask import Flask, render_template, json, request, redirect, session from flask.ext.mysql import MySQL from werkzeug import generate_password_hash, check_password_hash from flask_googlemaps import GoogleMaps from flask_googlemaps import Map import pygal from pygal.style import BlueStyle, NeonStyle,DarkS...
[ { "content": "Provide an exact copy of the source code:\n```python\n# -*- coding: utf-8 -*-\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# ...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\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 Lic...
```python # -*- coding: utf-8 -*- # 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 applica...
[ { "content": "Recreate the original code text:\n```python\n#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\nimport os\nfrom django.conf.urls.defaults import *\n\nurlpatterns = []\n\n\n# load the rapidsms configuration\nfrom rapidsms.config import Config\nconf = Config(os.environ[\"RAPIDSMS_INI\"])\n\n\n# ...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\n#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\nimport os\nfrom django.conf.urls.defaults import *\n\nurlpatterns = []\n\n\n# load the rapidsms configuration\nfrom rapidsms.config import Config\nconf = Config(os.environ[\"RAPIDSMS...
```python #!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import os from django.conf.urls.defaults import * urlpatterns = [] # load the rapidsms configuration from rapidsms.config import Config conf = Config(os.environ["RAPIDSMS_INI"]) # iterate each of the active rapidsms apps (from the ini), # and (attempt t...
[ { "content": "Here is some code:\n```python\n\"\"\"\n mbed CMSIS-DAP debugger\n Copyright (c) 2006-2013 ARM Limited\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://ww...
[ { "content": "Here is some code:\n<|memory_start|>```python\n\"\"\"\n mbed CMSIS-DAP debugger\n Copyright (c) 2006-2013 ARM Limited\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...
```python """ mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by a...
[ { "content": "```python\n# Copyright (c) 2012 OpenStack, LLC.\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.apache.or...
[ { "content": "<|memory_start|>```python\n# Copyright (c) 2012 OpenStack, LLC.\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...
```python # Copyright (c) 2012 OpenStack, LLC. # 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 # # Un...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n# Copyright 2017 Google Inc.\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.ap...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# Copyright 2017 Google Inc.\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 # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[ { "content": "Here is some code:\n```python\nimport os\nimport argparse\nfrom PIL import Image\n\ndef is_image(file_name):\n if \".png\" in file_name or \".jpg\" in file_name:\n return True\n else:\n return False\n\ndef resize_image(input_path, output_path, wd=0, ht=0):\n img = Image.open...
[ { "content": "Here is some code:\n<|memory_start|>```python\nimport os\nimport argparse\nfrom PIL import Image\n\ndef is_image(file_name):\n if \".png\" in file_name or \".jpg\" in file_name:\n return True\n else:\n return False\n\ndef resize_image(input_path, output_path, wd=0, ht=0):\n ...
```python import os import argparse from PIL import Image def is_image(file_name): if ".png" in file_name or ".jpg" in file_name: return True else: return False def resize_image(input_path, output_path, wd=0, ht=0): img = Image.open(input_path) # Resize the image sz = img.size ...
[ { "content": "```python\n#!/usr/bin/env python3\n# Copyright (c) 2014-2018 The Energi Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n# Copyright (c) 2014-2016 The Bitcoin Core developers\n# Distributed u...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python3\n# Copyright (c) 2014-2018 The Energi Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n# Copyright (c) 2014-2016 The Bitcoin Core developers\...
```python #!/usr/bin/env python3 # Copyright (c) 2014-2018 The Energi Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software licens...
[ { "content": "Provide a verbatim copy of the code:\n```python\n\"\"\"\n:mod: DataManager\n\n.. module: DataManager\n\n:synopsis: DataManager links the functionalities of StorageElement and FileCatalog.\n\nThis module consists of DataManager and related classes.\n\n\"\"\"\n\n\n# # RSCID\n__RCSID__ = \"$Id$\"\n# ...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n\"\"\"\n:mod: DataManager\n\n.. module: DataManager\n\n:synopsis: DataManager links the functionalities of StorageElement and FileCatalog.\n\nThis module consists of DataManager and related classes.\n\n\"\"\"\n\n\n# # RSCID\n__RCSID_...
```python """ :mod: DataManager .. module: DataManager :synopsis: DataManager links the functionalities of StorageElement and FileCatalog. This module consists of DataManager and related classes. """ # # RSCID __RCSID__ = "$Id$" # # imports from datetime import datetime, timedelta import fnmatch import os import ...
[ { "content": "Here is the code content:\n```python\nfrom django import forms\nfrom django.contrib.comments.forms import CommentForm\nfrom django.utils.translation import ugettext_lazy as _\nfrom django_comments_xtd.conf import settings\nfrom django_comments_xtd.models import TmpXtdComment\n\n\nclass XtdCommentF...
[ { "content": "Here is the code content:\n<|memory_start|>```python\nfrom django import forms\nfrom django.contrib.comments.forms import CommentForm\nfrom django.utils.translation import ugettext_lazy as _\nfrom django_comments_xtd.conf import settings\nfrom django_comments_xtd.models import TmpXtdComment\n\n\nc...
```python from django import forms from django.contrib.comments.forms import CommentForm from django.utils.translation import ugettext_lazy as _ from django_comments_xtd.conf import settings from django_comments_xtd.models import TmpXtdComment class XtdCommentForm(CommentForm): followup = forms.BooleanField( ...
[ { "content": "```python\n\"\"\"\nShutterfly Data Sink\n\"\"\"\nimport logging\nlog = logging.getLogger(\"modules.Shutterfly\")\n\nimport conduit\nimport conduit.utils as Utils\nfrom conduit.datatypes import Rid\nimport conduit.dataproviders.Image as Image\nimport conduit.Exceptions as Exceptions\nimport conduit...
[ { "content": "<|memory_start|>```python\n\"\"\"\nShutterfly Data Sink\n\"\"\"\nimport logging\nlog = logging.getLogger(\"modules.Shutterfly\")\n\nimport conduit\nimport conduit.utils as Utils\nfrom conduit.datatypes import Rid\nimport conduit.dataproviders.Image as Image\nimport conduit.Exceptions as Exceptions...
```python """ Shutterfly Data Sink """ import logging log = logging.getLogger("modules.Shutterfly") import conduit import conduit.utils as Utils from conduit.datatypes import Rid import conduit.dataproviders.Image as Image import conduit.Exceptions as Exceptions import conduit.datatypes.Photo as Photo Utils.dataprovi...
[ { "content": "Provide an exact copy of the source code:\n```python\n\"\"\"Boolean algebra module for SymPy\"\"\"\nfrom collections import defaultdict\n\nfrom sympy.core.basic import Basic\nfrom sympy.core.decorators import deprecated\nfrom sympy.core.operations import LatticeOp\nfrom sympy.core.function import ...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n\"\"\"Boolean algebra module for SymPy\"\"\"\nfrom collections import defaultdict\n\nfrom sympy.core.basic import Basic\nfrom sympy.core.decorators import deprecated\nfrom sympy.core.operations import LatticeOp\nfrom sympy.core....
```python """Boolean algebra module for SymPy""" from collections import defaultdict from sympy.core.basic import Basic from sympy.core.decorators import deprecated from sympy.core.operations import LatticeOp from sympy.core.function import Application, sympify from sympy.core.compatibility import ordered, product c...
[ { "content": "Provide an exact copy of the source code:\n```python\nimport os\nBASE_DIR = os.path.dirname(os.path.dirname(__file__))\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret k...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nimport os\nBASE_DIR = os.path.dirname(os.path.dirname(__file__))\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/\n\n# SECURITY WARNING: k...
```python import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '{{ secret_key }}' # SECURIT...
[ { "content": "Here is the snippet:\n```python\nimport theano.tensor as T\n\n\ndef cca_loss(outdim_size, use_all_singular_values):\n \"\"\"\n The main loss function (inner_cca_objective) is wrapped in this function due to\n the constraints imposed by Keras on objective functions\n \"\"\"\n def inn...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\nimport theano.tensor as T\n\n\ndef cca_loss(outdim_size, use_all_singular_values):\n \"\"\"\n The main loss function (inner_cca_objective) is wrapped in this function due to\n the constraints imposed by Keras on objective functions\n \"\...
```python import theano.tensor as T def cca_loss(outdim_size, use_all_singular_values): """ The main loss function (inner_cca_objective) is wrapped in this function due to the constraints imposed by Keras on objective functions """ def inner_cca_objective(y_true, y_pred): """ It is...
[ { "content": "```python\nfrom urllib.parse import urlparse\n\nfrom etherealpost.db.filters import JinjaFilters\nfrom pymongo import MongoClient\nfrom pyramid.config import Configurator\nfrom pyramid.httpexceptions import HTTPMovedPermanently\n\n\n# http://stackoverflow.com/a/15705778\ndef add_auto_route(config,...
[ { "content": "<|memory_start|>```python\nfrom urllib.parse import urlparse\n\nfrom etherealpost.db.filters import JinjaFilters\nfrom pymongo import MongoClient\nfrom pyramid.config import Configurator\nfrom pyramid.httpexceptions import HTTPMovedPermanently\n\n\n# http://stackoverflow.com/a/15705778\ndef add_au...
```python from urllib.parse import urlparse from etherealpost.db.filters import JinjaFilters from pymongo import MongoClient from pyramid.config import Configurator from pyramid.httpexceptions import HTTPMovedPermanently # http://stackoverflow.com/a/15705778 def add_auto_route(config, name, pattern, **kw): confi...
[ { "content": "Write the code verbatim:\n```python\n# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.\n# Copyright (C) NIWA & British Crown (Met Office) & Contributors.\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 b...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.\n# Copyright (C) NIWA & British Crown (Met Office) & Contributors.\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public Licens...
```python # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # 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...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n\"\"\"engine.SCons.Platform.hpux\n\nPlatform-specific initialization for HP-UX systems.\n\nThere normally shouldn't be any need to import this module directly. It\nwill usually be imported through the generic SCons.Platform.Platform()\nsele...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n\"\"\"engine.SCons.Platform.hpux\n\nPlatform-specific initialization for HP-UX systems.\n\nThere normally shouldn't be any need to import this module directly. It\nwill usually be imported through the generic SCons.Platform....
```python """engine.SCons.Platform.hpux Platform-specific initialization for HP-UX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007,...
[ { "content": "Reconstruct the code exactly:\n```python\n# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.\n#\n# This file is part of Navitia,\n# the software to build cool stuff with public transport.\n#\n# Hope you'll enjoy and contribute to this project,\n# powered by Can...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.\n#\n# This file is part of Navitia,\n# the software to build cool stuff with public transport.\n#\n# Hope you'll enjoy and contribute to this project,\n# ...
```python # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n'''\nCreated on 27 lip 2014\n\n@author: Krzysztof Langner\n'''\n\nfrom mewa.client import Connection\n\n\nHOST_URL = \"ws://mewa.cc:9001/ws\"\n# HOST_URL = \"ws://localhost:9000/ws\"\n\nconnection = Connection(HOST_URL)\n\ndef onConnec...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n'''\nCreated on 27 lip 2014\n\n@author: Krzysztof Langner\n'''\n\nfrom mewa.client import Connection\n\n\nHOST_URL = \"ws://mewa.cc:9001/ws\"\n# HOST_URL = \"ws://localhost:9000/ws\"\n\nconnection = Connection(HOST_URL)...
```python ''' Created on 27 lip 2014 @author: Krzysztof Langner ''' from mewa.client import Connection HOST_URL = "ws://mewa.cc:9001/ws" # HOST_URL = "ws://localhost:9000/ws" connection = Connection(HOST_URL) def onConnected(): connection.getDevices() connection.sendEvent("serviceA.event2", "78", True) ...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# -*- coding: utf-8 -*-\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 ...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\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 ma...
```python # -*- coding: utf-8 -*- # 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 applica...
[ { "content": "Return the code exactly, with no changes:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport json\nimport re\nimport os\nimport unicodedata\nimport ConfigParser\nfrom bson import ObjectId\nfrom datetime import datetime\n\nfrom mining.settings import PROJECT_PATH\n\n\ndef slugfy(tex...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport json\nimport re\nimport os\nimport unicodedata\nimport ConfigParser\nfrom bson import ObjectId\nfrom datetime import datetime\n\nfrom mining.settings import PROJECT_PATH\n\n...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- import json import re import os import unicodedata import ConfigParser from bson import ObjectId from datetime import datetime from mining.settings import PROJECT_PATH def slugfy(text): slug = unicodedata.normalize("NFKD", text).encode("UTF-8", "ignore") ...
[ { "content": "Here is the source code:\n```python\n\"\"\"\ntebdIsing2.py\nUse TEBD to compute ground state of transverse field Ising model.\n2014-09-15\n\"\"\"\n\nimport numpy as np\nfrom cmath import *\nfrom mpstest16 import *\nimport time\n\ndef main():\n test0()\n\ndef test0():\n (J,muB,N,t,nsteps,chi)...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n\"\"\"\ntebdIsing2.py\nUse TEBD to compute ground state of transverse field Ising model.\n2014-09-15\n\"\"\"\n\nimport numpy as np\nfrom cmath import *\nfrom mpstest16 import *\nimport time\n\ndef main():\n test0()\n\ndef test0():\n (J,muB...
```python """ tebdIsing2.py Use TEBD to compute ground state of transverse field Ising model. 2014-09-15 """ import numpy as np from cmath import * from mpstest16 import * import time def main(): test0() def test0(): (J,muB,N,t,nsteps,chi) = (0.1,1,3,0.1,100,5) for N in xrange(3,11): test2(J,muB,...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n# -*- coding: utf-8 -*-\n\nimport os\nimport pygame\nimport random\nfrom math import pi, cos, acos, sin, sqrt\n\nimport classes.board\nimport classes.extras as ex\nimport classes.game_driver as gd\nimport classes.level_con...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nimport os\nimport pygame\nimport random\nfrom math import pi, cos, acos, sin, sqrt\n\nimport classes.board\nimport classes.extras as ex\nimport classes.game_driver as gd\nimport c...
```python # -*- coding: utf-8 -*- import os import pygame import random from math import pi, cos, acos, sin, sqrt import classes.board import classes.extras as ex import classes.game_driver as gd import classes.level_controller as lc import classes.simple_vector as sv class Board(gd.BoardGame): def __init__(sel...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\n#!/usr/bin/env python\n\n\"\"\"\n@package mi.dataset.parser.test.test_dosta_abcdjm_cspp\n@file marine-integrations/mi/dataset/parser/test/test_dosta_abcdjm_cspp.py\n@author Mark Worden\n@brief Test code for a dosta_abcdjm_cspp data...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n#!/usr/bin/env python\n\n\"\"\"\n@package mi.dataset.parser.test.test_dosta_abcdjm_cspp\n@file marine-integrations/mi/dataset/parser/test/test_dosta_abcdjm_cspp.py\n@author Mark Worden\n@brief Test code for a dosta_...
```python #!/usr/bin/env python """ @package mi.dataset.parser.test.test_dosta_abcdjm_cspp @file marine-integrations/mi/dataset/parser/test/test_dosta_abcdjm_cspp.py @author Mark Worden @brief Test code for a dosta_abcdjm_cspp data parser """ import os import numpy import yaml import copy from StringIO import StringI...
[ { "content": "```python\n#!/usr/bin/env python\n\n# Based on previous work by\n# Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process)\n# and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)\n\n# A...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n\n# Based on previous work by\n# Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process)\n# and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in...
```python #!/usr/bin/env python # Based on previous work by # Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process) # and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/) # Adapted by M.Hendrix [2015] (d...
[ { "content": "Here is the code content:\n```python\n# Copyright 2015 Internap.\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.apache.org/licenses/LICENSE-2...
[ { "content": "Here is the code content:\n<|memory_start|>```python\n# Copyright 2015 Internap.\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.apache.org/li...
```python # Copyright 2015 Internap. # # 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 w...
[ { "content": "Repeat the code exactly:\n```python\n# Copyright (C) 2015-2017 Jan Blechta\n#\n# This file is part of FENaPack.\n#\n# FENaPack is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License as published by\n# the Free Software Foundation, eit...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n# Copyright (C) 2015-2017 Jan Blechta\n#\n# This file is part of FENaPack.\n#\n# FENaPack is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License as published by\n# the Free Software...
```python # Copyright (C) 2015-2017 Jan Blechta # # This file is part of FENaPack. # # FENaPack is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any...
[ { "content": "Here is the code block:\n```python\n# -*- coding: utf-8 -*-\n\n# MIT License\n#\n# Copyright (c) 2017 Tijme Gommers\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Softwa...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n# MIT License\n#\n# Copyright (c) 2017 Tijme Gommers\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\...
```python # -*- coding: utf-8 -*- # MIT License # # Copyright (c) 2017 Tijme Gommers # # 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 r...
[ { "content": "Write the code verbatim:\n```python\nfrom __future__ import (absolute_import, division, print_function)\n\n\nimport sys\nimport warnings\ntry:\n from setuptools import setup\nexcept ImportError:\n try:\n from setuptools.core import setup\n except ImportError:\n from distutil...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\nfrom __future__ import (absolute_import, division, print_function)\n\n\nimport sys\nimport warnings\ntry:\n from setuptools import setup\nexcept ImportError:\n try:\n from setuptools.core import setup\n except ImportError:\n ...
```python from __future__ import (absolute_import, division, print_function) import sys import warnings try: from setuptools import setup except ImportError: try: from setuptools.core import setup except ImportError: from distutils.core import setup from distutils.core import setup, Exten...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author: Dhaval Patel\n# Copyright (C) 2011 - TODAY Denero Team. (<http://www.deneroteam.com>)\n#\n# This program is free software: you can redistribute it and/or modify...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author: Dhaval Patel\n# Copyright (C) 2011 - TODAY Denero Team. (<http://www.deneroteam.com>)\n#\n# This program is free software: you can redistribute ...
```python # -*- coding: utf-8 -*- ############################################################################## # # Author: Dhaval Patel # Copyright (C) 2011 - TODAY Denero Team. (<http://www.deneroteam.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
[ { "content": "Here is the source code:\n```python\n# Copyright (c) 2013, Menno Smits\n# Released subject to the New BSD License\n# Please see http://en.wikipedia.org/wiki/BSD_licenses\n\nfrom __future__ import unicode_literals\n\nimport imaplib\nimport select\nimport socket\nimport sys\nimport warnings\nfrom da...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n# Copyright (c) 2013, Menno Smits\n# Released subject to the New BSD License\n# Please see http://en.wikipedia.org/wiki/BSD_licenses\n\nfrom __future__ import unicode_literals\n\nimport imaplib\nimport select\nimport socket\nimport sys\nimport w...
```python # Copyright (c) 2013, Menno Smits # Released subject to the New BSD License # Please see http://en.wikipedia.org/wiki/BSD_licenses from __future__ import unicode_literals import imaplib import select import socket import sys import warnings from datetime import datetime from operator import itemgetter from...
[ { "content": "```python\n# Copyright (C) 2020 OpenMotics BV\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later...
[ { "content": "<|memory_start|>```python\n# Copyright (C) 2020 OpenMotics BV\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your o...
```python # Copyright (C) 2020 OpenMotics BV # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program i...
[ { "content": "Repeat the full code snippet:\n```python\n# Copyright 2013 Hewlett-Packard Development Company, L.P.\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# htt...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# Copyright 2013 Hewlett-Packard Development Company, L.P.\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 a...
```python # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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...
[ { "content": "Provide a verbatim copy of the code:\n```python\n# -*- coding: utf-8 -*-\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# htt...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\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 ...
```python # -*- coding: utf-8 -*- # 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 applica...
[ { "content": "Here is a code file:\n```python\n#!/usr/bin/env python3\n# Copyright (c) 2015-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the ZMQ API.\"\"\"\n\nfrom test_fram...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n#!/usr/bin/env python3\n# Copyright (c) 2015-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the ZMQ API.\"\"\"\n...
```python #!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the ZMQ API.""" from test_framework.test_framework import TrollcoinTestFramework from t...
[ { "content": "Here is the script:\n```python\nfrom Components.config import config, ConfigSubsection, ConfigSelection, ConfigPIN, ConfigYesNo, ConfigSubList, ConfigInteger\nfrom Components.ServiceList import refreshServiceList\nfrom Screens.InputBox import PinInput\nfrom Screens.MessageBox import MessageBox\nfr...
[ { "content": "Here is the script:\n<|memory_start|>```python\nfrom Components.config import config, ConfigSubsection, ConfigSelection, ConfigPIN, ConfigYesNo, ConfigSubList, ConfigInteger\nfrom Components.ServiceList import refreshServiceList\nfrom Screens.InputBox import PinInput\nfrom Screens.MessageBox impor...
```python from Components.config import config, ConfigSubsection, ConfigSelection, ConfigPIN, ConfigYesNo, ConfigSubList, ConfigInteger from Components.ServiceList import refreshServiceList from Screens.InputBox import PinInput from Screens.MessageBox import MessageBox from Tools.BoundFunction import boundFunction from...
[ { "content": "```python\n'''\nHandle connections from a client greeter. Provide information such as\nsub-servers and news.\n'''\nimport asyncore\nimport socket\nimport struct\n\n\nclass Handler(asyncore.dispatcher_with_send):\n def handle_read(self):\n data = self.recv(1)\n if data == b'\\x00':...
[ { "content": "<|memory_start|>```python\n'''\nHandle connections from a client greeter. Provide information such as\nsub-servers and news.\n'''\nimport asyncore\nimport socket\nimport struct\n\n\nclass Handler(asyncore.dispatcher_with_send):\n def handle_read(self):\n data = self.recv(1)\n if d...
```python ''' Handle connections from a client greeter. Provide information such as sub-servers and news. ''' import asyncore import socket import struct class Handler(asyncore.dispatcher_with_send): def handle_read(self): data = self.recv(1) if data == b'\x00': # TODO: load alternate ...
[ { "content": "Return the code unaltered:\n```python\n# Copyright (C) 2011 Groza Cristian\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, either version 3 of the License, or...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n# Copyright (C) 2011 Groza Cristian\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, either version 3 of...
```python # Copyright (C) 2011 Groza Cristian # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pro...
[ { "content": "Here is the script:\n```python\nimport neurolab as nl\nimport game2\nimport othello\nimport ntuplesystematic as nts\nimport time\nimport random\n\nclass nn:\n\tdef __init__(self):\n\t\tself.x = [[-1,1] for x in range(64)]\n\t\tself.net = nl.net.newff(self.x,[1])\n\t\t#self.net.trainf = nl.train.tr...
[ { "content": "Here is the script:\n<|memory_start|>```python\nimport neurolab as nl\nimport game2\nimport othello\nimport ntuplesystematic as nts\nimport time\nimport random\n\nclass nn:\n\tdef __init__(self):\n\t\tself.x = [[-1,1] for x in range(64)]\n\t\tself.net = nl.net.newff(self.x,[1])\n\t\t#self.net.trai...
```python import neurolab as nl import game2 import othello import ntuplesystematic as nts import time import random class nn: def __init__(self): self.x = [[-1,1] for x in range(64)] self.net = nl.net.newff(self.x,[1]) #self.net.trainf = nl.train.train_gd self.moveb = 0 self.movew = 0 self.last_vb = 0 ...
[ { "content": "Repeat the full code snippet:\n```python\n# -*- coding: utf-8 -*-\n#\n# This file is part of HEPData.\n# Copyright (C) 2021 CERN.\n#\n# HEPData is free software; you can redistribute it\n# and/or modify it under the terms of the GNU General Public License as\n# published by the Free Software Found...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# This file is part of HEPData.\n# Copyright (C) 2021 CERN.\n#\n# HEPData is free software; you can redistribute it\n# and/or modify it under the terms of the GNU General Public License as\n# published by the Fre...
```python # -*- coding: utf-8 -*- # # This file is part of HEPData. # Copyright (C) 2021 CERN. # # HEPData 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, or (at your option)...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\nfrom flask import render_template, request\nimport numbers\nfrom pprint import pprint\nfrom arps.restserver import app, db, ApiException, apiview\nfrom arps.globals import *\nfrom arps.validation import get_schemas_for_endpoint\nfrom a...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\nfrom flask import render_template, request\nimport numbers\nfrom pprint import pprint\nfrom arps.restserver import app, db, ApiException, apiview\nfrom arps.globals import *\nfrom arps.validation import get_schemas_for_...
```python from flask import render_template, request import numbers from pprint import pprint from arps.restserver import app, db, ApiException, apiview from arps.globals import * from arps.validation import get_schemas_for_endpoint from arps.models import * METHODS = ['GET', 'POST', 'PUT', 'DELETE'] @app.route('/')...
[ { "content": "Here is the script:\n```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"Calculate the pitch needed to maintain contact between the front wheel and\nground.\n\"\"\"\nfrom sympy import simplify, symbols\nfrom sympy.physics.mechanics import ReferenceFrame, Point\nfrom sympy.physics.mec...
[ { "content": "Here is the script:\n<|memory_start|>```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"Calculate the pitch needed to maintain contact between the front wheel and\nground.\n\"\"\"\nfrom sympy import simplify, symbols\nfrom sympy.physics.mechanics import ReferenceFrame, Point\nfrom s...
```python #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Calculate the pitch needed to maintain contact between the front wheel and ground. """ from sympy import simplify, symbols from sympy.physics.mechanics import ReferenceFrame, Point from sympy.physics.mechanics import msprint from mpmath import findroot from sy...
[ { "content": "Return the code unaltered:\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2017-04-21 23:16\nfrom __future__ import unicode_literals\n\nimport django.contrib.auth.models\nimport django.contrib.auth.validators\nfrom django.db import migrations, models\nimport django.utils.timez...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.10.2 on 2017-04-21 23:16\nfrom __future__ import unicode_literals\n\nimport django.contrib.auth.models\nimport django.contrib.auth.validators\nfrom django.db import migrations, models\nimport dj...
```python # -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-04-21 23:16 from __future__ import unicode_literals import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial ...
[ { "content": "Reconstruct the code exactly:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n flask_security.forms\n ~~~~~~~~~~~~~~~~~~~~\n\n Flask-Security forms module\n\n :copyright: (c) 2012 by Matt Wright.\n :copyright: (c) 2017 by CERN.\n :license: MIT, see LICENSE for more details.\n\"\"\"\...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\n flask_security.forms\n ~~~~~~~~~~~~~~~~~~~~\n\n Flask-Security forms module\n\n :copyright: (c) 2012 by Matt Wright.\n :copyright: (c) 2017 by CERN.\n :license: MIT, see LICENSE for more d...
```python # -*- coding: utf-8 -*- """ flask_security.forms ~~~~~~~~~~~~~~~~~~~~ Flask-Security forms module :copyright: (c) 2012 by Matt Wright. :copyright: (c) 2017 by CERN. :license: MIT, see LICENSE for more details. """ import inspect from flask import Markup, current_app, flash, request...
[ { "content": "```python\nfrom __future__ import with_statement\n\nfrom fudge import Fake, patched_context, with_fakes\nimport unittest\nfrom nose.tools import raises, ok_\nimport random\nimport sys\n\nimport fabric\nfrom fabric.tasks import WrappedCallableTask, execute, Task, get_task_details\nfrom fabric.main ...
[ { "content": "<|memory_start|>```python\nfrom __future__ import with_statement\n\nfrom fudge import Fake, patched_context, with_fakes\nimport unittest\nfrom nose.tools import raises, ok_\nimport random\nimport sys\n\nimport fabric\nfrom fabric.tasks import WrappedCallableTask, execute, Task, get_task_details\nf...
```python from __future__ import with_statement from fudge import Fake, patched_context, with_fakes import unittest from nose.tools import raises, ok_ import random import sys import fabric from fabric.tasks import WrappedCallableTask, execute, Task, get_task_details from fabric.main import display_command from fabri...
[ { "content": "Here is the snippet:\n```python\n#!/usr/bin/env python\n#\n# Copyright 2007 Doug Hellmann.\n#\n#\n# All Rights Reserved\n#\n# Permission to use, copy, modify, and distribute this software and\n# its documentation for any purpose and without fee is hereby\n# granted, provide...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n#\n# Copyright 2007 Doug Hellmann.\n#\n#\n# All Rights Reserved\n#\n# Permission to use, copy, modify, and distribute this software and\n# its documentation for any purpose and without fee is hereby\n# ...
```python #!/usr/bin/env python # # Copyright 2007 Doug Hellmann. # # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copi...
[ { "content": "Replicate the source code:\n```python\n#!/usr/bin/env python\n\nimport argparse\nimport numpy as np\nimport math\nimport sys\nimport pdb\nimport bisect\n\nap = argparse.ArgumentParser(description=\"Print gap support from output of PrintGaps.py.\")\nap.add_argument(\"table\", help=\"Input tabular f...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nimport argparse\nimport numpy as np\nimport math\nimport sys\nimport pdb\nimport bisect\n\nap = argparse.ArgumentParser(description=\"Print gap support from output of PrintGaps.py.\")\nap.add_argument(\"table\", help=\...
```python #!/usr/bin/env python import argparse import numpy as np import math import sys import pdb import bisect ap = argparse.ArgumentParser(description="Print gap support from output of PrintGaps.py.") ap.add_argument("table", help="Input tabular file") ap.add_argument("out", help="Output file, stdout implies std...
[ { "content": "Here is the code block:\n```python\nimport sqlalchemy.types\nimport sqlalchemy.schema\nimport sqlalchemy.orm\n\nimport rod.model\n\n\nclass Lesson(rod.model.db.Model, rod.model.PersistentMixin):\n __tablename__ = 'lesson'\n\n id = sqlalchemy.schema.Column(sqlalchemy.types.Integer, primary_ke...
[ { "content": "Here is the code block:\n<|memory_start|>```python\nimport sqlalchemy.types\nimport sqlalchemy.schema\nimport sqlalchemy.orm\n\nimport rod.model\n\n\nclass Lesson(rod.model.db.Model, rod.model.PersistentMixin):\n __tablename__ = 'lesson'\n\n id = sqlalchemy.schema.Column(sqlalchemy.types.Int...
```python import sqlalchemy.types import sqlalchemy.schema import sqlalchemy.orm import rod.model class Lesson(rod.model.db.Model, rod.model.PersistentMixin): __tablename__ = 'lesson' id = sqlalchemy.schema.Column(sqlalchemy.types.Integer, primary_key=True) time = sqlalchemy.schema.Column(sqlalchemy.typ...
[ { "content": "Return the code exactly, with no changes:\n```python\n# coding=utf-8\n# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).\n# Licensed under the Apache License, Version 2.0 (see LICENSE).\n\nfrom __future__ import (absolute_import, division, generators, nested_scopes, print_function,...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# coding=utf-8\n# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).\n# Licensed under the Apache License, Version 2.0 (see LICENSE).\n\nfrom __future__ import (absolute_import, division, generators, nested_scopes,...
```python # coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os ...
[ { "content": "Produce an exact reconstruction of the code:\n```python\nfrom pydotorg import context_processors\nfrom django.test import TestCase\n\n\nclass MockRequest(object):\n def __init__(self, path):\n self.path = path\n super().__init__()\n\n\nclass TemplateProcessorsTestCase(TestCase):\n...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\nfrom pydotorg import context_processors\nfrom django.test import TestCase\n\n\nclass MockRequest(object):\n def __init__(self, path):\n self.path = path\n super().__init__()\n\n\nclass TemplateProcessorsTestC...
```python from pydotorg import context_processors from django.test import TestCase class MockRequest(object): def __init__(self, path): self.path = path super().__init__() class TemplateProcessorsTestCase(TestCase): def test_url_name(self): mock_request = MockRequest(path='/inner/') ...
[ { "content": "Provide an exact copy of the source code:\n```python\nfrom enigma import eComponentScan, iDVBFrontend, eTimer\nfrom Components.NimManager import nimmanager as nimmgr\nfrom Tools.Transponder import getChannelNumber\n\nclass ServiceScan:\n\n\tIdle = 1\n\tRunning = 2\n\tDone = 3\n\tError = 4\n\tDoneP...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nfrom enigma import eComponentScan, iDVBFrontend, eTimer\nfrom Components.NimManager import nimmanager as nimmgr\nfrom Tools.Transponder import getChannelNumber\n\nclass ServiceScan:\n\n\tIdle = 1\n\tRunning = 2\n\tDone = 3\n\tEr...
```python from enigma import eComponentScan, iDVBFrontend, eTimer from Components.NimManager import nimmanager as nimmgr from Tools.Transponder import getChannelNumber class ServiceScan: Idle = 1 Running = 2 Done = 3 Error = 4 DonePartially = 5 Errors = { 0: _("error starting scanning"), 1: _("error while ...
[ { "content": "Here is a code snippet:\n```python\n# (c) 2015, Ansible Inc,\n#\n# This file is part of Ansible\n#\n# Ansible 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, either version 3 of the Lic...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# (c) 2015, Ansible Inc,\n#\n# This file is part of Ansible\n#\n# Ansible 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, either vers...
```python # (c) 2015, Ansible Inc, # # This file is part of Ansible # # Ansible 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. # # Ans...
[ { "content": "Repeat the full code snippet:\n```python\nfrom .base import AuthenticationBase\n\n\nclass Delegated(AuthenticationBase):\n \"\"\"Delegated authentication endpoints.\n\n Args:\n domain (str): Your auth0 domain (e.g: username.auth0.com)\n \"\"\"\n\n def get_token(self, client_id, ...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\nfrom .base import AuthenticationBase\n\n\nclass Delegated(AuthenticationBase):\n \"\"\"Delegated authentication endpoints.\n\n Args:\n domain (str): Your auth0 domain (e.g: username.auth0.com)\n \"\"\"\n\n def get_token(s...
```python from .base import AuthenticationBase class Delegated(AuthenticationBase): """Delegated authentication endpoints. Args: domain (str): Your auth0 domain (e.g: username.auth0.com) """ def get_token(self, client_id, target, api_type, grant_type, id_token=None, refresh...
[ { "content": "```python\nfrom bson import json_util\nfrom flask import Blueprint, render_template, request\nfrom flask import Response\nfrom datetime import datetime\n\nfrom app import mongo\nfrom app import utils\nimport json\nmod_api = Blueprint('api', __name__, url_prefix='/api')\n\n\n@mod_api.route('/', met...
[ { "content": "<|memory_start|>```python\nfrom bson import json_util\nfrom flask import Blueprint, render_template, request\nfrom flask import Response\nfrom datetime import datetime\n\nfrom app import mongo\nfrom app import utils\nimport json\nmod_api = Blueprint('api', __name__, url_prefix='/api')\n\n\n@mod_ap...
```python from bson import json_util from flask import Blueprint, render_template, request from flask import Response from datetime import datetime from app import mongo from app import utils import json mod_api = Blueprint('api', __name__, url_prefix='/api') @mod_api.route('/', methods=['GET']) def index(): '''...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\nfrom optparse import make_option\nfrom django.core.management.base import BaseCommand\nfrom django.core.exceptions import ObjectDoesNotExist\n\nclass Command(BaseCommand):\n \"\"\"\n Get/Delete list of contributo...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\nfrom optparse import make_option\nfrom django.core.management.base import BaseCommand\nfrom django.core.exceptions import ObjectDoesNotExist\n\nclass Command(BaseCommand):\n \"\"\"\n Get/Delete li...
```python from optparse import make_option from django.core.management.base import BaseCommand from django.core.exceptions import ObjectDoesNotExist class Command(BaseCommand): """ Get/Delete list of contributors, non-contributors and total users """ option_list = BaseCommand.option_list + ( m...