prompt
listlengths
1
1
compression_prompt
listlengths
1
1
target
stringlengths
1.03k
828k
[ { "content": "Produce an exact reconstruction of the code:\n```python\n#!/usr/bin/env python\n\n# pylint: disable=broad-except\n\nimport re\nimport json\nimport time\n\nfrom reporting.utilities import getLogger, get_hostname\nfrom reporting.exceptions import InputDataError\n\nlog = getLogger(__name__)\n\nclass ...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n# pylint: disable=broad-except\n\nimport re\nimport json\nimport time\n\nfrom reporting.utilities import getLogger, get_hostname\nfrom reporting.exceptions import InputDataError\n\nlog = getLogger(__n...
```python #!/usr/bin/env python # pylint: disable=broad-except import re import json import time from reporting.utilities import getLogger, get_hostname from reporting.exceptions import InputDataError log = getLogger(__name__) class IParser(object): def parse(self): assert 0, "This method must be defin...
[ { "content": "Here is the script:\n```python\n#!/usr/bin/env python\n###############################################################################\n# $Id: elas.py 32163 2015-12-13 17:44:50Z goatbar $\n#\n# Project: GDAL/OGR Test Suite\n# Purpose: Test ELAS driver\n# Author: Even Rouault, <even dot rouault...
[ { "content": "Here is the script:\n<|memory_start|>```python\n#!/usr/bin/env python\n###############################################################################\n# $Id: elas.py 32163 2015-12-13 17:44:50Z goatbar $\n#\n# Project: GDAL/OGR Test Suite\n# Purpose: Test ELAS driver\n# Author: Even Rouault, <...
```python #!/usr/bin/env python ############################################################################### # $Id: elas.py 32163 2015-12-13 17:44:50Z goatbar $ # # Project: GDAL/OGR Test Suite # Purpose: Test ELAS driver # Author: Even Rouault, <even dot rouault at mines dash paris dot org> # ##################...
[ { "content": "```python\nimport email\r\nimport imaplib\r\nimport json\r\n\r\nfrom input.imap.connection import open_connection\r\n\r\nfrom input.imap.header import get_mail_header\r\nfrom util.read_utils import lines_per_n\r\n\r\n\r\ndef get_unavailable_uid():\r\n \"\"\"\r\n This function returns a list ...
[ { "content": "<|memory_start|>```python\nimport email\r\nimport imaplib\r\nimport json\r\n\r\nfrom input.imap.connection import open_connection\r\n\r\nfrom input.imap.header import get_mail_header\r\nfrom util.read_utils import lines_per_n\r\n\r\n\r\ndef get_unavailable_uid():\r\n \"\"\"\r\n This function...
```python import email import imaplib import json from input.imap.connection import open_connection from input.imap.header import get_mail_header from util.read_utils import lines_per_n def get_unavailable_uid(): """ This function returns a list of UIDs that are not available in the IMAP server ...
[ { "content": "```python\nfrom gobjcreator3.codegen.code_generator import CodeGenerator\nfrom gobjcreator3.codegen.output import StdOut\nfrom gobjcreator3.codegen.name_creator import NameCreator\nfrom gobjcreator3.codegen.c_marshaller_generator import CMarshallerGenerator, CMarshallerNameCreator\nfrom gobjcreato...
[ { "content": "<|memory_start|>```python\nfrom gobjcreator3.codegen.code_generator import CodeGenerator\nfrom gobjcreator3.codegen.output import StdOut\nfrom gobjcreator3.codegen.name_creator import NameCreator\nfrom gobjcreator3.codegen.c_marshaller_generator import CMarshallerGenerator, CMarshallerNameCreator\...
```python from gobjcreator3.codegen.code_generator import CodeGenerator from gobjcreator3.codegen.output import StdOut from gobjcreator3.codegen.name_creator import NameCreator from gobjcreator3.codegen.c_marshaller_generator import CMarshallerGenerator, CMarshallerNameCreator from gobjcreator3.model.type import Type f...
[ { "content": "```python\n# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:\n\n# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>\n#\n# This file is part of qutebrowser.\n#\n# qutebrowser is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Pub...
[ { "content": "<|memory_start|>```python\n# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:\n\n# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>\n#\n# This file is part of qutebrowser.\n#\n# qutebrowser is free software: you can redistribute it and/or modify\n# it under the terms of the...
```python # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # ...
[ { "content": "Here is the code block:\n```python\nfrom __future__ import print_function\nfrom icalendar import *\nfrom datetime import date, datetime, timedelta\nimport mysql.connector\nfrom mysql.connector import errorcode\nimport pickle\nimport csv\nimport pandas\nfrom pandas.io import sql\nimport matplotlib....
[ { "content": "Here is the code block:\n<|memory_start|>```python\nfrom __future__ import print_function\nfrom icalendar import *\nfrom datetime import date, datetime, timedelta\nimport mysql.connector\nfrom mysql.connector import errorcode\nimport pickle\nimport csv\nimport pandas\nfrom pandas.io import sql\nim...
```python from __future__ import print_function from icalendar import * from datetime import date, datetime, timedelta import mysql.connector from mysql.connector import errorcode import pickle import csv import pandas from pandas.io import sql import matplotlib.pyplot as plt import xlsxwriter import numpy as np import...
[ { "content": "```python\n# Copyright 2016 AT&T Corp\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses...
[ { "content": "<|memory_start|>```python\n# Copyright 2016 AT&T Corp\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apa...
```python # Copyright 2016 AT&T Corp # 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 requi...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nRegression tests for the Test Client, especially the customized assertions.\n\"\"\"\nimport os\nfrom django.conf import settings\n\nfrom django.test import Client, TestCase\nfrom django.test.utils impor...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nRegression tests for the Test Client, especially the customized assertions.\n\"\"\"\nimport os\nfrom django.conf import settings\n\nfrom django.test import Client, TestCase\nfrom django....
```python # -*- coding: utf-8 -*- """ Regression tests for the Test Client, especially the customized assertions. """ import os from django.conf import settings from django.test import Client, TestCase from django.test.utils import ContextList from django.core.urlresolvers import reverse from django.core.exceptions im...
[ { "content": "```python\n# This file is part of Py6S.\n#\n# Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file.\n#\n# Py6S is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License as published by\n# the Free Software Foundat...
[ { "content": "<|memory_start|>```python\n# This file is part of Py6S.\n#\n# Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file.\n#\n# Py6S is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License as published by\n# the Free ...
```python # This file is part of Py6S. # # Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file. # # Py6S is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the ...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n#\n# Copyright 2010-2011 Red Hat, Inc.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of th...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n#\n# Copyright 2010-2011 Red Hat, Inc.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either...
```python # # Copyright 2010-2011 Red Hat, Inc. # # 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 di...
[ { "content": "Repeat the code precisely:\n```python\n__author__ = 'dev'\n\nimport re\nfrom http.server import SimpleHTTPRequestHandler\n\nHEADERS_HOST_PARAMETER_KEY_NAME = \"Host\"\nREQUEST_LINE_ENCODING = \"iso-8859-1\"\nHOST_PATTERN_KEY_NAME = \"host_pattern\"\nRESPONSE_CONTENT_PATH_KEY_NAME = \"response_cont...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n__author__ = 'dev'\n\nimport re\nfrom http.server import SimpleHTTPRequestHandler\n\nHEADERS_HOST_PARAMETER_KEY_NAME = \"Host\"\nREQUEST_LINE_ENCODING = \"iso-8859-1\"\nHOST_PATTERN_KEY_NAME = \"host_pattern\"\nRESPONSE_CONTENT_PATH_KEY_NAME =...
```python __author__ = 'dev' import re from http.server import SimpleHTTPRequestHandler HEADERS_HOST_PARAMETER_KEY_NAME = "Host" REQUEST_LINE_ENCODING = "iso-8859-1" HOST_PATTERN_KEY_NAME = "host_pattern" RESPONSE_CONTENT_PATH_KEY_NAME = "response_content_path" class FakeHTTPRequestHandler(SimpleHTTPRequestHandler)...
[ { "content": "Here is a code file:\n```python\n# Author: Sari Sabban\n# Email: sari.sabban@gmail.com\n# URL: https://github.com/sarisabban\n#\n# Created By: \tSari Sabban\n# Created Date: \t20 March 2017\n\nimport urllib\n\ndef ProtVR(x):\n\tlis=list() \n\tfilename='HELLO C '\n\tfilename=urllib.urlopen('h...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# Author: Sari Sabban\n# Email: sari.sabban@gmail.com\n# URL: https://github.com/sarisabban\n#\n# Created By: \tSari Sabban\n# Created Date: \t20 March 2017\n\nimport urllib\n\ndef ProtVR(x):\n\tlis=list() \n\tfilename='HELLO C '\n\tfilename=u...
```python # Author: Sari Sabban # Email: sari.sabban@gmail.com # URL: https://github.com/sarisabban # # Created By: Sari Sabban # Created Date: 20 March 2017 import urllib def ProtVR(x): lis=list() filename='HELLO C ' filename=urllib.urlopen('http://files.rcsb.org/view/'+x+'.pdb') lis.append('<script src...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# Copyright 2016 Raytheon BBN Technologies\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# Copyright 2016 Raytheon BBN Technologies\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Li...
```python # Copyright 2016 Raytheon BBN Technologies # # 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 __all__ = ['DPO72004C','DPO2024','DPO20...
[ { "content": "Produce an exact reconstruction of the code:\n```python\nimport time,random,functools\nimport numpy as np\n\n\nfrom PyQt4 import QtCore, QtGui\nimport pyqtgraph as pg\nimport pyqtgraph.opengl as gl\n\n\nclass utilitiesClass():\n\t\"\"\"\n\tThis class contains methods that simplify setting up and r...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\nimport time,random,functools\nimport numpy as np\n\n\nfrom PyQt4 import QtCore, QtGui\nimport pyqtgraph as pg\nimport pyqtgraph.opengl as gl\n\n\nclass utilitiesClass():\n\t\"\"\"\n\tThis class contains methods that simplify ...
```python import time,random,functools import numpy as np from PyQt4 import QtCore, QtGui import pyqtgraph as pg import pyqtgraph.opengl as gl class utilitiesClass(): """ This class contains methods that simplify setting up and running an experiment. """ timers=[] viewBoxes=[] plots3D=[] plots2D=[] axisI...
[ { "content": "Here is the source code:\n```python\nimport requests\nimport pytest\nimport re\nfrom _pytest.runner import runtestprotocol\nfrom http.client import RemoteDisconnected\nfrom support.device_stats_db import DeviceStatsDB\nfrom support.test_rerun import should_rerun_test\nfrom tests import test_suite_...
[ { "content": "Here is the source code:\n<|memory_start|>```python\nimport requests\nimport pytest\nimport re\nfrom _pytest.runner import runtestprotocol\nfrom http.client import RemoteDisconnected\nfrom support.device_stats_db import DeviceStatsDB\nfrom support.test_rerun import should_rerun_test\nfrom tests im...
```python import requests import pytest import re from _pytest.runner import runtestprotocol from http.client import RemoteDisconnected from support.device_stats_db import DeviceStatsDB from support.test_rerun import should_rerun_test from tests import test_suite_data, appium_container from datetime import datetime fro...
[ { "content": "Here is the snippet:\n```python\n# Copyright (c) 2013 Johan Ceuppens.\n# All rights reserved.\n\n# Redistribution and use in source and binary forms are permitted\n# provided that the above copyright notice and this paragraph are\n# duplicated in all such forms and that any documentation,\n# adver...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n# Copyright (c) 2013 Johan Ceuppens.\n# All rights reserved.\n\n# Redistribution and use in source and binary forms are permitted\n# provided that the above copyright notice and this paragraph are\n# duplicated in all such forms and that any documen...
```python # Copyright (c) 2013 Johan Ceuppens. # All rights reserved. # Redistribution and use in source and binary forms are permitted # provided that the above copyright notice and this paragraph are # duplicated in all such forms and that any documentation, # advertising materials, and other materials related to su...
[ { "content": "Provide an exact copy of the source code:\n```python\nimport os\nimport time\nimport json\nimport string\nfrom collections import defaultdict, Counter\nfrom random import random\n\nimport tweepy\n\nclass TwitterAPI:\n \"\"\"\n Class for accessing the Twitter API.\n\n Requires API credenti...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nimport os\nimport time\nimport json\nimport string\nfrom collections import defaultdict, Counter\nfrom random import random\n\nimport tweepy\n\nclass TwitterAPI:\n \"\"\"\n Class for accessing the Twitter API.\n\n Requi...
```python import os import time import json import string from collections import defaultdict, Counter from random import random import tweepy class TwitterAPI: """ Class for accessing the Twitter API. Requires API credentials to be available in environment variables. These will be set appropriately ...
[ { "content": "Here is the script:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"The gzip file path specification resolver helper implementation.\"\"\"\n\n# This is necessary to prevent a circular import.\nimport dfvfs.file_io.gzip_file_io\nimport dfvfs.vfs.gzip_file_system\n\nfrom dfvfs.lib import definitions\nfro...
[ { "content": "Here is the script:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"The gzip file path specification resolver helper implementation.\"\"\"\n\n# This is necessary to prevent a circular import.\nimport dfvfs.file_io.gzip_file_io\nimport dfvfs.vfs.gzip_file_system\n\nfrom dfvfs.lib import ...
```python # -*- coding: utf-8 -*- """The gzip file path specification resolver helper implementation.""" # This is necessary to prevent a circular import. import dfvfs.file_io.gzip_file_io import dfvfs.vfs.gzip_file_system from dfvfs.lib import definitions from dfvfs.resolver import resolver from dfvfs.resolver impor...
[ { "content": "```python\nfrom typing import List\n\nimport typepy\nfrom mbstrdecoder import MultiByteStrDecoder\n\nfrom ....error import EmptyTableNameError\nfrom ._numpy import NumpyTableWriter\n\n\nclass PandasDataFrameWriter(NumpyTableWriter):\n \"\"\"\n A writer class for Pandas DataFrame format.\n\n ...
[ { "content": "<|memory_start|>```python\nfrom typing import List\n\nimport typepy\nfrom mbstrdecoder import MultiByteStrDecoder\n\nfrom ....error import EmptyTableNameError\nfrom ._numpy import NumpyTableWriter\n\n\nclass PandasDataFrameWriter(NumpyTableWriter):\n \"\"\"\n A writer class for Pandas DataFr...
```python from typing import List import typepy from mbstrdecoder import MultiByteStrDecoder from ....error import EmptyTableNameError from ._numpy import NumpyTableWriter class PandasDataFrameWriter(NumpyTableWriter): """ A writer class for Pandas DataFrame format. :Example: :ref:`exam...
[ { "content": "Recreate the original code text:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport subprocess\nfrom os.path import exists\n\nfrom setuptools import setup\nfrom setuptools.extension import Extension\nfrom setuptools.command.build_py import build_py as _build_py\n\nfrom Cython.Distu...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport subprocess\nfrom os.path import exists\n\nfrom setuptools import setup\nfrom setuptools.extension import Extension\nfrom setuptools.command.build_py import build_py as _build_py\n\nf...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess from os.path import exists from setuptools import setup from setuptools.extension import Extension from setuptools.command.build_py import build_py as _build_py from Cython.Distutils import build_ext class build_py(_build_py): if exists('...
[ { "content": "Write the code verbatim:\n```python\n#%% Libraries\nimport numpy as np\nimport root_funcs as rf\n#%% predict_linear class (Module for Process_Node - Predict)\nclass predict_linear(object):\n \n __lookup_dict = {\n 'beta_init': {\n 'zeros': ('Cluster_Control.Cluster_IO.Predi...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n#%% Libraries\nimport numpy as np\nimport root_funcs as rf\n#%% predict_linear class (Module for Process_Node - Predict)\nclass predict_linear(object):\n \n __lookup_dict = {\n 'beta_init': {\n 'zeros': ('Cluster_Control....
```python #%% Libraries import numpy as np import root_funcs as rf #%% predict_linear class (Module for Process_Node - Predict) class predict_linear(object): __lookup_dict = { 'beta_init': { 'zeros': ('Cluster_Control.Cluster_IO.Predict_Cluster.beta_init', 'beta_zeros') }, '...
[ { "content": "```python\n#!/usr/bin/env python\nimport fileinput\nimport sys\n\n///<summary>\n///Provides a bunch of operations to format and manage hard disks.\n///\n///One cool thing that this class does is allow you to generate a fstab file\n///based on disk formatting operations conducted earlier using this...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\nimport fileinput\nimport sys\n\n///<summary>\n///Provides a bunch of operations to format and manage hard disks.\n///\n///One cool thing that this class does is allow you to generate a fstab file\n///based on disk formatting operations conducted ea...
```python #!/usr/bin/env python import fileinput import sys ///<summary> ///Provides a bunch of operations to format and manage hard disks. /// ///One cool thing that this class does is allow you to generate a fstab file ///based on disk formatting operations conducted earlier using this class. This ///is helpful when...
[ { "content": "Recreate the original code text:\n```python\nfrom PyQt5.QtWidgets import QWidget, QSplitter, QVBoxLayout, QFrame, QFileDialog, QScrollArea, QMenuBar, QAction, QToolBar\r\nfrom PyQt5.QtCore import Qt\r\nfrom PyQt5.QtGui import QIcon\r\nfrom JamSpace.Views.LaneSpaceView import LaneSpaceView\r\nfrom ...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\nfrom PyQt5.QtWidgets import QWidget, QSplitter, QVBoxLayout, QFrame, QFileDialog, QScrollArea, QMenuBar, QAction, QToolBar\r\nfrom PyQt5.QtCore import Qt\r\nfrom PyQt5.QtGui import QIcon\r\nfrom JamSpace.Views.LaneSpaceView import LaneSp...
```python from PyQt5.QtWidgets import QWidget, QSplitter, QVBoxLayout, QFrame, QFileDialog, QScrollArea, QMenuBar, QAction, QToolBar from PyQt5.QtCore import Qt from PyQt5.QtGui import QIcon from JamSpace.Views.LaneSpaceView import LaneSpaceView from JamSpace.Views.ControlBar import ControlBar class MainView(QWi...
[ { "content": "Return the code exactly, with no changes:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nDon't edit this file manually.\nUpdate it from QGIS console:\n\nfrom processing.tools.translation import updateTranslations\nupdateTranslations()\n\"\"\"\n\nfrom PyQt4.QtCore import QCoreApplication\n\ndef tra...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nDon't edit this file manually.\nUpdate it from QGIS console:\n\nfrom processing.tools.translation import updateTranslations\nupdateTranslations()\n\"\"\"\n\nfrom PyQt4.QtCore import QCoreApplic...
```python # -*- coding: utf-8 -*- """ Don't edit this file manually. Update it from QGIS console: from processing.tools.translation import updateTranslations updateTranslations() """ from PyQt4.QtCore import QCoreApplication def translationShadow(): """QGISAlgorithmProvider""" QCoreApplication.translate("S...
[ { "content": "Here is a code file:\n```python\n# -*- coding: utf8 -*-\r\n\r\nimport sys, os\r\nsys.path.append(os.path.abspath('.'))\r\n\r\nimport re\r\n\r\nfrom operator import attrgetter\r\nimport difflib\r\n\r\n# Pylons model init sequence\r\nimport pylons.test\r\nimport logging\r\n\r\nfrom quanthistling.con...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# -*- coding: utf8 -*-\r\n\r\nimport sys, os\r\nsys.path.append(os.path.abspath('.'))\r\n\r\nimport re\r\n\r\nfrom operator import attrgetter\r\nimport difflib\r\n\r\n# Pylons model init sequence\r\nimport pylons.test\r\nimport logging\r\n\r\nfrom q...
```python # -*- coding: utf8 -*- import sys, os sys.path.append(os.path.abspath('.')) import re from operator import attrgetter import difflib # Pylons model init sequence import pylons.test import logging from quanthistling.config.environment import load_environment from quanthistling.model.meta im...
[ { "content": "Repeat the full code snippet:\n```python\nimport os, serial, time, numpy\n\nwatchTime = 3600\nmeasureInterval = 5\ncalcTime = 1.5\n\ndef receiving(ser):\n global last_received\n buffer_string = ''\n while True:\n buffer_string = buffer_string + ser.read(ser.inWaiting())\n if...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\nimport os, serial, time, numpy\n\nwatchTime = 3600\nmeasureInterval = 5\ncalcTime = 1.5\n\ndef receiving(ser):\n global last_received\n buffer_string = ''\n while True:\n buffer_string = buffer_string + ser.read(ser.inWaitin...
```python import os, serial, time, numpy watchTime = 3600 measureInterval = 5 calcTime = 1.5 def receiving(ser): global last_received buffer_string = '' while True: buffer_string = buffer_string + ser.read(ser.inWaiting()) if '\n' in buffer_string: lines = buffer_string.split('...
[ { "content": "Repeat the following code:\n```python\n# Author: Trevor Perrin\n# See the LICENSE file for legal information regarding use of this file.\n\n\"\"\"TLS Lite + poplib.\"\"\"\n\nimport socket\nfrom poplib import POP3, POP3_SSL_PORT\nfrom tlslite.tlsconnection import TLSConnection\nfrom tlslite.integra...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n# Author: Trevor Perrin\n# See the LICENSE file for legal information regarding use of this file.\n\n\"\"\"TLS Lite + poplib.\"\"\"\n\nimport socket\nfrom poplib import POP3, POP3_SSL_PORT\nfrom tlslite.tlsconnection import TLSConnection\nfrom...
```python # Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """TLS Lite + poplib.""" import socket from poplib import POP3, POP3_SSL_PORT from tlslite.tlsconnection import TLSConnection from tlslite.integration.clienthelper import ClientHelper class POP3_TLS(POP3, Clien...
[ { "content": "Write the code verbatim:\n```python\n#Copyright 2015 B. Johan G. Svensson\r\n#Licensed under the terms of the MIT license (see LICENSE).\r\n\r\nfrom __future__ import division\r\nimport string, struct, collections\r\nimport fsslib, floppytrack\r\n\r\n\r\n\r\n#import floppyinforead\r\n#dsk = floppy...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n#Copyright 2015 B. Johan G. Svensson\r\n#Licensed under the terms of the MIT license (see LICENSE).\r\n\r\nfrom __future__ import division\r\nimport string, struct, collections\r\nimport fsslib, floppytrack\r\n\r\n\r\n\r\n#import floppyinforead\...
```python #Copyright 2015 B. Johan G. Svensson #Licensed under the terms of the MIT license (see LICENSE). from __future__ import division import string, struct, collections import fsslib, floppytrack #import floppyinforead #dsk = floppyinforead.analyzedisc('j:\\Transfer\\CloudKingdom.fss') ##-Take a cof...
[ { "content": "Provide a verbatim copy of the code:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function\n\nimport numpy\nfrom util import sigmoid\n\nfrom abc import ABCMeta, abstractmethod\nfrom graph import Bipartite\nfrom collections import deque\n\nclass MCMethod(...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function\n\nimport numpy\nfrom util import sigmoid\n\nfrom abc import ABCMeta, abstractmethod\nfrom graph import Bipartite\nfrom collections import deque\n\...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import numpy from util import sigmoid from abc import ABCMeta, abstractmethod from graph import Bipartite from collections import deque class MCMethod(object): """Interface for Monte Carlo-like methods.""" __metacla...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n\n# Scrapy settings for curation_spider project\n#\n# For simplicity, this file contains only settings considered important or\n# commonly used. You can find more settings consulting the documentation:\n#\n# http://doc.scrapy.org/en/latest/topics/settings.ht...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n# Scrapy settings for curation_spider project\n#\n# For simplicity, this file contains only settings considered important or\n# commonly used. You can find more settings consulting the documentation:\n#\n# http://doc.scrapy.org/en/latest/to...
```python # -*- coding: utf-8 -*- # Scrapy settings for curation_spider 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.readthe...
[ { "content": "Here is a code snippet:\n```python\n__author__ = 'olav'\n\nimport sys, os\nimport theano.tensor as T\nimport theano\nimport numpy as np\n\nsys.path.append(os.path.abspath(\"./\"))\nfrom wrapper import create_output_func\nfrom model import ConvModel\n\n\ndef create_threshold_image(image, threshold)...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n__author__ = 'olav'\n\nimport sys, os\nimport theano.tensor as T\nimport theano\nimport numpy as np\n\nsys.path.append(os.path.abspath(\"./\"))\nfrom wrapper import create_output_func\nfrom model import ConvModel\n\n\ndef create_threshold_image(i...
```python __author__ = 'olav' import sys, os import theano.tensor as T import theano import numpy as np sys.path.append(os.path.abspath("./")) from wrapper import create_output_func from model import ConvModel def create_threshold_image(image, threshold): binary_arr = np.ones(image.shape) low_values_indices...
[ { "content": "Here is the source code:\n```python\n#!/usr/bin/python3\n\nimport sys\nimport random\nimport math\nimport os\nimport getopt\nimport pygame\nimport shelve\nimport time\nfrom pygame.locals import *\n\nif not pygame.font:\n print('Warning, fonts disabled')\nif not pygame.mixer:\n print('Warning...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n#!/usr/bin/python3\n\nimport sys\nimport random\nimport math\nimport os\nimport getopt\nimport pygame\nimport shelve\nimport time\nfrom pygame.locals import *\n\nif not pygame.font:\n print('Warning, fonts disabled')\nif not pygame.mixer:\n ...
```python #!/usr/bin/python3 import sys import random import math import os import getopt import pygame import shelve import time from pygame.locals import * if not pygame.font: print('Warning, fonts disabled') if not pygame.mixer: print('Warning, sound disabled') # setting up constants WINDOW_WIDTH = 640 WI...
[ { "content": "Here is a code snippet:\n```python\n# -*- coding: UTF-8 -*-\nimport os,pickle,glob,time,sys\nfrom tools import *\nfrom entity import *\nfrom Word import Word\nfrom Syllable import Syllable\n\nfrom ipa import ipa\nimport codecs\n\nclass Dictionary:\t# cf Word, in that Text.py will really instantiat...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# -*- coding: UTF-8 -*-\nimport os,pickle,glob,time,sys\nfrom tools import *\nfrom entity import *\nfrom Word import Word\nfrom Syllable import Syllable\n\nfrom ipa import ipa\nimport codecs\n\nclass Dictionary:\t# cf Word, in that Text.py will r...
```python # -*- coding: UTF-8 -*- import os,pickle,glob,time,sys from tools import * from entity import * from Word import Word from Syllable import Syllable from ipa import ipa import codecs class Dictionary: # cf Word, in that Text.py will really instantiate Dictionary_en,Dictionary_fi,usw. classnames=['Phoneme','...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n# Copyright (c) 2015, Robert Escriva\n# All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# \n# * R...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# Copyright (c) 2015, Robert Escriva\n# All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met...
```python # Copyright (c) 2015, Robert Escriva # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list ...
[ { "content": "```python\nimport numpy as np\n\nfrom fos.actor.primitives import AABBPrimitive\nfrom pyglet.gl import GLfloat\nfrom pyglet.gl import *\n\nclass Actor(object):\n \"\"\" Define a visualization object in Fos \"\"\"\n \n def __init__(self,\n affine = None,\n a...
[ { "content": "<|memory_start|>```python\nimport numpy as np\n\nfrom fos.actor.primitives import AABBPrimitive\nfrom pyglet.gl import GLfloat\nfrom pyglet.gl import *\n\nclass Actor(object):\n \"\"\" Define a visualization object in Fos \"\"\"\n \n def __init__(self,\n affine = None,\n ...
```python import numpy as np from fos.actor.primitives import AABBPrimitive from pyglet.gl import GLfloat from pyglet.gl import * class Actor(object): """ Define a visualization object in Fos """ def __init__(self, affine = None, aabb = None, force_cente...
[ { "content": "Write the code verbatim:\n```python\n#\n# Jinja2 (http://jinja.pocoo.org) based template renderer.\n#\n# Author: Satoru SATOH <ssato redhat.com>\n# License: MIT\n#\n# pylint: disable=unused-argument\n\"\"\"Template rendering module for jinja2-based template config files.\n\"\"\"\nfrom __future__ i...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n#\n# Jinja2 (http://jinja.pocoo.org) based template renderer.\n#\n# Author: Satoru SATOH <ssato redhat.com>\n# License: MIT\n#\n# pylint: disable=unused-argument\n\"\"\"Template rendering module for jinja2-based template config files.\n\"\"\"\nf...
```python # # Jinja2 (http://jinja.pocoo.org) based template renderer. # # Author: Satoru SATOH <ssato redhat.com> # License: MIT # # pylint: disable=unused-argument """Template rendering module for jinja2-based template config files. """ from __future__ import absolute_import import logging import os import anyconfi...
[ { "content": "Recreate the original code text:\n```python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport re\nimport sys\nimport theano\nimport theano.tensor as T\n\nfrom nltk import corpus\nfrom sklearn.metrics import accuracy_score, classification_report\nfrom sklearn.cross_validation import train_test...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport re\nimport sys\nimport theano\nimport theano.tensor as T\n\nfrom nltk import corpus\nfrom sklearn.metrics import accuracy_score, classification_report\nfrom sklearn.cross_validation i...
```python # -*- coding: utf-8 -*- import numpy as np import re import sys import theano import theano.tensor as T from nltk import corpus from sklearn.metrics import accuracy_score, classification_report from sklearn.cross_validation import train_test_split from sklearn.datasets import fetch_20newsgroups from sklearn...
[ { "content": "Here is a code snippet:\n```python\n# Copyright (c) 2008,2015,2018 MetPy Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"Collection of generally useful utility code from the cookbook.\"\"\"\n\nimport os\n\nimport numpy as np\n...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# Copyright (c) 2008,2015,2018 MetPy Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"Collection of generally useful utility code from the cookbook.\"\"\"\n\nimport os\n\nimpo...
```python # Copyright (c) 2008,2015,2018 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Collection of generally useful utility code from the cookbook.""" import os import numpy as np import pooch from . import __version__ try: string_type ...
[ { "content": "```python\n__author__ = 'tjhunter'\n\nimport build\nimport json\nimport pylab as pl\nfrom matplotlib.collections import LineCollection\n# Draws the network as a pdf and SVG file.\n\ndef draw_network(ax, fd, link_style):\n def decode_line(l):\n #print l\n dct = json.loads(l)\n lats = dct[...
[ { "content": "<|memory_start|>```python\n__author__ = 'tjhunter'\n\nimport build\nimport json\nimport pylab as pl\nfrom matplotlib.collections import LineCollection\n# Draws the network as a pdf and SVG file.\n\ndef draw_network(ax, fd, link_style):\n def decode_line(l):\n #print l\n dct = json.loads(l)\...
```python __author__ = 'tjhunter' import build import json import pylab as pl from matplotlib.collections import LineCollection # Draws the network as a pdf and SVG file. def draw_network(ax, fd, link_style): def decode_line(l): #print l dct = json.loads(l) lats = dct['lats'] lons = dct['lons'] ...
[ { "content": "Here is a code snippet:\n```python\n# -*- coding: utf-8 -*-\n\n########################## Copyrights and license ############################\n# #\n# Copyright 2011-2015 Christian Lupien <christian.lupien@usherbrooke.ca> ...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n########################## Copyrights and license ############################\n# #\n# Copyright 2011-2015 Christian Lupien <christian.lupien@u...
```python # -*- coding: utf-8 -*- ########################## Copyrights and license ############################ # # # Copyright 2011-2015 Christian Lupien <christian.lupien@usherbrooke.ca> # # ...
[ { "content": "```python\nfrom ..with_request import WithRequest\n\n\nclass Account(WithRequest):\n\n def __init__(self, url, session_id):\n self.base_url = url\n self.session_id=session_id\n\n def account_get_by_id(self, i_account):\n \"\"\"Get account by id\"\"\"\n endpoint = ...
[ { "content": "<|memory_start|>```python\nfrom ..with_request import WithRequest\n\n\nclass Account(WithRequest):\n\n def __init__(self, url, session_id):\n self.base_url = url\n self.session_id=session_id\n\n def account_get_by_id(self, i_account):\n \"\"\"Get account by id\"\"\"\n ...
```python from ..with_request import WithRequest class Account(WithRequest): def __init__(self, url, session_id): self.base_url = url self.session_id=session_id def account_get_by_id(self, i_account): """Get account by id""" endpoint = "{0}".format('/rest/Account/get_account_...
[ { "content": "Here is a code file:\n```python\nfrom sfsimodels import models\nimport sfsimodels as sm\nimport json\nimport numpy as np\n\n\ndef test_link_building_and_soil():\n number_of_storeys = 6\n interstorey_height = 3.4 # m\n n_bays = 3\n\n fb = models.FrameBuilding(number_of_storeys, n_bays)...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nfrom sfsimodels import models\nimport sfsimodels as sm\nimport json\nimport numpy as np\n\n\ndef test_link_building_and_soil():\n number_of_storeys = 6\n interstorey_height = 3.4 # m\n n_bays = 3\n\n fb = models.FrameBuilding(number_of_...
```python from sfsimodels import models import sfsimodels as sm import json import numpy as np def test_link_building_and_soil(): number_of_storeys = 6 interstorey_height = 3.4 # m n_bays = 3 fb = models.FrameBuilding(number_of_storeys, n_bays) fb.id = 1 fb.interstorey_heights = interstorey_...
[ { "content": "Here is the code block:\n```python\n#!/usr/bin/python\n#\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n#!/usr/bin/python\n#\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# h...
```python #!/usr/bin/python # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
[ { "content": "Return the code exactly, with no changes:\n```python\n#!/usr/bin/python\n\nimport sqlite3\n\nclass Database:\n def __init__(self):\n self.connect()\n\n def connect(self):\n self.conn = sqlite3.connect('lifebot.db')\n\n def get_cursor(self):\n # A bit weird for now but...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n#!/usr/bin/python\n\nimport sqlite3\n\nclass Database:\n def __init__(self):\n self.connect()\n\n def connect(self):\n self.conn = sqlite3.connect('lifebot.db')\n\n def get_cursor(self):\n # A bit w...
```python #!/usr/bin/python import sqlite3 class Database: def __init__(self): self.connect() def connect(self): self.conn = sqlite3.connect('lifebot.db') def get_cursor(self): # A bit weird for now but trying to figure out SQLite try: return self.conn.cursor(...
[ { "content": "Provide a verbatim copy of the code:\n```python\nfrom citrination_client.models.design.constraints.base import BaseConstraint\nfrom citrination_client.base.errors import CitrinationClientError\n\nclass ElementalInclusionConstraint(BaseConstraint):\n \"\"\"\n Constraint class which allows the...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\nfrom citrination_client.models.design.constraints.base import BaseConstraint\nfrom citrination_client.base.errors import CitrinationClientError\n\nclass ElementalInclusionConstraint(BaseConstraint):\n \"\"\"\n Constraint class ...
```python from citrination_client.models.design.constraints.base import BaseConstraint from citrination_client.base.errors import CitrinationClientError class ElementalInclusionConstraint(BaseConstraint): """ Constraint class which allows the assertion that a set of elements is included in the candidate c...
[ { "content": "Write the code verbatim:\n```python\nfrom datetime import date\n\nfrom cornflake.exceptions import ValidationError\nimport pytest\n\nfrom radar.api.serializers.salt_wasting import SaltWastingClinicalFeaturesSerializer\nfrom radar.models.patient_demographics import PatientDemographics\nfrom radar.m...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\nfrom datetime import date\n\nfrom cornflake.exceptions import ValidationError\nimport pytest\n\nfrom radar.api.serializers.salt_wasting import SaltWastingClinicalFeaturesSerializer\nfrom radar.models.patient_demographics import PatientDemographi...
```python from datetime import date from cornflake.exceptions import ValidationError import pytest from radar.api.serializers.salt_wasting import SaltWastingClinicalFeaturesSerializer from radar.models.patient_demographics import PatientDemographics from radar.models.patients import Patient from radar.models.users im...
[ { "content": "Here is a code snippet:\n```python\n# -*- coding: utf-8 -*-\n# This file is part of Shoop.\n#\n# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.\n#\n# This source code is licensed under the AGPLv3 license found in the\n# LICENSE file in the root directory of this source tree.\nimport os\n...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# This file is part of Shoop.\n#\n# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.\n#\n# This source code is licensed under the AGPLv3 license found in the\n# LICENSE file in the root directory of this source tr...
```python # -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import os from django.core.exceptions import ImproperlyConfigured...
[ { "content": "Here is some code:\n```python\n'''function [out] = imrotateFill(inp, angle)\n% function [out] = imrotateFill(inp)\n% Rotates an 2D image couterclockwise by angle in degrees\n% Output image has the same dimension as input.\n% Undefined regions are filled in by repeating the original image\n% Note:...
[ { "content": "Here is some code:\n<|memory_start|>```python\n'''function [out] = imrotateFill(inp, angle)\n% function [out] = imrotateFill(inp)\n% Rotates an 2D image couterclockwise by angle in degrees\n% Output image has the same dimension as input.\n% Undefined regions are filled in by repeating the origina...
```python '''function [out] = imrotateFill(inp, angle) % function [out] = imrotateFill(inp) % Rotates an 2D image couterclockwise by angle in degrees % Output image has the same dimension as input. % Undefined regions are filled in by repeating the original image % Note: input images must be square % % Copyright (c) U...
[ { "content": "Here is a code file:\n```python\n\"\"\"Settings that need to be set in order to run the tests.\"\"\"\nimport os\n\n\nDEBUG = True\nSITE_ID = 1\n\nAPP_ROOT = os.path.abspath(\n os.path.join(os.path.dirname(__file__), '..'))\n\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backe...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n\"\"\"Settings that need to be set in order to run the tests.\"\"\"\nimport os\n\n\nDEBUG = True\nSITE_ID = 1\n\nAPP_ROOT = os.path.abspath(\n os.path.join(os.path.dirname(__file__), '..'))\n\n\nDATABASES = {\n 'default': {\n 'ENGINE': ...
```python """Settings that need to be set in order to run the tests.""" import os DEBUG = True SITE_ID = 1 APP_ROOT = os.path.abspath( os.path.join(os.path.dirname(__file__), '..')) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } ROOT_URLCONF ...
[ { "content": "Write the code verbatim:\n```python\nimport json\nimport jwt\nimport logging\nimport os\nimport uuid\nimport signal\nimport sys\nimport traceback\n\nfrom tornado import ioloop, web, auth, httpserver, gen, escape, log\nfrom tornado.options import options, parse_command_line, define\n\nfrom problem ...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\nimport json\nimport jwt\nimport logging\nimport os\nimport uuid\nimport signal\nimport sys\nimport traceback\n\nfrom tornado import ioloop, web, auth, httpserver, gen, escape, log\nfrom tornado.options import options, parse_command_line, define\...
```python import json import jwt import logging import os import uuid import signal import sys import traceback from tornado import ioloop, web, auth, httpserver, gen, escape, log from tornado.options import options, parse_command_line, define from problem import Problem from contest import Contest from judge import ...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n'''\r\nStrava club information is not publicly available. To get the club information\r\n the club owner needs to be logged in. This script takes the HTML file of the\r\n strava club page and extracts all the users/athletes.\r\n...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n'''\r\nStrava club information is not publicly available. To get the club information\r\n the club owner needs to be logged in. This script takes the HTML file of the\r\n strava club page and extracts all the use...
```python ''' Strava club information is not publicly available. To get the club information the club owner needs to be logged in. This script takes the HTML file of the strava club page and extracts all the users/athletes. ''' from bs4 import BeautifulSoup import argparse def get_group_members_from_html(h...
[ { "content": "```python\n#!/usr/bin/env python\n#************************************************************************\n# Codelet Tuning Infrastructure\n# Copyright (C) 2010-2015 Intel Corporation, CEA, GENCI, and UVSQ\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n#************************************************************************\n# Codelet Tuning Infrastructure\n# Copyright (C) 2010-2015 Intel Corporation, CEA, GENCI, and UVSQ\n#\n# This program is free software: you can redistribute it and/or modify...
```python #!/usr/bin/env python #************************************************************************ # Codelet Tuning Infrastructure # Copyright (C) 2010-2015 Intel Corporation, CEA, GENCI, and UVSQ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pub...
[ { "content": "Here is the code block:\n```python\n# Copyright (c) 2012 OpenStack Foundation.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n# Copyright (c) 2012 OpenStack Foundation.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of th...
```python # Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
[ { "content": "```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://www.apache.org/licenses...
[ { "content": "<|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\n#\n# http://www.apa...
```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 require...
[ { "content": "Here is the source code:\n```python\nimport requests # Used to make HTTP requests\nimport json # Used to parse JSON\nimport os # Used to infer environment variables\n\nAPI_TAGO = os.environ.get('TAGO_API') or 'https://api.tago.io'\nREALTIME = os.environ.get('TAGO_REALTIME') or 'https://realtime...
[ { "content": "Here is the source code:\n<|memory_start|>```python\nimport requests # Used to make HTTP requests\nimport json # Used to parse JSON\nimport os # Used to infer environment variables\n\nAPI_TAGO = os.environ.get('TAGO_API') or 'https://api.tago.io'\nREALTIME = os.environ.get('TAGO_REALTIME') or '...
```python import requests # Used to make HTTP requests import json # Used to parse JSON import os # Used to infer environment variables API_TAGO = os.environ.get('TAGO_API') or 'https://api.tago.io' REALTIME = os.environ.get('TAGO_REALTIME') or 'https://realtime.tago.io' class Plan: def __init__(self, acc_token...
[ { "content": "Provide an exact copy of the source code:\n```python\nimport _plotly_utils.basevalidators\n\n\nclass CaxisValidator(_plotly_utils.basevalidators.CompoundValidator):\n def __init__(self, plotly_name=\"caxis\", parent_name=\"layout.ternary\", **kwargs):\n super(CaxisValidator, self).__init...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nimport _plotly_utils.basevalidators\n\n\nclass CaxisValidator(_plotly_utils.basevalidators.CompoundValidator):\n def __init__(self, plotly_name=\"caxis\", parent_name=\"layout.ternary\", **kwargs):\n super(CaxisValidat...
```python import _plotly_utils.basevalidators class CaxisValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="caxis", parent_name="layout.ternary", **kwargs): super(CaxisValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_nam...
[ { "content": "Return the code unaltered:\n```python\n# -*- coding: utf-8 -*-\n'''\nQueries for experiments with ENDSEQ operator\n'''\n\nimport os\n\nfrom tool.attributes import get_move_attribute_list, get_place_attribute_list\nfrom tool.experiment import SLI, RAN, ALGORITHM, \\\n CQL_ALG, QUERY, Q_MOVE, Q_P...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n'''\nQueries for experiments with ENDSEQ operator\n'''\n\nimport os\n\nfrom tool.attributes import get_move_attribute_list, get_place_attribute_list\nfrom tool.experiment import SLI, RAN, ALGORITHM, \\\n CQL_ALG, QU...
```python # -*- coding: utf-8 -*- ''' Queries for experiments with ENDSEQ operator ''' import os from tool.attributes import get_move_attribute_list, get_place_attribute_list from tool.experiment import SLI, RAN, ALGORITHM, \ CQL_ALG, QUERY, Q_MOVE, Q_PLACE from tool.io import get_query_dir, write_to_txt, get_out...
[ { "content": "Produce an exact reconstruction of the code:\n```python\nfrom __future__ import division, print_function\n\nimport operator\nfrom collections import OrderedDict\nimport numpy as np\nimport pandas as pd\nimport toolz\nfrom tornado.ioloop import IOLoop\nfrom tornado import gen\n\nfrom ..collection i...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\nfrom __future__ import division, print_function\n\nimport operator\nfrom collections import OrderedDict\nimport numpy as np\nimport pandas as pd\nimport toolz\nfrom tornado.ioloop import IOLoop\nfrom tornado import gen\n\nfro...
```python from __future__ import division, print_function import operator from collections import OrderedDict import numpy as np import pandas as pd import toolz from tornado.ioloop import IOLoop from tornado import gen from ..collection import Streaming, _stream_types, OperatorMixin from ..sources import Source from...
[ { "content": "Here is the snippet:\n```python\n# -*- coding: utf8 -*-\n\n__author__ = 'sergey'\n\nimport hashlib\nfrom time import time\nfrom dedupsqlfs.db.mysql.table import Table\n\nclass TableSubvolume( Table ):\n\n _table_name = \"subvolume\"\n\n def create( self ):\n c = self.getCursor()\n\n ...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n# -*- coding: utf8 -*-\n\n__author__ = 'sergey'\n\nimport hashlib\nfrom time import time\nfrom dedupsqlfs.db.mysql.table import Table\n\nclass TableSubvolume( Table ):\n\n _table_name = \"subvolume\"\n\n def create( self ):\n c = self.g...
```python # -*- coding: utf8 -*- __author__ = 'sergey' import hashlib from time import time from dedupsqlfs.db.mysql.table import Table class TableSubvolume( Table ): _table_name = "subvolume" def create( self ): c = self.getCursor() # Create table c.execute( "CREATE TA...
[ { "content": "Recreate the original code text:\n```python\n# -*- coding: utf-8 -*-\n#\n# Tolk documentation build configuration file, created by\n# sphinx-quickstart on Wed Sep 30 13:15:07 2015.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possi...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# Tolk documentation build configuration file, created by\n# sphinx-quickstart on Wed Sep 30 13:15:07 2015.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note th...
```python # -*- coding: utf-8 -*- # # Tolk documentation build configuration file, created by # sphinx-quickstart on Wed Sep 30 13:15:07 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file...
[ { "content": "Provide an exact copy of the source code:\n```python\n\"\"\"\nProvide container class for gas chemistry data.\n\"\"\"\nimport hashlib\nimport warnings\n\nimport numpy as np\nimport tables\nfrom tables.exceptions import NoSuchNodeError, NodeError\n\nfrom spectroscopy.class_factory import ResourceId...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n\"\"\"\nProvide container class for gas chemistry data.\n\"\"\"\nimport hashlib\nimport warnings\n\nimport numpy as np\nimport tables\nfrom tables.exceptions import NoSuchNodeError, NodeError\n\nfrom spectroscopy.class_factory i...
```python """ Provide container class for gas chemistry data. """ import hashlib import warnings import numpy as np import tables from tables.exceptions import NoSuchNodeError, NodeError from spectroscopy.class_factory import ResourceIdentifier from spectroscopy.plugins import get_registered_plugins from spectroscopy...
[ { "content": "Replicate the source code:\n```python\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under ...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this fi...
```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 "License"); you ...
[ { "content": "```python\n\"\"\"\nWSGI config for Creamas project.\n\nThis module contains the WSGI application used by Django's development server\nand any production WSGI deployments. It should expose a module-level variable\nnamed ``application``. Django's ``runserver`` and ``runfcgi`` commands discover\nthis...
[ { "content": "<|memory_start|>```python\n\"\"\"\nWSGI config for Creamas project.\n\nThis module contains the WSGI application used by Django's development server\nand any production WSGI deployments. It should expose a module-level variable\nnamed ``application``. Django's ``runserver`` and ``runfcgi`` command...
```python """ WSGI config for Creamas project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPL...
[ { "content": "Repeat the following code:\n```python\nimport os\nimport urlparse\nimport subprocess\nimport smtplib\nimport getpass\nimport re\nfrom email.mime.text import MIMEText\n\nimport pyrax\n\n\nenv_file = '/home/ubuntu/blimp.env'\n\n\ndef run():\n print('---> Getting latest backup of {}...'.format(her...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\nimport os\nimport urlparse\nimport subprocess\nimport smtplib\nimport getpass\nimport re\nfrom email.mime.text import MIMEText\n\nimport pyrax\n\n\nenv_file = '/home/ubuntu/blimp.env'\n\n\ndef run():\n print('---> Getting latest backup of {...
```python import os import urlparse import subprocess import smtplib import getpass import re from email.mime.text import MIMEText import pyrax env_file = '/home/ubuntu/blimp.env' def run(): print('---> Getting latest backup of {}...'.format(heroku_app_name)) latest_backup_url = subprocess.check_output( ...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\n#!/usr/bin/python\n\n#run as array job\n#if files are bzipped -> copy to local disk and unzip there\n\n\nimport os,sys\n\ndb_dir = sys.argv[1]\n\nzipped = sys.argv[2] #are files bzipped?\n\nif zipped == 'True':\n\tzipped = True\...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n#!/usr/bin/python\n\n#run as array job\n#if files are bzipped -> copy to local disk and unzip there\n\n\nimport os,sys\n\ndb_dir = sys.argv[1]\n\nzipped = sys.argv[2] #are files bzipped?\n\nif zipped == 'True':\n...
```python #!/usr/bin/python #run as array job #if files are bzipped -> copy to local disk and unzip there import os,sys db_dir = sys.argv[1] zipped = sys.argv[2] #are files bzipped? if zipped == 'True': zipped = True else: zipped = False files = os.listdir(db_dir) file = '#$ -S /bin/tcsh\n#$ -cwd\n#$ -V\n' p...
[ { "content": "```python\nfrom random import uniform\nimport numpy\n\ndef sigmoidFunction(x):\n try:\n ret = 1 / (1 + numpy.exp(-x))\n except OverflowError:\n ret = 0\n return ret\n\ndef softMax(array):\n exp = [numpy.exp(x) for x in array]\n return numpy.array([x / sum(exp) for x in...
[ { "content": "<|memory_start|>```python\nfrom random import uniform\nimport numpy\n\ndef sigmoidFunction(x):\n try:\n ret = 1 / (1 + numpy.exp(-x))\n except OverflowError:\n ret = 0\n return ret\n\ndef softMax(array):\n exp = [numpy.exp(x) for x in array]\n return numpy.array([x / s...
```python from random import uniform import numpy def sigmoidFunction(x): try: ret = 1 / (1 + numpy.exp(-x)) except OverflowError: ret = 0 return ret def softMax(array): exp = [numpy.exp(x) for x in array] return numpy.array([x / sum(exp) for x in exp]) global sigmoid sigm...
[ { "content": "```python\n# Written by Nicolas Neubauer, Arno Bakker\r\n# see LICENSE.txt for license information\r\n#\r\n# Test case for BuddyCast overlay version 12 (and 8). To be integrated into\r\n# test_buddycast_msg.py\r\n#\r\n# Very sensitive to the order in which things are put into DB,\r\n# so not a rob...
[ { "content": "<|memory_start|>```python\n# Written by Nicolas Neubauer, Arno Bakker\r\n# see LICENSE.txt for license information\r\n#\r\n# Test case for BuddyCast overlay version 12 (and 8). To be integrated into\r\n# test_buddycast_msg.py\r\n#\r\n# Very sensitive to the order in which things are put into DB,\r...
```python # Written by Nicolas Neubauer, Arno Bakker # see LICENSE.txt for license information # # Test case for BuddyCast overlay version 12 (and 8). To be integrated into # test_buddycast_msg.py # # Very sensitive to the order in which things are put into DB, # so not a robust test import unittest import...
[ { "content": "Repeat the code precisely:\n```python\n#!/bin/python\n#\n# Hacking together tutorials from deeplearning.net to make\n# a MLP model\n\nimport numpy\nimport theano\nimport theano.tensor as T\nimport sklearn.cross_validation\n\nclass LogisticRegression(object):\n \"\"\"Multi-class Logistic Regress...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n#!/bin/python\n#\n# Hacking together tutorials from deeplearning.net to make\n# a MLP model\n\nimport numpy\nimport theano\nimport theano.tensor as T\nimport sklearn.cross_validation\n\nclass LogisticRegression(object):\n \"\"\"Multi-class ...
```python #!/bin/python # # Hacking together tutorials from deeplearning.net to make # a MLP model import numpy import theano import theano.tensor as T import sklearn.cross_validation class LogisticRegression(object): """Multi-class Logistic Regression Class The logistic regression is fully described by a we...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\nfrom eden.model import _CrontabPattern, _ParsedSpec, Task, User\nfrom datetime import datetime, timedelta\nimport unittest\n\nclass TaskTest(unittest.TestCase):\n\n def test_new(self):\n task = Task(1, 'task_id', 'name', 'job...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\nfrom eden.model import _CrontabPattern, _ParsedSpec, Task, User\nfrom datetime import datetime, timedelta\nimport unittest\n\nclass TaskTest(unittest.TestCase):\n\n def test_new(self):\n task = Task(1, 'task_i...
```python from eden.model import _CrontabPattern, _ParsedSpec, Task, User from datetime import datetime, timedelta import unittest class TaskTest(unittest.TestCase): def test_new(self): task = Task(1, 'task_id', 'name', 'job.test', {'args':(), 'kw':{}}, 'every 5') self.assertEquals((task.name, tas...
[ { "content": "Replicate the source code:\n```python\nfrom rest_framework import serializers\nfrom django.contrib.auth.hashers import make_password\nfrom rest_framework.exceptions import ValidationError\nfrom django.contrib.auth import get_user_model\nfrom common.serializers import JobSerializer\nfrom job_auth.s...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\nfrom rest_framework import serializers\nfrom django.contrib.auth.hashers import make_password\nfrom rest_framework.exceptions import ValidationError\nfrom django.contrib.auth import get_user_model\nfrom common.serializers import JobSerializer\...
```python from rest_framework import serializers from django.contrib.auth.hashers import make_password from rest_framework.exceptions import ValidationError from django.contrib.auth import get_user_model from common.serializers import JobSerializer from job_auth.serializers import UserSerializer from .models import( ...
[ { "content": "Here is a code snippet:\n```python\n#!/usr/bin/env python\n# -*- coding: ascii -*-\n\nr\"\"\"\nSupport routines for exhaustive equation search in curve fit routines.\n\nUses itertools to find all combinations.\n\"\"\"\nfrom __future__ import print_function\nfrom builtins import str\n\n\nfrom itert...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: ascii -*-\n\nr\"\"\"\nSupport routines for exhaustive equation search in curve fit routines.\n\nUses itertools to find all combinations.\n\"\"\"\nfrom __future__ import print_function\nfrom builtins import str...
```python #!/usr/bin/env python # -*- coding: ascii -*- r""" Support routines for exhaustive equation search in curve fit routines. Uses itertools to find all combinations. """ from __future__ import print_function from builtins import str from itertools import combinations from math import factorial full_funcL = ...
[ { "content": "```python\nfrom django.conf.urls import url, patterns, include\nfrom django.contrib.auth.decorators import login_required\nfrom django.views.decorators.cache import cache_page\nfrom common.views import APIRoot, root_redirect_view\n\nfrom rest_auth.views import (\n Login, Logout, UserDetails, Pa...
[ { "content": "<|memory_start|>```python\nfrom django.conf.urls import url, patterns, include\nfrom django.contrib.auth.decorators import login_required\nfrom django.views.decorators.cache import cache_page\nfrom common.views import APIRoot, root_redirect_view\n\nfrom rest_auth.views import (\n Login, Logout,...
```python from django.conf.urls import url, patterns, include from django.contrib.auth.decorators import login_required from django.views.decorators.cache import cache_page from common.views import APIRoot, root_redirect_view from rest_auth.views import ( Login, Logout, UserDetails, PasswordChange, PasswordRes...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n# -*- coding: utf-8 -*-\nimport re\nfrom traceback import format_exc\n\nimport pytest\nfrom wrapanapi.utils import eval_strings\n\nfrom cfme.containers.provider import ContainersProvider\nfrom cfme.utils.appliance.implementation...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport re\nfrom traceback import format_exc\n\nimport pytest\nfrom wrapanapi.utils import eval_strings\n\nfrom cfme.containers.provider import ContainersProvider\nfrom cfme.utils.applianc...
```python # -*- coding: utf-8 -*- import re from traceback import format_exc import pytest from wrapanapi.utils import eval_strings from cfme.containers.provider import ContainersProvider from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.wait import TimedOutError pytestmark = [ pyt...
[ { "content": "Here is the source code:\n```python\n# -*- coding: utf-8 -*-\n\n#+---------------------------------------------------------------------------+\n#| 01001110 01100101 01110100 01111010 01101111 01100010 |\n#| ...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n#+---------------------------------------------------------------------------+\n#| 01001110 01100101 01110100 01111010 01101111 01100010 |\n#| ...
```python # -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communicatio...
[ { "content": "Return the code exactly, with no changes:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\n\nimport asyncio\nimport logging\nfrom functools import singledispatch\nfrom bson.objectid import ObjectId\nfrom bson.errors import InvalidId\nfrom tbone.data.fields.mongo import DBRefField\nfrom tbone....
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n#!/usr/bin/env python\n# encoding: utf-8\n\nimport asyncio\nimport logging\nfrom functools import singledispatch\nfrom bson.objectid import ObjectId\nfrom bson.errors import InvalidId\nfrom tbone.data.fields.mongo import DBRefFi...
```python #!/usr/bin/env python # encoding: utf-8 import asyncio import logging from functools import singledispatch from bson.objectid import ObjectId from bson.errors import InvalidId from tbone.data.fields.mongo import DBRefField from tbone.db.models import MongoCollectionMixin, post_save from tbone.dispatch.channe...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2014 Metaswitch Networks\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n#...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2014 Metaswitch Networks\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the ...
```python # -*- coding: utf-8 -*- # Copyright (c) 2014 Metaswitch Networks # 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/li...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\"\"\"\nForce-Directed Graph Layout\n=======================...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\"\"\"\nForce-Directed Graph Layout\n=======...
```python # -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Force-Directed Graph Layout =========================== This module contains implementations for a force-directed layout, where the graph is model...
[ { "content": "Replicate the source code:\n```python\n\"\"\"\nDjango settings for financeiro project.\n\nGenerated by 'django-admin startproject' using Django 1.9.5.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.9/topics/settings/\n\nFor the full list of settings and their values...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n\"\"\"\nDjango settings for financeiro project.\n\nGenerated by 'django-admin startproject' using Django 1.9.5.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.9/topics/settings/\n\nFor the full list of settings ...
```python """ Django settings for financeiro project. Generated by 'django-admin startproject' using Django 1.9.5. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ ...
[ { "content": "Here is the source code:\n```python\nfrom . import FixtureTest\n\n\nclass EarlyStep(FixtureTest):\n def test_steps_with_regional_route(self):\n self.load_fixtures([\n 'https://www.openstreetmap.org/way/24655593',\n 'https://www.openstreetmap.org/relation/2260059',\n...
[ { "content": "Here is the source code:\n<|memory_start|>```python\nfrom . import FixtureTest\n\n\nclass EarlyStep(FixtureTest):\n def test_steps_with_regional_route(self):\n self.load_fixtures([\n 'https://www.openstreetmap.org/way/24655593',\n 'https://www.openstreetmap.org/rela...
```python from . import FixtureTest class EarlyStep(FixtureTest): def test_steps_with_regional_route(self): self.load_fixtures([ 'https://www.openstreetmap.org/way/24655593', 'https://www.openstreetmap.org/relation/2260059', ], clip=self.tile_bbox(12, 653, 1582)) s...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n***************************************************************************\n Union.py\n ---------------------\n Date : August 2012\n Copyright : (C) 2012 by Victor Olaya\n Email : volayaf at gma...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n***************************************************************************\n Union.py\n ---------------------\n Date : August 2012\n Copyright : (C) 2012 by Victor Olaya\n Email ...
```python # -*- coding: utf-8 -*- """ *************************************************************************** Union.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***********************...
[ { "content": "Replicate the source code:\n```python\n#===========================================================================\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of version 2.1 of the GNU Lesser General Public\n# License as published by the Free Soft...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n#===========================================================================\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of version 2.1 of the GNU Lesser General Public\n# License as published ...
```python #=========================================================================== # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in th...
[ { "content": "Repeat the full code snippet:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# h5features documentation build configuration file, created by\n# sphinx-quickstart on Mon Nov 2 16:02:53 2015.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# h5features documentation build configuration file, created by\n# sphinx-quickstart on Mon Nov 2 16:02:53 2015.\n#\n# This file is execfile()d with the current directory set to its\n# con...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- # # h5features documentation build configuration file, created by # sphinx-quickstart on Mon Nov 2 16:02:53 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present ...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n#!/usr/bin/env python\n\"\"\"A module with utilities for dealing with context managers.\"\"\"\n\nfrom typing import ContextManager\nfrom typing import Generic\nfrom typing import Sequence\nfrom typing import TypeVar\n\n_T = TypeVar(\"_...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n#!/usr/bin/env python\n\"\"\"A module with utilities for dealing with context managers.\"\"\"\n\nfrom typing import ContextManager\nfrom typing import Generic\nfrom typing import Sequence\nfrom typing import TypeVar\n\n...
```python #!/usr/bin/env python """A module with utilities for dealing with context managers.""" from typing import ContextManager from typing import Generic from typing import Sequence from typing import TypeVar _T = TypeVar("_T") class NullContext(ContextManager[_T], Generic[_T]): """A context manager that alwa...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\ndef succ(x):\n return x + 1\n\nsuccessor = succ\ndel succ\nprint(successor(10))\n\n\n# functions inside functions\ndef f1():\n def g1():\n print(\"hi, it's me 'g'\")\n print(\"Thanks for calling me\")\n\n ...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\ndef succ(x):\n return x + 1\n\nsuccessor = succ\ndel succ\nprint(successor(10))\n\n\n# functions inside functions\ndef f1():\n def g1():\n print(\"hi, it's me 'g'\")\n print(\"Thanks for calli...
```python def succ(x): return x + 1 successor = succ del succ print(successor(10)) # functions inside functions def f1(): def g1(): print("hi, it's me 'g'") print("Thanks for calling me") print("This is the function 'f'") print("I am calling 'g' now") g1() def temperature(t): ...
[ { "content": "Here is a code file:\n```python\n# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:\n\n# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>\n#\n# This file is part of qutebrowser.\n#\n# qutebrowser is free software: you can redistribute it and/or modify\n# it under the terms ...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:\n\n# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>\n#\n# This file is part of qutebrowser.\n#\n# qutebrowser is free software: you can redistribute it and/or modify\n# it ...
```python # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # ...
[ { "content": "Repeat the following code:\n```python\n\"\"\"\nThis is a module to read in an HDF5 file with CCFs.\nUse this to determine the best parameters, and plot the best CCF for each star/date\n\"\"\"\nfrom collections import defaultdict\nimport logging\n\nimport h5py\nimport numpy as np\nimport pandas as ...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n\"\"\"\nThis is a module to read in an HDF5 file with CCFs.\nUse this to determine the best parameters, and plot the best CCF for each star/date\n\"\"\"\nfrom collections import defaultdict\nimport logging\n\nimport h5py\nimport numpy as np\ni...
```python """ This is a module to read in an HDF5 file with CCFs. Use this to determine the best parameters, and plot the best CCF for each star/date """ from collections import defaultdict import logging import h5py import numpy as np import pandas as pd from scipy.interpolate import InterpolatedUnivariateSpline as s...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n#!/usr/bin/env python\n#\n# A library that provides a Python interface to the Telegram Bot API\n# Copyright (C) 2015-2021\n# Leandro Toledo de Souza <devs@python-telegram-bot.org>\n#\n# This program is free softw...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n#!/usr/bin/env python\n#\n# A library that provides a Python interface to the Telegram Bot API\n# Copyright (C) 2015-2021\n# Leandro Toledo de Souza <devs@python-telegram-bot.org>\n#\n# This progr...
```python #!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2021 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as publ...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# Copyright (C) 2004-2016 by\n# Aric Hagberg <hagberg@lanl.gov>\n# Dan Schult <dschult@colgate.edu>\n# Pieter Swart <swart@lanl.gov>\n# All rights reserved.\n# BSD license.\n\"\"\"\nGenerators for som...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# Copyright (C) 2004-2016 by\n# Aric Hagberg <hagberg@lanl.gov>\n# Dan Schult <dschult@colgate.edu>\n# Pieter Swart <swart@lanl.gov>\n# All rights reserved.\n# BSD license.\n\"\"\"\nGe...
```python # Copyright (C) 2004-2016 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. """ Generators for some classic graphs. The typical graph generator is called as follows: >>> G=nx.complete_graph(100) re...
[ { "content": "Repeat the code precisely:\n```python\n#!/usr/bin/env python\nfrom __future__ import absolute_import, division, print_function, \\\n unicode_literals\nimport os\nimport sys\nimport time\nimport socket\ntry:\n import urllib.request as urllib\nexcept ImportError:\n import urllib\nimport has...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n#!/usr/bin/env python\nfrom __future__ import absolute_import, division, print_function, \\\n unicode_literals\nimport os\nimport sys\nimport time\nimport socket\ntry:\n import urllib.request as urllib\nexcept ImportError:\n import ur...
```python #!/usr/bin/env python from __future__ import absolute_import, division, print_function, \ unicode_literals import os import sys import time import socket try: import urllib.request as urllib except ImportError: import urllib import hashlib import argparse import logging from zeroconf import Servi...
[ { "content": "Write the code verbatim:\n```python\n# -*- coding: utf-8 -*-\n\n__author__ = 'meanwhile'\n\nimport ssl\nimport time\nimport socket\nimport sys\nimport logging\n\nimport vkontakte\nimport ProvaderStorage\nimport Constants\nimport FileWriter\nimport ProccessingResponce\nimport daemon\n\n\nclass VkPa...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n__author__ = 'meanwhile'\n\nimport ssl\nimport time\nimport socket\nimport sys\nimport logging\n\nimport vkontakte\nimport ProvaderStorage\nimport Constants\nimport FileWriter\nimport ProccessingResponce\nimport daemon...
```python # -*- coding: utf-8 -*- __author__ = 'meanwhile' import ssl import time import socket import sys import logging import vkontakte import ProvaderStorage import Constants import FileWriter import ProccessingResponce import daemon class VkParserDemon(daemon.Daemon): def run(self): #read code for...
[ { "content": "Repeat the following code:\n```python\n# Copyright 2010 OpenStack Foundation\n# Copyright 2012 University Of Minho\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of ...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n# Copyright 2010 OpenStack Foundation\n# Copyright 2012 University Of Minho\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\...
```python # Copyright 2010 OpenStack Foundation # Copyright 2012 University Of Minho # # 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/...
[ { "content": "Here is the snippet:\n```python\n\"\"\"Dirac notation for states.\"\"\"\n\n\nfrom sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt,\n Tuple)\nfrom sympy.printing.pretty.stringpict import prettyForm, stringPict\nfrom sympy.physics.quantum.qexpr import QExpr, d...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n\"\"\"Dirac notation for states.\"\"\"\n\n\nfrom sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt,\n Tuple)\nfrom sympy.printing.pretty.stringpict import prettyForm, stringPict\nfrom sympy.physics.quantum.qexpr...
```python """Dirac notation for states.""" from sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt, Tuple) from sympy.printing.pretty.stringpict import prettyForm, stringPict from sympy.physics.quantum.qexpr import QExpr, dispatch_method __all__ = [ 'KetBase', 'BraBase',...
[ { "content": "```python\nimport pytz\nfrom pytz import timezone\nfrom datetime import timedelta, datetime, date, time\nimport re\nfrom corehq.apps.casegroups.models import CommCareCaseGroup\nfrom corehq.apps.hqcase.dbaccessors import get_case_ids_in_domain\nfrom corehq.apps.reminders.dbaccessors import get_surv...
[ { "content": "<|memory_start|>```python\nimport pytz\nfrom pytz import timezone\nfrom datetime import timedelta, datetime, date, time\nimport re\nfrom corehq.apps.casegroups.models import CommCareCaseGroup\nfrom corehq.apps.hqcase.dbaccessors import get_case_ids_in_domain\nfrom corehq.apps.reminders.dbaccessors...
```python import pytz from pytz import timezone from datetime import timedelta, datetime, date, time import re from corehq.apps.casegroups.models import CommCareCaseGroup from corehq.apps.hqcase.dbaccessors import get_case_ids_in_domain from corehq.apps.reminders.dbaccessors import get_surveys_in_domain from dimagi.ext...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n# Copyright 2016 Casey Jaymes\n\n# This file is part of PySCAP.\n#\n# PySCAP 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 Softw...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n# Copyright 2016 Casey Jaymes\n\n# This file is part of PySCAP.\n#\n# PySCAP 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...
```python # Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
[ { "content": "Repeat the full code snippet:\n```python\n\"\"\"\n2.2.2: If `onFulfilled` is a function\nhttps://github.com/promises-aplus/promises-tests/blob/2.1.1/lib/tests/2.2.2.js\n\"\"\"\nimport threading\n\nfrom sleekxmpp.test import SleekTest\n\n\nclass Promise_2_2_2_1_TestCase(SleekTest):\n \"\"\"\n ...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n\"\"\"\n2.2.2: If `onFulfilled` is a function\nhttps://github.com/promises-aplus/promises-tests/blob/2.1.1/lib/tests/2.2.2.js\n\"\"\"\nimport threading\n\nfrom sleekxmpp.test import SleekTest\n\n\nclass Promise_2_2_2_1_TestCase(SleekTest):\...
```python """ 2.2.2: If `onFulfilled` is a function https://github.com/promises-aplus/promises-tests/blob/2.1.1/lib/tests/2.2.2.js """ import threading from sleekxmpp.test import SleekTest class Promise_2_2_2_1_TestCase(SleekTest): """ 2.2.2.1: it must be called after `promise` is fulfilled, with `promise`'s...
[ { "content": "Return the code unaltered:\n```python\n#!/usr/bin/env python\n\nimport sys\nimport json\nfrom types import SimpleNamespace\nfrom argparse import ArgumentParser, ArgumentDefaultsHelpFormatter\nfrom webbrowser import open_new_tab\n\nimport tornado.ioloop\nimport tornado.web\n\nfrom .console import s...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nimport sys\nimport json\nfrom types import SimpleNamespace\nfrom argparse import ArgumentParser, ArgumentDefaultsHelpFormatter\nfrom webbrowser import open_new_tab\n\nimport tornado.ioloop\nimport tornado.web\n\nfrom ....
```python #!/usr/bin/env python import sys import json from types import SimpleNamespace from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from webbrowser import open_new_tab import tornado.ioloop import tornado.web from .console import start_message, append_message, print_message from .infos import...
[ { "content": "Repeat the full code snippet:\n```python\n# -*- coding: UTF-8 -*-\n\n\"\"\"\ntitlecase.py v0.2\nOriginal Perl version by: John Gruber http://daringfireball.net/ 10 May 2008\nPython version by Stuart Colville http://muffinresearch.co.uk\nLicense: http://www.opensource.org/licenses/mit-license.php\n...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# -*- coding: UTF-8 -*-\n\n\"\"\"\ntitlecase.py v0.2\nOriginal Perl version by: John Gruber http://daringfireball.net/ 10 May 2008\nPython version by Stuart Colville http://muffinresearch.co.uk\nLicense: http://www.opensource.org/licenses/m...
```python # -*- coding: UTF-8 -*- """ titlecase.py v0.2 Original Perl version by: John Gruber http://daringfireball.net/ 10 May 2008 Python version by Stuart Colville http://muffinresearch.co.uk License: http://www.opensource.org/licenses/mit-license.php """ import unittest import sys import re SMALL = 'a|an|and|as...
[ { "content": "Replicate the source code:\n```python\n#!/usr/bin/env python\n\nfrom datetime import datetime\nfrom itertools import chain\nimport re\n\nimport numpy as np\nimport click\n\nfrom labman.db.process import (\n SamplePlatingProcess, GDNAExtractionProcess, GDNAPlateCompressionProcess,\n LibraryPr...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom datetime import datetime\nfrom itertools import chain\nimport re\n\nimport numpy as np\nimport click\n\nfrom labman.db.process import (\n SamplePlatingProcess, GDNAExtractionProcess, GDNAPlateCompressionProcess...
```python #!/usr/bin/env python from datetime import datetime from itertools import chain import re import numpy as np import click from labman.db.process import ( SamplePlatingProcess, GDNAExtractionProcess, GDNAPlateCompressionProcess, LibraryPrep16SProcess, NormalizationProcess, QuantificationProcess, ...
[ { "content": "Here is the code content:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Import smtplib for the actual sending function\nimport sys, os\nimport smtplib\nimport email\n# Import the email modules we'll need\nfrom email.mime.text import MIMEText\nfrom email.mime.multipart import MIME...
[ { "content": "Here is the code content:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Import smtplib for the actual sending function\nimport sys, os\nimport smtplib\nimport email\n# Import the email modules we'll need\nfrom email.mime.text import MIMEText\nfrom email.mime.multi...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- # Import smtplib for the actual sending function import sys, os import smtplib import email # Import the email modules we'll need from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.h...
[ { "content": "Here is the snippet:\n```python\n# copyright 2016 Siavoosh Payandeh Azad and Behrad Niazmand\nimport package_file\nimport copy\n\n\ndef extract_checker_info(name_string):\n package_file.list_of_detection_info_sa0[name_string] = []\n package_file.list_of_detection_info_sa1[name_string] = []\n...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n# copyright 2016 Siavoosh Payandeh Azad and Behrad Niazmand\nimport package_file\nimport copy\n\n\ndef extract_checker_info(name_string):\n package_file.list_of_detection_info_sa0[name_string] = []\n package_file.list_of_detection_info_sa1[nam...
```python # copyright 2016 Siavoosh Payandeh Azad and Behrad Niazmand import package_file import copy def extract_checker_info(name_string): package_file.list_of_detection_info_sa0[name_string] = [] package_file.list_of_detection_info_sa1[name_string] = [] package_file.list_of_true_misses_sa0[name_string...