prompt
listlengths
1
1
compression_prompt
listlengths
1
1
target
stringlengths
1.03k
828k
[ { "content": "Reconstruct the code exactly:\n```python\n#!/usr/bin/env python\n\n# GrovePi LED blink test for the Grove LED Socket (http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit)\n#\n# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterind...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n# GrovePi LED blink test for the Grove LED Socket (http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit)\n#\n# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http...
```python #!/usr/bin/env python # GrovePi LED blink test for the Grove LED Socket (http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a question about this example...
[ { "content": "```python\ndef cells():\n '''\n # Linear algebra overview\n '''\n\n '''\n '''\n\n '''\n Linear algebra is the study of **vectors** and **linear transformations**. This notebook introduces concepts form linear algebra in a birds-eye overview. The goal is not to get into the det...
[ { "content": "<|memory_start|>```python\ndef cells():\n '''\n # Linear algebra overview\n '''\n\n '''\n '''\n\n '''\n Linear algebra is the study of **vectors** and **linear transformations**. This notebook introduces concepts form linear algebra in a birds-eye overview. The goal is not to ...
```python def cells(): ''' # Linear algebra overview ''' ''' ''' ''' Linear algebra is the study of **vectors** and **linear transformations**. This notebook introduces concepts form linear algebra in a birds-eye overview. The goal is not to get into the details, but to give the reader a t...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2....
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/lic...
```python # -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ { "content": "Write the code verbatim:\n```python\n#!/usr/bin/env python\n#\n# Copyright 2009 Facebook\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apach...
[ { "content": "Write the code verbatim:\n<|memory_start|>```python\n#!/usr/bin/env python\n#\n# Copyright 2009 Facebook\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# ...
```python #!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
[ { "content": "Here is the script:\n```python\n# -*- coding: utf-8 -*-\n#\n# This file is part of Glances.\n#\n# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>\n#\n# Glances is free software; you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License as published b...
[ { "content": "Here is the script:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# This file is part of Glances.\n#\n# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>\n#\n# Glances is free software; you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public Licens...
```python # -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com> # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 ...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# Script name : tune_scale.py\n# Semantics version: semantics-4\n# Description : Tento skript umoznuje ladeni scaling faktoru\n# SCALE_CONCEPT12 a SCALE_PUSHPOP. Vychozi hodnoty jsou\n# ...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# Script name : tune_scale.py\n# Semantics version: semantics-4\n# Description : Tento skript umoznuje ladeni scaling faktoru\n# SCALE_CONCEPT12 a SCALE_PUSHPOP. Vychozi hodnoty jsou\n# ...
```python # Script name : tune_scale.py # Semantics version: semantics-4 # Description : Tento skript umoznuje ladeni scaling faktoru # SCALE_CONCEPT12 a SCALE_PUSHPOP. Vychozi hodnoty jsou # brany ze souboru settings, vychozi rozsah je +-0.6 a krok # 0...
[ { "content": "```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n save mail to file for ablog\n\"\"\"\nfrom __future__ import print_function # for pylint\nimport sys\nimport os\nimport os.path\nimport shutil\nimport datetime\n\nimport imaplib\nimport getpass\nimport email\nimport smtplib\n\n...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n save mail to file for ablog\n\"\"\"\nfrom __future__ import print_function # for pylint\nimport sys\nimport os\nimport os.path\nimport shutil\nimport datetime\n\nimport imaplib\nimport getpass\nimport email\nim...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- """ save mail to file for ablog """ from __future__ import print_function # for pylint import sys import os import os.path import shutil import datetime import imaplib import getpass import email import smtplib try: from email.MIMEMultipart import MIMEM...
[ { "content": "Return the code unaltered:\n```python\n# -*- coding: utf-8 -*-\n# Created by apple on 2017/1/31.\n\nimport re\nimport aiofiles\nimport plistlib\nfrom platform import system\nfrom .regex import Regex\nfrom ..log import log\nfrom zipfile import ZipFile\nfrom subprocess import Popen, PIPE\nfrom ..db ...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Created by apple on 2017/1/31.\n\nimport re\nimport aiofiles\nimport plistlib\nfrom platform import system\nfrom .regex import Regex\nfrom ..log import log\nfrom zipfile import ZipFile\nfrom subprocess import Popen, ...
```python # -*- coding: utf-8 -*- # Created by apple on 2017/1/31. import re import aiofiles import plistlib from platform import system from .regex import Regex from ..log import log from zipfile import ZipFile from subprocess import Popen, PIPE from ..db import AppType aapt = './aapt_mac' if system() == 'Darwin' el...
[ { "content": "Provide an exact copy of the source code:\n```python\n# ###################################################\n# Copyright (C) 2008-2017 The Unknown Horizons Team\n# team@unknown-horizons.org\n# This file is part of Unknown Horizons.\n#\n# Unknown Horizons is free software; you can redistribute it a...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n# ###################################################\n# Copyright (C) 2008-2017 The Unknown Horizons Team\n# team@unknown-horizons.org\n# This file is part of Unknown Horizons.\n#\n# Unknown Horizons is free software; you can r...
```python # ################################################### # Copyright (C) 2008-2017 The Unknown Horizons Team # team@unknown-horizons.org # This file is part of Unknown Horizons. # # Unknown Horizons is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n#! /usr/bin/env python3\n# coding: utf-8\n\n'''\nFonctions de manipulation et vérifications du fichier de configuration\n'''\n\nimport json\nimport utils.misc as misc\n\nCONF_FILE_NAME = \"conf/conf.json\"\n\n\n'''\ncheck_conf_valid: v...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n#! /usr/bin/env python3\n# coding: utf-8\n\n'''\nFonctions de manipulation et vérifications du fichier de configuration\n'''\n\nimport json\nimport utils.misc as misc\n\nCONF_FILE_NAME = \"conf/conf.json\"\n\n\n'''\nche...
```python #! /usr/bin/env python3 # coding: utf-8 ''' Fonctions de manipulation et vérifications du fichier de configuration ''' import json import utils.misc as misc CONF_FILE_NAME = "conf/conf.json" ''' check_conf_valid: vérifie que le fichier de conf est bien dans un format json valide entrée: pas d'argument (n...
[ { "content": "Reconstruct the code exactly:\n```python\n#!/usr/bin/env python\n\nimport os, sys\nimport filecmp\nimport re\nimport shutil\nholderlist=[]\n\ndef compareme(dir1, dir2):\n dircomp=filecmp.dircmp(dir1,dir2)\n only_in_one=dircomp.left_only\n diff_in_one=dircomp.diff_files\n dirpath=os.pat...
[ { "content": "Reconstruct the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nimport os, sys\nimport filecmp\nimport re\nimport shutil\nholderlist=[]\n\ndef compareme(dir1, dir2):\n dircomp=filecmp.dircmp(dir1,dir2)\n only_in_one=dircomp.left_only\n diff_in_one=dircomp.diff_files\n ...
```python #!/usr/bin/env python import os, sys import filecmp import re import shutil holderlist=[] def compareme(dir1, dir2): dircomp=filecmp.dircmp(dir1,dir2) only_in_one=dircomp.left_only diff_in_one=dircomp.diff_files dirpath=os.path.abspath(dir1) [holderlist.append(os.path.abspath( os.path.jo...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n#!/usr/bin/env python\n\nimport os\nfrom argh import arg, ArghParser\nfrom argh.exceptions import CommandError\nfrom functools import wraps\n\n\nCONFIG = os.environ.get('ALFRED_CONFIG')\n\n\ndef with_app(func):\n @wraps(func)\n @arg('-...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nimport os\nfrom argh import arg, ArghParser\nfrom argh.exceptions import CommandError\nfrom functools import wraps\n\n\nCONFIG = os.environ.get('ALFRED_CONFIG')\n\n\ndef with_app(func):\n @wraps(fu...
```python #!/usr/bin/env python import os from argh import arg, ArghParser from argh.exceptions import CommandError from functools import wraps CONFIG = os.environ.get('ALFRED_CONFIG') def with_app(func): @wraps(func) @arg('--config', help='path to config') def wrapper(args): from alfred import...
[ { "content": "Provide an exact copy of the source code:\n```python\nimport logging\nfrom pyvisdk.exceptions import InvalidArgumentError\n\n########################################\n# Automatically generated, do not edit.\n########################################\n\nlog = logging.getLogger(__name__)\n\ndef HostA...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nimport logging\nfrom pyvisdk.exceptions import InvalidArgumentError\n\n########################################\n# Automatically generated, do not edit.\n########################################\n\nlog = logging.getLogger(__name...
```python import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def HostAdminEnableEvent(vim, *args, **kwargs): '''This event records that the a...
[ { "content": "Here is the source code:\n```python\n#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\n Blockstack\n ~~~~~\n copyright: (c) 2014-2015 by Halfmoon Labs, Inc.\n copyright: (c) 2016 by Blockstack.org\n\n This file is part of Blockstack\n\n Blockstack is free software: you can...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\n Blockstack\n ~~~~~\n copyright: (c) 2014-2015 by Halfmoon Labs, Inc.\n copyright: (c) 2016 by Blockstack.org\n\n This file is part of Blockstack\n\n Blockstack is free s...
```python #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Blockstack ~~~~~ copyright: (c) 2014-2015 by Halfmoon Labs, Inc. copyright: (c) 2016 by Blockstack.org This file is part of Blockstack Blockstack is free software: you can redistribute it and/or modify it under the terms of the G...
[ { "content": "```python\nimport json\n\nfrom django.db import models\nfrom django.utils import timezone\nfrom django.conf import settings\n\n\nclass Client(models.Model):\n\n RESPONSE_TYPE_CHOICES = [\n ('code', 'code (Authorization Code Flow)'),\n ('id_token', 'id_token (Implicit Flow)'),\n ...
[ { "content": "<|memory_start|>```python\nimport json\n\nfrom django.db import models\nfrom django.utils import timezone\nfrom django.conf import settings\n\n\nclass Client(models.Model):\n\n RESPONSE_TYPE_CHOICES = [\n ('code', 'code (Authorization Code Flow)'),\n ('id_token', 'id_token (Implic...
```python import json from django.db import models from django.utils import timezone from django.conf import settings class Client(models.Model): RESPONSE_TYPE_CHOICES = [ ('code', 'code (Authorization Code Flow)'), ('id_token', 'id_token (Implicit Flow)'), ('id_token token', 'id_token t...
[ { "content": "Here is a code file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport copy\nimport re\nfrom importlib import import_module\n\nfrom django import forms\nfrom django.utils import six\nfrom django.utils.decorators import classonlymethod\nfrom django.utils.encodin...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport copy\nimport re\nfrom importlib import import_module\n\nfrom django import forms\nfrom django.utils import six\nfrom django.utils.decorators import classonlymethod\nfrom djan...
```python # -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import re from importlib import import_module from django import forms from django.utils import six from django.utils.decorators import classonlymethod from django.utils.encoding import python_2_unicode_compatible from django.utils....
[ { "content": "Here is the script:\n```python\nclass ProxyDict(object):\r\n def __init__(self, parent, collection_name, childclass, keyname):\r\n self.parent = parent\r\n self.collection_name = collection_name\r\n self.childclass = childclass\r\n self.keyname = keyname\r\n\r\n @...
[ { "content": "Here is the script:\n<|memory_start|>```python\nclass ProxyDict(object):\r\n def __init__(self, parent, collection_name, childclass, keyname):\r\n self.parent = parent\r\n self.collection_name = collection_name\r\n self.childclass = childclass\r\n self.keyname = keyn...
```python class ProxyDict(object): def __init__(self, parent, collection_name, childclass, keyname): self.parent = parent self.collection_name = collection_name self.childclass = childclass self.keyname = keyname @property def collection(self): return getatt...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n\"\"\"\nDescriptive HTTP status codes, for code readability.\n\nSee RFC 2616 - Sec 10: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\nAlso see django.core.handlers.wsgi.STATUS_CODE_TEXT\n\"\"\"\n\nHTTP_100_CONTINUE = 100\nHT...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n\"\"\"\nDescriptive HTTP status codes, for code readability.\n\nSee RFC 2616 - Sec 10: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\nAlso see django.core.handlers.wsgi.STATUS_CODE_TEXT\n\"\"\"\n\nHTTP_100_CO...
```python """ Descriptive HTTP status codes, for code readability. See RFC 2616 - Sec 10: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Also see django.core.handlers.wsgi.STATUS_CODE_TEXT """ HTTP_100_CONTINUE = 100 HTTP_101_SWITCHING_PROTOCOLS = 101 HTTP_200_OK = 200 HTTP_201_CREATED = 201 HTTP_202_ACCEPTED...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\nfrom django.apps import apps\nfrom django.contrib import messages\nfrom django.contrib.auth.decorators import login_required\nfrom django.core.urlresolvers import re...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\nfrom django.apps import apps\nfrom django.contrib import messages\nfrom django.contrib.auth.decorators import login_required\nfrom django.core.urlres...
```python # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import apps from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse_lazy from django.db.models import Q from django.shortcuts import redirect fro...
[ { "content": "Provide an exact copy of the source code:\n```python\nimport datetime\nimport logging\nimport Mollie\n\nfrom django.conf import settings\nfrom django.contrib.auth.decorators import login_required\nfrom django.template.context_processors import csrf\nfrom django.core.urlresolvers import reverse\nfr...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nimport datetime\nimport logging\nimport Mollie\n\nfrom django.conf import settings\nfrom django.contrib.auth.decorators import login_required\nfrom django.template.context_processors import csrf\nfrom django.core.urlresolvers im...
```python import datetime import logging import Mollie from django.conf import settings from django.contrib.auth.decorators import login_required from django.template.context_processors import csrf from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from django.short...
[ { "content": "Here is the snippet:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# dbload.py\n#\n# Copyright 2015 Hartland PC LLC\n#\n# This file is part of the of the database loader for CCE 4.0 (open source version).\n#\n# This package is free software: you can redistribute it and/or modify\...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# dbload.py\n#\n# Copyright 2015 Hartland PC LLC\n#\n# This file is part of the of the database loader for CCE 4.0 (open source version).\n#\n# This package is free software: you can redistribute i...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- # # dbload.py # # Copyright 2015 Hartland PC LLC # # This file is part of the of the database loader for CCE 4.0 (open source version). # # This package is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License...
[ { "content": "```python\nfrom .adaptive import *\nfrom .base import build, Optimizer\nfrom .dataset import Dataset\nfrom .first_order import *\n\n__version__ = '0.2.2'\n\n\ndef minimize(loss, train, valid=None, params=None, inputs=None, algo='rmsprop',\n updates=(), monitors=(), monitor_gradients=Fa...
[ { "content": "<|memory_start|>```python\nfrom .adaptive import *\nfrom .base import build, Optimizer\nfrom .dataset import Dataset\nfrom .first_order import *\n\n__version__ = '0.2.2'\n\n\ndef minimize(loss, train, valid=None, params=None, inputs=None, algo='rmsprop',\n updates=(), monitors=(), moni...
```python from .adaptive import * from .base import build, Optimizer from .dataset import Dataset from .first_order import * __version__ = '0.2.2' def minimize(loss, train, valid=None, params=None, inputs=None, algo='rmsprop', updates=(), monitors=(), monitor_gradients=False, batch_size=32, ...
[ { "content": "Here is the script:\n```python\nfrom os.path import exists, abspath, dirname, join\nimport misc\n\n\nTHIS_DIR = dirname(abspath(__file__))\n\n# this is a personal access token used by chaosbot to perform merges and other\n# api requests. it is a secret, and lives on the server, but since chaosbot...
[ { "content": "Here is the script:\n<|memory_start|>```python\nfrom os.path import exists, abspath, dirname, join\nimport misc\n\n\nTHIS_DIR = dirname(abspath(__file__))\n\n# this is a personal access token used by chaosbot to perform merges and other\n# api requests. it is a secret, and lives on the server, bu...
```python from os.path import exists, abspath, dirname, join import misc THIS_DIR = dirname(abspath(__file__)) # this is a personal access token used by chaosbot to perform merges and other # api requests. it is a secret, and lives on the server, but since chaosbot has # access to this secret file, it can be manipu...
[ { "content": "Here is the code block:\n```python\n# Copyright (C) 2010-2011 Richard Lincoln\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\n# deal in the Software without restriction, including with...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n# Copyright (C) 2010-2011 Richard Lincoln\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\n# deal in the Software without restriction...
```python # Copyright (C) 2010-2011 Richard Lincoln # # 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, modify, merg...
[ { "content": "Repeat the following code:\n```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# OpenERP, Open Source Management Solution\n# Addons modules by CLEARCORP S.A.\n# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.c...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n##############################################################################\n#\n# OpenERP, Open Source Management Solution\n# Addons modules by CLEARCORP S.A.\n# Copyright (C) 2009-TODAY CLEARCORP S.A. (<ht...
```python # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can re...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n#!/usr/bin/python\n\n# Copyright (c) 2017\n# Author: Ray Stojonic\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...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n#!/usr/bin/python\n\n# Copyright (c) 2017\n# Author: Ray Stojonic\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\"), t...
```python #!/usr/bin/python # Copyright (c) 2017 # Author: Ray Stojonic # # 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 us...
[ { "content": "```python\n#!/usr/bin/env python\n# pylint: disable=missing-docstring\n# flake8: noqa: T001\n# ___ ___ _ _ ___ ___ _ _____ ___ ___\n# / __| __| \\| | __| _ \\ /_\\_ _| __| \\\n# | (_ | _|| .` | _|| / / _ \\| | | _|| |) |\n# \\___|___|_|\\_|___|_|_\\/_/_\\_\\_|_|___|___/_ ___...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n# pylint: disable=missing-docstring\n# flake8: noqa: T001\n# ___ ___ _ _ ___ ___ _ _____ ___ ___\n# / __| __| \\| | __| _ \\ /_\\_ _| __| \\\n# | (_ | _|| .` | _|| / / _ \\| | | _|| |) |\n# \\___|___|_|\\_|___|_|_\\/_/_\\_\\_...
```python #!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| |...
[ { "content": "Repeat the full code snippet:\n```python\nfrom enum import Enum\n\nimport jouvence.document\n\n\nclass ElementType(Enum):\n\n ACTION = jouvence.document.TYPE_ACTION\n CENTERED_ACTION = jouvence.document.TYPE_CENTEREDACTION\n CHARACTER = jouvence.document.TYPE_CHARACTER\n DIALOG = jouve...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\nfrom enum import Enum\n\nimport jouvence.document\n\n\nclass ElementType(Enum):\n\n ACTION = jouvence.document.TYPE_ACTION\n CENTERED_ACTION = jouvence.document.TYPE_CENTEREDACTION\n CHARACTER = jouvence.document.TYPE_CHARACTER\n ...
```python from enum import Enum import jouvence.document class ElementType(Enum): ACTION = jouvence.document.TYPE_ACTION CENTERED_ACTION = jouvence.document.TYPE_CENTEREDACTION CHARACTER = jouvence.document.TYPE_CHARACTER DIALOG = jouvence.document.TYPE_DIALOG PARENTHETICAL = jouvence.document.T...
[ { "content": "```python\nfrom numpy import *\nfrom scipy.integrate import quadrature, romberg, fixed_quad\nfrom scipy.special import gammaln, betaln, digamma, polygamma, betainc, gamma\nimport pdb\nfrom hypergeom import hyper3F2regularizedZ1, hyper3F2Z1, hyper3F2aZ1\n\n\ndef dirichlet_integrate(alpha):\n nor...
[ { "content": "<|memory_start|>```python\nfrom numpy import *\nfrom scipy.integrate import quadrature, romberg, fixed_quad\nfrom scipy.special import gammaln, betaln, digamma, polygamma, betainc, gamma\nimport pdb\nfrom hypergeom import hyper3F2regularizedZ1, hyper3F2Z1, hyper3F2aZ1\n\n\ndef dirichlet_integrate(...
```python from numpy import * from scipy.integrate import quadrature, romberg, fixed_quad from scipy.special import gammaln, betaln, digamma, polygamma, betainc, gamma import pdb from hypergeom import hyper3F2regularizedZ1, hyper3F2Z1, hyper3F2aZ1 def dirichlet_integrate(alpha): normalizer = exp(sum(gammaln(alpha...
[ { "content": "Recreate the entire code block with identical formatting:\n```python\n# Copyright (c) 2010-2014, GEM Foundation.\n#\n# NRML is free software: you can redistribute it and/or modify it\n# under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either...
[ { "content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n# Copyright (c) 2010-2014, GEM Foundation.\n#\n# NRML is free software: you can redistribute it and/or modify it\n# under the terms of the GNU Affero General Public License as published\n# by the Free Software Fo...
```python # Copyright (c) 2010-2014, GEM Foundation. # # NRML is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # NRML is distri...
[ { "content": "Here is a code file:\n```python\nimport numbers\nimport struct\nfrom glob import glob\nfrom os import path\ntry:\n from secrets import SystemRandom\n random = SystemRandom()\nexcept ImportError:\n try:\n from random import SystemRandom\n random = SystemRandom()\n except I...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nimport numbers\nimport struct\nfrom glob import glob\nfrom os import path\ntry:\n from secrets import SystemRandom\n random = SystemRandom()\nexcept ImportError:\n try:\n from random import SystemRandom\n random = SystemRandom...
```python import numbers import struct from glob import glob from os import path try: from secrets import SystemRandom random = SystemRandom() except ImportError: try: from random import SystemRandom random = SystemRandom() except ImportError: import random from bitcoin import el...
[ { "content": "Here is a code file:\n```python\n'''\nScript that creates a randomized list of station/night pairs.\n\nGiven a list of station names and a list of night dates, this script\nwrites a semi-randomized list of the elements of the cartesian product\nof the two lists to a CSV file. The station names cyc...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n'''\nScript that creates a randomized list of station/night pairs.\n\nGiven a list of station names and a list of night dates, this script\nwrites a semi-randomized list of the elements of the cartesian product\nof the two lists to a CSV file. The s...
```python ''' Script that creates a randomized list of station/night pairs. Given a list of station names and a list of night dates, this script writes a semi-randomized list of the elements of the cartesian product of the two lists to a CSV file. The station names cycle through an alphabetized version of the input st...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\nfrom twisted.plugin import IPlugin\nfrom twisted.words.protocols import irc\nfrom txircd.module_interface import Command, ICommand, IModuleData, ModuleData\nfrom zope.interface import implements\n\nclass UserhostCommand(Mo...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\nfrom twisted.plugin import IPlugin\nfrom twisted.words.protocols import irc\nfrom txircd.module_interface import Command, ICommand, IModuleData, ModuleData\nfrom zope.interface import implements\n\nclass Us...
```python from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from zope.interface import implements class UserhostCommand(ModuleData, Command): implements(IPlugin, IModuleData, ICommand) name = "UserhostCommand" ...
[ { "content": "```python\n# Generated by Django 2.1.11 on 2021-02-06 22:03\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (\"pokemon_v2\", \"0008_auto_20201123_2045\"),\n ]\n\n operations = [\n ...
[ { "content": "<|memory_start|>```python\n# Generated by Django 2.1.11 on 2021-02-06 22:03\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (\"pokemon_v2\", \"0008_auto_20201123_2045\"),\n ]\n\n operat...
```python # Generated by Django 2.1.11 on 2021-02-06 22:03 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("pokemon_v2", "0008_auto_20201123_2045"), ] operations = [ migrations.CreateModel( na...
[ { "content": "Here is a code snippet:\n```python\n#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport shutil\nimport re\nimport glob\nimport socket\nfrom subprocess import call, check_output\nfrom collections import OrderedDict\nfrom optparse import OptionParser\n\n# ...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport shutil\nimport re\nimport glob\nimport socket\nfrom subprocess import call, check_output\nfrom collections import OrderedDict\nfrom optparse import Op...
```python #!/usr/bin/env python from __future__ import print_function import os import sys import shutil import re import glob import socket from subprocess import call, check_output from collections import OrderedDict from optparse import OptionParser # Command line parsing parser = OptionParser() parser.add_option...
[ { "content": "```python\n# -*- coding: utf-8 -*-\n#\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 under...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\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...
```python # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version ...
[ { "content": "```python\nfrom django.contrib.auth.decorators import login_required\nfrom django.core.exceptions import PermissionDenied\nfrom django.shortcuts import render, get_object_or_404\nfrom django.utils.timezone import now\n\nfrom seuranta.models import Competition\n\n\n@login_required\ndef own_competit...
[ { "content": "<|memory_start|>```python\nfrom django.contrib.auth.decorators import login_required\nfrom django.core.exceptions import PermissionDenied\nfrom django.shortcuts import render, get_object_or_404\nfrom django.utils.timezone import now\n\nfrom seuranta.models import Competition\n\n\n@login_required\n...
```python from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.shortcuts import render, get_object_or_404 from django.utils.timezone import now from seuranta.models import Competition @login_required def own_competitions(request): user = reques...
[ { "content": "```python\n\"\"\"A setuptools based setup module.\n\nPoTrans\n\"\"\"\n\n# Always prefer setuptools over distutils\nfrom setuptools import setup, find_packages\n# To use a consistent encoding\nfrom codecs import open\nfrom os import path\n\nhere = path.abspath(path.dirname(__file__))\n\n# Get the l...
[ { "content": "<|memory_start|>```python\n\"\"\"A setuptools based setup module.\n\nPoTrans\n\"\"\"\n\n# Always prefer setuptools over distutils\nfrom setuptools import setup, find_packages\n# To use a consistent encoding\nfrom codecs import open\nfrom os import path\n\nhere = path.abspath(path.dirname(__file__)...
```python """A setuptools based setup module. PoTrans """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with ...
[ { "content": "Here is some code:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache...
[ { "content": "Here is some code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ht...
```python # -*- coding: utf-8 -*- # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
[ { "content": "```python\nfrom bitarray import bitarray\n\n\ndef MissingNumbers(array):\n bArray = bitarray(100)\n missingNums = []\n tempPair = []\n strList = []\n itr = iter(range(100))\n strRange = \"\"\n\n\n for num in array:\n bArray[num] = 1\n\n for i in itr:\n print(i...
[ { "content": "<|memory_start|>```python\nfrom bitarray import bitarray\n\n\ndef MissingNumbers(array):\n bArray = bitarray(100)\n missingNums = []\n tempPair = []\n strList = []\n itr = iter(range(100))\n strRange = \"\"\n\n\n for num in array:\n bArray[num] = 1\n\n for i in itr:\...
```python from bitarray import bitarray def MissingNumbers(array): bArray = bitarray(100) missingNums = [] tempPair = [] strList = [] itr = iter(range(100)) strRange = "" for num in array: bArray[num] = 1 for i in itr: print(i) if bArray[i] == 0: ...
[ { "content": "```python\nimport pandas as pd\nfrom faker import Faker\nfrom uuid import uuid4\nimport logging\nimport numpy as np\nfrom datetime import datetime\n\n\nclass DataSet:\n def __init__(self, length, **kwargs):\n self.data = self.create(length, **kwargs)\n\n def get_data(self):\n r...
[ { "content": "<|memory_start|>```python\nimport pandas as pd\nfrom faker import Faker\nfrom uuid import uuid4\nimport logging\nimport numpy as np\nfrom datetime import datetime\n\n\nclass DataSet:\n def __init__(self, length, **kwargs):\n self.data = self.create(length, **kwargs)\n\n def get_data(s...
```python import pandas as pd from faker import Faker from uuid import uuid4 import logging import numpy as np from datetime import datetime class DataSet: def __init__(self, length, **kwargs): self.data = self.create(length, **kwargs) def get_data(self): return self.data def num_data(se...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\nfrom _pydevd_bundle.pydevd_constants import dict_contains\nimport sys\nfrom _pydevd_bundle import pydevd_xml\nfrom os.path import basename\nimport traceback\ntry:\n from urllib import quote, quote_plus, unquote, unquote_plus\...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\nfrom _pydevd_bundle.pydevd_constants import dict_contains\nimport sys\nfrom _pydevd_bundle import pydevd_xml\nfrom os.path import basename\nimport traceback\ntry:\n from urllib import quote, quote_plus, unquot...
```python from _pydevd_bundle.pydevd_constants import dict_contains import sys from _pydevd_bundle import pydevd_xml from os.path import basename import traceback try: from urllib import quote, quote_plus, unquote, unquote_plus except: from urllib.parse import quote, quote_plus, unquote, unquote_plus #@Reimpor...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n#Constraining Order - a simple constraint satisfaction library\n#\n#Copyright (c) 2015 Johannes Reinhardt <jreinhardt@ist-dein-freund.de>\n#\n#Permission is hereby granted, free of charge, to any person obtaining a copy\n#...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n#Constraining Order - a simple constraint satisfaction library\n#\n#Copyright (c) 2015 Johannes Reinhardt <jreinhardt@ist-dein-freund.de>\n#\n#Permission is hereby granted, free of charge, to any person obt...
```python #Constraining Order - a simple constraint satisfaction library # #Copyright (c) 2015 Johannes Reinhardt <jreinhardt@ist-dein-freund.de> # #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 Softwar...
[ { "content": "Here is the code block:\n```python\nfrom __future__ import division, absolute_import, print_function\n\nimport copy\nimport pickle\nimport sys\nimport platform\nimport gc\nimport copy\nimport warnings\nimport tempfile\nfrom os import path\nfrom io import BytesIO\n\nimport numpy as np\nfrom numpy.t...
[ { "content": "Here is the code block:\n<|memory_start|>```python\nfrom __future__ import division, absolute_import, print_function\n\nimport copy\nimport pickle\nimport sys\nimport platform\nimport gc\nimport copy\nimport warnings\nimport tempfile\nfrom os import path\nfrom io import BytesIO\n\nimport numpy as ...
```python from __future__ import division, absolute_import, print_function import copy import pickle import sys import platform import gc import copy import warnings import tempfile from os import path from io import BytesIO import numpy as np from numpy.testing import ( run_module_suite, TestCase, assert_, a...
[ { "content": "```python\n##\n# Copyright 2012-2013 Ghent University\n#\n# This file is part of EasyBuild,\n# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),\n# with support of Ghent University (http://ugent.be/hpc),\n# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be...
[ { "content": "<|memory_start|>```python\n##\n# Copyright 2012-2013 Ghent University\n#\n# This file is part of EasyBuild,\n# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),\n# with support of Ghent University (http://ugent.be/hpc),\n# the Flemish Supercomputer Centre (VSC) (http...
```python ## # Copyright 2012-2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules found...
[ { "content": "Here is a code file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2013 S. Daniel Francis <francis@sugarlabs.org>\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# t...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2013 S. Daniel Francis <francis@sugarlabs.org>\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as p...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 S. Daniel Francis <francis@sugarlabs.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the...
[ { "content": "Here is the script:\n```python\n#!/bin/env python3.1\n# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005, 2010\n# \n\nclass BinarySearchTree:\n '''\n Author: Brad Miller\n Date: 1/15/2005\n Description: Imlement a binary...
[ { "content": "Here is the script:\n<|memory_start|>```python\n#!/bin/env python3.1\n# Bradley N. Miller, David L. Ranum\n# Introduction to Data Structures and Algorithms in Python\n# Copyright 2005, 2010\n# \n\nclass BinarySearchTree:\n '''\n Author: Brad Miller\n Date: 1/15/2005\n Description: I...
```python #!/bin/env python3.1 # Bradley N. Miller, David L. Ranum # Introduction to Data Structures and Algorithms in Python # Copyright 2005, 2010 # class BinarySearchTree: ''' Author: Brad Miller Date: 1/15/2005 Description: Imlement a binary search tree with the following interface ...
[ { "content": "Here is a code snippet:\n```python\n# -*- coding: utf-8 -*-\n'''\nThe function in `vdirsyncer.sync` can be called on two instances of `Storage`\nto synchronize them. Due to the abstract API storage classes are implementing,\nthe two given instances don't have to be of the same exact type. This all...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n'''\nThe function in `vdirsyncer.sync` can be called on two instances of `Storage`\nto synchronize them. Due to the abstract API storage classes are implementing,\nthe two given instances don't have to be of the same exac...
```python # -*- coding: utf-8 -*- ''' The function in `vdirsyncer.sync` can be called on two instances of `Storage` to synchronize them. Due to the abstract API storage classes are implementing, the two given instances don't have to be of the same exact type. This allows us not only to synchronize a local vdir with a C...
[ { "content": "```python\nimport math, sys\nfrom SPARQLWrapper import SPARQLWrapper, JSON\nfrom queries.keywordSectionCount import keywordSectionCount\nfrom queries.createKeywordSectionQuery import createKeywordSectionQuery\n\n# get the year to query from the user\nyear = input(\"Enter year to query: \")\nyear =...
[ { "content": "<|memory_start|>```python\nimport math, sys\nfrom SPARQLWrapper import SPARQLWrapper, JSON\nfrom queries.keywordSectionCount import keywordSectionCount\nfrom queries.createKeywordSectionQuery import createKeywordSectionQuery\n\n# get the year to query from the user\nyear = input(\"Enter year to qu...
```python import math, sys from SPARQLWrapper import SPARQLWrapper, JSON from queries.keywordSectionCount import keywordSectionCount from queries.createKeywordSectionQuery import createKeywordSectionQuery # get the year to query from the user year = input("Enter year to query: ") year = str(year) # there are too many...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.11.6 on 2017-10-25 01:44\nfrom __future__ import unicode_literals\n\nfrom decimal import Decimal\nfrom django.conf import settings\nfrom django.db import migrations, models\nimport djang...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Generated by Django 1.11.6 on 2017-10-25 01:44\nfrom __future__ import unicode_literals\n\nfrom decimal import Decimal\nfrom django.conf import settings\nfrom django.db import migrations, mode...
```python # -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-10-25 01:44 from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.db import migrations, models import django.db.models.deletion import djmoney.models.fields class Migration(migrations.Mig...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n# -*- coding: utf-8 -*-\n'''\nLocal settings\n\n- Run in Debug mode\n- Use console backend for emails\n- Add Django Debug Toolbar\n- Add django-extensions as app\n'''\n\nfrom .common import * # noqa\n\n# DEBUG\n...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n'''\nLocal settings\n\n- Run in Debug mode\n- Use console backend for emails\n- Add Django Debug Toolbar\n- Add django-extensions as app\n'''\n\nfrom .common import * # n...
```python # -*- coding: utf-8 -*- ''' Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app ''' from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG...
[ { "content": "Repeat the following code:\n```python\n############################################################################\n# NHL GAMECENTER\n# XBMC ADD-ON\n############################################################################\nimport xbmcgui\nfrom resources.lib.userinterface import *\nfrom resour...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\n############################################################################\n# NHL GAMECENTER\n# XBMC ADD-ON\n############################################################################\nimport xbmcgui\nfrom resources.lib.userinterface impor...
```python ############################################################################ # NHL GAMECENTER # XBMC ADD-ON ############################################################################ import xbmcgui from resources.lib.userinterface import * from resources.lib.scoring_updates import * params = get_params() ...
[ { "content": "Repeat the following code:\n```python\nfrom ems.qt import QtWidgets, QtCore, QtGui\nfrom ems.qt.richtext.char_format_proxy import CharFormatProxy\n\nQt = QtCore.Qt\nQObject = QtCore.QObject\nQColor = QtGui.QColor\nQAction = QtWidgets.QAction\nQKeySequence = QtGui.QKeySequence\nQFont = QtGui.QFont\...
[ { "content": "Repeat the following code:\n<|memory_start|>```python\nfrom ems.qt import QtWidgets, QtCore, QtGui\nfrom ems.qt.richtext.char_format_proxy import CharFormatProxy\n\nQt = QtCore.Qt\nQObject = QtCore.QObject\nQColor = QtGui.QColor\nQAction = QtWidgets.QAction\nQKeySequence = QtGui.QKeySequence\nQFon...
```python from ems.qt import QtWidgets, QtCore, QtGui from ems.qt.richtext.char_format_proxy import CharFormatProxy Qt = QtCore.Qt QObject = QtCore.QObject QColor = QtGui.QColor QAction = QtWidgets.QAction QKeySequence = QtGui.QKeySequence QFont = QtGui.QFont QIcon = QtGui.QIcon QPixmap = QtGui.QPixmap ThemeIcon = QIc...
[ { "content": "```python\n# Secure Trading Python API\n# Authors: Secure Trading Ltd\n# Configuration variables\n\nfrom __future__ import unicode_literals\nfrom .requestobject import Request\nfrom .requestobject import Requests\nfrom .responseobject import Response\nfrom .exceptions import SecureTradingError\nfr...
[ { "content": "<|memory_start|>```python\n# Secure Trading Python API\n# Authors: Secure Trading Ltd\n# Configuration variables\n\nfrom __future__ import unicode_literals\nfrom .requestobject import Request\nfrom .requestobject import Requests\nfrom .responseobject import Response\nfrom .exceptions import Secure...
```python # Secure Trading Python API # Authors: Secure Trading Ltd # Configuration variables from __future__ import unicode_literals from .requestobject import Request from .requestobject import Requests from .responseobject import Response from .exceptions import SecureTradingError from .exceptions import ApiError f...
[ { "content": "Produce an exact reconstruction of the code:\n```python\nimport unittest\nfrom nqueens.chessboard import Chessboard\nfrom nqueens.solver import Solver\n\n\nclass TestSolver(unittest.TestCase):\n\n def setUp(self):\n self.standardBoard = Chessboard.create(8)\n\n def testSimpleSolution(...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\nimport unittest\nfrom nqueens.chessboard import Chessboard\nfrom nqueens.solver import Solver\n\n\nclass TestSolver(unittest.TestCase):\n\n def setUp(self):\n self.standardBoard = Chessboard.create(8)\n\n def tes...
```python import unittest from nqueens.chessboard import Chessboard from nqueens.solver import Solver class TestSolver(unittest.TestCase): def setUp(self): self.standardBoard = Chessboard.create(8) def testSimpleSolution(self): board = Chessboard.create(1) solver = Solver.create(boar...
[ { "content": "Replicate the source code:\n```python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2015, Mayo Clinic\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification,\n# are permitted provided that the following conditions are met:\n#\n# Redistributions of...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Copyright (c) 2015, Mayo Clinic\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification,\n# are permitted provided that the following conditions are met:\n#\n# Re...
```python # -*- coding: utf-8 -*- # Copyright (c) 2015, Mayo Clinic # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this ...
[ { "content": "Here is the code content:\n```python\n##############################################################################\n#\n# OSIS stands for Open Student Information System. It's an application\n# designed to manage the core business of higher education institutions,\n# such as universities...
[ { "content": "Here is the code content:\n<|memory_start|>```python\n##############################################################################\n#\n# OSIS stands for Open Student Information System. It's an application\n# designed to manage the core business of higher education institutions,\n# such...
```python ############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # ...
[ { "content": "Here is a code file:\n```python\nfrom os import path\n\nfrom enigma import iPlayableService, iServiceInformation, eTimer, eServiceCenter, eServiceReference, eDVBDB\n\nfrom Screens.Screen import Screen\nfrom Screens.ChannelSelection import FLAG_IS_DEDICATED_3D\nfrom Components.About import about\nf...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nfrom os import path\n\nfrom enigma import iPlayableService, iServiceInformation, eTimer, eServiceCenter, eServiceReference, eDVBDB\n\nfrom Screens.Screen import Screen\nfrom Screens.ChannelSelection import FLAG_IS_DEDICATED_3D\nfrom Components.About...
```python from os import path from enigma import iPlayableService, iServiceInformation, eTimer, eServiceCenter, eServiceReference, eDVBDB from Screens.Screen import Screen from Screens.ChannelSelection import FLAG_IS_DEDICATED_3D from Components.About import about from Components.SystemInfo import SystemInfo from Com...
[ { "content": "Repeat the code exactly:\n```python\n'''Simple classifier model\n\n'''\n\nfrom cortex.main import run\nfrom cortex.plugins import ModelPlugin\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom cortex.built_ins.models.utils import update_encoder_args\n\n\nclass MyClassi...
[ { "content": "Repeat the code exactly:\n<|memory_start|>```python\n'''Simple classifier model\n\n'''\n\nfrom cortex.main import run\nfrom cortex.plugins import ModelPlugin\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom cortex.built_ins.models.utils import update_encoder_args\n\n...
```python '''Simple classifier model ''' from cortex.main import run from cortex.plugins import ModelPlugin import torch import torch.nn as nn import torch.nn.functional as F from cortex.built_ins.models.utils import update_encoder_args class MyClassifier(ModelPlugin): '''Basic image classifier. Classifi...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n```python\nimport re\n\nfrom streamlink.plugin import Plugin, pluginmatcher\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream import HLSStream\nfrom streamlink.utils import parse_json\n\n\n@pluginmatcher(re.comp...
[ { "content": "Write out the code verbatim, preserving indentation and whitespace:\n<|memory_start|>```python\nimport re\n\nfrom streamlink.plugin import Plugin, pluginmatcher\nfrom streamlink.plugin.api import validate\nfrom streamlink.stream import HLSStream\nfrom streamlink.utils import parse_json\n\n\n@plugi...
```python import re from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream import HLSStream from streamlink.utils import parse_json @pluginmatcher(re.compile( r"https?://www\.cbsnews\.com/live/" )) class CBSNews(Plugin): _re_default_payload = re....
[ { "content": "Produce an exact reconstruction of the code:\n```python\n# Copyright (c) 2012 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.\n\n\nimport logging\nimport multiprocessing\n\nfrom pylib import android_...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n# Copyright (c) 2012 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.\n\n\nimport logging\nimport multiprocessing\n\nfrom pylib...
```python # Copyright (c) 2012 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 logging import multiprocessing from pylib import android_commands from pylib.base.test_result import TestResults from pylib.forwarder ...
[ { "content": "```python\n#\n# \n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE F...
[ { "content": "<|memory_start|>```python\n#\n# \n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOL...
```python # # # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ...
[ { "content": "Produce an exact reconstruction of the code:\n```python\n# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license i...
[ { "content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root ...
```python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. ...
[ { "content": "Provide an exact copy of the source code:\n```python\n''' tools for working with .sas7bdat files '''\r\n\r\nimport os\r\nfrom collections import OrderedDict\r\n\r\nimport pandas as pd\r\nfrom sas7bdat import SAS7BDAT\r\n\r\nfrom .knowledge.questionnaires import map_ph4, map_ph4_ssaga\r\n\r\nmap_su...
[ { "content": "Provide an exact copy of the source code:\n<|memory_start|>```python\n''' tools for working with .sas7bdat files '''\r\n\r\nimport os\r\nfrom collections import OrderedDict\r\n\r\nimport pandas as pd\r\nfrom sas7bdat import SAS7BDAT\r\n\r\nfrom .knowledge.questionnaires import map_ph4, map_ph4_ssa...
```python ''' tools for working with .sas7bdat files ''' import os from collections import OrderedDict import pandas as pd from sas7bdat import SAS7BDAT from .knowledge.questionnaires import map_ph4, map_ph4_ssaga map_subject = {'core': {'file_pfixes': []}} parent_dir = '/processed_data/zork/zork-phase...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n\"\"\"\nStartup script for the pyTanks server\n\nRequirements:\n Python 3.5 or newer\n websockets 7.0 (pip install websockets==7.0)\n\nUsage:\n python start.py\n\n The pyTanks server uses the settings found in config.py to ...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n\"\"\"\nStartup script for the pyTanks server\n\nRequirements:\n Python 3.5 or newer\n websockets 7.0 (pip install websockets==7.0)\n\nUsage:\n python start.py\n\n The pyTanks server uses the settings found ...
```python """ Startup script for the pyTanks server Requirements: Python 3.5 or newer websockets 7.0 (pip install websockets==7.0) Usage: python start.py The pyTanks server uses the settings found in config.py to control how the server works. Those values can be changed directly or be overridden ...
[ { "content": "```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Author: Janice Cheng\n\n\"\"\"\n把诘个服务器端改成在一个类中\n\n\"\"\"\n\nimport pika\nimport subprocess\n\ncredentials = pika.PlainCredentials('janice', 'janice123')\nparameters = pika.ConnectionParameters('172.16.201.134', 5672, '/', credentials)\nc...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Author: Janice Cheng\n\n\"\"\"\n把诘个服务器端改成在一个类中\n\n\"\"\"\n\nimport pika\nimport subprocess\n\ncredentials = pika.PlainCredentials('janice', 'janice123')\nparameters = pika.ConnectionParameters('172.16.201.134', 5672, '/',...
```python #!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Janice Cheng """ 把诘个服务器端改成在一个类中 """ import pika import subprocess credentials = pika.PlainCredentials('janice', 'janice123') parameters = pika.ConnectionParameters('172.16.201.134', 5672, '/', credentials) connection = pika.BlockingConnection(paramet...
[ { "content": "```python\nimport unittest\nimport transaction\n\nfrom pyramid import testing\n\nfrom .models import DBSession\n\n\nclass TestMyViewSuccessCondition(unittest.TestCase):\n def setUp(self):\n self.config = testing.setUp()\n from sqlalchemy import create_engine\n engine = crea...
[ { "content": "<|memory_start|>```python\nimport unittest\nimport transaction\n\nfrom pyramid import testing\n\nfrom .models import DBSession\n\n\nclass TestMyViewSuccessCondition(unittest.TestCase):\n def setUp(self):\n self.config = testing.setUp()\n from sqlalchemy import create_engine\n ...
```python import unittest import transaction from pyramid import testing from .models import DBSession class TestMyViewSuccessCondition(unittest.TestCase): def setUp(self): self.config = testing.setUp() from sqlalchemy import create_engine engine = create_engine('sqlite://') from...
[ { "content": "Replicate the source code:\n```python\n#!/usr/bin/env python\n\nfrom gi.repository import Gtk, Gdk\n\nimport pairdefs\n\nclass Picker:\n '''RandomSK UI and related functions.'''\n def pick_rand(self, widget=None, data=None):\n '''Pick a random sequence from our current pairdict and se...
[ { "content": "Replicate the source code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom gi.repository import Gtk, Gdk\n\nimport pairdefs\n\nclass Picker:\n '''RandomSK UI and related functions.'''\n def pick_rand(self, widget=None, data=None):\n '''Pick a random sequence from our current...
```python #!/usr/bin/env python from gi.repository import Gtk, Gdk import pairdefs class Picker: '''RandomSK UI and related functions.''' def pick_rand(self, widget=None, data=None): '''Pick a random sequence from our current pairdict and set output text.''' self.disp.set_text(self.pairdict.p...
[ { "content": "```python\n# Copyright 2014-2017 Camptocamp SA\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\nfrom odoo.tests import common\n\n\nclass FixedFeesTester(common.TransactionCase):\n\n def setUp(self):\n \"\"\"Initialize credit control level mock to test fees computations\"...
[ { "content": "<|memory_start|>```python\n# Copyright 2014-2017 Camptocamp SA\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\nfrom odoo.tests import common\n\n\nclass FixedFeesTester(common.TransactionCase):\n\n def setUp(self):\n \"\"\"Initialize credit control level mock to test fee...
```python # Copyright 2014-2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.tests import common class FixedFeesTester(common.TransactionCase): def setUp(self): """Initialize credit control level mock to test fees computations""" super(FixedFeesTester, s...
[ { "content": "Here is the source code:\n```python\n\"\"\"k5lib public functions.\n\nk5lib is a collection of functions and utilities to communicate with Fujits K5 cloud REST API.\n\n\"\"\"\nfrom .authenticate import get_global_token\nfrom .authenticate import get_region_token\nfrom .authenticate import get_proj...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n\"\"\"k5lib public functions.\n\nk5lib is a collection of functions and utilities to communicate with Fujits K5 cloud REST API.\n\n\"\"\"\nfrom .authenticate import get_global_token\nfrom .authenticate import get_region_token\nfrom .authenticate...
```python """k5lib public functions. k5lib is a collection of functions and utilities to communicate with Fujits K5 cloud REST API. """ from .authenticate import get_global_token from .authenticate import get_region_token from .authenticate import get_project_token from .authenticate import get_domain_id from .authen...
[ { "content": "Return the code exactly, with no changes:\n```python\n#!/usr/bin/env python\n# *********************************************************************\n# * Copyright (C) 2014 Luca Baldini (luca.baldini@pi.infn.it) *\n# * *\n# ...
[ { "content": "Return the code exactly, with no changes:\n<|memory_start|>```python\n#!/usr/bin/env python\n# *********************************************************************\n# * Copyright (C) 2014 Luca Baldini (luca.baldini@pi.infn.it) *\n# * ...
```python #!/usr/bin/env python # ********************************************************************* # * Copyright (C) 2014 Luca Baldini (luca.baldini@pi.infn.it) * # * * # * For the license terms see the file LICENSE, distributed * ...
[ { "content": "```python\n# Copyright (c) 2015 VMware, Inc.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/l...
[ { "content": "<|memory_start|>```python\n# Copyright (c) 2015 VMware, Inc.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://...
```python # Copyright (c) 2015 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
[ { "content": "Here is the source code:\n```python\n# -*- coding: utf-8 -*-\n#\n# Inqbus.installer documentation build configuration file, created by\n# sphinx-quickstart on Tue Feb 4 10:28:33 2014.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all poss...
[ { "content": "Here is the source code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# Inqbus.installer documentation build configuration file, created by\n# sphinx-quickstart on Tue Feb 4 10:28:33 2014.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note t...
```python # -*- coding: utf-8 -*- # # Inqbus.installer documentation build configuration file, created by # sphinx-quickstart on Tue Feb 4 10:28:33 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogene...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n##############################################################################\n#\n# OSIS stands for Open Student Information System. It's an application\n# designed to manage the core business of higher ed...
[ { "content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n##############################################################################\n#\n# OSIS stands for Open Student Information System. It's an application\n# designed to manage the core busin...
```python ############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # ...
[ { "content": "```python\nfrom .core import ( # noqa\n AssetID,\n AssetIDPlusDay,\n EPOCH,\n ExplodingObject,\n FakeDataPortal,\n FetcherDataPortal,\n MockDailyBarReader,\n OpenPrice,\n add_security_data,\n all_pairs_matching_predicate,\n all_subindices,\n assert_single_posit...
[ { "content": "<|memory_start|>```python\nfrom .core import ( # noqa\n AssetID,\n AssetIDPlusDay,\n EPOCH,\n ExplodingObject,\n FakeDataPortal,\n FetcherDataPortal,\n MockDailyBarReader,\n OpenPrice,\n add_security_data,\n all_pairs_matching_predicate,\n all_subindices,\n ass...
```python from .core import ( # noqa AssetID, AssetIDPlusDay, EPOCH, ExplodingObject, FakeDataPortal, FetcherDataPortal, MockDailyBarReader, OpenPrice, add_security_data, all_pairs_matching_predicate, all_subindices, assert_single_position, assert_timestamp_equal, ...
[ { "content": "Here is a code file:\n```python\n#!/usr/bin/env python\n\n'''\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements. See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership. The ASF licenses this file...
[ { "content": "Here is a code file:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n'''\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements. See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership. The ASF li...
```python #!/usr/bin/env 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 ...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n##################################################\n# GNU Radio Python Flow Graph\n# Title: Amrx\n# Generated: Tue Aug 8 20:51:18 2017\n####################################...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n##################################################\n# GNU Radio Python Flow Graph\n# Title: Amrx\n# Generated: Tue Aug 8 20:51:18 2017\n####################...
```python #!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Amrx # Generated: Tue Aug 8 20:51:18 2017 ################################################## from gnuradio import analog from gnuradio import blocks from gnuradio import e...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n```python\n# ex:ts=4:sw=4:sts=4:et\n# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-\n\nr\"\"\"\nThe base class for QuickRelease steps, along with error reporting classes, \ncustom subclasses of steps, and classes to run th...
[ { "content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n# ex:ts=4:sw=4:sts=4:et\n# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-\n\nr\"\"\"\nThe base class for QuickRelease steps, along with error reporting classes, \ncustom subclasses of steps, and c...
```python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- r""" The base class for QuickRelease steps, along with error reporting classes, custom subclasses of steps, and classes to run the individual parts of the steps. L{Step}s are usually searched for in the C{quickrelease...
[ { "content": "```python\n'''\n2DPCA for feature extraction of MNIST digits dataset \nAuthor : Akhil P M\n'''\n\n\nfrom settings import *\nfrom sklearn.ensemble import RandomForestClassifier\nimport utils\n\n\ndef compute_covariance_matrix(A):\n\t\"\"\" compute the 2D covariance matrix in image space\"\"\"\n\n\t...
[ { "content": "<|memory_start|>```python\n'''\n2DPCA for feature extraction of MNIST digits dataset \nAuthor : Akhil P M\n'''\n\n\nfrom settings import *\nfrom sklearn.ensemble import RandomForestClassifier\nimport utils\n\n\ndef compute_covariance_matrix(A):\n\t\"\"\" compute the 2D covariance matrix in image s...
```python ''' 2DPCA for feature extraction of MNIST digits dataset Author : Akhil P M ''' from settings import * from sklearn.ensemble import RandomForestClassifier import utils def compute_covariance_matrix(A): """ compute the 2D covariance matrix in image space""" no_of_images = len(A) cov = np.zeros((A.shap...
[ { "content": "```python\n#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\"\"\"\nThis module provide configure file management service in i18n environment.\n\"\"\"\nimport os\nimport logging\nimport logging.handlers\n\n\n_LOG_FORMAT = \"%(levelname)s: %(asctime)s: %(filename)s:%(lineno)d * %(thread)d %(message)s\...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\"\"\"\nThis module provide configure file management service in i18n environment.\n\"\"\"\nimport os\nimport logging\nimport logging.handlers\n\n\n_LOG_FORMAT = \"%(levelname)s: %(asctime)s: %(filename)s:%(lineno)d * %(threa...
```python #!/usr/bin/env python #-*- coding:utf-8 -*- """ This module provide configure file management service in i18n environment. """ import os import logging import logging.handlers _LOG_FORMAT = "%(levelname)s: %(asctime)s: %(filename)s:%(lineno)d * %(thread)d %(message)s" _LOG_DATEFMT = "%m-%d %H:%M:%S" def i...
[ { "content": "Here is the code content:\n```python\nfrom setuptools import setup\n\nsetup(\n name='pureples',\n version='0.0',\n author='adrian, simon',\n author_email='mail@adrianwesth.dk',\n maintainer='simon, adrian',\n maintainer_email='mail@adrianwesth.dk',\n url='https://github.com/uk...
[ { "content": "Here is the code content:\n<|memory_start|>```python\nfrom setuptools import setup\n\nsetup(\n name='pureples',\n version='0.0',\n author='adrian, simon',\n author_email='mail@adrianwesth.dk',\n maintainer='simon, adrian',\n maintainer_email='mail@adrianwesth.dk',\n url='https...
```python from setuptools import setup setup( name='pureples', version='0.0', author='adrian, simon', author_email='mail@adrianwesth.dk', maintainer='simon, adrian', maintainer_email='mail@adrianwesth.dk', url='https://github.com/ukuleleplayer/pureples', license="MIT", description='...
[ { "content": "Output the full code verbatim (no extra comments):\n```python\n# Copyright (C) 2011 by David Tomaschik <david@systemoverlord.com>\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...
[ { "content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# Copyright (C) 2011 by David Tomaschik <david@systemoverlord.com>\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Softwa...
```python # Copyright (C) 2011 by David Tomaschik <david@systemoverlord.com> # # 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 # ...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\nfrom django.conf.urls import url\n\nfrom rest_framework import routers, viewsets\n\nfrom rest_framework_nested import routers as nested_routers\n\n\nclass HybridRoutingMixin(object):\n \"\"\"\n Extends functionality ...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\nfrom django.conf.urls import url\n\nfrom rest_framework import routers, viewsets\n\nfrom rest_framework_nested import routers as nested_routers\n\n\nclass HybridRoutingMixin(object):\n \"\"\"\n Extend...
```python from django.conf.urls import url from rest_framework import routers, viewsets from rest_framework_nested import routers as nested_routers class HybridRoutingMixin(object): """ Extends functionality of DefaultRouter adding possibility to register simple API views, not just Viewsets. Based o...
[ { "content": "Here is a code snippet:\n```python\n# encoding: utf-8\n\nimport torch\nimport torch.autograd as autograd\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nclass Softmax(nn.Module):\n\n def __init__(self, num_labels, feature_dim):\n super(Softmax, sel...
[ { "content": "Here is a code snippet:\n<|memory_start|>```python\n# encoding: utf-8\n\nimport torch\nimport torch.autograd as autograd\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nclass Softmax(nn.Module):\n\n def __init__(self, num_labels, feature_dim):\n su...
```python # encoding: utf-8 import torch import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F import torch.optim as optim class Softmax(nn.Module): def __init__(self, num_labels, feature_dim): super(Softmax, self).__init__() self.linear = nn.Linear(feature_dim, ...
[ { "content": "Provide a verbatim copy of the code:\n```python\n# TODO: add Group and/or Selection\n\nclass Region(object):\n \"\"\" Base class for a spatial Region container\n\n A Region can contain simple and advanced geometry.\n\n A Region can be thought of as a 3D analogy to a sheet of\n paper in...
[ { "content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\n# TODO: add Group and/or Selection\n\nclass Region(object):\n \"\"\" Base class for a spatial Region container\n\n A Region can contain simple and advanced geometry.\n\n A Region can be thought of as a 3D analogy to a sheet ...
```python # TODO: add Group and/or Selection class Region(object): """ Base class for a spatial Region container A Region can contain simple and advanced geometry. A Region can be thought of as a 3D analogy to a sheet of paper in 2D. A Region defines its own coordinate system, dimension and resol...
[ { "content": "Repeat the code precisely as written (spacing intact):\n```python\n__author__ = 'yinjun'\n\n# Definition for singly-linked list.\n# class ListNode:\n# def __init__(self, x):\n# self.val = x\n# self.next = None\n\nclass Solution:\n # @param l1: the first list\n # @param l2...
[ { "content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n__author__ = 'yinjun'\n\n# Definition for singly-linked list.\n# class ListNode:\n# def __init__(self, x):\n# self.val = x\n# self.next = None\n\nclass Solution:\n # @param l1: the first list\...
```python __author__ = 'yinjun' # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @param l1: the first list # @param l2: the second list # @return: the sum list of l1 and l2 def addLists(self, l1, l2)...
[ { "content": "```python\n# Copyright 2021 The Brax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req...
[ { "content": "<|memory_start|>```python\n# Copyright 2021 The Brax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\...
```python # Copyright 2021 The Brax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
[ { "content": "```python\nimport django.core.handlers.wsgi\nimport logging\nfrom django.template import loader,Context,RequestContext\nfrom django.http import HttpResponse, HttpResponseRedirect\nfrom django.shortcuts import render_to_response\nfrom ebaysdk import finding\nfrom ebaysdk.exception import Connection...
[ { "content": "<|memory_start|>```python\nimport django.core.handlers.wsgi\nimport logging\nfrom django.template import loader,Context,RequestContext\nfrom django.http import HttpResponse, HttpResponseRedirect\nfrom django.shortcuts import render_to_response\nfrom ebaysdk import finding\nfrom ebaysdk.exception i...
```python import django.core.handlers.wsgi import logging from django.template import loader,Context,RequestContext from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from ebaysdk import finding from ebaysdk.exception import ConnectionError from ebayapi.api import...
[ { "content": "```python\nimport subprocess\nclass CmdRunException(Exception):\n pass\n\nclass Util(object):\n verbose = False\n @classmethod\n def cmdOutput(cls, cmd, havepassword = False):\n if cls.verbose and not havepassword:\n print(cmd)\n proc = subprocess.Popen(cmd, sh...
[ { "content": "<|memory_start|>```python\nimport subprocess\nclass CmdRunException(Exception):\n pass\n\nclass Util(object):\n verbose = False\n @classmethod\n def cmdOutput(cls, cmd, havepassword = False):\n if cls.verbose and not havepassword:\n print(cmd)\n proc = subproce...
```python import subprocess class CmdRunException(Exception): pass class Util(object): verbose = False @classmethod def cmdOutput(cls, cmd, havepassword = False): if cls.verbose and not havepassword: print(cmd) proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,...
[ { "content": "Return the code unaltered:\n```python\n# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ht...
[ { "content": "Return the code unaltered:\n<|memory_start|>```python\n# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licen...
```python # Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
[ { "content": "Here is the snippet:\n```python\n# coding: utf-8\n# Copyright (C) 2016 Bruno Abude Cardoso\n#\n# Imagem Cinemática 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 th...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\n# coding: utf-8\n# Copyright (C) 2016 Bruno Abude Cardoso\n#\n# Imagem Cinemática is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either...
```python # coding: utf-8 # Copyright (C) 2016 Bruno Abude Cardoso # # Imagem Cinemática is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n```python\nimport os\nimport time\nimport errno\n\n\nclass LockFileError(RuntimeError):\n pass\n\n\nclass LockFile(object):\n \"\"\"\n Lock file (Unix-only), implemented via symlinks.\n \"\"\"\n\n def __init__(self, filename, tim...
[ { "content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\nimport os\nimport time\nimport errno\n\n\nclass LockFileError(RuntimeError):\n pass\n\n\nclass LockFile(object):\n \"\"\"\n Lock file (Unix-only), implemented via symlinks.\n \"\"\"\n\n def __init__(sel...
```python import os import time import errno class LockFileError(RuntimeError): pass class LockFile(object): """ Lock file (Unix-only), implemented via symlinks. """ def __init__(self, filename, timeout=0.05, fail_if_active=False): self.filename = filename self.timeout = timeout...
[ { "content": "Here is the code block:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2009 Rene Liebscher\n#\n# This program is free software; you can redistribute it and/or modify it under\n# the terms of the GNU Lesser General Public License as published by the Free \n# Software Foundation; either ve...
[ { "content": "Here is the code block:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2009 Rene Liebscher\n#\n# This program is free software; you can redistribute it and/or modify it under\n# the terms of the GNU Lesser General Public License as published by the Free \n# Software Found...
```python # -*- coding: utf-8 -*- # # Copyright (C) 2009 Rene Liebscher # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 3 of the License, or (at your option) any # late...
[ { "content": "```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport django\nfrom django.contrib.admin.sites import AdminSite\nfrom django.utils.functional import SimpleLazyObject\n\nfrom djadmin import settings\nfrom .models import DjadminModelSetting\nfrom .signals import get_re...
[ { "content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport django\nfrom django.contrib.admin.sites import AdminSite\nfrom django.utils.functional import SimpleLazyObject\n\nfrom djadmin import settings\nfrom .models import DjadminModelSetting\nfrom .signa...
```python # -*- coding: utf-8 -*- from __future__ import unicode_literals import django from django.contrib.admin.sites import AdminSite from django.utils.functional import SimpleLazyObject from djadmin import settings from .models import DjadminModelSetting from .signals import get_register_model_with_mixin, handle_...
[ { "content": "Here is a code file:\n```python\nimport pickle\n\nPA = 'A6'\n\ndef load(partId, caseId=1):\n\t\"\"\"\n\tThis function returns the example test-cases for a specific part of an assignment.\n\tInput:\n\t\tpartId (int) = part number of the assignment (1 for A*Part1, 2 for A*Part2 and so on)\n\t\tcaseI...
[ { "content": "Here is a code file:\n<|memory_start|>```python\nimport pickle\n\nPA = 'A6'\n\ndef load(partId, caseId=1):\n\t\"\"\"\n\tThis function returns the example test-cases for a specific part of an assignment.\n\tInput:\n\t\tpartId (int) = part number of the assignment (1 for A*Part1, 2 for A*Part2 and s...
```python import pickle PA = 'A6' def load(partId, caseId=1): """ This function returns the example test-cases for a specific part of an assignment. Input: partId (int) = part number of the assignment (1 for A*Part1, 2 for A*Part2 and so on) caseId (int) = caseId = k to return the kth test case. Typically ther...
[ { "content": "Here is the snippet:\n```python\nfrom sympy import S, Symbol, I, Rational, PurePoly\nfrom sympy.matrices import Matrix, SparseMatrix, eye, zeros, ShapeError\nfrom sympy.utilities.pytest import raises, XFAIL\n\n\ndef test_sparse_matrix():\n def sparse_eye(n):\n return SparseMatrix.eye(n)\...
[ { "content": "Here is the snippet:\n<|memory_start|>```python\nfrom sympy import S, Symbol, I, Rational, PurePoly\nfrom sympy.matrices import Matrix, SparseMatrix, eye, zeros, ShapeError\nfrom sympy.utilities.pytest import raises, XFAIL\n\n\ndef test_sparse_matrix():\n def sparse_eye(n):\n return Spar...
```python from sympy import S, Symbol, I, Rational, PurePoly from sympy.matrices import Matrix, SparseMatrix, eye, zeros, ShapeError from sympy.utilities.pytest import raises, XFAIL def test_sparse_matrix(): def sparse_eye(n): return SparseMatrix.eye(n) def sparse_zeros(n): return SparseMatri...
[ { "content": "Repeat the full code snippet:\n```python\n#!/usr/bin/env python\n\nfrom nose import with_setup\nfrom machinekit.nosetests.realtime import setup_module,teardown_module\nfrom machinekit.nosetests.support import fnear\n\nfrom machinekit import hal\nimport os\n\ndef test_component_creation():\n glo...
[ { "content": "Repeat the full code snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nfrom nose import with_setup\nfrom machinekit.nosetests.realtime import setup_module,teardown_module\nfrom machinekit.nosetests.support import fnear\n\nfrom machinekit import hal\nimport os\n\ndef test_component_crea...
```python #!/usr/bin/env python from nose import with_setup from machinekit.nosetests.realtime import setup_module,teardown_module from machinekit.nosetests.support import fnear from machinekit import hal import os def test_component_creation(): global c1,c2 c1 = hal.Component("c1") c1.newpin("s32out", h...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n```python\n\"\"\"reaction URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.11/topics/http/urls/\nExamples:\nFunction views\n 1. Add an impo...
[ { "content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n\"\"\"reaction URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n https://docs.djangoproject.com/en/1.11/topics/http/urls/\nExamples:\nFunction views\n ...
```python """reaction URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home...
[ { "content": "```python\n#!/usr/bin/env python\n\n# The MIT License (MIT)\n#\n# Copyright (c) 2016 Paul Watkins, National Institutes of Health / NINDS\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 ...
[ { "content": "<|memory_start|>```python\n#!/usr/bin/env python\n\n# The MIT License (MIT)\n#\n# Copyright (c) 2016 Paul Watkins, National Institutes of Health / NINDS\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"...
```python #!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2016 Paul Watkins, National Institutes of Health / NINDS # # 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 r...
[ { "content": "Here is the script:\n```python\nfrom django import forms\n\nclass registration(forms.Form):\n username = forms.CharField(max_length=100, \n widget=forms.TextInput(attrs={'class': 'form-control',\n 'placeholder' : 'Username'}))\...
[ { "content": "Here is the script:\n<|memory_start|>```python\nfrom django import forms\n\nclass registration(forms.Form):\n username = forms.CharField(max_length=100, \n widget=forms.TextInput(attrs={'class': 'form-control',\n 'placeholder' ...
```python from django import forms class registration(forms.Form): username = forms.CharField(max_length=100, widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder' : 'Username'})) nom = forms.CharField(max_length=100, ...