code
stringlengths
9
256k
<s> import sys <EOL> import EulerPy <EOL> try : <EOL> from setuptools import setup <EOL> except ImportError : <EOL> from distutils . core import setup <EOL> def readme ( ) : <EOL> with open ( '<STR_LIT>' ) as f : <EOL> return f . read ( ) <EOL> def requirements ( ) : <EOL> with open ( '<STR_LIT>' ) as f : <EOL> install...
<s> from PyQt4 import QtCore , QtGui <EOL> from advancedoptions import AdvancedOptions_widget <EOL> from TumblrTextEdit import TumblrTextEdit <EOL> class Video_widget ( QtGui . QDialog ) : <EOL> def CreateLabel ( self , text , parent ) : <EOL> etiqueta = QtGui . QLabel ( text , parent ) <EOL> sizePolicy = QtGui . QSize...
<s> from lixian_commands . util import * <EOL> import lixian_help <EOL> import sys <EOL> from lixian_commands . login import login <EOL> from lixian_commands . logout import logout <EOL> from lixian_commands . download import download_task <EOL> from lixian_commands . list import list_task <EOL> from lixian_commands . ...
<s> basic_commands = [ <EOL> ( '<STR_LIT>' , "<STR_LIT>" ) , <EOL> ( '<STR_LIT>' , "<STR_LIT>" ) , <EOL> ( '<STR_LIT>' , "<STR_LIT>" ) , <EOL> ( '<STR_LIT:list>' , "<STR_LIT>" ) , <EOL> ( '<STR_LIT>' , "<STR_LIT>" ) , <EOL> ( '<STR_LIT>' , "<STR_LIT>" ) , <EOL> ( '<STR_LIT>' , "<STR_LIT>" ) , <EOL> ( '<STR_LIT>' , "<ST...
<s> from lixian_plugins . api import page_parser <EOL> import urllib2 <EOL> import re <EOL> def qjwm_link ( url ) : <EOL> assert re . match ( r'<STR_LIT>' , url ) <EOL> url = url . replace ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> html = urllib2 . urlopen ( url ) . read ( ) <EOL> m = re . search ( r'<STR_LIT>' , html ) <EOL>...
<s> import string <EOL> loop = <NUM_LIT:3> <EOL> while loop == <NUM_LIT:3> : <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> first = raw_input ( "<STR_LIT>" ) <EOL> if first . lower ( ) == ( "<S...
<s> import struct <EOL> import re <EOL> from . exif_log import get_logger <EOL> from . utils import s2n_motorola , s2n_intel , Ratio <EOL> from . tags import * <EOL> logger = get_logger ( ) <EOL> try : <EOL> basestring <EOL> except NameError : <EOL> basestring = str <EOL> class IfdTag : <EOL> """<STR_LIT>""" <EOL> def ...
<s> import logging <EOL> import gevent <EOL> import requests <EOL> from ouimeaux . config import WemoConfiguration <EOL> from ouimeaux . device import DeviceUnreachable <EOL> from ouimeaux . device . switch import Switch <EOL> from ouimeaux . device . insight import Insight <EOL> from ouimeaux . device . maker import M...
<s> from shutit_module import ShutItModule <EOL> import thing <EOL> class test1 ( ShutItModule ) : <EOL> def is_installed ( self , shutit ) : <EOL> return False <EOL> def build ( self , shutit ) : <EOL> thing . thing ( ) <EOL> shutit . send_and_expect ( '<STR_LIT>' ) <EOL> shutit . run_script ( '''<STR_LIT>''' ) <EOL> ...
<s> import featherweight_api <EOL> def myfn ( x , c ) : <EOL> """<STR_LIT>""" <EOL> print ( "<STR_LIT>" . format ( x , c ) ) <EOL> result = x * x + c <EOL> return result <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> featherweight_api . register ( myfn ) <EOL> featherweight_api . run ( ) </s>
<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> import argparse <EOL> import os <EOL> import numpy as np <EOL> from sklearn . feature_extraction . text import CountVecto...
<s> from sqlalchemy import Column , Integer , String , ForeignKey , create_engine <EOL> from sqlalchemy . orm import scoped_session , sessionmaker , relationship , backref <EOL> from sqlalchemy . ext . declarative import declarative_base <EOL> engine = create_engine ( "<STR_LIT>" ) <EOL> db_session = scoped_session ( s...
<s> '''<STR_LIT>''' <EOL> import logging <EOL> from libs import simpleauth <EOL> import secrets <EOL> import common <EOL> class AuthHandler ( common . BaseHandler , simpleauth . SimpleAuthHandler ) : <EOL> """<STR_LIT>""" <EOL> USER_ATTRS = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:name>...
<s> import numpy as np <EOL> import scipy . sparse as sp <EOL> from scipy . stats import norm <EOL> from sklearn . base import BaseEstimator , ClassifierMixin <EOL> from . validation import check_array <EOL> import ffm <EOL> def _validate_class_labels ( y ) : <EOL> assert len ( set ( y ) ) == <NUM_LIT:2> <EOL> assert y...
<s> import sys <EOL> import os <EOL> import json <EOL> import importlib <EOL> sys . path . append ( os . path . realpath ( '<STR_LIT>' ) ) <EOL> client_module = importlib . import_module ( '<STR_LIT>' ) <EOL> SampleUtilities = importlib . import_module ( '<STR_LIT>' ) <EOL> def main ( ) : <EOL> restClient = client_modu...
<s> import json <EOL> import os <EOL> import sys <EOL> import importlib <EOL> sys . path . append ( os . path . realpath ( '<STR_LIT>' ) ) <EOL> client_module = importlib . import_module ( '<STR_LIT>' ) <EOL> SampleUtilities = importlib . import_module ( '<STR_LIT>' ) <EOL> def main ( ) : <EOL> client = client_module ....
<s> import sys , os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( '<STR_LIT>' ) ) <EOL> extensions = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ] <EOL> templates_path = [ '<STR_LIT>' ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EOL> project = u'<STR_LIT>...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , unicode_literals <EOL> import base64 <EOL> import hashlib <EOL> import logging <EOL> log = logging . getLogger ( __name__ ) <EOL> import sys <EOL> try : <EOL> import urlparse <EOL> except ImportError : <EOL> import urllib . parse as urlparse <EOL> if sy...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , unicode_literals <EOL> import logging <EOL> from oauthlib . common import Request <EOL> from . base import BaseEndpoint , catch_errors_and_unavailability <EOL> from . . errors import InvalidClientError , UnsupportedTokenTypeError <EOL> from . . errors i...
<s> from __future__ import absolute_import , unicode_literals <EOL> import os <EOL> from mock import patch <EOL> from oauthlib . oauth2 import BackendApplicationClient <EOL> from oauthlib import signals <EOL> from ... . unittest import TestCase <EOL> @ patch ( '<STR_LIT>' , new = lambda : <NUM_LIT:1000> ) <EOL> class B...
<s> """<STR_LIT>""" <EOL> import os <EOL> import vim <EOL> from breeze import parser <EOL> from breeze import jumper <EOL> from breeze . utils import v <EOL> from breeze . utils import misc <EOL> from breeze . utils import settings <EOL> class Breeze : <EOL> def __init__ ( self ) : <EOL> self . parser = parser . Parser...
<s> """<STR_LIT>""" <EOL> from pygments . style import Style <EOL> from pygments . token import Keyword , Name , Comment , String , Error , Text , Number , Operator , Generic , Whitespace , Punctuation , Other , Literal <EOL> BACKGROUND = "<STR_LIT>" <EOL> CURRENT_LINE = "<STR_LIT>" <EOL> SELECTION = "<STR_LIT>" <EOL> ...
<s> from django . conf import settings <EOL> from . auth_handlers import BearerAuthHandler <EOL> TOKEN_TYPE_BEARER = '<STR_LIT>' <EOL> REGISTRY_TOKEN_TYPE = { <EOL> ( TOKEN_TYPE_BEARER , '<STR_LIT>' , BearerAuthHandler ) , <EOL> } <EOL> TEMPLATE_AUTHORIZE = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> TEMPLAT...
<s> from django . apps import AppConfig <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> class SitecatsConfig ( AppConfig ) : <EOL> """<STR_LIT>""" <EOL> name = '<STR_LIT>' <EOL> verbose_name = _ ( '<STR_LIT>' ) <EOL> _cat_cache = None <EOL> def get_categories_cache ( self ) : <EOL> return self ....
<s> from django . shortcuts import redirect <EOL> from . . flows_base import FlowsBase <EOL> from . . signals import sig_user_signup_success , sig_user_signup_fail <EOL> from . . settings import SIGNUP_ENABLED , SIGNUP_DISABLED_TEXT <EOL> class SignupFlow ( FlowsBase ) : <EOL> """<STR_LIT>""" <EOL> flow_type = '<STR_LI...
<s> from django . utils . translation import ugettext as _ <EOL> from . base import MessengerBase <EOL> from . . exceptions import MessengerWarmupException <EOL> class XMPPSleekMessenger ( MessengerBase ) : <EOL> """<STR_LIT>""" <EOL> alias = '<STR_LIT>' <EOL> xmpp = None <EOL> title = _ ( '<STR_LIT>' ) <EOL> _session_...
<s> """<STR_LIT>""" <EOL> from django . test import TestCase <EOL> from django . template . base import Template , TemplateSyntaxError <EOL> from django . template . context import Context <EOL> from django . test . utils import override_settings <EOL> from django . contrib . sites . models import Site <EOL> from sitem...
<s> from django . db import models <EOL> from django . conf import settings <EOL> from django . contrib . auth . models import Permission <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . utils . encoding import python_2_unicode_compatible <EOL> from . settings import MODEL_TREE , TR...
<s> """<STR_LIT>""" <EOL> import re <EOL> import zmq <EOL> from robotx . utils . misc import print_output <EOL> class MultiListener ( object ) : <EOL> """<STR_LIT>""" <EOL> ROBOT_LISTENER_API_VERSION = <NUM_LIT:2> <EOL> def __init__ ( self , masterip , port ) : <EOL> self . caserun = { } <EOL> self . context = zmq . Co...
<s> from django . conf import settings <EOL> DATABASES = { <EOL> '<STR_LIT:default>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:127.0.0.1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> } <...
<s> import os <EOL> import sys <EOL> from django . conf import settings <EOL> from django . core import urlresolvers <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django . core . files . base import ContentFile <EOL> from django . core . files . storage import FileSystemStorage <EOL> from...
<s> import testlib <EOL> import urlfetch <EOL> import unittest <EOL> import json <EOL> class GetTest ( unittest . TestCase ) : <EOL> def test_session ( self ) : <EOL> headers = testlib . randdict ( ) <EOL> cookies = testlib . randdict ( ) <EOL> s = urlfetch . Session ( headers = headers , cookies = cookies ) <EOL> self...
<s> from __future__ import print_function , unicode_literals , division , absolute_import <EOL> __author__ = "<STR_LIT>" <EOL> __copyright__ = "<STR_LIT>" <EOL> __license__ = "<STR_LIT>" <EOL> __version__ = "<STR_LIT>" <EOL> __email__ = "<STR_LIT>" <EOL> import sys <EOL> PY2 = sys . version_info [ <NUM_LIT:0> ] == <NUM...
<s> from __future__ import unicode_literals <EOL> import pytest <EOL> from arpeggio import SemanticAction , ParserPython <EOL> def test_direct_rule_call ( ) : <EOL> '''<STR_LIT>''' <EOL> def grammar ( ) : return rule1 , rule2 <EOL> def rule1 ( ) : return "<STR_LIT:a>" <EOL> def rule2 ( ) : return rule1 <EOL> call_count...
<s> from os . path import join , dirname <EOL> from textx . metamodel import metamodel_from_file <EOL> from textx . export import metamodel_export , model_export <EOL> def main ( debug = False ) : <EOL> this_folder = dirname ( __file__ ) <EOL> workflow_mm = metamodel_from_file ( <EOL> join ( this_folder , '<STR_LIT>' )...
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class DepsTree ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , sources ) : <EOL> """<STR_LIT>""" <EOL> self . _sources = sources <EOL> self . _provides_map = dict ( ) <EOL> for source in sources : <EOL> for provide in source . provides : <EOL> if p...
<s> DEBUG = True <EOL> DEBUG_TEMPLATE = True <EOL> SITE_ID = <NUM_LIT:1> <EOL> DATABASES = { <EOL> '<STR_LIT:default>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } <EOL> INSTALLED_APPS = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<ST...
<s> """<STR_LIT>""" <EOL> import __builtin__ <EOL> def print_ ( object_ ) : <EOL> import threading <EOL> import sys <EOL> __builtin__ . __GIL__ . acquire ( ) <EOL> try : <EOL> import multiprocessing <EOL> if multiprocessing . current_process ( ) . name == '<STR_LIT>' : <EOL> sys . stdout . write ( "<STR_LIT>" % ( multi...
<s> from setuptools import setup , find_packages <EOL> __author__ = '<STR_LIT>' <EOL> setup ( <EOL> name = "<STR_LIT>" , <EOL> version = "<STR_LIT>" , <EOL> py_modules = [ '<STR_LIT>' ] , <EOL> package_dir = { '<STR_LIT>' : '<STR_LIT>' } , <EOL> install_requires = open ( '<STR_LIT>' ) . read ( ) . splitlines ( ) , <EOL...
<s> def getIlastikVersion ( ) : <EOL> version = "<STR_LIT>" <EOL> version = version . split ( "<STR_LIT:U+0020>" ) [ <NUM_LIT:1> ] <EOL> return version . strip ( ) </s>
<s> from ilastik . core . baseModuleMgr import BaseModuleDataItemMgr , BaseModuleMgr <EOL> from ilastik . core . overlayMgr import OverlayItem <EOL> from ilastik . core . volume import DataAccessor <EOL> import numpy <EOL> import vigra <EOL> class AutomaticSegmentationItemModuleMgr ( BaseModuleDataItemMgr ) : <EOL> nam...
<s> import vigra <EOL> import numpy <EOL> import traceback , sys , copy <EOL> import threading <EOL> import copy <EOL> from ilastik . core . volume import VolumeLabels , VolumeLabelDescription <EOL> from ilastik . core . baseModuleMgr import BaseModuleDataItemMgr , BaseModuleMgr <EOL> from ilastik . core . overlayMgr i...
<s> import traceback , os , sys , segmentorBase </s>
<s> import unsupervisedMgr </s>
<s> from django . contrib import admin <EOL> from django . conf import settings <EOL> from blog . models import Post , Blog , BlogUserAccess <EOL> class BlogUserAccessInline ( admin . TabularInline ) : <EOL> model = BlogUserAccess <EOL> raw_id_fields = ( '<STR_LIT:user>' , ) <EOL> class BlogAdmin ( admin . ModelAdmin )...
<s> """<STR_LIT>""" <EOL> from django import template <EOL> from django . conf import settings <EOL> try : <EOL> from creoleparser . dialects import Creole10 as Creole <EOL> from creoleparser . core import Parser as CreoleParser <EOL> dialect = Creole ( use_additions = True ) <EOL> except ImportError : <EOL> Creole = N...
<s> from setuptools import setup <EOL> install_requires = [ <EOL> '<STR_LIT>' , <EOL> ] <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT:1.0>' , <EOL> description = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> license = '<STR_LIT>' , <EO...
<s> from . import constants <EOL> class BaseUploader ( object ) : <EOL> item_name = None <EOL> many = False <EOL> def __init__ ( self , requester , verbose = True ) : <EOL> self . requester = requester <EOL> self . verbose = verbose <EOL> def bulk_sync ( self , items ) : <EOL> url = self . get_urls ( items ) [ '<STR_LI...
<s> from eemeter . consumption import ConsumptionData <EOL> from eemeter . examples import get_example_project <EOL> from eemeter . meter import DefaultResidentialMeter <EOL> from eemeter . meter import DataCollection <EOL> def test_tutorial ( ) : <EOL> project = get_example_project ( "<STR_LIT>" ) <EOL> meter = Defaul...
<s> from flask import Markup <EOL> from flask . ext . wtf import Form <EOL> from wtforms import ( ValidationError , HiddenField , BooleanField , TextField , <EOL> PasswordField , SubmitField ) <EOL> from wtforms . validators import Required , Length , EqualTo , Email <EOL> from flask . ext . wtf . html5 import EmailFie...
<s> from __future__ import division <EOL> import datetime <EOL> import time <EOL> import traceback <EOL> import collections <EOL> import sys <EOL> import os <EOL> try : <EOL> import queue <EOL> except ImportError : <EOL> import Queue as queue <EOL> import mako . exceptions <EOL> import mako . template <EOL> import mako...
<s> from __future__ import absolute_import <EOL> from subprocess import * <EOL> try : <EOL> check_output <EOL> except NameError : <EOL> def check_output ( * popenargs , ** kwargs ) : <EOL> r"""<STR_LIT>""" <EOL> if '<STR_LIT>' in kwargs : <EOL> raise ValueError ( '<STR_LIT>' ) <EOL> process = Popen ( stdout = PIPE , * ...
<s> import httplib <EOL> import cgi <EOL> import wsgiref . handlers <EOL> from models import Server , AdminOptions <EOL> import os <EOL> from google . appengine . ext . webapp import template <EOL> from google . appengine . ext import webapp <EOL> from google . appengine . api import users <EOL> from google . appengine...
<s> from datetime import datetime <EOL> import marshal <EOL> id_stat = marshal . load ( open ( "<STR_LIT>" ) ) <EOL> def load_name_sample ( input , isTest ) : <EOL> f = open ( input ) <EOL> y = [ ] <EOL> x = [ ] <EOL> line = f . readline ( ) <EOL> index = <NUM_LIT:3> <EOL> if isTest == True : <EOL> index = <NUM_LIT:2> ...
<s> """<STR_LIT>""" <EOL> from collections import namedtuple , defaultdict <EOL> from warnings import warn <EOL> import six <EOL> class SeriesHelper ( object ) : <EOL> """<STR_LIT>""" <EOL> __initialized__ = False <EOL> def __new__ ( cls , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if not cls . __initialized__ ...
<s> from django . db import connection <EOL> from django . db . models import F , Q <EOL> from django . core . management . base import NoArgsCommand <EOL> from wagtail_modeltranslation . settings import DEFAULT_LANGUAGE <EOL> from wagtail_modeltranslation . translator import translator <EOL> from wagtail_modeltranslat...
<s> import os <EOL> import urllib2 <EOL> import hashlib <EOL> from lxml import etree <EOL> from moai . provider . oai import OAIBasedContentProvider <EOL> class FOXMLFile ( object ) : <EOL> def __init__ ( self , file_obj ) : <EOL> self . _doc = etree . parse ( file_obj ) <EOL> self . _ns = '<STR_LIT>' <EOL> def get_pro...
<s> from datetime import datetime <EOL> from unittest import TestCase , TestSuite , makeSuite <EOL> from oaipmh . datestamp import datestamp_to_datetime , tolerant_datestamp_to_datetime <EOL> from oaipmh . error import DatestampError <EOL> class DatestampTestCase ( TestCase ) : <EOL> def test_strict_datestamp_to_dateti...
<s> from . settings import db_location <EOL> import sqlite3 <EOL> import time <EOL> from math import degrees , sin , asin , cos , radians <EOL> '''<STR_LIT>''' <EOL> class ConnectionManager ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> conn = sqlite3 . connect ( db_location ) <EOL> conn . close...
<s> from __future__ import absolute_import , unicode_literals <EOL> import warnings <EOL> class WarningTestCaseMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> def assertWarning ( self , warning , callable , * args , ** kwargs ) : <EOL> with warnings . catch_warnings ( record = True ) as warning_list : <EOL> warnings . s...
<s> from collections import defaultdict <EOL> import json <EOL> import os . path <EOL> import numpy as np <EOL> import string <EOL> from vsm . viewer . wrappers import doc_label_name , def_label_fn <EOL> from topicexplorer . lib . hathitrust import parse_marc , get_volume_from_marc <EOL> from bottle import route , stat...
<s> import unittest2 as unittest <EOL> from vsm . corpus import add_metadata <EOL> from vsm . extensions . corpusbuilders . util import * <EOL> import numpy as np <EOL> class TestCorpusUtil ( unittest . TestCase ) : <EOL> def test_strip_punc ( self ) : <EOL> tsent = [ '<STR_LIT>' , '<STR_LIT:U+002C>' , '<STR_LIT:3>' , ...
<s> import os <EOL> import numpy as np <EOL> from unidecode import unidecode <EOL> from codecs import open <EOL> from vsm . corpus import Corpus <EOL> from util import * <EOL> from progressbar import ProgressBar , Percentage , Bar <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<S...
<s> import numpy as np <EOL> from scipy . sparse import csr_matrix <EOL> from base import BaseModel <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class TfIdf ( BaseModel ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , corpus = None , context_type = None , tf_matrix = None ) : <EOL> """<STR_LIT>""" <EOL> self . context_ty...
<s> from fake_switches . command_processing . base_command_processor import BaseCommandProcessor <EOL> class ConfigVrfCommandProcessor ( BaseCommandProcessor ) : <EOL> def __init__ ( self , switch_configuration , terminal_controller , logger , piping_processor , vrf ) : <EOL> BaseCommandProcessor . __init__ ( self , sw...
<s> import logging <EOL> import textwrap <EOL> from lxml import etree <EOL> from fake_switches . juniper . juniper_netconf_datastore import JuniperNetconfDatastore , NS_JUNOS <EOL> from fake_switches . netconf import OperationNotSupported , RUNNING , CANDIDATE , Response , xml_equals <EOL> from fake_switches . netconf ...
<s> import unittest <EOL> from flexmock import flexmock_teardown <EOL> from tests . dell import ssh_protocol_factory , telnet_protocol_factory <EOL> from tests . util . global_reactor import dell_privileged_password <EOL> from tests . util . protocol_util import with_protocol <EOL> class DellUnprivilegedTest ( unittest...
<s> """<STR_LIT>""" <EOL> from itertools import chain <EOL> from . parameters import ParameterContainer <EOL> class FilterContainer ( ParameterContainer ) : <EOL> """<STR_LIT>""" <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT:U+002C>" . join ( FilterContainer . __iter__ ( self ) ) <EOL> def __iter__ ( self ) : <EO...
<s> '''<STR_LIT>''' <EOL> from intuition . api . portfolio import PortfolioFactory <EOL> class Constant ( PortfolioFactory ) : <EOL> '''<STR_LIT>''' <EOL> def initialize ( self , configuration ) : <EOL> self . log . debug ( configuration ) <EOL> def optimize ( self , to_buy , to_sell ) : <EOL> '''<STR_LIT>''' <EOL> all...
<s> '''<STR_LIT>''' <EOL> import unittest <EOL> from nose . tools import eq_ , ok_ <EOL> import rpy2 <EOL> import os <EOL> from dna . test_utils import setup_logger , teardown_logger <EOL> import insights . analysis as analysis <EOL> class StocksAnalysisTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL...
<s> </s>
<s> from flask import Flask <EOL> from flask_registry import Registry , PackageRegistry , ExtensionRegistry , ConfigurationRegistry , BlueprintAutoDiscoveryRegistry <EOL> class Config ( object ) : <EOL> PACKAGES = [ '<STR_LIT>' ] <EOL> EXTENSIONS = [ '<STR_LIT>' ] <EOL> USER_CFG = True <EOL> def create_app ( config ) :...
<s> import glob <EOL> import six <EOL> import sys <EOL> import os <EOL> import imp <EOL> import logging <EOL> import traceback <EOL> import getopt <EOL> from workflow import engine as main_engine <EOL> from workflow . patterns import PROFILE <EOL> log = main_engine . get_logger ( '<STR_LIT>' ) <EOL> def run ( selection...
<s> try : <EOL> from unittest . mock import create_autospec <EOL> except ImportError : <EOL> from mock import create_autospec <EOL> try : <EOL> from unittest . mock import MagicMock <EOL> except ImportError : <EOL> from mock import MagicMock <EOL> import time <EOL> import pytest <EOL> from retry . api import retry_call...
<s> from numbers import Number <EOL> import itertools <EOL> from itertools import groupby <EOL> import numpy as np <EOL> import param <EOL> import types <EOL> from . import traversal , util <EOL> from . dimension import OrderedDict , Dimension , ViewableElement <EOL> from . layout import Layout , AdjointLayout , NdLayo...
<s> import numpy as np <EOL> from ... core import ( Store , Overlay , NdOverlay , Layout , AdjointLayout , <EOL> GridSpace , NdElement , Dataset , GridMatrix , NdLayout ) <EOL> from ... element import ( Curve , Points , Scatter , Image , Raster , Path , <EOL> RGB , Histogram , Spread , HeatMap , Contours , Bars , <EOL>...
<s> """<STR_LIT>""" <EOL> from io import BytesIO <EOL> import os , base64 <EOL> from contextlib import contextmanager <EOL> import param <EOL> from . . core . io import Exporter <EOL> from . . core . options import Store , StoreOptions , SkipRendering <EOL> from . . core . util import find_file <EOL> from . . import La...
<s> import numpy as np <EOL> import unittest <EOL> try : <EOL> from iris . tests . stock import lat_lon_cube <EOL> except ImportError : <EOL> raise unittest . SkipTest ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> from holoviews . core . data import Dataset <EOL> from holoviews . core . data . iris import coord_to_dimension ...
<s> """<STR_LIT>""" <EOL> import unittest <EOL> import param <EOL> class TestParameterizedRepr ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> class A ( param . Parameterized ) : <EOL> a = param . Number ( <NUM_LIT:4> , precedence = - <NUM_LIT:5> ) <EOL> b = param . String ( '<STR_LIT:B>' , precedence = - <N...
<s> class Action ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . method = None <EOL> self . layer = None <EOL> self . feature = None <EOL> self . id = None <EOL> self . bbox = None <EOL> self . maxfeatures = None <EOL> self . startfeature = <NUM_LIT:0> <EOL> self . attributes = { } <EOL> s...
<s> '''<STR_LIT>''' <EOL> import os <EOL> from lxml import etree <EOL> from FeatureServer . WebFeatureService . FilterEncoding . Operator import Operator <EOL> class LogicalOperator ( Operator ) : <EOL> def __init__ ( self , node ) : <EOL> super ( LogicalOperator , self ) . __init__ ( node ) <EOL> self . type = '<STR_L...
<s> '''<STR_LIT>''' <EOL> import os , re <EOL> from FeatureServer . WebFeatureService . Transaction . TransactionAction import TransactionAction <EOL> from lxml import etree <EOL> class Insert ( TransactionAction ) : <EOL> def __init__ ( self , node ) : <EOL> super ( Insert , self ) . __init__ ( node ) <EOL> self . typ...
<s> '''<STR_LIT>''' <EOL> from vectorformats . Formats . Format import Format <EOL> from xml . sax . saxutils import escape <EOL> import types <EOL> class GPX ( Format ) : <EOL> def encode ( self , features , ** kwargs ) : <EOL> results = [ """<STR_LIT>""" ] <EOL> results . append ( "<STR_LIT>" % self . layername ) <EO...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , division , print_function <EOL> from . sixing import * <EOL> class odict ( dict ) : <EOL> """<STR_LIT>""" <EOL> __slots__ = [ '<STR_LIT>' ] <EOL> def __new__ ( cls , * args , ** kwargs ) : <EOL> self = dict . __new__ ( cls , * args , ** kwargs ) <EOL> s...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , division , print_function <EOL> import struct <EOL> from binascii import hexlify <EOL> from collections import deque <EOL> import enum <EOL> import time <EOL> import random <EOL> import errno <EOL> import socket <EOL> from ... aid . sixing import * <EOL...
<s> """<STR_LIT>""" <EOL> from . wining import WinMailslotNb , PeerWms </s>
<s> """<STR_LIT>""" <EOL> import sys <EOL> if sys . version < '<STR_LIT:3>' : <EOL> def b ( x ) : <EOL> return x <EOL> else : <EOL> def b ( x ) : <EOL> return x . encode ( '<STR_LIT>' ) <EOL> xrange = range <EOL> import os <EOL> import time <EOL> import datetime <EOL> import copy <EOL> import io <EOL> from collections ...
<s> """<STR_LIT>""" <EOL> import sys <EOL> if sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:7> ) : <EOL> import unittest2 as unittest <EOL> else : <EOL> import unittest <EOL> import os <EOL> from ioflo . test import testing <EOL> from ioflo . aid . consoling import getConsole <EOL> console = getConsole ( ) <EOL> def se...
<s> from ehp import * <EOL> html = Html ( ) <EOL> data = '''<STR_LIT>''' <EOL> dom = html . feed ( data ) <EOL> for root , ind in dom . find_with_root ( AMP ) : <EOL> print ind </s>
<s> """<STR_LIT>""" <EOL> from vyapp . tools import set_status_msg <EOL> def clip_ph ( area ) : <EOL> """<STR_LIT>""" <EOL> area . clipboard_clear ( ) <EOL> area . clipboard_append ( area . filename ) <EOL> set_status_msg ( '<STR_LIT>' ) <EOL> def install ( area ) : <EOL> area . install ( ( '<STR_LIT>' , '<STR_LIT>' , ...
<s> """<STR_LIT>""" <EOL> import os <EOL> def log ( area , logfile ) : <EOL> with open ( logfile , '<STR_LIT>' ) as fd : <EOL> fd . write ( '<STR_LIT>' % os . path . abspath ( area . filename ) ) <EOL> def install ( area , logfile ) : <EOL> area . install ( ( - <NUM_LIT:1> , '<STR_LIT>' , lambda event : log ( event . w...
<s> """<STR_LIT>""" <EOL> def install ( area , chars ) : <EOL> area . install ( ( '<STR_LIT>' , '<STR_LIT>' , lambda event : event . widget . go_next_sym ( chars ) ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , lambda event : event . widget . go_prev_sym ( chars ) ) ) </s>
<s> import os <EOL> TEMPLATE_DEBUG = DEBUG = True <EOL> DATABASE_ENGINE = '<STR_LIT>' <EOL> DATABASE_NAME = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) <EOL> DATABASES = { <EOL> '<STR_LIT:default>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> } <EOL> AP...
<s> from __future__ import absolute_import , print_function , unicode_literals <EOL> import os <EOL> import sys <EOL> from os . path import exists <EOL> from os . path import join <EOL> from os . path import dirname <EOL> from os . path import abspath <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> base_path = dirnam...
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from os import environ <EOL> from os . path import exists <EOL> from subprocess import check_call <EOL> try : <EOL> from urllib . request import urlretrieve <EOL> except ImportError : <EOL> from urllib import urlretrieve <EOL> BASE_URL = "<STR_LIT>" ...
<s> import time <EOL> import unittest <EOL> import pytest <EOL> class TerribleTerribleWayToWriteTests ( unittest . TestCase ) : <EOL> @ pytest . fixture ( autouse = True ) <EOL> def setupBenchmark ( self , benchmark ) : <EOL> self . benchmark = benchmark <EOL> def test_foo ( self ) : <EOL> self . benchmark ( time . sle...
<s> from __future__ import absolute_import <EOL> import atexit <EOL> import inspect <EOL> import os <EOL> import weakref <EOL> from . actions import Action <EOL> from . actions import CallPrinter <EOL> from . actions import CodePrinter <EOL> from . actions import Debugger <EOL> from . actions import Manhole <EOL> from ...
<s> import types <EOL> import functools <EOL> from requests . adapters import HTTPAdapter <EOL> from . controller import CacheController <EOL> from . cache import DictCache <EOL> from . filewrapper import CallbackFileWrapper <EOL> class CacheControlAdapter ( HTTPAdapter ) : <EOL> invalidating_methods = set ( [ '<STR_LI...
<s> '''<STR_LIT>''' <EOL> import sys , json , re <EOL> from subprocess import Popen , PIPE , STDOUT <EOL> __doc__ = re . sub ( '<STR_LIT>' , '<STR_LIT>' , __doc__ , flags = re . M ) <EOL> testee = ( sys . argv [ <NUM_LIT:1> ] if len ( sys . argv ) >= <NUM_LIT:2> else <EOL> exit ( '<STR_LIT>' ) ) <EOL> ids = [ int ( x )...
<s> from ionyweb . administration . views import IsAdminView <EOL> from djangorestframework . response import Response <EOL> from djangorestframework import status <EOL> from django . shortcuts import get_object_or_404 <EOL> from django . template . loader import render_to_string <EOL> from django . template import Req...