prompt
listlengths
1
1
compression_prompt
listlengths
1
1
target
stringlengths
1.03k
828k
[ { "content": "Return the code unaltered:\n```python\nimport unittest\nfrom feemodel.txmempool import MemBlock\nfrom feemodel.tests.pseudoproxy import proxy\nfrom feemodel.tests.config import test_memblock_dbfile as dbfile\n\nAVAILABLE_HEIGHTS = range(333931, 333954) + [334655, 334656]\n\n\nclass PseudoProxyTest...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\nimport unittest\nfrom feemodel.txmempool import MemBlock\nfrom feemodel.tests.pseudoproxy import proxy\nfrom feemodel.tests.config import test_memblock_dbfile as dbfile\n\nAVAILABLE_HEIGHTS = range(333931, 333954) + [334655, 334656]\n\n\nclass...
```python import unittest from feemodel.txmempool import MemBlock from feemodel.tests.pseudoproxy import proxy from feemodel.tests.config import test_memblock_dbfile as dbfile AVAILABLE_HEIGHTS = range(333931, 333954) + [334655, 334656] class PseudoProxyTests(unittest.TestCase): def test_A(self): # Just...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\n# Copyright (c) 2017, The MITRE Corporation. All rights reserved.\n# See LICENSE.txt for complete terms.\n\n# mixbox\nfrom mixbox import fields\n\n# cybox\nfrom cybox.core import Observables\n\n# internal\nimport stix\nfrom stix.co...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n# Copyright (c) 2017, The MITRE Corporation. All rights reserved.\n# See LICENSE.txt for complete terms.\n\n# mixbox\nfrom mixbox import fields\n\n# cybox\nfrom cybox.core import Observables\n\n# internal\nimport st...
```python # Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. # mixbox from mixbox import fields # cybox from cybox.core import Observables # internal import stix from stix.common import StructuredTextList, VocabString from stix.common.vocabs import AttackerInfrast...
[ { "content": "```python\n#!/usr/bin/env python\n\"\"\"Determine single-source or multiple-source reachability in a digraph\"\"\"\n#pylint: disable=invalid-name\n\nimport sys\nfrom os.path import join\nfrom AlgsSedgewickWayne.Digraph import Digraph\nfrom AlgsSedgewickWayne.DirectedDFS import DirectedDFS\nfrom Al...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n\"\"\"Determine single-source or multiple-source reachability in a digraph\"\"\"\n#pylint: disable=invalid-name\n\nimport sys\nfrom os.path import join\nfrom AlgsSedgewickWayne.Digraph import Digraph\nfrom AlgsSedgewickWayne.DirectedDFS import Dire...
```python #!/usr/bin/env python """Determine single-source or multiple-source reachability in a digraph""" #pylint: disable=invalid-name import sys from os.path import join from AlgsSedgewickWayne.Digraph import Digraph from AlgsSedgewickWayne.DirectedDFS import DirectedDFS from AlgsSedgewickWayne.testcode.InputArgs i...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\nimport json\nfrom django.http import HttpResponse\n\n\nclass AjaxableResponseMixin(object):\n \"\"\"\n Mixin to add AJAX support to a form.\n Must be used with an object-based FormView (e.g. CreateView)\...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\nimport json\nfrom django.http import HttpResponse\n\n\nclass AjaxableResponseMixin(object):\n \"\"\"\n Mixin to add AJAX support to a form.\n Must be used with an object-based FormView (e...
```python import json from django.http import HttpResponse class AjaxableResponseMixin(object): """ Mixin to add AJAX support to a form. Must be used with an object-based FormView (e.g. CreateView) """ def render_to_json_response(self, context, **response_kwargs): data = json.dumps(context...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\nimport numpy as np\nimport pytest\nfrom rig.type_casts import (\n float_to_fix, fix_to_float,\n float_to_fp, fp_to_float,\n NumpyFloatToFixConverter, NumpyFixToFloatConverter\n)\nimport struct\n\nsz = {\n 8: 'b',\n 16: '...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\nimport numpy as np\nimport pytest\nfrom rig.type_casts import (\n float_to_fix, fix_to_float,\n float_to_fp, fp_to_float,\n NumpyFloatToFixConverter, NumpyFixToFloatConverter\n)\nimport struct\n\nsz = {\n 8:...
```python import numpy as np import pytest from rig.type_casts import ( float_to_fix, fix_to_float, float_to_fp, fp_to_float, NumpyFloatToFixConverter, NumpyFixToFloatConverter ) import struct sz = { 8: 'b', 16: 'h', 32: 'i', } SZ = {k: v.upper() for k, v in sz.items()} class TestFloatToFix(o...
[ { "content": "Replicate the source code:\n```python\nfrom pygments.lexer import RegexLexer, bygroups, include\nfrom pygments.token import *\n\nclass BlogLexer(RegexLexer):\n name = 'BLOG'\n aliases = ['blog']\n filenames = ['*.blog', '*.dblog']\n operators = ['\\\\-\\\\>', ':', '\\\\+', '\\\\-', '\\\\*', '/...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\nfrom pygments.lexer import RegexLexer, bygroups, include\nfrom pygments.token import *\n\nclass BlogLexer(RegexLexer):\n name = 'BLOG'\n aliases = ['blog']\n filenames = ['*.blog', '*.dblog']\n operators = ['\\\\-\\\\>', ':', '\\\\+', '\\\...
```python from pygments.lexer import RegexLexer, bygroups, include from pygments.token import * class BlogLexer(RegexLexer): name = 'BLOG' aliases = ['blog'] filenames = ['*.blog', '*.dblog'] operators = ['\\-\\>', ':', '\\+', '\\-', '\\*', '/', '\\[', ']', '\\{', '}', '!', '\\<', '\\>', '\\<=', '\\>...
[ { "content": "Replicate the source code:\n```python\n# Copyright (c) 2007 The Hewlett-Packard Development Company\n# All rights reserved.\n#\n# The license below extends only to copyright in the software and shall\n# not be construed as granting a license to any other intellectual\n# property including but not ...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n# Copyright (c) 2007 The Hewlett-Packard Development Company\n# All rights reserved.\n#\n# The license below extends only to copyright in the software and shall\n# not be construed as granting a license to any other intellectual\n# property in...
```python # Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardwar...
[ { "content": "Replicate the source code:\n```python\n\"\"\"This module contains all functionality on the level of a single audio file.\n\"\"\"\n\nfrom __future__ import print_function\nfrom audiorename.meta import Meta, dict_diff\nfrom phrydy.utils import as_string\nfrom tmep import Functions\nfrom tmep import ...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n\"\"\"This module contains all functionality on the level of a single audio file.\n\"\"\"\n\nfrom __future__ import print_function\nfrom audiorename.meta import Meta, dict_diff\nfrom phrydy.utils import as_string\nfrom tmep import Functions\nf...
```python """This module contains all functionality on the level of a single audio file. """ from __future__ import print_function from audiorename.meta import Meta, dict_diff from phrydy.utils import as_string from tmep import Functions from tmep import Template import errno import os import phrydy import re import s...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\nimport sqlite3\nimport urllib\nimport re\nfrom urllib.request import urlopen\nfrom bs4 import BeautifulSoup\n\n\ndef main():\n # The collection URL below.\n collURL = 'http://www.thelatinlibrary.com/germanicus.html'\n coll...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\nimport sqlite3\nimport urllib\nimport re\nfrom urllib.request import urlopen\nfrom bs4 import BeautifulSoup\n\n\ndef main():\n # The collection URL below.\n collURL = 'http://www.thelatinlibrary.com/germanicus...
```python import sqlite3 import urllib import re from urllib.request import urlopen from bs4 import BeautifulSoup def main(): # The collection URL below. collURL = 'http://www.thelatinlibrary.com/germanicus.html' collOpen = urllib.request.urlopen(collURL) collSOUP = BeautifulSoup(collOpen, 'html5lib')...
[ { "content": "```python\n\"\"\"Test code for binary neural network operators.\"\"\"\nimport numpy as np\nimport tvm\nimport topi\nfrom topi.util import get_const_tuple\nfrom tvm.contrib.pickle_memoize import memoize\n\n\ndef verify_binary_dense(batch, in_dim, out_dim):\n A = tvm.placeholder((batch, in_dim), ...
[ { "content": "<|memory_start|>```python\n\"\"\"Test code for binary neural network operators.\"\"\"\nimport numpy as np\nimport tvm\nimport topi\nfrom topi.util import get_const_tuple\nfrom tvm.contrib.pickle_memoize import memoize\n\n\ndef verify_binary_dense(batch, in_dim, out_dim):\n A = tvm.placeholder((...
```python """Test code for binary neural network operators.""" import numpy as np import tvm import topi from topi.util import get_const_tuple from tvm.contrib.pickle_memoize import memoize def verify_binary_dense(batch, in_dim, out_dim): A = tvm.placeholder((batch, in_dim), name='A') B = tvm.placeholder((out...
[ { "content": "Here is the snippet:\n```python\n#!/usr/bin/python\nimport pyman\nfrom os import getcwd, path\n\n\nclass VM( pyman.Page ):\n def __init__( self, pkg ):\n super( VM, self ).__init__( \"VM\" )\n self.host = None\n self.pkg = pkg\n self.dir = path.split( getcwd() )[1]\...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n#!/usr/bin/python\nimport pyman\nfrom os import getcwd, path\n\n\nclass VM( pyman.Page ):\n def __init__( self, pkg ):\n super( VM, self ).__init__( \"VM\" )\n self.host = None\n self.pkg = pkg\n self.dir = path.split...
```python #!/usr/bin/python import pyman from os import getcwd, path class VM( pyman.Page ): def __init__( self, pkg ): super( VM, self ).__init__( "VM" ) self.host = None self.pkg = pkg self.dir = path.split( getcwd() )[1] def choices( self ): if not self.actions: ...
[ { "content": "Repeat the code exactly:\n```python\nimport cv2\nimport numpy\nfrom alpha_fill import alpha_fill\n\nclass BoundingBox(object):\n\n def __init__(self, pil_img, show_plot=False):\n self.mask_img = alpha_fill(pil_img)\n self.set_bounding_box()\n self.set_side_lengths()\n\n ...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\nimport cv2\nimport numpy\nfrom alpha_fill import alpha_fill\n\nclass BoundingBox(object):\n\n def __init__(self, pil_img, show_plot=False):\n self.mask_img = alpha_fill(pil_img)\n self.set_bounding_box()\n self.set_side_l...
```python import cv2 import numpy from alpha_fill import alpha_fill class BoundingBox(object): def __init__(self, pil_img, show_plot=False): self.mask_img = alpha_fill(pil_img) self.set_bounding_box() self.set_side_lengths() self.set_areas() if show_plot: self...
[ { "content": "Repeat the following code:\n```python\n# -*- coding: utf-8 -*-\n\nfrom copy import deepcopy\n\nimport pytest\n\nfrom pydash._compat import iteritems\n\n\n# pytest.mark is a generator so create alias for convenience\nparametrize = pytest.mark.parametrize\n\n\nclass Object(object):\n def __init__...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nfrom copy import deepcopy\n\nimport pytest\n\nfrom pydash._compat import iteritems\n\n\n# pytest.mark is a generator so create alias for convenience\nparametrize = pytest.mark.parametrize\n\n\nclass Object(object):\n...
```python # -*- coding: utf-8 -*- from copy import deepcopy import pytest from pydash._compat import iteritems # pytest.mark is a generator so create alias for convenience parametrize = pytest.mark.parametrize class Object(object): def __init__(self, **attrs): for key, value in iteritems(attrs): ...
[ { "content": "```python\nimport os\n\nfrom flask import Flask, render_template\nfrom alexandria.extensions import db, migrate, bcrypt, login_manager\n\nfrom alexandria.models import users, documentlinks\n\ndef create_app(config_setting='dev'):\n \"\"\"An application factory, as explained here:\n http:...
[ { "content": "<|memory_start|>```python\nimport os\n\nfrom flask import Flask, render_template\nfrom alexandria.extensions import db, migrate, bcrypt, login_manager\n\nfrom alexandria.models import users, documentlinks\n\ndef create_app(config_setting='dev'):\n \"\"\"An application factory, as explained here...
```python import os from flask import Flask, render_template from alexandria.extensions import db, migrate, bcrypt, login_manager from alexandria.models import users, documentlinks def create_app(config_setting='dev'): """An application factory, as explained here: http://flask.pocoo.org/docs/patterns/app...
[ { "content": "Here is the script:\n```python\n#!/usr/bin/python2\n\"\"\"\nRuns a validation command on the provided file, and generates an Event from\nthe results.\n\nIf a format has no defined validation commands, no command is run.\n\"\"\"\nfrom __future__ import print_function\nimport ast\nimport sys\n\n# ar...
[ { "content": "Here is the script:\n<|memory_start|>```python\n#!/usr/bin/python2\n\"\"\"\nRuns a validation command on the provided file, and generates an Event from\nthe results.\n\nIf a format has no defined validation commands, no command is run.\n\"\"\"\nfrom __future__ import print_function\nimport ast\nim...
```python #!/usr/bin/python2 """ Runs a validation command on the provided file, and generates an Event from the results. If a format has no defined validation commands, no command is run. """ from __future__ import print_function import ast import sys # archivematicaCommon from custom_handlers import get_script_logg...
[ { "content": "Write the code verbatim:\n```python\n#!usr/bin/python\n# -*- coding: utf-8-*-\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 the\n# Free Software Foundation; either version 3, or (at your option) any l...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n#!usr/bin/python\n# -*- coding: utf-8-*-\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 the\n# Free Software Foundation; either version 3, or (at yo...
```python #!usr/bin/python # -*- coding: utf-8-*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3, or (at your option) any later # version. # # This program is distributed in th...
[ { "content": "```python\nfrom django.conf.urls import url, include, patterns\nfrom django.contrib import admin\nfrom django.conf import settings\n\nhandler403 = 'core.views.forbidden'\nhandler404 = 'core.views.page_not_found'\nhandler500 = 'core.views.server_error'\n\nurlpatterns = patterns(\n 'core.views',\...
[ { "content": "<|memory_start|>```python\nfrom django.conf.urls import url, include, patterns\nfrom django.contrib import admin\nfrom django.conf import settings\n\nhandler403 = 'core.views.forbidden'\nhandler404 = 'core.views.page_not_found'\nhandler500 = 'core.views.server_error'\n\nurlpatterns = patterns(\n ...
```python from django.conf.urls import url, include, patterns from django.contrib import admin from django.conf import settings handler403 = 'core.views.forbidden' handler404 = 'core.views.page_not_found' handler500 = 'core.views.server_error' urlpatterns = patterns( 'core.views', # api urls - WARNING: Do NO...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n\nfrom unittest import mock\n\nimport jinja2\nimport pytest\n\nfrom wt import jinja\n\n\ndef describe_Registry():\n\n def must_properly_register_filter(jinja_registry):\n\n assert len(list(jinja_registry)) == 0\n\n def fltr(d):\n retu...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nfrom unittest import mock\n\nimport jinja2\nimport pytest\n\nfrom wt import jinja\n\n\ndef describe_Registry():\n\n def must_properly_register_filter(jinja_registry):\n\n assert len(list(jinja_registry)) == 0\n\n def fltr(d):\n...
```python # -*- coding: utf-8 -*- from unittest import mock import jinja2 import pytest from wt import jinja def describe_Registry(): def must_properly_register_filter(jinja_registry): assert len(list(jinja_registry)) == 0 def fltr(d): return d res = jinja_registry.add(f...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n#!/usr/bin/env python\n# -------------------------------------------------------------------\n# File Name : create_dataset_events.py\n# Creation Date : 05-12-2016\n# Last Modified : Fri Jan 6 15:04:54 2017\n# Author: Thibaut Perol <tp...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n#!/usr/bin/env python\n# -------------------------------------------------------------------\n# File Name : create_dataset_events.py\n# Creation Date : 05-12-2016\n# Last Modified : Fri Jan 6 15:04:54 2017\n# Author: T...
```python #!/usr/bin/env python # ------------------------------------------------------------------- # File Name : create_dataset_events.py # Creation Date : 05-12-2016 # Last Modified : Fri Jan 6 15:04:54 2017 # Author: Thibaut Perol <tperol@g.harvard.edu> # ----------------------------------------------------------...
[ { "content": "Repeat the code exactly:\n```python\n#!/usr/bin/env python\n\n\n\n\n##################################################\n## DEPENDENCIES\nimport sys\nimport os\nimport os.path\ntry:\n import builtins as builtin\nexcept ImportError:\n import __builtin__ as builtin\nfrom os.path import getmtime...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n\n\n\n##################################################\n## DEPENDENCIES\nimport sys\nimport os\nimport os.path\ntry:\n import builtins as builtin\nexcept ImportError:\n import __builtin__ as builtin\nfrom os.path...
```python #!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import M...
[ { "content": "```python\n#----------------------------------------------------------------------\n# Purpose: This test compares k-means centers between H2O and MLlib.\n#----------------------------------------------------------------------\n\nimport sys\nsys.path.insert(1, \"../../\")\nimport h2o\nimport numpy...
[ { "content": "<|memory_start|>```python\n#----------------------------------------------------------------------\n# Purpose: This test compares k-means centers between H2O and MLlib.\n#----------------------------------------------------------------------\n\nimport sys\nsys.path.insert(1, \"../../\")\nimport h...
```python #---------------------------------------------------------------------- # Purpose: This test compares k-means centers between H2O and MLlib. #---------------------------------------------------------------------- import sys sys.path.insert(1, "../../") import h2o import numpy as np def kmeans_mllib(ip, por...
[ { "content": "Reconstruct the code exactly:\n```python\n__author__ = \"Christian Kongsgaard\"\n__license__ = 'MIT'\n\n# -------------------------------------------------------------------------------------------------------------------- #\n# IMPORTS\n\n# Modules\nimport pytest\nimport numpy as np\n\n# RiBuild M...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n__author__ = \"Christian Kongsgaard\"\n__license__ = 'MIT'\n\n# -------------------------------------------------------------------------------------------------------------------- #\n# IMPORTS\n\n# Modules\nimport pytest\nimport numpy as n...
```python __author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules import pytest import numpy as np # RiBuild Modules from delphin_6_automation.delphin_setup import weather_mode...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n# -*- coding: utf-8 -*-\n# Copyright (C) 2008-2010, 2013-2015 Rocky Bernstein <rocky@gnu.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public Licen...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Copyright (C) 2008-2010, 2013-2015 Rocky Bernstein <rocky@gnu.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Gene...
```python # -*- coding: utf-8 -*- # Copyright (C) 2008-2010, 2013-2015 Rocky Bernstein <rocky@gnu.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, ...
[ { "content": "```python\n# This file is part of the myhdl library, a Python package for using\n# Python as a Hardware Description Language.\n#\n# Copyright (C) 2003-2008 Jan Decaluwe\n#\n# The myhdl library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser Gene...
[ { "content": "<|memory_start|>```python\n# This file is part of the myhdl library, a Python package for using\n# Python as a Hardware Description Language.\n#\n# Copyright (C) 2003-2008 Jan Decaluwe\n#\n# The myhdl library is free software; you can redistribute it and/or\n# modify it under the terms of the...
```python # This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2008 Jan Decaluwe # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # publ...
[ { "content": "Repeat the full code snippet:\n```python\nimport sys\nimport pylab as plt\nsys.path.append(\"/mnt/brand01-00/mbrand_analysis/lib/matplotlib_venn/\")\nfrom venn3 import venn3, venn3_circles\nfrom venn_util import venn3_unweighted, venn2_unweighted\nimport itertools\nfrom subsetClass import subsetW...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\nimport sys\nimport pylab as plt\nsys.path.append(\"/mnt/brand01-00/mbrand_analysis/lib/matplotlib_venn/\")\nfrom venn3 import venn3, venn3_circles\nfrom venn_util import venn3_unweighted, venn2_unweighted\nimport itertools\nfrom subsetClas...
```python import sys import pylab as plt sys.path.append("/mnt/brand01-00/mbrand_analysis/lib/matplotlib_venn/") from venn3 import venn3, venn3_circles from venn_util import venn3_unweighted, venn2_unweighted import itertools from subsetClass import subsetWraper class buildVennDiagram(): def __init__(self,data): ...
[ { "content": "Here is the snippet:\n```python\nfrom __future__ import print_function\n\nimport os\n\nfrom IPython.display import display, HTML, Javascript\n\nleaflet_css = '//cdn.leafletjs.com/leaflet-0.7.2/leaflet.css'\n# leaftlet_js = \"//cdn.leafletjs.com/leaflet-0.7.2/leaflet\"\n\n# leaflet_draw_js = ['//cd...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\nfrom __future__ import print_function\n\nimport os\n\nfrom IPython.display import display, HTML, Javascript\n\nleaflet_css = '//cdn.leafletjs.com/leaflet-0.7.2/leaflet.css'\n# leaftlet_js = \"//cdn.leafletjs.com/leaflet-0.7.2/leaflet\"\n\n# leaflet_...
```python from __future__ import print_function import os from IPython.display import display, HTML, Javascript leaflet_css = '//cdn.leafletjs.com/leaflet-0.7.2/leaflet.css' # leaftlet_js = "//cdn.leafletjs.com/leaflet-0.7.2/leaflet" # leaflet_draw_js = ['//cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.2.3/leaflet....
[ { "content": "```python\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ...
[ { "content": "<|memory_start|>```python\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# ...
```python # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[ { "content": "Provide a verbatim copy of the code:\n```python\n# Copyright 2020 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:/...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n# Copyright 2020 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\...
```python # Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nimport o...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2...
```python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import sys from metadata import MetadataUpdateRunner from sync import SyncFromUpstreamRunner from t...
[ { "content": "Provide an exact copy of the source code:\n```python\n# -*- coding: utf-8 -*-\nfrom django.core.files.base import ContentFile\nimport os\nfrom photologue.models import Photo, PhotoSizeCache\nfrom photologue.tests.helpers import PhotologueBaseTest, SQUARE_IMAGE_PATH, PORTRAIT_IMAGE_PATH\n\nclass Im...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom django.core.files.base import ContentFile\nimport os\nfrom photologue.models import Photo, PhotoSizeCache\nfrom photologue.tests.helpers import PhotologueBaseTest, SQUARE_IMAGE_PATH, PORTRAIT_IMAGE_...
```python # -*- coding: utf-8 -*- from django.core.files.base import ContentFile import os from photologue.models import Photo, PhotoSizeCache from photologue.tests.helpers import PhotologueBaseTest, SQUARE_IMAGE_PATH, PORTRAIT_IMAGE_PATH class ImageResizeTest(PhotologueBaseTest): def setUp(self): super(Im...
[ { "content": "Recreate the original code text:\n```python\n# -*- coding: utf-8 -*-\n# <Lettuce - Behaviour Driven Development for python>\n# Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the ...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# <Lettuce - Behaviour Driven Development for python>\n# Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under t...
```python # -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software...
[ { "content": "Here is a code snippet:\n```python\n# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n#\n# Cod...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license inform...
```python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. ...
[ { "content": "```python\n# The following parse_* methods are from bitcoin-abe\n\nimport base58\n\ndef parse_TxIn(vds):\n d = {}\n d['prevout_hash'] = vds.read_bytes(32)\n d['prevout_n'] = vds.read_uint32()\n d['scriptSig'] = vds.read_bytes(vds.read_compact_size())\n d['sequence'] = vds.read_uint32()\n ret...
[ { "content": "<|memory_start|>```python\n# The following parse_* methods are from bitcoin-abe\n\nimport base58\n\ndef parse_TxIn(vds):\n d = {}\n d['prevout_hash'] = vds.read_bytes(32)\n d['prevout_n'] = vds.read_uint32()\n d['scriptSig'] = vds.read_bytes(vds.read_compact_size())\n d['sequence'] = vds.read...
```python # The following parse_* methods are from bitcoin-abe import base58 def parse_TxIn(vds): d = {} d['prevout_hash'] = vds.read_bytes(32) d['prevout_n'] = vds.read_uint32() d['scriptSig'] = vds.read_bytes(vds.read_compact_size()) d['sequence'] = vds.read_uint32() return d def parse_TxOut(vds): d ...
[ { "content": "Repeat the full code snippet:\n```python\n\"\"\"\n * Copyright (c) 2008 Zivios, LLC.\n *\n * This file is part of Zivios.\n *\n * Zivios 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...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n\"\"\"\n * Copyright (c) 2008 Zivios, LLC.\n *\n * This file is part of Zivios.\n *\n * Zivios 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 Sof...
```python """ * Copyright (c) 2008 Zivios, LLC. * * This file is part of Zivios. * * Zivios is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any la...
[ { "content": "```python\nfrom decimal import Decimal\nfrom django.db import models\nfrom django.core.validators import MinValueValidator\nfrom ..notifications.models import NotificationMessage\nfrom ..users.models import User\n\nclass Answer(models.Model):\n question = models.ForeignKey('contests.contest', r...
[ { "content": "<|memory_start|>```python\nfrom decimal import Decimal\nfrom django.db import models\nfrom django.core.validators import MinValueValidator\nfrom ..notifications.models import NotificationMessage\nfrom ..users.models import User\n\nclass Answer(models.Model):\n question = models.ForeignKey('cont...
```python from decimal import Decimal from django.db import models from django.core.validators import MinValueValidator from ..notifications.models import NotificationMessage from ..users.models import User class Answer(models.Model): question = models.ForeignKey('contests.contest', related_name='answer', ...
[ { "content": "```python\n#!/usr/bin/python\n# -*- coding: UTF-8 -*-\n\n\n# Plese delete 'system.db' before running this module\n# This is a temporary solution, i will add suport to the android app later on\n# But it is still very useful if you keen to add device though this method\n\nimport utils.device as Devi...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/python\n# -*- coding: UTF-8 -*-\n\n\n# Plese delete 'system.db' before running this module\n# This is a temporary solution, i will add suport to the android app later on\n# But it is still very useful if you keen to add device though this method\n\nimport util...
```python #!/usr/bin/python # -*- coding: UTF-8 -*- # Plese delete 'system.db' before running this module # This is a temporary solution, i will add suport to the android app later on # But it is still very useful if you keen to add device though this method import utils.device as Device # Example format: Device.add...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n#\n# bluetooth_config.py\n#\n# Copyright (C) 2016 - 2018 Kano Computing Ltd.\n# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2\n#\n# Bluetooth setup screen\n#\n\nimport os\nimport threading\n\nfrom gi import require_version...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n#\n# bluetooth_config.py\n#\n# Copyright (C) 2016 - 2018 Kano Computing Ltd.\n# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2\n#\n# Bluetooth setup screen\n#\n\nimport os\nimport threading\n\nfrom gi import...
```python # # bluetooth_config.py # # Copyright (C) 2016 - 2018 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2 # # Bluetooth setup screen # import os import threading from gi import require_version require_version('Gtk', '3.0') from gi.repository import Gtk, GObject from kano.gtk3....
[ { "content": "Here is a code file:\n```python\n# #\n# Copyright 2013-2016 Ghent University\n#\n# This file is part of EasyBuild,\n# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),\n# with support of Ghent University (http://ugent.be/hpc),\n# the Flemish Supercomputer Centre (VSC...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# #\n# Copyright 2013-2016 Ghent University\n#\n# This file is part of EasyBuild,\n# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),\n# with support of Ghent University (http://ugent.be/hpc),\n# the Flemish Supercomp...
```python # # # Copyright 2013-2016 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Fo...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\nimport json\nimport requests\nfrom bs4 import BeautifulSoup\nfrom .payload import Payload, Author, Affiliation\nfrom metadata import nmd\nfrom metadata import bioaging\nimport re\n\n\ndef map(url):\n meta = Payload(...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\nimport json\nimport requests\nfrom bs4 import BeautifulSoup\nfrom .payload import Payload, Author, Affiliation\nfrom metadata import nmd\nfrom metadata import bioaging\nimport re\n\n\ndef map(url):\n ...
```python import json import requests from bs4 import BeautifulSoup from .payload import Payload, Author, Affiliation from metadata import nmd from metadata import bioaging import re def map(url): meta = Payload() headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/5...
[ { "content": "Here is the snippet:\n```python\nimport os\nimport io\nimport itertools\nimport types\nfrom ochre.Sequence import Seq\n\n\nclass SeqList(object):\n \"\"\"\n A Python object that represents a collection of sequences.\n The underlying storage can be in a file (through the\n subclass File...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\nimport os\nimport io\nimport itertools\nimport types\nfrom ochre.Sequence import Seq\n\n\nclass SeqList(object):\n \"\"\"\n A Python object that represents a collection of sequences.\n The underlying storage can be in a file (through the\n ...
```python import os import io import itertools import types from ochre.Sequence import Seq class SeqList(object): """ A Python object that represents a collection of sequences. The underlying storage can be in a file (through the subclass FileSeqList) or in a list of Seq objects. """ def __new...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n# -*- coding: utf-8 -*-\n# Copyright 2012 Loris Corazza, Sakis Christakidis\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.\...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Copyright 2012 Loris Corazza, Sakis Christakidis\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance wi...
```python # -*- coding: utf-8 -*- # Copyright 2012 Loris Corazza, Sakis Christakidis # # 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...
[ { "content": "Here is the snippet:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.testsuite.cache\n ~~~~~~~~~~~~~~~~~~~~~~~~\n\n Tests the cache system\n\n :copyright: (c) 2014 by Armin Ronacher.\n :license: BSD, see LICENSE for more details.\n\"\"\"\nimport os\nimport time\nimport unitte...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.testsuite.cache\n ~~~~~~~~~~~~~~~~~~~~~~~~\n\n Tests the cache system\n\n :copyright: (c) 2014 by Armin Ronacher.\n :license: BSD, see LICENSE for more details.\n\"\"\"\nimport os\nimport tim...
```python # -*- coding: utf-8 -*- """ werkzeug.testsuite.cache ~~~~~~~~~~~~~~~~~~~~~~~~ Tests the cache system :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import time import unittest import tempfile import shutil from werkzeug.testsuite impor...
[ { "content": "```python\n# Generated by Django 2.1.2 on 2018-10-26 17:19\n\nfrom django.db import migrations, models\nimport django.utils.timezone\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('core', '0013_user_terms_accepted'),\n ]\n\n operations = [\n migrations.A...
[ { "content": "<|memory_start|>```python\n# Generated by Django 2.1.2 on 2018-10-26 17:19\n\nfrom django.db import migrations, models\nimport django.utils.timezone\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('core', '0013_user_terms_accepted'),\n ]\n\n operations = [\n ...
```python # Generated by Django 2.1.2 on 2018-10-26 17:19 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('core', '0013_user_terms_accepted'), ] operations = [ migrations.AddField( model_name='org...
[ { "content": "Repeat the following code:\n```python\n#Program using word problems to demonstrate math and number operators\n\nprint(\"If a 2000 pound pregnant hippo gives birth to a 100 pound calf,\")\nprint(\"but then eats 50 pounds of food, how much does she weigh?\")\ninput(\"Press the enter key to find out....
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n#Program using word problems to demonstrate math and number operators\n\nprint(\"If a 2000 pound pregnant hippo gives birth to a 100 pound calf,\")\nprint(\"but then eats 50 pounds of food, how much does she weigh?\")\ninput(\"Press the enter ...
```python #Program using word problems to demonstrate math and number operators print("If a 2000 pound pregnant hippo gives birth to a 100 pound calf,") print("but then eats 50 pounds of food, how much does she weigh?") input("Press the enter key to find out.") print("2000 - 100 + 50 = ", 2000 - 100 + 50) print("\nIf...
[ { "content": "```python\n# -*- coding: utf-8 -*-\nimport sys\nimport os\nimport urllib\nimport urlparse\nimport xbmc\nimport xbmcgui\nimport xbmcplugin\nimport xbmcaddon\n\nif sys.version_info < (2, 7):\n import simplejson\nelse:\n import json as simplejson\n\n# Import the common settings\nfrom resources....
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport sys\nimport os\nimport urllib\nimport urlparse\nimport xbmc\nimport xbmcgui\nimport xbmcplugin\nimport xbmcaddon\n\nif sys.version_info < (2, 7):\n import simplejson\nelse:\n import json as simplejson\n\n# Import the common settings\...
```python # -*- coding: utf-8 -*- import sys import os import urllib import urlparse import xbmc import xbmcgui import xbmcplugin import xbmcaddon if sys.version_info < (2, 7): import simplejson else: import json as simplejson # Import the common settings from resources.lib.settings import Settings from resou...
[ { "content": "Here is a code snippet:\n```python\n#!/opt/local/bin/python\nimport os\nimport sys\nimport re\nimport fnmatch\nPROJECT_NAME = \"KExperiment\"\n\nsource_reg = re.compile(\".*\\.(cpp|h)$\")\ntask_reg = re.compile(\"^\\s*/+\\s*(TODO|FIXME|BUG|NOTE|HACK):?\\s*(.*)$\", re.I)\n\nsource_match = source_re...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n#!/opt/local/bin/python\nimport os\nimport sys\nimport re\nimport fnmatch\nPROJECT_NAME = \"KExperiment\"\n\nsource_reg = re.compile(\".*\\.(cpp|h)$\")\ntask_reg = re.compile(\"^\\s*/+\\s*(TODO|FIXME|BUG|NOTE|HACK):?\\s*(.*)$\", re.I)\n\nsource_m...
```python #!/opt/local/bin/python import os import sys import re import fnmatch PROJECT_NAME = "KExperiment" source_reg = re.compile(".*\.(cpp|h)$") task_reg = re.compile("^\s*/+\s*(TODO|FIXME|BUG|NOTE|HACK):?\s*(.*)$", re.I) source_match = source_reg.match task_match = task_reg.match def main(): output = os.pat...
[ { "content": "Here is a code file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\" Provides new permission policies for django-rest-framework\n\"\"\"\n\nfrom rest_framework.permissions import DjangoModelPermissions, BasePermission\nfrom django.contrib.contenttypes.models import ContentType\nfrom rest_framework_fi...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n\"\"\" Provides new permission policies for django-rest-framework\n\"\"\"\n\nfrom rest_framework.permissions import DjangoModelPermissions, BasePermission\nfrom django.contrib.contenttypes.models import ContentType\nfrom r...
```python # -*- coding: utf-8 -*- """ Provides new permission policies for django-rest-framework """ from rest_framework.permissions import DjangoModelPermissions, BasePermission from django.contrib.contenttypes.models import ContentType from rest_framework_fine_permissions.models import FilterPermissionModel from dj...
[ { "content": "Replicate the source code:\n```python\n# grammar.py, part of Yapps 2 - yet another python parser system\n# Copyright 1999-2003 by Amit J. Patel <amitp@cs.stanford.edu>\n# Enhancements copyright 2003-2004 by Matthias Urlichs <smurf@debian.org>\n#\n# This version of the Yapps 2 grammar can be distri...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n# grammar.py, part of Yapps 2 - yet another python parser system\n# Copyright 1999-2003 by Amit J. Patel <amitp@cs.stanford.edu>\n# Enhancements copyright 2003-2004 by Matthias Urlichs <smurf@debian.org>\n#\n# This version of the Yapps 2 gramm...
```python # grammar.py, part of Yapps 2 - yet another python parser system # Copyright 1999-2003 by Amit J. Patel <amitp@cs.stanford.edu> # Enhancements copyright 2003-2004 by Matthias Urlichs <smurf@debian.org> # # This version of the Yapps 2 grammar can be distributed under the # terms of the MIT open source license,...
[ { "content": "Provide an exact copy of the source code:\n```python\nimport sys\nimport os\nimport re\nimport textwrap\nimport pytest\nfrom doctest import OutputChecker, ELLIPSIS\n\nfrom tests.lib import _create_test_package, _create_test_package_with_srcdir\n\n\ndistribute_re = re.compile('^distribute==[0-9.]+\...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nimport sys\nimport os\nimport re\nimport textwrap\nimport pytest\nfrom doctest import OutputChecker, ELLIPSIS\n\nfrom tests.lib import _create_test_package, _create_test_package_with_srcdir\n\n\ndistribute_re = re.compile('^dist...
```python import sys import os import re import textwrap import pytest from doctest import OutputChecker, ELLIPSIS from tests.lib import _create_test_package, _create_test_package_with_srcdir distribute_re = re.compile('^distribute==[0-9.]+\n', re.MULTILINE) def _check_output(result, expected): checker = Outpu...
[ { "content": "Here is the script:\n```python\n\"\"\"\nPyroman uses some standard chains, set in it's config.\nThese chains are used by the \"allow()\", \"reject()\" and \"drop()\" commandos\nfor nicer rule writing, and probably should do exactly that.\n\nIf you want maximal performance, you'll want to change th...
[ { "content": "Here is the script:\n<|memory_start|>```python\n\"\"\"\nPyroman uses some standard chains, set in it's config.\nThese chains are used by the \"allow()\", \"reject()\" and \"drop()\" commandos\nfor nicer rule writing, and probably should do exactly that.\n\nIf you want maximal performance, you'll w...
```python """ Pyroman uses some standard chains, set in it's config. These chains are used by the "allow()", "reject()" and "drop()" commandos for nicer rule writing, and probably should do exactly that. If you want maximal performance, you'll want to change these to ACCEPT and DROP directly by calling 'Firewall.accep...
[ { "content": "```python\n#some import\r\nimport numpy\r\nimport itertools\r\nimport random\r\nimport math\r\nimport os.path\r\nimport urllib2\r\nimport sys\r\n\r\n#global variables\r\nn = None\r\nN = None\r\nDk = None\r\nDu = None\r\nDc = None\r\ne = None\r\nr = None\r\nx = None\r\nxa = None\r\nASW = None\r\nEX...
[ { "content": "<|memory_start|>```python\n#some import\r\nimport numpy\r\nimport itertools\r\nimport random\r\nimport math\r\nimport os.path\r\nimport urllib2\r\nimport sys\r\n\r\n#global variables\r\nn = None\r\nN = None\r\nDk = None\r\nDu = None\r\nDc = None\r\ne = None\r\nr = None\r\nx = None\r\nxa = None\r\n...
```python #some import import numpy import itertools import random import math import os.path import urllib2 import sys #global variables n = None N = None Dk = None Du = None Dc = None e = None r = None x = None xa = None ASW = None EXC = None INS = None pASW = None pEXC = None pINS = None ...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\n# (C) British Crown Copyright 2014, Met Office\n#\n# This file is part of Iris.\n#\n# Iris is free software: you can redistribute it and/or modify it under\n# the terms of the GNU Lesser General Public License as published by the\n...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n# (C) British Crown Copyright 2014, Met Office\n#\n# This file is part of Iris.\n#\n# Iris is free software: you can redistribute it and/or modify it under\n# the terms of the GNU Lesser General Public License as pu...
```python # (C) British Crown Copyright 2014, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) an...
[ { "content": "Here is some code:\n```python\n#!/usr/bin/env python\n# -*- coding: latin-1 -*-\nimport sys, os\n\nfrom optparse import OptionParser, OptionGroup\nimport xml.etree.ElementTree as ET\n\n## Importing Utils from parent path\nfile_path = os.path.dirname(__file__)\njoin_path = os.path.join(file_path, '...
[ { "content": "Here is some code:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: latin-1 -*-\nimport sys, os\n\nfrom optparse import OptionParser, OptionGroup\nimport xml.etree.ElementTree as ET\n\n## Importing Utils from parent path\nfile_path = os.path.dirname(__file__)\njoin_path = os.path.j...
```python #!/usr/bin/env python # -*- coding: latin-1 -*- import sys, os from optparse import OptionParser, OptionGroup import xml.etree.ElementTree as ET ## Importing Utils from parent path file_path = os.path.dirname(__file__) join_path = os.path.join(file_path, '../Utils') abs_path = os.path.abspath(join_path) sy...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n# -*- coding: utf-8 -*-\n# Copyright 2009-2017 Noviat\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n\nimport calendar\nfrom datetime import datetime\nfrom dateutil.relativedelta import relativedelta\nimport logging\...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Copyright 2009-2017 Noviat\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n\nimport calendar\nfrom datetime import datetime\nfrom dateutil.relativedelta import relativedelta\...
```python # -*- coding: utf-8 -*- # Copyright 2009-2017 Noviat # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import calendar from datetime import datetime from dateutil.relativedelta import relativedelta import logging from sys import exc_info from traceback import format_exception from openerp impo...
[ { "content": "Reconstruct the code exactly:\n```python\n#\n# Project Kimchi\n#\n# Copyright IBM, Corp. 2013\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n#\n# Project Kimchi\n#\n# Copyright IBM, Corp. 2013\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; e...
```python # # Project Kimchi # # Copyright IBM, Corp. 2013 # # This library 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 2.1 of the License, or (at your option) any later version. # ...
[ { "content": "Here is a code file:\n```python\n#!/usr/bin/python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com>\n# See LICENSE for details.\n\nfrom hashlib import sha512\nfrom .openssl import OpenSSL\nfrom .cipher import Cipher\nfrom .hash import hma...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n#!/usr/bin/python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com>\n# See LICENSE for details.\n\nfrom hashlib import sha512\nfrom .openssl import OpenSSL\nfrom .cipher import Cipher\nfrom ...
```python #!/usr/bin/python #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com> # See LICENSE for details. from hashlib import sha512 from .openssl import OpenSSL from .cipher import Cipher from .hash import hmac_sha256, equals from struct import pack, unpack clas...
[ { "content": "Here is the snippet:\n```python\nfrom django.core.urlresolvers import reverse\n\nfrom rest_framework import status\nfrom rest_framework.test import APITestCase\n\n\nclass ComponentAuthenticationTest(APITestCase):\n fixtures = ['users.json', 'component_data.json']\n\n def test_noauthed_reject...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\nfrom django.core.urlresolvers import reverse\n\nfrom rest_framework import status\nfrom rest_framework.test import APITestCase\n\n\nclass ComponentAuthenticationTest(APITestCase):\n fixtures = ['users.json', 'component_data.json']\n\n def test...
```python from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.test import APITestCase class ComponentAuthenticationTest(APITestCase): fixtures = ['users.json', 'component_data.json'] def test_noauthed_rejects(self): url = reverse('component-detail', kwa...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2016 Fernando Hidalgo (http://www.hidalgofernando.com.ar)\n# All Rights Reserved.\n#\n# This program...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (C) 2016 Fernando Hidalgo (http://www.hidalgofernando.com.ar)\n# All Rights Reserved.\n#\n#...
```python # -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Fernando Hidalgo (http://www.hidalgofernando.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms ...
[ { "content": "```python\n# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\nclass Migration(SchemaMigration):\n\n def forwards(self, orm):\n \n # Adding field 'Project.project_type'\n db.add_column('project_p...
[ { "content": "<|memory_start|>```python\n# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\nclass Migration(SchemaMigration):\n\n def forwards(self, orm):\n \n # Adding field 'Project.project_type'\n db.add_c...
```python # encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Project.project_type' db.add_column('project_project', 'project_type', self.gf('...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n#!/usr/bin/env python2.7\n\"\"\"\\\nusage: pgctl-fuser [-d] file [file ...]\n\nShows the pids (of the current user) that have this file opened.\nThis is useful for finding which processes hold a file lock (flock).\nThi...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n#!/usr/bin/env python2.7\n\"\"\"\\\nusage: pgctl-fuser [-d] file [file ...]\n\nShows the pids (of the current user) that have this file opened.\nThis is useful for finding which processes hold a file lo...
```python #!/usr/bin/env python2.7 """\ usage: pgctl-fuser [-d] file [file ...] Shows the pids (of the current user) that have this file opened. This is useful for finding which processes hold a file lock (flock). This has the same behavior as `lsof -t file`, but is *much* faster. """ from __future__ import absolute_i...
[ { "content": "```python\n#!/usr/bin/env python\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 the License, or\n# (at your option) any later version.\n#\n# This ...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\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 the License, or\n# (at your option) any later vers...
```python #!/usr/bin/env python # 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 distributed in the ...
[ { "content": "Replicate the source code:\n```python\n# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>\n#\n# This file is part of Ansible\n#\n# Ansible is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundat...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>\n#\n# This file is part of Ansible\n#\n# Ansible is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free ...
```python # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your optio...
[ { "content": "```python\n# -*- coding: utf-8 -*-\nimport heapq # used for the so colled \"open list\" that stores known nodes\nimport time # for time limitation\nfrom pathfinding.core.util import SQRT2\nfrom pathfinding.core.diagonal_movement import DiagonalMovement\n\n\n# max. amount of tries we iterate unti...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport heapq # used for the so colled \"open list\" that stores known nodes\nimport time # for time limitation\nfrom pathfinding.core.util import SQRT2\nfrom pathfinding.core.diagonal_movement import DiagonalMovement\n\n\n# max. amount of tries...
```python # -*- coding: utf-8 -*- import heapq # used for the so colled "open list" that stores known nodes import time # for time limitation from pathfinding.core.util import SQRT2 from pathfinding.core.diagonal_movement import DiagonalMovement # max. amount of tries we iterate until we abort the search MAX_RUNS =...
[ { "content": "```python\nimport cv2\r\nimport numpy as np\r\nimport time\r\nfrom matplotlib import pyplot as plt\r\n\r\nx = 0\r\ny = 0\r\n\r\n\r\ndef makematchpicture(Grayurl):\r\n img = cv2.imread(Grayurl, 0)\r\n img2 = img.copy()\r\n template = cv2.imread('test.png', 0)\r\n w, h = template.shape[:...
[ { "content": "<|memory_start|>```python\nimport cv2\r\nimport numpy as np\r\nimport time\r\nfrom matplotlib import pyplot as plt\r\n\r\nx = 0\r\ny = 0\r\n\r\n\r\ndef makematchpicture(Grayurl):\r\n img = cv2.imread(Grayurl, 0)\r\n img2 = img.copy()\r\n template = cv2.imread('test.png', 0)\r\n w, h = ...
```python import cv2 import numpy as np import time from matplotlib import pyplot as plt x = 0 y = 0 def makematchpicture(Grayurl): img = cv2.imread(Grayurl, 0) img2 = img.copy() template = cv2.imread('test.png', 0) w, h = template.shape[::-1] methods = ['cv2.TM_SQDIFF'] fo...
[ { "content": "Here is the code block:\n```python\n# coding=utf-8\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file ...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n# coding=utf-8\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF lic...
```python # coding=utf-8 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "...
[ { "content": "Return the code exactly, with no changes:\n```python\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n# You can obtain one at http://mozilla.org/MPL/2.0/.\n\n# This modules provides functionality fo...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n# You can obtain one at http://mozilla.org/MPL/2.0/.\n\n# This modules provides ...
```python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # This modules provides functionality for dealing with code completion. from __future__ import absolute_impor...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n\"\"\"\nDjango-multilingual: a QuerySet subclass for models with translatable\nfields.\n\nThis file contains the implementation for QSRF Django.\n\"\"\"\n\nimport datetime\n\nfrom django.core.exceptions import FieldError\nfrom django.d...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n\"\"\"\nDjango-multilingual: a QuerySet subclass for models with translatable\nfields.\n\nThis file contains the implementation for QSRF Django.\n\"\"\"\n\nimport datetime\n\nfrom django.core.exceptions import FieldErro...
```python """ Django-multilingual: a QuerySet subclass for models with translatable fields. This file contains the implementation for QSRF Django. """ import datetime from django.core.exceptions import FieldError from django.db import connection from django.db.models.fields import FieldDoesNotExist from django.db.mo...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n# -*- coding: utf-8 -*-\n# pylint: disable-msg=W0612,E1101,W0141\nfrom warnings import catch_warnings, simplefilter\nimport datetime\nimport itertools\nimport pytest\nimport pytz\n\nfrom numpy.random import randn\nimport numpy as np\n\...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# pylint: disable-msg=W0612,E1101,W0141\nfrom warnings import catch_warnings, simplefilter\nimport datetime\nimport itertools\nimport pytest\nimport pytz\n\nfrom numpy.random import randn\nimpor...
```python # -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101,W0141 from warnings import catch_warnings, simplefilter import datetime import itertools import pytest import pytz from numpy.random import randn import numpy as np from pandas.core.index import Index, MultiIndex from pandas import (Panel, DataFrame,...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\nimport unittest\nimport javabridge\nfrom javabridge import JavaException, is_instance_of\nimport numpy as np\nfrom TASSELpy.TASSELbridge import TASSELbridge\ntry:\n try:\n javabridge.get_env()\n except AttributeErro...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\nimport unittest\nimport javabridge\nfrom javabridge import JavaException, is_instance_of\nimport numpy as np\nfrom TASSELpy.TASSELbridge import TASSELbridge\ntry:\n try:\n javabridge.get_env()\n exce...
```python import unittest import javabridge from javabridge import JavaException, is_instance_of import numpy as np from TASSELpy.TASSELbridge import TASSELbridge try: try: javabridge.get_env() except AttributeError: print("AttributeError: start bridge") TASSELbridge.start() except A...
[ { "content": "Provide a verbatim copy of the code:\n```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (c) 2015 Andhitia Rama. All rights reserved.\n# @author Andhitia Rama\n#\n# This program is free software: you can redis...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Copyright (c) 2015 Andhitia Rama. All rights reserved.\n# @author Andhitia Rama\n#\n# This program is free softwar...
```python # -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2015 Andhitia Rama. All rights reserved. # @author Andhitia Rama # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
[ { "content": "```python\n#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n#\n# This file is part of solus-sc\n#\n# Copyright © 2013-2018 Ikey Doherty <ikey@solus-project.com>\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...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n#\n# This file is part of solus-sc\n#\n# Copyright © 2013-2018 Ikey Doherty <ikey@solus-project.com>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General P...
```python #!/usr/bin/env python2 # -*- coding: utf-8 -*- # # This file is part of solus-sc # # Copyright © 2013-2018 Ikey Doherty <ikey@solus-project.com> # # 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 Softw...
[ { "content": "Provide a verbatim copy of the code:\n```python\n# -*- coding: utf-8 -*-\nfrom operator import attrgetter\nfrom pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType\nfrom pyangbind.lib.yangtypes import RestrictedClassType\nfrom pyangbind.lib.yangtypes import TypedListType\nfrom pyangbind....
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom operator import attrgetter\nfrom pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType\nfrom pyangbind.lib.yangtypes import RestrictedClassType\nfrom pyangbind.lib.yangtypes import TypedListType\...
```python # -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import ...
[ { "content": "Here is the snippet:\n```python\n#\n#\n# OpenERP, Open Source Management Solution\n# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved\n#\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public L...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n#\n#\n# OpenERP, Open Source Management Solution\n# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved\n#\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU ...
```python # # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # # # 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 Founda...
[ { "content": "Repeat the code exactly:\n```python\n#\n# Copyright 2009 Flavio Percoco Premoli\n#\n# This file is part of Ocvfw.\n#\n# Ocvfw is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License v2 as published\n# by the Free Software Foundation.\n#\n# Oc...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n#\n# Copyright 2009 Flavio Percoco Premoli\n#\n# This file is part of Ocvfw.\n#\n# Ocvfw is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License v2 as published\n# by the Free Software Foun...
```python # # Copyright 2009 Flavio Percoco Premoli # # This file is part of Ocvfw. # # Ocvfw is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License v2 as published # by the Free Software Foundation. # # Ocvfw is distributed in the hope that it will be useful, # b...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n# -*- coding: utf-8 -*-\n#\n#\n# Author: Yannick Vaucher\n# Copyright 2014 Camptocamp SA\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero Genera...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n#\n# Author: Yannick Vaucher\n# Copyright 2014 Camptocamp SA\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the G...
```python # -*- coding: utf-8 -*- # # # Author: Yannick Vaucher # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # ...
[ { "content": "Return the code unaltered:\n```python\n#! /urs/bin/python\n# coding: utf8\nfrom __future__ import print_function\nimport pymongo\nfrom random import uniform\n\nTWEETS_LIMIT = 0\nTRACES_LIMIT = 0\n\nclass DBClient(object):\n '''Docstring for DBClient'''\n\n def __init__(self):\n super(...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n#! /urs/bin/python\n# coding: utf8\nfrom __future__ import print_function\nimport pymongo\nfrom random import uniform\n\nTWEETS_LIMIT = 0\nTRACES_LIMIT = 0\n\nclass DBClient(object):\n '''Docstring for DBClient'''\n\n def __init__(self):...
```python #! /urs/bin/python # coding: utf8 from __future__ import print_function import pymongo from random import uniform TWEETS_LIMIT = 0 TRACES_LIMIT = 0 class DBClient(object): '''Docstring for DBClient''' def __init__(self): super(DBClient, self).__init__() self.mongo = pymongo.MongoCli...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n\"\"\"\n gstation-edit MidiPort definition\n\"\"\"\n# this file is part of gstation-edit\n# Copyright (C) F LAIGNEL 2009-2017 <fengalin@free.fr>\n#\n# gstation-edit is free software: you can redistribute it and/or modify i...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n\"\"\"\n gstation-edit MidiPort definition\n\"\"\"\n# this file is part of gstation-edit\n# Copyright (C) F LAIGNEL 2009-2017 <fengalin@free.fr>\n#\n# gstation-edit is free software: you can redistribute it...
```python """ gstation-edit MidiPort definition """ # this file is part of gstation-edit # Copyright (C) F LAIGNEL 2009-2017 <fengalin@free.fr> # # gstation-edit 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...
[ { "content": "Provide a verbatim copy of the code:\n```python\nimport pytest\nimport doctest\nfrom insights.tests import context_wrap\nfrom insights.parsers import SkipException\nfrom insights.parsers import pmrep\nfrom insights.parsers.pmrep import PMREPMetrics\n\nPMREPMETRIC_DATA = \"\"\"\nTime,\"network.inte...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\nimport pytest\nimport doctest\nfrom insights.tests import context_wrap\nfrom insights.parsers import SkipException\nfrom insights.parsers import pmrep\nfrom insights.parsers.pmrep import PMREPMetrics\n\nPMREPMETRIC_DATA = \"\"\"\nTim...
```python import pytest import doctest from insights.tests import context_wrap from insights.parsers import SkipException from insights.parsers import pmrep from insights.parsers.pmrep import PMREPMetrics PMREPMETRIC_DATA = """ Time,"network.interface.out.packets-lo","network.interface.out.packets-eth0","network.inter...
[ { "content": "```python\n\"\"\"\nContains classes controlling wizards for making new maps\n\"\"\"\n\nimport tkinter as tk\nimport mathsmap.colours as colours\n\nclass Wizard:\n \"\"\"\n A base class for all wizards in this project\n \"\"\"\n def clear(self):\n \"\"\"\n Remove all curre...
[ { "content": "<|memory_start|>```python\n\"\"\"\nContains classes controlling wizards for making new maps\n\"\"\"\n\nimport tkinter as tk\nimport mathsmap.colours as colours\n\nclass Wizard:\n \"\"\"\n A base class for all wizards in this project\n \"\"\"\n def clear(self):\n \"\"\"\n ...
```python """ Contains classes controlling wizards for making new maps """ import tkinter as tk import mathsmap.colours as colours class Wizard: """ A base class for all wizards in this project """ def clear(self): """ Remove all current widgets from top level of wizard """ ...
[ { "content": "```python\n# ##### BEGIN GPL LICENSE BLOCK #####\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later...
[ { "content": "<|memory_start|>```python\n# ##### BEGIN GPL LICENSE BLOCK #####\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your o...
```python # ##### BEGIN GPL LICENSE BLOCK ##### # # 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 ...
[ { "content": "Provide an exact copy of the source code:\n```python\n\"\"\"RachioObject module containing a helper class for all API calls.\"\"\"\nimport json\n\nfrom requests import Session\n\n_API_URL = \"https://api.rach.io/1/public\"\n\n\nclass RachioObject:\n \"\"\"The Rachio base object.\"\"\"\n\n de...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n\"\"\"RachioObject module containing a helper class for all API calls.\"\"\"\nimport json\n\nfrom requests import Session\n\n_API_URL = \"https://api.rach.io/1/public\"\n\n\nclass RachioObject:\n \"\"\"The Rachio base object....
```python """RachioObject module containing a helper class for all API calls.""" import json from requests import Session _API_URL = "https://api.rach.io/1/public" class RachioObject: """The Rachio base object.""" def __init__(self, authtoken: str, http_session=None, timeout=25): """Rachioobject cl...
[ { "content": "```python\nimport argparse\nimport json\nimport logging\nimport time\nfrom collections import defaultdict\n\nfrom pynet import Node, NodeHooks, Encryptor, PeerDefinition\nfrom pynet.util import run_node\n\n\nSHUTDOWN = False\n\n\nclass KVPDB(object):\n \"\"\"A per-owner dictionary.\n\n Each owne...
[ { "content": "<|memory_start|>```python\nimport argparse\nimport json\nimport logging\nimport time\nfrom collections import defaultdict\n\nfrom pynet import Node, NodeHooks, Encryptor, PeerDefinition\nfrom pynet.util import run_node\n\n\nSHUTDOWN = False\n\n\nclass KVPDB(object):\n \"\"\"A per-owner dictionary...
```python import argparse import json import logging import time from collections import defaultdict from pynet import Node, NodeHooks, Encryptor, PeerDefinition from pynet.util import run_node SHUTDOWN = False class KVPDB(object): """A per-owner dictionary. Each owner has their own dictionary, this class exp...
[ { "content": "```python\nimport math\n\nclass ColorScience():\n\t\"\"\"Methodes relative at Color Science\"\"\"\n\t\n\t@staticmethod\n\tdef linearToSrgb(color):\n\t\tcolorOut = []\n\n\t\tfor i in range(3):\n\t\t\tif color[i] <= 0.0031308:\n\t\t\t\tcolorTmp = color[i] * 12.92\n\t\t\t\tcolorOut.append( round(colo...
[ { "content": "<|memory_start|>```python\nimport math\n\nclass ColorScience():\n\t\"\"\"Methodes relative at Color Science\"\"\"\n\t\n\t@staticmethod\n\tdef linearToSrgb(color):\n\t\tcolorOut = []\n\n\t\tfor i in range(3):\n\t\t\tif color[i] <= 0.0031308:\n\t\t\t\tcolorTmp = color[i] * 12.92\n\t\t\t\tcolorOut.ap...
```python import math class ColorScience(): """Methodes relative at Color Science""" @staticmethod def linearToSrgb(color): colorOut = [] for i in range(3): if color[i] <= 0.0031308: colorTmp = color[i] * 12.92 colorOut.append( round(colorTmp, 6) ) else: colorTmp = 1.055 * ( pow(color[i], 1...
[ { "content": "Return the code exactly, with no changes:\n```python\n# -*- coding: utf-8 -*-\n\nimport re\nimport urllib.parse\n\nfrom bs4 import BeautifulSoup\n\nfrom pyload.core.utils.misc import eval_js\n\nfrom ..anticaptchas.ReCaptcha import ReCaptcha\nfrom ..base.simple_downloader import SimpleDownloader\n\...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nimport re\nimport urllib.parse\n\nfrom bs4 import BeautifulSoup\n\nfrom pyload.core.utils.misc import eval_js\n\nfrom ..anticaptchas.ReCaptcha import ReCaptcha\nfrom ..base.simple_downloader import Sim...
```python # -*- coding: utf-8 -*- import re import urllib.parse from bs4 import BeautifulSoup from pyload.core.utils.misc import eval_js from ..anticaptchas.ReCaptcha import ReCaptcha from ..base.simple_downloader import SimpleDownloader class ZippyshareCom(SimpleDownloader): __name__ = "ZippyshareCom" __...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n\"\"\"\n Plugin for UrlResolver\n Copyright (C) 2017 tknorris\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 ...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n\"\"\"\n Plugin for UrlResolver\n Copyright (C) 2017 tknorris\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 th...
```python """ Plugin for UrlResolver Copyright (C) 2017 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later...
[ { "content": "Reconstruct the code exactly:\n```python\n\"\"\" The Chain of Responsibility Pattern\n\nNotes:\n\nThe Chain of Responsibility pattern allows the client programmer to dynamically\ncreate a recursive chain of objects - each of which tries to fulfill a\n'responsibility' (usually represented by a meth...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n\"\"\" The Chain of Responsibility Pattern\n\nNotes:\n\nThe Chain of Responsibility pattern allows the client programmer to dynamically\ncreate a recursive chain of objects - each of which tries to fulfill a\n'responsibility' (usually repre...
```python """ The Chain of Responsibility Pattern Notes: The Chain of Responsibility pattern allows the client programmer to dynamically create a recursive chain of objects - each of which tries to fulfill a 'responsibility' (usually represented by a method call). If an object in the chain is unable to fulfill it, th...
[ { "content": "```python\n#!/usr/bin/env python\n\n\"\"\" Assignment 1, Exercise 3, INF1340, Fall, 2015. Troubleshooting Car Issues.\n\nThis module contains one function diagnose_car(). It is an expert system to\ninteractive diagnose car issues.\n\n\"\"\"\n\n__author__ = 'Susan Sim'\n__email__ = \"ses@drsusansim...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n\n\"\"\" Assignment 1, Exercise 3, INF1340, Fall, 2015. Troubleshooting Car Issues.\n\nThis module contains one function diagnose_car(). It is an expert system to\ninteractive diagnose car issues.\n\n\"\"\"\n\n__author__ = 'Susan Sim'\n__email__ = ...
```python #!/usr/bin/env python """ Assignment 1, Exercise 3, INF1340, Fall, 2015. Troubleshooting Car Issues. This module contains one function diagnose_car(). It is an expert system to interactive diagnose car issues. """ __author__ = 'Susan Sim' __email__ = "ses@drsusansim.org" __copyright__ = "2015 Susan Sim" _...
[ { "content": "Repeat the full code snippet:\n```python\n#!/usr/bin/env python\n\nfrom setuptools import setup\n\nlong_desc = '''\n\nEncrypted JSON Transport Protocol\n---------------------------------\n\nEJTP is an overlay protocol that allows the pluggable use of underlying transports, such as UDP, TCP, HTTP, ...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom setuptools import setup\n\nlong_desc = '''\n\nEncrypted JSON Transport Protocol\n---------------------------------\n\nEJTP is an overlay protocol that allows the pluggable use of underlying transports, such as ...
```python #!/usr/bin/env python from setuptools import setup long_desc = ''' Encrypted JSON Transport Protocol --------------------------------- EJTP is an overlay protocol that allows the pluggable use of underlying transports, such as UDP, TCP, HTTP, IRC, Email and carrier pigeon to provide a cryptographically se...
[ { "content": "Provide a verbatim copy of the code:\n```python\n#!/usr/bin/env python\n\"\"\"\nBased on test code moved here from bottom of tulip/jtlvint.py\n\nSCL; 31 Dec 2011.\n\"\"\"\n\nimport os\n\nfrom tulip.jtlvint import *\nfrom tulip.polytope import Region\nfrom tulip.prop2part import PropPreservingParti...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\"\"\"\nBased on test code moved here from bottom of tulip/jtlvint.py\n\nSCL; 31 Dec 2011.\n\"\"\"\n\nimport os\n\nfrom tulip.jtlvint import *\nfrom tulip.polytope import Region\nfrom tulip.prop2part import Pro...
```python #!/usr/bin/env python """ Based on test code moved here from bottom of tulip/jtlvint.py SCL; 31 Dec 2011. """ import os from tulip.jtlvint import * from tulip.polytope import Region from tulip.prop2part import PropPreservingPartition class jtlvint_test: def setUp(self): self.tmpdir = "tmpspe...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n# -*- coding: utf-8 -*-\nimport collections\nfrom xml.sax.xmlreader import AttributesImpl\n\nfrom ecoxipy import _python2, _unicode\nfrom ecoxipy import _helpers\n\nfrom ._common import XMLNode, ContainerNode, _s...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport collections\nfrom xml.sax.xmlreader import AttributesImpl\n\nfrom ecoxipy import _python2, _unicode\nfrom ecoxipy import _helpers\n\nfrom ._common import XMLNode, C...
```python # -*- coding: utf-8 -*- import collections from xml.sax.xmlreader import AttributesImpl from ecoxipy import _python2, _unicode from ecoxipy import _helpers from ._common import XMLNode, ContainerNode, _string_repr from ._content_nodes import Text from .indexing import (IndexDescriptor, ElementByUniqueAttrib...
[ { "content": "Repeat the following code:\n```python\n#!/usr/bin/env python\n\nfrom cogflect.GeneratorBase import GeneratorBase\nfrom cogflect.common import generate_cppclass_common\nfrom cogflect.util import sanitizeTypename, indent\nimport cog\n\n_body = \"\"\"\n typedef %(name)s::type enum_type;\n\n // ...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom cogflect.GeneratorBase import GeneratorBase\nfrom cogflect.common import generate_cppclass_common\nfrom cogflect.util import sanitizeTypename, indent\nimport cog\n\n_body = \"\"\"\n typedef %(name)s::type enum_...
```python #!/usr/bin/env python from cogflect.GeneratorBase import GeneratorBase from cogflect.common import generate_cppclass_common from cogflect.util import sanitizeTypename, indent import cog _body = """ typedef %(name)s::type enum_type; // TODO: iterate public/protected/private independently? // TOD...
[ { "content": "```python\nimport json\n\nfrom flask import Flask\n\nfrom fittrackee.users.models import User\nfrom fittrackee.workouts.models import Sport, Workout\n\nfrom ..api_test_case import ApiTestCaseMixin\n\n\nclass TestGetStatsByTime(ApiTestCaseMixin):\n def test_it_gets_no_stats_when_user_has_no_work...
[ { "content": "<|memory_start|>```python\nimport json\n\nfrom flask import Flask\n\nfrom fittrackee.users.models import User\nfrom fittrackee.workouts.models import Sport, Workout\n\nfrom ..api_test_case import ApiTestCaseMixin\n\n\nclass TestGetStatsByTime(ApiTestCaseMixin):\n def test_it_gets_no_stats_when_...
```python import json from flask import Flask from fittrackee.users.models import User from fittrackee.workouts.models import Sport, Workout from ..api_test_case import ApiTestCaseMixin class TestGetStatsByTime(ApiTestCaseMixin): def test_it_gets_no_stats_when_user_has_no_workouts( self, app: Flask, us...
[ { "content": "Repeat the following code:\n```python\nr\"\"\"\nTest ec.utils.\n\"\"\"\nimport unittest\n\nfrom ec.utils import get, static, custom, walk\n\nfrom support.helpers import RawInputHook as RIH, expect_exception\n\n# Tests\nclass TestUtils(unittest.TestCase):\n def setUp(self):\n pass\n\n def tear...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\nr\"\"\"\nTest ec.utils.\n\"\"\"\nimport unittest\n\nfrom ec.utils import get, static, custom, walk\n\nfrom support.helpers import RawInputHook as RIH, expect_exception\n\n# Tests\nclass TestUtils(unittest.TestCase):\n def setUp(self):\n pa...
```python r""" Test ec.utils. """ import unittest from ec.utils import get, static, custom, walk from support.helpers import RawInputHook as RIH, expect_exception # Tests class TestUtils(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_get(self): Inputs = 'a', 1 RIH...
[ { "content": "```python\nfrom helga.plugins import command\n\nfrom functions import bounty_lookup, crucible_lookup, daily_lookup\nfrom functions import heroic_lookup, nightfall_lookup, xur_lookup\nfrom scraper import VENDOR_NAMES\n\nguard_help = \"Returns a guardian's destinytracker.com page\"\n@command('guardi...
[ { "content": "<|memory_start|>```python\nfrom helga.plugins import command\n\nfrom functions import bounty_lookup, crucible_lookup, daily_lookup\nfrom functions import heroic_lookup, nightfall_lookup, xur_lookup\nfrom scraper import VENDOR_NAMES\n\nguard_help = \"Returns a guardian's destinytracker.com page\"\n...
```python from helga.plugins import command from functions import bounty_lookup, crucible_lookup, daily_lookup from functions import heroic_lookup, nightfall_lookup, xur_lookup from scraper import VENDOR_NAMES guard_help = "Returns a guardian's destinytracker.com page" @command('guardian', aliases=('g',), help=guard_...
[ { "content": "Repeat the full code snippet:\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# Block using iptables through Flask\n\nimport subprocess # Run iptables\nfrom IPy import IP # Valide IP\nimport re # Make sure to validate\nfrom flask import Flask # Run Flask\nfrom flask import request # For ur...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# Block using iptables through Flask\n\nimport subprocess # Run iptables\nfrom IPy import IP # Valide IP\nimport re # Make sure to validate\nfrom flask import Flask # Run Flask\nfrom flask import ...
```python #!/usr/bin/python # -*- coding: utf-8 -*- # Block using iptables through Flask import subprocess # Run iptables from IPy import IP # Valide IP import re # Make sure to validate from flask import Flask # Run Flask from flask import request # For url arguments app = Flask(__name__) # wget "127.0.0.1:9000/blo...
[ { "content": "Repeat the full code snippet:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2013 Tristan Fischer (sphere@dersphere.de)\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 pu...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2013 Tristan Fischer (sphere@dersphere.de)\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Publ...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Tristan Fischer (sphere@dersphere.de) # # 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...
[ { "content": "Provide a verbatim copy of the code:\n```python\n# Задача 9. Вариант 22.\n# Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен\n# его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток\n# узнать, есть ли какая-либо буква в слове, причем програм...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n# Задача 9. Вариант 22.\n# Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен\n# его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток\n# узнать, есть ли какая-либо буква в слове...
```python # Задача 9. Вариант 22. # Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен # его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток # узнать, есть ли какая-либо буква в слове, причем программа может отвечать только # "Да" и "Нет". Вслед за тем игрок долж...
[ { "content": "Return the code exactly, with no changes:\n```python\n# the implementation here is a bit crappy.\nimport time\nfrom Directories import resolveFilename, SCOPE_CONFIG\nfrom boxbranding import getBoxType\n\nboxtype = getBoxType()\n\nPERCENTAGE_START = 50\nPERCENTAGE_END = 100\n\nprofile_start = time....
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# the implementation here is a bit crappy.\nimport time\nfrom Directories import resolveFilename, SCOPE_CONFIG\nfrom boxbranding import getBoxType\n\nboxtype = getBoxType()\n\nPERCENTAGE_START = 50\nPERCENTAGE_END = 100\n\nprofi...
```python # the implementation here is a bit crappy. import time from Directories import resolveFilename, SCOPE_CONFIG from boxbranding import getBoxType boxtype = getBoxType() PERCENTAGE_START = 50 PERCENTAGE_END = 100 profile_start = time.time() profile_data = {} total_time = 1 profile_file = None try: f = ope...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\nimport os\nimport numpy\nimport scipy_data_fitting\n\nclass Fig4(scipy_data_fitting.Data):\n \"\"\"\n Use this to load the data from Figure 4 in PhysRevLett.105.167202.\n\n Should not be used directly, but only subclassed....
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\nimport os\nimport numpy\nimport scipy_data_fitting\n\nclass Fig4(scipy_data_fitting.Data):\n \"\"\"\n Use this to load the data from Figure 4 in PhysRevLett.105.167202.\n\n Should not be used directly, but ...
```python import os import numpy import scipy_data_fitting class Fig4(scipy_data_fitting.Data): """ Use this to load the data from Figure 4 in PhysRevLett.105.167202. Should not be used directly, but only subclassed. """ def __init__(self, subfig): super().__init__() self.subfig =...
[ { "content": "Provide a verbatim copy of the code:\n```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport itertools\nimport os\nimport os.path\n\nimport sys\nimport argparse\nimport logging\n\n\ndef cartesian_product(dicts):\n return (dict(zip(dicts, x)) for x in itertools.product(*dicts.value...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport itertools\nimport os\nimport os.path\n\nimport sys\nimport argparse\nimport logging\n\n\ndef cartesian_product(dicts):\n return (dict(zip(dicts, x)) for x in itertools.prod...
```python #!/usr/bin/env python3 # -*- coding: utf-8 -*- import itertools import os import os.path import sys import argparse import logging def cartesian_product(dicts): return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values())) def summary(configuration): kvs = sorted([(k, v) for k, v in c...