prompt
listlengths
1
1
compression_prompt
listlengths
1
1
target
stringlengths
1.03k
828k
[ { "content": "Repeat the code exactly:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# EM MEDIA HANDLER\n# Copyright (c) 2014-2021 Erin Morelli\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Soft...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# EM MEDIA HANDLER\n# Copyright (c) 2014-2021 Erin Morelli\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation file...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- # EM MEDIA HANDLER # Copyright (c) 2014-2021 Erin Morelli # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, inclu...
[ { "content": "Repeat the code exactly:\n```python\n#The MIT License (MIT)\n#\n#Copyright (c) 2014 Robert Abela\n#\n#Permission is hereby granted, free of charge, to any person obtaining a copy\n#of this software and associated documentation files (the \"Software\"), to deal\n#in the Software without restriction...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n#The MIT License (MIT)\n#\n#Copyright (c) 2014 Robert Abela\n#\n#Permission is hereby granted, free of charge, to any person obtaining a copy\n#of this software and associated documentation files (the \"Software\"), to deal\n#in the Software wit...
```python #The MIT License (MIT) # #Copyright (c) 2014 Robert Abela # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, ...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# Amara, universalsubtitles.org\n# \n# Copyright (C) 2013 Participatory Culture Foundation\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\...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# Amara, universalsubtitles.org\n# \n# Copyright (C) 2013 Participatory Culture Foundation\n# \n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Pu...
```python # Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # 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...
[ { "content": "Replicate the source code:\n```python\n\"\"\"Tools for processing configuration files.\"\"\"\n\nfrom ConfigParser import ConfigParser\n\nfrom pyfusion.conf.exceptions import DisallowedSectionType, \\\n ConfigSectionSyntaxError, UnknownVariableTypeError\n\n# This list contains allowed section t...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n\"\"\"Tools for processing configuration files.\"\"\"\n\nfrom ConfigParser import ConfigParser\n\nfrom pyfusion.conf.exceptions import DisallowedSectionType, \\\n ConfigSectionSyntaxError, UnknownVariableTypeError\n\n# This list contains a...
```python """Tools for processing configuration files.""" from ConfigParser import ConfigParser from pyfusion.conf.exceptions import DisallowedSectionType, \ ConfigSectionSyntaxError, UnknownVariableTypeError # This list contains allowed section types, i.e. [SectionType:Name] in # config files. Be sure to updat...
[ { "content": "```python\nfrom __future__ import print_function\n\nimport time\nimport logging\nfrom py2neo import Graph,Node\nfrom py2neo.ext import ogm\nfrom py2neo.packages.httpstream.http import SocketError\n\nlog = logging.getLogger('flask.neo4j')\nlogging.basicConfig()\n\n# Find the stack on which we want ...
[ { "content": "<|memory_start|>```python\nfrom __future__ import print_function\n\nimport time\nimport logging\nfrom py2neo import Graph,Node\nfrom py2neo.ext import ogm\nfrom py2neo.packages.httpstream.http import SocketError\n\nlog = logging.getLogger('flask.neo4j')\nlogging.basicConfig()\n\n# Find the stack o...
```python from __future__ import print_function import time import logging from py2neo import Graph,Node from py2neo.ext import ogm from py2neo.packages.httpstream.http import SocketError log = logging.getLogger('flask.neo4j') logging.basicConfig() # Find the stack on which we want to store the GraphDatabaseService ...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\nimport os\nimport sys\nimport time\nimport logging\n\nfrom exabgp.logger.handler import getLogger\nfrom exabgp.logger.format import formater\n\n\ndef echo(_):\n return _\n\n\nclass option(object):\n logger = None\n formater = ...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\nimport os\nimport sys\nimport time\nimport logging\n\nfrom exabgp.logger.handler import getLogger\nfrom exabgp.logger.format import formater\n\n\ndef echo(_):\n return _\n\n\nclass option(object):\n logger = None\...
```python import os import sys import time import logging from exabgp.logger.handler import getLogger from exabgp.logger.format import formater def echo(_): return _ class option(object): logger = None formater = echo short = False level = 'WARNING' logit = {} cwd = '' # where th...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n# F. Giorgi R. Francisco\n# Uncertainties in regional climate change prediction: a regional analysis\n# of ensemble simulations with the HADCM2 coupled AOGCM\n\noutlines = dict()\noutlines[1] = ((110, -45), (155, -45), (15...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n# F. Giorgi R. Francisco\n# Uncertainties in regional climate change prediction: a regional analysis\n# of ensemble simulations with the HADCM2 coupled AOGCM\n\noutlines = dict()\noutlines[1] = ((110, -45),...
```python # F. Giorgi R. Francisco # Uncertainties in regional climate change prediction: a regional analysis # of ensemble simulations with the HADCM2 coupled AOGCM outlines = dict() outlines[1] = ((110, -45), (155, -45), (155, -11), (110, -11)) outlines[2] = ((-82, -20), (-34, -20), (-34, 12), (-82, 12)) outlines[3]...
[ { "content": "```python\nfrom numpy import *\n\ndef metropolis(data, model, nlinks, beta=1., keepchain=True, startlink=0):\n\t'''\n\tThe \"model\" object must implement:\n\t\n\tp = model.get_params()\n\t-- this must return an *independent copy* of the parameters.\n\n\tmodel.set_params(p)\n\n\tp = model.propose_...
[ { "content": "<|memory_start|>```python\nfrom numpy import *\n\ndef metropolis(data, model, nlinks, beta=1., keepchain=True, startlink=0):\n\t'''\n\tThe \"model\" object must implement:\n\t\n\tp = model.get_params()\n\t-- this must return an *independent copy* of the parameters.\n\n\tmodel.set_params(p)\n\n\tp ...
```python from numpy import * def metropolis(data, model, nlinks, beta=1., keepchain=True, startlink=0): ''' The "model" object must implement: p = model.get_params() -- this must return an *independent copy* of the parameters. model.set_params(p) p = model.propose_params() model.tally(accept, linknumber) ...
[ { "content": "```python\n# Copyright (c) 2016 Ultimaker B.V.\r\n# Cura is released under the terms of the AGPLv3 or higher.\r\n\r\n# This collects a lot of quality and quality changes related code which was split between ContainerManager\r\n# and the MachineManager and really needs to usable from both.\r\nfrom ...
[ { "content": "<|memory_start|>```python\n# Copyright (c) 2016 Ultimaker B.V.\r\n# Cura is released under the terms of the AGPLv3 or higher.\r\n\r\n# This collects a lot of quality and quality changes related code which was split between ContainerManager\r\n# and the MachineManager and really needs to usable fro...
```python # Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. # This collects a lot of quality and quality changes related code which was split between ContainerManager # and the MachineManager and really needs to usable from both. from typing import List from UM.App...
[ { "content": "Here is the snippet:\n```python\n# import packages\nimport matplotlib; matplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.feature_selection import chi2\nfrom sklearn.metrics import roc_auc_score, roc_curve, auc, precision_score, f1_score...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n# import packages\nimport matplotlib; matplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.feature_selection import chi2\nfrom sklearn.metrics import roc_auc_score, roc_curve, auc, precision...
```python # import packages import matplotlib; matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd import numpy as np from sklearn.feature_selection import chi2 from sklearn.metrics import roc_auc_score, roc_curve, auc, precision_score, f1_score, mean_squared_error, accuracy_score # report coeff...
[ { "content": "Here is the snippet:\n```python\n#\n# @file TestReadMathML.py\n# @brief Read MathML unit tests\n#\n# @author Akiya Jouraku (Python conversion)\n# @author Ben Bornstein \n#\n# $Id: TestReadMathML.py 11441 2010-07-09 02:22:23Z mhucka $\n# $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbm...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n#\n# @file TestReadMathML.py\n# @brief Read MathML unit tests\n#\n# @author Akiya Jouraku (Python conversion)\n# @author Ben Bornstein \n#\n# $Id: TestReadMathML.py 11441 2010-07-09 02:22:23Z mhucka $\n# $HeadURL: https://sbml.svn.sourceforge...
```python # # @file TestReadMathML.py # @brief Read MathML unit tests # # @author Akiya Jouraku (Python conversion) # @author Ben Bornstein # # $Id: TestReadMathML.py 11441 2010-07-09 02:22:23Z mhucka $ # $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/bindings/python/test/math/TestRea...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n#!/usr/bin/env python\n# -*- coding: utf8 -*-\n\"\"\"\n@script : model.py\n@created : 2012-11-04 01:48:15.090\n@changed : 2012-11-08 10:26:47.237\n@creator : mkpy.py --version 0.0.27\n@author : Igor A.Vetrov <qprostu...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf8 -*-\n\"\"\"\n@script : model.py\n@created : 2012-11-04 01:48:15.090\n@changed : 2012-11-08 10:26:47.237\n@creator : mkpy.py --version 0.0.27\n@author : Igor A...
```python #!/usr/bin/env python # -*- coding: utf8 -*- """ @script : model.py @created : 2012-11-04 01:48:15.090 @changed : 2012-11-08 10:26:47.237 @creator : mkpy.py --version 0.0.27 @author : Igor A.Vetrov <qprostu@gmail.com> @about : model of TODO application """ from __future__ import print_function from argpa...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\nimport sys, atexit\nimport pickle\nimport bluetooth as bt\nfrom cmd import Cmd\nfrom service import SerialPortService\nimport socket\n\nbanner = '''Welcome to btsdk shell.\n\\tType 'help()' for help\n'''\n\nclass Shell(Cmd):\n p...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\nimport sys, atexit\nimport pickle\nimport bluetooth as bt\nfrom cmd import Cmd\nfrom service import SerialPortService\nimport socket\n\nbanner = '''Welcome to btsdk shell.\n\\tType 'help()' for help\n'''\n\nclass Sh...
```python import sys, atexit import pickle import bluetooth as bt from cmd import Cmd from service import SerialPortService import socket banner = '''Welcome to btsdk shell. \tType 'help()' for help ''' class Shell(Cmd): prompt = 'btsdk> ' intro = "btsdk shell" def __init__(self): Cmd.__init__(se...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nHelper functions used in views.\n\"\"\"\n\nimport csv\nimport urllib2\nimport time\nimport threading\nimport locale\nfrom json import dumps\nfrom functools import wraps\nfrom datetime i...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nHelper functions used in views.\n\"\"\"\n\nimport csv\nimport urllib2\nimport time\nimport threading\nimport locale\nfrom json import dumps\nfrom functools import wraps\...
```python # -*- coding: utf-8 -*- """ Helper functions used in views. """ import csv import urllib2 import time import threading import locale from json import dumps from functools import wraps from datetime import datetime from lxml import etree from functools import wraps from flask import Response from presence_an...
[ { "content": "```python\n#!/usr/bin/pytho\nimport sys\nimport warnings\n\ndef help_message():\n print ' '\n print 'sht11'\n print ' --help Displays this usage message '\n print ' --detect Displays if the sensor is connected on Raspberry Pi'\n prin...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/pytho\nimport sys\nimport warnings\n\ndef help_message():\n print ' '\n print 'sht11'\n print ' --help Displays this usage message '\n print ' --detect Displays if the sensor is connected on Raspber...
```python #!/usr/bin/pytho import sys import warnings def help_message(): print ' ' print 'sht11' print ' --help Displays this usage message ' print ' --detect Displays if the sensor is connected on Raspberry Pi' print ' -h , --humidity ...
[ { "content": "```python\n# import nnpy\n# import time\n\n# s=nnpy.Socket(nnpy.AF_SP,nnpy.REP)\n#\n#\n# s.bind('tcp://127.0.0.1:5555')\n#\n# # s.setsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET,value=1024*1024)\n# # s.getsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET)\n#\n# counter=0\n# while True:\n# t...
[ { "content": "<|memory_start|>```python\n# import nnpy\n# import time\n\n# s=nnpy.Socket(nnpy.AF_SP,nnpy.REP)\n#\n#\n# s.bind('tcp://127.0.0.1:5555')\n#\n# # s.setsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET,value=1024*1024)\n# # s.getsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET)\n#\n# counter=0\n# whil...
```python # import nnpy # import time # s=nnpy.Socket(nnpy.AF_SP,nnpy.REP) # # # s.bind('tcp://127.0.0.1:5555') # # # s.setsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET,value=1024*1024) # # s.getsockopt(option=nnpy.RCVBUF,level=nnpy.SOL_SOCKET) # # counter=0 # while True: # try: # res=s.recv(flags=nnpy....
[ { "content": "Provide an exact copy of the source code:\n```python\n\"\"\"Graphical user interface.\"\"\"\n\nimport collections\nimport ctypes\n\nimport sdl2\n\nimport hienoi.renderer\nfrom hienoi._common import GLProfile, GraphicsAPI, ParticleDisplay, UserData\nfrom hienoi._vectors import Vector2i, Vector2f, V...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n\"\"\"Graphical user interface.\"\"\"\n\nimport collections\nimport ctypes\n\nimport sdl2\n\nimport hienoi.renderer\nfrom hienoi._common import GLProfile, GraphicsAPI, ParticleDisplay, UserData\nfrom hienoi._vectors import Vecto...
```python """Graphical user interface.""" import collections import ctypes import sdl2 import hienoi.renderer from hienoi._common import GLProfile, GraphicsAPI, ParticleDisplay, UserData from hienoi._vectors import Vector2i, Vector2f, Vector4f class NavigationAction(object): """Enumerator for the current nagiv...
[ { "content": "Repeat the following code:\n```python\n\"\"\"Tests for maintenance.py\"\"\"\nimport unittest\nimport random\nimport time\nimport datetime\nfrom string import ascii_letters\n\nimport webtest\n\nfrom google.appengine.ext import testbed\nfrom google.appengine.ext import ndb\n\nimport maintenance\nimp...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n\"\"\"Tests for maintenance.py\"\"\"\nimport unittest\nimport random\nimport time\nimport datetime\nfrom string import ascii_letters\n\nimport webtest\n\nfrom google.appengine.ext import testbed\nfrom google.appengine.ext import ndb\n\nimport ...
```python """Tests for maintenance.py""" import unittest import random import time import datetime from string import ascii_letters import webtest from google.appengine.ext import testbed from google.appengine.ext import ndb import maintenance import models def random_string(length=10, chars=ascii_letters + ' '): ...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Train the CTC model (CSJ corpus).\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom os.path import j...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Train the CTC model (CSJ corpus).\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom ...
```python #! /usr/bin/env python # -*- coding: utf-8 -*- """Train the CTC model (CSJ corpus).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from os.path import join, isfile, abspath import sys import time import tensorflow as tf from setproctitle impo...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ndirect PAS\nPython Application Services\n----------------------------------------------------------------------------\n(C) direct Netware Group - All rights reserved\nhttps://www.direct-netware.de/r...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\ndirect PAS\nPython Application Services\n----------------------------------------------------------------------------\n(C) direct Netware Group - All rights reserved\nhttps://www.dir...
```python # -*- coding: utf-8 -*- """ direct PAS Python Application Services ---------------------------------------------------------------------------- (C) direct Netware Group - All rights reserved https://www.direct-netware.de/redirect?pas;upnp The following license agreement remains valid unless any additions or...
[ { "content": "```python\n# Copyright 2014 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 telemetry.timeline.async_slice as async_slice_module\nimport telemetry.timeline.event_container as event_container\...
[ { "content": "<|memory_start|>```python\n# Copyright 2014 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 telemetry.timeline.async_slice as async_slice_module\nimport telemetry.timeline.event_container as ...
```python # Copyright 2014 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 telemetry.timeline.async_slice as async_slice_module import telemetry.timeline.event_container as event_container import telemetry.timeline.f...
[ { "content": "Repeat the full code snippet:\n```python\n# -*- coding: utf8 -*-\n\nfrom qstatpretty.ttyutil.unicode import unicode, ulen\n\nDELIMITERS_FULL = {\n\n 'header_tl': u\"┌\",\n 'header_t': u\"─\",\n 'header_tr': u\"┐\",\n 'header_b': u\"─\",\n 'header_bl': u\"├\",\n...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# -*- coding: utf8 -*-\n\nfrom qstatpretty.ttyutil.unicode import unicode, ulen\n\nDELIMITERS_FULL = {\n\n 'header_tl': u\"┌\",\n 'header_t': u\"─\",\n 'header_tr': u\"┐\",\n 'header_b': u\"─\",\n 'header_bl...
```python # -*- coding: utf8 -*- from qstatpretty.ttyutil.unicode import unicode, ulen DELIMITERS_FULL = { 'header_tl': u"┌", 'header_t': u"─", 'header_tr': u"┐", 'header_b': u"─", 'header_bl': u"├", 'header_l': u"│", 'header_r': u"│", 'header_br': ...
[ { "content": "Reconstruct the code exactly:\n```python\n#!/usr/bin/env python\n\n#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#\n#\n# Name: generate_gaussian_samples.py \n#\n# Author: Constantin Weisser (weisser@mit.edu)\n#\n# Purpose: This is a python script to write a f...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#\n#\n# Name: generate_gaussian_samples.py \n#\n# Author: Constantin Weisser (weisser@mit.edu)\n#\n# Purpose: This is a python scr...
```python #!/usr/bin/env python #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # # Name: generate_gaussian_samples.py # # Author: Constantin Weisser (weisser@mit.edu) # # Purpose: This is a python script to write a file containing 10000 data points # sampled from a 2D Gauss...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\n/***************************************************************************\r\n A QGIS plugin\r\n CLUZ for QGIS\r\n -------------------...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\n/***************************************************************************\r\n A QGIS plugin\r\n CLUZ for QGIS\r\n ---...
```python # -*- coding: utf-8 -*- """ /*************************************************************************** A QGIS plugin CLUZ for QGIS ------------------- begin : 2016-23-02 copyright : (C) 2016 by Bo...
[ { "content": "```python\nfrom sentinels import NOTHING\n\nfrom .api_object import APIObject\nfrom .lazy_query import LazyQuery\n\nclass Test(APIObject):\n\n def report_end(self, duration=NOTHING):\n self.client.api.call_function('report_test_end', {'id': self.id, 'duration': duration})\n\n def mark...
[ { "content": "<|memory_start|>```python\nfrom sentinels import NOTHING\n\nfrom .api_object import APIObject\nfrom .lazy_query import LazyQuery\n\nclass Test(APIObject):\n\n def report_end(self, duration=NOTHING):\n self.client.api.call_function('report_test_end', {'id': self.id, 'duration': duration})...
```python from sentinels import NOTHING from .api_object import APIObject from .lazy_query import LazyQuery class Test(APIObject): def report_end(self, duration=NOTHING): self.client.api.call_function('report_test_end', {'id': self.id, 'duration': duration}) def mark_skipped(self): self.clie...
[ { "content": "Repeat the full code snippet:\n```python\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you un...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this f...
```python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you...
[ { "content": "Here is the snippet:\n```python\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn.datasets import fetch_olivetti_faces\nfrom sklearn.utils.validation import check_random_state\n\nfrom linear_regression import *\nfrom knn import *\n\n\ndef main():\n # Load the faces datasets\n...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn.datasets import fetch_olivetti_faces\nfrom sklearn.utils.validation import check_random_state\n\nfrom linear_regression import *\nfrom knn import *\n\n\ndef main():\n # Load the ...
```python import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import fetch_olivetti_faces from sklearn.utils.validation import check_random_state from linear_regression import * from knn import * def main(): # Load the faces datasets data = fetch_olivetti_faces() targets = data.targ...
[ { "content": "Here is a code snippet:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>\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...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file exce...
```python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Isaku Yamahata <yamahata at private email ne jp> # 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 Li...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n\"\"\"\nTest collection used only for testing purpose\n\"\"\"\nfrom booby import fields\nfrom ot_api.base import OpentopicModel\n\nfrom .parsers import test_parser\n\n\ndef _generate_test_object(i):\n \"\"\"\n :return: dist with ...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n\"\"\"\nTest collection used only for testing purpose\n\"\"\"\nfrom booby import fields\nfrom ot_api.base import OpentopicModel\n\nfrom .parsers import test_parser\n\n\ndef _generate_test_object(i):\n \"\"\"\n :re...
```python """ Test collection used only for testing purpose """ from booby import fields from ot_api.base import OpentopicModel from .parsers import test_parser def _generate_test_object(i): """ :return: dist with test object """ return { 'id': i, 'name': 'test_name{0}'.format(str(i))...
[ { "content": "Repeat the code exactly:\n```python\n# coding: utf8\n# Auntefication Library\nfrom ColorAndSayLib import PrintWC, SayPrint\n\n# Variables of userdata\nlogpass = {\"hacker\": \"12345678\"}\n######################\nPostLoginTrue = False\n\n\n######################\n# def SayPrint(text,speech = None,...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n# coding: utf8\n# Auntefication Library\nfrom ColorAndSayLib import PrintWC, SayPrint\n\n# Variables of userdata\nlogpass = {\"hacker\": \"12345678\"}\n######################\nPostLoginTrue = False\n\n\n######################\n# def SayPrint(tex...
```python # coding: utf8 # Auntefication Library from ColorAndSayLib import PrintWC, SayPrint # Variables of userdata logpass = {"hacker": "12345678"} ###################### PostLoginTrue = False ###################### # def SayPrint(text,speech = None,color= None,ttsd = "plyer"): # if color == None: # ...
[ { "content": "```python\nimport pyquaternion\n\n\n# Create a quaternion representing a rotation of +90 degrees about positive y axis.\nmy_quaternion = pyquaternion.Quaternion(axis=[0, 1, 0], degrees=90)\n\nmy_vector = [0, 0, 4]\nmy_rotated_vector = my_quaternion.rotate(my_vector)\n\nprint('\\nBasic Rotation')\n...
[ { "content": "<|memory_start|>```python\nimport pyquaternion\n\n\n# Create a quaternion representing a rotation of +90 degrees about positive y axis.\nmy_quaternion = pyquaternion.Quaternion(axis=[0, 1, 0], degrees=90)\n\nmy_vector = [0, 0, 4]\nmy_rotated_vector = my_quaternion.rotate(my_vector)\n\nprint('\\nBa...
```python import pyquaternion # Create a quaternion representing a rotation of +90 degrees about positive y axis. my_quaternion = pyquaternion.Quaternion(axis=[0, 1, 0], degrees=90) my_vector = [0, 0, 4] my_rotated_vector = my_quaternion.rotate(my_vector) print('\nBasic Rotation') print('--------------') print('My ...
[ { "content": "Here is some code:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nTest the IO routines - based on the MSAT test cases\n\"\"\"\nimport unittest\n\nimport numpy as np\n\nimport pytasa.anisotropy_index\n\n\nclass TestAnisotropyIndex(unittest.TestCase):\n\n def setUp(self):\n ...
[ { "content": "Here is some code:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nTest the IO routines - based on the MSAT test cases\n\"\"\"\nimport unittest\n\nimport numpy as np\n\nimport pytasa.anisotropy_index\n\n\nclass TestAnisotropyIndex(unittest.TestCase):\n\n def ...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the IO routines - based on the MSAT test cases """ import unittest import numpy as np import pytasa.anisotropy_index class TestAnisotropyIndex(unittest.TestCase): def setUp(self): """Some useful matricies for testing""" self.olivi...
[ { "content": "Reconstruct the code exactly:\n```python\n#!/usr/bin/env python2\r\n\r\n# Copyright 2015 Dejan D. M. Milosavljevic\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 may obtain a copy of...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python2\r\n\r\n# Copyright 2015 Dejan D. M. Milosavljevic\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 may ...
```python #!/usr/bin/env python2 # Copyright 2015 Dejan D. M. Milosavljevic # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n\"\"\"\nCopyright (2010-2014) INCUBAID BVBA\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 h...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n\"\"\"\nCopyright (2010-2014) INCUBAID BVBA\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 Lic...
```python """ Copyright (2010-2014) INCUBAID BVBA 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 w...
[ { "content": "```python\nimport pipes\r\nimport os\r\nimport string\r\nimport unittest\r\nfrom test.support import TESTFN, run_unittest, unlink, reap_children\r\n\r\nif os.name != 'posix':\r\n raise unittest.SkipTest('pipes module only works on posix')\r\n\r\nTESTFN2 = TESTFN + \"2\"\r\n\r\n# tr a-z A-Z is n...
[ { "content": "<|memory_start|>```python\nimport pipes\r\nimport os\r\nimport string\r\nimport unittest\r\nfrom test.support import TESTFN, run_unittest, unlink, reap_children\r\n\r\nif os.name != 'posix':\r\n raise unittest.SkipTest('pipes module only works on posix')\r\n\r\nTESTFN2 = TESTFN + \"2\"\r\n\r\n#...
```python import pipes import os import string import unittest from test.support import TESTFN, run_unittest, unlink, reap_children if os.name != 'posix': raise unittest.SkipTest('pipes module only works on posix') TESTFN2 = TESTFN + "2" # tr a-z A-Z is not portable, so make the ranges explicit s_com...
[ { "content": "Here is the script:\n```python\n#creer l'url avec son checksum\n\nimport hashlib\n\ndef checksumUrl(queryString,action,secret):\n\t#1. Create the entire query string for your API call without the checksum parameter \"name=Test+Meeting&meetingID=abc123&attendeePW=111222&moderatorPW=333444\"\n\t#2. ...
[ { "content": "Here is the script:\n<|memory_start|>```python\n#creer l'url avec son checksum\n\nimport hashlib\n\ndef checksumUrl(queryString,action,secret):\n\t#1. Create the entire query string for your API call without the checksum parameter \"name=Test+Meeting&meetingID=abc123&attendeePW=111222&moderatorPW=...
```python #creer l'url avec son checksum import hashlib def checksumUrl(queryString,action,secret): #1. Create the entire query string for your API call without the checksum parameter "name=Test+Meeting&meetingID=abc123&attendeePW=111222&moderatorPW=333444" #2. Prepend the call name to your string "createname=Test+...
[ { "content": "Here is the source code:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function, absolute_import, unicode_literals\nfrom qtpy.QtCore import *\n# from qtpy.QtWidgets import *\nimport re\nimport logging\nfrom sphinx_explorer.util.commander import ...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function, absolute_import, unicode_literals\nfrom qtpy.QtCore import *\n# from qtpy.QtWidgets import *\nimport re\nimport logging\nfrom sphinx_explorer.util.c...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import, unicode_literals from qtpy.QtCore import * # from qtpy.QtWidgets import * import re import logging from sphinx_explorer.util.commander import Commander logger = logging.getLogger(__name__) class P...
[ { "content": "Return the code exactly, with no changes:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n Copyright © 2014 German Neuroinformatics Node (G-Node)\n\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted unde...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n Copyright © 2014 German Neuroinformatics Node (G-Node)\n\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, ar...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright © 2014 German Neuroinformatics Node (G-Node) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted under the terms of the BSD License. See LICENSE file in the root of the Project. ...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n#!/usr/bin/env python\n#\n# Copyright 2017 Anil Thomas\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 ...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n#!/usr/bin/env python\n#\n# Copyright 2017 Anil Thomas\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 ma...
```python #!/usr/bin/env python # # Copyright 2017 Anil Thomas # # 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 requir...
[ { "content": "Repeat the following code:\n```python\n\"\"\"\nFitPanel class contains fields allowing to fit models and data\n\n:note: For Fit to be performed the user should check at least one parameter\n on fit Panel window.\n\n\"\"\"\nimport wx\nimport wx.lib.newevent\nfrom wx.aui import AuiNotebook as N...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n\"\"\"\nFitPanel class contains fields allowing to fit models and data\n\n:note: For Fit to be performed the user should check at least one parameter\n on fit Panel window.\n\n\"\"\"\nimport wx\nimport wx.lib.newevent\nfrom wx.aui import ...
```python """ FitPanel class contains fields allowing to fit models and data :note: For Fit to be performed the user should check at least one parameter on fit Panel window. """ import wx import wx.lib.newevent from wx.aui import AuiNotebook as Notebook import datetime from bumps.gui.convergence_view import C...
[ { "content": "```python\n# Copyright (c) 2015 Ultimaker B.V.\n# Cura is released under the terms of the AGPLv3 or higher.\n\nfrom UM.Backend.Backend import Backend\nfrom UM.Application import Application\nfrom UM.Scene.SceneNode import SceneNode\nfrom UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterat...
[ { "content": "<|memory_start|>```python\n# Copyright (c) 2015 Ultimaker B.V.\n# Cura is released under the terms of the AGPLv3 or higher.\n\nfrom UM.Backend.Backend import Backend\nfrom UM.Application import Application\nfrom UM.Scene.SceneNode import SceneNode\nfrom UM.Scene.Iterator.DepthFirstIterator import ...
```python # Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Backend.Backend import Backend from UM.Application import Application from UM.Scene.SceneNode import SceneNode from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Preferences import...
[ { "content": "Provide an exact copy of the source code:\n```python\nfrom datetime import datetime\n\nfrom dateutil.relativedelta import relativedelta\n\nfrom feedrsub.database import db\nfrom feedrsub.models.period import PERIOD, Period\nfrom feedrsub.models.populate_db import populate_periods\n\n\ndef test_pop...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nfrom datetime import datetime\n\nfrom dateutil.relativedelta import relativedelta\n\nfrom feedrsub.database import db\nfrom feedrsub.models.period import PERIOD, Period\nfrom feedrsub.models.populate_db import populate_periods\n...
```python from datetime import datetime from dateutil.relativedelta import relativedelta from feedrsub.database import db from feedrsub.models.period import PERIOD, Period from feedrsub.models.populate_db import populate_periods def test_populate_periods(session): populate_periods() daily = Period.query.fi...
[ { "content": "Here is the snippet:\n```python\n# This file is part of PyEMMA.\n#\n# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)\n#\n# PyEMMA is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License ...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n# This file is part of PyEMMA.\n#\n# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)\n#\n# PyEMMA is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General...
```python # This file is part of PyEMMA. # # Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # PyEMMA is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, ei...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n#!/usr/bin/python\n# Mario Hernandez\n# github.com/mariofix\n# Licences under GPL v3\n#\n# For use with nginx\n# uwsgi -s /tmp/ad-login.sock -w adlogin:app --enable-threads --chmod-socket=666\n#\nimport bender\n\nfrom flask import Fl...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n#!/usr/bin/python\n# Mario Hernandez\n# github.com/mariofix\n# Licences under GPL v3\n#\n# For use with nginx\n# uwsgi -s /tmp/ad-login.sock -w adlogin:app --enable-threads --chmod-socket=666\n#\nimport bender\n\nfrom...
```python #!/usr/bin/python # Mario Hernandez # github.com/mariofix # Licences under GPL v3 # # For use with nginx # uwsgi -s /tmp/ad-login.sock -w adlogin:app --enable-threads --chmod-socket=666 # import bender from flask import Flask, request, jsonify app = Flask(__name__) @app.route("/auth", methods=["GET", "POST"...
[ { "content": "Repeat the following code:\n```python\nimport re\nimport os\nimport commands\nimport logging\nfrom autotest.client.shared import error\nfrom virttest import virsh, utils_misc, xml_utils, libvirt_xml\nfrom virttest.libvirt_xml import vm_xml, xcepts\n\n\ndef xml_recover(vmxml):\n \"\"\"\n Reco...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\nimport re\nimport os\nimport commands\nimport logging\nfrom autotest.client.shared import error\nfrom virttest import virsh, utils_misc, xml_utils, libvirt_xml\nfrom virttest.libvirt_xml import vm_xml, xcepts\n\n\ndef xml_recover(vmxml):\n ...
```python import re import os import commands import logging from autotest.client.shared import error from virttest import virsh, utils_misc, xml_utils, libvirt_xml from virttest.libvirt_xml import vm_xml, xcepts def xml_recover(vmxml): """ Recover older xml config with backup vmxml. :params: vmxml: VMXM...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\nfrom django.conf import settings\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.backends import ModelBackend\n\nfrom google.appengine.api import users\n\n\nclass GoogleAccountBackend(ModelBackend):\...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\nfrom django.conf import settings\nfrom django.contrib.auth.models import User\nfrom django.contrib.auth.backends import ModelBackend\n\nfrom google.appengine.api import users\n\n\nclass GoogleAccountBackend...
```python from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.backends import ModelBackend from google.appengine.api import users class GoogleAccountBackend(ModelBackend): """ backend for authentication via Google Accounts on Google App Engine A Djan...
[ { "content": "Replicate the source code:\n```python\nimport win32pipe\r\nimport win32console\r\nimport win32process\r\nimport time\r\nimport win32con\r\nimport codecs\r\nimport ctypes \r\nuser32 = ctypes.windll.user32\r\n\r\nCONQUE_WINDOWS_VK = {\r\n '3' : win32con.VK_CANCEL,\r\n '8' : win32con.VK_BACK,...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\nimport win32pipe\r\nimport win32console\r\nimport win32process\r\nimport time\r\nimport win32con\r\nimport codecs\r\nimport ctypes \r\nuser32 = ctypes.windll.user32\r\n\r\nCONQUE_WINDOWS_VK = {\r\n '3' : win32con.VK_CANCEL,\r\n '8' : w...
```python import win32pipe import win32console import win32process import time import win32con import codecs import ctypes user32 = ctypes.windll.user32 CONQUE_WINDOWS_VK = { '3' : win32con.VK_CANCEL, '8' : win32con.VK_BACK, '9' : win32con.VK_TAB, '12' : win32con.VK_CLEAR, '13' : ...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\nimport tornado.websocket\n\nfrom Server.Chat.SimpleTypes import Participant\nfrom Server.Tools.Response.Json import *\n\nclass ChatWebSocketManager(tornado.websocket.WebSocketHandler):\n \"\"\"\n The main chat socket...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\nimport tornado.websocket\n\nfrom Server.Chat.SimpleTypes import Participant\nfrom Server.Tools.Response.Json import *\n\nclass ChatWebSocketManager(tornado.websocket.WebSocketHandler):\n \"\"\"\n The ...
```python import tornado.websocket from Server.Chat.SimpleTypes import Participant from Server.Tools.Response.Json import * class ChatWebSocketManager(tornado.websocket.WebSocketHandler): """ The main chat socket manager, which handles both server commands from the user as well as chat messages themselves...
[ { "content": "Repeat the code exactly:\n```python\n# vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4:\n# conveyor/src/main/python/conveyor/client/__init__.py\n#\n# conveyor - Printing dispatch engine for 3D objects and their friends.\n# Copyright © 2012 Matthew W. Samsonoff <matthew.samsonoff@makerbot.com>\n#\n#...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n# vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4:\n# conveyor/src/main/python/conveyor/client/__init__.py\n#\n# conveyor - Printing dispatch engine for 3D objects and their friends.\n# Copyright © 2012 Matthew W. Samsonoff <matthew.samsonoff@mak...
```python # vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4: # conveyor/src/main/python/conveyor/client/__init__.py # # conveyor - Printing dispatch engine for 3D objects and their friends. # Copyright © 2012 Matthew W. Samsonoff <matthew.samsonoff@makerbot.com> # # This program is free software: you can redistribute it...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\n''' pydevd - a debugging daemon\nThis is the daemon you launch for python remote debugging.\n\nProtocol:\neach command has a format:\n id\\tsequence-num\\ttext\n id: protocol command number\n sequence-num: each request ...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n''' pydevd - a debugging daemon\nThis is the daemon you launch for python remote debugging.\n\nProtocol:\neach command has a format:\n id\\tsequence-num\\ttext\n id: protocol command number\n sequence-nu...
```python ''' pydevd - a debugging daemon This is the daemon you launch for python remote debugging. Protocol: each command has a format: id\tsequence-num\ttext id: protocol command number sequence-num: each request has a sequence number. Sequence numbers originating at the debugger are odd, sequence n...
[ { "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...
[ { "content": "```python\nimport curses\nimport datetime\nimport sys\n\nfrom writelightly.calendar import Calendar\nfrom writelightly.conf import Config\nfrom writelightly.edit import edit_date, get_edits, clean_tmp, show_edits\nfrom writelightly.metadata import Metadata\nfrom writelightly.screen import ScreenMa...
[ { "content": "<|memory_start|>```python\nimport curses\nimport datetime\nimport sys\n\nfrom writelightly.calendar import Calendar\nfrom writelightly.conf import Config\nfrom writelightly.edit import edit_date, get_edits, clean_tmp, show_edits\nfrom writelightly.metadata import Metadata\nfrom writelightly.screen...
```python import curses import datetime import sys from writelightly.calendar import Calendar from writelightly.conf import Config from writelightly.edit import edit_date, get_edits, clean_tmp, show_edits from writelightly.metadata import Metadata from writelightly.screen import ScreenManager, TextArea from writelight...
[ { "content": "Here is the code content:\n```python\nimport logging\nimport posixpath\nimport requests\nimport arrow\nfrom functools import partial\nfrom errbot import BotPlugin, botcmd\nfrom apscheduler.scheduler import Scheduler\nfrom BeautifulSoup import BeautifulSoup\n\n\nSTOPS = {\n 'xmassteps': 'bstgajt...
[ { "content": "Here is the code content:\n<|memory_start|>```python\nimport logging\nimport posixpath\nimport requests\nimport arrow\nfrom functools import partial\nfrom errbot import BotPlugin, botcmd\nfrom apscheduler.scheduler import Scheduler\nfrom BeautifulSoup import BeautifulSoup\n\n\nSTOPS = {\n 'xmas...
```python import logging import posixpath import requests import arrow from functools import partial from errbot import BotPlugin, botcmd from apscheduler.scheduler import Scheduler from BeautifulSoup import BeautifulSoup STOPS = { 'xmassteps': 'bstgajt', 'centre': 'bstgajp', 'hippodrome': 'bstdwmd', ...
[ { "content": "Reconstruct the code exactly:\n```python\nimport numpy as np\nfrom scipy.interpolate import interp1d\nimport matplotlib.pyplot as plt\nplt.ion()\nfrom astropy.io import fits\nfrom fitstools import common_header\nfrom html_plot import plotter\n\ndef unpack_xy(use_args='all', preserve=False):\n d...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\nimport numpy as np\nfrom scipy.interpolate import interp1d\nimport matplotlib.pyplot as plt\nplt.ion()\nfrom astropy.io import fits\nfrom fitstools import common_header\nfrom html_plot import plotter\n\ndef unpack_xy(use_args='all', preserv...
```python import numpy as np from scipy.interpolate import interp1d import matplotlib.pyplot as plt plt.ion() from astropy.io import fits from fitstools import common_header from html_plot import plotter def unpack_xy(use_args='all', preserve=False): def decorator(f): def wrapper(use_args, *args, **kwargs)...
[ { "content": "Write the code verbatim:\n```python\n# -*- coding: utf-8 -*-\nimport unittest\nimport pathlib2 as pathlib\nfrom refmanage import BibFile\nfrom refmanage.ref_exceptions import UnparseableBibtexError\nfrom pybtex.database import BibliographyData\n\n\n# Base classes\n# ============\nclass Base(unitte...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nimport unittest\nimport pathlib2 as pathlib\nfrom refmanage import BibFile\nfrom refmanage.ref_exceptions import UnparseableBibtexError\nfrom pybtex.database import BibliographyData\n\n\n# Base classes\n# ============\nc...
```python # -*- coding: utf-8 -*- import unittest import pathlib2 as pathlib from refmanage import BibFile from refmanage.ref_exceptions import UnparseableBibtexError from pybtex.database import BibliographyData # Base classes # ============ class Base(unittest.TestCase): """ Base class for tests This cl...
[ { "content": "Provide a verbatim copy of the code:\n```python\n#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\n'''\nA cbz writter\n'''\n\nfrom mgdpck import actions\nimport os\nimport mimetypes\nimport zipfile\n\nclass CbzWritter(actions.AbsWritter):\n @classmethod\n def get_name(cls):\n return 'cbz'\n\n\n ...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\n'''\nA cbz writter\n'''\n\nfrom mgdpck import actions\nimport os\nimport mimetypes\nimport zipfile\n\nclass CbzWritter(actions.AbsWritter):\n @classmethod\n def get_name(cls):\n ret...
```python #! /usr/bin/python # -*- coding: utf-8 -*- ''' A cbz writter ''' from mgdpck import actions import os import mimetypes import zipfile class CbzWritter(actions.AbsWritter): @classmethod def get_name(cls): return 'cbz' def __init__(self, outdir): self.outdir = outdir self.out = None d...
[ { "content": "Here is the code content:\n```python\n#\n# Copyright (C) 2009, 2010 UNINETT AS\n#\n# This file is part of Network Administration Visualized (NAV).\n#\n# NAV is free software: you can redistribute it and/or modify it under the\n# terms of the GNU General Public License version 2 as published by the...
[ { "content": "Here is the code content:\n<|memory_start|>```python\n#\n# Copyright (C) 2009, 2010 UNINETT AS\n#\n# This file is part of Network Administration Visualized (NAV).\n#\n# NAV is free software: you can redistribute it and/or modify it under the\n# terms of the GNU General Public License version 2 as ...
```python # # Copyright (C) 2009, 2010 UNINETT AS # # This file is part of Network Administration Visualized (NAV). # # NAV 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 distrib...
[ { "content": "Here is a code file:\n```python\n\"\"\"\nInternal tasks are tasks that are started from the teuthology infrastructure.\nNote that there is no corresponding task defined for this module. All of\nthe calls are made from other modules, most notably teuthology/run.py\n\"\"\"\nfrom cStringIO import St...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n\"\"\"\nInternal tasks are tasks that are started from the teuthology infrastructure.\nNote that there is no corresponding task defined for this module. All of\nthe calls are made from other modules, most notably teuthology/run.py\n\"\"\"\nfrom cSt...
```python """ Internal tasks are tasks that are started from the teuthology infrastructure. Note that there is no corresponding task defined for this module. All of the calls are made from other modules, most notably teuthology/run.py """ from cStringIO import StringIO import contextlib import logging import os import...
[ { "content": "Reconstruct the code exactly:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport applications.delivery2.models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('delivery2', '0001_initial'),\n...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\nimport applications.delivery2.models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('delivery2', '0...
```python # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import applications.delivery2.models class Migration(migrations.Migration): dependencies = [ ('delivery2', '0001_initial'), ] operations = [ migrations.CreateModel( ...
[ { "content": "Here is the snippet:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport PyV8\nimport urllib\nfrom urlparse import urlparse\n\ntry:\n import json\nexcept ImportError:\n import simplejson as json\n\n\nclass Wappalyzer(object):\n\n def __init__(self, ...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport PyV8\nimport urllib\nfrom urlparse import urlparse\n\ntry:\n import json\nexcept ImportError:\n import simplejson as json\n\n\nclass Wappalyzer(object):\n\n def...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import PyV8 import urllib from urlparse import urlparse try: import json except ImportError: import simplejson as json class Wappalyzer(object): def __init__(self, url): self.file_dir = os.path.dirname(__file__) ...
[ { "content": "```python\n#/*##########################################################################\n# Copyright (C) 2004-2012 European Synchrotron Radiation Facility\n#\n# This file is part of the PyMca X-ray Fluorescence Toolkit developed at\n# the ESRF by the Software group.\n#\n# This toolkit is free sof...
[ { "content": "<|memory_start|>```python\n#/*##########################################################################\n# Copyright (C) 2004-2012 European Synchrotron Radiation Facility\n#\n# This file is part of the PyMca X-ray Fluorescence Toolkit developed at\n# the ESRF by the Software group.\n#\n# This too...
```python #/*########################################################################## # Copyright (C) 2004-2012 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. # # This toolkit is free software; you can redistribute i...
[ { "content": "```python\n# update_hi - receive binary and i) parse it, ii) update json tally as needed, iii) store .hi file for later\n# get_hi -- fetch a bin for the emu\n# get_json_tally - dump highscore table as json (for fancy frontend to display, say)\n# get_html_tally - dump highscore in vaguely readable ...
[ { "content": "<|memory_start|>```python\n# update_hi - receive binary and i) parse it, ii) update json tally as needed, iii) store .hi file for later\n# get_hi -- fetch a bin for the emu\n# get_json_tally - dump highscore table as json (for fancy frontend to display, say)\n# get_html_tally - dump highscore in v...
```python # update_hi - receive binary and i) parse it, ii) update json tally as needed, iii) store .hi file for later # get_hi -- fetch a bin for the emu # get_json_tally - dump highscore table as json (for fancy frontend to display, say) # get_html_tally - dump highscore in vaguely readable html table (for web browse...
[ { "content": "Repeat the full code snippet:\n```python\n#SBaaS base\nfrom SBaaS_base.postgresql_orm_base import *\nclass data_stage03_quantification_dG0_f(Base):\n __tablename__ = 'data_stage03_quantification_dG0_f'\n id = Column(Integer, Sequence('data_stage03_quantification_dG0_f_id_seq'), primary_key=T...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n#SBaaS base\nfrom SBaaS_base.postgresql_orm_base import *\nclass data_stage03_quantification_dG0_f(Base):\n __tablename__ = 'data_stage03_quantification_dG0_f'\n id = Column(Integer, Sequence('data_stage03_quantification_dG0_f_id_seq'...
```python #SBaaS base from SBaaS_base.postgresql_orm_base import * class data_stage03_quantification_dG0_f(Base): __tablename__ = 'data_stage03_quantification_dG0_f' id = Column(Integer, Sequence('data_stage03_quantification_dG0_f_id_seq'), primary_key=True) reference_id = Column(String(100)) met_name =...
[ { "content": "Repeat the following code:\n```python\nimport torch\nimport torch.nn as nn\n\nimport torch.nn.functional as F\n\nclass KimCNN(nn.Module):\n def __init__(self, config):\n super(KimCNN, self).__init__()\n output_channel = config.output_channel\n target_class = config.target_c...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\nimport torch\nimport torch.nn as nn\n\nimport torch.nn.functional as F\n\nclass KimCNN(nn.Module):\n def __init__(self, config):\n super(KimCNN, self).__init__()\n output_channel = config.output_channel\n target_class =...
```python import torch import torch.nn as nn import torch.nn.functional as F class KimCNN(nn.Module): def __init__(self, config): super(KimCNN, self).__init__() output_channel = config.output_channel target_class = config.target_class words_num = config.words_num words_dim ...
[ { "content": "Here is a code snippet:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nSettings for the hello scripts.\n\nYou most likely need to edit a few of them, e.g. API_HOST and the OAuth\ncredentials.\n\"\"\"\n\nOUR_BANK = '00100'\n\nUSERNAME = '1000203893'\nPASSWORD = '1000203893'\nC...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nSettings for the hello scripts.\n\nYou most likely need to edit a few of them, e.g. API_HOST and the OAuth\ncredentials.\n\"\"\"\n\nOUR_BANK = '00100'\n\nUSERNAME = '1000203893'\nPASSWORD =...
```python # -*- coding: utf-8 -*- """ Settings for the hello scripts. You most likely need to edit a few of them, e.g. API_HOST and the OAuth credentials. """ OUR_BANK = '00100' USERNAME = '1000203893' PASSWORD = '1000203893' CONSUMER_KEY = 'bvldezvlnqj4mtva4jfktke4xliep0bt1xm44yxi' CONSU...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n# Author: Nic Wolfe <nic@wolfeden.ca>\n# URL: http://code.google.com/p/sickbeard/\n#\n# This file is part of Sick Beard.\n#\n# Sick Beard is free software: you can redistribute it and/or modify\n# it under the te...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n# Author: Nic Wolfe <nic@wolfeden.ca>\n# URL: http://code.google.com/p/sickbeard/\n#\n# This file is part of Sick Beard.\n#\n# Sick Beard is free software: you can redistribute it and/or modify\n#...
```python # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 o...
[ { "content": "```python\n#!/usr/bin/env python\n\n'''\nThis module contains some common routines used by cv2 samples and an abstract multiprocessing class\n'''\n\nimport numpy as np\nimport cv2\n\n# built-in modules\nimport os\nimport itertools as it\nfrom contextlib import contextmanager\n\n\nimport multiproce...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n\n'''\nThis module contains some common routines used by cv2 samples and an abstract multiprocessing class\n'''\n\nimport numpy as np\nimport cv2\n\n# built-in modules\nimport os\nimport itertools as it\nfrom contextlib import contextmanager\n\n\ni...
```python #!/usr/bin/env python ''' This module contains some common routines used by cv2 samples and an abstract multiprocessing class ''' import numpy as np import cv2 # built-in modules import os import itertools as it from contextlib import contextmanager import multiprocessing import Queue #needed separately ...
[ { "content": "Here is the script:\n```python\nimport numpy as np\nimport os.path as op\nfrom numpy.testing import assert_array_almost_equal, assert_array_equal\nfrom nose.tools import assert_true, assert_false, assert_equal, assert_raises\n\nimport mne\nfrom mne import io, Epochs, read_events, pick_types, creat...
[ { "content": "Here is the script:\n<|memory_start|>```python\nimport numpy as np\nimport os.path as op\nfrom numpy.testing import assert_array_almost_equal, assert_array_equal\nfrom nose.tools import assert_true, assert_false, assert_equal, assert_raises\n\nimport mne\nfrom mne import io, Epochs, read_events, p...
```python import numpy as np import os.path as op from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_true, assert_false, assert_equal, assert_raises import mne from mne import io, Epochs, read_events, pick_types, create_info, EpochsArray from mne.utils import (_TempDi...
[ { "content": "Recreate the original code text:\n```python\n# -*- coding:utf-8 -*-\n#\n# Copyright 2019 The Android Open Source Project\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 Licen...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\n# -*- coding:utf-8 -*-\n#\n# Copyright 2019 The Android Open Source Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a c...
```python # -*- coding:utf-8 -*- # # Copyright 2019 The Android Open Source Project # # 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 # # Unl...
[ { "content": "Write the code verbatim:\n```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, division, unicode_literals\n##\n## This is part of Pybble, a WMS (Whatever Management System) based on\n## Jinja2/Haml, Werkzeug, Flask, and Optimism.\n##\n## Py...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, division, unicode_literals\n##\n## This is part of Pybble, a WMS (Whatever Management System) based on\n## Jinja2/Haml, Werkzeug, Flask, and Opti...
```python #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals ## ## This is part of Pybble, a WMS (Whatever Management System) based on ## Jinja2/Haml, Werkzeug, Flask, and Optimism. ## ## Pybble is Copyright © 2009-2014 by Matthias Urlichs <matth...
[ { "content": "Recreate the original code text:\n```python\nimport pytest\nimport time\nfrom anchore_engine.apis.oauth import merge_client_metadata\nfrom anchore_engine.apis.oauth import (\n setup_oauth_client,\n OAuth2Client,\n CLIENT_GRANT_KEY,\n ANONYMOUS_CLIENT_ID,\n)\n\n\n@pytest.mark.parametriz...
[ { "content": "Recreate the original code text:\n<|memory_start|>```python\nimport pytest\nimport time\nfrom anchore_engine.apis.oauth import merge_client_metadata\nfrom anchore_engine.apis.oauth import (\n setup_oauth_client,\n OAuth2Client,\n CLIENT_GRANT_KEY,\n ANONYMOUS_CLIENT_ID,\n)\n\n\n@pytest...
```python import pytest import time from anchore_engine.apis.oauth import merge_client_metadata from anchore_engine.apis.oauth import ( setup_oauth_client, OAuth2Client, CLIENT_GRANT_KEY, ANONYMOUS_CLIENT_ID, ) @pytest.mark.parametrize( "existing_metadata, meta_to_add, expected_output", [ ...
[ { "content": "Repeat the following code:\n```python\n# Bezier - last updated for NodeBox 1.8.3\n# Author: Tom De Smedt <tomdesmedt@trapdoor.be>\n# Manual: http://nodebox.net/code/index.php/Bezier\n# Copyright (c) 2007 by Tom De Smedt.\n# Refer to the \"Use\" section on http://nodebox.net/code\n# Thanks to Dr. F...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n# Bezier - last updated for NodeBox 1.8.3\n# Author: Tom De Smedt <tomdesmedt@trapdoor.be>\n# Manual: http://nodebox.net/code/index.php/Bezier\n# Copyright (c) 2007 by Tom De Smedt.\n# Refer to the \"Use\" section on http://nodebox.net/code\n#...
```python # Bezier - last updated for NodeBox 1.8.3 # Author: Tom De Smedt <tomdesmedt@trapdoor.be> # Manual: http://nodebox.net/code/index.php/Bezier # Copyright (c) 2007 by Tom De Smedt. # Refer to the "Use" section on http://nodebox.net/code # Thanks to Dr. Florimond De Smedt at the Free University of Brussels for t...
[ { "content": "```python\n#!/usr/bin/python3\n\"\"\"Post-process a GC roots dump.\n\"\"\"\n\nimport getopt\nimport os\nimport re\nimport sys\n\nimport script_utils as u\n\n# Input and output file (if not specified, defaults to stdin/stdout)\nflag_infile = None\nflag_outfile = None\n\n# Binary to analyze\nflag_mo...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/python3\n\"\"\"Post-process a GC roots dump.\n\"\"\"\n\nimport getopt\nimport os\nimport re\nimport sys\n\nimport script_utils as u\n\n# Input and output file (if not specified, defaults to stdin/stdout)\nflag_infile = None\nflag_outfile = None\n\n# Binary to ...
```python #!/usr/bin/python3 """Post-process a GC roots dump. """ import getopt import os import re import sys import script_utils as u # Input and output file (if not specified, defaults to stdin/stdout) flag_infile = None flag_outfile = None # Binary to analyze flag_module = None #..................................
[ { "content": "Here is a code file:\n```python\nfrom operator import attrgetter\n\nfrom django.core.urlresolvers import reverse\nfrom django.db.models import Min\n\nimport commonware.log\nfrom elasticsearch_dsl import F\nfrom elasticsearch_dsl.filter import Bool\n\nimport mkt\nfrom mkt.constants import APP_FEATU...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nfrom operator import attrgetter\n\nfrom django.core.urlresolvers import reverse\nfrom django.db.models import Min\n\nimport commonware.log\nfrom elasticsearch_dsl import F\nfrom elasticsearch_dsl.filter import Bool\n\nimport mkt\nfrom mkt.constants ...
```python from operator import attrgetter from django.core.urlresolvers import reverse from django.db.models import Min import commonware.log from elasticsearch_dsl import F from elasticsearch_dsl.filter import Bool import mkt from mkt.constants import APP_FEATURES from mkt.constants.applications import DEVICE_GAIA ...
[ { "content": "Here is the script:\n```python\n# -*- coding: utf-8 -*-\n#---------------------------------------------------------------------\n'''\nCreated on 07 Nov. 2015\n\n@author: Seko\n@summary: Advanced Downloader\n\n'''\n#---------------------------------------------------------------------\n\n# ________...
[ { "content": "Here is the script:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#---------------------------------------------------------------------\n'''\nCreated on 07 Nov. 2015\n\n@author: Seko\n@summary: Advanced Downloader\n\n'''\n#-------------------------------------------------------------------...
```python # -*- coding: utf-8 -*- #--------------------------------------------------------------------- ''' Created on 07 Nov. 2015 @author: Seko @summary: Advanced Downloader ''' #--------------------------------------------------------------------- # ____________________ I M P O R T ________________...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n# coding=utf-8\r\n'''\r\nCreated on 2016. 8. 14.\r\n\r\n@author: Jay\r\n'''\r\nfrom cppy.adaptor import CpRqRpClass\r\nimport win32com.client\r\n\r\n\r\n@CpRqRpClass('CpTrade.CpTd0311')\r\nclass StockOrderCash(object):\r\n '''\r\n ...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# coding=utf-8\r\n'''\r\nCreated on 2016. 8. 14.\r\n\r\n@author: Jay\r\n'''\r\nfrom cppy.adaptor import CpRqRpClass\r\nimport win32com.client\r\n\r\n\r\n@CpRqRpClass('CpTrade.CpTd0311')\r\nclass StockOrderCash(object):\...
```python # coding=utf-8 ''' Created on 2016. 8. 14. @author: Jay ''' from cppy.adaptor import CpRqRpClass import win32com.client @CpRqRpClass('CpTrade.CpTd0311') class StockOrderCash(object): ''' 장내주식/코스닥주식/ELW 주문(현금주문) 데이터를 요청하고 수신한다. ''' def __init__(self): self.instCpTdUti...
[ { "content": "Here is the source code:\n```python\nimport sys\n\ntry:\n from django.conf import settings\n\n settings.configure(\n DEBUG=True,\n USE_TZ=True,\n DATABASES={\n \"default\": {\n \"ENGINE\": \"django.db.backends.sqlite3\",\n }\n ...
[ { "content": "Here is the source code:\n<|memory_start|>```python\nimport sys\n\ntry:\n from django.conf import settings\n\n settings.configure(\n DEBUG=True,\n USE_TZ=True,\n DATABASES={\n \"default\": {\n \"ENGINE\": \"django.db.backends.sqlite3\",\n ...
```python import sys try: from django.conf import settings settings.configure( DEBUG=True, USE_TZ=True, DATABASES={ "default": { "ENGINE": "django.db.backends.sqlite3", } }, ROOT_URLCONF="djangocms_owl.urls", INSTALLED_APP...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n# -*- coding: utf-8 -*-\n# ---------------------------------------------------------------------------\n# police-uum.py\n# Author: Maxim Dubinin (sim@gis-lab.info)\n# About: Grab 112.ru data on участковые, creates two tabl...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# ---------------------------------------------------------------------------\n# police-uum.py\n# Author: Maxim Dubinin (sim@gis-lab.info)\n# About: Grab 112.ru data on участковые, ...
```python # -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # police-uum.py # Author: Maxim Dubinin (sim@gis-lab.info) # About: Grab 112.ru data on участковые, creates two tables linked with unique id, policemen and locations they are responsible for. # Created: 13:26...
[ { "content": "```python\n\"\"\"\nJedi is a static analysis tool for Python that can be used in IDEs/editors. Its\nhistoric focus is autocompletion, but does static analysis for now as well.\nJedi is fast and is very well tested. It understands Python on a deeper level\nthan all other static analysis frameworks ...
[ { "content": "<|memory_start|>```python\n\"\"\"\nJedi is a static analysis tool for Python that can be used in IDEs/editors. Its\nhistoric focus is autocompletion, but does static analysis for now as well.\nJedi is fast and is very well tested. It understands Python on a deeper level\nthan all other static anal...
```python """ Jedi is a static analysis tool for Python that can be used in IDEs/editors. Its historic focus is autocompletion, but does static analysis for now as well. Jedi is fast and is very well tested. It understands Python on a deeper level than all other static analysis frameworks for Python. Jedi has support ...
[ { "content": "```python\nimport requests, logging, json\nfrom storitch import config, config_load, logger\n\ndef upload_multipart():\n r = requests.post(\n 'http://127.0.0.1:{}/store'.format(config['port']),\n files={'file': open('test1.txt', 'rb')}\n )\n logging.debug(r.text)\n loggin...
[ { "content": "<|memory_start|>```python\nimport requests, logging, json\nfrom storitch import config, config_load, logger\n\ndef upload_multipart():\n r = requests.post(\n 'http://127.0.0.1:{}/store'.format(config['port']),\n files={'file': open('test1.txt', 'rb')}\n )\n logging.debug(r.t...
```python import requests, logging, json from storitch import config, config_load, logger def upload_multipart(): r = requests.post( 'http://127.0.0.1:{}/store'.format(config['port']), files={'file': open('test1.txt', 'rb')} ) logging.debug(r.text) logging.debug(r.status_code) r.rai...
[ { "content": "Reconstruct the code exactly:\n```python\nfrom __future__ import unicode_literals\n__author__ = 'hz'\nimport nltk\n\nclass DataFormat:\n def __init__(self):\n pass\n\n def dataFormat( self, _sentence ):\n \"\"\"\n format the input data and save it in the tmp file\n ...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\nfrom __future__ import unicode_literals\n__author__ = 'hz'\nimport nltk\n\nclass DataFormat:\n def __init__(self):\n pass\n\n def dataFormat( self, _sentence ):\n \"\"\"\n format the input data and save it in the ...
```python from __future__ import unicode_literals __author__ = 'hz' import nltk class DataFormat: def __init__(self): pass def dataFormat( self, _sentence ): """ format the input data and save it in the tmp file :param _sentence: :return: """ if isinstan...
[ { "content": "Repeat the code precisely:\n```python\nimport ntlm_auth.compute_hash as compute_hash\n\n\nclass TestComputeHash(object):\n\n def test_lmowfv1(self):\n # 4.2.2.1.1 - LMOWFv1()\n expected = b\"\\xe5\\x2c\\xac\\x67\\x41\\x9a\\x9a\\x22\" \\\n b\"\\x4a\\x3b\\x10\\x8f\...
[ { "content": "Repeat the code precisely:\n<|memory_start|>```python\nimport ntlm_auth.compute_hash as compute_hash\n\n\nclass TestComputeHash(object):\n\n def test_lmowfv1(self):\n # 4.2.2.1.1 - LMOWFv1()\n expected = b\"\\xe5\\x2c\\xac\\x67\\x41\\x9a\\x9a\\x22\" \\\n b\"\\x4a...
```python import ntlm_auth.compute_hash as compute_hash class TestComputeHash(object): def test_lmowfv1(self): # 4.2.2.1.1 - LMOWFv1() expected = b"\xe5\x2c\xac\x67\x41\x9a\x9a\x22" \ b"\x4a\x3b\x10\x8f\x3f\xa6\xcb\x6d" actual = compute_hash._lmowfv1("Password") ...
[ { "content": "Replicate the source code:\n```python\n# japanese_theme_base.py --- Traditional colors of Japan\n\ndef parse_csv(s):\n result = dict()\n\n def modifier(x):\n if x[0] == \"#\":\n return x[1:]\n else:\n return result[x]\n\n ls = s.splitlines()\n for l ...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n# japanese_theme_base.py --- Traditional colors of Japan\n\ndef parse_csv(s):\n result = dict()\n\n def modifier(x):\n if x[0] == \"#\":\n return x[1:]\n else:\n return result[x]\n\n ls = s.splitlin...
```python # japanese_theme_base.py --- Traditional colors of Japan def parse_csv(s): result = dict() def modifier(x): if x[0] == "#": return x[1:] else: return result[x] ls = s.splitlines() for l in ls: ss = l.split(",") result[ss[0]] = modifier...
[ { "content": "Here is the script:\n```python\nfrom strategy import Strategy\nimport gobject\n\nclass SimpleStrategy(Strategy):\n\tdef __init__(self):\n\t\tsuper(SimpleStrategy, self).__init__()\n\n\tdef do_raise_cash(self, target, hand):\n\t\traised = 0\n\n\t\t(monopolies, crap) = self.split_hand(hand)\n\n\t\t#...
[ { "content": "Here is the script:\n<|memory_start|>```python\nfrom strategy import Strategy\nimport gobject\n\nclass SimpleStrategy(Strategy):\n\tdef __init__(self):\n\t\tsuper(SimpleStrategy, self).__init__()\n\n\tdef do_raise_cash(self, target, hand):\n\t\traised = 0\n\n\t\t(monopolies, crap) = self.split_han...
```python from strategy import Strategy import gobject class SimpleStrategy(Strategy): def __init__(self): super(SimpleStrategy, self).__init__() def do_raise_cash(self, target, hand): raised = 0 (monopolies, crap) = self.split_hand(hand) # first try mortgage properties that are not # part of monopolies...
[ { "content": "Repeat the code exactly:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport tensorflow as tf\nimport numpy as np\nimport scipy.misc as misc\nimport os\nimport time\nfrom collections import namedtuple\nfrom .ops import conv2d...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport tensorflow as tf\nimport numpy as np\nimport scipy.misc as misc\nimport os\nimport time\nfrom collections import namedtuple\nfrom .o...
```python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import import tensorflow as tf import numpy as np import scipy.misc as misc import os import time from collections import namedtuple from .ops import conv2d, deconv2d, lrelu, fc, batch_norm, init_embedding, conditio...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# Section 3: Algebraic simplification\n\n# This code implements a simple computer algebra system, which takes in an\n# expression made of nested sums and products, and simplifies it into a\n# single sum of products. Th...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# Section 3: Algebraic simplification\n\n# This code implements a simple computer algebra system, which takes in an\n# expression made of nested sums and products, and simplifies it into a\n# single sum...
```python # Section 3: Algebraic simplification # This code implements a simple computer algebra system, which takes in an # expression made of nested sums and products, and simplifies it into a # single sum of products. The goal is described in more detail in the # problem set writeup. # Much of this code is already...
[ { "content": "```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport unittest\n\nfrom utils.read_data_file import read_int_array\nfrom sorting.insertion_sort import sort\n\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\n\n\nclass InsertionSortTester(unittest.TestCase):\n\n #...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport unittest\n\nfrom utils.read_data_file import read_int_array\nfrom sorting.insertion_sort import sort\n\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\n\n\nclass InsertionSortTester(unittest.Tes...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- import os import unittest from utils.read_data_file import read_int_array from sorting.insertion_sort import sort BASE_DIR = os.path.dirname(os.path.abspath(__file__)) class InsertionSortTester(unittest.TestCase): # Test sort in default order, i.e., in ...
[ { "content": "Here is the script:\n```python\n\"\"\" sample variance decay of two level QG system \"\"\"\n\nfrom __future__ import division\nfrom __future__ import absolute_import\n\nfrom firedrake import *\n\nfrom quasi_geostrophic_model import *\n\nimport numpy as np\n\nimport matplotlib.pyplot as plot\n\n\n#...
[ { "content": "Here is the script:\n<|memory_start|>```python\n\"\"\" sample variance decay of two level QG system \"\"\"\n\nfrom __future__ import division\nfrom __future__ import absolute_import\n\nfrom firedrake import *\n\nfrom quasi_geostrophic_model import *\n\nimport numpy as np\n\nimport matplotlib.pyplo...
```python """ sample variance decay of two level QG system """ from __future__ import division from __future__ import absolute_import from firedrake import * from quasi_geostrophic_model import * import numpy as np import matplotlib.pyplot as plot # define mesh hierarchy mesh = UnitSquareMesh(5, 5) L = 4 mesh_...
[ { "content": "Here is a code file:\n```python\n#Copyright (c) 2011,12 Walter Bender\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 3 of the License, or\n# (at your o...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n#Copyright (c) 2011,12 Walter Bender\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 3 of the License, ...
```python #Copyright (c) 2011,12 Walter Bender # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # You should have rece...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\nimport argparse\nimport itertools\nimport json\nimport collections\nimport datetime\nimport sys\n\nimport mercantile\nimport shapely.geometry\n\n\nMIN_DATE = '0000-00-00'\nMAX_DATE = '9999-99-99'\nMIN_ZOOM = 0\nMAX_ZOOM = 19\n\n...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\nimport argparse\nimport itertools\nimport json\nimport collections\nimport datetime\nimport sys\n\nimport mercantile\nimport shapely.geometry\n\n\nMIN_DATE = '0000-00-00'\nMAX_DATE = '9999-99-99'\nMIN_ZOOM = 0\nM...
```python import argparse import itertools import json import collections import datetime import sys import mercantile import shapely.geometry MIN_DATE = '0000-00-00' MAX_DATE = '9999-99-99' MIN_ZOOM = 0 MAX_ZOOM = 19 cache_down = {} cache_up = {} cache_center = {} cache_date = {} cache_in_bound = {} def get_down...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information.\n#\n# fields.compressed - Some types and objects related to compressed fields. Use in place of IRField ( in FIELDS...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information.\n#\n# fields.compressed - Some types and objects related to compressed fields. Use in place of IRF...
```python # Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.compressed - Some types and objects related to compressed fields. Use in place of IRField ( in FIELDS array to activate functionality ) # # vim: set ts=8 shiftwidth=8 softtabstop=8 no...
[ { "content": "Here is the script:\n```python\n# -*- coding: UTF-8 -*-\n\n\nimport re,urllib,urlparse\n\nfrom resources.lib.modules import cleantitle\nfrom resources.lib.modules import client\nfrom resources.lib.modules import debrid\n\nclass source:\n def __init__(self):\n self.priority = 1\n s...
[ { "content": "Here is the script:\n<|memory_start|>```python\n# -*- coding: UTF-8 -*-\n\n\nimport re,urllib,urlparse\n\nfrom resources.lib.modules import cleantitle\nfrom resources.lib.modules import client\nfrom resources.lib.modules import debrid\n\nclass source:\n def __init__(self):\n self.priorit...
```python # -*- coding: UTF-8 -*- import re,urllib,urlparse from resources.lib.modules import cleantitle from resources.lib.modules import client from resources.lib.modules import debrid class source: def __init__(self): self.priority = 1 self.language = ['en'] self.domains = ['best-movi...
[ { "content": "Here is the code block:\n```python\nimport inspect\nimport os\nimport sys\n\nfrom django.apps import apps\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.db import DEFAULT_DB_ALIAS, connections\nfrom django.db.migrations.loader import Migrati...
[ { "content": "Here is the code block:\n<|memory_start|>```python\nimport inspect\nimport os\nimport sys\n\nfrom django.apps import apps\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.db import DEFAULT_DB_ALIAS, connections\nfrom django.db.migrations.loade...
```python import inspect import os import sys from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.loader import MigrationLoader from django.utils.timezone import now from . i...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\n# -*- encoding: utf-8 -*-\nimport pytest\n\nfrom decimal import Decimal\n\nfrom finance.tests.factories import VatSettingsFactory\nfrom invoice.models import Invoice, InvoiceLine\nfrom invoice.service import InvoicePrint\nfrom i...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n# -*- encoding: utf-8 -*-\nimport pytest\n\nfrom decimal import Decimal\n\nfrom finance.tests.factories import VatSettingsFactory\nfrom invoice.models import Invoice, InvoiceLine\nfrom invoice.service import Invo...
```python # -*- encoding: utf-8 -*- import pytest from decimal import Decimal from finance.tests.factories import VatSettingsFactory from invoice.models import Invoice, InvoiceLine from invoice.service import InvoicePrint from invoice.tests.factories import ( InvoiceFactory, InvoiceLineFactory, InvoiceSet...
[ { "content": "```python\n# coding: utf-8\n#\n# This file is part of Sequana software\n#\n# Copyright (c) 2016 - Sequana Development Team\n#\n# File author(s):\n# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>\n# Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>,\n# <d.desvillechab...
[ { "content": "<|memory_start|>```python\n# coding: utf-8\n#\n# This file is part of Sequana software\n#\n# Copyright (c) 2016 - Sequana Development Team\n#\n# File author(s):\n# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>\n# Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>,\n# ...
```python # coding: utf-8 # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>, # <d.desvillechabrol@gmail.com> # # Distributed ...
[ { "content": "Here is the snippet:\n```python\n#!/usr/bin/env python\nimport numpy\nimport os\nimport tensorflow as tf\nfrom multiprocessing import Pool\nfrom tqdm import tqdm\nimport numpy as np\nimport h5py\n\nfrom generic.data_provider.nlp_utils import DummyTokenizer\nfrom generic.data_provider.iterator impo...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\nimport numpy\nimport os\nimport tensorflow as tf\nfrom multiprocessing import Pool\nfrom tqdm import tqdm\nimport numpy as np\nimport h5py\n\nfrom generic.data_provider.nlp_utils import DummyTokenizer\nfrom generic.data_provid...
```python #!/usr/bin/env python import numpy import os import tensorflow as tf from multiprocessing import Pool from tqdm import tqdm import numpy as np import h5py from generic.data_provider.nlp_utils import DummyTokenizer from generic.data_provider.iterator import Iterator def extract_features( img_input, ...
[ { "content": "Here is the code block:\n```python\nfrom __future__ import print_function\nimport httplib2\nimport os\n\nfrom apiclient import discovery\nfrom oauth2client import client\nfrom oauth2client import tools\nfrom oauth2client.file import Storage\n\nimport datetime\n\ntry:\n import argparse\n flag...
[ { "content": "Here is the code block:\n<|memory_start|>```python\nfrom __future__ import print_function\nimport httplib2\nimport os\n\nfrom apiclient import discovery\nfrom oauth2client import client\nfrom oauth2client import tools\nfrom oauth2client.file import Storage\n\nimport datetime\n\ntry:\n import ar...
```python from __future__ import print_function import httplib2 import os from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage import datetime try: import argparse flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_...
[ { "content": "```python\nclass bokehLine(object):\n\tdef __init__(self, line, symbol = None, viewNum = None, parent = None):\n\t\tself.line = line\n\t\tself.symbol = symbol\n\t\tself.viewNum = viewNum\n\t\tself.style = None\n\t\tself.val = {'name' : self.line.name, \n\t\t\t\t\t'color' : self.line.lin...
[ { "content": "<|memory_start|>```python\nclass bokehLine(object):\n\tdef __init__(self, line, symbol = None, viewNum = None, parent = None):\n\t\tself.line = line\n\t\tself.symbol = symbol\n\t\tself.viewNum = viewNum\n\t\tself.style = None\n\t\tself.val = {'name' : self.line.name, \n\t\t\t\t\t'color' ...
```python class bokehLine(object): def __init__(self, line, symbol = None, viewNum = None, parent = None): self.line = line self.symbol = symbol self.viewNum = viewNum self.style = None self.val = {'name' : self.line.name, 'color' : self.line.line_color, 'width' : self.line.line_width...
[ { "content": "Here is the code content:\n```python\nfrom functools import partial\nimport json\n\nfrom PyQt5.QtCore import QCoreApplication, Qt\nfrom PyQt5.QtGui import QCursor, QIcon, QKeySequence\nfrom PyQt5.QtWidgets import (\n QMainWindow,\n QMenu,\n)\n\nfrom plover import log\nfrom plover.oslayer imp...
[ { "content": "Here is the code content:\n<|memory_start|>```python\nfrom functools import partial\nimport json\n\nfrom PyQt5.QtCore import QCoreApplication, Qt\nfrom PyQt5.QtGui import QCursor, QIcon, QKeySequence\nfrom PyQt5.QtWidgets import (\n QMainWindow,\n QMenu,\n)\n\nfrom plover import log\nfrom pl...
```python from functools import partial import json from PyQt5.QtCore import QCoreApplication, Qt from PyQt5.QtGui import QCursor, QIcon, QKeySequence from PyQt5.QtWidgets import ( QMainWindow, QMenu, ) from plover import log from plover.oslayer import wmctrl from plover.registry import registry from plover.r...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\n# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved.\n# Copyright 2012 Managed I.T.\n#\n# Author: Patrick Galbraith <patg@hp.com>\n# Author: Kiall Mac Innes <kiall@managedit.ie>\n#\n# License...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\n# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved.\n# Copyright 2012 Managed I.T.\n#\n# Author: Patrick Galbraith <patg@hp.com>\n# Author: Kiall Mac Innes <kiall@managedit.i...
```python # Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved. # Copyright 2012 Managed I.T. # # Author: Patrick Galbraith <patg@hp.com> # Author: Kiall Mac Innes <kiall@managedit.ie> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in com...