code
stringlengths
9
256k
<s> import shelve <EOL> from zope . interface import implements <EOL> from repoze . who . interfaces import IMetadataProvider <EOL> class EntitlementMetadataProvider ( object ) : <EOL> implements ( IMetadataProvider ) <EOL> def __init__ ( self , filename , key_attribute ) : <EOL> self . _store = shelve . open ( filenam...
<s> __author__ = '<STR_LIT>' <EOL> import copy <EOL> import sys <EOL> import os <EOL> import re <EOL> import logging <EOL> import logging . handlers <EOL> from importlib import import_module <EOL> from saml2 import root_logger , BINDING_URI , SAMLError <EOL> from saml2 import BINDING_SOAP <EOL> from saml2 import BINDIN...
<s> import saml2 <EOL> from saml2 import SamlBase <EOL> from saml2 import md <EOL> NAMESPACE = '<STR_LIT>' <EOL> class DisplayName ( md . LocalizedNameType_ ) : <EOL> """<STR_LIT>""" <EOL> c_tag = '<STR_LIT>' <EOL> c_namespace = NAMESPACE <EOL> c_children = md . LocalizedNameType_ . c_children . copy ( ) <EOL> c_attrib...
<s> """<STR_LIT>""" <EOL> import calendar <EOL> import re <EOL> import time <EOL> import sys <EOL> from datetime import timedelta <EOL> from datetime import datetime <EOL> TIME_FORMAT = "<STR_LIT>" <EOL> TIME_FORMAT_WITH_FRAGMENT = re . compile ( <EOL> "<STR_LIT>" ) <EOL> def f_quotient ( arg0 , arg1 , arg2 = <NUM_LIT:...
<s> from pysqlite2 import dbapi2 as sqlite3 <EOL> con = sqlite3 . connect ( "<STR_LIT>" ) <EOL> cur = con . cursor ( ) <EOL> who = "<STR_LIT>" <EOL> age = <NUM_LIT> <EOL> cur . execute ( "<STR_LIT>" , ( who , age ) ) <EOL> print cur . fetchone ( ) </s>
<s> """<STR_LIT>""" <EOL> import sys , ldap <EOL> ldap . set_option ( ldap . OPT_DEBUG_LEVEL , <NUM_LIT:0> ) <EOL> ldapmodule_trace_level = <NUM_LIT:1> <EOL> ldapmodule_trace_file = sys . stderr <EOL> CACERTFILE = '<STR_LIT>' <EOL> ldap . set_option ( ldap . OPT_X_TLS_REQUIRE_CERT , ldap . OPT_X_TLS_DEMAND ) <EOL> ldap...
<s> """<STR_LIT>""" <EOL> import ldap <EOL> from ldap import __version__ <EOL> class ResultProcessor : <EOL> """<STR_LIT>""" <EOL> def allresults ( self , msgid , timeout = - <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> result_type , result_list , result_msgid , result_serverctrls = self . result3 ( msgid , <NUM_LIT:0> ...
<s> import _saslwrapper <EOL> import new <EOL> new_instancemethod = new . instancemethod <EOL> try : <EOL> _swig_property = property <EOL> except NameError : <EOL> pass <EOL> def _swig_setattr_nondynamic ( self , class_type , name , value , static = <NUM_LIT:1> ) : <EOL> if ( name == "<STR_LIT>" ) : return self . this ...
<s> """<STR_LIT>""" <EOL> from . import _csv as csv <EOL> from . import _json as json <EOL> from . import _yaml as yaml <EOL> from . import _tsv as tsv <EOL> from . import _html as html <EOL> from . import _ods as ods <EOL> available = ( json , yaml , csv , tsv , html , ods ) </s>
<s> import sys , zipfile , xml . dom . minidom <EOL> from namespaces import nsdict <EOL> from elementtypes import * <EOL> IGNORED_TAGS = [ <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] + [ nsdict [ item [ <NUM_LIT:0> ] ]...
<s> __doc__ = """<STR_LIT>""" <EOL> from namespaces import * <EOL> allowed_children = { <EOL> ( DCNS , u'<STR_LIT>' ) : ( <EOL> ) , <EOL> ( DCNS , u'<STR_LIT:date>' ) : ( <EOL> ) , <EOL> ( DCNS , u'<STR_LIT:description>' ) : ( <EOL> ) , <EOL> ( DCNS , u'<STR_LIT>' ) : ( <EOL> ) , <EOL> ( DCNS , u'<STR_LIT>' ) : ( <EOL>...
<s> import sys <EOL> class TType : <EOL> STOP = <NUM_LIT:0> <EOL> VOID = <NUM_LIT:1> <EOL> BOOL = <NUM_LIT:2> <EOL> BYTE = <NUM_LIT:3> <EOL> I08 = <NUM_LIT:3> <EOL> DOUBLE = <NUM_LIT:4> <EOL> I16 = <NUM_LIT:6> <EOL> I32 = <NUM_LIT:8> <EOL> I64 = <NUM_LIT:10> <EOL> STRING = <NUM_LIT:11> <EOL> UTF7 = <NUM_LIT:11> <EOL> S...
<s> from django . contrib import admin <EOL> from desktop . models import Document , DocumentPermission , DocumentTag <EOL> admin . site . register ( Document ) <EOL> admin . site . register ( DocumentPermission ) <EOL> admin . site . register ( DocumentTag ) </s>
<s> import configobj <EOL> from cStringIO import StringIO <EOL> import logging <EOL> import re <EOL> from desktop . lib . conf import * <EOL> from nose . tools import assert_true , assert_false , assert_equals , assert_raises <EOL> def my_dynamic_default ( ) : <EOL> """<STR_LIT>""" <EOL> return <NUM_LIT:3> + <NUM_LIT:4...
<s> from django . conf . urls import url <EOL> from desktop . lib . metrics import views <EOL> urlpatterns = [ <EOL> url ( r'<STR_LIT>' , views . index , name = '<STR_LIT:index>' ) , <EOL> ] </s>
<s> """<STR_LIT>""" <EOL> import logging , collections <EOL> class FixedBuffer ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , maxsize = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> self . buffer = collections . deque ( ) <EOL> self . maxsize = maxsize <EOL> self . size = <NUM_LIT:0> <EOL> def insert ( self...
<s> import logging <EOL> import datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import connection , models <EOL> from desktop . models import Document <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ...
<s> from __future__ import absolute_import <EOL> import logging <EOL> import re <EOL> import desktop . monkey_patches <EOL> import desktop . lib . metrics . file_reporter <EOL> desktop . lib . metrics . file_reporter . start_file_reporter ( ) <EOL> from django . conf import settings <EOL> from django . conf . urls impo...
<s> import sys <EOL> sys . path . append ( "<STR_LIT>" ) <EOL> from thrift . transport import TSocket <EOL> from thrift . transport import TTransport <EOL> from thrift . protocol import TBinaryProtocol <EOL> host = "<STR_LIT:localhost>" <EOL> port = <NUM_LIT> <EOL> from hadoop . api import Jobtracker <EOL> from hadoop ...
<s> import logging <EOL> import threading <EOL> import time <EOL> import urlparse <EOL> import heapq <EOL> from desktop . lib . rest . http_client import HttpClient <EOL> from hadoop import cluster <EOL> LOG = logging . getLogger ( __name__ ) <EOL> MAX_HEAP_SIZE = <NUM_LIT:20> <EOL> _log_client_heap = [ ] <EOL> _log_cl...
<s> from django . conf . urls import patterns , url <EOL> urlpatterns = patterns ( <EOL> '<STR_LIT>' , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' , name = '<STR_LIT>' ) , <EOL> ) </s>
<s> from django . utils . translation import ugettext_lazy as _t , ugettext as _ <EOL> from desktop . lib . conf import Config , UnspecifiedConfigSection , ConfigSection , coerce_json_dict , coerce_password_from_script <EOL> from desktop . conf import coerce_database <EOL> DATABASES = UnspecifiedConfigSection ( <EOL> k...
<s> import os <EOL> import sys <EOL> sys . path . append ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ) </s>
<s> import logging <EOL> import json <EOL> from nose . plugins . skip import SkipTest <EOL> from nose . tools import assert_equal , assert_true <EOL> from django . contrib . auth . models import User <EOL> from django . core . urlresolvers import reverse <EOL> from hadoop . pseudo_hdfs4 import is_live_cluster <EOL> fro...
<s> from django . conf . urls import patterns , url <EOL> import notebook . monkey_patches <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' , name = '<STR_LIT:index>' ) , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' , name = '<...
<s> import operator <EOL> import six <EOL> from ibis . expr . types import TableColumn <EOL> from ibis . compat import py_string <EOL> from ibis . expr . datatypes import HasSchema , Schema <EOL> from ibis . expr . rules import value , string , number , integer , boolean , list_of <EOL> from ibis . expr . types import ...
<s> impala_identifiers = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT:all>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<S...
<s> import ibis <EOL> from ibis . impala . compiler import build_ast , to_sql <EOL> from ibis import impala <EOL> from ibis . expr . tests . mocks import MockConnection <EOL> from ibis . compat import unittest <EOL> import ibis . common as com <EOL> import ibis . expr . api as api <EOL> import ibis . expr . operations ...
<s> from __future__ import absolute_import <EOL> from pytest import raises <EOL> from impala . interface import _bind_parameters <EOL> from impala . dbapi import ProgrammingError <EOL> def dt ( expected , query , params ) : <EOL> result = _bind_parameters ( query , params ) <EOL> assert expected == result <EOL> def tes...
<s> from flask . ext . restful import fields <EOL> from flask_restful_swagger import swagger <EOL> @ swagger . model <EOL> class BlueprintState ( object ) : <EOL> resource_fields = { <EOL> '<STR_LIT:id>' : fields . String , <EOL> '<STR_LIT>' : fields . Raw , <EOL> '<STR_LIT>' : fields . String , <EOL> '<STR_LIT>' : fie...
<s> from nose . plugins . attrib import attr <EOL> from manager_rest . test import base_test <EOL> from manager_rest . resources_v2 import Events <EOL> from manager_rest . manager_elasticsearch import ManagerElasticsearch <EOL> @ attr ( client_min_version = <NUM_LIT:2> , client_max_version = base_test . LATEST_API_VERS...
<s> import abc <EOL> class AgentInstaller ( object ) : <EOL> __metaclass__ = abc . ABCMeta <EOL> def __init__ ( self , cloudify_agent ) : <EOL> self . cloudify_agent = cloudify_agent <EOL> @ property <EOL> def agent_name ( self ) : <EOL> return self . cloudify_agent [ '<STR_LIT:name>' ] <EOL> @ property <EOL> def agent...
<s> import os <EOL> import testenv <EOL> from cloudify . utils import id_generator <EOL> from testenv . constants import TOP_LEVEL_DIR <EOL> from testenv import TestEnvironment <EOL> """<STR_LIT>""" <EOL> def setup_package ( ) : <EOL> unique_name = '<STR_LIT>' . format ( id_generator ( <NUM_LIT:4> ) ) <EOL> test_workin...
<s> import uuid <EOL> from cloudify_rest_client . executions import Execution <EOL> from testenv import TestCase <EOL> from testenv . utils import get_resource as resource <EOL> from testenv . utils import deploy_and_execute_workflow as deploy <EOL> from testenv . utils import delete_provider_context <EOL> from testenv...
<s> from functools import wraps <EOL> import json <EOL> import os <EOL> import sys <EOL> from IPy import IP <EOL> from cinderclient . v1 import client as cinder_client <EOL> from cinderclient import exceptions as cinder_exceptions <EOL> import keystoneclient . v3 . client as keystone_client <EOL> import neutronclient ....
<s> from __future__ import with_statement <EOL> import logging <EOL> import logger <EOL> import os <EOL> import contextlib <EOL> import shutil <EOL> import time <EOL> import errno <EOL> import sys <EOL> from functools import wraps <EOL> import platform <EOL> import codes <EOL> SUPPORTED_DISTROS = ( '<STR_LIT>' , '<STR_...
<s> """<STR_LIT>""" <EOL> import base64 <EOL> import socket <EOL> from xml . etree import ElementTree as ET <EOL> from xml . parsers . expat import ExpatError <EOL> from libcloud . common . base import ConnectionUserAndKey , ConnectionKey , Response <EOL> from libcloud . compute . types import NodeState , Provider , In...
<s> """<STR_LIT>""" <EOL> import httplib <EOL> import os <EOL> import re <EOL> import socket <EOL> import ssl <EOL> import warnings <EOL> import libcloud . security <EOL> class LibcloudHTTPSConnection ( httplib . HTTPSConnection ) : <EOL> """<STR_LIT>""" <EOL> verify = False <EOL> ca_cert = None <EOL> def __init__ ( se...
<s> import httplib <EOL> import unittest <EOL> import sys <EOL> from xml . etree import ElementTree as ET <EOL> import xmlrpclib <EOL> from libcloud . compute . drivers . softlayer import SoftLayerNodeDriver as SoftLayer <EOL> from libcloud . compute . types import NodeState <EOL> from test import MockHttp <EOL> from t...
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import errno <EOL> import subprocess <EOL> import tempfile <EOL> from esky . sudo import sudo_base as base <EOL> import esky . slaveproc <EOL> def has_root ( ) : <EOL> """<STR_LIT>""" <EOL> return ( os . geteuid ( ) == <NUM_LIT:0> ) <EOL> def can_get_root ( ) :...
<s> import json <EOL> import warnings <EOL> from . import AWSHelperFn , AWSProperty , awsencode <EOL> Allow = "<STR_LIT>" <EOL> Deny = "<STR_LIT>" <EOL> Everybody = "<STR_LIT:*>" <EOL> CurrentTime = "<STR_LIT>" <EOL> EpochTime = "<STR_LIT>" <EOL> MultiFactorAuthAge = "<STR_LIT>" <EOL> Referer = "<STR_LIT>" <EOL> Secure...
<s> from aws import Action <EOL> service_name = '<STR_LIT>' <EOL> prefix = '<STR_LIT>' <EOL> PutEvents = Action ( prefix , '<STR_LIT>' ) <EOL> GetReports = Action ( prefix , '<STR_LIT>' ) <EOL> GetFinancialReports = Action ( prefix , '<STR_LIT>' ) </s>
<s> import sys , os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( '<STR_LIT:.>' ) ) <EOL> extensions = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> templates_path = [ '<STR_LIT>' ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EO...
<s> import logging <EOL> from nymms . resources import load_resource , Node <EOL> from nymms . registry import DuplicateEntryError <EOL> logger = logging . getLogger ( __name__ ) <EOL> class Backend ( object ) : <EOL> def _load_nodes ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def load_nodes ...
<s> from troposphere import GetAtt , Join , Output <EOL> from troposphere import Parameter , Ref , Template <EOL> from troposphere . cloudfront import Distribution , DistributionConfig <EOL> from troposphere . cloudfront import Origin , DefaultCacheBehavior <EOL> from troposphere . cloudfront import ForwardedValues <EO...
<s> from troposphere import GetAtt , Join , Output , Parameter , Ref , Template <EOL> from troposphere . ec2 import SecurityGroup <EOL> from troposphere . rds import DBInstance , DBSubnetGroup <EOL> t = Template ( ) <EOL> t . add_description ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL...
<s> import unittest <EOL> import troposphere . rds as rds <EOL> from troposphere import If , Parameter , Ref <EOL> class TestRDS ( unittest . TestCase ) : <EOL> def test_it_allows_an_rds_instance_created_from_a_snapshot ( self ) : <EOL> rds_instance = rds . DBInstance ( <EOL> '<STR_LIT>' , <EOL> AllocatedStorage = <NUM...
<s> from . import AWSProperty , AWSObject <EOL> from . validators import boolean , integer , integer_range , positive_integer <EOL> VALID_VOLUME_TYPES = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> try : <EOL> from awacs . aws import Policy <EOL> policytypes = ( dict , Policy ) <EOL> except ImportError : <EOL> pol...
<s> class CrawlError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class CrawlTimeoutError ( CrawlError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class ContainerInvalidEnvironment ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class AlchemyInvalidMetadata ( ContainerInvalidEnvironment ) : <EOL> """<ST...
<s> import os <EOL> import sys <EOL> from optparse import make_option <EOL> from subprocess import Popen , call , PIPE <EOL> from tempfile import TemporaryFile <EOL> from django . core . management . base import BaseCommand <EOL> from django . conf import settings <EOL> try : <EOL> domains = settings . STANDALONE_DOMAI...
<s> from __future__ import print_function <EOL> import datetime <EOL> import os <EOL> import threading <EOL> import time <EOL> class Watcher ( object ) : <EOL> def __init__ ( self , files = None , cmds = None , verbose = False , clear = False ) : <EOL> self . files = [ ] <EOL> self . cmds = [ ] <EOL> self . num_runs = ...
<s> '''<STR_LIT>''' <EOL> import logger as logger <EOL> import types <EOL> class Sender ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . listeners = { } <EOL> self . logger = logger . getLogger ( ) <EOL> def register ( self , listener , events = None ) : <EOL> """<STR_LIT>""" <EOL> if event...
<s> from flask import Flask , request , Response , redirect , url_for , abort <EOL> from flask . ext . script import Manager <EOL> from threading import Lock <EOL> app = Flask ( __name__ ) <EOL> manager = Manager ( app ) <EOL> class Video ( object ) : <EOL> def __init__ ( self , name , url , duration ) : <EOL> self . n...
<s> from setuptools import setup , find_packages <EOL> from htmlmin import __version__ <EOL> README = open ( '<STR_LIT>' ) . read ( ) <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = __version__ , <EOL> description = '<STR_LIT>' , <EOL> long_description = README , <EOL> author = '<STR_LIT>' , <EOL> author_email...
<s> from splinter . meta import InheritedDocs <EOL> class CookieManagerAPI ( InheritedDocs ( '<STR_LIT>' , ( object , ) , { } ) ) : <EOL> """<STR_LIT>""" <EOL> def add ( self , cookies ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def delete ( self , * cookies ) : <EOL> """<STR_LIT>""" <EOL> raise Not...
<s> from flask import Flask , request , abort , Response , redirect , url_for <EOL> from os import path <EOL> from functools import wraps <EOL> this_folder = path . abspath ( path . dirname ( __file__ ) ) <EOL> def read_static ( static_name ) : <EOL> return open ( path . join ( this_folder , '<STR_LIT>' , static_name )...
<s> '''<STR_LIT>''' <EOL> from paxos import essential <EOL> from paxos . essential import ProposalID <EOL> class Messenger ( essential . Messenger ) : <EOL> def send_prepare_nack ( self , to_uid , proposal_id , promised_id ) : <EOL> '''<STR_LIT>''' <EOL> def send_accept_nack ( self , to_uid , proposal_id , promised_id ...
<s> '''<STR_LIT>''' <EOL> from codalab . bundles . uploaded_bundle import UploadedBundle <EOL> class DatasetBundle ( UploadedBundle ) : <EOL> BUNDLE_TYPE = '<STR_LIT>' </s>
<s> import sys <EOL> if sys . version_info [ <NUM_LIT:0> ] < <NUM_LIT:3> : <EOL> xrange = xrange <EOL> bytes = lambda x , y : str ( x ) <EOL> else : <EOL> xrange = range <EOL> bytes = bytes </s>
<s> '''<STR_LIT>''' <EOL> from codalab . model . orm_object import ORMObject <EOL> from codalab . common import ( <EOL> NotFoundError , <EOL> precondition , <EOL> UsageError , <EOL> PermissionError , <EOL> ) <EOL> from codalab . lib import ( <EOL> spec_util , <EOL> ) <EOL> from codalab . model . tables import ( <EOL> G...
<s> import argparse <EOL> import time <EOL> import os <EOL> parser = argparse . ArgumentParser ( ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , type = int , default = <NUM_LIT:10> , help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , type = int , default = <NUM_LIT> , help = '<ST...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AddField ( <EOL> model_name = '<STR_LIT:message>' , <EOL> name = '...
<s> from unittest import TestCase <EOL> from mock import DEFAULT , MagicMock , patch <EOL> from ircpdb . debugger import Ircpdb <EOL> class TestDebugger ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . arbitrary_channel = '<STR_LIT>' <EOL> self . arbitrary_allowed_nickname = '<STR_LIT>' <EOL> self . arbitrary_lim...
<s> from jirafs . plugin import CommandPlugin <EOL> from jirafs . utils import run_command_method_with_kwargs <EOL> class Command ( CommandPlugin ) : <EOL> """<STR_LIT>""" <EOL> MIN_VERSION = '<STR_LIT>' <EOL> MAX_VERSION = '<STR_LIT>' <EOL> def add_arguments ( self , parser ) : <EOL> parser . add_argument ( <EOL> '<ST...
<s> import argparse <EOL> from distutils . version import LooseVersion <EOL> import logging <EOL> import os <EOL> from taskw . warrior import TaskWarriorShellout <EOL> import keyring <EOL> from . api import get_api_connection <EOL> from . exceptions import ConfigurationError , IncompatibleVersionError <EOL> from . task...
<s> from distutils . core import setup <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT:1.0>' , <EOL> py_modules = [ '<STR_LIT>' ] , <EOL> ) </s>
<s> from __future__ import ( unicode_literals , absolute_import , <EOL> division , print_function ) <EOL> import logging <EOL> import json <EOL> import unicodecsv as csv <EOL> from bson import json_util <EOL> from africa_data import countries <EOL> logger = logging . getLogger ( __name__ ) <EOL> logging . basicConfig (...
<s> from shapely import wkb <EOL> from util import json_encode <EOL> class QueryError ( RuntimeError ) : <EOL> pass <EOL> def features_geojson ( features , json_callback ) : <EOL> '''<STR_LIT:U+0020>''' <EOL> geojson = dict ( type = '<STR_LIT>' , features = features ) <EOL> body , mime = json_encode ( geojson ) , '<STR...
<s> from flask_wtf import Form <EOL> from wtforms import TextField , PasswordField <EOL> from wtforms . validators import DataRequired <EOL> from comport . user . models import User <EOL> class LoginForm ( Form ) : <EOL> username = TextField ( '<STR_LIT>' , validators = [ DataRequired ( ) ] ) <EOL> password = PasswordF...
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> from alembic import op <EOL> import sqlalchemy as sa <EOL> def upgrade ( ) : <EOL> op . create_table ( '<STR_LIT>' , <EOL> sa . Column ( '<STR_LIT:id>' , sa . Integer ( ) , nullable = False ) , <EOL> sa . ForeignKeyConstraint ( [ '...
<s> import requests <EOL> import hashlib <EOL> from datetime import datetime <EOL> from comport . department . models import Extractor <EOL> from comport . utils import random_string , random_date <EOL> import random <EOL> class JSONTestClient ( object ) : <EOL> def run ( self , department , mutators = [ ] ) : <EOL> ba...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import django . db . models . deletion <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterField ( <EOL> mo...
<s> from eatsmart . settings . staging import * <EOL> DATABASES [ '<STR_LIT:default>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> DATABASES [ '<STR_LIT:default>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> EMAIL_SUBJECT_PREFIX = '<STR_LIT>' <EOL> BROKER_URL = '<STR_LIT>' % os . environ </s>
<s> from django . conf . urls import include , url <EOL> from django . contrib import admin <EOL> from schools . urls import router as schools_router <EOL> urlpatterns = [ <EOL> url ( r'<STR_LIT>' , include ( admin . site . urls ) ) , <EOL> url ( r'<STR_LIT>' , include ( schools_router . urls ) ) , <EOL> ] </s>
<s> VERSION = ( <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:0> , '<STR_LIT>' ) <EOL> __version__ = '<STR_LIT:.>' . join ( ( str ( each ) for each in VERSION [ : <NUM_LIT:4> ] ) ) <EOL> __all__ = [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' <EOL> ] <EOL> import sys <EOL> from ...
<s> """<STR_LIT>""" <EOL> import os <EOL> import time <EOL> import hashlib <EOL> import tempfile <EOL> import datetime <EOL> import shutil <EOL> from utils import get_normalized_path <EOL> from os . path import join as jn <EOL> __all__ = ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ...
<s> def filesizeformat ( bytes , sep = '<STR_LIT:U+0020>' ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> bytes = float ( bytes ) <EOL> except ( TypeError , ValueError , UnicodeDecodeError ) : <EOL> return '<STR_LIT>' % sep <EOL> if bytes < <NUM_LIT> : <EOL> size = bytes <EOL> template = '<STR_LIT>' <EOL> elif bytes < <NUM...
<s> from django_rq import job <EOL> @ job <EOL> def refresh_cache ( klass_str , obj_args , obj_kwargs , call_args , call_kwargs ) : <EOL> from . base import Job <EOL> Job . job_refresh ( klass_str , obj_args , obj_kwargs , call_args , call_kwargs ) </s>
<s> import re <EOL> import functools <EOL> try : <EOL> from urllib . parse import quote <EOL> except ImportError : <EOL> from urllib import quote <EOL> from . import url <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> patterns = re . compile ( "<STR_LIT>" ) <EOL> class Template ( object ) : <EOL> def __init__ ( sel...
<s> from base64 import b64decode <EOL> from datetime import datetime <EOL> from email . parser import FeedParser <EOL> from email . utils import parseaddr , parsedate <EOL> from optparse import make_option <EOL> import socket <EOL> import sys <EOL> import time <EOL> from django . conf import settings <EOL> from django ...
<s> </s>
<s> students = <NUM_LIT> <EOL> capacity = <NUM_LIT:100> <EOL> tas = <NUM_LIT:5> <EOL> if students < capacity : <EOL> print "<STR_LIT>" <EOL> else : <EOL> print "<STR_LIT>" <EOL> if tas == <NUM_LIT:0> : <EOL> print "<STR_LIT>" <EOL> elif tas < students / <NUM_LIT:5> : <EOL> print "<STR_LIT>" <EOL> else : <EOL> print "<S...
<s> instructions = """<STR_LIT>""" <EOL> allowed_commands = [ '<STR_LIT:a>' , '<STR_LIT:r>' , '<STR_LIT:s>' , '<STR_LIT:q>' ] <EOL> names = [ ] <EOL> command = raw_input ( instructions ) <EOL> while command . lower ( ) in allowed_commands : <EOL> if command . lower ( ) == '<STR_LIT:a>' : <EOL> name = raw_input ( "<STR_...
<s> def open_csvfile ( filename , delimiter = '<STR_LIT:U+002C>' ) : <EOL> with open ( filename , "<STR_LIT:r>" ) as csv_file : <EOL> rows = csv_file . read ( ) . split ( "<STR_LIT:\n>" ) <EOL> for index , row in enumerate ( rows ) : <EOL> rows [ index ] = row . split ( delimiter ) <EOL> return rows </s>
<s> def quadrant ( address ) : <EOL> "<STR_LIT>" <EOL> return [ quadrant for quadrant in address . split ( '<STR_LIT:U+0020>' ) if quadrant in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ] or None </s>
<s> """<STR_LIT:U+0020>""" <EOL> from flask import ( Blueprint , request , render_template , flash , g , <EOL> session , redirect , url_for , abort ) <EOL> from flask_reddit . frontends . views import get_subreddits , process_thread_paginator <EOL> from flask_reddit . subreddits . forms import SubmitForm <EOL> from fla...
<s> """<STR_LIT>""" <EOL> __title__ = '<STR_LIT>' <EOL> __author__ = '<STR_LIT>' <EOL> __license__ = '<STR_LIT>' <EOL> __copyright__ = '<STR_LIT>' <EOL> from html . parser import HTMLParser <EOL> import logging <EOL> from . text import innerTrim <EOL> log = logging . getLogger ( __name__ ) <EOL> class OutputFormatter (...
<s> class ChefError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> class ChefServerError ( ChefError ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , message , code = None ) : <EOL> self . raw_message = message <EOL> if isinstance ( message , list ) : <EOL> message = '<STR_LIT:U+002CU+0020>' . join ( m for m in messa...
<s> """<STR_LIT>""" <EOL> import random <EOL> from . . conf import * <EOL> from django . db import reset_queries <EOL> from django . conf import settings <EOL> reset_chance = getattr ( settings , '<STR_LIT>' , <NUM_LIT> ) <EOL> class Plugin : <EOL> def random_reset ( self ) : <EOL> if random . random ( ) <= reset_chanc...
<s> from django . shortcuts import get_object_or_404 <EOL> from django . core . urlresolvers import reverse , reverse_lazy <EOL> from django . contrib import messages <EOL> from django . http import HttpResponseRedirect , Http404 <EOL> from django . views . generic import DetailView , RedirectView , TemplateView , List...
<s> from django . db import models <EOL> from django . contrib . auth . models import User <EOL> from djangoratings . fields import RatingField <EOL> from django . core . urlresolvers import reverse <EOL> from codesters . utils import unique_slugify <EOL> from django . template . defaultfilters import slugify <EOL> LEV...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import datetime <EOL> from django . utils . timezone import utc <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migration...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> from django . conf import settings <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , ...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AddField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_LIT...
<s> from django . conf . urls import patterns <EOL> urlpatterns = patterns ( <EOL> '<STR_LIT>' , <EOL> ) </s>
<s> from os . path import isfile , join <EOL> import glob <EOL> import os <EOL> import re <EOL> from setuptools import setup <EOL> if isfile ( "<STR_LIT>" ) : <EOL> os . unlink ( "<STR_LIT>" ) <EOL> TOPDIR = os . path . dirname ( __file__ ) or "<STR_LIT:.>" <EOL> VERSION = re . search ( '<STR_LIT>' , <EOL> open ( TOPDI...
<s> import os <EOL> from setuptools import setup , find_packages <EOL> f = open ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ) <EOL> readme = f . read ( ) <EOL> f . close ( ) <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = "<STR_LIT>" , <EOL> description = '<STR_LIT>' , <EOL> long_desc...
<s> VERSION = ( <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:3> ) </s>
<s> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , '<STR_LIT:..>' ) <EOL> import main <EOL> main . app . run ( ) </s>
<s> import os <EOL> import sys <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> os . environ . setdefault ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> from django . core . management import execute_from_command_line <EOL> execute_from_command_line ( sys . argv ) </s>