prompt listlengths 1 1 | compression_prompt listlengths 1 1 | target stringlengths 1.03k 828k |
|---|---|---|
[
{
"content": "```python\n# Copyright (c) 2012 NetApp, 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/l... | [
{
"content": "<|memory_start|>```python\n# Copyright (c) 2012 NetApp, 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://... | ```python
# Copyright (c) 2012 NetApp, 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
#
# Unles... |
[
{
"content": "Here is the source code:\n```python\n#!/usr/bin/env python\n# Copyright 2016 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\nimport decorators\nimport logging\nimport unittest\n\nfrom trace_test imp... | [
{
"content": "Here is the source code:\n<|memory_start|>```python\n#!/usr/bin/env python\n# Copyright 2016 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\nimport decorators\nimport logging\nimport unittest\n\nfro... | ```python
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import decorators
import logging
import unittest
from trace_test import TraceTest
#from .trace_test import TraceTest
def gen... |
[
{
"content": "Write the code verbatim:\n```python\nimport fcntl\nimport os\n\n# FROM: http://code.activestate.com/recipes/577911-context-manager-for-a-daemon-pid-file/\nclass PidFile(object):\n \"\"\"Context manager that locks a pid file. Implemented as class\n not generator because daemon.py is calling ... | [
{
"content": "Write the code verbatim:\n<|memory_start|>```python\nimport fcntl\nimport os\n\n# FROM: http://code.activestate.com/recipes/577911-context-manager-for-a-daemon-pid-file/\nclass PidFile(object):\n \"\"\"Context manager that locks a pid file. Implemented as class\n not generator because daemo... | ```python
import fcntl
import os
# FROM: http://code.activestate.com/recipes/577911-context-manager-for-a-daemon-pid-file/
class PidFile(object):
"""Context manager that locks a pid file. Implemented as class
not generator because daemon.py is calling .__exit__() with no parameters
instead of the None, No... |
[
{
"content": "Return the code exactly, with no changes:\n```python\n\"\"\"This code does not work as for it will raise connection error\"\"\"\nimport requests\nfrom bs4 import BeautifulSoup\nimport re\nfrom time import sleep\n\ndef is_video(td):\n\t\"\"\"it is a video if two prerequisites\"\"\"\n\tpricelabels =... | [
{
"content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n\"\"\"This code does not work as for it will raise connection error\"\"\"\nimport requests\nfrom bs4 import BeautifulSoup\nimport re\nfrom time import sleep\n\ndef is_video(td):\n\t\"\"\"it is a video if two prerequisites\"\"\"\... | ```python
"""This code does not work as for it will raise connection error"""
import requests
from bs4 import BeautifulSoup
import re
from time import sleep
def is_video(td):
"""it is a video if two prerequisites"""
pricelabels = td('span', 'pricelabel')
return(len(pricelabels) == 1 and
pricelabels[0].text.strip... |
[
{
"content": "```python\n#!/usr/bin/env python\n# coding:utf-8\n# Contributor:\n# fffonion <fffonion@gmail.com>\n\nimport importlib\nfrom ..const import *\nfrom . import en_us as lng_fallback\n\ntry:\n _locale = LOCALE.lower() if LOCALE else 'en_us'\n if _locale in ('zh_cn', 'zh_sg'):\n ... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/env python\n# coding:utf-8\n# Contributor:\n# fffonion <fffonion@gmail.com>\n\nimport importlib\nfrom ..const import *\nfrom . import en_us as lng_fallback\n\ntry:\n _locale = LOCALE.lower() if LOCALE else 'en_us'\n if _locale in ('zh_cn', 'z... | ```python
#!/usr/bin/env python
# coding:utf-8
# Contributor:
# fffonion <fffonion@gmail.com>
import importlib
from ..const import *
from . import en_us as lng_fallback
try:
_locale = LOCALE.lower() if LOCALE else 'en_us'
if _locale in ('zh_cn', 'zh_sg'):
_locale = 'zh_hans'
elif _loca... |
[
{
"content": "Recreate the original code text:\n```python\n#!/usr/bin/python\n\n\"\"\"\n Read mutmat.snp.tsv (tab delimited file with snps)\n and create a table for hotspot analysis\n\"\"\"\n\nimport sys\n\nclass Interval:\n\tdef __init__(self, start, stop, gene):\n\t\tself.start = start\n\t\tself.stop = s... | [
{
"content": "Recreate the original code text:\n<|memory_start|>```python\n#!/usr/bin/python\n\n\"\"\"\n Read mutmat.snp.tsv (tab delimited file with snps)\n and create a table for hotspot analysis\n\"\"\"\n\nimport sys\n\nclass Interval:\n\tdef __init__(self, start, stop, gene):\n\t\tself.start = start\n\t... | ```python
#!/usr/bin/python
"""
Read mutmat.snp.tsv (tab delimited file with snps)
and create a table for hotspot analysis
"""
import sys
class Interval:
def __init__(self, start, stop, gene):
self.start = start
self.stop = stop
self.gene = gene
def findGene(intervals, pos, sindex, eindex):
if eind... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\n#!/usr/bin/python\n#\n# Copyright 2008 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtai... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n#!/usr/bin/python\n#\n# Copyright 2008 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\... | ```python
#!/usr/bin/python
#
# Copyright 2008 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
[
{
"content": "```python\nimport numpy as np\nimport pandas as pd\nimport nltk\nfrom nltk.stem.snowball import SnowballStemmer\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom bs4 import BeautifulSoup\nimport re\nimport os\nimport codecs\nfrom sklearn import feature_extraction\nfrom sklearn.clu... | [
{
"content": "<|memory_start|>```python\nimport numpy as np\nimport pandas as pd\nimport nltk\nfrom nltk.stem.snowball import SnowballStemmer\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom bs4 import BeautifulSoup\nimport re\nimport os\nimport codecs\nfrom sklearn import feature_extraction\n... | ```python
import numpy as np
import pandas as pd
import nltk
from nltk.stem.snowball import SnowballStemmer
from sklearn.feature_extraction.text import TfidfVectorizer
from bs4 import BeautifulSoup
import re
import os
import codecs
from sklearn import feature_extraction
from sklearn.cluster import KMeans
from pprint im... |
[
{
"content": "Provide an exact copy of the source code:\n```python\n# -*- coding: utf-8 -*-\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
{
"content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the L... | ```python
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
[
{
"content": "```python\n# TASK\n# This should be a user plug-in\n\nfrom __future__ import print_function\nimport os\n\nclass Task:\n\n def __init__(self, logger, output, script, parallelism, number, params):\n self.logger = logger\n self.process = None\n self.fd = None\n self.out... | [
{
"content": "<|memory_start|>```python\n# TASK\n# This should be a user plug-in\n\nfrom __future__ import print_function\nimport os\n\nclass Task:\n\n def __init__(self, logger, output, script, parallelism, number, params):\n self.logger = logger\n self.process = None\n self.fd = None\n... | ```python
# TASK
# This should be a user plug-in
from __future__ import print_function
import os
class Task:
def __init__(self, logger, output, script, parallelism, number, params):
self.logger = logger
self.process = None
self.fd = None
self.output = output
self.script = ... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\n\"\"\"\nRESTx: Sane, simple and effective data publishing and integration. \n\nCopyright (C) 2010 MuleSoft Inc. http://www.mulesoft.com\n\nThis program is free software: you can redistribute it and/or modify \nit under the ... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n\"\"\"\nRESTx: Sane, simple and effective data publishing and integration. \n\nCopyright (C) 2010 MuleSoft Inc. http://www.mulesoft.com\n\nThis program is free software: you can redistribute it and/or modify... | ```python
"""
RESTx: Sane, simple and effective data publishing and integration.
Copyright (C) 2010 MuleSoft Inc. http://www.mulesoft.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, eith... |
[
{
"content": "Repeat the code precisely as written (spacing intact):\n```python\nfrom collections import namedtuple\n \nentry = namedtuple('entry', 'qname flag rname pos mapq cigar rnext pnext tlen seq qual')\n\nVALID_HD_TAGS = ['VN', 'SO']\nVALID_SQ_TAGS = ['SN', 'LN', 'AS', 'M5', 'SP', 'UR']\n\nREQUIRED_HD_TA... | [
{
"content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\nfrom collections import namedtuple\n \nentry = namedtuple('entry', 'qname flag rname pos mapq cigar rnext pnext tlen seq qual')\n\nVALID_HD_TAGS = ['VN', 'SO']\nVALID_SQ_TAGS = ['SN', 'LN', 'AS', 'M5', 'SP', 'UR']\n... | ```python
from collections import namedtuple
entry = namedtuple('entry', 'qname flag rname pos mapq cigar rnext pnext tlen seq qual')
VALID_HD_TAGS = ['VN', 'SO']
VALID_SQ_TAGS = ['SN', 'LN', 'AS', 'M5', 'SP', 'UR']
REQUIRED_HD_TAGS = ['VN']
REQUIRED_SQ_TAGS = ['SN', 'LN']
class SamHeader( object ):
def __init... |
[
{
"content": "```python\n#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n# test_data_root.py\nimport os\nimport sys\nimport unittest\nimport time\nimport yaml\n\nroot_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + \"..\" ) \ndata_path = os.path.join(root_folder, 'aikif', 'data', 'co... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n# test_data_root.py\nimport os\nimport sys\nimport unittest\nimport time\nimport yaml\n\nroot_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + \"..\" ) \ndata_path = os.path.join(root_folder, 'aik... | ```python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# test_data_root.py
import os
import sys
import unittest
import time
import yaml
root_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + ".." )
data_path = os.path.join(root_folder, 'aikif', 'data', 'core')
yaml_file = os.path.join(data_... |
[
{
"content": "Write the code verbatim:\n```python\n#!/usr/bin/env python\n#\n# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)\n# Copyright (c) 1997-2015 California Institute of Technology.\n# License: 3-clause BSD. The full license text is available at:\n# - http://trac.mystic.cacr.caltech.edu/pro... | [
{
"content": "Write the code verbatim:\n<|memory_start|>```python\n#!/usr/bin/env python\n#\n# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)\n# Copyright (c) 1997-2015 California Institute of Technology.\n# License: 3-clause BSD. The full license text is available at:\n# - http://trac.mystic.cacr... | ```python
#!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 1997-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE
"""
Testing the pol... |
[
{
"content": "Here is the source code:\n```python\nimport scrapy\nfrom scrapy.spiders import Spider\nfrom scrapy import Request\nimport re\nfrom scrapy.selector import Selector\nfrom xiaomi_appstore_crawler.items import XiaomiAppstoreCrawlerItem\n\nclass XiaomiSpider(Spider):\n name = \"xiaomi\"\n allowed... | [
{
"content": "Here is the source code:\n<|memory_start|>```python\nimport scrapy\nfrom scrapy.spiders import Spider\nfrom scrapy import Request\nimport re\nfrom scrapy.selector import Selector\nfrom xiaomi_appstore_crawler.items import XiaomiAppstoreCrawlerItem\n\nclass XiaomiSpider(Spider):\n name = \"xiaom... | ```python
import scrapy
from scrapy.spiders import Spider
from scrapy import Request
import re
from scrapy.selector import Selector
from xiaomi_appstore_crawler.items import XiaomiAppstoreCrawlerItem
class XiaomiSpider(Spider):
name = "xiaomi"
allowed_domains = ["app.mi.com"]
start_urls = [
"http:... |
[
{
"content": "```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport re\nimport uuid\n\n_INVISIBLE_CHARS = (\n '\\u200b',\n '\\u200c',\n '\\u200d',\n '\\ufeff',\n)\n_INVISIBLE_MAP = dict(zip(\n '0123456789abcdef',\n (''.join((i, j)) for i in _INVISIBLE_CHARS for j ... | [
{
"content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport re\nimport uuid\n\n_INVISIBLE_CHARS = (\n '\\u200b',\n '\\u200c',\n '\\u200d',\n '\\ufeff',\n)\n_INVISIBLE_MAP = dict(zip(\n '0123456789abcdef',\n (''.join((i, j)) for i in _INVISI... | ```python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import uuid
_INVISIBLE_CHARS = (
'\u200b',
'\u200c',
'\u200d',
'\ufeff',
)
_INVISIBLE_MAP = dict(zip(
'0123456789abcdef',
(''.join((i, j)) for i in _INVISIBLE_CHARS for j in _INVISIBLE_CHARS),
))
_INVISIBLE_REVE... |
[
{
"content": "```python\n# Foremast - Pipeline Tooling\n#\n# Copyright 2018 Gogo, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org... | [
{
"content": "<|memory_start|>```python\n# Foremast - Pipeline Tooling\n#\n# Copyright 2018 Gogo, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:... | ```python
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... |
[
{
"content": "Here is a code file:\n```python\n# Copyright 2016-2017, Fabien Boucher\n# Copyright 2016-2017, Red Hat\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n# Copyright 2016-2017, Fabien Boucher\n# Copyright 2016-2017, Red Hat\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Lice... | ```python
# Copyright 2016-2017, Fabien Boucher
# Copyright 2016-2017, Red Hat
#
# 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
#
# Unle... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n#\n# --- BEGIN_HEADER ---\n#\n# webserver - [insert a few words of module description on this line]\n# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter\n#\n# This file is part of... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n#\n# --- BEGIN_HEADER ---\n#\n# webserver - [insert a few words of module description on this line]\n# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter\n#\n# This... | ```python
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# webserver - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under th... |
[
{
"content": "Reproduce the code exactly as provided (keep formatting):\n```python\nimport time\nimport threading\nimport threadactive\n\nclass BackWorker(threadactive.Agent):\n def tick(self):\n threadactive.Agent.tick(self)\n print(\"[%s][%d] front\" % (threading.current_thread().getName(), t... | [
{
"content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\nimport time\nimport threading\nimport threadactive\n\nclass BackWorker(threadactive.Agent):\n def tick(self):\n threadactive.Agent.tick(self)\n print(\"[%s][%d] front\" % (threading.current_threa... | ```python
import time
import threading
import threadactive
class BackWorker(threadactive.Agent):
def tick(self):
threadactive.Agent.tick(self)
print("[%s][%d] front" % (threading.current_thread().getName(), time.clock()) )
self.print_in_front2()
self.print_in_back()
time.sle... |
[
{
"content": "Provide a verbatim copy of the code:\n```python\n#!/usr/bin/python\nfrom BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer\nfrom os import curdir, sep\nimport sys, getopt\nimport cgi\n\nclass ServerHandler(BaseHTTPRequestHandler):\n\n\t# Handler for the GET requests\n\tdef do_GET(self):\n\t\... | [
{
"content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n#!/usr/bin/python\nfrom BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer\nfrom os import curdir, sep\nimport sys, getopt\nimport cgi\n\nclass ServerHandler(BaseHTTPRequestHandler):\n\n\t# Handler for the GET requests\n\tdef do... | ```python
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
from os import curdir, sep
import sys, getopt
import cgi
class ServerHandler(BaseHTTPRequestHandler):
# Handler for the GET requests
def do_GET(self):
if self.path=="/":
self.path="/app/views/index.html"
try:
# Check... |
[
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n\nclass Migration(SchemaMigration):\n\n def... | [
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n\nclass Migration(SchemaMigrat... | ```python
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Pagina.image'
db.add_column(u'manga_pagina', 'i... |
[
{
"content": "```python\n# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n\nclass Migration(SchemaMigration):\n\n def forwards(self, orm):\n # Deleting field 'WorkFlowStep.depth'\... | [
{
"content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n\nclass Migration(SchemaMigration):\n\n def forwards(self, orm):\n # Deleting field 'Work... | ```python
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'WorkFlowStep.depth'
db.delete_column(u'calc_w... |
[
{
"content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# storecmds.py \n# Store the requested commands and arguments \n# until given the go-ahead to run them. \n\n# The TECO commands we want are - \n# Files - Read, write, save, close. \n# Lines - Move between lines, within lines. G... | [
{
"content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# storecmds.py \n# Store the requested commands and arguments \n# until given the go-ahead to run them. \n\n# The TECO commands we want are - \n# Files - Read, write, save, close. \n# Lines - Move between lines,... | ```python
# storecmds.py
# Store the requested commands and arguments
# until given the go-ahead to run them.
# The TECO commands we want are -
# Files - Read, write, save, close.
# Lines - Move between lines, within lines. Go to a line.
# Move "x" lines up or down. Move "x" bytes back or forward.
# Edi... |
[
{
"content": "Recreate the original code text:\n```python\n# Code for line numbers\n# https://stackoverflow.com/questions/40386194/create-text-area-textedit-with-line-number-in-pyqt-5\n\nfrom PyQt4.Qt import Qt\nfrom PyQt4.QtCore import QRect\nfrom PyQt4.QtCore import QSize\nfrom PyQt4.QtCore import SIGNAL\nfro... | [
{
"content": "Recreate the original code text:\n<|memory_start|>```python\n# Code for line numbers\n# https://stackoverflow.com/questions/40386194/create-text-area-textedit-with-line-number-in-pyqt-5\n\nfrom PyQt4.Qt import Qt\nfrom PyQt4.QtCore import QRect\nfrom PyQt4.QtCore import QSize\nfrom PyQt4.QtCore im... | ```python
# Code for line numbers
# https://stackoverflow.com/questions/40386194/create-text-area-textedit-with-line-number-in-pyqt-5
from PyQt4.Qt import Qt
from PyQt4.QtCore import QRect
from PyQt4.QtCore import QSize
from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QColor
from PyQt4.QtGui import QPainter
fro... |
[
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n## begin license ##\n# \n# \"Meresco Examples\" is a project demonstrating some of the\n# features of various components of the \"Meresco Suite\".\n# Also see http://meresco.org. \n# \n# Copyright (C) 2007-2008 S... | [
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n## begin license ##\n# \n# \"Meresco Examples\" is a project demonstrating some of the\n# features of various components of the \"Meresco Suite\".\n# Also see http://meresco.org. \n# \n# Copyright... | ```python
## begin license ##
#
# "Meresco Examples" is a project demonstrating some of the
# features of various components of the "Meresco Suite".
# Also see http://meresco.org.
#
# Copyright (C) 2007-2008 SURF Foundation. http://www.surf.nl
# Copyright (C) 2007-2010 Seek You Too (CQ2) http://www.cq2.nl
# Copyrigh... |
[
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# -*- coding: utf-8 -*-\n\n\n# Andy Sayler\n# 2015\n# pytutamen Package\n# Tutamen Client Library\n\n\n### Imports ###\n\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ ... | [
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n\n# Andy Sayler\n# 2015\n# pytutamen Package\n# Tutamen Client Library\n\n\n### Imports ###\n\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\n... | ```python
# -*- coding: utf-8 -*-
# Andy Sayler
# 2015
# pytutamen Package
# Tutamen Client Library
### Imports ###
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_libra... |
[
{
"content": "Replicate the source code:\n```python\n#!/usr/bin/env python3\n\nimport imp\nimport os\nimport unittest\nfrom pprint import pprint\nimp.load_source('ufw_forward', os.path.join(os.path.dirname(__file__), os.path.pardir, 'library', 'ufw_forward.py'))\nfrom ufw_forward import UFWForwards\n\n\n\n\ncla... | [
{
"content": "Replicate the source code:\n<|memory_start|>```python\n#!/usr/bin/env python3\n\nimport imp\nimport os\nimport unittest\nfrom pprint import pprint\nimp.load_source('ufw_forward', os.path.join(os.path.dirname(__file__), os.path.pardir, 'library', 'ufw_forward.py'))\nfrom ufw_forward import UFWForwa... | ```python
#!/usr/bin/env python3
import imp
import os
import unittest
from pprint import pprint
imp.load_source('ufw_forward', os.path.join(os.path.dirname(__file__), os.path.pardir, 'library', 'ufw_forward.py'))
from ufw_forward import UFWForwards
class TestBase(unittest.TestCase):
def test_do_magic(self):
... |
[
{
"content": "```python\n#\n#\n\n# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Google Inc.\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\n# met:\n#\n# 1. Redistributions ... | [
{
"content": "<|memory_start|>```python\n#\n#\n\n# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Google Inc.\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\n# met:\n#\n# 1. ... | ```python
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the ab... |
[
{
"content": "Here is the snippet:\n```python\n\"\"\"Extensions to the 'distutils' for large or complex distributions\"\"\"\n\nimport os\nimport functools\nimport distutils.core\nimport distutils.filelist\nimport re\nfrom distutils.errors import DistutilsOptionError\nfrom distutils.util import convert_path\nfro... | [
{
"content": "Here is the snippet:\n<|memory_start|>```python\n\"\"\"Extensions to the 'distutils' for large or complex distributions\"\"\"\n\nimport os\nimport functools\nimport distutils.core\nimport distutils.filelist\nimport re\nfrom distutils.errors import DistutilsOptionError\nfrom distutils.util import c... | ```python
"""Extensions to the 'distutils' for large or complex distributions"""
import os
import functools
import distutils.core
import distutils.filelist
import re
from distutils.errors import DistutilsOptionError
from distutils.util import convert_path
from fnmatch import fnmatchcase
from ._deprecation_warning imp... |
[
{
"content": "Here is the code content:\n```python\nimport os\nimport logging\n\nfrom PyQt5 import QtCore\nfrom PyQt5.QtWidgets import *\n\nimport vqt.cli as vq_cli\nimport vqt.main as vq_main\nimport vqt.saveable as vq_save\nimport vqt.hotkeys as vq_hotkeys\nimport vqt.menubuilder as vq_menu\nfrom vqt.saveable... | [
{
"content": "Here is the code content:\n<|memory_start|>```python\nimport os\nimport logging\n\nfrom PyQt5 import QtCore\nfrom PyQt5.QtWidgets import *\n\nimport vqt.cli as vq_cli\nimport vqt.main as vq_main\nimport vqt.saveable as vq_save\nimport vqt.hotkeys as vq_hotkeys\nimport vqt.menubuilder as vq_menu\nf... | ```python
import os
import logging
from PyQt5 import QtCore
from PyQt5.QtWidgets import *
import vqt.cli as vq_cli
import vqt.main as vq_main
import vqt.saveable as vq_save
import vqt.hotkeys as vq_hotkeys
import vqt.menubuilder as vq_menu
from vqt.saveable import compat_isNone
logger = logging.getLogger(__name__)
... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LI... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache... | ```python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\n\"\"\"\nTask performed by user in django view\n\"\"\"\nimport functools\n\nfrom django.core.urlresolvers import reverse\nfrom django.conf.urls import url\nfrom django.shortcuts import get_object_or_404\n\nfrom ..activation import Activ... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n\"\"\"\nTask performed by user in django view\n\"\"\"\nimport functools\n\nfrom django.core.urlresolvers import reverse\nfrom django.conf.urls import url\nfrom django.shortcuts import get_object_or_404\n\nfrom ..activat... | ```python
"""
Task performed by user in django view
"""
import functools
from django.core.urlresolvers import reverse
from django.conf.urls import url
from django.shortcuts import get_object_or_404
from ..activation import Activation, ViewActivation, STATUS
from ..exceptions import FlowRuntimeError
from . import base... |
[
{
"content": "Here is the code content:\n```python\n#####################################################################\r\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\r\n#\tFile: qbo.py\t\t\t\t\t\t\t\t\t\t\t\t\t#\r\n#\tDeveloper: Justin Leto\t\t\t\t\t\t\t\t\t\t\t#\r\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\r\n#\tqbo cl... | [
{
"content": "Here is the code content:\n<|memory_start|>```python\n#####################################################################\r\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\r\n#\tFile: qbo.py\t\t\t\t\t\t\t\t\t\t\t\t\t#\r\n#\tDeveloper: Justin Leto\t\t\t\t\t\t\t\t\t\t\t#\r\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t... | ```python
#####################################################################
# #
# File: qbo.py #
# Developer: Justin Leto #
# #
# qbo class provides an interface from main csv iterator method #
# to handle qbo formatting, validations, and writing to file. ... |
[
{
"content": "```python\nimport numpy as np\ntry:\n import netCDF4 as netCDF\nexcept:\n import netCDF3 as netCDF\nimport pyroms\n\n\ndef remap(src_array, remap_file, src_grad1=None, src_grad2=None, \\\n src_grad3=None, spval=1e37, verbose=False):\n '''\n remap based on addresses and weig... | [
{
"content": "<|memory_start|>```python\nimport numpy as np\ntry:\n import netCDF4 as netCDF\nexcept:\n import netCDF3 as netCDF\nimport pyroms\n\n\ndef remap(src_array, remap_file, src_grad1=None, src_grad2=None, \\\n src_grad3=None, spval=1e37, verbose=False):\n '''\n remap based on ad... | ```python
import numpy as np
try:
import netCDF4 as netCDF
except:
import netCDF3 as netCDF
import pyroms
def remap(src_array, remap_file, src_grad1=None, src_grad2=None, \
src_grad3=None, spval=1e37, verbose=False):
'''
remap based on addresses and weights computed in a setup phase
'... |
[
{
"content": "Provide an exact copy of the source code:\n```python\n# coding=utf-8\n# Copyright 2021 The Google Research 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... | [
{
"content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n# coding=utf-8\n# Copyright 2021 The Google Research 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 o... | ```python
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\n#!/usr/bin/python3\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n#!/usr/bin/python3\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the... | ```python
#!/usr/bin/python3
# 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 ... |
[
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n# coding: utf-8\n# This file is part of Thomas Aquinas.\n#\n# Thomas Aquinas 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 ... | [
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n# coding: utf-8\n# This file is part of Thomas Aquinas.\n#\n# Thomas Aquinas is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as publ... | ```python
# coding: utf-8
# This file is part of Thomas Aquinas.
#
# Thomas Aquinas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#... |
[
{
"content": "```python\n\"\"\"\n\n\"\"\"\nfrom io import BytesIO\nfrom itertools import count\nimport tarfile\nfrom time import time, sleep\n\nfrom click import progressbar\nfrom logbook import Logger\nimport pandas as pd\nimport requests\nfrom six.moves.urllib.parse import urlencode\nfrom boto import connect_... | [
{
"content": "<|memory_start|>```python\n\"\"\"\n\n\"\"\"\nfrom io import BytesIO\nfrom itertools import count\nimport tarfile\nfrom time import time, sleep\n\nfrom click import progressbar\nfrom logbook import Logger\nimport pandas as pd\nimport requests\nfrom six.moves.urllib.parse import urlencode\nfrom boto... | ```python
"""
"""
from io import BytesIO
from itertools import count
import tarfile
from time import time, sleep
from click import progressbar
from logbook import Logger
import pandas as pd
import requests
from six.moves.urllib.parse import urlencode
from boto import connect_s3
import tarfile
from . import core as b... |
[
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n#!/usr/bin/env python\n\nimport requests\nimport json\nimport os\nfrom fabric.colors import red, green, blue, cyan, magenta\nfrom time import sleep\n\napi_key = 'be25c8a17fdcd031f54dd3417ee4d083'\napi_base_url = 'http:... | [
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nimport requests\nimport json\nimport os\nfrom fabric.colors import red, green, blue, cyan, magenta\nfrom time import sleep\n\napi_key = 'be25c8a17fdcd031f54dd3417ee4d083'\napi_b... | ```python
#!/usr/bin/env python
import requests
import json
import os
from fabric.colors import red, green, blue, cyan, magenta
from time import sleep
api_key = 'be25c8a17fdcd031f54dd3417ee4d083'
api_base_url = 'http://api.themoviedb.org/3'
def pretty(data):
print ""
print json.dumps(data, sort_keys=True, indent... |
[
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nTransfer function with derivatives\n\n:Example:\n >>> import numpy as np\n >>> f = TanSig()\n >>> x = np.linspace(-5,5,100)\n >>> y = f(x)\n >>> df_on_dy = f.deriv(x, y)... | [
{
"content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nTransfer function with derivatives\n\n:Example:\n >>> import numpy as np\n >>> f = TanSig()\n >>> x = np.linspace(-5,5,100)\n >>> y = f(x)\n >>> df_on_dy... | ```python
# -*- coding: utf-8 -*-
"""
Transfer function with derivatives
:Example:
>>> import numpy as np
>>> f = TanSig()
>>> x = np.linspace(-5,5,100)
>>> y = f(x)
>>> df_on_dy = f.deriv(x, y) # calc derivative
>>> f.out_minmax # list output range [min, max]
[-1, 1]
>>> f.inp_acti... |
[
{
"content": "Provide an exact copy of the source code:\n```python\n# Sublime Suricate, Copyright (C) 2013 N. Subiron\n#\n# This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n# are welcome to redistribute it and/or modify it under the terms of the GNU\n# General Public License as pu... | [
{
"content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n# Sublime Suricate, Copyright (C) 2013 N. Subiron\n#\n# This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n# are welcome to redistribute it and/or modify it under the terms of the GNU\n# General Publ... | ```python
# Sublime Suricate, Copyright (C) 2013 N. Subiron
#
# This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you
# are welcome to redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either
# version 3 of the Lic... |
[
{
"content": "Return the code unaltered:\n```python\n# Copyright 2021 Google LLC. All Rights Reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# \n# http://www.apa... | [
{
"content": "Return the code unaltered:\n<|memory_start|>```python\n# Copyright 2021 Google LLC. All Rights Reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# \n# ... | ```python
# Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
[
{
"content": "Reconstruct the code exactly:\n```python\n#!/usr/bin/env python\nimport re, glob, string\n# as swap1.py except that we here use a regex with comments and compile it:\narg = r'[^,]+'\ncall = re.compile(r\"\"\"\n (?P<start> # preserve start of function string\n superLibFunc # n... | [
{
"content": "Reconstruct the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python\nimport re, glob, string\n# as swap1.py except that we here use a regex with comments and compile it:\narg = r'[^,]+'\ncall = re.compile(r\"\"\"\n (?P<start> # preserve start of function string\n sup... | ```python
#!/usr/bin/env python
import re, glob, string
# as swap1.py except that we here use a regex with comments and compile it:
arg = r'[^,]+'
call = re.compile(r"""
(?P<start> # preserve start of function string
superLibFunc # name of function to match
\s* # optional w... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\nimport xbmc,xbmcgui,xbmcaddon,xbmcplugin\nimport urllib\nimport thesportsdb\nimport datetime\nimport os\nimport re\nimport threading\nfrom random import randint\nfrom centerutils.common_variables import *\nfrom centerutils.datem... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\nimport xbmc,xbmcgui,xbmcaddon,xbmcplugin\nimport urllib\nimport thesportsdb\nimport datetime\nimport os\nimport re\nimport threading\nfrom random import randint\nfrom centerutils.common_variables import *\nfrom c... | ```python
import xbmc,xbmcgui,xbmcaddon,xbmcplugin
import urllib
import thesportsdb
import datetime
import os
import re
import threading
from random import randint
from centerutils.common_variables import *
from centerutils.datemanipulation import *
import competlist as competlist
import teamview as teamview
import con... |
[
{
"content": "Provide an exact copy of the source code:\n```python\n# SpeakerTest.py \n# Group 7 ECE 4900\n# Edward Reehorst w/ help from\n# http://minhdo.ece.illinois.edu/teaching/speaker_recognition/\n# Text independent speaker recognition system based on mel frequency coeffiecient\n# features and vector quan... | [
{
"content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n# SpeakerTest.py \n# Group 7 ECE 4900\n# Edward Reehorst w/ help from\n# http://minhdo.ece.illinois.edu/teaching/speaker_recognition/\n# Text independent speaker recognition system based on mel frequency coeffiecient\n# features... | ```python
# SpeakerTest.py
# Group 7 ECE 4900
# Edward Reehorst w/ help from
# http://minhdo.ece.illinois.edu/teaching/speaker_recognition/
# Text independent speaker recognition system based on mel frequency coeffiecient
# features and vector quantization
import numpy as np
import scipy.fftpack as fft
import scipy.i... |
[
{
"content": "Repeat the following code:\n```python\nimport urllib\nfrom django.db.models import Avg, Sum, Count\nfrom django import forms\nfrom django.forms.widgets import Input\nfrom django.shortcuts import render\nfrom colourlens.models import Artwork, Colour\n\nPROM_ATTRS = {'min': '0', 'max': '100', 'step'... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\nimport urllib\nfrom django.db.models import Avg, Sum, Count\nfrom django import forms\nfrom django.forms.widgets import Input\nfrom django.shortcuts import render\nfrom colourlens.models import Artwork, Colour\n\nPROM_ATTRS = {'min': '0', 'max... | ```python
import urllib
from django.db.models import Avg, Sum, Count
from django import forms
from django.forms.widgets import Input
from django.shortcuts import render
from colourlens.models import Artwork, Colour
PROM_ATTRS = {'min': '0', 'max': '100', 'step': '5'}
DIST_ATTRS = {'min': '0', 'max': '50', 'step': '1'}... |
[
{
"content": "```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 license information.\n# Code generated by Microsoft (R) Au... | [
{
"content": "<|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 license information.\n# Code generated by ... | ```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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.