prompt listlengths 1 1 | compression_prompt listlengths 1 1 | target stringlengths 1.03k 828k |
|---|---|---|
[
{
"content": "```python\n#! /usr/bin/env python\n#\n# quick and dirty processing of the MD All Sky images\n\nfrom astropy.io import fits\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nfrom scipy.misc import imsave\nimport numpy as np\nimport aplpy\nimport argparse as ap\nimport os.path\n... | [
{
"content": "<|memory_start|>```python\n#! /usr/bin/env python\n#\n# quick and dirty processing of the MD All Sky images\n\nfrom astropy.io import fits\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nfrom scipy.misc import imsave\nimport numpy as np\nimport aplpy\nimport argparse as ap\n... | ```python
#! /usr/bin/env python
#
# quick and dirty processing of the MD All Sky images
from astropy.io import fits
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from scipy.misc import imsave
import numpy as np
import aplpy
import argparse as ap
import os.path
import logging
import time
def d(f... |
[
{
"content": "Here is a code file:\n```python\n# -*- coding: utf-8 -*-\n###########################################################################\n# Module Writen to OpenERP, Open Source Management Solution\n#\n# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com\n# All Rights Reserved.\n# info@vau... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n###########################################################################\n# Module Writen to OpenERP, Open Source Management Solution\n#\n# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com\n# All Rights Reserved... | ```python
# -*- coding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
###########################################... |
[
{
"content": "Reproduce the code exactly as provided (keep formatting):\n```python\n# Copyright 2021 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:/... | [
{
"content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n# Copyright 2021 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... | ```python
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
[
{
"content": "```python\n'''\nCopyright (c) 2016 Genome Research Ltd.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\... | [
{
"content": "<|memory_start|>```python\n'''\nCopyright (c) 2016 Genome Research Ltd.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitatio... | ```python
'''
Copyright (c) 2016 Genome Research Ltd.
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, merge, publ... |
[
{
"content": "Repeat the following code:\n```python\nimport wx, sys, os, logging\nlog = logging.getLogger( __name__ )\nfrom squaremap import squaremap\nfrom runsnakerun import pstatsloader\n\nclass PStatsAdapter(squaremap.DefaultAdapter):\n\n percentageView = False\n total = 0\n \n TREE = pstatsload... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\nimport wx, sys, os, logging\nlog = logging.getLogger( __name__ )\nfrom squaremap import squaremap\nfrom runsnakerun import pstatsloader\n\nclass PStatsAdapter(squaremap.DefaultAdapter):\n\n percentageView = False\n total = 0\n \n T... | ```python
import wx, sys, os, logging
log = logging.getLogger( __name__ )
from squaremap import squaremap
from runsnakerun import pstatsloader
class PStatsAdapter(squaremap.DefaultAdapter):
percentageView = False
total = 0
TREE = pstatsloader.TREE_CALLS
def value(self, node, parent=None):
... |
[
{
"content": "Here is the code block:\n```python\n# This file is part of xrayutilities.\n#\n# xrayutilities is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at ... | [
{
"content": "Here is the code block:\n<|memory_start|>```python\n# This file is part of xrayutilities.\n#\n# xrayutilities is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the Lic... | ```python
# This file is part of xrayutilities.
#
# xrayutilities is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is d... |
[
{
"content": "Reconstruct the code exactly:\n```python\nimport pytest\nimport time\n\n\n# Not entirely happy with this check\n# TODO Change when I understand pytest better\ndef skip_if_unplugged():\n import usb.core\n dev = usb.core.find(idVendor=0x0403, idProduct=0x6014)\n if dev is None:\n pyt... | [
{
"content": "Reconstruct the code exactly:\n<|memory_start|>```python\nimport pytest\nimport time\n\n\n# Not entirely happy with this check\n# TODO Change when I understand pytest better\ndef skip_if_unplugged():\n import usb.core\n dev = usb.core.find(idVendor=0x0403, idProduct=0x6014)\n if dev is No... | ```python
import pytest
import time
# Not entirely happy with this check
# TODO Change when I understand pytest better
def skip_if_unplugged():
import usb.core
dev = usb.core.find(idVendor=0x0403, idProduct=0x6014)
if dev is None:
pytest.skip("FT232H not plugged in")
def test_lights(num_lights, ... |
[
{
"content": "```python\n\"\"\"\nBase graph objects\n\"\"\"\n\nfrom evh.base import EvHandler,EvStack\nfrom math import *\n\nclass Drawable(object):\n \"\"\"\n Base class for drawable objects.\n \"\"\"\n def __init__(self,x,y,scale=1.0):\n self.x=x\n self.y=y\n self.scale=scale\... | [
{
"content": "<|memory_start|>```python\n\"\"\"\nBase graph objects\n\"\"\"\n\nfrom evh.base import EvHandler,EvStack\nfrom math import *\n\nclass Drawable(object):\n \"\"\"\n Base class for drawable objects.\n \"\"\"\n def __init__(self,x,y,scale=1.0):\n self.x=x\n self.y=y\n s... | ```python
"""
Base graph objects
"""
from evh.base import EvHandler,EvStack
from math import *
class Drawable(object):
"""
Base class for drawable objects.
"""
def __init__(self,x,y,scale=1.0):
self.x=x
self.y=y
self.scale=scale
def Draw(self,ctx):
ctx.save()
... |
[
{
"content": "Repeat the code exactly as the original, including blank lines:\n```python\n#!/usr/bin/env python\n\n\"\"\"Handle records from /proc/self/maps data files\"\"\"\n\nimport regentest as RG\nimport ProcHandlers as PH\n\nPFC = PH.ProcFieldConstants\n\n# ---\n\ndef re_self_maps(inprecs):\n\n \"\"\"It... | [
{
"content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n\"\"\"Handle records from /proc/self/maps data files\"\"\"\n\nimport regentest as RG\nimport ProcHandlers as PH\n\nPFC = PH.ProcFieldConstants\n\n# ---\n\ndef re_self_maps(inprecs):... | ```python
#!/usr/bin/env python
"""Handle records from /proc/self/maps data files"""
import regentest as RG
import ProcHandlers as PH
PFC = PH.ProcFieldConstants
# ---
def re_self_maps(inprecs):
"""Iterate through parsed records and re-generate data file"""
__leadtemp = "{st:08x}-{en:08x} {fl:4s} {offset... |
[
{
"content": "Here is a code file:\n```python\n'''Example script to generate text from Nietzsche's writings.\n\nAt least 20 epochs are required before the generated text\nstarts sounding coherent.\n\nIt is recommended to run this script on GPU, as recurrent\nnetworks are quite computationally intensive.\n\nIf y... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n'''Example script to generate text from Nietzsche's writings.\n\nAt least 20 epochs are required before the generated text\nstarts sounding coherent.\n\nIt is recommended to run this script on GPU, as recurrent\nnetworks are quite computationally in... | ```python
'''Example script to generate text from Nietzsche's writings.
At least 20 epochs are required before the generated text
starts sounding coherent.
It is recommended to run this script on GPU, as recurrent
networks are quite computationally intensive.
If you try this script on new data, make sure your corpus... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\n##########################################################################\n# \n# Copyright (c) 2014, John Haddon. All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or without\n# modificati... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n##########################################################################\n# \n# Copyright (c) 2014, John Haddon. All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or withou... | ```python
##########################################################################
#
# Copyright (c) 2014, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
[
{
"content": "Replicate the source code:\n```python\n\"\"\"\nTest Scikit-learn\n\"\"\"\nimport numpy as np\nfrom mlens.ensemble import SuperLearner, Subsemble, BlendEnsemble, TemporalEnsemble\nfrom mlens.testing.dummy import return_pickled\ntry:\n from sklearn.utils.estimator_checks import check_estimator\n ... | [
{
"content": "Replicate the source code:\n<|memory_start|>```python\n\"\"\"\nTest Scikit-learn\n\"\"\"\nimport numpy as np\nfrom mlens.ensemble import SuperLearner, Subsemble, BlendEnsemble, TemporalEnsemble\nfrom mlens.testing.dummy import return_pickled\ntry:\n from sklearn.utils.estimator_checks import ch... | ```python
"""
Test Scikit-learn
"""
import numpy as np
from mlens.ensemble import SuperLearner, Subsemble, BlendEnsemble, TemporalEnsemble
from mlens.testing.dummy import return_pickled
try:
from sklearn.utils.estimator_checks import check_estimator
from sklearn.linear_model import Lasso, LinearRegression
f... |
[
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n#############################################################################\n##\n## Copyright (C) 2015 Riverbank Computing Limited.\n## Copyright (C) 2006 Thorsten Marek.\n## All right reserved.\n##\n## This fi... | [
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n#############################################################################\n##\n## Copyright (C) 2015 Riverbank Computing Limited.\n## Copyright (C) 2006 Thorsten Marek.\n## All right reserved.... | ```python
#############################################################################
##
## Copyright (C) 2015 Riverbank Computing Limited.
## Copyright (C) 2006 Thorsten Marek.
## All right reserved.
##
## This file is part of PyQt.
##
## You may use this file under the terms of the GPL v2 or the revised BSD
## lice... |
[
{
"content": "Repeat the following code:\n```python\n# systemd-sysv-generator integration test\n#\n# (C) 2015 Canonical Ltd.\n# Author: Martin Pitt <martin.pitt@ubuntu.com>\n#\n# systemd is free software; you can redistribute it and/or modify it\n# under the terms of the GNU Lesser General Public License as pub... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\n# systemd-sysv-generator integration test\n#\n# (C) 2015 Canonical Ltd.\n# Author: Martin Pitt <martin.pitt@ubuntu.com>\n#\n# systemd is free software; you can redistribute it and/or modify it\n# under the terms of the GNU Lesser General Publi... | ```python
# systemd-sysv-generator integration test
#
# (C) 2015 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
#
# systemd 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 ... |
[
{
"content": "Reproduce the code exactly as provided (keep formatting):\n```python\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF lic... | [
{
"content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownersh... | ```python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you... |
[
{
"content": "```python\nimport logging\nfrom zephserver.infra.service_manager import ServiceManager\nfrom zephserver.service.service_interface import ServiceInterface\n\nfrom zephserver.infra.cluster_adapter import ClusterAdapter\nfrom zephserversettings import MY_ROOM_HANDLER\nfrom threading import Thread, Ev... | [
{
"content": "<|memory_start|>```python\nimport logging\nfrom zephserver.infra.service_manager import ServiceManager\nfrom zephserver.service.service_interface import ServiceInterface\n\nfrom zephserver.infra.cluster_adapter import ClusterAdapter\nfrom zephserversettings import MY_ROOM_HANDLER\nfrom threading i... | ```python
import logging
from zephserver.infra.service_manager import ServiceManager
from zephserver.service.service_interface import ServiceInterface
from zephserver.infra.cluster_adapter import ClusterAdapter
from zephserversettings import MY_ROOM_HANDLER
from threading import Thread, Event, Lock
class SaySocket(Se... |
[
{
"content": "Replicate the source code:\n```python\nimport json\nimport logging\nimport os\nimport subprocess\nimport textwrap\nimport uuid\n\nimport boto3\nimport passlib.hash\nimport pytest\n\nfrom dcos_installer import backend\nfrom dcos_installer.config import Config, make_default_config_if_needed, to_conf... | [
{
"content": "Replicate the source code:\n<|memory_start|>```python\nimport json\nimport logging\nimport os\nimport subprocess\nimport textwrap\nimport uuid\n\nimport boto3\nimport passlib.hash\nimport pytest\n\nfrom dcos_installer import backend\nfrom dcos_installer.config import Config, make_default_config_if... | ```python
import json
import logging
import os
import subprocess
import textwrap
import uuid
import boto3
import passlib.hash
import pytest
from dcos_installer import backend
from dcos_installer.config import Config, make_default_config_if_needed, to_config
os.environ["BOOTSTRAP_ID"] = "12345"
def test_password_ha... |
[
{
"content": "Repeat the following code:\n```python\n#! /usr/bin/env python\nfrom pbhla.filenames import get_file_type\n\n__author__ = 'bbowman@pacificbiosciences.com'\n\nimport logging\nfrom tempfile import NamedTemporaryFile\n\nfrom pbcore.io.FastaIO import FastaRecord, FastaWriter\nfrom pbcore.io.FastqIO imp... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\n#! /usr/bin/env python\nfrom pbhla.filenames import get_file_type\n\n__author__ = 'bbowman@pacificbiosciences.com'\n\nimport logging\nfrom tempfile import NamedTemporaryFile\n\nfrom pbcore.io.FastaIO import FastaRecord, FastaWriter\nfrom pbcor... | ```python
#! /usr/bin/env python
from pbhla.filenames import get_file_type
__author__ = 'bbowman@pacificbiosciences.com'
import logging
from tempfile import NamedTemporaryFile
from pbcore.io.FastaIO import FastaRecord, FastaWriter
from pbcore.io.FastqIO import FastqRecord, FastqWriter
from pbhla.io.AmpAnalysisIO imp... |
[
{
"content": "Produce an exact reconstruction of the code:\n```python\n# Python\nimport json\nimport logging\nimport re\nimport urllib\nimport urlparse\nimport warnings\nimport webbrowser\n\n# Requests\nimport requests\n\n# BeautifulSoup4\nfrom bs4 import BeautifulSoup\n\n__all__ = ['LogMeInCentralAPI']\n\nlogg... | [
{
"content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n# Python\nimport json\nimport logging\nimport re\nimport urllib\nimport urlparse\nimport warnings\nimport webbrowser\n\n# Requests\nimport requests\n\n# BeautifulSoup4\nfrom bs4 import BeautifulSoup\n\n__all__ = ['LogMeInCent... | ```python
# Python
import json
import logging
import re
import urllib
import urlparse
import warnings
import webbrowser
# Requests
import requests
# BeautifulSoup4
from bs4 import BeautifulSoup
__all__ = ['LogMeInCentralAPI']
logger = logging.getLogger('lmiapi.central')
class LogMeInCentralAPI(object): # pragma:... |
[
{
"content": "Here is the code block:\n```python\nfrom __future__ import unicode_literals\n\nfrom sqlalchemy import ForeignKeyConstraint, text\n\nfrom applications.users.models import *\nfrom django.conf import settings\nfrom graphspace.mixins import *\n\nBase = settings.BASE\n\n# ================== Table Defin... | [
{
"content": "Here is the code block:\n<|memory_start|>```python\nfrom __future__ import unicode_literals\n\nfrom sqlalchemy import ForeignKeyConstraint, text\n\nfrom applications.users.models import *\nfrom django.conf import settings\nfrom graphspace.mixins import *\n\nBase = settings.BASE\n\n# ==============... | ```python
from __future__ import unicode_literals
from sqlalchemy import ForeignKeyConstraint, text
from applications.users.models import *
from django.conf import settings
from graphspace.mixins import *
Base = settings.BASE
# ================== Table Definitions =================== #
class UniprotAlias(IDMixin,... |
[
{
"content": "Here is the source code:\n```python\nfrom keras.models import Model\nfrom keras.layers import Dense, ZeroPadding2D, BatchNormalization, Conv2D, MaxPooling2D, Activation, Input, Concatenate\nfrom keras.optimizers import RMSprop\nfrom layers.SpatialPyramidPooling import SpatialPyramidPooling\nfrom k... | [
{
"content": "Here is the source code:\n<|memory_start|>```python\nfrom keras.models import Model\nfrom keras.layers import Dense, ZeroPadding2D, BatchNormalization, Conv2D, MaxPooling2D, Activation, Input, Concatenate\nfrom keras.optimizers import RMSprop\nfrom layers.SpatialPyramidPooling import SpatialPyrami... | ```python
from keras.models import Model
from keras.layers import Dense, ZeroPadding2D, BatchNormalization, Conv2D, MaxPooling2D, Activation, Input, Concatenate
from keras.optimizers import RMSprop
from layers.SpatialPyramidPooling import SpatialPyramidPooling
from keras.applications.resnet50 import identity_block, con... |
[
{
"content": "Reproduce the code exactly as provided (keep formatting):\n```python\n# coding:utf-8\r\nimport os\r\nimport sys\r\nimport pycurl\r\n\r\n\r\nc = pycurl.Curl()\r\nURL = \"http://www.baidu.com/\"\r\nc.setopt(pycurl.URL, URL)\r\n\r\n# 连接超时时间,5秒\r\nc.setopt(pycurl.CONNECTTIMEOUT, 5)\r\n\r\n# 下载超时时间,5秒\... | [
{
"content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n# coding:utf-8\r\nimport os\r\nimport sys\r\nimport pycurl\r\n\r\n\r\nc = pycurl.Curl()\r\nURL = \"http://www.baidu.com/\"\r\nc.setopt(pycurl.URL, URL)\r\n\r\n# 连接超时时间,5秒\r\nc.setopt(pycurl.CONNECTTIMEOUT, 5)\r\n... | ```python
# coding:utf-8
import os
import sys
import pycurl
c = pycurl.Curl()
URL = "http://www.baidu.com/"
c.setopt(pycurl.URL, URL)
# 连接超时时间,5秒
c.setopt(pycurl.CONNECTTIMEOUT, 5)
# 下载超时时间,5秒
c.setopt(pycurl.TIMEOUT, 5)
c.setopt(pycurl.FORBID_REUSE, 1)
c.setopt(pycurl.MAXREDIRS, 1)
c.setopt(pycurl... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2017-2020 The Project X-Ray Authors.\n#\n# Use of this source code is governed by a ISC-style\n# license that can be found in the LICENSE file or at\n# https:/... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2017-2020 The Project X-Ray Authors.\n#\n# Use of this source code is governed by a ISC-style\n# license that can be found in the LICENSE file ... | ```python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import os, random
random.se... |
[
{
"content": "```python\nfrom datetime import datetime\nimport hashlib\nfrom werkzeug.security import generate_password_hash, check_password_hash\nfrom itsdangerous import TimedJSONWebSignatureSerializer as Serializer\nfrom flask import current_app\nfrom flask.ext.login import UserMixin, AnonymousUserMixin\nfro... | [
{
"content": "<|memory_start|>```python\nfrom datetime import datetime\nimport hashlib\nfrom werkzeug.security import generate_password_hash, check_password_hash\nfrom itsdangerous import TimedJSONWebSignatureSerializer as Serializer\nfrom flask import current_app\nfrom flask.ext.login import UserMixin, Anonymo... | ```python
from datetime import datetime
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
from flask.ext.login import UserMixin, AnonymousUserMixin
from .. import db, login_manager... |
[
{
"content": "Replicate the source code:\n```python\n#!/usr/bin/env python\n\n# nicechart.py\n#\n# Copyright 2011 \n# \n# Christoph Sterz \n# Florian Weber \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... | [
{
"content": "Replicate the source code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n# nicechart.py\n#\n# Copyright 2011 \n# \n# Christoph Sterz \n# Florian Weber \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... | ```python
#!/usr/bin/env python
# nicechart.py
#
# Copyright 2011
#
# Christoph Sterz
# Florian Weber
#
# 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 Lic... |
[
{
"content": "Here is the code block:\n```python\n# Copyright 2016 Red Hat, Inc.\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/licen... | [
{
"content": "Here is the code block:\n<|memory_start|>```python\n# Copyright 2016 Red Hat, Inc.\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.... | ```python
# Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
[
{
"content": "```python\nimport os\nimport importlib\nfrom gmc.conf import global_settings\n\nENVIRONMENT_VARIABLE = \"GMC_SETTINGS_MODULE\"\nclass Settings:\n \"\"\"\n Module to load settings to configure gmc\n \"\"\"\n def __init__(self, *args, **kwargs):\n self.settings = None\n sel... | [
{
"content": "<|memory_start|>```python\nimport os\nimport importlib\nfrom gmc.conf import global_settings\n\nENVIRONMENT_VARIABLE = \"GMC_SETTINGS_MODULE\"\nclass Settings:\n \"\"\"\n Module to load settings to configure gmc\n \"\"\"\n def __init__(self, *args, **kwargs):\n self.settings = N... | ```python
import os
import importlib
from gmc.conf import global_settings
ENVIRONMENT_VARIABLE = "GMC_SETTINGS_MODULE"
class Settings:
"""
Module to load settings to configure gmc
"""
def __init__(self, *args, **kwargs):
self.settings = None
self.settings_module = None
def __getatt... |
[
{
"content": "```python\nimport collections\n\nfrom rx import AnonymousObservable, Observable\nfrom rx.disposables import CompositeDisposable\nfrom rx.internal import default_comparer\nfrom rx.internal import extensionmethod\n\n\n@extensionmethod(Observable)\ndef sequence_equal(self, second, comparer=None):\n ... | [
{
"content": "<|memory_start|>```python\nimport collections\n\nfrom rx import AnonymousObservable, Observable\nfrom rx.disposables import CompositeDisposable\nfrom rx.internal import default_comparer\nfrom rx.internal import extensionmethod\n\n\n@extensionmethod(Observable)\ndef sequence_equal(self, second, com... | ```python
import collections
from rx import AnonymousObservable, Observable
from rx.disposables import CompositeDisposable
from rx.internal import default_comparer
from rx.internal import extensionmethod
@extensionmethod(Observable)
def sequence_equal(self, second, comparer=None):
"""Determines whether two seque... |
[
{
"content": "Reconstruct the code exactly:\n```python\n#!/usr/bin/env python\n\nclass Solution:\n # @param board, a list of lists of 1 length string\n # @param word, a string\n # @return a boolean\n def exist(self, board, word):\n def valid(board, mark, i, j, dir, c):\n i1 = i\n ... | [
{
"content": "Reconstruct the code exactly:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nclass Solution:\n # @param board, a list of lists of 1 length string\n # @param word, a string\n # @return a boolean\n def exist(self, board, word):\n def valid(board, mark, i, j, dir, c):\n ... | ```python
#!/usr/bin/env python
class Solution:
# @param board, a list of lists of 1 length string
# @param word, a string
# @return a boolean
def exist(self, board, word):
def valid(board, mark, i, j, dir, c):
i1 = i
j1 = j
if dir == 0:
i1 +=... |
[
{
"content": "Provide a verbatim copy of the code:\n```python\nfrom django.db import models\n\nclass NumberedModel(models.Model):\n def number_with_respect_to(self):\n return self.__class__.objects.all()\n\n def _renumber(self):\n '''Renumbers the queryset while preserving the instance's num... | [
{
"content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\nfrom django.db import models\n\nclass NumberedModel(models.Model):\n def number_with_respect_to(self):\n return self.__class__.objects.all()\n\n def _renumber(self):\n '''Renumbers the queryset while preserving th... | ```python
from django.db import models
class NumberedModel(models.Model):
def number_with_respect_to(self):
return self.__class__.objects.all()
def _renumber(self):
'''Renumbers the queryset while preserving the instance's number'''
queryset = self.number_with_respect_to()
fie... |
[
{
"content": "```python\n\"\"\"Provides functionality to interact with fans.\"\"\"\nfrom datetime import timedelta\nimport functools as ft\nimport logging\nfrom typing import Optional\n\nimport voluptuous as vol\n\nfrom homeassistant.const import SERVICE_TOGGLE, SERVICE_TURN_OFF, SERVICE_TURN_ON\nimport homeass... | [
{
"content": "<|memory_start|>```python\n\"\"\"Provides functionality to interact with fans.\"\"\"\nfrom datetime import timedelta\nimport functools as ft\nimport logging\nfrom typing import Optional\n\nimport voluptuous as vol\n\nfrom homeassistant.const import SERVICE_TOGGLE, SERVICE_TURN_OFF, SERVICE_TURN_ON... | ```python
"""Provides functionality to interact with fans."""
from datetime import timedelta
import functools as ft
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.const import SERVICE_TOGGLE, SERVICE_TURN_OFF, SERVICE_TURN_ON
import homeassistant.helpers.config_validation as cv... |
[
{
"content": "```python\n# -*- coding: utf-8 -*-\n\n## This file is part of Invenio.\n## Copyright (C) 2010 CERN.\n##\n## Invenio is free software; you can redistribute it and/or\n## modify it under the terms of the GNU General Public License as\n## published by the Free Software Foundation; either version 2 of... | [
{
"content": "<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n## This file is part of Invenio.\n## Copyright (C) 2010 CERN.\n##\n## Invenio is free software; you can redistribute it and/or\n## modify it under the terms of the GNU General Public License as\n## published by the Free Software Foundation; eit... | ```python
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2010 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your o... |
[
{
"content": "```python\n#coding:utf-8 \nfrom yuming import ifRegged\nimport sys\nimport time,random\n\ndicType = []\ndic = {}\n\ndtFile = open('domainType','r').readlines()\nfor t in dtFile[1:-1]:\n dicType.append(t[:-1])\n\n#print dicType\n\ntimes = [1,2,3,4]\nfor t in times:\n dic[t] = []\n\ntotalDic =... | [
{
"content": "<|memory_start|>```python\n#coding:utf-8 \nfrom yuming import ifRegged\nimport sys\nimport time,random\n\ndicType = []\ndic = {}\n\ndtFile = open('domainType','r').readlines()\nfor t in dtFile[1:-1]:\n dicType.append(t[:-1])\n\n#print dicType\n\ntimes = [1,2,3,4]\nfor t in times:\n dic[t] = ... | ```python
#coding:utf-8
from yuming import ifRegged
import sys
import time,random
dicType = []
dic = {}
dtFile = open('domainType','r').readlines()
for t in dtFile[1:-1]:
dicType.append(t[:-1])
#print dicType
times = [1,2,3,4]
for t in times:
dic[t] = []
totalDic = []
pinyinFile = open('pinyin','r').read... |
[
{
"content": "Here is a code snippet:\n```python\nimport socket\nimport select\nimport codes\nimport funs\nimport os\nimport subprocess\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('server_ip', type=str, help='address of the server (e.g. 198.123.1.3)')\nparser.add_argument('--serv... | [
{
"content": "Here is a code snippet:\n<|memory_start|>```python\nimport socket\nimport select\nimport codes\nimport funs\nimport os\nimport subprocess\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('server_ip', type=str, help='address of the server (e.g. 198.123.1.3)')\nparser.add_... | ```python
import socket
import select
import codes
import funs
import os
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('server_ip', type=str, help='address of the server (e.g. 198.123.1.3)')
parser.add_argument('--server_port', type=int, default=12345, required=False, help='p... |
[
{
"content": "Return the code unaltered:\n```python\n#!/usr/bin/env python\n#\n# 2014-08-04 Sebastian Rockel (rockel@informatik.uni-hamburg.de)\n# Provides a service interface to read the robot motion parameters\n# uses the dynamic_reconfigure client\n#\nimport roslib; roslib.load_manifest('robot_motion_param')... | [
{
"content": "Return the code unaltered:\n<|memory_start|>```python\n#!/usr/bin/env python\n#\n# 2014-08-04 Sebastian Rockel (rockel@informatik.uni-hamburg.de)\n# Provides a service interface to read the robot motion parameters\n# uses the dynamic_reconfigure client\n#\nimport roslib; roslib.load_manifest('robo... | ```python
#!/usr/bin/env python
#
# 2014-08-04 Sebastian Rockel (rockel@informatik.uni-hamburg.de)
# Provides a service interface to read the robot motion parameters
# uses the dynamic_reconfigure client
#
import roslib; roslib.load_manifest('robot_motion_param')
from robot_motion_param.srv import *
import rospy
import... |
[
{
"content": "Repeat the code exactly:\n```python\nimport pigui.pyqt5.widgets.list.view\nimport pigui.pyqt5.widgets.miller.view\n\nimport about.editor\nimport about.delegate\n\nDefaultList = pigui.pyqt5.widgets.list.view.DefaultList\n\n\ndef create_delegate(self, index):\n typ = self.model.data(index, 'type'... | [
{
"content": "Repeat the code exactly:\n<|memory_start|>```python\nimport pigui.pyqt5.widgets.list.view\nimport pigui.pyqt5.widgets.miller.view\n\nimport about.editor\nimport about.delegate\n\nDefaultList = pigui.pyqt5.widgets.list.view.DefaultList\n\n\ndef create_delegate(self, index):\n typ = self.model.da... | ```python
import pigui.pyqt5.widgets.list.view
import pigui.pyqt5.widgets.miller.view
import about.editor
import about.delegate
DefaultList = pigui.pyqt5.widgets.list.view.DefaultList
def create_delegate(self, index):
typ = self.model.data(index, 'type')
if typ == 'editor':
suffix = self.model.data... |
[
{
"content": "Here is a code file:\n```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Author : Matt Lorentzen\n# Twitter : @lorentzenman\n\nimport os, sys, time, argparse\n\ndef banner():\n\n\tversion = \"part of the spiderweb\"\n \n\tbanner = \"\"\"\n _\n _ __ __ _ _ _... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Author : Matt Lorentzen\n# Twitter : @lorentzenman\n\nimport os, sys, time, argparse\n\ndef banner():\n\n\tversion = \"part of the spiderweb\"\n \n\tbanner = \"\"\"\n _\n _... | ```python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author : Matt Lorentzen
# Twitter : @lorentzenman
import os, sys, time, argparse
def banner():
version = "part of the spiderweb"
banner = """
_
_ __ __ _ _ _ __| | __ _ _ _
| '_ \ / _` | | | |/ _` |/ _` | | | |
| |_) | ... |
[
{
"content": "Reconstruct the code exactly:\n```python\n# To change this license header, choose License Headers in Project Properties.\n# To change this template file, choose Tools | Templates\n# and open the template in the editor.\n\nclass socket_protocol:\n def __init__(self):\n self.response = \"\... | [
{
"content": "Reconstruct the code exactly:\n<|memory_start|>```python\n# To change this license header, choose License Headers in Project Properties.\n# To change this template file, choose Tools | Templates\n# and open the template in the editor.\n\nclass socket_protocol:\n def __init__(self):\n sel... | ```python
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
class socket_protocol:
def __init__(self):
self.response = ""
pass
def pack_request(self, request):
... |
[
{
"content": "Repeat the full code snippet:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nThe application allows you to show the weights of a class\nthat inherits from pylearn2's Model.\n\nTo start, goto File > Open pickled model... and select the\nfile that has your saved mode. Loading mi... | [
{
"content": "Repeat the full code snippet:\n<|memory_start|>```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nThe application allows you to show the weights of a class\nthat inherits from pylearn2's Model.\n\nTo start, goto File > Open pickled model... and select the\nfile that has your saved ... | ```python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The application allows you to show the weights of a class
that inherits from pylearn2's Model.
To start, goto File > Open pickled model... and select the
file that has your saved mode. Loading might take a while
and the window will look frozen while loading.
... |
[
{
"content": "Here is some code:\n```python\n#!/usr/bin/python\n# -*- coding: UTF-8 -*-\n# CTA API CLI YAH\n\nimport sys\nimport requests\n#from bs4 import BeautifulSoup\nfrom xmltodict import parse\nimport datetime\nfrom time import gmtime, strftime\n# enable debugging\nimport cgitb\ncgitb.enable()\n\n# get AP... | [
{
"content": "Here is some code:\n<|memory_start|>```python\n#!/usr/bin/python\n# -*- coding: UTF-8 -*-\n# CTA API CLI YAH\n\nimport sys\nimport requests\n#from bs4 import BeautifulSoup\nfrom xmltodict import parse\nimport datetime\nfrom time import gmtime, strftime\n# enable debugging\nimport cgitb\ncgitb.enab... | ```python
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# CTA API CLI YAH
import sys
import requests
#from bs4 import BeautifulSoup
from xmltodict import parse
import datetime
from time import gmtime, strftime
# enable debugging
import cgitb
cgitb.enable()
# get API key from file
f = open('./.cta-api.key', 'r')
APIKEY = ... |
[
{
"content": "```python\n#!/usr/bin/env python\n\n# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed wit... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/env python\n\n# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt,... | ```python
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# -----------... |
[
{
"content": "Write the code verbatim:\n```python\n\"\"\"Define the File Type.\n\nThe primary purpose of the File object is to track the protocol to be used\nto transfer the file as well as to give the appropriate filepath depending\non where (client-side, remote-side, intermediary-side) the File.filepath is\nb... | [
{
"content": "Write the code verbatim:\n<|memory_start|>```python\n\"\"\"Define the File Type.\n\nThe primary purpose of the File object is to track the protocol to be used\nto transfer the file as well as to give the appropriate filepath depending\non where (client-side, remote-side, intermediary-side) the Fil... | ```python
"""Define the File Type.
The primary purpose of the File object is to track the protocol to be used
to transfer the file as well as to give the appropriate filepath depending
on where (client-side, remote-side, intermediary-side) the File.filepath is
being called from.
"""
import os
import logging
from urll... |
[
{
"content": "Write the code verbatim:\n```python\nimport os\nfrom django.contrib import messages\n\nSETTINGS_DIR = os.path.dirname(os.path.abspath(__file__))\nPROJECT_DIR = os.path.dirname(SETTINGS_DIR)\nBUILDOUT_DIR = os.path.dirname(PROJECT_DIR)\nVAR_DIR = os.path.join(BUILDOUT_DIR, \"var\")\n\n\n###########... | [
{
"content": "Write the code verbatim:\n<|memory_start|>```python\nimport os\nfrom django.contrib import messages\n\nSETTINGS_DIR = os.path.dirname(os.path.abspath(__file__))\nPROJECT_DIR = os.path.dirname(SETTINGS_DIR)\nBUILDOUT_DIR = os.path.dirname(PROJECT_DIR)\nVAR_DIR = os.path.join(BUILDOUT_DIR, \"var\")\... | ```python
import os
from django.contrib import messages
SETTINGS_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_DIR = os.path.dirname(SETTINGS_DIR)
BUILDOUT_DIR = os.path.dirname(PROJECT_DIR)
VAR_DIR = os.path.join(BUILDOUT_DIR, "var")
#######################################################################... |
[
{
"content": "Produce an exact reconstruction of the code:\n```python\nfrom setuptools import setup # Always prefer setuptools over distutils\nimport os\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()\n\n# allow setup.py to be run from any path\nos.chdir(os.path.normpath(os.path.j... | [
{
"content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\nfrom setuptools import setup # Always prefer setuptools over distutils\nimport os\n\nREADME = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()\n\n# allow setup.py to be run from any path\nos.chdir(os.path.no... | ```python
from setuptools import setup # Always prefer setuptools over distutils
import os
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-ga-pul... |
[
{
"content": "```python\nimport hashlib\nimport os\nfrom textwrap import dedent\n\nfrom ..cache import BaseCache\nfrom ..controller import CacheController\n\ntry:\n FileNotFoundError\nexcept NameError:\n # py2.X\n FileNotFoundError = IOError\n\n\ndef _secure_open_write(filename, fmode):\n # We only ... | [
{
"content": "<|memory_start|>```python\nimport hashlib\nimport os\nfrom textwrap import dedent\n\nfrom ..cache import BaseCache\nfrom ..controller import CacheController\n\ntry:\n FileNotFoundError\nexcept NameError:\n # py2.X\n FileNotFoundError = IOError\n\n\ndef _secure_open_write(filename, fmode):... | ```python
import hashlib
import os
from textwrap import dedent
from ..cache import BaseCache
from ..controller import CacheController
try:
FileNotFoundError
except NameError:
# py2.X
FileNotFoundError = IOError
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it... |
[
{
"content": "```python\n#!/usr/bin/env python\n\"\"\"Manually send commands to the RC car.\"\"\"\nimport argparse\nimport json\nimport pygame\nimport pygame.font\nimport socket\nimport sys\n\nfrom common import server_up\n\nUP = LEFT = DOWN = RIGHT = False\nQUIT = False\n\n# pylint: disable=superfluous-parens\... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/env python\n\"\"\"Manually send commands to the RC car.\"\"\"\nimport argparse\nimport json\nimport pygame\nimport pygame.font\nimport socket\nimport sys\n\nfrom common import server_up\n\nUP = LEFT = DOWN = RIGHT = False\nQUIT = False\n\n# pylint: disable=sup... | ```python
#!/usr/bin/env python
"""Manually send commands to the RC car."""
import argparse
import json
import pygame
import pygame.font
import socket
import sys
from common import server_up
UP = LEFT = DOWN = RIGHT = False
QUIT = False
# pylint: disable=superfluous-parens
def dead_frequency(frequency):
"""Retu... |
[
{
"content": "```python\nfrom __future__ import unicode_literals\nimport frappe\nfrom frappe.utils.file_manager import save_file\nimport os, base64, re\nimport random\nimport json\n\n@frappe.whitelist()\ndef add_node():\n\tctype = frappe.form_dict.get('ctype')\n\tparent_field = 'parent_' + ctype.lower().replace... | [
{
"content": "<|memory_start|>```python\nfrom __future__ import unicode_literals\nimport frappe\nfrom frappe.utils.file_manager import save_file\nimport os, base64, re\nimport random\nimport json\n\n@frappe.whitelist()\ndef add_node():\n\tctype = frappe.form_dict.get('ctype')\n\tparent_field = 'parent_' + ctype... | ```python
from __future__ import unicode_literals
import frappe
from frappe.utils.file_manager import save_file
import os, base64, re
import random
import json
@frappe.whitelist()
def add_node():
ctype = frappe.form_dict.get('ctype')
parent_field = 'parent_' + ctype.lower().replace(' ', '_')
name_field = ctype.lowe... |
[
{
"content": "Write the code verbatim:\n```python\nimport requests\r\nimport json\r\n\r\naccess_token='EAAMcWZCJ7Ui4BALHXjXKkizZANG5AhQZAL9buUS5KR6fX8YurTosJLmxTfP4WoZBiP8DFe8eqbJ2NplRPGLsve2xYIwwsbERTnX5pvsiRIvJ0So1TZAHmOHlUPVnzZCBjPdZBhkm8CBnYTV0eNjAwQiBVkroQGnaqgZD'\r\noutfile=open(\"list.csv\",\"w\")\r\n\r\... | [
{
"content": "Write the code verbatim:\n<|memory_start|>```python\nimport requests\r\nimport json\r\n\r\naccess_token='EAAMcWZCJ7Ui4BALHXjXKkizZANG5AhQZAL9buUS5KR6fX8YurTosJLmxTfP4WoZBiP8DFe8eqbJ2NplRPGLsve2xYIwwsbERTnX5pvsiRIvJ0So1TZAHmOHlUPVnzZCBjPdZBhkm8CBnYTV0eNjAwQiBVkroQGnaqgZD'\r\noutfile=open(\"list.csv... | ```python
import requests
import json
access_token='EAAMcWZCJ7Ui4BALHXjXKkizZANG5AhQZAL9buUS5KR6fX8YurTosJLmxTfP4WoZBiP8DFe8eqbJ2NplRPGLsve2xYIwwsbERTnX5pvsiRIvJ0So1TZAHmOHlUPVnzZCBjPdZBhkm8CBnYTV0eNjAwQiBVkroQGnaqgZD'
outfile=open("list.csv","w")
def text_cleaning(text):
text = text.encode('ascii', ... |
[
{
"content": "Reconstruct the code exactly:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2019, the cclib development team\n#\n# This file is part of cclib (http://cclib.github.io) and is distributed under\n# the terms of the BSD 3-Clause License.\n\n\"\"\"Generate the coverage.rst and coverage.rst fi... | [
{
"content": "Reconstruct the code exactly:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2019, the cclib development team\n#\n# This file is part of cclib (http://cclib.github.io) and is distributed under\n# the terms of the BSD 3-Clause License.\n\n\"\"\"Generate the coverage.rst and... | ```python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Generate the coverage.rst and coverage.rst files from test results."""
from __future__ import print_function... |
[
{
"content": "Return the code unaltered:\n```python\nfrom Components.Console import Console\nfrom os import mkdir, path, remove\nfrom glob import glob\nfrom Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, getConfigListEntry, ConfigSelection, ConfigIP, ConfigYesNo, ConfigSequence, ... | [
{
"content": "Return the code unaltered:\n<|memory_start|>```python\nfrom Components.Console import Console\nfrom os import mkdir, path, remove\nfrom glob import glob\nfrom Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, getConfigListEntry, ConfigSelection, ConfigIP, ConfigYesNo, ... | ```python
from Components.Console import Console
from os import mkdir, path, remove
from glob import glob
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, getConfigListEntry, ConfigSelection, ConfigIP, ConfigYesNo, ConfigSequence, ConfigNumber, NoSave, ConfigEnableDisable, configfile
... |
[
{
"content": "Here is a code file:\n```python\n# Copyright 2017 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# http://www... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n# Copyright 2017 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... | ```python
# Copyright 2017 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 required ... |
[
{
"content": "Repeat the code precisely as written (spacing intact):\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Oct 28 14:06:45 2014\n\n@author: a1655681\n\"\"\"\nimport mtpy.modeling.occam2d as o2d\nimport mtpy.modeling.pek1dclasses as p1dc\nimport numpy as np\nimport os\nimport os.path as op\... | [
{
"content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Oct 28 14:06:45 2014\n\n@author: a1655681\n\"\"\"\nimport mtpy.modeling.occam2d as o2d\nimport mtpy.modeling.pek1dclasses as p1dc\nimport numpy as np\nimport os\nimpor... | ```python
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 28 14:06:45 2014
@author: a1655681
"""
import mtpy.modeling.occam2d as o2d
import mtpy.modeling.pek1dclasses as p1dc
import numpy as np
import os
import os.path as op
import pek2dforward as p2d
import string
import scipy.interpolate as si
import mtpy.utils.fileh... |
[
{
"content": "Here is the source code:\n```python\nimport json\nfrom models import Character, User, Draft, DraftTicket, Episode, DraftHistory, Rubric, Score\nfrom sqlalchemy import or_, exc\nfrom sqlalchemy.orm import lazyload\nfrom datetime import timedelta, datetime\nimport pandas as pd\nimport numpy as np\n\... | [
{
"content": "Here is the source code:\n<|memory_start|>```python\nimport json\nfrom models import Character, User, Draft, DraftTicket, Episode, DraftHistory, Rubric, Score\nfrom sqlalchemy import or_, exc\nfrom sqlalchemy.orm import lazyload\nfrom datetime import timedelta, datetime\nimport pandas as pd\nimpor... | ```python
import json
from models import Character, User, Draft, DraftTicket, Episode, DraftHistory, Rubric, Score
from sqlalchemy import or_, exc
from sqlalchemy.orm import lazyload
from datetime import timedelta, datetime
import pandas as pd
import numpy as np
def handle_event(msg_type, msg, db_session=None):
p... |
[
{
"content": "Reproduce the code exactly as provided (keep formatting):\n```python\n# The contents of this file has been derived code from the Twisted project\n# (http://twistedmatrix.com/). The original author is Jp Calderone.\n\n# Twisted project license follows:\n\n# Permission is hereby granted, free of cha... | [
{
"content": "Reproduce the code exactly as provided (keep formatting):\n<|memory_start|>```python\n# The contents of this file has been derived code from the Twisted project\n# (http://twistedmatrix.com/). The original author is Jp Calderone.\n\n# Twisted project license follows:\n\n# Permission is hereby gran... | ```python
# The contents of this file has been derived code from the Twisted project
# (http://twistedmatrix.com/). The original author is Jp Calderone.
# Twisted project license follows:
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation fil... |
[
{
"content": "```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# http://www.apache.org/licenses/LI... | [
{
"content": "<|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 License at\n#\n# http://www.apache... | ```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 required b... |
[
{
"content": "Repeat the code precisely as written (spacing intact):\n```python\n#! /Library/Frameworks/Python.framework/Versions/3.5/bin/python3\n# -*- coding: utf-8 -*-\n\n# 163服务器地址:\n# POP3服务器: pop.163.com\n# SMTP服务器: smtp.163.com\n# IMAP服务器: imap.163.com\n# sina服务器地址:\n# POP3服务器:pop.sina.com\n# SMTP服务器:smt... | [
{
"content": "Repeat the code precisely as written (spacing intact):\n<|memory_start|>```python\n#! /Library/Frameworks/Python.framework/Versions/3.5/bin/python3\n# -*- coding: utf-8 -*-\n\n# 163服务器地址:\n# POP3服务器: pop.163.com\n# SMTP服务器: smtp.163.com\n# IMAP服务器: imap.163.com\n# sina服务器地址:\n# POP3服务器:pop.sina.co... | ```python
#! /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
# -*- coding: utf-8 -*-
# 163服务器地址:
# POP3服务器: pop.163.com
# SMTP服务器: smtp.163.com
# IMAP服务器: imap.163.com
# sina服务器地址:
# POP3服务器:pop.sina.com
# SMTP服务器:smtp.sina.com
from email import encoders
from email.header import Header
from email.mime.... |
[
{
"content": "Provide an exact copy of the source code:\n```python\nimport time\nimport logging\nfrom autobahn.asyncio.websocket import WebSocketClientProtocol\n\nlog = logging.getLogger(__name__)\n\n\nclass STFRecordProtocol(WebSocketClientProtocol):\n img_directory = None\n address = None\n resolutio... | [
{
"content": "Provide an exact copy of the source code:\n<|memory_start|>```python\nimport time\nimport logging\nfrom autobahn.asyncio.websocket import WebSocketClientProtocol\n\nlog = logging.getLogger(__name__)\n\n\nclass STFRecordProtocol(WebSocketClientProtocol):\n img_directory = None\n address = Non... | ```python
import time
import logging
from autobahn.asyncio.websocket import WebSocketClientProtocol
log = logging.getLogger(__name__)
class STFRecordProtocol(WebSocketClientProtocol):
img_directory = None
address = None
resolution = None
def __init__(self):
super().__init__()
self.fi... |
[
{
"content": "Repeat the code exactly as the original, including blank lines:\n```python\n#! /usr/bin/env python\n\nimport rospy\nimport math\nfrom pprint import pprint\nimport numpy as np\nimport fetch_api\nfrom std_msgs.msg import String, Header, ColorRGBA, Bool\nfrom std_srvs.srv import Empty\nfrom image_geo... | [
{
"content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\n#! /usr/bin/env python\n\nimport rospy\nimport math\nfrom pprint import pprint\nimport numpy as np\nimport fetch_api\nfrom std_msgs.msg import String, Header, ColorRGBA, Bool\nfrom std_srvs.srv import Empty... | ```python
#! /usr/bin/env python
import rospy
import math
from pprint import pprint
import numpy as np
import fetch_api
from std_msgs.msg import String, Header, ColorRGBA, Bool
from std_srvs.srv import Empty
from image_geometry import PinholeCameraModel
import tf
import tf.transformations as tft
# from tf import Trans... |
[
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n```python\n\"\"\"\nDeploy this project in dev/stage/production.\n\nRequires commander_ which is installed on the systems that need it.\n\n.. _commander: https://github.com/oremj/commander\n\nThis script is supposed to work ... | [
{
"content": "Replicate the code snippet exactly, without paraphrasing or reformatting:\n<|memory_start|>```python\n\"\"\"\nDeploy this project in dev/stage/production.\n\nRequires commander_ which is installed on the systems that need it.\n\n.. _commander: https://github.com/oremj/commander\n\nThis script is s... | ```python
"""
Deploy this project in dev/stage/production.
Requires commander_ which is installed on the systems that need it.
.. _commander: https://github.com/oremj/commander
This script is supposed to work in Python 2.6.
The only outside dependency is `virtualenv-2.7`.
"""
import os
import sys
sys.path.append(o... |
[
{
"content": "Repeat the code exactly:\n```python\n#\n# Gramps - a GTK+/GNOME based genealogy program\n#\n# Copyright (C) 2016 Tom Samstag\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Found... | [
{
"content": "Repeat the code exactly:\n<|memory_start|>```python\n#\n# Gramps - a GTK+/GNOME based genealogy program\n#\n# Copyright (C) 2016 Tom Samstag\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Fre... | ```python
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2016 Tom Samstag
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your op... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\n#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\n\nimport rapidsms\nfrom models import *\n\n\nclass App(rapidsms.App):\n def parse(self, msg):\n text = msg.text\n msg.tags = []\n\n # check the contents of ... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n#!/usr/bin/env python\n# vim: ai ts=4 sts=4 et sw=4\n\n\nimport rapidsms\nfrom models import *\n\n\nclass App(rapidsms.App):\n def parse(self, msg):\n text = msg.text\n msg.tags = []\n\n # check ... | ```python
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import rapidsms
from models import *
class App(rapidsms.App):
def parse(self, msg):
text = msg.text
msg.tags = []
# check the contents of this message for EVERY SINGLE
# TAG that we know of. TODO: cache this for a litt... |
[
{
"content": "Replicate the source code:\n```python\n#!/usr/bin/env python\n\n\nimport yaml\nimport argparse\nimport os\n\n\n__author__ = \"Anoop P Alias\"\n__copyright__ = \"Copyright Anoop P Alias\"\n__license__ = \"GPL\"\n__email__ = \"anoopalias01@gmail.com\"\n\n\ninstallation_path = \"/opt/nDeploy\" # Abs... | [
{
"content": "Replicate the source code:\n<|memory_start|>```python\n#!/usr/bin/env python\n\n\nimport yaml\nimport argparse\nimport os\n\n\n__author__ = \"Anoop P Alias\"\n__copyright__ = \"Copyright Anoop P Alias\"\n__license__ = \"GPL\"\n__email__ = \"anoopalias01@gmail.com\"\n\n\ninstallation_path = \"/opt/... | ```python
#!/usr/bin/env python
import yaml
import argparse
import os
__author__ = "Anoop P Alias"
__copyright__ = "Copyright Anoop P Alias"
__license__ = "GPL"
__email__ = "anoopalias01@gmail.com"
installation_path = "/opt/nDeploy" # Absolute Installation Path
backend_config_file = installation_path+"/conf/back... |
[
{
"content": "Repeat the code exactly:\n```python\nimport numpy as np\nimport sys\nfrom jug import TaskGenerator\nfrom os.path import expanduser\nHOME = expanduser(\"~\")\nif \"storage\" in HOME:\n HOME = \"/storage/home/geffroy\"\nsys.path.append(HOME + \"/Code/PG/Source\")\nfrom phase_fluctuations import D... | [
{
"content": "Repeat the code exactly:\n<|memory_start|>```python\nimport numpy as np\nimport sys\nfrom jug import TaskGenerator\nfrom os.path import expanduser\nHOME = expanduser(\"~\")\nif \"storage\" in HOME:\n HOME = \"/storage/home/geffroy\"\nsys.path.append(HOME + \"/Code/PG/Source\")\nfrom phase_fluct... | ```python
import numpy as np
import sys
from jug import TaskGenerator
from os.path import expanduser
HOME = expanduser("~")
if "storage" in HOME:
HOME = "/storage/home/geffroy"
sys.path.append(HOME + "/Code/PG/Source")
from phase_fluctuations import DWaveModel
from MCMC import MCMCDriver
# pylint: disable=E1101
N... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\n#!/usr/bin/env python\n\nimport argparse\nimport os\nimport sys\nimport synapseclient\nimport hashlib\nimport string\n\nscript_path = os.path.dirname(__file__)\nlocal_module_path = os.path.abspath(os.path.join(script_path,'lib')... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\n#!/usr/bin/env python\n\nimport argparse\nimport os\nimport sys\nimport synapseclient\nimport hashlib\nimport string\n\nscript_path = os.path.dirname(__file__)\nlocal_module_path = os.path.abspath(os.path.join(sc... | ```python
#!/usr/bin/env python
import argparse
import os
import sys
import synapseclient
import hashlib
import string
script_path = os.path.dirname(__file__)
local_module_path = os.path.abspath(os.path.join(script_path,'lib'))
sys.path.append(local_module_path)
import s3
STATIC_BUCKET = "static.synapse.org"
def c... |
[
{
"content": "Repeat the code exactly:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\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://ww... | [
{
"content": "Repeat the code exactly:\n<|memory_start|>```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\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
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
[
{
"content": "Repeat the code exactly as the original, including blank lines:\n```python\nimport re\nfrom urlparse import urlparse, urlunsplit\n\nfrom django import forms\nfrom django.contrib import admin\n\nfrom .models import Mirror, MirrorProtocol, MirrorUrl, MirrorRsync\n\nclass MirrorUrlForm(forms.ModelFor... | [
{
"content": "Repeat the code exactly as the original, including blank lines:\n<|memory_start|>```python\nimport re\nfrom urlparse import urlparse, urlunsplit\n\nfrom django import forms\nfrom django.contrib import admin\n\nfrom .models import Mirror, MirrorProtocol, MirrorUrl, MirrorRsync\n\nclass MirrorUrlFor... | ```python
import re
from urlparse import urlparse, urlunsplit
from django import forms
from django.contrib import admin
from .models import Mirror, MirrorProtocol, MirrorUrl, MirrorRsync
class MirrorUrlForm(forms.ModelForm):
class Meta:
model = MirrorUrl
def clean_url(self):
# is this a valid... |
[
{
"content": "Repeat the following code:\n```python\nfrom core.himesis import Himesis, HimesisPreConditionPatternLHS\n\nclass HM5ThenClausePart2CompleteLHS(HimesisPreConditionPatternLHS):\n def __init__(self):\n \"\"\"\n Creates the himesis graph representing the AToM3 model HM5ThenClausePart2C... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\nfrom core.himesis import Himesis, HimesisPreConditionPatternLHS\n\nclass HM5ThenClausePart2CompleteLHS(HimesisPreConditionPatternLHS):\n def __init__(self):\n \"\"\"\n Creates the himesis graph representing the AToM3 model HM5... | ```python
from core.himesis import Himesis, HimesisPreConditionPatternLHS
class HM5ThenClausePart2CompleteLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HM5ThenClausePart2CompleteLHS.
"""
# Flag this instance as com... |
[
{
"content": "```python\n#/usr/bin/python\n# import os for the os.walk() function\n# os.walk returns a list of tuples: 3-tuple (dirpath, dirnames, filenames)\n\nimport os\nimport sys\n\ndef ParseArgs():\n Error1 = \"\"\" # USAGE #\n # filesystemWalk.py [directory]\n # filesystemWalk.py /Users/mcohoo... | [
{
"content": "<|memory_start|>```python\n#/usr/bin/python\n# import os for the os.walk() function\n# os.walk returns a list of tuples: 3-tuple (dirpath, dirnames, filenames)\n\nimport os\nimport sys\n\ndef ParseArgs():\n Error1 = \"\"\" # USAGE #\n # filesystemWalk.py [directory]\n # filesystemWalk.... | ```python
#/usr/bin/python
# import os for the os.walk() function
# os.walk returns a list of tuples: 3-tuple (dirpath, dirnames, filenames)
import os
import sys
def ParseArgs():
Error1 = """ # USAGE #
# filesystemWalk.py [directory]
# filesystemWalk.py /Users/mcohoon/Devel/PythonPractice """
if l... |
[
{
"content": "```python\n\"\"\"\nTest basic std::list functionality but with a declaration from\nthe debug info (the Foo struct) as content.\n\"\"\"\n\nfrom lldbsuite.test.decorators import *\nfrom lldbsuite.test.lldbtest import *\nfrom lldbsuite.test import lldbutil\n\n\nclass TestDbgInfoContentList(TestBase):... | [
{
"content": "<|memory_start|>```python\n\"\"\"\nTest basic std::list functionality but with a declaration from\nthe debug info (the Foo struct) as content.\n\"\"\"\n\nfrom lldbsuite.test.decorators import *\nfrom lldbsuite.test.lldbtest import *\nfrom lldbsuite.test import lldbutil\n\n\nclass TestDbgInfoConten... | ```python
"""
Test basic std::list functionality but with a declaration from
the debug info (the Foo struct) as content.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestDbgInfoContentList(TestBase):
mydir = TestBase.compute_mydir(__... |
[
{
"content": "Return the code unaltered:\n```python\n# Make coding more python3-ish\nfrom __future__ import (absolute_import, division, print_function)\n__metaclass__ = type\n\n\nfrom ansible.plugins.callback.default import (\n CallbackModule as CallbackModule_default\n)\nfrom ansible import constants as C\n... | [
{
"content": "Return the code unaltered:\n<|memory_start|>```python\n# Make coding more python3-ish\nfrom __future__ import (absolute_import, division, print_function)\n__metaclass__ = type\n\n\nfrom ansible.plugins.callback.default import (\n CallbackModule as CallbackModule_default\n)\nfrom ansible import ... | ```python
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback.default import (
CallbackModule as CallbackModule_default
)
from ansible import constants as C
"""Implementation of Custom Class that inherits the 'defaul... |
[
{
"content": "Here is the code block:\n```python\n\"\"\" Compute ternary contours using matplotlib.pyplot.contour function \"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport ternary\nimport math\nimport itertools\n\n\ndef shannon_entropy(p):\n \"\"\"Computes the Shannon Entropy at a distribu... | [
{
"content": "Here is the code block:\n<|memory_start|>```python\n\"\"\" Compute ternary contours using matplotlib.pyplot.contour function \"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport ternary\nimport math\nimport itertools\n\n\ndef shannon_entropy(p):\n \"\"\"Computes the Shannon Entro... | ```python
""" Compute ternary contours using matplotlib.pyplot.contour function """
import numpy as np
import matplotlib.pyplot as plt
import ternary
import math
import itertools
def shannon_entropy(p):
"""Computes the Shannon Entropy at a distribution in the simplex."""
s = 0.
for i in range(len(p)):
... |
[
{
"content": "Here is some code:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Tests for the family module.\"\"\"\n#\n# (C) Pywikibot team, 2014-2015\n#\n# Distributed under the terms of the MIT license.\n#\nfrom __future__ import absolute_import, unicode_literals\n\n__version__ = '$Id$'\n\nfrom pywikibot.family ... | [
{
"content": "Here is some code:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\"\"\"Tests for the family module.\"\"\"\n#\n# (C) Pywikibot team, 2014-2015\n#\n# Distributed under the terms of the MIT license.\n#\nfrom __future__ import absolute_import, unicode_literals\n\n__version__ = '$Id$'\n\nfrom p... | ```python
# -*- coding: utf-8 -*-
"""Tests for the family module."""
#
# (C) Pywikibot team, 2014-2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
from pywikibot.family import Family, SingleSiteFamily
from pywikibot.exceptions im... |
[
{
"content": "Reconstruct the code exactly:\n```python\n\"\"\"\nModule to wrap an integer in bitwise flag/field accessors.\n\"\"\"\n\nfrom collections import OrderedDict\nfrom collections.abc import Iterable\n\nfrom pcapng._compat import namedtuple\n\n\nclass FlagBase(object):\n \"\"\"\\\n Base class for ... | [
{
"content": "Reconstruct the code exactly:\n<|memory_start|>```python\n\"\"\"\nModule to wrap an integer in bitwise flag/field accessors.\n\"\"\"\n\nfrom collections import OrderedDict\nfrom collections.abc import Iterable\n\nfrom pcapng._compat import namedtuple\n\n\nclass FlagBase(object):\n \"\"\"\\\n ... | ```python
"""
Module to wrap an integer in bitwise flag/field accessors.
"""
from collections import OrderedDict
from collections.abc import Iterable
from pcapng._compat import namedtuple
class FlagBase(object):
"""\
Base class for flag types to be used in a Flags object.
Handles the bitwise math so sub... |
[
{
"content": "Reconstruct the code file line-for-line, unmodified:\n```python\n#<ImportSpecificModules>\nimport operator\n,Doer,Representer\nfrom ShareYourSystem.Functers import Functer,Triggerer,Hooker\nBaseModuleStr=\"ShareYourSystem.Functers.Functer\"\nDecorationModuleStr=\"ShareYourSystem.Standards.Classors... | [
{
"content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n#<ImportSpecificModules>\nimport operator\n,Doer,Representer\nfrom ShareYourSystem.Functers import Functer,Triggerer,Hooker\nBaseModuleStr=\"ShareYourSystem.Functers.Functer\"\nDecorationModuleStr=\"ShareYourSystem.St... | ```python
#<ImportSpecificModules>
import operator
,Doer,Representer
from ShareYourSystem.Functers import Functer,Triggerer,Hooker
BaseModuleStr="ShareYourSystem.Functers.Functer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer")
#</ImportSpecificModules>
#<DefineLocals>
SYS.setSubModule(globals())
Sw... |
[
{
"content": "Here is a code file:\n```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2016 NORDUnet A/S\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or\n# without modification, are permitted provided that the following\n# conditions are met:\n#\n# 1. Redis... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2016 NORDUnet A/S\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or\n# without modification, are permitted provided that the following\n# conditions are met:\n#... | ```python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyri... |
[
{
"content": "Repeat the code precisely:\n```python\nimport re\nfrom collections import OrderedDict\nfrom django.urls import reverse, resolve, NoReverseMatch\nfrom django.conf import settings\nfrom django.http import HttpResponseRedirect\n\nfrom ct.models import Course, CourseUnit, UnitLesson, Response\nfrom ct... | [
{
"content": "Repeat the code precisely:\n<|memory_start|>```python\nimport re\nfrom collections import OrderedDict\nfrom django.urls import reverse, resolve, NoReverseMatch\nfrom django.conf import settings\nfrom django.http import HttpResponseRedirect\n\nfrom ct.models import Course, CourseUnit, UnitLesson, R... | ```python
import re
from collections import OrderedDict
from django.urls import reverse, resolve, NoReverseMatch
from django.conf import settings
from django.http import HttpResponseRedirect
from ct.models import Course, CourseUnit, UnitLesson, Response
from ctms.urls import urlpatterns as ctms_urls
from .views import... |
[
{
"content": "```python\nimport json\nimport re\n\nfrom django import http\nfrom django.db.models import Count\nfrom django.shortcuts import redirect, render\nfrom django.views.decorators.csrf import csrf_exempt\n\nfrom tower import ugettext as _\n\nimport amo\nimport amo.utils\nfrom addons.decorators import ow... | [
{
"content": "<|memory_start|>```python\nimport json\nimport re\n\nfrom django import http\nfrom django.db.models import Count\nfrom django.shortcuts import redirect, render\nfrom django.views.decorators.csrf import csrf_exempt\n\nfrom tower import ugettext as _\n\nimport amo\nimport amo.utils\nfrom addons.deco... | ```python
import json
import re
from django import http
from django.db.models import Count
from django.shortcuts import redirect, render
from django.views.decorators.csrf import csrf_exempt
from tower import ugettext as _
import amo
import amo.utils
from addons.decorators import owner_or_unlisted_reviewer
from amo.d... |
[
{
"content": "Return the code exactly, with no changes:\n```python\nfrom __future__ import print_function\nfrom show3d_balls import *\nimport argparse\nimport os\nimport random\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.... | [
{
"content": "Return the code exactly, with no changes:\n<|memory_start|>```python\nfrom __future__ import print_function\nfrom show3d_balls import *\nimport argparse\nimport os\nimport random\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudn... | ```python
from __future__ import print_function
from show3d_balls import *
import argparse
import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
i... |
[
{
"content": "Here is a code file:\n```python\n# -*- coding: utf-8 -*-\n\n# renderer-console\n#\n# Copyright (C) 2012 Intel Corporation. All rights reserved.\n#\n# This program is free software; you can redistribute it and/or modify it\n# under the terms and conditions of the GNU Lesser General Public License,\... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n\n# renderer-console\n#\n# Copyright (C) 2012 Intel Corporation. All rights reserved.\n#\n# This program is free software; you can redistribute it and/or modify it\n# under the terms and conditions of the GNU Lesser General ... | ```python
# -*- coding: utf-8 -*-
# renderer-console
#
# Copyright (C) 2012 Intel Corporation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Fou... |
[
{
"content": "```python\n#!/usr/bin/env python\n\n\nfrom __future__ import unicode_literals, print_function\n\nimport logging\nimport os\nfrom StringIO import StringIO\nfrom logging.handlers import RotatingFileHandler\n\nimport cv2\nfrom PIL import Image\nfrom flask import Flask, make_response, request, send_fr... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/env python\n\n\nfrom __future__ import unicode_literals, print_function\n\nimport logging\nimport os\nfrom StringIO import StringIO\nfrom logging.handlers import RotatingFileHandler\n\nimport cv2\nfrom PIL import Image\nfrom flask import Flask, make_response, ... | ```python
#!/usr/bin/env python
from __future__ import unicode_literals, print_function
import logging
import os
from StringIO import StringIO
from logging.handlers import RotatingFileHandler
import cv2
from PIL import Image
from flask import Flask, make_response, request, send_from_directory, jsonify, render_templ... |
[
{
"content": "Reconstruct the code file line-for-line, unmodified:\n```python\n#!/usr/bin/env python3\n\"\"\"\nRecursively link all files.\n\"\"\"\n\nimport argparse\nimport glob\nimport os\nimport signal\nimport sys\nfrom typing import List\n\nimport file_mod\n\n\nclass Options:\n \"\"\"\n Options class\... | [
{
"content": "Reconstruct the code file line-for-line, unmodified:\n<|memory_start|>```python\n#!/usr/bin/env python3\n\"\"\"\nRecursively link all files.\n\"\"\"\n\nimport argparse\nimport glob\nimport os\nimport signal\nimport sys\nfrom typing import List\n\nimport file_mod\n\n\nclass Options:\n \"\"\"\n ... | ```python
#!/usr/bin/env python3
"""
Recursively link all files.
"""
import argparse
import glob
import os
import signal
import sys
from typing import List
import file_mod
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespace = None
self.par... |
[
{
"content": "Provide a verbatim copy of the code:\n```python\nimport datetime\nimport pathlib\nimport re\n\nimport packaging.version\nimport requests\nimport tabulate\n\nFILE_HEAD = r\"\"\"Plugins List\n============\n\nPyPI projects that match \"pytest-\\*\" are considered plugins and are listed\nautomatically... | [
{
"content": "Provide a verbatim copy of the code:\n<|memory_start|>```python\nimport datetime\nimport pathlib\nimport re\n\nimport packaging.version\nimport requests\nimport tabulate\n\nFILE_HEAD = r\"\"\"Plugins List\n============\n\nPyPI projects that match \"pytest-\\*\" are considered plugins and are liste... | ```python
import datetime
import pathlib
import re
import packaging.version
import requests
import tabulate
FILE_HEAD = r"""Plugins List
============
PyPI projects that match "pytest-\*" are considered plugins and are listed
automatically. Packages classified as inactive are excluded.
"""
DEVELOPMENT_STATUS_CLASSIFI... |
[
{
"content": "```python\nimport json\nimport math\nimport os\nimport sys\n\nBASE_DIR = os.getcwd()\nsys.path.append(BASE_DIR)\nfrom .honey_enc import DTE, DTE_random\nfrom pcfg.pcfg import TrainedGrammar\nimport honeyvault_config as hny_config\nfrom Crypto.Cipher import AES\nfrom Crypto.Hash import SHA256\nfrom... | [
{
"content": "<|memory_start|>```python\nimport json\nimport math\nimport os\nimport sys\n\nBASE_DIR = os.getcwd()\nsys.path.append(BASE_DIR)\nfrom .honey_enc import DTE, DTE_random\nfrom pcfg.pcfg import TrainedGrammar\nimport honeyvault_config as hny_config\nfrom Crypto.Cipher import AES\nfrom Crypto.Hash imp... | ```python
import json
import math
import os
import sys
BASE_DIR = os.getcwd()
sys.path.append(BASE_DIR)
from .honey_enc import DTE, DTE_random
from pcfg.pcfg import TrainedGrammar
import honeyvault_config as hny_config
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
from Crypto.Protocol.KDF import PBKDF1
... |
[
{
"content": "Here is the snippet:\n```python\n# coding: utf-8\n\n\"\"\"\n Wavefront REST API\n\n <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.... | [
{
"content": "Here is the snippet:\n<|memory_start|>```python\n# coding: utf-8\n\n\"\"\"\n Wavefront REST API\n\n <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically ... | ```python
# coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavef... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\n# -*- coding: utf-8 -*-\nfrom flask_wtf import Form\nfrom wtforms import TextField, SelectField, SelectMultipleField, widgets\nfrom wtforms.validators import DataRequired\n\nimport json\nimport os\n\nclass MultiCheckboxField(SelectMult... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\nfrom flask_wtf import Form\nfrom wtforms import TextField, SelectField, SelectMultipleField, widgets\nfrom wtforms.validators import DataRequired\n\nimport json\nimport os\n\nclass MultiCheckbox... | ```python
# -*- coding: utf-8 -*-
from flask_wtf import Form
from wtforms import TextField, SelectField, SelectMultipleField, widgets
from wtforms.validators import DataRequired
import json
import os
class MultiCheckboxField(SelectMultipleField):
widget = widgets.ListWidget(prefix_label=False)
option_widget =... |
[
{
"content": "Here is the snippet:\n```python\n# -*- coding: utf-8 -*-\n# Copyright 2021 Green Valley NV\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apa... | [
{
"content": "Here is the snippet:\n<|memory_start|>```python\n# -*- coding: utf-8 -*-\n# Copyright 2021 Green Valley NV\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | ```python
# -*- coding: utf-8 -*-
# Copyright 2021 Green Valley NV
#
# 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 ap... |
[
{
"content": "```python\nimport controller.component\nfrom util import jsonmanager, debug, configuration\nfrom view.entity import Entity\n\n\nclass Scene:\n def __init__(self, name, entities_data):\n self.name = name\n self.entities = []\n self.started_entities = []\n self.event_i... | [
{
"content": "<|memory_start|>```python\nimport controller.component\nfrom util import jsonmanager, debug, configuration\nfrom view.entity import Entity\n\n\nclass Scene:\n def __init__(self, name, entities_data):\n self.name = name\n self.entities = []\n self.started_entities = []\n ... | ```python
import controller.component
from util import jsonmanager, debug, configuration
from view.entity import Entity
class Scene:
def __init__(self, name, entities_data):
self.name = name
self.entities = []
self.started_entities = []
self.event_input = None
self.cont_inp... |
[
{
"content": "Repeat the following code:\n```python\nimport numpy as np\nimport networkx as nx\nimport math\nimport random\n\n\ndef convert(something):#use networkx conversion from numpy array\n #g = nx.from_numpy_matrix(someNPMat)\n g = nx.to_networkx_graph(something)\n return g\n\ndef deleteSelfLoops... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\nimport numpy as np\nimport networkx as nx\nimport math\nimport random\n\n\ndef convert(something):#use networkx conversion from numpy array\n #g = nx.from_numpy_matrix(someNPMat)\n g = nx.to_networkx_graph(something)\n return g\n\ndef... | ```python
import numpy as np
import networkx as nx
import math
import random
def convert(something):#use networkx conversion from numpy array
#g = nx.from_numpy_matrix(someNPMat)
g = nx.to_networkx_graph(something)
return g
def deleteSelfLoops(graph, nNodes): #used to take away self loops in final graph ... |
[
{
"content": "Here is the code block:\n```python\n#------------------------------------------------------------------------------\n# Copyright (c) 2009 Richard W. Lincoln\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files ... | [
{
"content": "Here is the code block:\n<|memory_start|>```python\n#------------------------------------------------------------------------------\n# Copyright (c) 2009 Richard W. Lincoln\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated docu... | ```python
#------------------------------------------------------------------------------
# Copyright (c) 2009 Richard W. 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... |
[
{
"content": "Here is some code:\n```python\nimport json\n# Descarga esta librería con el comando 'pip install json2html'\nfrom json2html import *\n\nclass Usuario(object):\n #si ya tenemos definidos nuestros atributos no es necesario pedir con **args\n def __init__(self, nombre,edad,direccion):\n ... | [
{
"content": "Here is some code:\n<|memory_start|>```python\nimport json\n# Descarga esta librería con el comando 'pip install json2html'\nfrom json2html import *\n\nclass Usuario(object):\n #si ya tenemos definidos nuestros atributos no es necesario pedir con **args\n def __init__(self, nombre,edad,direc... | ```python
import json
# Descarga esta librería con el comando 'pip install json2html'
from json2html import *
class Usuario(object):
#si ya tenemos definidos nuestros atributos no es necesario pedir con **args
def __init__(self, nombre,edad,direccion):
self.nombre = nombre
self.edad = edad
... |
[
{
"content": "Recreate the entire code block with identical formatting:\n```python\nfrom Coordinate import Coordinate as C\nfrom Move import Move\n\nWHITE = True\nBLACK = False\nX = 0\nY = 1\n\n\nclass Piece:\n\n def __init__(self, board, side, position, movesMade=0):\n self.board = board\n sel... | [
{
"content": "Recreate the entire code block with identical formatting:\n<|memory_start|>```python\nfrom Coordinate import Coordinate as C\nfrom Move import Move\n\nWHITE = True\nBLACK = False\nX = 0\nY = 1\n\n\nclass Piece:\n\n def __init__(self, board, side, position, movesMade=0):\n self.board = bo... | ```python
from Coordinate import Coordinate as C
from Move import Move
WHITE = True
BLACK = False
X = 0
Y = 1
class Piece:
def __init__(self, board, side, position, movesMade=0):
self.board = board
self.side = side
self.position = position
self.movesMade = 0
def __str__(self... |
[
{
"content": "Here is the snippet:\n```python\n# Copyright 2019-2020 by Christopher C. Little.\n# This file is part of Abydos.\n#\n# Abydos is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either vers... | [
{
"content": "Here is the snippet:\n<|memory_start|>```python\n# Copyright 2019-2020 by Christopher C. Little.\n# This file is part of Abydos.\n#\n# Abydos is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundat... | ```python
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any la... |
[
{
"content": "Repeat the following code:\n```python\n# (C) Datadog, Inc. 2020-present\n# All rights reserved\n# Licensed under a 3-clause BSD style license (see LICENSE)\nfrom typing import Any\n\nimport pytest\n\nfrom datadog_checks.base.stubs.aggregator import AggregatorStub\n\nfrom .common import CHECK_CONFI... | [
{
"content": "Repeat the following code:\n<|memory_start|>```python\n# (C) Datadog, Inc. 2020-present\n# All rights reserved\n# Licensed under a 3-clause BSD style license (see LICENSE)\nfrom typing import Any\n\nimport pytest\n\nfrom datadog_checks.base.stubs.aggregator import AggregatorStub\n\nfrom .common im... | ```python
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from typing import Any
import pytest
from datadog_checks.base.stubs.aggregator import AggregatorStub
from .common import CHECK_CONFIG
from .metrics import ALWAYS_PRESENT_METRICS, NOT_ALWAYS_PR... |
[
{
"content": "```python\n#!/usr/bin/env python\n\n\"\"\"\nConverts PDF text content (though not images containing text) to plain text, html, xml or \"tags\".\n\"\"\"\nimport sys\nimport logging\nimport six\nimport pdfminer.settings\npdfminer.settings.STRICT = False\nimport pdfminer.high_level\nimport pdfminer.l... | [
{
"content": "<|memory_start|>```python\n#!/usr/bin/env python\n\n\"\"\"\nConverts PDF text content (though not images containing text) to plain text, html, xml or \"tags\".\n\"\"\"\nimport sys\nimport logging\nimport six\nimport pdfminer.settings\npdfminer.settings.STRICT = False\nimport pdfminer.high_level\ni... | ```python
#!/usr/bin/env python
"""
Converts PDF text content (though not images containing text) to plain text, html, xml or "tags".
"""
import sys
import logging
import six
import pdfminer.settings
pdfminer.settings.STRICT = False
import pdfminer.high_level
import pdfminer.layout
from pdfminer.image import ImageWrit... |
[
{
"content": "Here is a code file:\n```python\n\"\"\"This script contains set of functions that test parallel optimization with\nskopt, where constant liar parallelization strategy is used.\n\"\"\"\n\n\nfrom numpy.testing import assert_equal\nfrom numpy.testing import assert_raises\n\nfrom skopt.space import Re... | [
{
"content": "Here is a code file:\n<|memory_start|>```python\n\"\"\"This script contains set of functions that test parallel optimization with\nskopt, where constant liar parallelization strategy is used.\n\"\"\"\n\n\nfrom numpy.testing import assert_equal\nfrom numpy.testing import assert_raises\n\nfrom skopt... | ```python
"""This script contains set of functions that test parallel optimization with
skopt, where constant liar parallelization strategy is used.
"""
from numpy.testing import assert_equal
from numpy.testing import assert_raises
from skopt.space import Real
from skopt import Optimizer
from skopt.benchmarks import... |
[
{
"content": "Repeat the code precisely:\n```python\nfrom vsvlandb.models import Site, Subnet, Impact\n\nfrom flask.ext.wtf import Form\n\nfrom wtforms import TextField, SelectField, BooleanField, IntegerField\nfrom wtforms.validators import DataRequired, NumberRange, Optional, Length\n\nfrom wtforms.ext.sqlalc... | [
{
"content": "Repeat the code precisely:\n<|memory_start|>```python\nfrom vsvlandb.models import Site, Subnet, Impact\n\nfrom flask.ext.wtf import Form\n\nfrom wtforms import TextField, SelectField, BooleanField, IntegerField\nfrom wtforms.validators import DataRequired, NumberRange, Optional, Length\n\nfrom wt... | ```python
from vsvlandb.models import Site, Subnet, Impact
from flask.ext.wtf import Form
from wtforms import TextField, SelectField, BooleanField, IntegerField
from wtforms.validators import DataRequired, NumberRange, Optional, Length
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField, QuerySelectFi... |
[
{
"content": "Repeat the full code snippet:\n```python\n# Copyright 2016 Mirantis, Inc.\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.apac... | [
{
"content": "Repeat the full code snippet:\n<|memory_start|>```python\n# Copyright 2016 Mirantis, Inc.\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
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
[
{
"content": "Output the full code verbatim (no extra comments):\n```python\n\"\"\"\r\nWSGI config for scheduler_site project.\r\n\r\nThis module contains the WSGI application used by Django's development server\r\nand any production WSGI deployments. It should expose a module-level variable\r\nnamed ``applicat... | [
{
"content": "Output the full code verbatim (no extra comments):\n<|memory_start|>```python\n\"\"\"\r\nWSGI config for scheduler_site project.\r\n\r\nThis module contains the WSGI application used by Django's development server\r\nand any production WSGI deployments. It should expose a module-level variable\r\n... | ```python
"""
WSGI config for scheduler_site project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via th... |
[
{
"content": "Produce an exact reconstruction of the code:\n```python\n# Django settings for hackeragenda project.\n\nimport os\n\nfrom collections import OrderedDict\n\nPROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])\nSUBPROJECT_PATH = os.path.split(PROJECT_PATH)[0]\n\nBASE_DIR = PROJECT_PATH # to ... | [
{
"content": "Produce an exact reconstruction of the code:\n<|memory_start|>```python\n# Django settings for hackeragenda project.\n\nimport os\n\nfrom collections import OrderedDict\n\nPROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])\nSUBPROJECT_PATH = os.path.split(PROJECT_PATH)[0]\n\nBASE_DIR = PRO... | ```python
# Django settings for hackeragenda project.
import os
from collections import OrderedDict
PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])
SUBPROJECT_PATH = os.path.split(PROJECT_PATH)[0]
BASE_DIR = PROJECT_PATH # to avoid stupid warning from django 1.6
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADM... |
[
{
"content": "```python\nfrom django.conf import settings\nfrom django.core.cache import cache\nfrom django.utils.cache import get_cache_key, learn_cache_key, patch_response_headers\n\nclass CacheMiddleware(object):\n \"\"\"\n Cache middleware. If this is enabled, each Django-powered page will be\n cac... | [
{
"content": "<|memory_start|>```python\nfrom django.conf import settings\nfrom django.core.cache import cache\nfrom django.utils.cache import get_cache_key, learn_cache_key, patch_response_headers\n\nclass CacheMiddleware(object):\n \"\"\"\n Cache middleware. If this is enabled, each Django-powered page ... | ```python
from django.conf import settings
from django.core.cache import cache
from django.utils.cache import get_cache_key, learn_cache_key, patch_response_headers
class CacheMiddleware(object):
"""
Cache middleware. If this is enabled, each Django-powered page will be
cached for CACHE_MIDDLEWARE_SECONDS ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.