code
stringlengths
9
256k
<s> from __future__ import unicode_literals , division , absolute_import , print_function <EOL> import unittest <EOL> import sys <EOL> import os <EOL> import asn1crypto <EOL> from oscrypto import keys <EOL> from . unittest_data import data_decorator , data <EOL> from . _unittest_compat import patch <EOL> patch ( ) <EOL...
<s> import subprocess <EOL> def get_service_running ( svc_name ) : <EOL> result = False <EOL> try : <EOL> output = subprocess . check_output ( [ "<STR_LIT>" , svc_name , "<STR_LIT:status>" ] ) <EOL> if "<STR_LIT>" in output : <EOL> result = True <EOL> else : <EOL> result = False <EOL> except : <EOL> print "<STR_LIT>" %...
<s> """<STR_LIT>""" <EOL> import datetime <EOL> from ants import signals <EOL> class CoreStats ( object ) : <EOL> def __init__ ( self , stats ) : <EOL> self . stats = stats <EOL> @ classmethod <EOL> def from_crawler ( cls , crawler ) : <EOL> o = cls ( crawler . stats ) <EOL> crawler . signals . connect ( o . spider_ope...
<s> from twisted . internet import task <EOL> from ants . utils . exceptions import NotConfigured <EOL> from ants import signals <EOL> from ants . utils import log <EOL> class LogStats ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , stats , interval = <NUM_LIT> ) : <EOL> self . stats = stats <EOL> self ....
<s> import random <EOL> import warnings <EOL> from time import time <EOL> from collections import deque <EOL> from twisted . internet import reactor , defer , task <EOL> from ants . utils . defer import mustbe_deferred <EOL> from ants . utils . httpobj import urlparse_cached <EOL> from ants . resolver import dnscache <...
<s> """<STR_LIT>""" <EOL> from cStringIO import StringIO <EOL> from email . MIMEMultipart import MIMEMultipart <EOL> from email . MIMENonMultipart import MIMENonMultipart <EOL> from email . MIMEBase import MIMEBase <EOL> from email . MIMEText import MIMEText <EOL> from email . Utils import COMMASPACE , formatdate <EOL>...
<s> from __future__ import print_function <EOL> import os <EOL> from ants . utils . job import job_dir <EOL> from ants . utils . request import request_fingerprint <EOL> from ants . utils import log <EOL> class BaseDupeFilter ( object ) : <EOL> @ classmethod <EOL> def from_settings ( cls , settings ) : <EOL> return cls...
<s> from ants . utils import manager <EOL> __author__ = '<STR_LIT>' <EOL> '''<STR_LIT>''' <EOL> from twisted . web import server , resource <EOL> from twisted . internet import reactor <EOL> from ants . utils . jsonextends import JSON <EOL> import datetime <EOL> import json <EOL> import logging <EOL> class WebServiceMa...
<s> __author__ = '<STR_LIT>' <EOL> from ants . webservice import webservice <EOL> from ants . cluster import cluster <EOL> from ants . crawl import crawl <EOL> from twisted . internet import reactor <EOL> import unittest <EOL> from ants import settings <EOL> class WebServiceTest ( unittest . TestCase ) : <EOL> def test...
<s> import os <EOL> from gitpandas import Repository , ProjectDirectory <EOL> __author__ = '<STR_LIT>' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> g = ProjectDirectory ( working_dir = os . path . abspath ( '<STR_LIT>' ) ) <EOL> b = g . file_detail ( extensions = [ '<STR_LIT>' ] , ignore_dir = [ '<STR_LIT>' , '<ST...
<s> import json <EOL> import requests <EOL> target = "<STR_LIT>" <EOL> headers = { "<STR_LIT>" : "<STR_LIT:application/json>" } <EOL> req = """<STR_LIT>""" <EOL> j = json . loads ( req ) <EOL> r = requests . post ( target , data = json . dumps ( j ) , headers = headers ) <EOL> print r . status_code <EOL> print r . cont...
<s> xilinx_board_type = '<STR_LIT>' <EOL> weblab_xilinx_experiment_port_number = <NUM_LIT:1> <EOL> xilinx_home = "<STR_LIT:.>" <EOL> xilinx_impact_full_path = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> xilinx_programmer_type = '<STR_LIT>' <EOL> xilinx_device_to_send_commands = '<STR_LIT>' <EOL> digilent_adept_full_path = [ "<...
<s> laboratory_assigned_experiments = { <EOL> '<STR_LIT>' : <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : ( ) <EOL> } <EOL> } </s>
<s> laboratory_session_type = '<STR_LIT>' <EOL> laboratory_assigned_experiments = { <EOL> '<STR_LIT>' : <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : ( ) <EOL> } , <EOL> '<STR_LIT>' : <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : ( ) <EOL> } , <EOL> } </s>
<s> import os <EOL> import traceback <EOL> import urllib2 <EOL> import json <EOL> import threading <EOL> import datetime <EOL> import time <EOL> import StringIO <EOL> import subprocess <EOL> from weblab . util import data_filename <EOL> from voodoo . log import logged <EOL> from voodoo . lock import locked <EOL> from v...
<s> from __future__ import print_function , unicode_literals <EOL> core_universal_identifier = '<STR_LIT>' <EOL> core_universal_identifier_human = "<STR_LIT>" <EOL> weblab_db_force_engine_creation = True <EOL> db_database = "<STR_LIT>" <EOL> weblab_db_username = '<STR_LIT>' <EOL> weblab_db_password = '<STR_LIT>' <EOL> ...
<s> from __future__ import print_function , unicode_literals <EOL> import unittest <EOL> import tempfile <EOL> import os <EOL> import test . unit . configuration as configuration_module <EOL> import experiments . ud_gpib . server as UdGpibExperiment <EOL> import weblab . experiment . util as ExperimentUtil <EOL> import...
<s> from __future__ import print_function , unicode_literals <EOL> import unittest <EOL> import time <EOL> import weblab . core . coordinator . checker_threaded as RCT <EOL> import weblab . core . coordinator . checker as ResourcesChecker <EOL> class Coordinator ( object ) : <EOL> locator = "<STR_LIT>" <EOL> original_c...
<s> from __future__ import print_function , unicode_literals <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import sys <EOL> received = sys . argv [ <NUM_LIT:1> ] <EOL> if received . find ( "<STR_LIT>" ) >= <NUM_LIT:0> : <EOL> print ( "<STR_LIT>" ) <EOL> elif received . find ( "<STR_LIT>" ) >= <NUM_LIT:0> : <EOL> pr...
<s> from __future__ import print_function , unicode_literals <EOL> from urllib import addinfourl <EOL> from cStringIO import StringIO <EOL> class fakeaddinfourl ( addinfourl ) : <EOL> def __init__ ( self , response = '<STR_LIT>' , headers = { } , url = '<STR_LIT>' ) : <EOL> if isinstance ( response , basestring ) : <EO...
<s> from __future__ import print_function , unicode_literals <EOL> import thread as _thread <EOL> import threading as _threading <EOL> import new as _new <EOL> import types as _types <EOL> import sys as _sys <EOL> import datetime as _datetime <EOL> import voodoo . log as _log <EOL> import urllib2 as _urllib2 <EOL> impo...
<s> from __future__ import print_function , unicode_literals <EOL> class BotError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kargs ) : <EOL> Exception . __init__ ( self , * args , ** kargs ) <EOL> class InvalidUserOrPasswordError ( BotError ) : <EOL> def __init__ ( self , * args , ** ...
<s> from __future__ import print_function , unicode_literals <EOL> import threading <EOL> from flask . ext . admin import expose , AdminIndexView , BaseView <EOL> from flask . ext . admin . contrib . sqla import ModelView <EOL> from flask . ext . admin . contrib . fileadmin import FileAdmin <EOL> admin_request = thread...
<s> from __future__ import print_function , unicode_literals <EOL> import time <EOL> import uuid <EOL> import json <EOL> import datetime <EOL> from weblab . data . experiments import ExperimentId <EOL> import weblab . core . coordinator . exc as CoordExc <EOL> from voodoo . typechecker import typecheck <EOL> from voodo...
<s> from __future__ import print_function , unicode_literals <EOL> import weblab . exc as wlExc <EOL> class LoginError ( wlExc . WebLabError ) : <EOL> def __init__ ( self , * args , ** kargs ) : <EOL> wlExc . WebLabError . __init__ ( self , * args , ** kargs ) <EOL> class InvalidCredentialsError ( LoginError ) : <EOL> ...
<s> from __future__ import print_function , unicode_literals <EOL> from weblab . core . web import get_argument <EOL> from weblab . core . wl import weblab_api <EOL> import weblab . data . command as Command <EOL> SESSION_ID = '<STR_LIT>' <EOL> HTML_TEMPLATE = """<STR_LIT>""" <EOL> @ weblab_api . route_web ( '<STR_LIT>...
<s> from __future__ import print_function , unicode_literals <EOL> from __future__ import with_statement <EOL> from alembic import context <EOL> from sqlalchemy import engine_from_config , pool <EOL> from logging . config import fileConfig <EOL> config = context . config <EOL> fileConfig ( config . config_file_name ) <...
<s> from __future__ import print_function , unicode_literals <EOL> from weblab . experiment . devices . vm . manager import VirtualMachineManager <EOL> from voodoo . override import Override <EOL> class VirtualMachineDummy ( VirtualMachineManager ) : <EOL> def __init__ ( self , cfg_manager ) : <EOL> VirtualMachineManag...
<s> from __future__ import print_function , unicode_literals <EOL> import os <EOL> import sys <EOL> def data_filename ( fname ) : <EOL> basedir = os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' ) ) <EOL> if os . path . exists ( os . path . join ( basedir , '<STR_LIT>' , fname ...
<s> import time <EOL> import sys <EOL> import logging <EOL> import logging . config <EOL> import StringIO <EOL> HEADER = """<STR_LIT>""" % time . asctime ( ) <EOL> class Generator ( object ) : <EOL> def __init__ ( self , modules , prefix , suffix , max_file_size , max_handler_size , check = False ) : <EOL> super ( Gene...
<s> import unittest <EOL> from nose . tools import assert_is_not_none <EOL> from sqlalchemy import text <EOL> from wcloud . tasks . db_tasks import connect , create_db , destroy_db <EOL> class TestDatabaseTasks ( unittest . TestCase ) : <EOL> def test_connect ( self ) : <EOL> """<STR_LIT>""" <EOL> engine = connect ( "<...
<s> """<STR_LIT>""" </s>
<s> import premailer <EOL> from pyramid . renderers import render <EOL> from pyramid . response import Response <EOL> from websauna . system . core . route import simple_route <EOL> @ simple_route ( "<STR_LIT>" , route_name = "<STR_LIT>" ) <EOL> def sample_html_email ( request ) : <EOL> """<STR_LIT>""" <EOL> html_body ...
<s> """<STR_LIT>""" <EOL> import time <EOL> import os <EOL> import pytest <EOL> from flaky import flaky <EOL> from . scaffold import execute_venv_command , insert_content_after_line <EOL> from . scaffold import replace_file <EOL> from . scaffold import create_psq_db <EOL> from . scaffold import app_scaffold <EOL> @ pyt...
<s> from django . db import models <EOL> from django . utils import timezone <EOL> class SecretFile ( models . Model ) : <EOL> filename = models . CharField ( max_length = <NUM_LIT:255> , blank = True , null = True ) <EOL> order = models . IntegerField ( blank = True , null = True ) <EOL> size = models . PositiveIntege...
<s> from models . base import * <EOL> class Model ( BaseModel ) : <EOL> def __init__ ( self ) : <EOL> super ( Model , self ) . __init__ ( db_name = '<STR_LIT:user>' ) </s>
<s> from __future__ import absolute_import , division , print_function , with_statement <EOL> import os <EOL> import logging <EOL> from turbo . conf import app_config <EOL> from turbo . util import join_sys_path , get_base_dir , import_object <EOL> import turbo . helper <EOL> from turbo . helper import install_helper <...
<s> class SuspiciousOpenID ( Exception ) : <EOL> pass </s>
<s> """<STR_LIT>""" <EOL> from retriever . app . app import App <EOL> def launch_app ( lists ) : <EOL> """<STR_LIT>""" <EOL> print "<STR_LIT>" <EOL> app = App ( lists ) <EOL> app . MainLoop ( ) </s>
<s> """<STR_LIT>""" <EOL> import os <EOL> import xlrd <EOL> from retriever . lib . templates import Script <EOL> from retriever . lib . models import Table , Cleanup , no_cleanup <EOL> from retriever . lib . excel import Excel <EOL> VERSION = '<STR_LIT>' <EOL> def sci_name ( value ) : <EOL> """<STR_LIT>""" <EOL> values...
<s> import base64 <EOL> import hmac <EOL> import hashlib <EOL> import urllib <EOL> from datetime import datetime <EOL> import xml . etree . cElementTree as ET <EOL> from . lib import safe_quote_tuple , etree_to_dict <EOL> from . . requestqueuer import RequestQueuer <EOL> PA_NAMESPACE = "<STR_LIT>" <EOL> class AmazonPro...
<s> import pprint <EOL> import urllib <EOL> from uuid import uuid4 <EOL> from twisted . internet . defer import Deferred , DeferredList , maybeDeferred <EOL> from twisted . internet . threads import deferToThread <EOL> from twisted . web . resource import Resource <EOL> from twisted . internet import reactor <EOL> from...
<s> from twisted . trial import unittest <EOL> from twisted . internet import reactor <EOL> from twisted . internet . defer import Deferred <EOL> import os <EOL> import sys <EOL> sys . path . append ( os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT>" ) ) <EOL> import twisted <EOL> twisted . internet . b...
<s> __version_info__ = ( '<STR_LIT:0>' , '<STR_LIT>' , '<STR_LIT:0>' ) <EOL> __version__ = '<STR_LIT:.>' . join ( __version_info__ ) </s>
<s> import mock <EOL> from werckercli . tests import ( <EOL> TestCase , <EOL> VALID_GITHUB_SSH_URL , <EOL> ) <EOL> from werckercli import cli <EOL> from werckercli . git import RemoteOption <EOL> class PrintIntroTtests ( TestCase ) : <EOL> def test_get_intro ( self ) : <EOL> result = cli . get_intro ( ) <EOL> self . as...
<s> from wsgi_intercept . mechanoid_intercept import Browser <EOL> from nose . tools import with_setup <EOL> import wsgi_intercept <EOL> from wsgi_intercept import test_wsgi_app <EOL> _saved_debuglevel = None <EOL> def install ( port = <NUM_LIT> ) : <EOL> _saved_debuglevel , wsgi_intercept . debuglevel = wsgi_intercept...
<s> class Error ( Exception ) : <EOL> def __init__ ( self , summary , code = None , severity = None , message = None ) : <EOL> self . summary = summary <EOL> self . code = int ( code ) <EOL> self . severity = severity <EOL> self . msg = message <EOL> self . codetable = { <NUM_LIT:0> : "<STR_LIT:OK>" , <EOL> <NUM_LIT:1>...
<s> import sys <EOL> import os <EOL> cwd = os . getcwd ( ) <EOL> project_root = os . path . dirname ( cwd ) <EOL> sys . path . insert ( <NUM_LIT:0> , project_root ) <EOL> import pyline <EOL> extensions = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EOL> templates_path = [ '<STR_LIT...
<s> from django . test import TestCase </s>
<s> from django . test import TestCase <EOL> import csv <EOL> from import_export_theunitedstatesio . models import TheUnitedStatesIoLegislatorCurrent , LEGISLATORS_CURRENT_CSV_FILE <EOL> class ImportExportTheUnitedStatesIoTests ( TestCase ) : <EOL> def test_csv_file_can_be_found_in_legislators_current ( self ) : <EOL> ...
<s> from django . conf . urls import url <EOL> from position import views <EOL> urlpatterns = [ <EOL> url ( r'<STR_LIT>' , <EOL> views . positions_related_to_candidate_campaign_oppose_view , <EOL> name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , <EOL> views . positions_count_for_candidate_campaign_oppose_view , <EOL> ...
<s> from django . conf . urls import url <EOL> from ux_birch import views <EOL> urlpatterns = [ <EOL> url ( r'<STR_LIT>' , views . my_ballot_view , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , views . start_view , name = '<STR_LIT:start>' ) , <EOL> url ( r'<STR_LIT>' , views . ask_view , name = '<STR_LIT>' ) , <EO...
<s> """<STR_LIT>""" <EOL> import wevote_functions . admin <EOL> from wevotebase import settings <EOL> def run ( ) : <EOL> wevote_functions . admin . setup_logging ( <EOL> stream = settings . LOG_STREAM , <EOL> logfile = settings . LOG_FILE , <EOL> stream_level = settings . LOG_STREAM_LEVEL , <EOL> file_level = settings...
<s> from nose . tools import eq_ , assert_false , ok_ <EOL> from selenium . webdriver . common . by import By <EOL> from tests import get_url <EOL> from tests . simple_page import SimplePageTest <EOL> from webium . find import Finds <EOL> class TestClick ( SimplePageTest ) : <EOL> def test_basic_finds ( self ) : <EOL> ...
<s> from selenium . common . exceptions import WebDriverException <EOL> from waiting import wait as wait_lib <EOL> import webium . settings <EOL> def wait ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> kwargs . setdefault ( '<STR_LIT>' , ( <NUM_LIT:1> , None ) ) <EOL> kwargs . setdefault ( '<STR_LIT>' , WebDriver...
<s> import arduino . portscan as portscan <EOL> portscan . main ( ) </s>
<s> import time <EOL> from energenie import OpenThings <EOL> from energenie import Devices , Messages , radio <EOL> from Timer import Timer <EOL> TX_RATE = <NUM_LIT:10> <EOL> def warning ( msg ) : <EOL> print ( "<STR_LIT>" % str ( msg ) ) <EOL> def trace ( msg ) : <EOL> print ( "<STR_LIT>" % str ( msg ) ) <EOL> directo...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from collections import deque <EOL> from contextlib import contextmanager <EOL> import six . moves . _thread as _thread <EOL> try : <EOL> from . import speedup <EOL> except ImportError : <EOL> speedup = False <EOL> __all__ = [ '<STR_LIT>' , '<STR_LI...
<s> '''<STR_LIT>''' <EOL> import numpy as np <EOL> from numpy . linalg . linalg import inv <EOL> class RidgeRegression ( object ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , complexity = <NUM_LIT:1> ) : <EOL> self . set_lambda ( complexity ) <EOL> def trainModel ( self , train ) : <EOL> instances = train . get_...
<s> import hashlib <EOL> def encrypt ( text ) : <EOL> m = hashlib . sha256 ( ) <EOL> m . update ( text ) <EOL> return m . hexdigest ( ) <EOL> def compare ( text , thehash ) : <EOL> return encrypt ( text ) == thehash </s>
<s> import os <EOL> import re <EOL> import sys <EOL> import subprocess <EOL> try : <EOL> from urllib . parse import urljoin <EOL> assert urljoin <EOL> except ImportError : <EOL> from urlparse import urljoin <EOL> from tornado . util import ObjectDict <EOL> py = sys . version_info <EOL> py3k = py >= ( <NUM_LIT:3> , <NUM...
<s> import os <EOL> from wsgiref . simple_server import make_server <EOL> from webob . exc import WSGIHTTPException <EOL> from pyramid . config import Configurator <EOL> from pyramid . interfaces import IExceptionResponse <EOL> from pyramid . path import caller_package <EOL> from pyramid . path import package_path <EOL...
<s> import time <EOL> from compactor . process import Process <EOL> from compactor . context import Context <EOL> import logging <EOL> logging . basicConfig ( ) <EOL> log = logging . getLogger ( __name__ ) <EOL> log . setLevel ( logging . INFO ) <EOL> class WebProcess ( Process ) : <EOL> @ Process . install ( '<STR_LIT...
<s> from pystachio import * <EOL> class CommandLine ( Struct ) : <EOL> binary = Required ( String ) <EOL> args = List ( String ) <EOL> params = Map ( String , String ) <EOL> class Resources ( Struct ) : <EOL> cpu = Required ( Float ) <EOL> ram = Required ( Integer ) <EOL> disk = Default ( Integer , <NUM_LIT:2> * <NUM_L...
<s> from revscoring . languages import portuguese <EOL> from . import enwiki , mediawiki , wikipedia , wikitext <EOL> badwords = [ <EOL> portuguese . badwords . revision . diff . match_delta_sum , <EOL> portuguese . badwords . revision . diff . match_delta_increase , <EOL> portuguese . badwords . revision . diff . matc...
<s> """<STR_LIT>""" <EOL> from . . datasource import Datasource <EOL> class table ( Datasource ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , items_datasource , name = None ) : <EOL> name = self . _format_name ( name , [ items_datasource ] ) <EOL> super ( ) . __init__ ( name , self . process , <EOL> depends_on =...
<s> """<STR_LIT>""" <EOL> from . feature import Feature , Modifier , Constant <EOL> from . functions import trim <EOL> __all__ = [ Feature , Modifier , Constant , trim ] </s>
<s> from ... . dependencies import DependentSet <EOL> from ... feature import Feature <EOL> from ... meta import aggregators , bools <EOL> from . diff import Diff <EOL> class Revision ( DependentSet ) : <EOL> def __init__ ( self , name , revision_datasources ) : <EOL> super ( ) . __init__ ( name ) <EOL> self . datasour...
<s> from nose . tools import eq_ <EOL> from . . precision import precision <EOL> def test_boolean ( ) : <EOL> test_statistic = precision ( ) <EOL> score_labels = [ <EOL> ( { '<STR_LIT>' : True } , { '<STR_LIT>' : True } , True ) , <EOL> ( { '<STR_LIT>' : False } , { '<STR_LIT>' : True } , False ) , <EOL> ( { '<STR_LIT>...
<s> from ifttt import app </s>
<s> """<STR_LIT>""" <EOL> __version__ = "<STR_LIT>" <EOL> __metaclass__ = type <EOL> import sys <EOL> import os <EOL> import string <EOL> import optparse <EOL> import tempfile <EOL> import wikipedia as pywikibot <EOL> from pywikibot import i18n <EOL> import config <EOL> class TextEditor : <EOL> def __init__ ( self ) : ...
<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> import os <EOL> import urllib <EOL> import pywikibot <EOL> import BeautifulSoup <EOL> import upload <EOL> def get_imagelinks ( url ) : <EOL> """<STR_LIT>""" <EOL> links = [ ] <EOL> uo = pywikibot . MyURLopener <EOL> file = uo . open ( url ) <EOL> soup = Beautifu...
<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> import MySQLdb <EOL> import MySQLdb . cursors <EOL> import time <EOL> class Connection ( object ) : <EOL> """<STR_LIT>""" <EOL> RECOVERABLE_ERRORS = ( <EOL> <NUM_LIT> , <EOL> <NUM_LIT> , <EOL> <NUM_LIT> , <EOL> <NUM_LIT> , <EOL> <NUM_LIT> , <EOL> <NUM_LIT> , <EO...
<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> import threading <EOL> import re <EOL> from Queue import Queue <EOL> import wikipedia as pywikibot <EOL> import interwiki <EOL> class IWRCBot ( ) : <EOL> def __init__ ( self , site , safe = True ) : <EOL> self . other_ns = re . compile ( u'<STR_LIT>' + u'<STR_LI...
<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> import os <EOL> import unittest <EOL> import test_utils <EOL> import pywikibot <EOL> import data_ingestion <EOL> class TestPhoto ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . obj = data_ingestion . Photo ( URL = '<STR_LIT>' , <EOL> metadata =...
<s> """<STR_LIT>""" <EOL> from io import UnsupportedOperation <EOL> import sys <EOL> stdin = sys . stdin <EOL> stdout = sys . stdout <EOL> stderr = sys . stderr <EOL> argv = sys . argv <EOL> if sys . platform == "<STR_LIT:win32>" : <EOL> import codecs <EOL> from ctypes import WINFUNCTYPE , windll , POINTER <EOL> from c...
<s> import os <EOL> import sys <EOL> PROJECT_ROOT = os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ) <EOL> sys . path = [ PROJECT_ROOT ] + sys . path <EOL> from django . core . management import execute_manager <EOL> try : <EOL> import settings <EOL> except ImportError : <EOL>...
<s> from django . conf . urls . defaults import * <EOL> from django . contrib import admin <EOL> from userapp . admin import alternative_site <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> ( r'<STR_LIT>' , include ( admin . site . urls ) ) , <EOL> ( r'<STR_LIT>' , include ( alternative_site . urls ) ) , <EOL> ( r'<...
<s> from txamqp . client import Closed <EOL> from txamqp . content import Content <EOL> from txamqp . testlib import TestBase <EOL> from twisted . internet . defer import inlineCallbacks <EOL> class QueueTests ( TestBase ) : <EOL> """<STR_LIT>""" <EOL> @ inlineCallbacks <EOL> def test_purge ( self ) : <EOL> """<STR_LIT...
<s> """<STR_LIT>""" <EOL> import logging <EOL> import sys , struct , datetime <EOL> class BadRecordException ( Exception ) : <EOL> def __init__ ( self ) : <EOL> pass <EOL> flag_def = { <EOL> <NUM_LIT> : "<STR_LIT:U+0020>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , ...
<s> __version__ = '<STR_LIT>' <EOL> __releasedate__ = '<STR_LIT>' </s>
<s> import os <EOL> import re <EOL> from setuptools import find_packages , setup <EOL> READMEFILE = "<STR_LIT>" <EOL> VERSIONFILE = os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> VSRE = r"<STR_LIT>" <EOL> def get_version ( ) : <EOL> verstrline = open ( VERSIONFILE , "<STR_LIT>" ) . read ( ) <EOL> mo = re . search...
<s> """<STR_LIT>""" </s>
<s> import sys ; import os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' ) ) ) <EOL> import sfminit <EOL> import argparse <EOL> import numpy as np <EOL> import copy <EOL> import sys <EOL> """<STR_LIT>""" <EOL> def make_cli ( ) : <EOL...
<s> """<STR_LIT>""" <EOL> from setuptools import setup <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT:1.0>' , <EOL> packages = [ '<STR_LIT>' ] , <EOL> package_dir = { '<STR_LIT>' : '<STR_LIT>' } , <EOL> install_requires = [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> pa...
<s> """<STR_LIT>""" <EOL> import logging <EOL> import time <EOL> from fabric . api import prompt , env <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> logger . setLevel ( logging . INFO ) <EOL> class BaseProvisioner ( object ) : <EOL> services = [ ] <EOL> def __init__ ( self , node , conf , * args , ** kwargs ...
<s> """<STR_LIT>""" <EOL> import setuptools <EOL> from distutils . core import setup <EOL> import os <EOL> import os . path as osp <EOL> def get_package_data ( name , extlist ) : <EOL> """<STR_LIT>""" <EOL> flist = [ ] <EOL> offset = len ( name ) + len ( os . pathsep ) <EOL> for dirpath , _dirnames , filenames in os . ...
<s> from machine import I2C <EOL> from machine import Pin <EOL> class I2CLCD : <EOL> def __init__ ( self , i2c = <NUM_LIT:0> , addr = <NUM_LIT> , backlight_pin = '<STR_LIT>' ) : <EOL> self . lines = <NUM_LIT:2> <EOL> self . columms = <NUM_LIT:20> <EOL> self . addr = addr <EOL> self . bl_pin = backlight_pin <EOL> if bac...
<s> from agate . aggregations . base import Aggregation <EOL> from agate . data_types import Number <EOL> from agate . exceptions import DataTypeError <EOL> class Sum ( Aggregation ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , column_name ) : <EOL> self . _column_name = column_name <EOL> def get_aggregate_data_...
<s> try : <EOL> from cdecimal import Decimal <EOL> except ImportError : <EOL> from decimal import Decimal <EOL> from babel . numbers import format_decimal <EOL> from agate . aggregations import Min , Max <EOL> from agate import utils <EOL> @ utils . allow_tableset_proxy <EOL> def bins ( self , column_name , count = <NU...
<s> from agate . table import Table <EOL> def _aggregate ( self , aggregations = [ ] ) : <EOL> """<STR_LIT>""" <EOL> from agate . tableset import TableSet <EOL> output = [ ] <EOL> if isinstance ( self . _values [ <NUM_LIT:0> ] , TableSet ) : <EOL> for key , nested_tableset in self . items ( ) : <EOL> column_names , col...
<s> try : <EOL> from cdecimal import Decimal <EOL> except ImportError : <EOL> from decimal import Decimal <EOL> from agate import Table <EOL> from agate . data_types import * <EOL> from agate . testcase import AgateTestCase <EOL> class TestBins ( AgateTestCase ) : <EOL> def setUp ( self ) : <EOL> self . number_type = N...
<s> def _get_ordered_keys ( rows , column_index ) : <EOL> """<STR_LIT>""" <EOL> return [ r [ column_index ] for r in rows ] <EOL> def _get_mapped_keys ( rows , column_index ) : <EOL> mapped_keys = { } <EOL> for r in rows : <EOL> key = r [ column_index ] <EOL> if key in mapped_keys : <EOL> mapped_keys [ key ] . append (...
<s> import datetime <EOL> import six <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> from csvkit import table <EOL> class TestColumn ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . c = table . Column ( <NUM_LIT:0> , u'<STR_LIT:test>' , [ u'<STR_LIT...
<s> from abc import abstractmethod <EOL> class IMemberDelegate : <EOL> @ abstractmethod <EOL> def apply ( self , cls , originalMemberNameList , memberName , classNamingConvention , getter , setter ) : <EOL> raise NotImplementedError ( ) <EOL> @ abstractmethod <EOL> def remove ( self , cls , originalMemberNameList , mem...
<s> import logging <EOL> import os <EOL> import re <EOL> from io import BytesIO <EOL> from PIL import Image <EOL> from assets . common import replace_colors <EOL> from assets . common import unpack_color_directives <EOL> from assets . common import make_color_directives <EOL> def read_default_color ( species_data ) : <...
<s> """<STR_LIT>""" <EOL> import time <EOL> import sys <EOL> from conque_globals import * <EOL> from conque_win32_util import * <EOL> from conque_sole_subprocess import * <EOL> from conque_sole_shared_memory import * <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> try : <EOL> if len ( sys . argv ) < <NUM_LIT:5> : <EO...
<s> import traceback <EOL> import sys <EOL> try : <EOL> from django . apps import AppConfig <EOL> except ImportError : <EOL> AppConfig = object <EOL> class WooeyConfig ( AppConfig ) : <EOL> name = '<STR_LIT>' <EOL> verbose_name = '<STR_LIT>' <EOL> def ready ( self ) : <EOL> from . import signals </s>
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import wooey . models . mixins <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . CreateModel ( <EOL> name = '<...
<s> import argparse <EOL> import sys <EOL> parser = argparse . ArgumentParser ( description = "<STR_LIT>" ) <EOL> parser . add_argument ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT:name>' , help = '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> args = parser . parse_args ...