code stringlengths 9 256k |
|---|
<s> import os <EOL> import os . path as op <EOL> from io import BytesIO <EOL> from nose . tools import eq_ , ok_ <EOL> from flask import Flask , url_for <EOL> from flask_admin import form , helpers <EOL> def _create_temp ( ) : <EOL> path = op . join ( op . dirname ( __file__ ) , '<STR_LIT>' ) <EOL> if not op . exists (... |
<s> import heapq <EOL> import itertools <EOL> class SendQueue ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , separator = '<STR_LIT:U+002C>' ) : <EOL> self . SEPARATOR = separator <EOL> self . _queue = [ ] <EOL> def push ( self , msg ) : <EOL> """<STR_LIT>""" <EOL> self . _queue . append ( msg ) <EOL> de... |
<s> from __future__ import print_function <EOL> from collections import OrderedDict <EOL> import sys <EOL> LEAVE_OUT = <NUM_LIT> <EOL> with open ( sys . argv [ <NUM_LIT:1> ] ) as in_file : <EOL> num_lines = sum ( <NUM_LIT:1> for _ in in_file ) <EOL> to = int ( num_lines * ( <NUM_LIT:1> - LEAVE_OUT ) ) <EOL> obj2id = { ... |
<s> """<STR_LIT>""" <EOL> import numpy <EOL> import theano . tensor . shared_randomstreams <EOL> import theano <EOL> import theano . tensor as T <EOL> from theano . tensor . signal import downsample <EOL> from theano . tensor . nnet import conv <EOL> def ReLU ( x ) : <EOL> y = T . maximum ( <NUM_LIT:0.0> , x ) <EOL> re... |
<s> """<STR_LIT>""" <EOL> import subprocess <EOL> name = '<STR_LIT>' <EOL> platforms = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> optional = True <EOL> not_found = "<STR_LIT>" <EOL> def check_exists ( fips_dir ) : <EOL> try : <EOL> subprocess . check_output ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> return True <EOL> except ( OS... |
<s> """<STR_LIT>""" <EOL> from mod import log , emscripten , nacl , android <EOL> def run ( fips_dir , proj_dir , args ) : <EOL> """<STR_LIT>""" <EOL> sdk_name = None <EOL> if len ( args ) > <NUM_LIT:0> : <EOL> sdk_name = args [ <NUM_LIT:0> ] <EOL> if sdk_name == '<STR_LIT>' : <EOL> emscripten . setup ( fips_dir , proj... |
<s> import sys , os <EOL> sys . path . append ( os . path . abspath ( '<STR_LIT:..>' ) ) <EOL> extensions = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EOL> templates_path = [ '<STR_LIT>' ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EOL> project = u'<STR_LIT>' <EOL> cop... |
<s> from django . conf . urls . defaults import * <EOL> from simpleapi import Route <EOL> from handlers import Example <EOL> from sapi import formatters , wrappers <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> ( r'<STR_LIT>' , Route ( Example , debug = True ) ) <EOL> ) </s>
|
<s> from formatter import * <EOL> from wrapper import * <EOL> from py2xml import * <EOL> from extjs import * </s>
|
<s> """<STR_LIT>""" <EOL> import types <EOL> import json <EOL> from twisted . application import service <EOL> from twisted . internet import defer , reactor <EOL> from twisted . python import log <EOL> DEFAULT_JSONRPC = '<STR_LIT>' <EOL> class JSONRPCService ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self... |
<s> """<STR_LIT>""" <EOL> from collections import namedtuple <EOL> Customer = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class LineItem : <EOL> def __init__ ( self , product , quantity , price ) : <EOL> self . product = product <EOL> self . quantity = quantity <EOL> self . price = price <EOL> def total ( self ) : <... |
<s> class A : <EOL> def ping ( self ) : <EOL> print ( '<STR_LIT>' , self ) <EOL> class B ( A ) : <EOL> def pong ( self ) : <EOL> print ( '<STR_LIT>' , self ) <EOL> class C ( A ) : <EOL> def pong ( self ) : <EOL> print ( '<STR_LIT>' , self ) <EOL> class D ( B , C ) : <EOL> def ping ( self ) : <EOL> super ( ) . ping ( ) ... |
<s> """<STR_LIT>""" <EOL> import contextlib <EOL> @ contextlib . contextmanager <EOL> def looking_glass ( ) : <EOL> import sys <EOL> original_write = sys . stdout . write <EOL> def reverse_write ( text ) : <EOL> original_write ( text [ : : - <NUM_LIT:1> ] ) <EOL> sys . stdout . write = reverse_write <EOL> msg = '<STR_L... |
<s> """<STR_LIT>""" <EOL> class Quantity : <EOL> def __init__ ( self , storage_name ) : <EOL> self . storage_name = storage_name <EOL> def __set__ ( self , instance , value ) : <EOL> if value > <NUM_LIT:0> : <EOL> instance . __dict__ [ self . storage_name ] = value <EOL> else : <EOL> raise ValueError ( '<STR_LIT>' ) <E... |
<s> """<STR_LIT>""" <EOL> from concurrent import futures <EOL> import potd <EOL> def save_month ( year_month , verbose ) : <EOL> year , month = [ int ( s ) for s in year_month . split ( '<STR_LIT:->' ) ] <EOL> total_size = <NUM_LIT:0> <EOL> img_count = <NUM_LIT:0> <EOL> dates = potd . list_days_of_month ( year , month ... |
<s> """<STR_LIT>""" <EOL> DEMO = """<STR_LIT>""" <EOL> class Namespace ( object ) : <EOL> pass <EOL> def make_averager ( ) : <EOL> ns = Namespace ( ) <EOL> ns . num_items = <NUM_LIT:0> <EOL> ns . total = <NUM_LIT:0> <EOL> def averager ( new_value ) : <EOL> ns . num_items += <NUM_LIT:1> <EOL> ns . total += new_value <EO... |
<s> """<STR_LIT>""" <EOL> from bisect import bisect <EOL> def bisect_find ( seq , item ) : <EOL> left_pos = bisect ( seq , item ) - <NUM_LIT:1> <EOL> return left_pos if seq and seq [ left_pos ] == item else - <NUM_LIT:1> </s>
|
<s> import logging <EOL> from flimp . file_handler import process , clean_data <EOL> from fom . session import Fluid <EOL> logger = logging . getLogger ( "<STR_LIT>" ) <EOL> logger . setLevel ( logging . DEBUG ) <EOL> logfile_handler = logging . FileHandler ( '<STR_LIT>' ) <EOL> logfile_handler . setLevel ( logging . D... |
<s> from math import sin , cos , pi , atan2 , hypot <EOL> import pg <EOL> import random <EOL> SPEED = <NUM_LIT:50> <EOL> class Bot ( object ) : <EOL> def __init__ ( self , position , target ) : <EOL> self . y = ( random . random ( ) - <NUM_LIT:0.5> ) * <NUM_LIT:20> <EOL> self . position = position <EOL> self . target =... |
<s> from . gl import * <EOL> from . import gl <EOL> from . camera import ( <EOL> Camera , <EOL> ) <EOL> from . core import ( <EOL> App , <EOL> async , <EOL> call_after , <EOL> Context , <EOL> delete_all , <EOL> FragmentShader , <EOL> index , <EOL> IndexBuffer , <EOL> Mesh , <EOL> poll_events , <EOL> Program , <EOL> run... |
<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> __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> '<STR_LIT>' , <EOL> '<ST... |
<s> from __future__ import absolute_import <EOL> from nose . tools import assert_raises <EOL> from formencode . context import Context , ContextRestoreError <EOL> c1 = Context ( default = None ) <EOL> c2 = Context ( ) <EOL> def test_one ( ) : <EOL> state = c1 . set ( foo = <NUM_LIT:1> ) <EOL> assert_is ( c1 , '<STR_LIT... |
<s> from distutils import version <EOL> version = version . LooseVersion ( '<STR_LIT>' ) </s>
|
<s> from piped_status_testing import statustest , util <EOL> from twisted . internet import reactor , defer <EOL> """<STR_LIT>""" <EOL> class HelperStatusTest ( statustest . StatusTestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self , ** namespace ) : <EOL> self . namespace = namespace <EOL> def statustest_nothing... |
<s> from zope import interface <EOL> from twisted . internet import defer <EOL> from twisted . web import client , error <EOL> from piped . plugins . status_testing import statustest , processors <EOL> from piped import processing <EOL> class TestTutorialProcessor ( processors . StatusTestProcessor ) : <EOL> interface ... |
<s> """<STR_LIT>""" <EOL> from twisted . internet import defer <EOL> from twisted . python import failure <EOL> from zope import interface <EOL> from piped import util , processing , exceptions , log <EOL> from piped . processors import base <EOL> class ScatterGatherer ( base . Processor ) : <EOL> interface . classProv... |
<s> import logging <EOL> import sys <EOL> from twisted . application import service <EOL> from twisted . internet import defer , stdio , process , reactor , fdesc <EOL> from twisted . protocols import basic <EOL> from zope import interface <EOL> from piped import event , exceptions , util , resource <EOL> logger = logg... |
<s> """<STR_LIT>""" <EOL> import copy <EOL> import datetime <EOL> from twisted . internet import defer <EOL> from twisted . python import failure <EOL> from twisted . trial import unittest <EOL> from piped import util , processing , exceptions <EOL> class uncopyable ( object ) : <EOL> def __deepcopy__ ( self , memo ) :... |
<s> from __future__ import absolute_import <EOL> from __future__ import division <EOL> from __future__ import print_function <EOL> from . method_message import MethodMessage <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class MethodMessageFactory ( object ) : <EOL> def __init__ ( self , ids ) : <EOL> self . _ids = ids <EOL> de... |
<s> from __future__ import absolute_import <EOL> from __future__ import division <EOL> from __future__ import print_function <EOL> from . constants import MSG_CHANGED <EOL> from . server_message_serializer import ServerMessageSerializer <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class ChangedMessageSerializer ( ServerMessag... |
<s> from __future__ import absolute_import <EOL> from __future__ import division <EOL> from __future__ import print_function <EOL> from . . message_parser import MessageParser <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class ServerMessageParser ( MessageParser ) : <EOL> pass </s>
|
<s> from __future__ import absolute_import <EOL> from __future__ import division <EOL> from __future__ import print_function <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class Subscriber ( object ) : <EOL> def __init__ ( self , board , subscriptions ) : <EOL> self . _board = board <EOL> self . _subscriptions = subscriptions <... |
<s> from __future__ import absolute_import <EOL> from __future__ import division <EOL> from __future__ import print_function <EOL> import unittest <EOL> from ddp . messages . pong_message import PongMessage <EOL> from ddp . messages . pong_message_parser import PongMessageParser <EOL> class PongMessageParserTestCase ( ... |
<s> """<STR_LIT>""" <EOL> from django import forms <EOL> from sample_resource . models import SampleResourceAggregate as SampleResourceAggregateModel <EOL> class SampleResourceAggregate ( forms . ModelForm ) : <EOL> '''<STR_LIT>''' <EOL> sync_resources = forms . BooleanField ( label = "<STR_LIT>" , initial = True , req... |
<s> '''<STR_LIT>''' <EOL> from django . views . generic import list_detail , create_update , simple <EOL> from django . http import HttpResponseRedirect , HttpResponseNotAllowed , Http404 , HttpResponse <EOL> from expedient . clearinghouse . aggregate . models import Aggregate <EOL> from expedient . clearinghouse . agg... |
<s> '''<STR_LIT>''' <EOL> SITE_ID = <NUM_LIT:1> <EOL> '''<STR_LIT>''' <EOL> SITE_NAME = "<STR_LIT>" <EOL> '''<STR_LIT>''' <EOL> SITE_DOMAIN = "<STR_LIT>" <EOL> '''<STR_LIT>''' </s>
|
<s> '''<STR_LIT>''' <EOL> from itertools import chain <EOL> from django import forms <EOL> from django . contrib . auth . models import User <EOL> from django . utils . safestring import mark_safe <EOL> from django . utils . html import conditional_escape <EOL> from expedient . clearinghouse . roles . models import Pro... |
<s> '''<STR_LIT>''' <EOL> def itersubclasses ( cls , _seen = None ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( cls , type ) : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % cls ) <EOL> if _seen is None : _seen = set ( ) <EOL> try : <EOL> subs = cls . __subclasses__ ( ) <EOL> except TypeError : <EOL> sub... |
<s> '''<STR_LIT>''' <EOL> import logging <EOL> from expedient . common . permissions . models import ExpedientPermission , ObjectPermission , PermissionOwnership <EOL> from expedient . common . middleware import threadlocals <EOL> from expedient . common . permissions . exceptions import PermitteeNotInThreadLocals , Pe... |
<s> '''<STR_LIT>''' <EOL> import urllib , urllib2 , cookielib <EOL> import logging <EOL> from pprint import pformat <EOL> logger = logging . getLogger ( "<STR_LIT>" ) <EOL> def fake_login ( client , user ) : <EOL> """<STR_LIT>""" <EOL> from django . conf import settings <EOL> from django . utils . importlib import impo... |
<s> """<STR_LIT>""" <EOL> from django import template <EOL> register = template . Library ( ) <EOL> @ register . filter <EOL> def number_vms_inside_server_for_slice ( server , slice_uuid ) : <EOL> """<STR_LIT>""" <EOL> vms_inside = <NUM_LIT:0> <EOL> for vm in server . vtserver . vms . all ( ) : <EOL> if server . uuid =... |
<s> '''<STR_LIT>''' <EOL> from django . db import models <EOL> from expedient . clearinghouse . resources . models import Resource , Sliver <EOL> from expedient_geni . models import GENIAggregate , GENISliceInfo <EOL> from xml . etree import cElementTree as et <EOL> import calendar <EOL> from exceptions import RSpecPar... |
<s> """<STR_LIT>""" <EOL> mod_name = '<STR_LIT>' <EOL> def rspec_to_omnispec ( urn , rspec ) : <EOL> '''<STR_LIT>''' <EOL> trans_mod = __import__ ( mod_name , fromlist = [ mod_name ] ) <EOL> translators = trans_mod . all <EOL> mod = None <EOL> for translator in translators : <EOL> mod = __import__ ( mod_name + '<STR_LI... |
<s> '''<STR_LIT>''' <EOL> import os <EOL> import binascii <EOL> from omctl_settings import * <EOL> from datetime import timedelta , datetime <EOL> import time <EOL> from expedient . common . utils . transport import TestClientTransport <EOL> from urlparse import urlparse <EOL> import xmlrpclib <EOL> from expedient . co... |
<s> import os <EOL> import sys <EOL> from os . path import dirname , join <EOL> sys . stdout = sys . stderr <EOL> PYTHON_DIR = join ( dirname ( __file__ ) , '<STR_LIT>' ) <EOL> PLUGINS_DIR = join ( dirname ( __file__ ) , '<STR_LIT>' ) <EOL> os . environ [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> sys . path . insert ( <NUM_LIT... |
<s> """<STR_LIT>""" <EOL> import unittest <EOL> import jsonrpc <EOL> import urllib <EOL> from StringIO import StringIO <EOL> class TestProxy ( unittest . TestCase ) : <EOL> def urlopen ( self , url , data ) : <EOL> self . postdata = data <EOL> return StringIO ( self . respdata ) <EOL> def setUp ( self ) : <EOL> self . ... |
<s> import logging <EOL> import logging . handlers <EOL> import os . path <EOL> from flask import Flask , request_started , request , request_tearing_down <EOL> from foam . config import FOAMLOG , LOGLEVEL , LOGFORMAT , LOGDIR <EOL> app = Flask ( "<STR_LIT>" ) <EOL> lhandle = logging . handlers . RotatingFileHandler ( ... |
<s> import logging <EOL> import uuid <EOL> from foamext . IPy import IP <EOL> from foamext import IPy <EOL> from foam . geni . db import GeniDB <EOL> from foam . core . exception import CoreException <EOL> from foam . core . log import KeyAdapter <EOL> from foam . openflow . types import Port <EOL> NEVER = <NUM_LIT:0> ... |
<s> import datetime <EOL> from foam . sfa . util . faults import InsufficientRights <EOL> from foam . sfa . util . xrn import urn_to_hrn <EOL> from foam . sfa . util . method import Method <EOL> from foam . sfa . util . foam . sfa . ime import utcparse <EOL> from foam . sfa . trust . credential import Credential <EOL> ... |
<s> from foam . sfa . rspecs . elements . element import Element <EOL> class Install ( Element ) : <EOL> fields = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT:url>' , <EOL> '<STR_LIT>' , <EOL> ] </s>
|
<s> from foam . sfa . util . xrn import Xrn <EOL> from foam . sfa . rspecs . elements . element import Element <EOL> from foam . sfa . rspecs . elements . link import Link <EOL> from foam . sfa . rspecs . elements . interface import Interface <EOL> from foam . sfa . rspecs . elements . property import Property <EOL> cl... |
<s> import xmlrpclib <EOL> from foam . sfa . trust . certificate import Certificate <EOL> from foam . sfa . trust . gid import GID <EOL> class SfaTicket ( Certificate ) : <EOL> gidCaller = None <EOL> gidObject = None <EOL> attributes = { } <EOL> rspec = { } <EOL> delegate = False <EOL> def __init__ ( self , create = Fa... |
<s> from django . core . management import execute_manager <EOL> try : <EOL> import settings <EOL> except ImportError , e : <EOL> import sys <EOL> sys . stderr . write ( "<STR_LIT:%s>" % str ( e ) ) <EOL> sys . stderr . write ( "<STR_LIT>" % __file__ ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> if __name__ == "<STR_LIT:__m... |
<s> '''<STR_LIT>''' <EOL> from exceptions import PermissionDenied , PermissionSignatureError <EOL> from models import ExpedientPermission <EOL> from django . contrib . contenttypes . models import ContentType <EOL> class require_obj_permissions ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , user_kw , pe... |
<s> '''<STR_LIT>''' <EOL> from django . db import models <EOL> from django import forms <EOL> import formfields <EOL> class MACAddressField ( models . CharField ) : <EOL> """<STR_LIT>""" <EOL> empty_strings_allowed = False <EOL> description = "<STR_LIT>" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> kwargs [... |
<s> from django . conf . urls . defaults import patterns , url <EOL> urlpatterns = patterns ( '<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 . conf import settings <EOL> from expedient . common . tests . manager import SettingsTestCase <EOL> from django . core . urlresolvers import reverse <EOL> import logging <EOL> from django . contrib . auth . models import User <EOL> from openflow . optin_manager . opts . models import UserFlowSpace , Ex... |
<s> from openflow . optin_manager . sfa . util . xrn import urn_to_hrn <EOL> from openflow . optin_manager . sfa . trust . auth import Auth <EOL> class SliverStatus : <EOL> def __init__ ( self , slice_xrn , creds , options , ** kwargs ) : <EOL> hrn , type = urn_to_hrn ( slice_xrn ) <EOL> valid_creds = Auth ( ) . checkC... |
<s> from openflow . optin_manager . sfa . rspecs . elements . element import Element <EOL> class Execute ( Element ) : <EOL> fields = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] </s>
|
<s> from openflow . optin_manager . sfa . util . xrn import Xrn <EOL> from openflow . optin_manager . sfa . util . xml import XpathFilter <EOL> from openflow . optin_manager . sfa . rspecs . elements . node import Node <EOL> from openflow . optin_manager . sfa . rspecs . elements . sliver import Sliver <EOL> from openf... |
<s> from openflow . optin_manager . sfa . managers . MetaSfaRegistry import MetaSfaRegistry <EOL> def create_credential ( xrn ) : <EOL> MetaSfaRegistry ( ) . get_credential ( xrn ) </s>
|
<s> from types import StringTypes <EOL> import dateutil . parser <EOL> import datetime <EOL> import time <EOL> DATEFORMAT = "<STR_LIT>" <EOL> def utcparse ( input ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( input , StringTypes ) : <EOL> try : <EOL> input = int ( input ) <EOL> except ValueError : <EOL> pass <EOL> if... |
<s> from time import sleep <EOL> while <NUM_LIT:1> : <EOL> print "<STR_LIT>" <EOL> sleep ( <NUM_LIT:1> ) </s>
|
<s> import shutil <EOL> import os <EOL> import jinja2 <EOL> import string <EOL> import subprocess <EOL> import re <EOL> from xen . provisioning . HdManager import HdManager <EOL> from settings . settingsLoader import OXA_XEN_SERVER_KERNEL , OXA_XEN_SERVER_INITRD , OXA_DEBIAN_INTERFACES_FILE_LOCATION , OXA_DEBIAN_UDEV_F... |
<s> '''<STR_LIT>''' <EOL> from django . shortcuts import get_object_or_404 <EOL> from django . views . generic . create_update import get_model_and_form_class <EOL> from django . views . generic import simple <EOL> from django . http import HttpResponseRedirect , HttpResponseNotAllowed <EOL> from vt_manager . common . ... |
<s> from vt_manager . communication . sfa . util . xrn import urn_to_hrn <EOL> from vt_manager . communication . sfa . trust . auth import Auth <EOL> class SliverStatus : <EOL> def __init__ ( self , slice_xrn , creds , options , ** kwargs ) : <EOL> hrn , type = urn_to_hrn ( slice_xrn ) <EOL> valid_creds = Auth ( ) . ch... |
<s> from vt_manager . communication . sfa . rspecs . elements . element import Element <EOL> class NetworkInterface ( Element ) : <EOL> fields = [ '<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>' , <... |
<s> from vt_manager . communication . sfa . rspecs . elements . element import Element <EOL> class VM ( Element ) : <EOL> fields = [ <EOL> '<STR_LIT:name>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT:state>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>... |
<s> import xmlrpclib <EOL> from vt_manager . communication . sfa . util . genicode import GENICODE <EOL> class SfaFault ( xmlrpclib . Fault ) : <EOL> def __init__ ( self , faultCode , faultString , extra = None ) : <EOL> if extra : <EOL> faultString += "<STR_LIT>" + str ( extra ) <EOL> xmlrpclib . Fault . __init__ ( se... |
<s> from vt_manager . communication . sfa . vm_utils . expiration_manager import ExpirationManager <EOL> import threading <EOL> import time <EOL> class BackgroundExpirationMonitoring ( threading . Thread ) : <EOL> period = <NUM_LIT> * <NUM_LIT:6> <EOL> def __init__ ( self ) : <EOL> threading . Thread . __init__ ( self ... |
<s> '''<STR_LIT>''' <EOL> import sys , traceback , logging <EOL> from django . conf import settings <EOL> from os . path import dirname , join <EOL> DEFAULT_FROM_EMAIL = "<STR_LIT>" <EOL> EMAIL_SUBJECT_PREFIX = '<STR_LIT>' <EOL> EMAIL_USE_TLS = True <EOL> EMAIL_HOST = '<STR_LIT>' <EOL> EMAIL_HOST_USER = '<STR_LIT>' <EO... |
<s> import xmlrpclib <EOL> from vt_manager . communication . northCommInterface import send_sync <EOL> from uuid import uuid4 <EOL> from vt_manager . communication . utils . XmlHelper import * <EOL> rspec = open ( "<STR_LIT>" ) . read ( ) <EOL> url = "<STR_LIT>" <EOL> callBackUrl = "<STR_LIT>" <EOL> rspec = XmlHelper .... |
<s> from distutils . core import setup <EOL> setup ( <EOL> name = "<STR_LIT>" , <EOL> packages = [ "<STR_LIT>" ] , <EOL> package_data = { '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] } , <EOL> version = "<STR_LIT>" , <EOL> description = "<STR_LIT>" , <EOL> author = "<STR_LIT>" , <EOL> author_email = "<STR_LIT>" , <EOL> ... |
<s> import sys <EOL> try : <EOL> import gyp <EOL> except ImportError , e : <EOL> import os . path <EOL> sys . path . append ( os . path . join ( os . path . dirname ( sys . argv [ <NUM_LIT:0> ] ) , '<STR_LIT>' ) ) <EOL> import gyp <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( gyp . script_main ( ) ) </... |
<s> import os <EOL> import unittest , threading , zookeeper <EOL> ZOO_OPEN_ACL_UNSAFE = { "<STR_LIT>" : <NUM_LIT> , "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT>" } <EOL> class TestBase ( unittest . TestCase ) : <EOL> SERVER_PORT = <NUM_LIT> <EOL> def __init__ ( self , methodName = '<STR_LIT>' ) : <EOL> unitt... |
<s> """<STR_LIT>""" <EOL> import os , sys <EOL> import errno <EOL> from pprint import pprint <EOL> import string <EOL> import unittest <EOL> from test_all import db , test_support , verbose , get_new_environment_path , get_new_database_path <EOL> class SimpleRecnoTestCase ( unittest . TestCase ) : <EOL> if ( sys . vers... |
<s> import unittest <EOL> from ctypes import * <EOL> from ctypes . test import need_symbol <EOL> import _ctypes_test <EOL> class SlicesTestCase ( unittest . TestCase ) : <EOL> def test_getslice_cint ( self ) : <EOL> a = ( c_int * <NUM_LIT:100> ) ( * xrange ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> b = range ( <NUM_LIT> , <NUM_... |
<s> import ensurepip <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> ensurepip . _main ( ) </s>
|
<s> from Tkinter import * <EOL> from idlelib import SearchEngine <EOL> from idlelib . SearchDialogBase import SearchDialogBase <EOL> import re <EOL> def replace ( text ) : <EOL> root = text . _root ( ) <EOL> engine = SearchEngine . get ( root ) <EOL> if not hasattr ( engine , "<STR_LIT>" ) : <EOL> engine . _replacedial... |
<s> import unittest <EOL> from test . test_support import requires <EOL> from _tkinter import TclError <EOL> class TextTest ( object ) : <EOL> hw = '<STR_LIT>' <EOL> hwn = hw + '<STR_LIT:\n>' <EOL> Text = None <EOL> def setUp ( self ) : <EOL> self . text = self . Text ( ) <EOL> def test_init ( self ) : <EOL> self . ass... |
<s> """<STR_LIT>""" <EOL> __version__ = "<STR_LIT>" <EOL> __author__ = "<STR_LIT>" <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>"... |
<s> from __future__ import absolute_import <EOL> import logging <EOL> import operator <EOL> import os <EOL> import tempfile <EOL> import shutil <EOL> import warnings <EOL> try : <EOL> import wheel <EOL> except ImportError : <EOL> wheel = None <EOL> from pip . req import RequirementSet <EOL> from pip . basecommand impor... |
<s> from test . test_support import run_unittest , check_warnings <EOL> import cgi <EOL> import os <EOL> import sys <EOL> import tempfile <EOL> import unittest <EOL> from collections import namedtuple <EOL> class HackedSysModule : <EOL> argv = [ ] <EOL> stdin = sys . stdin <EOL> cgi . sys = HackedSysModule ( ) <EOL> tr... |
<s> import unittest <EOL> import os <EOL> import sys <EOL> from test import test_support <EOL> MacOS = test_support . import_module ( '<STR_LIT>' ) <EOL> import Carbon . File <EOL> import macostools <EOL> TESTFN2 = test_support . TESTFN + '<STR_LIT:2>' <EOL> requires_32bit = unittest . skipUnless ( sys . maxint < <NUM_... |
<s> import unittest <EOL> import os <EOL> import os . path <EOL> import sys <EOL> import re <EOL> import tempfile <EOL> from test . test_support import verbose , run_unittest , forget <EOL> from test . script_helper import ( temp_dir , make_script , compile_script , <EOL> make_pkg , make_zip_script , make_zip_pkg ) <EO... |
<s> import os <EOL> from test import test_support <EOL> test_support . import_module ( '<STR_LIT>' ) <EOL> test_support . requires ( '<STR_LIT>' ) <EOL> this_dir = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> lib_tk_test = os . path . abspath ( os . path . join ( this_dir , os . path . pardir , <EOL> ... |
<s> import sys <EOL> import os <EOL> from stat import ST_MTIME <EOL> import imp <EOL> def main ( ) : <EOL> silent = <NUM_LIT:0> <EOL> verbose = <NUM_LIT:0> <EOL> if sys . argv [ <NUM_LIT:1> : ] : <EOL> if sys . argv [ <NUM_LIT:1> ] == '<STR_LIT>' : <EOL> verbose = <NUM_LIT:1> <EOL> elif sys . argv [ <NUM_LIT:1> ] == '<... |
<s> """<STR_LIT>""" <EOL> import sys , errno , getopt , re <EOL> sep1 = '<STR_LIT:=>' * <NUM_LIT> + '<STR_LIT:\n>' <EOL> sep2 = '<STR_LIT:->' * <NUM_LIT> + '<STR_LIT:\n>' <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> truncate_last = <NUM_LIT:0> <EOL> reverse = <NUM_LIT:0> <EOL> branch = None <EOL> opts , args = geto... |
<s> import sys <EOL> if sys . path [ <NUM_LIT:0> ] in ( "<STR_LIT:.>" , "<STR_LIT>" ) : del sys . path [ <NUM_LIT:0> ] <EOL> import sys , os <EOL> from stat import * <EOL> def msg ( str ) : <EOL> sys . stderr . write ( str + '<STR_LIT:\n>' ) <EOL> def main ( ) : <EOL> pathlist = os . environ [ '<STR_LIT>' ] . split ( o... |
<s> """<STR_LIT>""" <EOL> import os , sys , traceback , string <EOL> import tkMessageBox <EOL> def setup ( root , wm = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> try : <EOL> root . tk . eval ( "<STR_LIT>" ) <EOL> except : <EOL> dir = os . path . dirname ( self . __file__ ) <EOL> root . tk . eval ( '<STR_LI... |
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> class PaginationError ( Exception ) : <EOL> """<STR_LIT>""" </s>
|
<s> from django . contrib import admin <EOL> from django . conf . urls import * <EOL> from django . conf import settings <EOL> from django . contrib . auth . decorators import permission_required <EOL> ADMIN_URL_PREFIX = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class AdminViews ( admin . ModelAdmin ) : <E... |
<s> import datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import models <EOL> from app_metrics . compat import AUTH_USER_MODEL <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ( self , orm ) : <EOL> db . alter_column ( '<STR_LIT>' , '<STR_LIT>'... |
<s> from __future__ import unicode_literals <EOL> import datetime <EOL> from frappe import _ <EOL> import frappe <EOL> import frappe . database <EOL> import frappe . utils <EOL> from frappe . utils import cint <EOL> import frappe . utils . user <EOL> from frappe import conf <EOL> from frappe . sessions import Session ,... |
<s> from __future__ import unicode_literals <EOL> import re <EOL> import MySQLdb <EOL> import frappe <EOL> from frappe import _ <EOL> from frappe . utils import now , cint <EOL> from frappe . model import no_value_fields <EOL> from frappe . model . document import Document <EOL> from frappe . custom . doctype . propert... |
<s> from __future__ import unicode_literals <EOL> import frappe , json <EOL> from frappe . model . document import Document <EOL> class Version ( Document ) : <EOL> pass <EOL> @ frappe . whitelist ( ) <EOL> def restore ( version ) : <EOL> if not "<STR_LIT>" in frappe . get_roles ( ) : <EOL> raise frappe . PermissionErr... |
<s> from __future__ import unicode_literals <EOL> import frappe <EOL> from frappe . model . document import Document <EOL> class EventRole ( Document ) : <EOL> pass </s>
|
<s> from __future__ import unicode_literals <EOL> import frappe <EOL> from frappe . website . utils import get_full_index <EOL> def get_context ( context ) : <EOL> context . full_index = get_full_index ( extn = True ) </s>
|
<s> from __future__ import unicode_literals <EOL> import frappe <EOL> from frappe . model . document import Document <EOL> class SocialLoginKeys ( Document ) : <EOL> pass </s>
|
<s> from __future__ import unicode_literals <EOL> import frappe <EOL> from frappe . core . doctype . custom_field . custom_field import create_custom_field <EOL> def execute ( ) : <EOL> if "<STR_LIT>" in frappe . db . get_table_columns ( "<STR_LIT>" ) : <EOL> create_custom_field_for_owner_match ( ) <EOL> def create_cus... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.