code
stringlengths
9
256k
<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 . alter_column ( '<STR_LIT>' , '<STR_LIT:name>' , type_ = sa . VARCHAR ( <NUM_LIT> ) ) <EOL> def downgrade ( ) : <EOL> op . alter_column ( '<STR_...
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> from alembic import op <EOL> def upgrade ( ) : <EOL> op . drop_constraint ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> op . create_foreign_key ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , [ '<STR_LIT>' ] , [ '<STR_LIT:id>' ] , ondelete = '<S...
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> from alembic import op <EOL> def upgrade ( ) : <EOL> op . create_index ( '<STR_LIT>' , '<STR_LIT:source>' , [ '<STR_LIT>' ] ) <EOL> def downgrade ( ) : <EOL> op . drop_index ( '<STR_LIT>' , '<STR_LIT:source>' ) </s>
<s> from datetime import datetime <EOL> from uuid import UUID <EOL> from changes . api . serializer import serialize <EOL> from changes . models import Project , Change <EOL> def test_simple ( ) : <EOL> change = Change ( <EOL> id = UUID ( hex = '<STR_LIT>' ) , <EOL> label = '<STR_LIT>' , <EOL> project = Project ( slug ...
<s> from changes . testutils import APITestCase <EOL> import datetime <EOL> import mock <EOL> class CachedSnapshotClusterDetailsAPITestCase ( APITestCase ) : <EOL> def setUp ( self ) : <EOL> super ( CachedSnapshotClusterDetailsAPITestCase , self ) . setUp ( ) <EOL> self . mock_datetime = datetime . datetime . utcnow ( ...
<s> from changes . testutils import APITestCase <EOL> class PatchDetailsTest ( APITestCase ) : <EOL> def test_simple ( self ) : <EOL> patch = self . create_patch ( ) <EOL> path = '<STR_LIT>' . format ( patch . id . hex ) <EOL> resp = self . client . get ( path ) <EOL> assert resp . status_code == <NUM_LIT:200> <EOL> da...
<s> from changes . config import db <EOL> from changes . models import ProjectOption , SnapshotStatus <EOL> from changes . testutils import APITestCase <EOL> class SnapshotListTest ( APITestCase ) : <EOL> def test_simple ( self ) : <EOL> project_1 = self . create_project ( ) <EOL> build_1 = self . create_build ( projec...
<s> from __future__ import absolute_import <EOL> import mock <EOL> from cStringIO import StringIO <EOL> from changes . config import db <EOL> from changes . jobs . sync_artifact import sync_artifact <EOL> from changes . models import HistoricalImmutableStep <EOL> from changes . testutils import TestCase <EOL> class Syn...
<s> from changes . constants import Result , Status <EOL> from changes . utils . agg import aggregate_result , aggregate_status <EOL> def test_aggregate_result ( ) : <EOL> status_list = [ Result . passed , Result . failed , Result . unknown ] <EOL> assert aggregate_result ( status_list ) == Result . failed <EOL> status...
<s> import unittest <EOL> from test_conversation_manager import * <EOL> from test_performer import * <EOL> from test_emmer import * <EOL> from test_packets import * <EOL> from test_reactor import * <EOL> from test_response_router import * <EOL> from test_tftp_conversation import * <EOL> if __name__ == "<STR_LIT:__main_...
<s> from grouper . audit import get_audits <EOL> from grouper . constants import PERMISSION_AUDITOR <EOL> from grouper . email_util import cancel_async_emails <EOL> from grouper . fe . util import GrouperHandler <EOL> from grouper . model_soup import AUDIT_STATUS_CHOICES , Audit <EOL> from grouper . models . audit_log ...
<s> from grouper . fe . util import GrouperHandler <EOL> from grouper . util import matches_glob <EOL> from grouper . models . audit_log import AuditLog <EOL> from grouper . models . counter import Counter <EOL> from grouper . models . permission_map import PermissionMap <EOL> class PermissionsRevoke ( GrouperHandler )...
<s> from datetime import datetime <EOL> from sqlalchemy import Column , String , DateTime , Index , LargeBinary <EOL> from grouper . models . base . model_base import Model <EOL> class PerfProfile ( Model ) : <EOL> __tablename__ = "<STR_LIT>" <EOL> __table_args__ = ( <EOL> Index ( <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ...
<s> from fixtures import ( <EOL> graph , <EOL> groups , <EOL> permissions , <EOL> session , <EOL> standard_graph , <EOL> users , <EOL> ) <EOL> from grouper . model_soup import GROUP_EDGE_ROLES , Group <EOL> from grouper . permissions import get_groups_by_permission <EOL> from grouper . models . permission import Permis...
<s> import json <EOL> import os <EOL> import requests <EOL> import urllib <EOL> import urlparse <EOL> def _deep_sort ( obj ) : <EOL> if isinstance ( obj , dict ) : <EOL> return { <EOL> key : _deep_sort ( value ) <EOL> for key , value in obj . iteritems ( ) <EOL> } <EOL> elif isinstance ( obj , list ) : <EOL> return sor...
<s> from __future__ import absolute_import , print_function <EOL> """<STR_LIT>""" <EOL> from django . conf import settings <EOL> from django . core . management import call_command <EOL> import sys <EOL> from nsot . services import http <EOL> from nsot . util . commands import NsotCommand , CommandError <EOL> class Com...
<s> from __future__ import unicode_literals <EOL> from django . db import migrations , models <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterIndexTogether ( <EOL> name = '<STR_LIT:value>' , <EOL> index_...
<s> from __future__ import unicode_literals <EOL> import pytest <EOL> pytestmark = pytest . mark . django_db <EOL> import copy <EOL> from django . core . urlresolvers import reverse <EOL> import json <EOL> import logging <EOL> from rest_framework import status <EOL> from . fixtures import live_server , client , user , ...
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> import ast <EOL> import csv <EOL> import logging <EOL> from . . vendor import click <EOL> log = logging . getLogger ( __name__ ) <EOL> NO_ATTRIBUTES = ( '<STR_LIT>' , ) <EOL> def process_site_id ( ctx , param , value ) : <EOL> """<STR_LIT>""" <EOL>...
<s> """<STR_LIT>""" <EOL> import markupbase <EOL> import re <EOL> interesting_normal = re . compile ( '<STR_LIT>' ) <EOL> incomplete = re . compile ( '<STR_LIT>' ) <EOL> entityref = re . compile ( '<STR_LIT>' ) <EOL> charref = re . compile ( '<STR_LIT>' ) <EOL> starttagopen = re . compile ( '<STR_LIT>' ) <EOL> piclose ...
<s> import os , string <EOL> import unittest <EOL> from test_all import db , dbobj , test_support , get_new_environment_path , get_new_database_path <EOL> class dbobjTestCase ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> db_name = '<STR_LIT>' <EOL> def setUp ( self ) : <EOL> self . homeDir = get_new_environment...
<s> import sys <EOL> from ctypes import * <EOL> _array_type = type ( Array ) <EOL> def _other_endian ( typ ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( typ , _OTHER_ENDIAN ) : <EOL> return getattr ( typ , _OTHER_ENDIAN ) <EOL> if isinstance ( typ , _array_type ) : <EOL> return _other_endian ( typ . _type_ ) * typ . _le...
<s> import unittest <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
<s> """<STR_LIT>""" <EOL> import unittest <EOL> from ctypes import * <EOL> import _ctypes_test <EOL> class ValuesTestCase ( unittest . TestCase ) : <EOL> def test_an_integer ( self ) : <EOL> ctdll = CDLL ( _ctypes_test . __file__ ) <EOL> an_integer = c_int . in_dll ( ctdll , "<STR_LIT>" ) <EOL> x = an_integer . value <...
<s> """<STR_LIT>""" <EOL> __revision__ = "<STR_LIT>" <EOL> import os <EOL> from distutils . errors import DistutilsFileError <EOL> from distutils import log <EOL> _copy_action = { None : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> def _copy_file_contents ( src , dst , buffer_...
<s> """<STR_LIT>""" <EOL> __revision__ = "<STR_LIT>" <EOL> import os , sys , re <EOL> from types import StringType , NoneType <EOL> from distutils import sysconfig <EOL> from distutils . dep_util import newer <EOL> from distutils . ccompiler import CCompiler , gen_preprocess_options , gen_lib_options <EOL> from distuti...
<s> import os <EOL> import bdb <EOL> import types <EOL> from Tkinter import * <EOL> from idlelib . WindowList import ListedToplevel <EOL> from idlelib . ScrolledList import ScrolledList <EOL> from idlelib import macosxSupport <EOL> class Idb ( bdb . Bdb ) : <EOL> def __init__ ( self , gui ) : <EOL> self . gui = gui <EO...
<s> from Tkinter import * <EOL> class ToolTipBase : <EOL> def __init__ ( self , button ) : <EOL> self . button = button <EOL> self . tipwindow = None <EOL> self . id = None <EOL> self . x = self . y = <NUM_LIT:0> <EOL> self . _id1 = self . button . bind ( "<STR_LIT>" , self . enter ) <EOL> self . _id2 = self . button ....
<s> import unittest <EOL> from test . test_support import requires <EOL> from _tkinter import TclError <EOL> import Tkinter as tk <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 ...
<s> """<STR_LIT>""" <EOL> from Tkinter import * <EOL> from Dialog import Dialog <EOL> import os <EOL> import fnmatch <EOL> dialogstates = { } <EOL> class FileDialog : <EOL> """<STR_LIT>""" <EOL> title = "<STR_LIT>" <EOL> def __init__ ( self , master , title = None ) : <EOL> if title is None : title = self . title <EOL>...
<s> import sys <EOL> from . main import main <EOL> sys . exit ( main ( "<STR_LIT>" ) ) </s>
<s> """<STR_LIT>""" <EOL> from . . import fixer_base <EOL> from . . fixer_util import Name <EOL> class FixItertools ( fixer_base . BaseFix ) : <EOL> BM_compatible = True <EOL> it_funcs = "<STR_LIT>" <EOL> PATTERN = """<STR_LIT>""" % ( locals ( ) ) <EOL> run_order = <NUM_LIT:6> <EOL> def transform ( self , node , result...
<s> """<STR_LIT>""" <EOL> from . . import fixer_base <EOL> from . . fixer_util import Name <EOL> class FixXreadlines ( fixer_base . BaseFix ) : <EOL> BM_compatible = True <EOL> PATTERN = """<STR_LIT>""" <EOL> def transform ( self , node , results ) : <EOL> no_call = results . get ( "<STR_LIT>" ) <EOL> if no_call : <EOL...
<s> import bisect <EOL> import mmap <EOL> import tempfile <EOL> import os <EOL> import sys <EOL> import threading <EOL> import itertools <EOL> import _multiprocessing <EOL> from multiprocessing . util import Finalize , info <EOL> from multiprocessing . forking import assert_spawning <EOL> __all__ = [ '<STR_LIT>' ] <EOL...
<s> __GNUCLIKE_ASM = <NUM_LIT:3> <EOL> __GNUCLIKE_ASM = <NUM_LIT:2> <EOL> __GNUCLIKE___TYPEOF = <NUM_LIT:1> <EOL> __GNUCLIKE___OFFSETOF = <NUM_LIT:1> <EOL> __GNUCLIKE___SECTION = <NUM_LIT:1> <EOL> __GNUCLIKE_ATTRIBUTE_MODE_DI = <NUM_LIT:1> <EOL> __GNUCLIKE_CTOR_SECTION_HANDLING = <NUM_LIT:1> <EOL> __GNUCLIKE_BUILTIN_CO...
<s> from warnings import warnpy3k <EOL> warnpy3k ( "<STR_LIT>" , stacklevel = <NUM_LIT:2> ) <EOL> del warnpy3k <EOL> cdplayerrc = '<STR_LIT>' <EOL> class Cdplayer : <EOL> def __init__ ( self , tracklist ) : <EOL> import string <EOL> self . artist = '<STR_LIT>' <EOL> self . title = '<STR_LIT>' <EOL> if type ( tracklist ...
<s> from _Dlg import * </s>
<s> def FOUR_CHAR_CODE ( x ) : return x <EOL> pixPurgeBit = <NUM_LIT:0> <EOL> noNewDeviceBit = <NUM_LIT:1> <EOL> useTempMemBit = <NUM_LIT:2> <EOL> keepLocalBit = <NUM_LIT:3> <EOL> useDistantHdwrMemBit = <NUM_LIT:4> <EOL> useLocalHdwrMemBit = <NUM_LIT:5> <EOL> pixelsPurgeableBit = <NUM_LIT:6> <EOL> pixelsLockedBit = <NU...
<s> import os <EOL> from warnings import warnpy3k <EOL> warnpy3k ( "<STR_LIT>" , stacklevel = <NUM_LIT:2> ) <EOL> Error = "<STR_LIT>" <EOL> BGENDIR = "<STR_LIT>" <EOL> INCLUDEDIR = "<STR_LIT>" <EOL> TOOLBOXDIR = "<STR_LIT>" <EOL> CREATOR = "<STR_LIT>" <EOL> try : <EOL> from bgenlocationscustomize import * <EOL> except ...
<s> """<STR_LIT>""" <EOL> import aetools <EOL> import MacOS <EOL> _code = '<STR_LIT>' <EOL> class Text_Suite_Events : <EOL> pass <EOL> class attachment ( aetools . ComponentItem ) : <EOL> """<STR_LIT>""" <EOL> want = '<STR_LIT>' <EOL> class _Prop__3c_Inheritance_3e_ ( aetools . NProperty ) : <EOL> """<STR_LIT>""" <EOL>...
<s> _CHAR_ALIGNMENT = <NUM_LIT:1> <EOL> _SHORT_ALIGNMENT = <NUM_LIT:2> <EOL> _INT_ALIGNMENT = <NUM_LIT:4> <EOL> _LONG_ALIGNMENT = <NUM_LIT:8> <EOL> _LONG_LONG_ALIGNMENT = <NUM_LIT:8> <EOL> _DOUBLE_ALIGNMENT = <NUM_LIT:8> <EOL> _LONG_DOUBLE_ALIGNMENT = <NUM_LIT:16> <EOL> _POINTER_ALIGNMENT = <NUM_LIT:8> <EOL> _MAX_ALIGN...
<s> </s>
<s> """<STR_LIT>""" <EOL> import StringIO <EOL> import getopt <EOL> import json <EOL> import os <EOL> import random <EOL> import re <EOL> import shutil <EOL> import sys <EOL> import time <EOL> import traceback <EOL> import warnings <EOL> import unittest <EOL> import tempfile <EOL> import imp <EOL> import platform <EOL>...
<s> import unittest <EOL> import sys <EOL> import _ast <EOL> from test import test_support <EOL> import textwrap <EOL> class TestSpecifics ( unittest . TestCase ) : <EOL> def test_no_ending_newline ( self ) : <EOL> compile ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> compile ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT...
<s> from test . test_support import run_unittest <EOL> import unittest <EOL> import sys <EOL> import dis <EOL> import StringIO <EOL> def _f ( a ) : <EOL> print a <EOL> return <NUM_LIT:1> <EOL> dis_f = """<STR_LIT>""" % ( _f . func_code . co_firstlineno + <NUM_LIT:1> , <EOL> _f . func_code . co_firstlineno + <NUM_LIT:2>...
<s> from test import test_support <EOL> import types <EOL> import unittest <EOL> class FuncAttrsTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> class F : <EOL> def a ( self ) : <EOL> pass <EOL> def b ( ) : <EOL> return <NUM_LIT:3> <EOL> self . f = F <EOL> self . fi = F ( ) <EOL> self . b = b <EOL> def c...
<s> import unittest <EOL> import __builtin__ <EOL> import exceptions <EOL> import warnings <EOL> from test . test_support import run_unittest , check_warnings <EOL> import os <EOL> import sys <EOL> from platform import system as platform_system <EOL> DEPRECATION_WARNINGS = [ "<STR_LIT>" ] <EOL> if sys . py3kwarning : <...
<s> import unittest , StringIO , robotparser <EOL> from test import test_support <EOL> from urllib2 import urlopen , HTTPError <EOL> HAVE_HTTPS = True <EOL> try : <EOL> from urllib2 import HTTPSHandler <EOL> except ImportError : <EOL> HAVE_HTTPS = False <EOL> class RobotTestCase ( unittest . TestCase ) : <EOL> def __in...
<s> import unittest <EOL> from test import test_support <EOL> test_support . import_module ( '<STR_LIT>' ) <EOL> from _testcapi import _test_structmembersType , CHAR_MAX , CHAR_MIN , UCHAR_MAX , SHRT_MAX , SHRT_MIN , USHRT_MAX , INT_MAX , INT_MIN , UINT_MAX , LONG_MAX , LONG_MIN , ULONG_MAX , LLONG_MAX , LLONG_MIN , UL...
<s> import unittest <EOL> from test import test_support <EOL> test_support . import_module ( '<STR_LIT>' , deprecated = True ) <EOL> from compiler import transformer , ast <EOL> from compiler import compile <EOL> class Tests ( unittest . TestCase ) : <EOL> def testMultipleLHS ( self ) : <EOL> """<STR_LIT>""" <EOL> snip...
<s> import unittest <EOL> from test import test_support <EOL> test_support . requires ( '<STR_LIT>' ) <EOL> import time <EOL> import os <EOL> import subprocess <EOL> winsound = test_support . import_module ( '<STR_LIT>' ) <EOL> ctypes = test_support . import_module ( '<STR_LIT>' ) <EOL> import _winreg <EOL> def has_sou...
<s> """<STR_LIT>""" <EOL> import re <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> uses_relative = [ '<STR_LIT>' , '<STR_LIT:http>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT:file>' , '<STR_LIT>...
<s> __version__ = '<STR_LIT>' <EOL> import re <EOL> import string <EOL> def _namelist ( instance ) : <EOL> namelist , namedict , classlist = [ ] , { } , [ instance . __class__ ] <EOL> for c in classlist : <EOL> for b in c . __bases__ : <EOL> classlist . append ( b ) <EOL> for name in c . __dict__ . keys ( ) : <EOL> if ...
<s> def g ( n ) : <EOL> for i in xrange ( n ) : <EOL> yield n <EOL> print len ( list ( g ( <NUM_LIT> ) ) ) </s>
<s> import sre_compile <EOL> for i in xrange ( <NUM_LIT:1000> ) : <EOL> sre_compile . compile ( "<STR_LIT>" , <NUM_LIT:0> ) </s>
<s> import time <EOL> PIDIGITS_LEN = <NUM_LIT> <EOL> def pidigits ( length ) : <EOL> i = k = ns = <NUM_LIT:0> <EOL> k1 = <NUM_LIT:1> <EOL> n , a , d , t , u = <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> <EOL> while ( True ) : <EOL> k += <NUM_LIT:1> <EOL> t = n << <NUM_LIT:1> <EOL> n *= k <EOL> a...
<s> import os , sys , subprocess , shutil <EOL> sys . path . append ( os . path . dirname ( __file__ ) + "<STR_LIT>" ) <EOL> from test_helper import create_virtenv , run_test <EOL> ENV_NAME = "<STR_LIT>" + os . path . basename ( sys . executable ) <EOL> SRC_DIR = os . path . abspath ( os . path . join ( ENV_NAME , "<ST...
<s> def ident ( x ) : <EOL> return x <EOL> print <NUM_LIT:1> , ident ( <NUM_LIT:2> ) , <NUM_LIT:3> , ident ( <NUM_LIT:4> ) <EOL> print ident ( "<STR_LIT:hello>" ) </s>
<s> class C ( object ) : <EOL> def __add__ ( self , rhs ) : <EOL> print "<STR_LIT>" <EOL> def new_add ( lhs , rhs ) : <EOL> print "<STR_LIT>" <EOL> c = C ( ) <EOL> c . __add__ = new_add <EOL> c + c <EOL> C . __add__ = new_add <EOL> c + c </s>
<s> class C1 ( object ) : <EOL> def __getattr__ ( self , name ) : <EOL> print "<STR_LIT>" , name <EOL> return name <EOL> class C2 ( object ) : <EOL> def __getattribute__ ( self , name ) : <EOL> print "<STR_LIT>" , name <EOL> return name <EOL> c1 = C1 ( ) <EOL> c1 . a = <NUM_LIT:1> <EOL> print c1 . a <EOL> print c1 . b ...
<s> def f ( b ) : <EOL> b2 = b . __nonzero__ ( ) <EOL> for i in xrange ( <NUM_LIT> ) : <EOL> pass <EOL> print b , b2 <EOL> f ( True ) </s>
<s> X = <NUM_LIT:0> <EOL> Y = <NUM_LIT:0> <EOL> Z = <NUM_LIT:0> <EOL> W = <NUM_LIT:0> <EOL> def f ( val , desc ) : <EOL> print desc <EOL> return val <EOL> def wrapper ( ) : <EOL> X = <NUM_LIT:1> <EOL> Y = <NUM_LIT:1> <EOL> Z = <NUM_LIT:1> <EOL> W = <NUM_LIT:1> <EOL> print "<STR_LIT>" <EOL> class C ( f ( object , "<STR_...
<s> class C ( object ) : <EOL> def __init__ ( self , x ) : <EOL> self . x = x <EOL> def __eq__ ( self , y ) : <EOL> print "<STR_LIT>" , y <EOL> return self . x <EOL> def __contains__ ( self , y ) : <EOL> print "<STR_LIT>" , y <EOL> return self . x <EOL> print <NUM_LIT:1> in C ( "<STR_LIT:hello>" ) <EOL> print <NUM_LIT:...
<s> import sys <EOL> def p ( ) : <EOL> print hasattr ( sys . modules [ '<STR_LIT:__main__>' ] , '<STR_LIT:a>' ) <EOL> p ( ) <EOL> a = <NUM_LIT:1> <EOL> p ( ) <EOL> del a <EOL> p ( ) <EOL> try : <EOL> del a <EOL> except NameError , e : <EOL> print e <EOL> a = <NUM_LIT:1> <EOL> def mk_cls ( b1 , b2 ) : <EOL> class C ( ob...
<s> from distutils . core import setup <EOL> import distutils . command . build as build </s>
<s> s = """<STR_LIT>""" <EOL> try : <EOL> exec s <EOL> except Exception as e : <EOL> print repr ( e ) </s>
<s> def foo ( ) : <EOL> print "<STR_LIT:foo>" <EOL> def bar ( ) : <EOL> print "<STR_LIT:bar>" <EOL> l = [ foo , foo , bar , bar ] <EOL> for i in l : <EOL> i ( ) </s>
<s> def f ( o , msg ) : <EOL> print msg <EOL> return o <EOL> g1 = ( f ( i , i ) for i in f ( xrange ( <NUM_LIT:5> ) , "<STR_LIT>" ) ) <EOL> print <NUM_LIT:1> <EOL> print g1 . next ( ) <EOL> print list ( g1 ) <EOL> print <EOL> def f2 ( ) : <EOL> g2 = ( f ( i , j ) for i in f ( xrange ( <NUM_LIT:4> ) , "<STR_LIT>" ) if i...
<s> import sys <EOL> print "<STR_LIT>" in sys . modules <EOL> raise Exception ( "<STR_LIT>" ) </s>
<s> def f2 ( i ) : <EOL> return <NUM_LIT:1.0> / ( i - <NUM_LIT:5> ) <EOL> def f1 ( ) : <EOL> a , b , c , d , e , f , g = range ( <NUM_LIT:7> ) <EOL> for i in xrange ( <NUM_LIT:10> ) : <EOL> try : <EOL> print i , f2 ( i ) <EOL> except Exception , e : <EOL> print e <EOL> return a , b , c , d , e , f , g <EOL> print f1 ( ...
<s> def f ( * args ) : <EOL> print "<STR_LIT>" , <EOL> for a in args : <EOL> print a , <EOL> print "<STR_LIT:)>" <EOL> s = - <NUM_LIT:1> <EOL> try : <EOL> s = sum ( args ) <EOL> except : <EOL> pass <EOL> return s <EOL> print map ( f , range ( <NUM_LIT:10> ) ) <EOL> print map ( f , range ( <NUM_LIT:9> ) , range ( <NUM_L...
<s> class C ( object ) : <EOL> """<STR_LIT:U+0020>""" </s>
<s> import os <EOL> import test_package <EOL> print <NUM_LIT:1> , test_package . __name__ , os . path . normpath ( test_package . __file__ ) . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> import test_package . intrapackage_import <EOL> import test_package . absolute_import <EOL> import test_package . absolute_import_wit...
<s> print "<STR_LIT>" </s>
<s> class MyDescr ( object ) : <EOL> def __set__ ( self , inst , val ) : <EOL> print type ( self ) , type ( inst ) , val <EOL> class Test ( object ) : <EOL> def _setattr__ ( self , name , val ) : <EOL> print name , val <EOL> object . __setattr__ ( self , name , val ) <EOL> foo = MyDescr ( ) <EOL> def test ( t ) : <EOL>...
<s> class S ( str ) : <EOL> pass <EOL> def f ( ) : <EOL> base = "<STR_LIT:.>" * <NUM_LIT> <EOL> for i in xrange ( <NUM_LIT:100> ) : <EOL> s = S ( base ) <EOL> f ( ) <EOL> s = S ( "<STR_LIT>" ) <EOL> s . blah = <NUM_LIT:2> <EOL> print s . blah </s>
<s> import sys <EOL> sys . stdout . write ( "<STR_LIT>" ) <EOL> print >> sys . stdout , "<STR_LIT>" <EOL> print sys . stdout . fileno ( ) </s>
<s> def foo ( ) : <EOL> try : continue <EOL> finally : pass </s>
<s> import weakref <EOL> import gc <EOL> class Foo : <EOL> def wr_cleared ( self , wr ) : <EOL> print "<STR_LIT>" , wr <EOL> def meth ( self ) : <EOL> <NUM_LIT:1> <EOL> def createCycle ( self ) : <EOL> self . __bound_meth = self . meth <EOL> self . __wr = weakref . ref ( self . __bound_meth , self . wr_cleared ) <EOL> ...
<s> import os . path <EOL> import sys <EOL> import subprocess <EOL> PYSTON_DIR = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' ) <EOL> STDMODULE_DIR = os . path . join ( PYSTON_DIR , "<STR_LIT>" ) <EOL> def find_module_source ( module_name ) : <EOL> for pattern in ( "<STR_LIT>" , "<STR_LIT>" ) : ...
<s> import random <EOL> import sys <EOL> from pyxl . utils import escape <EOL> class PyxlException ( Exception ) : <EOL> pass <EOL> class x_base_metaclass ( type ) : <EOL> def __init__ ( self , name , parents , attrs ) : <EOL> super ( x_base_metaclass , self ) . __init__ ( name , parents , attrs ) <EOL> x_base_parents ...
<s> class Error ( Exception ) : <EOL> pass <EOL> class ConfigError ( Error ) : <EOL> pass </s>
<s> from distutils . core import setup <EOL> import os . path <EOL> import sys <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> packages = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> package_data = { '<STR_LIT>' : [ '<STR_LIT:*>' ] } , <EOL> scripts = [ '<STR_LIT>' ] , <EOL> author =...
<s> import os <EOL> import sys <EOL> import numpy as np <EOL> import pydeep . rbm <EOL> import matplotlib . pyplot as plt <EOL> import pydeep . utils . preprocess <EOL> import pydeep . utils . utils <EOL> mnist_dir = os . path . join ( os . environ [ '<STR_LIT>' ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> mnist_train_path = ...
<s> """<STR_LIT>""" <EOL> import os , shutil , sys , tempfile , textwrap , urllib , urllib2 , subprocess <EOL> from optparse import OptionParser <EOL> if sys . platform == '<STR_LIT:win32>' : <EOL> def quote ( c ) : <EOL> if '<STR_LIT:U+0020>' in c : <EOL> return '<STR_LIT>' % c <EOL> else : <EOL> return c <EOL> else :...
<s> """<STR_LIT>""" <EOL> __docformat__ = "<STR_LIT>" <EOL> __author__ = "<STR_LIT>" <EOL> __version__ = "<STR_LIT>" <EOL> __needs__ = '<STR_LIT>' <EOL> from . import default <EOL> from . import shared <EOL> CITATION_TEMPLATE = default . CITATION_TEMPLATE . copy ( ) <EOL> CITATION_TEMPLATE . update ( dict ( <EOL> inden...
<s> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , "<STR_LIT>" ) <EOL> import ssl <EOL> import logging <EOL> import snakemq <EOL> import snakemq . link <EOL> def on_connect ( conn ) : <EOL> sock = slink . get_socket_by_conn ( conn ) <EOL> print conn , sock <EOL> print sock . getpeercert ( ) <EOL> snakemq . init_l...
<s> """<STR_LIT>""" </s>
<s> import csv <EOL> import codecs <EOL> import cStringIO <EOL> import os <EOL> import sys <EOL> import json <EOL> import copy <EOL> import logging <EOL> import cPickle as pickle <EOL> from datetime import datetime <EOL> FORMAT = '<STR_LIT>' <EOL> logging . basicConfig ( format = FORMAT , stream = sys . stdout , level ...
<s> from django . forms import CharField , PasswordInput <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from passwords . validators import ( validate_length , common_sequences , <EOL> dictionary_words , complexity , <EOL> PASSWORD_MIN_LENGTH , PASSWORD_MAX_LENGTH ) <EOL> class PasswordField ( C...
<s> import datetime <EOL> import logging <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> class VideoSequence ( object ) : <EOL> def __init__ ( self , dur , nfrs ) : <EOL> self . dur = dur <EOL> self . nfrs = nfrs <EOL> self . subregions = [ ] <EOL> self . add_subregion ( Subregion ( <NUM_LIT:0> , dur , skip = Tru...
<s> '''<STR_LIT>''' <EOL> import sys <EOL> import os <EOL> if len ( sys . argv ) < <NUM_LIT:2> : <EOL> print >> sys . stderr , "<STR_LIT>" % sys . argv [ <NUM_LIT:0> ] <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> filename = sys . argv . pop ( <NUM_LIT:1> ) <EOL> device = MonkeyRunner . waitForConnection ( ) <EOL> device . ta...
<s> '''<STR_LIT>''' <EOL> import sys <EOL> import os <EOL> import unittest <EOL> try : <EOL> for p in os . environ [ '<STR_LIT>' ] . split ( '<STR_LIT::>' ) : <EOL> if not p in sys . path : <EOL> sys . path . append ( p ) <EOL> except : <EOL> pass <EOL> try : <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . join (...
<s> from functional . tests . identity . v3 import test_identity <EOL> class CatalogTests ( test_identity . IdentityTests ) : <EOL> def test_catalog_list ( self ) : <EOL> raw_output = self . openstack ( '<STR_LIT>' ) <EOL> items = self . parse_listing ( raw_output ) <EOL> self . assert_table_structure ( items , [ '<STR...
<s> import os <EOL> import uuid <EOL> from functional . tests . volume . v1 import common <EOL> class VolumeTests ( common . BaseVolumeTests ) : <EOL> """<STR_LIT>""" <EOL> NAME = uuid . uuid4 ( ) . hex <EOL> OTHER_NAME = uuid . uuid4 ( ) . hex <EOL> HEADERS = [ '<STR_LIT>' ] <EOL> FIELDS = [ '<STR_LIT>' ] <EOL> @ clas...
<s> """<STR_LIT>""" <EOL> import six <EOL> from openstackclient . common import command <EOL> from openstackclient . common import parseractions <EOL> from openstackclient . common import utils <EOL> class AddAggregateHost ( command . ShowOne ) : <EOL> """<STR_LIT>""" <EOL> def get_parser ( self , prog_name ) : <EOL> p...
<s> """<STR_LIT>""" <EOL> import six <EOL> import sys <EOL> from keystoneauth1 import exceptions as ks_exc <EOL> from openstackclient . common import command <EOL> from openstackclient . common import utils <EOL> from openstackclient . i18n import _ <EOL> class CreateDomain ( command . ShowOne ) : <EOL> """<STR_LIT>"""...
<s> """<STR_LIT>""" <EOL> import argparse <EOL> import six <EOL> from openstackclient . common import utils <EOL> from openstackclient . i18n import _ <EOL> from openstackclient . identity import common as identity_common <EOL> from openstackclient . network import common <EOL> from openstackclient . network import uti...
<s> from openstackclient . common import exceptions <EOL> from openstackclient . common import utils <EOL> from openstackclient . compute . v2 import flavor <EOL> from openstackclient . tests . compute . v2 import fakes as compute_fakes <EOL> from openstackclient . tests import utils as tests_utils <EOL> class TestFlav...
<s> import copy <EOL> from openstackclient . identity . v3 import federation_protocol <EOL> from openstackclient . tests import fakes <EOL> from openstackclient . tests . identity . v3 import fakes as identity_fakes <EOL> class TestProtocol ( identity_fakes . TestFederatedIdentity ) : <EOL> def setUp ( self ) : <EOL> s...