prompt
listlengths
1
1
compression_prompt
listlengths
1
1
target
stringlengths
1.03k
828k
[ { "content": "Repeat the following code:\n```python\n# coding=utf-8\n\nfrom rest_test import *\nimport api.resources.users.users\n\n__author__ = 'Glebov Boris'\n\n\nclass UserListTest(RestBaseTest):\n \"\"\"\n Test all case for GET: /api/v1/users/\n \"\"\"\n def test_users_list_success(self):\n ...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n# coding=utf-8\n\nfrom rest_test import *\nimport api.resources.users.users\n\n__author__ = 'Glebov Boris'\n\n\nclass UserListTest(RestBaseTest):\n \"\"\"\n Test all case for GET: /api/v1/users/\n \"\"\"\n def test_users_list_succe...
```python # coding=utf-8 from rest_test import * import api.resources.users.users __author__ = 'Glebov Boris' class UserListTest(RestBaseTest): """ Test all case for GET: /api/v1/users/ """ def test_users_list_success(self): client_app = self.get_app_client() r = client_app.get('/ap...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n#!/usr/local/bin/python\n# -*- coding: utf-8 -*-\nfrom django.http import HttpResponse\nfrom django.core.urlresolvers import reverse\nfrom techism2 import service\nfrom datetime import datetime, timedelta\nimport icalendar\nimport ti...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n#!/usr/local/bin/python\n# -*- coding: utf-8 -*-\nfrom django.http import HttpResponse\nfrom django.core.urlresolvers import reverse\nfrom techism2 import service\nfrom datetime import datetime, timedelta\nimport ical...
```python #!/usr/local/bin/python # -*- coding: utf-8 -*- from django.http import HttpResponse from django.core.urlresolvers import reverse from techism2 import service from datetime import datetime, timedelta import icalendar import time def ical(request): ninety_days = datetime.utcnow() + timedelta(days=90) ...
[ { "content": "Here is the source code:\n```python\nimport hashlib\nimport pytest\n\nfrom django.contrib.auth.models import User\nfrom django.core import mail\n\nfrom factories import SecretaryFactory, AdministratorFactory\nfrom users.models import Employee\nfrom users.models import Administrator\nfrom users.mod...
[ { "content": "Here is the source code:\n<|memory_start|>```python\nimport hashlib\nimport pytest\n\nfrom django.contrib.auth.models import User\nfrom django.core import mail\n\nfrom factories import SecretaryFactory, AdministratorFactory\nfrom users.models import Employee\nfrom users.models import Administrator...
```python import hashlib import pytest from django.contrib.auth.models import User from django.core import mail from factories import SecretaryFactory, AdministratorFactory from users.models import Employee from users.models import Administrator from users.models import Secretary from django.core.exceptions import Ob...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nimp...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship inf...
```python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import functools import logging im...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n#!/usr/bin/env python3\n# -*- mode: python -*-\n\n# This script is used to prepare the tarballs that a version 002 client\n# submits for further processing. It copies the tarballs and their MD5\n# sums to the archive (after chec...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n#!/usr/bin/env python3\n# -*- mode: python -*-\n\n# This script is used to prepare the tarballs that a version 002 client\n# submits for further processing. It copies the tarballs and their MD5\n# sums to the arc...
```python #!/usr/bin/env python3 # -*- mode: python -*- # This script is used to prepare the tarballs that a version 002 client # submits for further processing. It copies the tarballs and their MD5 # sums to the archive (after checking) and sets the state links, so # that the dispatch script will pick them up and get...
[ { "content": "Return the code unaltered:\n```python\n# import sys\n# sys.path.append(\".\")\n\nfrom keras.layers import Input, Dense\nimport keras.optimizers\nfrom keras.models import Model\nimport sklearn.model_selection as mds\nimport numpy as np\nimport problem.load_data as load_data\nimport problem.train_MI...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n# import sys\n# sys.path.append(\".\")\n\nfrom keras.layers import Input, Dense\nimport keras.optimizers\nfrom keras.models import Model\nimport sklearn.model_selection as mds\nimport numpy as np\nimport problem.load_data as load_data\nimport ...
```python # import sys # sys.path.append(".") from keras.layers import Input, Dense import keras.optimizers from keras.models import Model import sklearn.model_selection as mds import numpy as np import problem.load_data as load_data import problem.train_MINST as train_MINST import matplotlib.pyplot as plt import hype...
[ { "content": "```python\n\"\"\"\r\nClasses for Various Statistical Distributions.\r\n\r\nReferences:\r\n - Regress+ A compendium of common probability distributions (version 2.3)\r\n by Michael P. McLaughlin (mpmcl@mitre.org)\r\n http://www.causascientia.org/math_stat/Dists/Compendium.pdf\r\n - Hand...
[ { "content": "<|memory_start|>```python\n\"\"\"\r\nClasses for Various Statistical Distributions.\r\n\r\nReferences:\r\n - Regress+ A compendium of common probability distributions (version 2.3)\r\n by Michael P. McLaughlin (mpmcl@mitre.org)\r\n http://www.causascientia.org/math_stat/Dists/Compendium.p...
```python """ Classes for Various Statistical Distributions. References: - Regress+ A compendium of common probability distributions (version 2.3) by Michael P. McLaughlin (mpmcl@mitre.org) http://www.causascientia.org/math_stat/Dists/Compendium.pdf - Hand-book on statistical distributions for e...
[ { "content": "Repeat the following code:\n```python\n\"\"\"\nContains the house price model.\n\nDON'T USE THIS MODEL! Use the HousePriceModel in house_price_model_2.py.\n\"\"\"\nimport os\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.linear_model i...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n\"\"\"\nContains the house price model.\n\nDON'T USE THIS MODEL! Use the HousePriceModel in house_price_model_2.py.\n\"\"\"\nimport os\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklear...
```python """ Contains the house price model. DON'T USE THIS MODEL! Use the HousePriceModel in house_price_model_2.py. """ import os import numpy as np import pandas as pd from sklearn.ensemble import RandomForestRegressor from sklearn.linear_model import RidgeCV # Constants BASE_DATE = pd.to_datetime('20140101', f...
[ { "content": "```python\n###############################################################################\r\n##\r\n## Copyright 2011-2013 Tavendo GmbH\r\n##\r\n## Licensed under the Apache License, Version 2.0 (the \"License\");\r\n## you may not use this file except in compliance with the License.\r\n## You...
[ { "content": "<|memory_start|>```python\n###############################################################################\r\n##\r\n## Copyright 2011-2013 Tavendo GmbH\r\n##\r\n## Licensed under the Apache License, Version 2.0 (the \"License\");\r\n## you may not use this file except in compliance with the Lic...
```python ############################################################################### ## ## Copyright 2011-2013 Tavendo GmbH ## ## 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 ...
[ { "content": "Here is a code file:\n```python\n# coding: utf-8\nfrom __future__ import unicode_literals\n\nimport re\n\nfrom .common import InfoExtractor\nfrom ..compat import (\n compat_urllib_parse,\n compat_urllib_request,\n)\n\n\nclass StreamcloudIE(InfoExtractor):\n IE_NAME = 'streamcloud.eu'\n ...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# coding: utf-8\nfrom __future__ import unicode_literals\n\nimport re\n\nfrom .common import InfoExtractor\nfrom ..compat import (\n compat_urllib_parse,\n compat_urllib_request,\n)\n\n\nclass StreamcloudIE(InfoExtractor):\n IE_NAME = 'stre...
```python # coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) class StreamcloudIE(InfoExtractor): IE_NAME = 'streamcloud.eu' _VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_...
[ { "content": "Provide a verbatim copy of the code:\n```python\n###\n# Copyright (c) 2011, Rodrigo Dias Cruz\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n###\n# Copyright (c) 2011, Rodrigo Dias Cruz\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Re...
```python ### # Copyright (c) 2011, Rodrigo Dias Cruz # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list...
[ { "content": "Return the code unaltered:\n```python\nimport numpy as np\nimport pytest\n\nfrom pandas import DataFrame, Series\nimport pandas.util.testing as tm\n\n\n@pytest.mark.parametrize('subset', ['a', ['a'], ['a', 'B']])\ndef test_duplicated_with_misspelled_column_name(subset):\n # GH 19730\n df = D...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\nimport numpy as np\nimport pytest\n\nfrom pandas import DataFrame, Series\nimport pandas.util.testing as tm\n\n\n@pytest.mark.parametrize('subset', ['a', ['a'], ['a', 'B']])\ndef test_duplicated_with_misspelled_column_name(subset):\n # GH 1...
```python import numpy as np import pytest from pandas import DataFrame, Series import pandas.util.testing as tm @pytest.mark.parametrize('subset', ['a', ['a'], ['a', 'B']]) def test_duplicated_with_misspelled_column_name(subset): # GH 19730 df = DataFrame({'A': [0, 0, 1], 'B': [0, 0, 1],...
[ { "content": "Provide a verbatim copy of the code:\n```python\nimport logging\nfrom collections import UserDict\nimport pymysql\nimport re\n\nlog = logging.getLogger('tyggbot')\n\n\nclass Emote:\n def __init__(self):\n self.id = -1 # An ID of -1 means the emote will be inserted on sync\n self....
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\nimport logging\nfrom collections import UserDict\nimport pymysql\nimport re\n\nlog = logging.getLogger('tyggbot')\n\n\nclass Emote:\n def __init__(self):\n self.id = -1 # An ID of -1 means the emote will be inserted on syn...
```python import logging from collections import UserDict import pymysql import re log = logging.getLogger('tyggbot') class Emote: def __init__(self): self.id = -1 # An ID of -1 means the emote will be inserted on sync self.emote_id = None self.code = None # This value will be inserted ...
[ { "content": "```python\nfrom __future__ import absolute_import\nimport os\nimport shutil\nimport tempfile\nimport unittest\n\n\nclass SetupStack(object):\n def __init__(self):\n self._on_teardown = []\n\n def add_teardown(self, teardown):\n self._on_teardown.append(teardown)\n\n def tear...
[ { "content": "<|memory_start|>```python\nfrom __future__ import absolute_import\nimport os\nimport shutil\nimport tempfile\nimport unittest\n\n\nclass SetupStack(object):\n def __init__(self):\n self._on_teardown = []\n\n def add_teardown(self, teardown):\n self._on_teardown.append(teardown)...
```python from __future__ import absolute_import import os import shutil import tempfile import unittest class SetupStack(object): def __init__(self): self._on_teardown = [] def add_teardown(self, teardown): self._on_teardown.append(teardown) def tear_down(self): for func in reve...
[ { "content": "Replicate the source code:\n```python\n#!/usr/bin/env python3\nimport numpy as np\nimport numpy.random\nfrom time import time\n\n# web mercator projection functions\n# ---------------------------------\ndef linear_lat(lat, atanh = np.arctanh, sin = np.sin, radians = np.radians):\n return atanh(...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n#!/usr/bin/env python3\nimport numpy as np\nimport numpy.random\nfrom time import time\n\n# web mercator projection functions\n# ---------------------------------\ndef linear_lat(lat, atanh = np.arctanh, sin = np.sin, radians = np.radians):\n ...
```python #!/usr/bin/env python3 import numpy as np import numpy.random from time import time # web mercator projection functions # --------------------------------- def linear_lat(lat, atanh = np.arctanh, sin = np.sin, radians = np.radians): return atanh(sin(radians(lat))) def inv_linear_lat(ll, asin = np.arcsin...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Sep 10 15:25:02 2016\n\n@author: jessime\n\"\"\"\n\nimport pygame\nimport minesweeper_game.events as events\n\nclass Controller():\n\n def __init__(self, ev_manager, model):\n self.ev_manager = ev_manager\n self.model = mo...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Sep 10 15:25:02 2016\n\n@author: jessime\n\"\"\"\n\nimport pygame\nimport minesweeper_game.events as events\n\nclass Controller():\n\n def __init__(self, ev_manager, model):\n self.ev_manager = ev_manager\n ...
```python # -*- coding: utf-8 -*- """ Created on Sat Sep 10 15:25:02 2016 @author: jessime """ import pygame import minesweeper_game.events as events class Controller(): def __init__(self, ev_manager, model): self.ev_manager = ev_manager self.model = model self.ev_manager.register(self)...
[ { "content": "```python\nimport pytest\nfrom tri_struct import merged\n\nfrom tri_form import Field, Form\nfrom tri_form.compat import render_to_string, format_html, field_defaults_factory, render_template, Template\nfrom .compat import RequestFactory, SafeText\n\n\ndef test_render_to_string():\n assert rend...
[ { "content": "<|memory_start|>```python\nimport pytest\nfrom tri_struct import merged\n\nfrom tri_form import Field, Form\nfrom tri_form.compat import render_to_string, format_html, field_defaults_factory, render_template, Template\nfrom .compat import RequestFactory, SafeText\n\n\ndef test_render_to_string():\...
```python import pytest from tri_struct import merged from tri_form import Field, Form from tri_form.compat import render_to_string, format_html, field_defaults_factory, render_template, Template from .compat import RequestFactory, SafeText def test_render_to_string(): assert render_to_string( template_n...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n#!/usr/bin/env python\n'''\nUse Pexpect to change the logging buffer size(logging buffered <size>).\nVerify this change by examining the output of 'show run'.\n'''\n\nimport pexpect\nimport time\nfrom getpass import getpass\n\ndef login(ssh_...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n#!/usr/bin/env python\n'''\nUse Pexpect to change the logging buffer size(logging buffered <size>).\nVerify this change by examining the output of 'show run'.\n'''\n\nimport pexpect\nimport time\nfrom getpass import getpass\n...
```python #!/usr/bin/env python ''' Use Pexpect to change the logging buffer size(logging buffered <size>). Verify this change by examining the output of 'show run'. ''' import pexpect import time from getpass import getpass def login(ssh_conn): ''' Handle sending password ''' password = getpass() ...
[ { "content": "Here is the script:\n```python\n# -*- coding: utf-8 -*-\n\n# This file is part of Tumulus.\n#\n# Copyright (C) 2013 OKso (http://okso.me)\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published by\n# the...
[ { "content": "Here is the script:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n# This file is part of Tumulus.\n#\n# Copyright (C) 2013 OKso (http://okso.me)\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as pub...
```python # -*- coding: utf-8 -*- # This file is part of Tumulus. # # Copyright (C) 2013 OKso (http://okso.me) # # 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 L...
[ { "content": "Reconstruct the code exactly:\n```python\n# -*- coding: utf-8 -*-\n#------------------------------------------------------------\n# pelisalacarta - XBMC Plugin\n# Canal para series.ly\n# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/\n#------------------------------------------------------...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#------------------------------------------------------------\n# pelisalacarta - XBMC Plugin\n# Canal para series.ly\n# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/\n#--------------------------------------...
```python # -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para series.ly # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import re import sys import os import urllib2 from ...
[ { "content": "```python\n# Copyright 2013: Mirantis Inc.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0...
[ { "content": "<|memory_start|>```python\n# Copyright 2013: Mirantis Inc.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/lice...
```python # Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[ { "content": "Repeat the following code:\n```python\n'''\nEstablish custom log levels for rexlexer's verbose output.\n'''\nimport logging\nfrom rexlex.config import LOG_MSG_MAXWIDTH\n\n\n# ---------------------------------------------------------------------------\n# Establish custom log levels.\n# ------------...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n'''\nEstablish custom log levels for rexlexer's verbose output.\n'''\nimport logging\nfrom rexlex.config import LOG_MSG_MAXWIDTH\n\n\n# ---------------------------------------------------------------------------\n# Establish custom log levels....
```python ''' Establish custom log levels for rexlexer's verbose output. ''' import logging from rexlex.config import LOG_MSG_MAXWIDTH # --------------------------------------------------------------------------- # Establish custom log levels. # ------------------------------------------------------------------------...
[ { "content": "Repeat the code precisely:\n```python\n\"\"\"\n Copyright (C) 2020 Quinn D Granfor <spootdev@gmail.com>\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 version 2, as published by the Free Software Foundation.\n\n...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n\"\"\"\n Copyright (C) 2020 Quinn D Granfor <spootdev@gmail.com>\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 version 2, as published by the Free Software...
```python """ Copyright (C) 2020 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be use...
[ { "content": "Here is the code block:\n```python\nimport view\r\nimport wx\r\nimport wx.gizmos as gizmos\r\nfrom cuttlebug.ui.controls import DictListCtrl\r\nfrom cuttlebug.util import ArtListMixin, has_icon, bidict, KeyTree, str2int\r\nfrom functools import partial\r\nimport cuttlebug.gdb as gdb\r\nimport os, ...
[ { "content": "Here is the code block:\n<|memory_start|>```python\nimport view\r\nimport wx\r\nimport wx.gizmos as gizmos\r\nfrom cuttlebug.ui.controls import DictListCtrl\r\nfrom cuttlebug.util import ArtListMixin, has_icon, bidict, KeyTree, str2int\r\nfrom functools import partial\r\nimport cuttlebug.gdb as gd...
```python import view import wx import wx.gizmos as gizmos from cuttlebug.ui.controls import DictListCtrl from cuttlebug.util import ArtListMixin, has_icon, bidict, KeyTree, str2int from functools import partial import cuttlebug.gdb as gdb import os, threading import cuttlebug.ui.menu as menu import cuttlebug....
[ { "content": "```python\nimport time\nimport sys\nimport RPi.GPIO as GPIO\n\noff = '1242424352424342424242424242425342524342'\nb0 = '12424243524243424242424242424242424242424242'\nb1 = '124242435242434242424242424242534242424242'\nb2 = '1242424352424342424242424242425353424242'\nb3 = '12424243524243424242424242...
[ { "content": "<|memory_start|>```python\nimport time\nimport sys\nimport RPi.GPIO as GPIO\n\noff = '1242424352424342424242424242425342524342'\nb0 = '12424243524243424242424242424242424242424242'\nb1 = '124242435242434242424242424242534242424242'\nb2 = '1242424352424342424242424242425353424242'\nb3 = '1242424352...
```python import time import sys import RPi.GPIO as GPIO off = '1242424352424342424242424242425342524342' b0 = '12424243524243424242424242424242424242424242' b1 = '124242435242434242424242424242534242424242' b2 = '1242424352424342424242424242425353424242' b3 = '124242435242434242424242424242424253424242' b4 = '1242424...
[ { "content": "Repeat the full code snippet:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Locating Restriction Sites\n\nUsage:\n REVP.py <input> [--compare] [--max=MAX] [--min=MIN]\n REVP.py (--help | --version)\n\nOptions:\n --compare run a speed comparison of various methods\n ...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Locating Restriction Sites\n\nUsage:\n REVP.py <input> [--compare] [--max=MAX] [--min=MIN]\n REVP.py (--help | --version)\n\nOptions:\n --compare run a speed comparison of var...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- """Locating Restriction Sites Usage: REVP.py <input> [--compare] [--max=MAX] [--min=MIN] REVP.py (--help | --version) Options: --compare run a speed comparison of various methods --max=MAX Set the maximum length of palindrome to search for, ...
[ { "content": "```python\n# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/li...
[ { "content": "<|memory_start|>```python\n# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://w...
```python # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n#! /usr/bin/env python\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom DataTools import writeDataToFile\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--time-step',dest='time_step',required=False)\n...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n#! /usr/bin/env python\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom DataTools import writeDataToFile\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--time-step',dest='time_step',r...
```python #! /usr/bin/env python import numpy as np import matplotlib.pyplot as plt from DataTools import writeDataToFile import argparse parser = argparse.ArgumentParser() parser.add_argument('--time-step',dest='time_step',required=False) parser.add_argument('--output-file',dest='fn_out',required=False) args = parse...
[ { "content": "Repeat the full code snippet:\n```python\n# -*- coding: utf-8 -*-\n#\n# method.py - commander\n#\n# Copyright (C) 2010 - Jesse van den Kieboom\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# ...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# method.py - commander\n#\n# Copyright (C) 2010 - Jesse van den Kieboom\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 p...
```python # -*- coding: utf-8 -*- # # method.py - commander # # Copyright (C) 2010 - Jesse van den Kieboom # # 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,...
[ { "content": "Recreate the original code text:\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.\...
[ { "content": "Recreate the original code text:\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# licen...
```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\"\"\"\nClasses for generating diff coverage reports.\n\"\"\"\nfrom __future__ import unicode_literals\nfrom abc import ABCMeta, abstractmethod\nfrom jinja2 import Environment, PackageLoader\nfrom jinja2_pluralize import pluralize_dj\nfrom diff_cover.snippets import Snippet\nimport six\...
[ { "content": "<|memory_start|>```python\n\"\"\"\nClasses for generating diff coverage reports.\n\"\"\"\nfrom __future__ import unicode_literals\nfrom abc import ABCMeta, abstractmethod\nfrom jinja2 import Environment, PackageLoader\nfrom jinja2_pluralize import pluralize_dj\nfrom diff_cover.snippets import Snip...
```python """ Classes for generating diff coverage reports. """ from __future__ import unicode_literals from abc import ABCMeta, abstractmethod from jinja2 import Environment, PackageLoader from jinja2_pluralize import pluralize_dj from diff_cover.snippets import Snippet import six class DiffViolations(object): "...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n#!/usr/bin/env python\n\n\"\"\"\nmain.py -- Udacity conference server-side Python App Engine\n HTTP controller handlers for memcache & task queue access\n\n$Id$\n\ncreated by wesc on 2014 may 24\n\n\"\"\"\n\n__autho...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n\"\"\"\nmain.py -- Udacity conference server-side Python App Engine\n HTTP controller handlers for memcache & task queue access\n\n$Id$\n\ncreated by wesc on 2014 may 24\n\n\...
```python #!/usr/bin/env python """ main.py -- Udacity conference server-side Python App Engine HTTP controller handlers for memcache & task queue access $Id$ created by wesc on 2014 may 24 """ __author__ = 'wesc+api@google.com (Wesley Chun)' import webapp2 from google.appengine.api import app_identity from g...
[ { "content": "Replicate the source code:\n```python\n# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/\n# Copyright (c) 2010, Eucalyptus Systems, Inc.\n# Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton\n# www.bluepines.org\n# Copyright (c) 2012 42 Lines Inc., Jim Browne\n#\n# Permission ...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/\n# Copyright (c) 2010, Eucalyptus Systems, Inc.\n# Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton\n# www.bluepines.org\n# Copyright (c) 2012 42 Lines Inc., Jim Browne\n...
```python # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton # www.bluepines.org # Copyright (c) 2012 42 Lines Inc., Jim Browne # # Permission is hereby granted, free of charge, to any person obtainin...
[ { "content": "```python\n#!/usr/bin/env python\n\nfrom jsk_network_tools.msg import FC2OCS, OCS2FC\nfrom jsk_network_tools.silverhammer_util import *\nfrom threading import Lock, Thread\nfrom socket import *\nfrom struct import Struct\nimport os\nimport rospy\nimport signal\nimport sys\nimport roslib\nfrom rosl...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom jsk_network_tools.msg import FC2OCS, OCS2FC\nfrom jsk_network_tools.silverhammer_util import *\nfrom threading import Lock, Thread\nfrom socket import *\nfrom struct import Struct\nimport os\nimport rospy\nimport signal\nimport sys\nimport r...
```python #!/usr/bin/env python from jsk_network_tools.msg import FC2OCS, OCS2FC from jsk_network_tools.silverhammer_util import * from threading import Lock, Thread from socket import * from struct import Struct import os import rospy import signal import sys import roslib from roslib.message import get_message_class...
[ { "content": "```python\n# ----------------------------------------------------------------------------\n# Copyright 2015 Nervana Systems Inc.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the ...
[ { "content": "<|memory_start|>```python\n# ----------------------------------------------------------------------------\n# Copyright 2015 Nervana Systems Inc.\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 obtai...
```python # ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n# Copyright (C) 2008, OLPC\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 ...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n# Copyright (C) 2008, OLPC\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;...
```python # Copyright (C) 2008, OLPC # # 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 i...
[ { "content": "```python\nfrom collections import defaultdict, Iterable\nimport itertools\n\nimport numpy as np\nimport tensorflow as tf\nfrom six.moves import zip_longest\n\n\nNAME_COUNTERS = defaultdict(lambda: 0)\n\n\ndef generate_name(obj):\n \"\"\"Generate a unique name for the object in question\n\n ...
[ { "content": "<|memory_start|>```python\nfrom collections import defaultdict, Iterable\nimport itertools\n\nimport numpy as np\nimport tensorflow as tf\nfrom six.moves import zip_longest\n\n\nNAME_COUNTERS = defaultdict(lambda: 0)\n\n\ndef generate_name(obj):\n \"\"\"Generate a unique name for the object in ...
```python from collections import defaultdict, Iterable import itertools import numpy as np import tensorflow as tf from six.moves import zip_longest NAME_COUNTERS = defaultdict(lambda: 0) def generate_name(obj): """Generate a unique name for the object in question Returns a name of the form "{calling_cla...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# Copyright 2014, 2018 IBM Corp.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the Lice...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# Copyright 2014, 2018 IBM Corp.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a ...
```python # Copyright 2014, 2018 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n# Copyright Iris contributors\n#\n# This file is part of Iris and is released under the LGPL license.\n# See COPYING and COPYING.LESSER in the root of the repository for full\n# licensing details.\n\"\"\"\nA package providing :c...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# Copyright Iris contributors\n#\n# This file is part of Iris and is released under the LGPL license.\n# See COPYING and COPYING.LESSER in the root of the repository for full\n# licensing details.\n\"\"\"\nA pack...
```python # Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ A package providing :class:`iris.cube.Cube` analysis support. This module defines a suite of :class:`~iris.analy...
[ { "content": "Here is the snippet:\n```python\n# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:\n\n# Copyright 2016-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>\n#\n# This file is part of qutebrowser.\n#\n# qutebrowser is free software: you can redistribute it and/or modify\n# it under the terms ...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:\n\n# Copyright 2016-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>\n#\n# This file is part of qutebrowser.\n#\n# qutebrowser is free software: you can redistribute it and/or modify\n# it ...
```python # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # ...
[ { "content": "Here is a code file:\n```python\n\"\"\"Datatype validation.\"\"\"\n\n__all__ = ['failures', 'is_valid']\n\nfrom collections import defaultdict\n\nfrom datatype.tools import Choice, Literal, walk\n\n\ndef is_valid(datatype, value):\n \"\"\"Return boolean representing validity of `value` against ...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n\"\"\"Datatype validation.\"\"\"\n\n__all__ = ['failures', 'is_valid']\n\nfrom collections import defaultdict\n\nfrom datatype.tools import Choice, Literal, walk\n\n\ndef is_valid(datatype, value):\n \"\"\"Return boolean representing validity of ...
```python """Datatype validation.""" __all__ = ['failures', 'is_valid'] from collections import defaultdict from datatype.tools import Choice, Literal, walk def is_valid(datatype, value): """Return boolean representing validity of `value` against `datatype`.""" return not failures(datatype, value) def fa...
[ { "content": "Repeat the following code:\n```python\n#\n# Copyright 2009-2016 Red Hat, Inc.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n#\n# Copyright 2009-2016 Red Hat, Inc.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the ...
```python # # Copyright 2009-2016 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is di...
[ { "content": "```python\n\"\"\"\nTest client connections to a XMPP chat room\n\"\"\"\nimport math\nimport time\nimport bisect\nimport logging\nimport random\nfrom threading import Thread\n\nimport pytest\n\nfrom echochamber.utils import create_client_connections, establish_channel, find_available_port\nfrom ech...
[ { "content": "<|memory_start|>```python\n\"\"\"\nTest client connections to a XMPP chat room\n\"\"\"\nimport math\nimport time\nimport bisect\nimport logging\nimport random\nfrom threading import Thread\n\nimport pytest\n\nfrom echochamber.utils import create_client_connections, establish_channel, find_availabl...
```python """ Test client connections to a XMPP chat room """ import math import time import bisect import logging import random from threading import Thread import pytest from echochamber.utils import create_client_connections, establish_channel, find_available_port from echochamber.proxy import ProxyServer def re...
[ { "content": "Here is the script:\n```python\nimport os\nimport sys\nimport unittest\nimport threading\n\n# add the source directory to the path so the unit test framework can find it\nsys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'EPLaunchLite'))\n\ntry:\n from FileTypes im...
[ { "content": "Here is the script:\n<|memory_start|>```python\nimport os\nimport sys\nimport unittest\nimport threading\n\n# add the source directory to the path so the unit test framework can find it\nsys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'EPLaunchLite'))\n\ntry:\n f...
```python import os import sys import unittest import threading # add the source directory to the path so the unit test framework can find it sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'EPLaunchLite')) try: from FileTypes import FileTypes has_gtk = True except ImportError ...
[ { "content": "Here is the source code:\n```python\n#! /usr/bin/env python\nfrom __future__ import division,print_function\nfrom lingpy.data.derive import compile_model\nfrom scipy.spatial.distance import squareform\nfrom time import sleep\nfrom pickle import dump\n\nasjp = {}\n\nscore = open('score','r').read()...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n#! /usr/bin/env python\nfrom __future__ import division,print_function\nfrom lingpy.data.derive import compile_model\nfrom scipy.spatial.distance import squareform\nfrom time import sleep\nfrom pickle import dump\n\nasjp = {}\n\nscore = open('sc...
```python #! /usr/bin/env python from __future__ import division,print_function from lingpy.data.derive import compile_model from scipy.spatial.distance import squareform from time import sleep from pickle import dump asjp = {} score = open('score','r').read() score = score.split('\n') del score[-1] dicto = {} for l...
[ { "content": "Here is a code snippet:\n```python\n# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy o...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtai...
```python # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # 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/lice...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n\"\"\"Copyright 2019 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n https://www.a...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n\"\"\"Copyright 2019 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n ...
```python """Copyright 2019 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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so...
[ { "content": "Return the code exactly, with no changes:\n```python\nfrom __future__ import unicode_literals\nimport boto\nimport boto3\nimport boto.ec2.autoscale\nfrom boto.ec2.autoscale.launchconfig import LaunchConfiguration\nfrom boto.ec2.autoscale.group import AutoScalingGroup\nfrom boto.ec2.autoscale impor...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\nfrom __future__ import unicode_literals\nimport boto\nimport boto3\nimport boto.ec2.autoscale\nfrom boto.ec2.autoscale.launchconfig import LaunchConfiguration\nfrom boto.ec2.autoscale.group import AutoScalingGroup\nfrom boto.ec2...
```python from __future__ import unicode_literals import boto import boto3 import boto.ec2.autoscale from boto.ec2.autoscale.launchconfig import LaunchConfiguration from boto.ec2.autoscale.group import AutoScalingGroup from boto.ec2.autoscale import Tag import boto.ec2.elb import sure # noqa from moto import mock_aut...
[ { "content": "Return the code exactly, with no changes:\n```python\n# Copyright (C) 2015 Simon Biggs\n# This program is free software: you can redistribute it and/or\n# modify it under the terms of the GNU Affero General Public\n# License as published by the Free Software Foundation, either\n# version 3 of the ...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n# Copyright (C) 2015 Simon Biggs\n# This program is free software: you can redistribute it and/or\n# modify it under the terms of the GNU Affero General Public\n# License as published by the Free Software Foundation, either\n# v...
```python # Copyright (C) 2015 Simon Biggs # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public # License as published by the Free Software Foundation, either # version 3 of the License, or (at your option) any later version. # This program is dist...
[ { "content": "Replicate the source code:\n```python\n\"\"\"\r\nBasic building blocks for generic class based views.\r\n\r\nWe don't bind behaviour to http method handlers yet,\r\nwhich allows mixin classes to be composed in interesting ways.\r\n\"\"\"\r\nfrom __future__ import unicode_literals\r\n\r\nfrom djang...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n\"\"\"\r\nBasic building blocks for generic class based views.\r\n\r\nWe don't bind behaviour to http method handlers yet,\r\nwhich allows mixin classes to be composed in interesting ways.\r\n\"\"\"\r\nfrom __future__ import unicode_literals\r...
```python """ Basic building blocks for generic class based views. We don't bind behaviour to http method handlers yet, which allows mixin classes to be composed in interesting ways. """ from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.http import Http404...
[ { "content": "```python\n# -*- coding: utf-8 -*-\nimport os\n\n\ndef test_001_basic(settings, inspector):\n \"\"\"Looking for parents of basic sample\"\"\"\n sources = [\n os.path.join(settings.sample_path, 'main_basic.scss'),\n os.path.join(settings.sample_path, 'main_depth_import-3.scss'),...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport os\n\n\ndef test_001_basic(settings, inspector):\n \"\"\"Looking for parents of basic sample\"\"\"\n sources = [\n os.path.join(settings.sample_path, 'main_basic.scss'),\n os.path.join(settings.sample_path, 'main_depth_...
```python # -*- coding: utf-8 -*- import os def test_001_basic(settings, inspector): """Looking for parents of basic sample""" sources = [ os.path.join(settings.sample_path, 'main_basic.scss'), os.path.join(settings.sample_path, 'main_depth_import-3.scss'), os.path.join(settings.sample...
[ { "content": "Here is the script:\n```python\n# -*- coding: utf-8 -*-\nimport datetime\n\nfrom openerp import http\nfrom openerp.http import request\nfrom openerp import tools\nfrom openerp.tools.translate import _\n\n\nclass website_account(http.Controller):\n @http.route(['/my', '/my/home'], type='http', a...
[ { "content": "Here is the script:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport datetime\n\nfrom openerp import http\nfrom openerp.http import request\nfrom openerp import tools\nfrom openerp.tools.translate import _\n\n\nclass website_account(http.Controller):\n @http.route(['/my', '/my/home']...
```python # -*- coding: utf-8 -*- import datetime from openerp import http from openerp.http import request from openerp import tools from openerp.tools.translate import _ class website_account(http.Controller): @http.route(['/my', '/my/home'], type='http', auth="public", website=True) def account(self): ...
[ { "content": "```python\n# Abstract syntax tree for CODA IDL\n\n# ============================================================================\n# Scopes\n# ============================================================================\n\nclass DefScope:\n 'Mixin class for descriptors which are also scopes.'\n d...
[ { "content": "<|memory_start|>```python\n# Abstract syntax tree for CODA IDL\n\n# ============================================================================\n# Scopes\n# ============================================================================\n\nclass DefScope:\n 'Mixin class for descriptors which are al...
```python # Abstract syntax tree for CODA IDL # ============================================================================ # Scopes # ============================================================================ class DefScope: 'Mixin class for descriptors which are also scopes.' def __init__(self): self.str...
[ { "content": "Repeat the code precisely:\n```python\n# -*- coding: utf-8 -*-\nimport tornado.web\nimport tornado.ioloop\nfrom tornado.testing import AsyncHTTPTestCase\nfrom tortik.page import RequestHandler\nimport tornado.curl_httpclient\n\n\ndef first_postprocessor(handler, data, callback):\n callback(hand...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport tornado.web\nimport tornado.ioloop\nfrom tornado.testing import AsyncHTTPTestCase\nfrom tortik.page import RequestHandler\nimport tornado.curl_httpclient\n\n\ndef first_postprocessor(handler, data, callback):\n ...
```python # -*- coding: utf-8 -*- import tornado.web import tornado.ioloop from tornado.testing import AsyncHTTPTestCase from tortik.page import RequestHandler import tornado.curl_httpclient def first_postprocessor(handler, data, callback): callback(handler, data.replace('Hello,', 'Good')) def second_postproces...
[ { "content": "```python\n##\n## This file is part of the libsigrokdecode project.\n##\n## Copyright (C) 2014 Angus Gratton <gus@projectgus.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 published by\n## the Free Softw...
[ { "content": "<|memory_start|>```python\n##\n## This file is part of the libsigrokdecode project.\n##\n## Copyright (C) 2014 Angus Gratton <gus@projectgus.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 published by\n#...
```python ## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2014 Angus Gratton <gus@projectgus.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 Software Foundation; either version...
[ { "content": "Here is a code file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nProvides constants common in the Bluetooth HCI protocol.\n\"\"\"\n\nimport enum\n\nHCI_MAX_EVENT_SIZE = 260\n\n\nclass Status(enum.IntEnum):\n \"\"\"\n Collection of HCI return states.\n \"\"\"\n Success = 0x00\n Un...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nProvides constants common in the Bluetooth HCI protocol.\n\"\"\"\n\nimport enum\n\nHCI_MAX_EVENT_SIZE = 260\n\n\nclass Status(enum.IntEnum):\n \"\"\"\n Collection of HCI return states.\n \"\"\"\n Succes...
```python # -*- coding: utf-8 -*- """ Provides constants common in the Bluetooth HCI protocol. """ import enum HCI_MAX_EVENT_SIZE = 260 class Status(enum.IntEnum): """ Collection of HCI return states. """ Success = 0x00 UnknownHciCommand = 0x01 UnknownConnectionIdentifier = 0x02 Hardwar...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n#!/usr/bin/env python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#\n# Copyright (c) 2010-2011 OpenStack, LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file exce...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n#!/usr/bin/env python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n#\n# Copyright (c) 2010-2011 OpenStack, LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not us...
```python #!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2010-2011 OpenStack, 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.apach...
[ { "content": "```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom scipy.stats import binned_statistic as bin_stat\nfrom lif import *\nfrom syn import *\n\nprefs.codegen.target = 'numpy'\ndefaultclock.dt = 1*ms\n\nparams = LifParams(constant_input=3)\nparams.update(SynParams())\nneurons = LifNeurons(...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom scipy.stats import binned_statistic as bin_stat\nfrom lif import *\nfrom syn import *\n\nprefs.codegen.target = 'numpy'\ndefaultclock.dt = 1*ms\n\nparams = LifParams(constant_input=3)\nparams.update(SynParams())\nneuro...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- from scipy.stats import binned_statistic as bin_stat from lif import * from syn import * prefs.codegen.target = 'numpy' defaultclock.dt = 1*ms params = LifParams(constant_input=3) params.update(SynParams()) neurons = LifNeurons(1000, params) excitatory_synapses ...
[ { "content": "```python\nimport logging\nimport os\nimport pickle\nfrom collections import namedtuple\n\nimport gym\nimport numpy as np\n\nfrom catastrophe_wrapper import *\nfrom catastrophe_wrapper import CatastropheWrapper\nfrom classifier_tf import (SavedCatastropheBlockerTensorflow,\n ...
[ { "content": "<|memory_start|>```python\nimport logging\nimport os\nimport pickle\nfrom collections import namedtuple\n\nimport gym\nimport numpy as np\n\nfrom catastrophe_wrapper import *\nfrom catastrophe_wrapper import CatastropheWrapper\nfrom classifier_tf import (SavedCatastropheBlockerTensorflow,\n ...
```python import logging import os import pickle from collections import namedtuple import gym import numpy as np from catastrophe_wrapper import * from catastrophe_wrapper import CatastropheWrapper from classifier_tf import (SavedCatastropheBlockerTensorflow, SavedCatastropheClassifierTens...
[ { "content": "Here is a code file:\n```python\nfrom CommonClasses import *\r\nfrom solution import Solution\r\n\r\nclass TestSuite:\r\n \r\n def run(self):\r\n self.test000()\r\n self.test001()\r\n self.test002()\r\n self.test003()\r\n# self.test004()\r\n\r\n def tes...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nfrom CommonClasses import *\r\nfrom solution import Solution\r\n\r\nclass TestSuite:\r\n \r\n def run(self):\r\n self.test000()\r\n self.test001()\r\n self.test002()\r\n self.test003()\r\n# self.test004()\r\...
```python from CommonClasses import * from solution import Solution class TestSuite: def run(self): self.test000() self.test001() self.test002() self.test003() # self.test004() def test000(self): print 'test 000\n' ...
[ { "content": "Replicate the source code:\n```python\nimport collections\n\nimport mpi4py\nimport numpy\n\nimport chainer.cuda\nimport chainer.utils\nfrom chainermn.communicators import _communication_utility\nfrom chainermn.communicators._communication_utility import chunked_bcast_obj\nfrom chainermn.communicat...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\nimport collections\n\nimport mpi4py\nimport numpy\n\nimport chainer.cuda\nimport chainer.utils\nfrom chainermn.communicators import _communication_utility\nfrom chainermn.communicators._communication_utility import chunked_bcast_obj\nfrom chai...
```python import collections import mpi4py import numpy import chainer.cuda import chainer.utils from chainermn.communicators import _communication_utility from chainermn.communicators._communication_utility import chunked_bcast_obj from chainermn.communicators import _memory_utility from chainermn.communicators impo...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\n# TODO: Temporarily disabled due to importing old code into openshift-ansible\n# repo. We will work on these over time.\n# pylint: disable=bad-continuation,missing-docstring,no-self-use,invalid-name,no-value-for-parameter\n\nimport...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n# TODO: Temporarily disabled due to importing old code into openshift-ansible\n# repo. We will work on these over time.\n# pylint: disable=bad-continuation,missing-docstring,no-self-use,invalid-name,no-value-for-par...
```python # TODO: Temporarily disabled due to importing old code into openshift-ansible # repo. We will work on these over time. # pylint: disable=bad-continuation,missing-docstring,no-self-use,invalid-name,no-value-for-parameter import click import os import re import sys from ooinstall import openshift_ansible from ...
[ { "content": "Here is a code file:\n```python\n#!/usr/local/bin/python\n# VER=2.0.0.2\n# 09 FEB 2012\n\n\"\"\"\nfg UTILITIES\nrequires:\n + winscp for win32\n + pexpect 2.3 on linux\n\"\"\"\nimport re, sys, time, os, getpass, string, traceback\nfrom os import popen\nfrom optparse import OptionParser\nfrom subpr...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n#!/usr/local/bin/python\n# VER=2.0.0.2\n# 09 FEB 2012\n\n\"\"\"\nfg UTILITIES\nrequires:\n + winscp for win32\n + pexpect 2.3 on linux\n\"\"\"\nimport re, sys, time, os, getpass, string, traceback\nfrom os import popen\nfrom optparse import OptionPa...
```python #!/usr/local/bin/python # VER=2.0.0.2 # 09 FEB 2012 """ fg UTILITIES requires: + winscp for win32 + pexpect 2.3 on linux """ import re, sys, time, os, getpass, string, traceback from os import popen from optparse import OptionParser from subprocess import * try: import pexpect except: pass class fg...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\nfrom django.db import models\nfrom django.utils import timezone\nfrom django_extensions.db.models import TimeStampedModel\n\nfrom .managers import PartyQuerySet\n\n\nclass Party(TimeStampedModel):\n \"\"\"\n A UK...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\nfrom django.db import models\nfrom django.utils import timezone\nfrom django_extensions.db.models import TimeStampedModel\n\nfrom .managers import PartyQuerySet\n\n\nclass Party(TimeStampedModel):\n ...
```python from django.db import models from django.utils import timezone from django_extensions.db.models import TimeStampedModel from .managers import PartyQuerySet class Party(TimeStampedModel): """ A UK political party The canonical source of these parties is The Electoral Commission, with some e...
[ { "content": "```python\nimport webracer\nimport nose.plugins.attrib\nfrom . import utils\nfrom .apps import form_app\n\nutils.app_runner_setup(__name__, form_app.app, 8059)\n\n@nose.plugins.attrib.attr('client')\n@webracer.config(host='localhost', port=8059)\nclass RequestViaFormTest(webracer.WebTestCase):\n ...
[ { "content": "<|memory_start|>```python\nimport webracer\nimport nose.plugins.attrib\nfrom . import utils\nfrom .apps import form_app\n\nutils.app_runner_setup(__name__, form_app.app, 8059)\n\n@nose.plugins.attrib.attr('client')\n@webracer.config(host='localhost', port=8059)\nclass RequestViaFormTest(webracer.W...
```python import webracer import nose.plugins.attrib from . import utils from .apps import form_app utils.app_runner_setup(__name__, form_app.app, 8059) @nose.plugins.attrib.attr('client') @webracer.config(host='localhost', port=8059) class RequestViaFormTest(webracer.WebTestCase): def test_get_form_as_url(self):...
[ { "content": "Repeat the following code:\n```python\n\"\"\"test_import.py: Functional tests for code that imports raw data from\nscientists and writes data files formatted to be included in the package\ndistributions\n\"\"\"\n\nimport re\n\n__author__ = \"Joel Dubowy\"\n\nfrom eflookup.fccs2ef.importer im...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n\"\"\"test_import.py: Functional tests for code that imports raw data from\nscientists and writes data files formatted to be included in the package\ndistributions\n\"\"\"\n\nimport re\n\n__author__ = \"Joel Dubowy\"\n\nfrom eflookup.fcc...
```python """test_import.py: Functional tests for code that imports raw data from scientists and writes data files formatted to be included in the package distributions """ import re __author__ = "Joel Dubowy" from eflookup.fccs2ef.importer import ( Fccs2CoverTypeImporter, CoverType2EfGroupImporter, Ef...
[ { "content": "Return the code exactly, with no changes:\n```python\nimport codecs\nimport csv\nimport json\nimport re\nimport warnings\nimport codecs\nfrom openpyxl import load_workbook, Workbook\nfrom time import strftime\n\nfrom django.contrib.auth.models import User\nfrom django.forms.models import model_to_...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\nimport codecs\nimport csv\nimport json\nimport re\nimport warnings\nimport codecs\nfrom openpyxl import load_workbook, Workbook\nfrom time import strftime\n\nfrom django.contrib.auth.models import User\nfrom django.forms.models ...
```python import codecs import csv import json import re import warnings import codecs from openpyxl import load_workbook, Workbook from time import strftime from django.contrib.auth.models import User from django.forms.models import model_to_dict from django.http import JsonResponse, Http404, HttpResponse from django...
[ { "content": "Here is a code file:\n```python\n#!/usr/bin/env python\n# ----------------------------------------------------------------------\n# Numenta Platform for Intelligent Computing (NuPIC)\n# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement\n# with Numenta, Inc., for a separate license fo...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n#!/usr/bin/env python\n# ----------------------------------------------------------------------\n# Numenta Platform for Intelligent Computing (NuPIC)\n# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement\n# with Numenta, Inc., for a sep...
```python #!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and c...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\nimport pyclbr\nimport os\nfrom operator import itemgetter\n\n\ndef show_class(name, class_data):\n print('Class:', name)\n filename = os.path.basename(class_data.file)\n print(' File: {0} [{1}]'.format(...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\nimport pyclbr\nimport os\nfrom operator import itemgetter\n\n\ndef show_class(name, class_data):\n print('Class:', name)\n filename = os.path.basename(class_data.file)\n print(' File: {0...
```python import pyclbr import os from operator import itemgetter def show_class(name, class_data): print('Class:', name) filename = os.path.basename(class_data.file) print(' File: {0} [{1}]'.format( filename, class_data.lineno)) show_super_classes(name, class_data) show_methods(name, cla...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n'''\nEntry point module to start the interactive console.\n'''\nfrom _pydev_bundle._pydev_getopt import gnu_getopt\nfrom _pydev_comm.rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client\nfrom _pyd...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n'''\nEntry point module to start the interactive console.\n'''\nfrom _pydev_bundle._pydev_getopt import gnu_getopt\nfrom _pydev_comm.rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_c...
```python ''' Entry point module to start the interactive console. ''' from _pydev_bundle._pydev_getopt import gnu_getopt from _pydev_comm.rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client from _pydev_imps._pydev_saved_modules import thread start_new_thread = thread.start_new_thread try: ...
[ { "content": "Repeat the code precisely:\n```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author: Nicolas Bessi\n# Copyright 2013 Camptocamp SA\n#\n# This program is free software: you can redistribute it and/or modify\n# it un...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author: Nicolas Bessi\n# Copyright 2013 Camptocamp SA\n#\n# This program is free software: you can redistribute it and/or mo...
```python # -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2013 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 ...
[ { "content": "```python\nimport pyb\nfrom pyb import Pin\nfrom pyb import ExtInt\n\n# We need to use global properties here as any allocation of a memory (aka declaration of a variable)\n# during the read cycle causes non-acceptable delay and we are loosing data than\nnc = None\ngnd = None\nvcc = None\ndata = N...
[ { "content": "<|memory_start|>```python\nimport pyb\nfrom pyb import Pin\nfrom pyb import ExtInt\n\n# We need to use global properties here as any allocation of a memory (aka declaration of a variable)\n# during the read cycle causes non-acceptable delay and we are loosing data than\nnc = None\ngnd = None\nvcc ...
```python import pyb from pyb import Pin from pyb import ExtInt # We need to use global properties here as any allocation of a memory (aka declaration of a variable) # during the read cycle causes non-acceptable delay and we are loosing data than nc = None gnd = None vcc = None data = None timer = None micros = None ...
[ { "content": "```python\nfrom django import forms\nfrom django.conf import settings\nfrom django.http import HttpResponse, HttpResponseRedirect, Http404\nfrom account import models as amod\nfrom . import templater\nimport datetime\n\n\ndef process_request(request):\n '''Creates a reset password form to email ...
[ { "content": "<|memory_start|>```python\nfrom django import forms\nfrom django.conf import settings\nfrom django.http import HttpResponse, HttpResponseRedirect, Http404\nfrom account import models as amod\nfrom . import templater\nimport datetime\n\n\ndef process_request(request):\n '''Creates a reset passwor...
```python from django import forms from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, Http404 from account import models as amod from . import templater import datetime def process_request(request): '''Creates a reset password form to email a unique link to the user''' ...
[ { "content": "Repeat the code exactly as the original, including blank lines:\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 ro...
[ { "content": "Repeat the code exactly as the original, including blank lines:\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 i...
```python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Ch...
[ { "content": "```python\nfrom django.utils.translation import ugettext_lazy as _\nfrom horizon import exceptions\nfrom horizon import tabs\nimport json\nfrom crystal_dashboard.api import controllers as api\nfrom crystal_dashboard.dashboards.crystal import exceptions as sdsexception\nfrom crystal_dashboard.dashb...
[ { "content": "<|memory_start|>```python\nfrom django.utils.translation import ugettext_lazy as _\nfrom horizon import exceptions\nfrom horizon import tabs\nimport json\nfrom crystal_dashboard.api import controllers as api\nfrom crystal_dashboard.dashboards.crystal import exceptions as sdsexception\nfrom crystal...
```python from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tabs import json from crystal_dashboard.api import controllers as api from crystal_dashboard.dashboards.crystal import exceptions as sdsexception from crystal_dashboard.dashboards.crystal.controllers.con...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n\n# Copyright (C) 2016, Maximilian Köhl <mail@koehlma.de>\n#\n# This program is free software: you can redistribute it and/or modify it under\n# the terms of the GNU Lesser General Public License version 3 as published by\n# the Free Software Foundation.\n#\n# T...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n# Copyright (C) 2016, Maximilian Köhl <mail@koehlma.de>\n#\n# This program is free software: you can redistribute it and/or modify it under\n# the terms of the GNU Lesser General Public License version 3 as published by\n# the Free Software Fou...
```python # -*- coding: utf-8 -*- # Copyright (C) 2016, Maximilian Köhl <mail@koehlma.de> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed in t...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import find_packages, setup\n\nimport pycolorname\n\nwith open('requirements.txt') as requirements:\n required = requirements.read().splitlines()\n\nwith open(...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom setuptools import find_packages, setup\n\nimport pycolorname\n\nwith open('requirements.txt') as requirements:\n required = requirements.read().splitlines...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup import pycolorname with open('requirements.txt') as requirements: required = requirements.read().splitlines() with open('test-requirements.txt') as requirements: test_required = requirements.read().splitlines...
[ { "content": "Recreate the entire code block with identical formatting:\n```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 Lic...
[ { "content": "Recreate the entire code block with identical formatting:\n<|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 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": "Write out the code verbatim, preserving indentation and whitespace:\n```python\nbl_info = {\n \"name\": \"BVH Cache Manager\",\n \"category\": \"Render\",\n \"description\":\"Easily delete cached BVH data!\",\n \"location\":\"Properties Editor > Render > BVH Cache Manager\",\n \"aut...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\nbl_info = {\n \"name\": \"BVH Cache Manager\",\n \"category\": \"Render\",\n \"description\":\"Easily delete cached BVH data!\",\n \"location\":\"Properties Editor > Render > BVH Cache Manag...
```python bl_info = { "name": "BVH Cache Manager", "category": "Render", "description":"Easily delete cached BVH data!", "location":"Properties Editor > Render > BVH Cache Manager", "author":"Gregory Bolet", "version":"001", "warning":"Alpha Version" } import bpy import os import shutil ...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\n\"\"\"Download files with progress indicators.\n\"\"\"\nimport cgi\nimport logging\nimport mimetypes\nimport os\n\nfrom pipenv.patched.notpip._vendor import requests\nfrom pipenv.patched.notpip._vendor.requests.models import CON...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n\"\"\"Download files with progress indicators.\n\"\"\"\nimport cgi\nimport logging\nimport mimetypes\nimport os\n\nfrom pipenv.patched.notpip._vendor import requests\nfrom pipenv.patched.notpip._vendor.requests.m...
```python """Download files with progress indicators. """ import cgi import logging import mimetypes import os from pipenv.patched.notpip._vendor import requests from pipenv.patched.notpip._vendor.requests.models import CONTENT_CHUNK_SIZE from pipenv.patched.notpip._internal.models.index import PyPI from pipenv.patch...
[ { "content": "Here is a code file:\n```python\nfrom tests.conftest import get_token\n\n\ndef edit_post(postsetup, token, title='title', content='content', tags='',\n action='save', url='/1/edit'):\n return postsetup.app.post(url, data={\n 'token': token,\n 'title': title,\n 'conte...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nfrom tests.conftest import get_token\n\n\ndef edit_post(postsetup, token, title='title', content='content', tags='',\n action='save', url='/1/edit'):\n return postsetup.app.post(url, data={\n 'token': token,\n 'title': title,...
```python from tests.conftest import get_token def edit_post(postsetup, token, title='title', content='content', tags='', action='save', url='/1/edit'): return postsetup.app.post(url, data={ 'token': token, 'title': title, 'content': content, 'tags': tags, 'action':...
[ { "content": "Here is some code:\n```python\nfrom sys import getsizeof\nimport collections\nimport pickle\n# import timeit\nfrom sys import getsizeof\nimport time\nimport csv\nimport io\noutput = io.StringIO()\n\n\nwith open('../dictionary_Nikon_Snippet_Surroundings.pickle', 'rb') as f:\n d = (pickle.load(f)...
[ { "content": "Here is some code:\n<|memory_start|>```python\nfrom sys import getsizeof\nimport collections\nimport pickle\n# import timeit\nfrom sys import getsizeof\nimport time\nimport csv\nimport io\noutput = io.StringIO()\n\n\nwith open('../dictionary_Nikon_Snippet_Surroundings.pickle', 'rb') as f:\n d =...
```python from sys import getsizeof import collections import pickle # import timeit from sys import getsizeof import time import csv import io output = io.StringIO() with open('../dictionary_Nikon_Snippet_Surroundings.pickle', 'rb') as f: d = (pickle.load(f)) with open('/Users/sasa/Dropbox/1-Uni/CMPUT 692/Pr...
[ { "content": "Replicate the source code:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nDemo program of Hindi WordNet in Python. \n\nHere I demonstrate all the functionalities of the libraries, but note you can load only the pickle files which are necessary for your task rather than loading every pickle file. L...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nDemo program of Hindi WordNet in Python. \n\nHere I demonstrate all the functionalities of the libraries, but note you can load only the pickle files which are necessary for your task rather than loading ever...
```python # -*- coding: utf-8 -*- """ Demo program of Hindi WordNet in Python. Here I demonstrate all the functionalities of the libraries, but note you can load only the pickle files which are necessary for your task rather than loading every pickle file. Loading of pickle files takes time and memory. But once load...
[ { "content": "Replicate the source code:\n```python\n\"\"\"Create random dog names\"\"\"\nimport random\nfrom functools import reduce\n\nfrom dog_list import DOGS\n\n\ndef word_iter(words):\n \"\"\"iterate on words\"\"\"\n word = []\n for char in words:\n if char in ' \\n\\t':\n if wo...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n\"\"\"Create random dog names\"\"\"\nimport random\nfrom functools import reduce\n\nfrom dog_list import DOGS\n\n\ndef word_iter(words):\n \"\"\"iterate on words\"\"\"\n word = []\n for char in words:\n if char in ' \\n\\t':\n ...
```python """Create random dog names""" import random from functools import reduce from dog_list import DOGS def word_iter(words): """iterate on words""" word = [] for char in words: if char in ' \n\t': if word: yield ''.join(word) word = [] els...
[ { "content": "Repeat the full code snippet:\n```python\n# wsse/server/drf/tests/test_authentication.py\n# coding=utf-8\n# pywsse\n# Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso\n# Date: September 1st, 2016\n# Description: Test DRF WSSE Authentication backend.\n\nimport contextlib\n...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# wsse/server/drf/tests/test_authentication.py\n# coding=utf-8\n# pywsse\n# Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso\n# Date: September 1st, 2016\n# Description: Test DRF WSSE Authentication backend.\n\nimp...
```python # wsse/server/drf/tests/test_authentication.py # coding=utf-8 # pywsse # Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso # Date: September 1st, 2016 # Description: Test DRF WSSE Authentication backend. import contextlib import hashlib import base64 import datetime import itertools ...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n#\n\nfrom __future__ import absolute_import, unicode_literals\n\nimport os\n\nfrom PIL import Image, ExifTags\nimport magic\n\nfrom oclubs.access import fs\nfrom oclubs.exceptions impor...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n#\n\nfrom __future__ import absolute_import, unicode_literals\n\nimport os\n\nfrom PIL import Image, ExifTags\nimport magic\n\nfrom oclubs.access import fs\nfrom oclubs....
```python #!/usr/bin/env python # -*- coding: UTF-8 -*- # from __future__ import absolute_import, unicode_literals import os from PIL import Image, ExifTags import magic from oclubs.access import fs from oclubs.exceptions import UploadNotSupported from oclubs.objs.base import BaseObject, Property ORIENTATION = nex...
[ { "content": "Repeat the full code snippet:\n```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author: Guewen Baconnier\n# Copyright 2013 Camptocamp SA\n#\n# This program is free software: you can redistribute it and/or modify\n# ...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# Author: Guewen Baconnier\n# Copyright 2013 Camptocamp SA\n#\n# This program is free software: you can redistribute it and...
```python # -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 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 ...
[ { "content": "```python\n# This file holds physical constants and reads atomic weights.\nimport sys\nimport re\nimport os\nimport inspect\n###############\n\n# Physical Constants\n\nPHYSICAL_CONSTANTS = {\n 'h' : 6.626070E-34, # Planck's constants in J * s\n 'c' : 2.997925E+10, # speed of light in units...
[ { "content": "<|memory_start|>```python\n# This file holds physical constants and reads atomic weights.\nimport sys\nimport re\nimport os\nimport inspect\n###############\n\n# Physical Constants\n\nPHYSICAL_CONSTANTS = {\n 'h' : 6.626070E-34, # Planck's constants in J * s\n 'c' : 2.997925E+10, # speed o...
```python # This file holds physical constants and reads atomic weights. import sys import re import os import inspect ############### # Physical Constants PHYSICAL_CONSTANTS = { 'h' : 6.626070E-34, # Planck's constants in J * s 'c' : 2.997925E+10, # speed of light in units of cm/s 'Eh' : 4.359745E-18, ...
[ { "content": "```python\n# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nfrom __future__ import absolute_import, division, print_function\n\nINCLUDES = \"\"\"\n#include <opens...
[ { "content": "<|memory_start|>```python\n# This file is dual licensed under the terms of the Apache License, Version\n# 2.0, and the BSD License. See the LICENSE file in the root of this repository\n# for complete details.\n\nfrom __future__ import absolute_import, division, print_function\n\nINCLUDES = \"\"\"\...
```python # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function INCLUDES = """ #include <openssl/x509v3.h> /* * This is part ...
[ { "content": "Repeat the code exactly:\n```python\n#!/bin/env python\n\n# Automatically translated python version of \n# OpenSceneGraph example program \"osgscalarbar\"\n# !!! This program will need manual tuning before it will work. !!!\n\nimport sys\n\nfrom osgpypp import osg\nfrom osgpypp import osgDB\nfrom ...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n#!/bin/env python\n\n# Automatically translated python version of \n# OpenSceneGraph example program \"osgscalarbar\"\n# !!! This program will need manual tuning before it will work. !!!\n\nimport sys\n\nfrom osgpypp import osg\nfrom osgpypp imp...
```python #!/bin/env python # Automatically translated python version of # OpenSceneGraph example program "osgscalarbar" # !!! This program will need manual tuning before it will work. !!! import sys from osgpypp import osg from osgpypp import osgDB from osgpypp import osgGA from osgpypp import osgSim from osgpypp ...
[ { "content": "Provide a verbatim copy of the code:\n```python\nimport os\nimport sys\n\nneighborDict = {} #dictionary containing neighbors of each node\nweightDict = {} #dictionary containing weights of edges\nfeatureDict = {} #dictionary containing features of each node\nfeatureDictTotal = {} #dictionay contai...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\nimport os\nimport sys\n\nneighborDict = {} #dictionary containing neighbors of each node\nweightDict = {} #dictionary containing weights of edges\nfeatureDict = {} #dictionary containing features of each node\nfeatureDictTotal = {} #...
```python import os import sys neighborDict = {} #dictionary containing neighbors of each node weightDict = {} #dictionary containing weights of edges featureDict = {} #dictionary containing features of each node featureDictTotal = {} #dictionay containing all listed features of each node totalFeatureDict = {} #dition...
[ { "content": "Return the code exactly, with no changes:\n```python\n\"\"\"evaluation_framework.py -- All that is needed to evaluate feature selection algorithms.\"\"\"\n\nimport numpy as np\nimport tables as tb\nimport subprocess\nimport shlex\nimport math\n\nfrom sklearn import linear_model, metrics, model_sel...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n\"\"\"evaluation_framework.py -- All that is needed to evaluate feature selection algorithms.\"\"\"\n\nimport numpy as np\nimport tables as tb\nimport subprocess\nimport shlex\nimport math\n\nfrom sklearn import linear_model, me...
```python """evaluation_framework.py -- All that is needed to evaluate feature selection algorithms.""" import numpy as np import tables as tb import subprocess import shlex import math from sklearn import linear_model, metrics, model_selection def consistency_index(sel1, sel2, num_features): """ Compute the co...
[ { "content": "Here is the snippet:\n```python\nimport os\nimport random\nimport time\n\nimport json\nfrom locust import HttpLocust, TaskSet, task\n\nfrom lib.baseTaskSet import baseTaskSet\n\n# TODO - make these config-driven\nfrom lib.openstack.keystone import get_auth_token\nfrom lib.openstack.cinder import l...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\nimport os\nimport random\nimport time\n\nimport json\nfrom locust import HttpLocust, TaskSet, task\n\nfrom lib.baseTaskSet import baseTaskSet\n\n# TODO - make these config-driven\nfrom lib.openstack.keystone import get_auth_token\nfrom lib.openstack...
```python import os import random import time import json from locust import HttpLocust, TaskSet, task from lib.baseTaskSet import baseTaskSet # TODO - make these config-driven from lib.openstack.keystone import get_auth_token from lib.openstack.cinder import list_volumes from lib.openstack.cinder import list_volume...
[ { "content": "```python\n# Copyright (c) 2011-present, Facebook, Inc. All rights reserved.\n# This source code is licensed under both the GPLv2 (found in the\n# COPYING file in the root directory) and Apache 2.0 License\n# (found in the LICENSE.Apache file in the root directory).\n\nfrom advisor.rule_parser...
[ { "content": "<|memory_start|>```python\n# Copyright (c) 2011-present, Facebook, Inc. All rights reserved.\n# This source code is licensed under both the GPLv2 (found in the\n# COPYING file in the root directory) and Apache 2.0 License\n# (found in the LICENSE.Apache file in the root directory).\n\nfrom adv...
```python # Copyright (c) 2011-present, Facebook, Inc. All rights reserved. # This source code is licensed under both the GPLv2 (found in the # COPYING file in the root directory) and Apache 2.0 License # (found in the LICENSE.Apache file in the root directory). from advisor.rule_parser import RulesSpec from advis...
[ { "content": "Here is the snippet:\n```python\n##\n# Copyright 2013-2021 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 the snippet:\n<|memory_start|>```python\n##\n# Copyright 2013-2021 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 Supercompu...
```python ## # Copyright 2013-2021 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 Fou...
[ { "content": "Here is the code block:\n```python\n# Legal boring crap follows. In simple english, you can use this\n# code in your own project, be your project commercial or free.\n# Just be sure to include the license and stuff. The \"copyright\"\n# here is just for technical reasons.\n#\n# Copyright 2011, Phi...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n# Legal boring crap follows. In simple english, you can use this\n# code in your own project, be your project commercial or free.\n# Just be sure to include the license and stuff. The \"copyright\"\n# here is just for technical reasons.\n#\n# Cop...
```python # Legal boring crap follows. In simple english, you can use this # code in your own project, be your project commercial or free. # Just be sure to include the license and stuff. The "copyright" # here is just for technical reasons. # # Copyright 2011, Philip Peterson. # # This file is part of Pumpkinpy. # # ...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n\"\"\"\nccp.client\n~~~~~~~~~~~~\n\nThis module implements the Changelog API.\n\n:license: MIT, see LICENSE for more details.\n\n\"\"\"\n\nimport sys\nimport requests\nimport json\nfrom time import time\nimport logging\nfrom pkg_resources import get_distribution...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nccp.client\n~~~~~~~~~~~~\n\nThis module implements the Changelog API.\n\n:license: MIT, see LICENSE for more details.\n\n\"\"\"\n\nimport sys\nimport requests\nimport json\nfrom time import time\nimport logging\nfrom pkg_resources import ...
```python # -*- coding: utf-8 -*- """ ccp.client ~~~~~~~~~~~~ This module implements the Changelog API. :license: MIT, see LICENSE for more details. """ import sys import requests import json from time import time import logging from pkg_resources import get_distribution API_HOST = "localhost" API_PORT = 5000 SEV...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\nimport zstackwoodpecker.test_state as ts_header\nimport os\nTestAction = ts_header.TestAction\ndef path():\n\n return dict(initial_formation=\"template5\", checking_point=8, path_list=[\n\t\t[TestAction.create_vm, 'vm1', ],\n...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\nimport zstackwoodpecker.test_state as ts_header\nimport os\nTestAction = ts_header.TestAction\ndef path():\n\n return dict(initial_formation=\"template5\", checking_point=8, path_list=[\n\t\t[TestAction.create...
```python import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, path_list=[ [TestAction.create_vm, 'vm1', ], [TestAction.create_volume, 'volume1', 'flag=scsi'], [TestAction.attach_volume, 'vm1', 'vo...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n# -*- coding: utf-8 -*-\n\nEGSPHAN_EXT = \".egsphant\"\nEGSINP_EXT = \".egsinp\"\nEGSPHSF_EXT = \".egsphsp1\"\n\ndef make_cup_prefix(radUnit, outerCup, innerCupSer, innerCupNum):\n \"\"\"\n Makes filename prefix given RU,...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nEGSPHAN_EXT = \".egsphant\"\nEGSINP_EXT = \".egsinp\"\nEGSPHSF_EXT = \".egsphsp1\"\n\ndef make_cup_prefix(radUnit, outerCup, innerCupSer, innerCupNum):\n \"\"\"\n Makes filename ...
```python # -*- coding: utf-8 -*- EGSPHAN_EXT = ".egsphant" EGSINP_EXT = ".egsinp" EGSPHSF_EXT = ".egsphsp1" def make_cup_prefix(radUnit, outerCup, innerCupSer, innerCupNum): """ Makes filename prefix given RU, OC, IC info Parameters ---------- radUnit: string radiation unit ...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\nfrom ..osid import objects as osid_objects\nfrom ..osid import markers as osid_markers\nfrom ..osid import sessions as osid_sessions\n\n\nclass Grade(osid_objects.OsidObject, osid_markers.Subjugateable):\n \"\"\"A ``Grade``.\n\n ...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\nfrom ..osid import objects as osid_objects\nfrom ..osid import markers as osid_markers\nfrom ..osid import sessions as osid_sessions\n\n\nclass Grade(osid_objects.OsidObject, osid_markers.Subjugateable):\n \"\"\"A ``...
```python from ..osid import objects as osid_objects from ..osid import markers as osid_markers from ..osid import sessions as osid_sessions class Grade(osid_objects.OsidObject, osid_markers.Subjugateable): """A ``Grade``. Grades represent qualified performance levels defined within some grading system. ...