prompt
listlengths
1
1
compression_prompt
listlengths
1
1
target
stringlengths
1.03k
828k
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# -*- coding: utf-8 -*-\n\nimport os\nfrom base64 import standard_b64decode\nfrom functools import wraps\nfrom urllib.parse import unquote\n\nfrom cryptography.hazmat.backends import default_backend\nfrom cryptography....
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nimport os\nfrom base64 import standard_b64decode\nfrom functools import wraps\nfrom urllib.parse import unquote\n\nfrom cryptography.hazmat.backends import default_backend\nfr...
```python # -*- coding: utf-8 -*- import os from base64 import standard_b64decode from functools import wraps from urllib.parse import unquote from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes import flask from flask.json import json...
[ { "content": "Repeat the following code:\n```python\nclass WordBranch(object):\r\n \"\"\"WordBranch represents a single branch in the tree of all the valid word combinations.\r\n\r\n Attributes:\r\n letter_branch (LetterBranch) The reference to the LetterBranch that represents the word.\r\n ...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\nclass WordBranch(object):\r\n \"\"\"WordBranch represents a single branch in the tree of all the valid word combinations.\r\n\r\n Attributes:\r\n letter_branch (LetterBranch) The reference to the LetterBranch that represents the...
```python class WordBranch(object): """WordBranch represents a single branch in the tree of all the valid word combinations. Attributes: letter_branch (LetterBranch) The reference to the LetterBranch that represents the word. origin (WordBranch) The reference to the parent Wor...
[ { "content": "```python\n#!/usr/bin/env python\n# Copyright (c) 2012 Cloudera, Inc. All rights reserved.\n# Validates all aggregate functions across all datatypes\n#\nimport logging\nimport pytest\nfrom tests.common.test_vector import *\nfrom tests.common.impala_test_suite import ImpalaTestSuite\nfrom tests.com...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n# Copyright (c) 2012 Cloudera, Inc. All rights reserved.\n# Validates all aggregate functions across all datatypes\n#\nimport logging\nimport pytest\nfrom tests.common.test_vector import *\nfrom tests.common.impala_test_suite import ImpalaTestSuite...
```python #!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Validates all aggregate functions across all datatypes # import logging import pytest from tests.common.test_vector import * from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.test_dimensions import crea...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\n# Copyright 2014 - StackStorm, 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:/...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n# Copyright 2014 - StackStorm, 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...
```python # Copyright 2014 - StackStorm, 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...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\nimport json\nimport tornado.web\n\nimport logging\nlogger = logging.getLogger('boilerplate.' + __name__)\n\n\nclass BaseHandler(tornado.web.RequestHandler):\n \"\"\"A class to collect common handler methods - all other handle...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\nimport json\nimport tornado.web\n\nimport logging\nlogger = logging.getLogger('boilerplate.' + __name__)\n\n\nclass BaseHandler(tornado.web.RequestHandler):\n \"\"\"A class to collect common handler methods - ...
```python import json import tornado.web import logging logger = logging.getLogger('boilerplate.' + __name__) class BaseHandler(tornado.web.RequestHandler): """A class to collect common handler methods - all other handlers should subclass this one. """ def load_json(self): """Load JSON from ...
[ { "content": "Recreate the original code text:\n```python\n#!/usr/bin/env python\nfrom __future__ import division\nfrom __future__ import print_function\nfrom builtins import input\nfrom builtins import range\nfrom past.utils import old_div\nimport sys\nimport matplotlib\nif matplotlib.get_backend() != \"TKAgg\...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\n#!/usr/bin/env python\nfrom __future__ import division\nfrom __future__ import print_function\nfrom builtins import input\nfrom builtins import range\nfrom past.utils import old_div\nimport sys\nimport matplotlib\nif matplotlib.get_backe...
```python #!/usr/bin/env python from __future__ import division from __future__ import print_function from builtins import input from builtins import range from past.utils import old_div import sys import matplotlib if matplotlib.get_backend() != "TKAgg": matplotlib.use("TKAgg") import pmagpy.pmag as pmag import pma...
[ { "content": "Here is the script:\n```python\n\"\"\"\nDescription: \nRequirements: pySerial, wxPython Phoenix\n\nglossary and of other descriptions:\n\nDMM - digital multimeter\nPSU - power supply\nSBC - single board computer\n\nINS - general instrument commands\n\nGEN - general sequence instructions\n\n\"\"\"\...
[ { "content": "Here is the script:\n<|memory_start|>```python\n\"\"\"\nDescription: \nRequirements: pySerial, wxPython Phoenix\n\nglossary and of other descriptions:\n\nDMM - digital multimeter\nPSU - power supply\nSBC - single board computer\n\nINS - general instrument commands\n\nGEN - general sequence instruc...
```python """ Description: Requirements: pySerial, wxPython Phoenix glossary and of other descriptions: DMM - digital multimeter PSU - power supply SBC - single board computer INS - general instrument commands GEN - general sequence instructions """ import logging import sys import time import wx import theme im...
[ { "content": "```python\n\"\"\"\nFunctions for working with broadcast database\n\nCopyright 2015, Outernet Inc.\nSome rights reserved.\n\nThis software is free software licensed under the terms of GPLv3. See COPYING\nfile that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.\n\"\"\"\n\nimport...
[ { "content": "<|memory_start|>```python\n\"\"\"\nFunctions for working with broadcast database\n\nCopyright 2015, Outernet Inc.\nSome rights reserved.\n\nThis software is free software licensed under the terms of GPLv3. See COPYING\nfile that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.\n...
```python """ Functions for working with broadcast database Copyright 2015, Outernet Inc. Some rights reserved. This software is free software licensed under the terms of GPLv3. See COPYING file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt. """ import sqlite3 import datetime import sqlize...
[ { "content": "Here is the script:\n```python\n\"\"\"\nSteady-state channel flow in 3D\n===============================\n\nSteady state flow in a channel subject to bottom friction.\n\nThis test reproduces the \"channel\" test case found in GOTM test suite [1]\nand also [2].\n\nThis case tests the turbulence clo...
[ { "content": "Here is the script:\n<|memory_start|>```python\n\"\"\"\nSteady-state channel flow in 3D\n===============================\n\nSteady state flow in a channel subject to bottom friction.\n\nThis test reproduces the \"channel\" test case found in GOTM test suite [1]\nand also [2].\n\nThis case tests th...
```python """ Steady-state channel flow in 3D =============================== Steady state flow in a channel subject to bottom friction. This test reproduces the "channel" test case found in GOTM test suite [1] and also [2]. This case tests the turbulence closure model, vertical viscosity and bottom boundary layer. ...
[ { "content": "Here is the source code:\n```python\n# Copyright 2019 The TensorFlow Authors. 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# http:/...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n# Copyright 2019 The TensorFlow Authors. 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\...
```python # Copyright 2019 The TensorFlow Authors. 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 required ...
[ { "content": "```python\nfrom __future__ import division, absolute_import, print_function\n\nimport numpy as np\nfrom . import kde_utils\n\nclass TestCDF(kde_utils.KDETester):\n @classmethod\n def setUpClass(cls):\n kde_utils.setupClass_lognorm(cls)\n\n def method_works(self, k, method, name):\n...
[ { "content": "<|memory_start|>```python\nfrom __future__ import division, absolute_import, print_function\n\nimport numpy as np\nfrom . import kde_utils\n\nclass TestCDF(kde_utils.KDETester):\n @classmethod\n def setUpClass(cls):\n kde_utils.setupClass_lognorm(cls)\n\n def method_works(self, k, ...
```python from __future__ import division, absolute_import, print_function import numpy as np from . import kde_utils class TestCDF(kde_utils.KDETester): @classmethod def setUpClass(cls): kde_utils.setupClass_lognorm(cls) def method_works(self, k, method, name): begin, last = k.cdf([k.low...
[ { "content": "```python\n#!/usr/bin/env python\n# Copyright (C) 2011 Smarkets Limited <support@smarkets.com>\n#\n# This module is released under the MIT License:\n# http://www.opensource.org/licenses/mit-license.php\nimport glob\nimport io\nimport os\nimport shutil\nimport subprocess\nimport sys\nfrom distutils...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n# Copyright (C) 2011 Smarkets Limited <support@smarkets.com>\n#\n# This module is released under the MIT License:\n# http://www.opensource.org/licenses/mit-license.php\nimport glob\nimport io\nimport os\nimport shutil\nimport subprocess\nimport sys...
```python #!/usr/bin/env python # Copyright (C) 2011 Smarkets Limited <support@smarkets.com> # # This module is released under the MIT License: # http://www.opensource.org/licenses/mit-license.php import glob import io import os import shutil import subprocess import sys from distutils.command import build, clean from ...
[ { "content": "```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to i...
[ { "content": "<|memory_start|>```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable la...
```python # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distribut...
[ { "content": "Provide a verbatim copy of the code:\n```python\n\"\"\"Public interface managing the workflow for peer assessments.\n\nThe Peer Assessment Workflow API exposes all public actions required to complete\nthe workflow for a given submission.\n\n\"\"\"\nimport logging\nimport json\n\nfrom django.db imp...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n\"\"\"Public interface managing the workflow for peer assessments.\n\nThe Peer Assessment Workflow API exposes all public actions required to complete\nthe workflow for a given submission.\n\n\"\"\"\nimport logging\nimport json\n\nfr...
```python """Public interface managing the workflow for peer assessments. The Peer Assessment Workflow API exposes all public actions required to complete the workflow for a given submission. """ import logging import json from django.db import DatabaseError, IntegrityError, transaction from django.utils import time...
[ { "content": "Here is a code file:\n```python\n#!/usr/bin/env python\n# Copyright 2015-2016 Yelp 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.apache...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n#!/usr/bin/env python\n# Copyright 2015-2016 Yelp 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# h...
```python #!/usr/bin/env python # Copyright 2015-2016 Yelp 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 appli...
[ { "content": "```python\n#!usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Final Project\"\"\"\n\ndef print_menu():\n \"\"\"Welcome To Your Phonebook\n\n Args: None\n Returns: None\n Examples:\n >>> Enter your choice (1-4) here: 1\n >>> Enter new contact name: chris\n >>> Enter contac...
[ { "content": "<|memory_start|>```python\n#!usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Final Project\"\"\"\n\ndef print_menu():\n \"\"\"Welcome To Your Phonebook\n\n Args: None\n Returns: None\n Examples:\n >>> Enter your choice (1-4) here: 1\n >>> Enter new contact name: chris\n ...
```python #!usr/bin/env python # -*- coding: utf-8 -*- """Final Project""" def print_menu(): """Welcome To Your Phonebook Args: None Returns: None Examples: >>> Enter your choice (1-4) here: 1 >>> Enter new contact name: chris >>> Enter contact phone number: 347192456 ...You entere...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\n# -*- coding: utf-8 -*-\n#\n# This file is execfile()d with the current directory set to its containing dir.\n\n# To run the docs build directly, generate module index:\n# rm -r docs/api ; sphinx-apidoc -f -M -o docs/api smif\n# ...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# This file is execfile()d with the current directory set to its containing dir.\n\n# To run the docs build directly, generate module index:\n# rm -r docs/api ; sphinx-apidoc -f -M -o d...
```python # -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # To run the docs build directly, generate module index: # rm -r docs/api ; sphinx-apidoc -f -M -o docs/api smif # Then build docs: # rm -r docs/_build ; sphinx-build -b html docs docs/_build/html ...
[ { "content": "Replicate the source code:\n```python\n<<<<<<< HEAD\nfrom ListNode import ListNode\nclass Solution(object):\n def swapPairs(self, head):\n if not head or not head.next :\n return head\n resNode = head.next\n while head :\n pre = head\n head ...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n<<<<<<< HEAD\nfrom ListNode import ListNode\nclass Solution(object):\n def swapPairs(self, head):\n if not head or not head.next :\n return head\n resNode = head.next\n while head :\n pre = head\n ...
```python <<<<<<< HEAD from ListNode import ListNode class Solution(object): def swapPairs(self, head): if not head or not head.next : return head resNode = head.next while head : pre = head head = head.next.next ======= # https://leetcode.com/problems/sw...
[ { "content": "Return the code unaltered:\n```python\n# -*- coding: utf-8 -*-\n#\n# This file is part of EventGhost.\n# Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/>\n#\n# EventGhost is free software: you can redistribute it and/or modify it under\n# the terms of the GNU General Public Li...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# This file is part of EventGhost.\n# Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/>\n#\n# EventGhost is free software: you can redistribute it and/or modify it under\n# the terms of the GNU G...
```python # -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/> # # EventGhost is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, eit...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\n# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a c...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# Yo...
```python # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
[ { "content": "Return the code exactly, with no changes:\n```python\nfrom time import sleep\nfrom uos import urandom\nfrom machine import Pin\nfrom cockle import pins\n\ndataPin = pins[1]\nclockPin = pins[2]\nlatchPin = pins[3]\n\ndataPin.init(Pin.OUT)\nlatchPin.init(Pin.OUT)\nclockPin.init(Pin.OUT)\n\ndataPin.v...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\nfrom time import sleep\nfrom uos import urandom\nfrom machine import Pin\nfrom cockle import pins\n\ndataPin = pins[1]\nclockPin = pins[2]\nlatchPin = pins[3]\n\ndataPin.init(Pin.OUT)\nlatchPin.init(Pin.OUT)\nclockPin.init(Pin.O...
```python from time import sleep from uos import urandom from machine import Pin from cockle import pins dataPin = pins[1] clockPin = pins[2] latchPin = pins[3] dataPin.init(Pin.OUT) latchPin.init(Pin.OUT) clockPin.init(Pin.OUT) dataPin.value(0) latchPin.value(0) clockPin.value(0) delay = 1 numLights = 8 byteCount...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n#!/usr/bin/env python3\n#\n# Copyright (c) 2016, Neil Booth\n#\n# All rights reserved.\n#\n# See the file \"LICENCE\" for information about the copyright\n# and warranty status of this software.\n\n'''Script to send RPC commands to a...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n#!/usr/bin/env python3\n#\n# Copyright (c) 2016, Neil Booth\n#\n# All rights reserved.\n#\n# See the file \"LICENCE\" for information about the copyright\n# and warranty status of this software.\n\n'''Script to send R...
```python #!/usr/bin/env python3 # # Copyright (c) 2016, Neil Booth # # All rights reserved. # # See the file "LICENCE" for information about the copyright # and warranty status of this software. '''Script to send RPC commands to a running ElectrumX server.''' import argparse import asyncio import json from functool...
[ { "content": "```python\n#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nimport os\nimport sys\nimport warnings\nimport subprocess\n\nimport fpdf\npackage_dir = 'fpdf'\n\n# convert the README and format in restructured text (only when registering)\nlong_desc = \"\"\nif os.path.exists(\"README.md\")...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom distutils.core import setup\n\nimport os\nimport sys\nimport warnings\nimport subprocess\n\nimport fpdf\npackage_dir = 'fpdf'\n\n# convert the README and format in restructured text (only when registering)\nlong_desc = \"\"\nif os.path.exist...
```python #!/usr/bin/env python from distutils.core import setup import os import sys import warnings import subprocess import fpdf package_dir = 'fpdf' # convert the README and format in restructured text (only when registering) long_desc = "" if os.path.exists("README.md"): try: cmd = ['pandoc', '--fr...
[ { "content": "Repeat the code precisely:\n```python\nfrom bs4 import BeautifulSoup\nimport urllib\nfrom requests import get\n\ndef speakers(url, year):\n\turl = url\n\tyear = year\n\tsoup = BeautifulSoup(get(url).content)\n\tcards = soup.find_all(attrs={\"class\": \"portfolio-it\"})\n\td = {}\n\tfor card in car...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\nfrom bs4 import BeautifulSoup\nimport urllib\nfrom requests import get\n\ndef speakers(url, year):\n\turl = url\n\tyear = year\n\tsoup = BeautifulSoup(get(url).content)\n\tcards = soup.find_all(attrs={\"class\": \"portfolio-it\"})\n\td = {}\n\...
```python from bs4 import BeautifulSoup import urllib from requests import get def speakers(url, year): url = url year = year soup = BeautifulSoup(get(url).content) cards = soup.find_all(attrs={"class": "portfolio-it"}) d = {} for card in cards: # byline_url = card.a['href'] d.update({card.find('h4').string:...
[ { "content": "Repeat the code precisely:\n```python\n'''\n This is the main settings module for your adapter.\n It will be imported and available to your adapter package:::\n \n from rmas_adapter.conf import settings\n poll_interval = settings.POLL_INTERVAL\n \n You will need to...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n'''\n This is the main settings module for your adapter.\n It will be imported and available to your adapter package:::\n \n from rmas_adapter.conf import settings\n poll_interval = settings.POLL_INTERVAL\n \n ...
```python ''' This is the main settings module for your adapter. It will be imported and available to your adapter package::: from rmas_adapter.conf import settings poll_interval = settings.POLL_INTERVAL You will need to have some code somehwere (usually in your runner.py) that...
[ { "content": "Repeat the code precisely:\n```python\n'''\nDescription\nThis class wraps defs to validate a chromosome\nloci table file used by LDNe2 to filter out loci\npairs that share a chromosome.\n'''\n__filename__ = \"pgchromlocifilemanager.py\"\n__date__ = \"20180502\"\n__author__ = \"Ted Cosart<ted.cosar...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n'''\nDescription\nThis class wraps defs to validate a chromosome\nloci table file used by LDNe2 to filter out loci\npairs that share a chromosome.\n'''\n__filename__ = \"pgchromlocifilemanager.py\"\n__date__ = \"20180502\"\n__author__ = \"Ted ...
```python ''' Description This class wraps defs to validate a chromosome loci table file used by LDNe2 to filter out loci pairs that share a chromosome. ''' __filename__ = "pgchromlocifilemanager.py" __date__ = "20180502" __author__ = "Ted Cosart<ted.cosart@umontana.edu>" ''' This string designates that there is no ch...
[ { "content": "```python\nfrom Components.ActionMap import ActionMap\nfrom Components.Button import Button\nfrom Components.config import config\nfrom Components.MenuList import MenuList\nfrom Components.TimerList import TimerList\nfrom Components.TimerSanityCheck import TimerSanityCheck\nfrom Components.UsageCo...
[ { "content": "<|memory_start|>```python\nfrom Components.ActionMap import ActionMap\nfrom Components.Button import Button\nfrom Components.config import config\nfrom Components.MenuList import MenuList\nfrom Components.TimerList import TimerList\nfrom Components.TimerSanityCheck import TimerSanityCheck\nfrom Co...
```python from Components.ActionMap import ActionMap from Components.Button import Button from Components.config import config from Components.MenuList import MenuList from Components.TimerList import TimerList from Components.TimerSanityCheck import TimerSanityCheck from Components.UsageConfig import preferredTimerPat...
[ { "content": "Repeat the following code:\n```python\n\"\"\"\nsentry.templatetags.sentry_helpers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\n# XXX: Import django-paging's template tags so...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n\"\"\"\nsentry.templatetags.sentry_helpers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\n# XXX: Import django-paging's ...
```python """ sentry.templatetags.sentry_helpers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ # XXX: Import django-paging's template tags so we dont have to worry about # INSTALLED_APPS from django i...
[ { "content": "Repeat the full code snippet:\n```python\n# coding: utf-8\n\n\"\"\"\n Onshape REST API\n\n The Onshape REST API consumed by all clients. # noqa: E501\n\n The version of the OpenAPI document: 1.113\n Contact: api-support@onshape.zendesk.com\n Generated by: https://openapi-generator....
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# coding: utf-8\n\n\"\"\"\n Onshape REST API\n\n The Onshape REST API consumed by all clients. # noqa: E501\n\n The version of the OpenAPI document: 1.113\n Contact: api-support@onshape.zendesk.com\n Generated by: https://op...
```python # coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noq...
[ { "content": "Here is the code block:\n```python\n# Copyright 2018-2020 by Christopher C. Little.\n# This file is part of Abydos.\n#\n# Abydos 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 v...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n# Copyright 2018-2020 by Christopher C. Little.\n# This file is part of Abydos.\n#\n# Abydos 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 Foun...
```python # Copyright 2018-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 la...
[ { "content": "Replicate the source code:\n```python\nimport bpy\nimport pyperclip\n\nfrom math import degrees\n\n\nclass DataBuffer(bpy.types.Operator):\n \"\"\"Export data Position, Rotation and Scale of all selected element\"\"\"\n bl_idname = \"object.data_buffer\"\n bl_label = \"Paste information b...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\nimport bpy\nimport pyperclip\n\nfrom math import degrees\n\n\nclass DataBuffer(bpy.types.Operator):\n \"\"\"Export data Position, Rotation and Scale of all selected element\"\"\"\n bl_idname = \"object.data_buffer\"\n bl_label = \"Pas...
```python import bpy import pyperclip from math import degrees class DataBuffer(bpy.types.Operator): """Export data Position, Rotation and Scale of all selected element""" bl_idname = "object.data_buffer" bl_label = "Paste information buffer" def execute(self, context): objs = context.select...
[ { "content": "Repeat the following code:\n```python\nimport pytest\nimport uqbar.strings\n\nimport supriya\n\n\ndef test_do_not_coerce_arguments():\n synth = supriya.realtime.Synth()\n group = supriya.realtime.Group()\n assert synth.node_id is None\n assert group.node_id is None\n request = supri...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\nimport pytest\nimport uqbar.strings\n\nimport supriya\n\n\ndef test_do_not_coerce_arguments():\n synth = supriya.realtime.Synth()\n group = supriya.realtime.Group()\n assert synth.node_id is None\n assert group.node_id is None\n ...
```python import pytest import uqbar.strings import supriya def test_do_not_coerce_arguments(): synth = supriya.realtime.Synth() group = supriya.realtime.Group() assert synth.node_id is None assert group.node_id is None request = supriya.commands.SynthNewRequest( node_id=synth, synthdef=s...
[ { "content": "Return the code exactly, with no changes:\n```python\n\"\"\"\nReader for the http://entilocali.opencontent.it/\n\"\"\"\n\nimport datetime\nimport posixpath\nimport urlparse\n\nimport requests\n\nfrom datacat.readers import BaseReader\nfrom datacat.schema import DATE_FORMAT\n\n\ndef urljoin(base, *...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n\"\"\"\nReader for the http://entilocali.opencontent.it/\n\"\"\"\n\nimport datetime\nimport posixpath\nimport urlparse\n\nimport requests\n\nfrom datacat.readers import BaseReader\nfrom datacat.schema import DATE_FORMAT\n\n\ndef...
```python """ Reader for the http://entilocali.opencontent.it/ """ import datetime import posixpath import urlparse import requests from datacat.readers import BaseReader from datacat.schema import DATE_FORMAT def urljoin(base, *parts): """A mix between urlparse.urljoin() and posixpath.join()""" return url...
[ { "content": "```python\n#!/usr/bin/env python\n\n#####################################################################\n# Software License Agreement (BSD License)\n#\n# Copyright (c) 2011, Willow Garage, Inc.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# mo...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n\n#####################################################################\n# Software License Agreement (BSD License)\n#\n# Copyright (c) 2011, Willow Garage, Inc.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with ...
```python #!/usr/bin/env python ##################################################################### # Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provid...
[ { "content": "Here is the code block:\n```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jon Surrell\n# Copyright (c) 2013 Jon Surrell\n#\n# License: MIT\n#\n\n\"\"\"This module exports the Stack Ghc plugin class.\"\"\"\n\nfrom SublimeLinter.li...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n#\n# linter.py\n# Linter for SublimeLinter3, a code checking framework for Sublime Text 3\n#\n# Written by Jon Surrell\n# Copyright (c) 2013 Jon Surrell\n#\n# License: MIT\n#\n\n\"\"\"This module exports the Stack Ghc plugin class.\"\"\"\n\nfrom ...
```python # # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Jon Surrell # Copyright (c) 2013 Jon Surrell # # License: MIT # """This module exports the Stack Ghc plugin class.""" from SublimeLinter.lint import Linter, util from os.path import basename class StackG...
[ { "content": "Here is the script:\n```python\n\"\"\"\nfitpack --- curve and surface fitting with splines\n\nfitpack is based on a collection of Fortran routines DIERCKX\nby P. Dierckx (see http://www.netlib.org/dierckx/) transformed\nto double routines by Pearu Peterson.\n\"\"\"\n# Created by Pearu Peterson, Ju...
[ { "content": "Here is the script:\n<|memory_start|>```python\n\"\"\"\nfitpack --- curve and surface fitting with splines\n\nfitpack is based on a collection of Fortran routines DIERCKX\nby P. Dierckx (see http://www.netlib.org/dierckx/) transformed\nto double routines by Pearu Peterson.\n\"\"\"\n# Created by Pe...
```python """ fitpack --- curve and surface fitting with splines fitpack is based on a collection of Fortran routines DIERCKX by P. Dierckx (see http://www.netlib.org/dierckx/) transformed to double routines by Pearu Peterson. """ # Created by Pearu Peterson, June,August 2003 from __future__ import division, print_fun...
[ { "content": "```python\nfrom datetime import timedelta, datetime\n\nfrom airflow import DAG\nfrom airflow.contrib.operators.bigquery_operator import BigQueryOperator\nfrom airflow.contrib.operators.bigquery_to_gcs import BigQueryToCloudStorageOperator\nfrom airflow.contrib.operators.gcs_to_bq import GoogleClou...
[ { "content": "<|memory_start|>```python\nfrom datetime import timedelta, datetime\n\nfrom airflow import DAG\nfrom airflow.contrib.operators.bigquery_operator import BigQueryOperator\nfrom airflow.contrib.operators.bigquery_to_gcs import BigQueryToCloudStorageOperator\nfrom airflow.contrib.operators.gcs_to_bq i...
```python from datetime import timedelta, datetime from airflow import DAG from airflow.contrib.operators.bigquery_operator import BigQueryOperator from airflow.contrib.operators.bigquery_to_gcs import BigQueryToCloudStorageOperator from airflow.contrib.operators.gcs_to_bq import GoogleCloudStorageToBigQueryOperator ...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n# -*- coding: utf-8 -*-\r\nimport markdown\r\nimport ho.pisa as pisa\r\nimport StringIO\r\nimport os\r\nimport re\r\nfrom Cheetah.Template import Template\r\nfrom tempfile import NamedTemporaryFile\r\n\r\ndebug = False\r\n\r\ndef markdown2pd...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\r\nimport markdown\r\nimport ho.pisa as pisa\r\nimport StringIO\r\nimport os\r\nimport re\r\nfrom Cheetah.Template import Template\r\nfrom tempfile import NamedTemporaryFile\r\n\r\ndebug = False\r\n\r\...
```python # -*- coding: utf-8 -*- import markdown import ho.pisa as pisa import StringIO import os import re from Cheetah.Template import Template from tempfile import NamedTemporaryFile debug = False def markdown2pdf(text, pdffile, cssfile='xhtml2pdf.css', src_dir='.', fontfile='arial.ttf', skipT...
[ { "content": "Reconstruct the code exactly:\n```python\n\"\"\"\nBot code for creating chemical items in wikidata from UNII\n\nAdapted from: https://github.com/sebotic/cdk_pywrapper/blob/master/cdk_pywrapper/chemlib.py\n\"\"\"\nimport os\nimport re\nimport subprocess\nimport time\nimport zipfile\nimport pandas a...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n\"\"\"\nBot code for creating chemical items in wikidata from UNII\n\nAdapted from: https://github.com/sebotic/cdk_pywrapper/blob/master/cdk_pywrapper/chemlib.py\n\"\"\"\nimport os\nimport re\nimport subprocess\nimport time\nimport zipfile\...
```python """ Bot code for creating chemical items in wikidata from UNII Adapted from: https://github.com/sebotic/cdk_pywrapper/blob/master/cdk_pywrapper/chemlib.py """ import os import re import subprocess import time import zipfile import pandas as pd import wikidataintegrator.wdi_core as wdi_core data_folder = "un...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom django.conf import settings\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom personas.models import *\nfrom territo...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom django.conf import settings\nfrom django.db import models\nfrom django.contrib.auth.models import User\nfrom personas.models import...
```python # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import models from django.contrib.auth.models import User from personas.models import * from territorios.models import * from establecimientos.models import * from mediosdetransporte.models import *...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n#!/usr/bin/env python3\n\n#Copyright 2018 OSIsoft, 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 a...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n#!/usr/bin/env python3\n\n#Copyright 2018 OSIsoft, 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 ...
```python #!/usr/bin/env python3 #Copyright 2018 OSIsoft, LLC # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # #<http://www.apache.org/licenses/LICENSE-2.0> # #Unless required by applicable la...
[ { "content": "Here is a code file:\n```python\nimport time\nimport functools\n\nclass TimeCost(object):\n def __init__(self, unit='s', precision=4, logger=None):\n self.start = None\n self.end = None\n self.total = 0\n self.unit = unit\n self.precision = precision\n ...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nimport time\nimport functools\n\nclass TimeCost(object):\n def __init__(self, unit='s', precision=4, logger=None):\n self.start = None\n self.end = None\n self.total = 0\n self.unit = unit\n self.precision = pre...
```python import time import functools class TimeCost(object): def __init__(self, unit='s', precision=4, logger=None): self.start = None self.end = None self.total = 0 self.unit = unit self.precision = precision self.__unitfactor = {'s': 1, 'ms': ...
[ { "content": "```python\n\"\"\"\n.. _tut_evoked_objects:\n\nThe :class:`Evoked <mne.Evoked>` data structure: evoked/averaged data\n=====================================================================\n\nThe :class:`Evoked <mne.Evoked>` data structure is mainly used for storing\naveraged data over trials. In MN...
[ { "content": "<|memory_start|>```python\n\"\"\"\n.. _tut_evoked_objects:\n\nThe :class:`Evoked <mne.Evoked>` data structure: evoked/averaged data\n=====================================================================\n\nThe :class:`Evoked <mne.Evoked>` data structure is mainly used for storing\naveraged data ov...
```python """ .. _tut_evoked_objects: The :class:`Evoked <mne.Evoked>` data structure: evoked/averaged data ===================================================================== The :class:`Evoked <mne.Evoked>` data structure is mainly used for storing averaged data over trials. In MNE the evoked objects are usually ...
[ { "content": "```python\nimport sim, sim_items, main\nfrom util import *\nimport random\n\nclass ReinforcedPrefix(sim_items.Prefix):\n \"\"\"\n \"reinforced\" prefix boosts armor by increasing its PV or EV (whichever would\n normally be greater) by 1-3 points. \n \"\"\"\n def __init__(self):\n ...
[ { "content": "<|memory_start|>```python\nimport sim, sim_items, main\nfrom util import *\nimport random\n\nclass ReinforcedPrefix(sim_items.Prefix):\n \"\"\"\n \"reinforced\" prefix boosts armor by increasing its PV or EV (whichever would\n normally be greater) by 1-3 points. \n \"\"\"\n def __in...
```python import sim, sim_items, main from util import * import random class ReinforcedPrefix(sim_items.Prefix): """ "reinforced" prefix boosts armor by increasing its PV or EV (whichever would normally be greater) by 1-3 points. """ def __init__(self): super(ReinforcedPrefix, self).__init...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# Copyright 2021 Nisaba Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# Copyright 2021 Nisaba Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n...
```python # Copyright 2021 Nisaba Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
[ { "content": "Here is some code:\n```python\n#!/usr/bin/env python2\nimport threading\nimport time\n# HTTP-related\nimport SimpleHTTPServer\nimport SocketServer\nimport os\n# websocket-related\nfrom gevent import monkey; monkey.patch_all()\nfrom ws4py.server.geventserver import WebSocketServer\nfrom ws4py.webso...
[ { "content": "Here is some code:\n<|memory_start|>```python\n#!/usr/bin/env python2\nimport threading\nimport time\n# HTTP-related\nimport SimpleHTTPServer\nimport SocketServer\nimport os\n# websocket-related\nfrom gevent import monkey; monkey.patch_all()\nfrom ws4py.server.geventserver import WebSocketServer\n...
```python #!/usr/bin/env python2 import threading import time # HTTP-related import SimpleHTTPServer import SocketServer import os # websocket-related from gevent import monkey; monkey.patch_all() from ws4py.server.geventserver import WebSocketServer from ws4py.websocket import WebSocket import random class HTTPThread...
[ { "content": "```python\nfrom __future__ import with_statement\nfrom cms.api import create_page\nfrom cms.toolbar.toolbar import CMSToolbar\nfrom cms.middleware.toolbar import ToolbarMiddleware\nfrom cms.test_utils.testcases import SettingsOverrideTestCase\nfrom cms.test_utils.util.context_managers import Setti...
[ { "content": "<|memory_start|>```python\nfrom __future__ import with_statement\nfrom cms.api import create_page\nfrom cms.toolbar.toolbar import CMSToolbar\nfrom cms.middleware.toolbar import ToolbarMiddleware\nfrom cms.test_utils.testcases import SettingsOverrideTestCase\nfrom cms.test_utils.util.context_manag...
```python from __future__ import with_statement from cms.api import create_page from cms.toolbar.toolbar import CMSToolbar from cms.middleware.toolbar import ToolbarMiddleware from cms.test_utils.testcases import SettingsOverrideTestCase from cms.test_utils.util.context_managers import SettingsOverride from django.con...
[ { "content": "Here is a code snippet:\n```python\nimport time\nfrom struct import pack\nfrom typing import Optional\n\nfrom electrum import ecc\nfrom electrum.i18n import _\nfrom electrum.util import UserCancelled\nfrom electrum.keystore import bip39_normalize_passphrase\nfrom electrum.bip32 import BIP32Node, c...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\nimport time\nfrom struct import pack\nfrom typing import Optional\n\nfrom electrum import ecc\nfrom electrum.i18n import _\nfrom electrum.util import UserCancelled\nfrom electrum.keystore import bip39_normalize_passphrase\nfrom electrum.bip32 imp...
```python import time from struct import pack from typing import Optional from electrum import ecc from electrum.i18n import _ from electrum.util import UserCancelled from electrum.keystore import bip39_normalize_passphrase from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 from electrum.loggin...
[ { "content": "```python\n# (c) 2014, Chris Church <chris@ninemoreminutes.com>\n# Copyright (c) 2017 Ansible Project\n# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)\n\nfrom __future__ import (absolute_import, division, print_function)\n__metaclass__ = type\n\nDOCUMEN...
[ { "content": "<|memory_start|>```python\n# (c) 2014, Chris Church <chris@ninemoreminutes.com>\n# Copyright (c) 2017 Ansible Project\n# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)\n\nfrom __future__ import (absolute_import, division, print_function)\n__metaclass__ =...
```python # (c) 2014, Chris Church <chris@ninemoreminutes.com> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ author: Ansib...
[ { "content": "Reconstruct the code exactly:\n```python\n# -*- coding: UTF-8 -*-\n#\n# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.\n#\n# Authors: Hervé Cauwelier <herve@itaapy.com>\n# Luis Belmar-Letelier <luis@itaapy.com>\n# David Versmisse <david.versmisse@itaapy.com>\n#\n# This f...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n# -*- coding: UTF-8 -*-\n#\n# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.\n#\n# Authors: Hervé Cauwelier <herve@itaapy.com>\n# Luis Belmar-Letelier <luis@itaapy.com>\n# David Versmisse <david.versmisse@itaapy.c...
```python # -*- coding: UTF-8 -*- # # Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend. # # Authors: Hervé Cauwelier <herve@itaapy.com> # Luis Belmar-Letelier <luis@itaapy.com> # David Versmisse <david.versmisse@itaapy.com> # # This file is part of Lpod (see: http://lpod-project.org). # Lpod is ...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n# Bulletproof Arma Launcher\n# Copyright (C) 2017 Lukasz Taczuk\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 version 3 as\n# published by the Free Software...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n# Bulletproof Arma Launcher\n# Copyright (C) 2017 Lukasz Taczuk\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 version 3 as\n# published by t...
```python # Bulletproof Arma Launcher # Copyright (C) 2017 Lukasz Taczuk # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be u...
[ { "content": "```python\nimport gzip\nimport pytest\n\nimport spindrift.http as http\nimport spindrift.network as network\n\n\nPORT = 12345\n\n\nclass Context(object):\n\n def __init__(self):\n self.server = 0\n self.client = 0\n\n\nclass Server(http.HTTPHandler):\n\n def on_http_data(self):...
[ { "content": "<|memory_start|>```python\nimport gzip\nimport pytest\n\nimport spindrift.http as http\nimport spindrift.network as network\n\n\nPORT = 12345\n\n\nclass Context(object):\n\n def __init__(self):\n self.server = 0\n self.client = 0\n\n\nclass Server(http.HTTPHandler):\n\n def on_...
```python import gzip import pytest import spindrift.http as http import spindrift.network as network PORT = 12345 class Context(object): def __init__(self): self.server = 0 self.client = 0 class Server(http.HTTPHandler): def on_http_data(self): self.context.server += 1 ...
[ { "content": "Here is the source code:\n```python\n\"\"\"\nOperations on wrappers\n\"\"\"\n\nimport array\nimport __builtin__\nimport ctypes\nimport collections\nimport functools\nfrom ROOT import THStack, TGraphAsymmErrors\n\nimport history\nimport wrappers\n\n\nclass OperationError(Exception): pass\nclass Too...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n\"\"\"\nOperations on wrappers\n\"\"\"\n\nimport array\nimport __builtin__\nimport ctypes\nimport collections\nimport functools\nfrom ROOT import THStack, TGraphAsymmErrors\n\nimport history\nimport wrappers\n\n\nclass OperationError(Exception):...
```python """ Operations on wrappers """ import array import __builtin__ import ctypes import collections import functools from ROOT import THStack, TGraphAsymmErrors import history import wrappers class OperationError(Exception): pass class TooFewWrpsError(OperationError): pass class TooManyWrpsError(OperationErro...
[ { "content": "Here is a code file:\n```python\n# coding=utf-8\n# Copyright 2020 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apac...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# coding=utf-8\n# Copyright 2020 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ...
```python # coding=utf-8 # Copyright 2020 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ { "content": "Repeat the code precisely:\n```python\nimport os\nimport logging\n\nfrom droptopus import config, settings\n\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import (\n QDialog,\n QDialogButtonBox,\n QFileDialog,\n QFormLayout,\n QHBoxLayout,\n QLabel,\n QLineEdit,\n QMes...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\nimport os\nimport logging\n\nfrom droptopus import config, settings\n\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import (\n QDialog,\n QDialogButtonBox,\n QFileDialog,\n QFormLayout,\n QHBoxLayout,\n QLabel,\n QLin...
```python import os import logging from droptopus import config, settings from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( QDialog, QDialogButtonBox, QFileDialog, QFormLayout, QHBoxLayout, QLabel, QLineEdit, QMessageBox, QPushButton, ) from PyQt5.QtGui import QPixmap cla...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\nimport argparse\nfrom fractions import Fraction\nimport math\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport re\nimport time\n\nimport parse_ctcp_output\nimport parse_tcptrace\nimport anal...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\nimport argparse\nfrom fractions import Fraction\nimport math\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport re\nimport time\n\nimport parse_ctcp_output\nimport parse_tcptr...
```python import argparse from fractions import Fraction import math import matplotlib.pyplot as plt import numpy as np import os import re import time import parse_ctcp_output import parse_tcptrace import analyse_data # Format:- # key: cc_type eg. 10x, 1000x, cubic, cubicsfqCodel etc. # value: dictionary: key - (va...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\npeforth\n\n[x] 13:59 2017-07-31 找到 JavaScript eval() equivalent in Python\n https://stackoverflow.com/questions/701802/how-do-i-execute-a-string-containing-python-code-in-python\n 成功了!!\n >>> mycode = 'print (\"hello world...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\npeforth\n\n[x] 13:59 2017-07-31 找到 JavaScript eval() equivalent in Python\n https://stackoverflow.com/questions/701802/how-do-i-execute-a-string-containing-python-code-in-python\n 成功了!!\n >>> mycode = 'prin...
```python peforth [x] 13:59 2017-07-31 找到 JavaScript eval() equivalent in Python https://stackoverflow.com/questions/701802/how-do-i-execute-a-string-containing-python-code-in-python 成功了!! >>> mycode = 'print ("hello world")' >>> exec(mycode) hello world >>> The technique of returning a fu...
[ { "content": "```python\nfrom builtins import object\nimport numpy as np\n\nfrom cs231n.layers import *\nfrom cs231n.fast_layers import *\nfrom cs231n.layer_utils import *\n\n\nclass ThreeLayerConvNet(object):\n \"\"\"\n A three-layer convolutional network with the following architecture:\n\n conv - re...
[ { "content": "<|memory_start|>```python\nfrom builtins import object\nimport numpy as np\n\nfrom cs231n.layers import *\nfrom cs231n.fast_layers import *\nfrom cs231n.layer_utils import *\n\n\nclass ThreeLayerConvNet(object):\n \"\"\"\n A three-layer convolutional network with the following architecture:\...
```python from builtins import object import numpy as np from cs231n.layers import * from cs231n.fast_layers import * from cs231n.layer_utils import * class ThreeLayerConvNet(object): """ A three-layer convolutional network with the following architecture: conv - relu - 2x2 max pool - affine - relu - af...
[ { "content": "Repeat the following code:\n```python\n#!/usr/bin/env python\n\"\"\"\nExtract grammatical error edits from CoNLL dataset SGML files into kilogram format.\nNot using XML or SGML parse since the file is not XML/SGML-compliant.\nwget http://www.comp.nus.edu.sg/~nlp/conll13st/release2.3.1.tar.gz\n\"\"...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\"\"\"\nExtract grammatical error edits from CoNLL dataset SGML files into kilogram format.\nNot using XML or SGML parse since the file is not XML/SGML-compliant.\nwget http://www.comp.nus.edu.sg/~nlp/conll13st/release2....
```python #!/usr/bin/env python """ Extract grammatical error edits from CoNLL dataset SGML files into kilogram format. Not using XML or SGML parse since the file is not XML/SGML-compliant. wget http://www.comp.nus.edu.sg/~nlp/conll13st/release2.3.1.tar.gz """ import re import argparse import unicodecsv as csv SPACE ...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n# Copyright (C) 2015 Red Hat, Inc.\n#\n# This copyrighted material is made available to anyone wishing to use,\n# modify, copy, or redistribute it subject to the terms and conditions of\n# the GNU General Public License v.2, or (at your option) any later versio...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Copyright (C) 2015 Red Hat, Inc.\n#\n# This copyrighted material is made available to anyone wishing to use,\n# modify, copy, or redistribute it subject to the terms and conditions of\n# the GNU General Public License v.2, or (at your option) ...
```python # -*- coding: utf-8 -*- # Copyright (C) 2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distrib...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\nimport pytest\n\nfrom desmod.timescale import parse_time, scale_time\n\n\n@pytest.mark.parametrize('test_input, expected', [\n ('12 s', (12, 's')),\n ('12s', (12, 's')),\n ('+12s', (12, 's')),\n ('-12...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\nimport pytest\n\nfrom desmod.timescale import parse_time, scale_time\n\n\n@pytest.mark.parametrize('test_input, expected', [\n ('12 s', (12, 's')),\n ('12s', (12, 's')),\n ('+12s', (12, '...
```python import pytest from desmod.timescale import parse_time, scale_time @pytest.mark.parametrize('test_input, expected', [ ('12 s', (12, 's')), ('12s', (12, 's')), ('+12s', (12, 's')), ('-12s', (-12, 's')), ('12.0 s', (12.0, 's')), ('12. s', (12.0, 's')), ('+12.0 s', (12.0, 's')), ...
[ { "content": "Produce an exact reconstruction of the code:\n```python\nimport os\nfrom pathlib import Path\nimport unittest\n\nimport ray\nimport ray.rllib.agents.marwil as marwil\nfrom ray.rllib.utils.framework import try_import_tf\nfrom ray.rllib.utils.test_utils import check_compute_single_action, \\\n fr...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\nimport os\nfrom pathlib import Path\nimport unittest\n\nimport ray\nimport ray.rllib.agents.marwil as marwil\nfrom ray.rllib.utils.framework import try_import_tf\nfrom ray.rllib.utils.test_utils import check_compute_single_ac...
```python import os from pathlib import Path import unittest import ray import ray.rllib.agents.marwil as marwil from ray.rllib.utils.framework import try_import_tf from ray.rllib.utils.test_utils import check_compute_single_action, \ framework_iterator tf1, tf, tfv = try_import_tf() class TestMARWIL(unittest.T...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n#\n# Copyright (c) rPath, Inc.\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 Software without restriction, incl...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n#\n# Copyright (c) rPath, Inc.\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 Software without r...
```python # # Copyright (c) rPath, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, ...
[ { "content": "```python\nfrom django.db import models\nfrom django.conf import settings\nimport bills.models as bill_models\n\nclass GovInfoScraper(models.Model):\n bill_name = models.CharField(max_length=100)\n bill_code = models.CharField(max_length=10)\n comment_startdate = models.DateField()\n c...
[ { "content": "<|memory_start|>```python\nfrom django.db import models\nfrom django.conf import settings\nimport bills.models as bill_models\n\nclass GovInfoScraper(models.Model):\n bill_name = models.CharField(max_length=100)\n bill_code = models.CharField(max_length=10)\n comment_startdate = models.Da...
```python from django.db import models from django.conf import settings import bills.models as bill_models class GovInfoScraper(models.Model): bill_name = models.CharField(max_length=100) bill_code = models.CharField(max_length=10) comment_startdate = models.DateField() comment_enddate = models.DateFie...
[ { "content": "Here is the script:\n```python\n\"\"\"Testing facility for conkit.io.FastaIO\"\"\"\n\n__author__ = \"Felix Simkovic\"\n__date__ = \"09 Sep 2016\"\n\nimport os\nimport unittest\n\nfrom conkit.io.clustal import ClustalParser\nfrom conkit.io._iotools import create_tmp_f\n\n\nclass TestClustalParser(u...
[ { "content": "Here is the script:\n<|memory_start|>```python\n\"\"\"Testing facility for conkit.io.FastaIO\"\"\"\n\n__author__ = \"Felix Simkovic\"\n__date__ = \"09 Sep 2016\"\n\nimport os\nimport unittest\n\nfrom conkit.io.clustal import ClustalParser\nfrom conkit.io._iotools import create_tmp_f\n\n\nclass Tes...
```python """Testing facility for conkit.io.FastaIO""" __author__ = "Felix Simkovic" __date__ = "09 Sep 2016" import os import unittest from conkit.io.clustal import ClustalParser from conkit.io._iotools import create_tmp_f class TestClustalParser(unittest.TestCase): def test_read_1(self): seq = """CLU...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n'''\nCopyright (C) 2011 Mihnea Dobrescu-Balaur\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n'''\nCopyright (C) 2011 Mihnea Dobrescu-Balaur\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; eith...
```python ''' Copyright (C) 2011 Mihnea Dobrescu-Balaur This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distr...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n# Copyright 2020 The Oppia Authors. 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...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# Copyright 2020 The Oppia Authors. 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 obta...
```python # Copyright 2020 The Oppia Authors. 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 required by a...
[ { "content": "```python\n#!/usr/bin/env python3\n# grouping algorithms for images and videos\n# PixPack Photo Organiser\n\nimport re\nimport os\n\ndef group_by_dates(date_meta, destination, pattern='ym'):\n # generate folder name by using basic date informations\n # available patterns: yr=2017, ym=2017-03...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python3\n# grouping algorithms for images and videos\n# PixPack Photo Organiser\n\nimport re\nimport os\n\ndef group_by_dates(date_meta, destination, pattern='ym'):\n # generate folder name by using basic date informations\n # available patterns: yr=...
```python #!/usr/bin/env python3 # grouping algorithms for images and videos # PixPack Photo Organiser import re import os def group_by_dates(date_meta, destination, pattern='ym'): # generate folder name by using basic date informations # available patterns: yr=2017, ym=2017-03, ss=summer # exif date form...
[ { "content": "Here is the source code:\n```python\nimport pymongo\n\nfrom barin import schema as S\nfrom barin import event\n\n\n# TODO: test backref logic\n\n\nclass InstanceManager(object):\n\n def __init__(self, manager, instance):\n self._manager = manager\n self.instance = instance\n\n ...
[ { "content": "Here is the source code:\n<|memory_start|>```python\nimport pymongo\n\nfrom barin import schema as S\nfrom barin import event\n\n\n# TODO: test backref logic\n\n\nclass InstanceManager(object):\n\n def __init__(self, manager, instance):\n self._manager = manager\n self.instance = ...
```python import pymongo from barin import schema as S from barin import event # TODO: test backref logic class InstanceManager(object): def __init__(self, manager, instance): self._manager = manager self.instance = instance def __getattr__(self, name): return getattr(self._manage...
[ { "content": "```python\n# -*- coding: utf-8 -*-\nimport leancloud\nfrom leancloud import Object\nfrom leancloud import LeanCloudError\nfrom leancloud import Query\nfrom leancloud import User\n\n\nfrom wsgi import signer\n\n\n\nnot_binary_label_dict = {'field':['field__manufacture', 'field__financial', 'field__...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport leancloud\nfrom leancloud import Object\nfrom leancloud import LeanCloudError\nfrom leancloud import Query\nfrom leancloud import User\n\n\nfrom wsgi import signer\n\n\n\nnot_binary_label_dict = {'field':['field__manufacture', 'field__fina...
```python # -*- coding: utf-8 -*- import leancloud from leancloud import Object from leancloud import LeanCloudError from leancloud import Query from leancloud import User from wsgi import signer not_binary_label_dict = {'field':['field__manufacture', 'field__financial', 'field__infotech', 'field__law', 'field__ag...
[ { "content": "Provide a verbatim copy of the code:\n```python\n# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, di...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file...
```python # ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # ----------------------------------...
[ { "content": "Here is a code snippet:\n```python\n#!/usr/bin/python\r\n\r\n\"\"\"\r\nBenjamin Carr\r\nHomework #2 - MPCS 55001\r\nAnswers:\r\n(1) Program below.\r\n(2) My program is correct for all cases where both the numbers and the distances from the median\r\n are unique. I spent a lot of time (30+ hrs) ...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n#!/usr/bin/python\r\n\r\n\"\"\"\r\nBenjamin Carr\r\nHomework #2 - MPCS 55001\r\nAnswers:\r\n(1) Program below.\r\n(2) My program is correct for all cases where both the numbers and the distances from the median\r\n are unique. I spent a lot of...
```python #!/usr/bin/python """ Benjamin Carr Homework #2 - MPCS 55001 Answers: (1) Program below. (2) My program is correct for all cases where both the numbers and the distances from the median are unique. I spent a lot of time (30+ hrs) trying to figure out other ways of doing this other than using a ...
[ { "content": "Repeat the code precisely:\n```python\n# -*- coding: utf-8 -*-\n\n# Automatic provisioning of AWS S3 buckets.\n\nimport time\nimport botocore\nimport boto3\nimport nixops.util\nimport nixops.resources\nimport nixops.ec2_utils\n\n\nclass S3BucketDefinition(nixops.resources.ResourceDefinition):\n ...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n# Automatic provisioning of AWS S3 buckets.\n\nimport time\nimport botocore\nimport boto3\nimport nixops.util\nimport nixops.resources\nimport nixops.ec2_utils\n\n\nclass S3BucketDefinition(nixops.resources.ResourceD...
```python # -*- coding: utf-8 -*- # Automatic provisioning of AWS S3 buckets. import time import botocore import boto3 import nixops.util import nixops.resources import nixops.ec2_utils class S3BucketDefinition(nixops.resources.ResourceDefinition): """Definition of an S3 bucket.""" @classmethod def get...
[ { "content": "Write the code verbatim:\n```python\n#!/usr/bin/python\nimport sys\nfrom klampt import *\nfrom klampt import vis\nfrom klampt.vis.glrobotprogram import GLSimulationPlugin\nimport robotiq \n\n\nclass MyGLViewer(GLSimulationPlugin):\n def __init__(self,world):\n GLSimulationPlugin.__init__...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n#!/usr/bin/python\nimport sys\nfrom klampt import *\nfrom klampt import vis\nfrom klampt.vis.glrobotprogram import GLSimulationPlugin\nimport robotiq \n\n\nclass MyGLViewer(GLSimulationPlugin):\n def __init__(self,world):\n GLSimulatio...
```python #!/usr/bin/python import sys from klampt import * from klampt import vis from klampt.vis.glrobotprogram import GLSimulationPlugin import robotiq class MyGLViewer(GLSimulationPlugin): def __init__(self,world): GLSimulationPlugin.__init__(self,world) #Put any controller modules or sensor ...
[ { "content": "Here is the code content:\n```python\n#!python\n\"\"\"Bootstrap setuptools installation\n\nIf you want to use setuptools in your package's setup.py, just include this\nfile in the same directory with it, and add this to the top of your setup.py::\n\n from ez_setup import use_setuptools\n use...
[ { "content": "Here is the code content:\n<|memory_start|>```python\n#!python\n\"\"\"Bootstrap setuptools installation\n\nIf you want to use setuptools in your package's setup.py, just include this\nfile in the same directory with it, and add this to the top of your setup.py::\n\n from ez_setup import use_set...
```python #!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of ...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n#!/usr/bin/env python\n\"\"\"\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements. See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n#!/usr/bin/env python\n\"\"\"\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements. See the NOTICE file\ndistributed with this work for additional information\nrega...
```python #!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\nimport setuptools\n\nwith open('VERSION.txt', 'r') as f:\n version = f.read().strip()\n\nsetuptools.setup(\n name=\"odoo12-addons-oca-purchase-workflow\",\n description=\"Meta package for oca-purchase-workflow...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\nimport setuptools\n\nwith open('VERSION.txt', 'r') as f:\n version = f.read().strip()\n\nsetuptools.setup(\n name=\"odoo12-addons-oca-purchase-workflow\",\n description=\"Meta package for oca-p...
```python import setuptools with open('VERSION.txt', 'r') as f: version = f.read().strip() setuptools.setup( name="odoo12-addons-oca-purchase-workflow", description="Meta package for oca-purchase-workflow Odoo addons", version=version, install_requires=[ 'odoo12-addon-procurement_purchase_...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\nimport os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()\n\n# allow setup.py to be run from any path\nos.chdir(os.path.normpath(os.path.join(os.path.abspath(__f...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\nimport os\nfrom setuptools import setup\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()\n\n# allow setup.py to be run from any path\nos.chdir(os.path.normpath(os.path.join(os....
```python import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-rahit-user', version='0.0.1', descriptio...
[ { "content": "```python\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 published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distrib...
[ { "content": "<|memory_start|>```python\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 published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This pr...
```python # 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 is distributed in the hope that it wil...
[ { "content": "Return the code unaltered:\n```python\n# -*- coding: utf-8 -*-\n#\n# (c) Copyright 2003-2009 Hewlett-Packard Development Company, L.P.\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 Soft...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# (c) Copyright 2003-2009 Hewlett-Packard Development Company, L.P.\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\...
```python # -*- coding: utf-8 -*- # # (c) Copyright 2003-2009 Hewlett-Packard Development Company, L.P. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (a...
[ { "content": "```python\n#!/usr/bin/env python3\n\nimport sys\nprint(\"QPID support NOT enabled! Will NOT connect to any broker, and messages will be lost!\")\n\n\n\"\"\"\n Exceptions.\n\"\"\"\n\nclass ProtonException(Exception):\n pass\n\nclass SessionError(Exception):\n pass\n\nclass Timeout(Exception):\n ...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python3\n\nimport sys\nprint(\"QPID support NOT enabled! Will NOT connect to any broker, and messages will be lost!\")\n\n\n\"\"\"\n Exceptions.\n\"\"\"\n\nclass ProtonException(Exception):\n pass\n\nclass SessionError(Exception):\n pass\n\nclass Timeou...
```python #!/usr/bin/env python3 import sys print("QPID support NOT enabled! Will NOT connect to any broker, and messages will be lost!") """ Exceptions. """ class ProtonException(Exception): pass class SessionError(Exception): pass class Timeout(Exception): pass """ Messages. """ class Message(objec...
[ { "content": "Provide a verbatim copy of the code:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright 2016 University of Oslo, Norway\n#\n# This file is part of Cerebrum.\n#\n# Cerebrum is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public L...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright 2016 University of Oslo, Norway\n#\n# This file is part of Cerebrum.\n#\n# Cerebrum is free software; you can redistribute it and/or modify it\n# under the terms of the GNU ...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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 versio...
[ { "content": "Here is the source code:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.conf import settings\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('auth', '__first__')]\n\n ope...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nfrom django.conf import settings\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('auth', '__first...
```python # -*- coding: utf-8 -*- from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('auth', '__first__')] operations = [ migrations.CreateModel( nam...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n#!/usr/bin/env python\n#\n# Navigator.py\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 version 2 as\n# published by the Free Software...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n#!/usr/bin/env python\n#\n# Navigator.py\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 version 2 as\n# published by t...
```python #!/usr/bin/env python # # Navigator.py # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY...
[ { "content": "Return the code exactly, with no changes:\n```python\nfrom Server.Game import *\nfrom threading import Thread\nfrom CodIa.tuto.models import User\nfrom CodIa.tuto.app import db\nimport threading\nimport time\nimport random\n\nclass PlayerThread(Thread):\n\n def __init__(self, GameThread, userna...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\nfrom Server.Game import *\nfrom threading import Thread\nfrom CodIa.tuto.models import User\nfrom CodIa.tuto.app import db\nimport threading\nimport time\nimport random\n\nclass PlayerThread(Thread):\n\n def __init__(self, Ga...
```python from Server.Game import * from threading import Thread from CodIa.tuto.models import User from CodIa.tuto.app import db import threading import time import random class PlayerThread(Thread): def __init__(self, GameThread, username, ia): Thread.__init__(self) self.GameThread = GameThread ...
[ { "content": "Here is the code content:\n```python\n\"\"\"\nPyStratum\n\"\"\"\nimport configparser\nfrom pydoc import locate\n\nfrom cleo import Command, Input, Output\nfrom pystratum.RoutineLoader import RoutineLoader\n\nfrom pystratum.style.PyStratumStyle import PyStratumStyle\n\n\nclass LoaderCommand(Command...
[ { "content": "Here is the code content:\n<|memory_start|>```python\n\"\"\"\nPyStratum\n\"\"\"\nimport configparser\nfrom pydoc import locate\n\nfrom cleo import Command, Input, Output\nfrom pystratum.RoutineLoader import RoutineLoader\n\nfrom pystratum.style.PyStratumStyle import PyStratumStyle\n\n\nclass Loade...
```python """ PyStratum """ import configparser from pydoc import locate from cleo import Command, Input, Output from pystratum.RoutineLoader import RoutineLoader from pystratum.style.PyStratumStyle import PyStratumStyle class LoaderCommand(Command): """ Command for loading stored routines into a MySQL/MsSQ...
[ { "content": "Repeat the code precisely:\n```python\n#!/usr/bin/env python\n\nimport json, argparse\n\nparser = argparse.ArgumentParser()\nparser.description = '''Generate an RST list documenting PISM's diagnostics.'''\nparser.add_argument(\"FILE\", nargs=1)\noptions = parser.parse_args()\n\ndef print_heading(t...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nimport json, argparse\n\nparser = argparse.ArgumentParser()\nparser.description = '''Generate an RST list documenting PISM's diagnostics.'''\nparser.add_argument(\"FILE\", nargs=1)\noptions = parser.parse_args()\n\ndef...
```python #!/usr/bin/env python import json, argparse parser = argparse.ArgumentParser() parser.description = '''Generate an RST list documenting PISM's diagnostics.''' parser.add_argument("FILE", nargs=1) options = parser.parse_args() def print_heading(title, label, decoration): heading = """ .. _{label}: {tit...
[ { "content": "Return the code exactly, with no changes:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2012-2018, CRS4\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2012-2018, CRS4\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in...
```python # -*- coding: utf-8 -*- # # Copyright (c) 2012-2018, CRS4 # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, co...
[ { "content": "Here is the code content:\n```python\n# Copyright (c) 2017 Ansible Tower by Red Hat\n# All Rights Reserved.\nimport sys\nimport six\n\nfrom awx.main.utils.pglock import advisory_lock\nfrom awx.main.models import Instance, InstanceGroup\n\nfrom django.core.management.base import BaseCommand, Comman...
[ { "content": "Here is the code content:\n<|memory_start|>```python\n# Copyright (c) 2017 Ansible Tower by Red Hat\n# All Rights Reserved.\nimport sys\nimport six\n\nfrom awx.main.utils.pglock import advisory_lock\nfrom awx.main.models import Instance, InstanceGroup\n\nfrom django.core.management.base import Bas...
```python # Copyright (c) 2017 Ansible Tower by Red Hat # All Rights Reserved. import sys import six from awx.main.utils.pglock import advisory_lock from awx.main.models import Instance, InstanceGroup from django.core.management.base import BaseCommand, CommandError class InstanceNotFound(Exception): def __init...
[ { "content": "```python\n\"\"\"\n@author: Michael Guarino\n\"\"\"\n\nimport numpy as np\n\nnp.set_printoptions(threshold=np.nan)\nimport tensorflow as tf\nfrom tensorflow.contrib import rnn\nimport tensorflow.contrib.layers as layers\n\nclass HAN:\n def __init__(self, max_seq_len, max_sent_len, num_classes,\n ...
[ { "content": "<|memory_start|>```python\n\"\"\"\n@author: Michael Guarino\n\"\"\"\n\nimport numpy as np\n\nnp.set_printoptions(threshold=np.nan)\nimport tensorflow as tf\nfrom tensorflow.contrib import rnn\nimport tensorflow.contrib.layers as layers\n\nclass HAN:\n def __init__(self, max_seq_len, max_sent_len,...
```python """ @author: Michael Guarino """ import numpy as np np.set_printoptions(threshold=np.nan) import tensorflow as tf from tensorflow.contrib import rnn import tensorflow.contrib.layers as layers class HAN: def __init__(self, max_seq_len, max_sent_len, num_classes, vocab_size, embedding_size, ...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n##########\n# pattern_impl.py\n##########\nfrom installmethod import installmethod # the installmethod from recipe: 223613\n\nclass ObserverPattern:\n \"\"\"\n A reusable implementation of the Observer pattern.\n ...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n##########\n# pattern_impl.py\n##########\nfrom installmethod import installmethod # the installmethod from recipe: 223613\n\nclass ObserverPattern:\n \"\"\"\n A reusable implementation of the Observe...
```python ########## # pattern_impl.py ########## from installmethod import installmethod # the installmethod from recipe: 223613 class ObserverPattern: """ A reusable implementation of the Observer pattern. """ theSubject = None observers = {} class Subject: def __init__(self): ...
[ { "content": "Repeat the code precisely:\n```python\n\"\"\"\nThe :mod:`sklearn.model_selection._split` module includes classes and\nfunctions to split the data based on a preset strategy.\n\"\"\"\n\n# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,\n# Gael Varoquaux <gael.varoquaux@normalesup....
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n\"\"\"\nThe :mod:`sklearn.model_selection._split` module includes classes and\nfunctions to split the data based on a preset strategy.\n\"\"\"\n\n# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,\n# Gael Varoquaux <gael.varoq...
```python """ The :mod:`sklearn.model_selection._split` module includes classes and functions to split the data based on a preset strategy. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Girsel <olivier.grisel@ensta.org> # ...
[ { "content": "Recreate the original code text:\n```python\n#!/usr/bin/env python\n\n\nimport sys\nimport os\nimport traceback\nimport time\nimport gc\nimport hashlib\n\n#gc.disable()\n\nsys.path.insert(0, '../../PyPDF2/')\n\nimport PyPDF2\nimport find_pdfrw\nimport pdfrw\n\nfrom PyPDF2 import PdfFileReader, Pdf...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n\nimport sys\nimport os\nimport traceback\nimport time\nimport gc\nimport hashlib\n\n#gc.disable()\n\nsys.path.insert(0, '../../PyPDF2/')\n\nimport PyPDF2\nimport find_pdfrw\nimport pdfrw\n\nfrom PyPDF2 import Pd...
```python #!/usr/bin/env python import sys import os import traceback import time import gc import hashlib #gc.disable() sys.path.insert(0, '../../PyPDF2/') import PyPDF2 import find_pdfrw import pdfrw from PyPDF2 import PdfFileReader, PdfFileWriter import find_pdfrw from pdfrw import PdfReader, PdfWriter, PdfPa...
[ { "content": "Provide a verbatim copy of the code:\n```python\n# encoding: utf-8\nfrom collections import Counter\nimport re\nimport os.path\n\n#from https://mathiasbynens.be/demo/url-regex diego's one\nVALID_URL= re.compile(r\"^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n# encoding: utf-8\nfrom collections import Counter\nimport re\nimport os.path\n\n#from https://mathiasbynens.be/demo/url-regex diego's one\nVALID_URL= re.compile(r\"^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}...
```python # encoding: utf-8 from collections import Counter import re import os.path #from https://mathiasbynens.be/demo/url-regex diego's one VALID_URL= re.compile(r"^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172...
[ { "content": "Repeat the full code snippet:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nScrapy settings for tegenaria project.\n\nFor simplicity, this file contains only settings considered important or\ncommonly used. You can find more settings consulting the documentation:\n\nhttp://doc.scrapy.org/en/latest/...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nScrapy settings for tegenaria project.\n\nFor simplicity, this file contains only settings considered important or\ncommonly used. You can find more settings consulting the documentation:\n\nhttp://doc.scrap...
```python # -*- coding: utf-8 -*- """ Scrapy settings for tegenaria project. For simplicity, this file contains only settings considered important or commonly used. You can find more settings consulting the documentation: http://doc.scrapy.org/en/latest/topics/settings.html http://scrapy.readthedocs.org/en/latest/top...
[ { "content": "```python\n#!/usr/bin/env python\n\n\"\"\"\n parallel_tree.py - Version 1.0 2013-09-22\n \n Run two tasks in parallel using the pi_trees library.\n \n Created for the Pi Robot Project: http://www.pirobot.org\n Copyright (c) 2014 Patrick Goebel. All rights reserved.\n\n This p...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n\n\"\"\"\n parallel_tree.py - Version 1.0 2013-09-22\n \n Run two tasks in parallel using the pi_trees library.\n \n Created for the Pi Robot Project: http://www.pirobot.org\n Copyright (c) 2014 Patrick Goebel. All rights reserve...
```python #!/usr/bin/env python """ parallel_tree.py - Version 1.0 2013-09-22 Run two tasks in parallel using the pi_trees library. Created for the Pi Robot Project: http://www.pirobot.org Copyright (c) 2014 Patrick Goebel. All rights reserved. This program is free software; you can red...
[ { "content": "Provide an exact copy of the source code:\n```python\nimport pytest\n\n\ndef test_default():\n from vishnu.backend import Redis\n from vishnu.backend.config.redis import DEFAULT_HOST, DEFAULT_PORT, DEFAULT_DB\n\n config = Redis()\n assert config.host == DEFAULT_HOST\n assert config....
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nimport pytest\n\n\ndef test_default():\n from vishnu.backend import Redis\n from vishnu.backend.config.redis import DEFAULT_HOST, DEFAULT_PORT, DEFAULT_DB\n\n config = Redis()\n assert config.host == DEFAULT_HOST\n ...
```python import pytest def test_default(): from vishnu.backend import Redis from vishnu.backend.config.redis import DEFAULT_HOST, DEFAULT_PORT, DEFAULT_DB config = Redis() assert config.host == DEFAULT_HOST assert config.port == DEFAULT_PORT assert config.db == DEFAULT_DB def test_custom_h...
[ { "content": "Repeat the code precisely:\n```python\nfrom flask_sqlalchemy import SQLAlchemy\n\ndb = SQLAlchemy()\n\nathlete_teams = db.Table('athlete_teams',\n db.Column('athlete_id', db.Integer, db.ForeignKey('athletes.id')),\n db.Column('team_id', db.Integer, db.ForeignKey('teams.id'))\n)\n\n\nclass At...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\nfrom flask_sqlalchemy import SQLAlchemy\n\ndb = SQLAlchemy()\n\nathlete_teams = db.Table('athlete_teams',\n db.Column('athlete_id', db.Integer, db.ForeignKey('athletes.id')),\n db.Column('team_id', db.Integer, db.ForeignKey('teams.id'))\...
```python from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() athlete_teams = db.Table('athlete_teams', db.Column('athlete_id', db.Integer, db.ForeignKey('athletes.id')), db.Column('team_id', db.Integer, db.ForeignKey('teams.id')) ) class Athlete(db.Model): __tablename__ = 'athletes' id = ...
[ { "content": "Recreate the original code text:\n```python\nimport scrapy\n\nfrom ..items import Article, Comment\n\nclass GuardianSpider(scrapy.Spider):\n name = \"guardian\"\n allowed_domains = [\"theguardian.com\"]\n start_urls = [\n \"http://www.theguardian.com/world/2016/feb/09/draft-snooper...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\nimport scrapy\n\nfrom ..items import Article, Comment\n\nclass GuardianSpider(scrapy.Spider):\n name = \"guardian\"\n allowed_domains = [\"theguardian.com\"]\n start_urls = [\n \"http://www.theguardian.com/world/2016/feb/...
```python import scrapy from ..items import Article, Comment class GuardianSpider(scrapy.Spider): name = "guardian" allowed_domains = ["theguardian.com"] start_urls = [ "http://www.theguardian.com/world/2016/feb/09/draft-snoopers-charter-fails-on-spying-powers-and-privacy-protections" ] d...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n\nfrom kivy.uix.widget import Widget\nfrom kivy.clock import Clock\nfrom kivy.graphics import Color, Callback, Rotate, PushMatrix, PopMatrix, Translate, Quad\nfrom kivy.graphics.opengl import glBlendFunc, GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_SRC_COLOR, GL_ONE_MINUS...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nfrom kivy.uix.widget import Widget\nfrom kivy.clock import Clock\nfrom kivy.graphics import Color, Callback, Rotate, PushMatrix, PopMatrix, Translate, Quad\nfrom kivy.graphics.opengl import glBlendFunc, GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_SRC_COL...
```python # -*- coding: utf-8 -*- from kivy.uix.widget import Widget from kivy.clock import Clock from kivy.graphics import Color, Callback, Rotate, PushMatrix, PopMatrix, Translate, Quad from kivy.graphics.opengl import glBlendFunc, GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_ONE_MINUS_SRC...