code
stringlengths
9
256k
<s> """<STR_LIT>""" <EOL> def get_lambda ( ) : <EOL> return lambda x , y : x + y <EOL> def get_lambdas ( ) : <EOL> return [ lambda a , b : a + b , lambda x , y : x + y ] <EOL> def call_lambda ( F ) : <EOL> return F ( ) <EOL> def call_lambda2 ( callback = None ) : <EOL> return callback ( ) <EOL> def main ( ) : <EOL> f =...
<s> '''<STR_LIT>''' <EOL> def main ( ) : <EOL> a = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] <EOL> b = False <EOL> try : <EOL> a . no_such_method ( ) <EOL> b = '<STR_LIT>' <EOL> except : <EOL> b = True <EOL> TestError ( b == True ) </s>
<s> """<STR_LIT>""" <EOL> def main ( ) : <EOL> a = [ ] <EOL> with rpc ( '<STR_LIT>' ) as server : <EOL> for ob in server . mycollection : <EOL> a . append ( ob ) <EOL> print ( a ) <EOL> TestError ( len ( a ) == <NUM_LIT:10> ) <EOL> TestError ( a [ <NUM_LIT:0> ] == <NUM_LIT:0> ) <EOL> TestError ( a [ <NUM_LIT:1> ] == <N...
<s> tank . explode ( ) <EOL> explosion_channel = explosion_sound . play ( ) <EOL> if explosion_channel is not None : <EOL> left , right = stereo_pan ( tank . position . x , SCREEN_SIZE [ <NUM_LIT:0> ] ) <EOL> explosion_channel . set_volume ( left , right ) </s>
<s> from math import radians <EOL> from OpenGL . GL import * <EOL> from OpenGL . GLU import * <EOL> import pygame <EOL> from pygame . locals import * <EOL> import model3d <EOL> SCREEN_SIZE = ( <NUM_LIT> , <NUM_LIT> ) <EOL> def resize ( width , height ) : <EOL> glViewport ( <NUM_LIT:0> , <NUM_LIT:0> , width , height ) <...
<s> import math <EOL> class Vector2 : <EOL> def __init__ ( self , x = <NUM_LIT:0> , y = <NUM_LIT:0> ) : <EOL> self . x = x <EOL> self . y = y <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . x , self . y ) <EOL> def from_points ( P1 , P2 ) : <EOL> return Vector2 ( P2 [ <NUM_LIT:0> ] - P1 [ <NUM_LIT:0> ]...
<s> class World ( object ) : <EOL> def __init__ ( self ) : <EOL> self . entities = { } <EOL> self . entity_id = <NUM_LIT:0> <EOL> self . background = pygame . surface . Surface ( SCREEN_SIZE ) . convert ( ) <EOL> self . background . fill ( ( <NUM_LIT:255> , <NUM_LIT:255> , <NUM_LIT:255> ) ) <EOL> pygame . draw . circle...
<s> import unittest <EOL> from . vector3 import Vector3 <EOL> class TestVector3 ( unittest . TestCase ) : <EOL> def test_add ( self ) : <EOL> v1 = Vector3 ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ) <EOL> v2 = Vector3 ( <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> ) <EOL> self . assertEqual ( v1 + v2 , ( <NUM_LIT:5> , <NUM_...
<s> import time <EOL> from dubbo_client import ZookeeperRegistry , DubboClient , DubboClientError , ApplicationConfig <EOL> __author__ = '<STR_LIT>' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> config = ApplicationConfig ( '<STR_LIT>' ) <EOL> service_interface = '<STR_LIT>' <EOL> registry = ZookeeperRegistry ( '<S...
<s> import logging <EOL> from django . db import models <EOL> from django . utils . timezone import now <EOL> from account . models import User <EOL> from problem . models import AbstractProblem <EOL> from group . models import Group <EOL> from utils . models import RichTextField <EOL> from jsonfield import JSONField <...
<s> import xmlrpclib <EOL> import httplib <EOL> class TimeoutHTTPConnection ( httplib . HTTPConnection ) : <EOL> def __init__ ( self , host , timeout = <NUM_LIT:10> ) : <EOL> httplib . HTTPConnection . __init__ ( self , host , timeout = timeout ) <EOL> class TimeoutTransport ( xmlrpclib . Transport ) : <EOL> def __init...
<s> from __future__ import unicode_literals <EOL> from django . db import migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . RenameField ( <EOL> model_name = '<STR_LIT>' , <EOL> old_name = '<STR_LIT>'...
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> from scipy import sparse <EOL> from scipy . sparse import csgraph <EOL> from fractions import gcd <EOL> def annotate_nodes ( func ) : <EOL> def new_func ( self ) : <EOL> list_of_components = func ( self ) <EOL> if self . node_labels is not None : <EOL> return [ self . ...
<s> """<STR_LIT>""" <EOL> from . util import ( capture , get_data_dir , get_h5_data_file , write_array , <EOL> max_abs_diff , get_h5_data_group ) </s>
<s> """<STR_LIT>""" <EOL> def test_tic_tac_toc ( ) : <EOL> from . . timing import tic , tac , toc <EOL> import time <EOL> h = <NUM_LIT:0.1> <EOL> tic ( ) <EOL> time . sleep ( h ) <EOL> el1 = tac ( ) <EOL> time . sleep ( h ) <EOL> el2 = tac ( ) <EOL> time . sleep ( h ) <EOL> el3 = toc ( ) <EOL> assert ( abs ( el1 - h ) ...
<s> import tables as pt <EOL> import numpy as np <EOL> class PositionModel ( pt . IsDescription ) : <EOL> timestamp = pt . Time64Col ( ) <EOL> symbol = pt . StringCol ( <NUM_LIT:30> ) <EOL> shares = pt . Int32Col ( ) <EOL> purchase_price = pt . Float32Col ( ) </s>
<s> """<STR_LIT>""" <EOL> __docformat__ = '<STR_LIT>' <EOL> import re , sys <EOL> from epydoc import markup <EOL> from epydoc . markup import epytext <EOL> from epydoc . apidoc import * <EOL> from epydoc . docintrospecter import introspect_docstring_lineno <EOL> from epydoc . util import py_src_filename <EOL> from epyd...
<s> '''<STR_LIT>''' <EOL> '''<STR_LIT>''' <EOL> import math <EOL> import pickle <EOL> import inspect <EOL> import datetime as dt <EOL> from dateutil . relativedelta import relativedelta <EOL> '''<STR_LIT>''' <EOL> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> '''<STR_LIT>''' <EOL> import QSTK . qstkl...
<s> '''<STR_LIT>''' <EOL> import math <EOL> import datetime as dt <EOL> import numpy as np <EOL> from QSTK . qstkutil import qsdateutil <EOL> from math import sqrt <EOL> import pandas as pd <EOL> from copy import deepcopy <EOL> import random as rand <EOL> from QSTK . qstkutil import DataAccess as da <EOL> from QSTK . q...
<s> """<STR_LIT>""" <EOL> from pygments . style import Style <EOL> from pygments . token import Keyword , Name , Comment , String , Error , Number , Operator , Generic , Whitespace , Punctuation , Other , Literal <EOL> class FlaskyStyle ( Style ) : <EOL> background_color = "<STR_LIT>" <EOL> default_style = "<STR_LIT>" ...
<s> """<STR_LIT>""" <EOL> import copy <EOL> from jedi . _compatibility import use_metaclass , unicode <EOL> from jedi . parser import representation as pr <EOL> from jedi . parser . tokenize import Token <EOL> from jedi import debug <EOL> from jedi import common <EOL> from jedi . evaluate . cache import memoize_default...
<s> definition = <NUM_LIT:3> <EOL> a = definition <EOL> b <EOL> a <EOL> b = a <EOL> c = b <EOL> c <EOL> cd = <NUM_LIT:1> <EOL> cd = c <EOL> cd = e <EOL> import math <EOL> math <EOL> b = math <EOL> b <EOL> class C ( object ) : <EOL> def b ( self ) : <EOL> b <EOL> self . b <EOL> self . b ( ) <EOL> self . b <EOL> return <...
<s> int . imag <EOL> int . is_integer <EOL> float . is_int <EOL> <NUM_LIT:1.0> . is_integer <EOL> "<STR_LIT>" . upper <EOL> r"<STR_LIT>" . upper <EOL> "<STR_LIT:=>" . upper <EOL> a = "<STR_LIT:=>" <EOL> a . upper <EOL> arr = [ ] <EOL> arr . app <EOL> list ( ) . app <EOL> [ ] . append <EOL> arr2 = [ <NUM_LIT:1> , <NUM_L...
<s> foo = '<STR_LIT>' </s>
<s> import logging <EOL> import os <EOL> LOGGING = False <EOL> if LOGGING : <EOL> filename = os . path . join ( <EOL> os . path . dirname ( os . path . abspath ( __file__ ) ) , "<STR_LIT>" ) <EOL> logging . basicConfig ( filename = filename , level = logging . DEBUG ) <EOL> log = logging . getLogger ( __name__ ) </s>
<s> """<STR_LIT>""" <EOL> from rdflib . graph import Graph <EOL> from rdflib . term import BNode <EOL> from rdflib . term import Literal <EOL> from rdflib . term import URIRef <EOL> from rdflib . term import Variable <EOL> from rdflib . namespace import RDF <EOL> from rdfextras . utils . termutils import SUBJECT <EOL> ...
<s> import unittest <EOL> from rdflib . graph import Graph <EOL> class QueryTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pass <EOL> def tearDown ( self ) : <EOL> pass <EOL> def testUnicodeString ( self ) : <EOL> from rdfextras . sparql . parser import parse <EOL> from cStringIO import StringIO <E...
<s> import unittest <EOL> from rdfextras . sparql . parser import Query <EOL> qstring = r"""<STR_LIT>""" <EOL> class TestIssue35 ( unittest . TestCase ) : <EOL> def test_issue_35 ( self ) : <EOL> res = Query . parseString ( qstring ) <EOL> assert res is not None <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittes...
<s> from rdflib import ConjunctiveGraph , URIRef , Literal <EOL> from StringIO import StringIO <EOL> import unittest <EOL> import nose <EOL> import rdflib <EOL> testContent = """<STR_LIT>""" <EOL> BASIC_KNOWS_DATA = '''<STR_LIT>''' <EOL> KNOWS_QUERY = '''<STR_LIT>''' <EOL> SUBCLASS_DATA = '''<STR_LIT>''' <EOL> SUBCLASS...
<s> """<STR_LIT>""" <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from rdflib import ConjunctiveGraph , URIRef <EOL> person = URIRef ( '<STR_LIT>' ) <EOL> dad = URIRef ( '<STR_LIT>' ) <EOL> mom = URIRef ( '<STR_LIT>' ) <EOL> momOfDad = URIRef ( '<STR_LIT>' ) <EOL> momOfMom = URIRef ( '<STR_LIT>' ) <EOL> dadOfDad = ...
<s> """<STR_LIT>""" </s>
<s> """<STR_LIT>""" <EOL> from rdflib . term import Literal <EOL> from rdflib . serializer import Serializer <EOL> from rdflib . py3compat import b <EOL> import warnings <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class NTSerializer ( Serializer ) : <EOL> """<STR_LIT>""" <EOL> def serialize ( self , stream , base = None , en...
<s> """<STR_LIT>""" </s>
<s> from rdflib . term import Literal <EOL> from rdflib . term import URIRef <EOL> from rdflib . graph import ConjunctiveGraph <EOL> def test_escaping_of_triple_doublequotes ( ) : <EOL> """<STR_LIT>""" <EOL> g = ConjunctiveGraph ( ) <EOL> g . add ( ( URIRef ( '<STR_LIT>' ) , URIRef ( '<STR_LIT>' ) , Literal ( '<STR_LIT...
<s> import unittest <EOL> from rdflib . graph import Graph <EOL> from rdflib . term import URIRef <EOL> from rdflib . py3compat import b <EOL> class NamespacePrefixTest ( unittest . TestCase ) : <EOL> def test_compute_qname ( self ) : <EOL> """<STR_LIT>""" <EOL> g = Graph ( ) <EOL> self . assertEqual ( g . compute_qnam...
<s> from rdflib . graph import ConjunctiveGraph <EOL> import unittest <EOL> class TestTrixParse ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pass <EOL> def tearDown ( self ) : <EOL> pass <EOL> def testAperture ( self ) : <EOL> g = ConjunctiveGraph ( ) <EOL> g . parse ( "<STR_LIT>" , format = "<STR_LIT>" )...
<s> from . import TestCase <EOL> import JsonStats . FetchStats . Plugins <EOL> from JsonStats . FetchStats import Fetcher <EOL> class TestPluginMount ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . fetcher = Fetcher <EOL> class _example_plugin ( Fetcher ) : <EOL> def __init__ ( self ) : <EOL> self . context = '<...
<s> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> def univariate_kalman ( y , Z , H , T , Q , R ) : <EOL> a = np . zeros ( ( T . shape [ <NUM_LIT:0> ] , y . shape [ <NUM_LIT:0> ] + <NUM_LIT:1> ) ) <EOL> a [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] = y [ <NUM_LIT:0> ] <EOL> P = np . ones ( ( a . shape [ <NUM_LIT...
<s> import traceback <EOL> from git_mirror import * <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> repo = None <EOL> try : <EOL> repos = load_repos ( ) <EOL> reponame = find_repo_by_directory ( repos , os . getcwd ( ) ) <EOL> if reponame is None or reponame not in repos : <EOL> raise Exception ( "<STR_LIT>" . format...
<s> __version__ = ( <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> import sys <EOL> reload ( sys ) <EOL> sys . setdefaultencoding ( '<STR_LIT>' ) <EOL> import types <EOL> from pprint import pprint <EOL> from . entity import classFor , VERSION_ATTRIBUTES , MINIMAL_ATTRIBUTES , PORTFOLIO_ITEM_SUB_TYPES <EOL> class Entit...
<s> import os <EOL> import sys <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> os . environ . setdefault ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> from django . core . management import execute_from_command_line <EOL> execute_from_command_line ( sys . argv ) </s>
<s> """<STR_LIT>""" <EOL> class EqualityComparable : <EOL> __slots__ = [ ] <EOL> def __eq__ ( self , other ) : <EOL> return isinstance ( other , self . __class__ ) and other . id == self . id <EOL> def __ne__ ( self , other ) : <EOL> if isinstance ( other , self . __class__ ) : <EOL> return other . id != self . id <EOL...
<s> from rx . subjects import Subject <EOL> from rx . concurrency import QtScheduler <EOL> import sys <EOL> try : <EOL> from PyQt4 import QtCore <EOL> from PyQt4 . QtGui import QWidget , QLabel <EOL> from PyQt4 . QtGui import QApplication <EOL> except ImportError : <EOL> try : <EOL> from PyQt5 import QtCore <EOL> from ...
<s> import logging <EOL> from datetime import datetime , timedelta <EOL> gevent = None <EOL> from rx . disposables import Disposable , SingleAssignmentDisposable , CompositeDisposable <EOL> from rx . concurrency . scheduler import Scheduler <EOL> log = logging . getLogger ( "<STR_LIT>" ) <EOL> class GEventScheduler ( S...
<s> import heapq <EOL> import rx <EOL> class PriorityQueue ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , capacity = None ) : <EOL> self . items = [ ] <EOL> self . count = <NUM_LIT:0> <EOL> self . lock = rx . config . get ( "<STR_LIT>" ) ( ) <EOL> def __len__ ( self ) : <EOL> """<STR_LIT>""" <EOL> retur...
<s> from rx import Observable <EOL> from rx . internal . basic import default_comparer <EOL> from rx . internal import extensionmethod <EOL> @ extensionmethod ( Observable ) <EOL> def contains ( self , value , comparer = None ) : <EOL> """<STR_LIT>""" <EOL> comparer = comparer or default_comparer <EOL> return self . fi...
<s> from rx . observable import Observable <EOL> from rx . anonymousobservable import AnonymousObservable <EOL> from rx . concurrency import current_thread_scheduler <EOL> from rx . internal import extensionclassmethod <EOL> @ extensionclassmethod ( Observable ) <EOL> def generate ( cls , initial_state , condition , it...
<s> from rx import Observable <EOL> from rx . subjects import Subject <EOL> from rx . internal import extensionmethod <EOL> @ extensionmethod ( Observable ) <EOL> def publish ( self , selector = None ) : <EOL> """<STR_LIT>""" <EOL> if selector : <EOL> return self . multicast ( subject_selector = lambda : Subject ( ) , ...
<s> from rx import AnonymousObservable , Observable <EOL> from rx . disposables import SingleAssignmentDisposable , SerialDisposable , ScheduledDisposable <EOL> from rx . internal import extensionmethod <EOL> @ extensionmethod ( Observable ) <EOL> def subscribe_on ( self , scheduler ) : <EOL> """<STR_LIT>""" <EOL> sour...
<s> from rx import Observable , Observer <EOL> from rx . anonymousobservable import AnonymousObservable <EOL> from rx . disposables import CompositeDisposable <EOL> from rx . internal import extensionclassmethod <EOL> @ extensionclassmethod ( Observable ) <EOL> def when ( cls , * args ) : <EOL> """<STR_LIT>""" <EOL> pl...
<s> from rx import Observer <EOL> from rx . notification import OnNext , OnError , OnCompleted <EOL> from . recorded import Recorded <EOL> from . reactive_assert import AssertList <EOL> class MockObserver ( Observer ) : <EOL> def __init__ ( self , scheduler ) : <EOL> self . scheduler = scheduler <EOL> self . messages =...
<s> from rx . disposables import Disposable , BooleanDisposable , SingleAssignmentDisposable <EOL> from rx . disposables import CompositeDisposable , SerialDisposable <EOL> from rx . disposables import RefCountDisposable <EOL> def test_anonymousdisposable_create ( ) : <EOL> def action ( ) : <EOL> pass <EOL> disposable ...
<s> import unittest <EOL> from rx import Observable <EOL> from rx . testing import TestScheduler , ReactiveTest , is_prime , MockDisposable <EOL> from rx . disposables import Disposable , SerialDisposable <EOL> on_next = ReactiveTest . on_next <EOL> on_completed = ReactiveTest . on_completed <EOL> on_error = ReactiveTe...
<s> import unittest <EOL> from rx import Observable <EOL> from rx . testing import TestScheduler , ReactiveTest , is_prime , MockDisposable <EOL> from rx . disposables import Disposable , SerialDisposable <EOL> on_next = ReactiveTest . on_next <EOL> on_completed = ReactiveTest . on_completed <EOL> on_error = ReactiveTe...
<s> import unittest <EOL> from rx import Observable <EOL> from rx . testing import TestScheduler , ReactiveTest , is_prime , MockDisposable <EOL> from rx . disposables import Disposable , SerialDisposable <EOL> on_next = ReactiveTest . on_next <EOL> on_completed = ReactiveTest . on_completed <EOL> on_error = ReactiveTe...
<s> import unittest <EOL> from datetime import datetime , timedelta <EOL> from rx import Observable <EOL> from rx . testing import TestScheduler , ReactiveTest , is_prime , MockDisposable <EOL> from rx . disposables import Disposable , SerialDisposable , BooleanDisposable <EOL> on_next = ReactiveTest . on_next <EOL> on...
<s> from django . conf import settings <EOL> import datetime <EOL> class Settings : <EOL> def __init__ ( self , options ) : <EOL> self . handlers = options . get ( "<STR_LIT>" , None ) <EOL> if not self . handlers : <EOL> self . handlers = ( <EOL> "<STR_LIT>" , <EOL> ) <EOL> self . realm = options . get ( "<STR_LIT>" ,...
<s> """<STR_LIT>""" <EOL> from aiorest_ws . auth . user . utils import generate_password_hash <EOL> __all__ = ( '<STR_LIT>' , '<STR_LIT>' , ) <EOL> class AbstractUser ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( AbstractUser , self ) . __init__ ( ) <EOL> self . fir...
<s> """<STR_LIT>""" <EOL> import inspect <EOL> from aiorest_ws . exceptions import NotSupportedArgumentType , InvalidPathArgument , InvalidHandler <EOL> from aiorest_ws . views import MethodBasedView <EOL> from aiorest_ws . utils . validators import to_str , get_object_type <EOL> __all__ = ( <EOL> '<STR_LIT>' , '<STR_L...
<s> from fixtures . command_line import default_command_line as cmd <EOL> def test_define ( cmd ) : <EOL> assert len ( cmd . options . _option_string_actions . keys ( ) ) == <NUM_LIT:4> <EOL> def test_define_add_args ( cmd ) : <EOL> cmd . define ( '<STR_LIT>' , default = '<STR_LIT>' , help = '<STR_LIT>' , type = str ) ...
<s> from patchwords . models import * <EOL> from patchwords . queries import * <EOL> p = Paragraph . objects . filter ( parent = None ) [ <NUM_LIT:5> ] <EOL> print "<STR_LIT>" , p . _print_subtree ( ) <EOL> print getMostPopularSubtree ( p ) </s>
<s> ZIPFILE = b"""<STR_LIT>""" <EOL> import base64 <EOL> import os . path <EOL> import pkgutil <EOL> import shutil <EOL> import sys <EOL> import tempfile <EOL> def bootstrap ( tmpdir = None ) : <EOL> import pip <EOL> packages = [ "<STR_LIT>" ] <EOL> if "<STR_LIT>" in sys . argv or os . environ . get ( "<STR_LIT>" ) : <...
<s> from . helpers import ResourceBase , IterableResource <EOL> from . errors import ok_or_error , response_or_error <EOL> from . compat import update_doc <EOL> class SshFilteredIterableResource ( IterableResource ) : <EOL> def all ( self , user = None ) : <EOL> """<STR_LIT>""" <EOL> params = { } <EOL> if user : <EOL> ...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> from __future__ import division <EOL> from __future__ import unicode_literals <EOL> from . import arduino_params_file <EOL> class ItemsFile ( arduino_params_file . ParamsFile ) : <EOL> def __init__ ( self ...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> from __future__ import division <EOL> from __future__ import unicode_literals <EOL> import time <EOL> import threading <EOL> from . import deco <EOL> from . import serial_port <EOL> @ deco . singleton <EOL...
<s> def saveState ( settings , widget , key ) : <EOL> settings . beginGroup ( key ) <EOL> settings . setValue ( '<STR_LIT>' , widget . pos ) <EOL> settings . setValue ( '<STR_LIT:size>' , widget . size ) <EOL> if hasattr ( widget , '<STR_LIT>' ) : <EOL> settings . setValue ( '<STR_LIT:state>' , widget . saveState ( ) )...
<s> '''<STR_LIT>''' <EOL> import director . vtkAll as vtk <EOL> import director . vtkNumpy as vnp <EOL> from director . shallowCopy import shallowCopy <EOL> import numpy as np <EOL> def thresholdPoints ( polyData , arrayName , thresholdRange ) : <EOL> assert ( polyData . GetPointData ( ) . GetArray ( arrayName ) ) <EOL...
<s> import director . vtkAll as vtk <EOL> import director . objectmodel as om <EOL> from director import lcmUtils <EOL> try : <EOL> import bot_lcmgl <EOL> LCMGL_AVAILABLE = True <EOL> except ImportError : <EOL> LCMGL_AVAILABLE = False <EOL> class LCMGLObject ( om . ObjectModelItem ) : <EOL> def __init__ ( self , name ,...
<s> import os <EOL> import sys <EOL> import vtk <EOL> import math <EOL> import PythonQt <EOL> from PythonQt import QtCore , QtGui <EOL> import director . objectmodel as om <EOL> from director import drcargs <EOL> from director import robotstate <EOL> from director . timercallback import TimerCallback <EOL> from directo...
<s> from __future__ import division <EOL> import director <EOL> from director import irisdriver <EOL> import os <EOL> import sys <EOL> import PythonQt <EOL> import json <EOL> from PythonQt import QtCore , QtGui <EOL> from time import time <EOL> import imp <EOL> import director . applogic as app <EOL> from director impo...
<s> import time <EOL> from PythonQt import QtCore <EOL> import traceback <EOL> class TimerCallback ( object ) : <EOL> def __init__ ( self , targetFps = <NUM_LIT:30> ) : <EOL> '''<STR_LIT>''' <EOL> self . targetFps = targetFps <EOL> self . timer = QtCore . QTimer ( ) <EOL> self . useScheduledTimer = True <EOL> self . ti...
<s> import os <EOL> import sys <EOL> import time <EOL> import lcm <EOL> import functools <EOL> import threading <EOL> import glob <EOL> import json <EOL> import re <EOL> import select <EOL> import numpy as np <EOL> from director import lcmspy as spy <EOL> VIDEO_LCM_URL = '<STR_LIT>' <EOL> class FieldData ( object ) : <...
<s> from director import robotsystem <EOL> import os <EOL> import numpy as np <EOL> import pydrake <EOL> from pydrake . solvers import ik <EOL> from director import drcargs <EOL> from director . consoleapp import ConsoleApp <EOL> from director import visualization as vis <EOL> from director import objectmodel as om <EO...
<s> from rosbridge_library . capability import Capability <EOL> from rosbridge_library . internal import ros_loader , message_conversion <EOL> class ServiceResponse ( Capability ) : <EOL> service_response_msg_fields = [ <EOL> ( True , "<STR_LIT>" , ( str , unicode ) ) , ( False , "<STR_LIT:id>" , ( str , unicode ) ) , ...
<s> import sys <EOL> import rospy <EOL> import rostest <EOL> import unittest <EOL> from rosgraph import Master <EOL> from time import sleep , time <EOL> from rosbridge_library . internal . subscribers import * <EOL> from rosbridge_library . internal . topics import * <EOL> from rosbridge_library . internal import ros_l...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , division , print_function , with_statement <EOL> import datetime <EOL> import errno <EOL> import functools <EOL> import heapq <EOL> import itertools <EOL> import logging <EOL> import numbers <EOL> import os <EOL> import select <EOL> import sys <EOL> imp...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , division , print_function , with_statement <EOL> import base64 <EOL> import binascii <EOL> import datetime <EOL> import email . utils <EOL> import functools <EOL> import gzip <EOL> import hashlib <EOL> import hmac <EOL> import mimetypes <EOL> import num...
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import os <EOL> import sys <EOL> import time <EOL> from docopt import docopt <EOL> from colorclass import Color <EOL> from colorclass import disable_all_colors , enable_all_colors , is_enabled <EOL> from colorclass import set_dark_background , set_li...
<s> """<STR_LIT>""" <EOL> from textwrap import dedent <EOL> import pytest <EOL> from terminaltables . tables import AsciiTable , UnixTable <EOL> @ pytest . mark . parametrize ( '<STR_LIT>' , [ AsciiTable , UnixTable ] ) <EOL> def test_empty ( cls ) : <EOL> """<STR_LIT>""" <EOL> table = cls ( [ ] ) <EOL> assert <NUM_LIT...
<s> from AlphaGo . preprocessing . preprocessing import Preprocess <EOL> import AlphaGo . go as go <EOL> import numpy as np <EOL> import unittest <EOL> def simple_board ( ) : <EOL> gs = go . GameState ( size = <NUM_LIT:7> ) <EOL> gs . do_move ( ( <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> gs . do_move ( ( <NUM_LIT:1> , <NUM_L...
<s> import os <EOL> COV = None <EOL> if os . environ . get ( '<STR_LIT>' ) : <EOL> import coverage <EOL> COV = coverage . coverage ( branch = True , include = '<STR_LIT>' ) <EOL> COV . start ( ) <EOL> from app import create_app , db <EOL> from app . models import User , Follow , Role , Permission , Post , Comment <EOL>...
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import stat <EOL> import genericpath <EOL> import warnings <EOL> from genericpath import * <EOL> from genericpath import _unicode <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT...
<s> """<STR_LIT>""" <EOL> from alembic import context <EOL> from paste . deploy import loadapp <EOL> from logging . config import fileConfig <EOL> from sqlalchemy . engine . base import Engine <EOL> try : <EOL> from pylons import config as pylons_config <EOL> pylons_config [ '<STR_LIT>' ] <EOL> except : <EOL> config = ...
<s> """<STR_LIT>""" <EOL> import os , sys , threading <EOL> try : <EOL> from coverage . tracer import CTracer <EOL> except ImportError : <EOL> if os . getenv ( '<STR_LIT>' ) == '<STR_LIT:c>' : <EOL> sys . stderr . write ( <EOL> "<STR_LIT>" <EOL> ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> CTracer = None <EOL> class PyTrac...
<s> import getpass <EOL> from . _compat import string_types , ascii_lowercase , input <EOL> def prompt ( name , default = None ) : <EOL> """<STR_LIT>""" <EOL> prompt = name + ( default and '<STR_LIT>' % default or '<STR_LIT>' ) <EOL> prompt += name . endswith ( '<STR_LIT:?>' ) and '<STR_LIT:U+0020>' or '<STR_LIT>' <EOL...
<s> </s>
<s> from datetime import datetime <EOL> import errno <EOL> import socket <EOL> import ssl <EOL> import sys <EOL> import gunicorn . http as http <EOL> import gunicorn . http . wsgi as wsgi <EOL> import gunicorn . util as util <EOL> import gunicorn . workers . base as base <EOL> from gunicorn import six <EOL> ALREADY_HAN...
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import re <EOL> import json <EOL> import mimetypes <EOL> import getpass <EOL> from io import BytesIO <EOL> from argparse import ArgumentParser , ArgumentTypeError , ArgumentError <EOL> try : <EOL> from collections import OrderedDict <EOL> except ImportError : <...
<s> import os , stat , posixpath , re <EOL> from mako import exceptions , util <EOL> from mako . template import Template <EOL> try : <EOL> import threading <EOL> except : <EOL> import dummy_threading as threading <EOL> class TemplateCollection ( object ) : <EOL> """<STR_LIT>""" <EOL> def has_template ( self , uri ) : ...
<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> from . import Extension <EOL> from . . inlinepatterns import Pattern <EOL> from . . util import etree <EOL> import re <EOL> def build_url ( label , base , end ) : <EOL> """<STR_LIT>""" <EOL> clean_label ...
<s> """<STR_LIT>""" <EOL> import socket <EOL> from . models import Response <EOL> from . packages . urllib3 . poolmanager import PoolManager , proxy_from_url <EOL> from . packages . urllib3 . response import HTTPResponse <EOL> from . packages . urllib3 . util import Timeout as TimeoutSauce <EOL> from . compat import ur...
<s> """<STR_LIT>""" <EOL> import os . path <EOL> import fnmatch <EOL> from pygments . formatters . _mapping import FORMATTERS <EOL> from pygments . plugin import find_plugin_formatters <EOL> from pygments . util import ClassNotFound <EOL> ns = globals ( ) <EOL> for fcls in FORMATTERS : <EOL> ns [ fcls . __name__ ] = fc...
<s> """<STR_LIT>""" <EOL> from pygments . style import Style <EOL> from pygments . token import Token , Comment , Name , Keyword , Generic , Number , String , Whitespace <EOL> class FruityStyle ( Style ) : <EOL> """<STR_LIT>""" <EOL> background_color = '<STR_LIT>' <EOL> highlight_color = '<STR_LIT>' <EOL> styles = { <E...
<s> try : <EOL> from urllib . parse import urlencode <EOL> except ImportError : <EOL> from urllib import urlencode <EOL> from . filepost import encode_multipart_formdata <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class RequestMethods ( object ) : <EOL> """<STR_LIT>""" <EOL> _encode_url_methods = set ( [ '<STR_LIT>' , '<STR_...
<s> import subprocess <EOL> from subprocess import PIPE <EOL> import time <EOL> from selenium . common . exceptions import WebDriverException <EOL> from selenium . webdriver . common import utils <EOL> class Service ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , executable_path , port = <NUM_LIT:0> , ho...
<s> import os <EOL> import re <EOL> import sys <EOL> from glob import glob <EOL> import pkg_resources <EOL> from distutils . command . sdist import sdist as _sdist <EOL> from distutils . util import convert_path <EOL> from distutils import log <EOL> from setuptools import svn_utils <EOL> READMES = ( '<STR_LIT>' , '<STR...
<s> """<STR_LIT>""" <EOL> from ... connectors . zxJDBC import ZxJDBCConnector <EOL> from . base import MSDialect , MSExecutionContext <EOL> from ... import engine <EOL> class MSExecutionContext_zxjdbc ( MSExecutionContext ) : <EOL> _embedded_scope_identity = False <EOL> def pre_exec ( self ) : <EOL> super ( MSExecution...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from . pysqlite import SQLiteDialect_pysqlite <EOL> from ... engine import url as _url <EOL> from ... import pool <EOL> class SQLiteDialect_pysqlcipher ( SQLiteDialect_pysqlite ) : <EOL> driver = '<STR_LIT>' <EOL> pragmas = ( '<STR_LIT>' , '<STR_LIT...
<s> """<STR_LIT>""" <EOL> import itertools <EOL> import operator <EOL> import weakref <EOL> from . . import exc , orm , util <EOL> from . . orm import collections , interfaces <EOL> from . . sql import not_ , or_ <EOL> def association_proxy ( target_collection , attr , ** kw ) : <EOL> """<STR_LIT>""" <EOL> return Assoc...
<s> """<STR_LIT>""" <EOL> from . import exc , collections , interfaces , state <EOL> from . . import util <EOL> from . import base <EOL> class ClassManager ( dict ) : <EOL> """<STR_LIT>""" <EOL> MANAGER_ATTR = base . DEFAULT_MANAGER_ATTR <EOL> STATE_ATTR = base . DEFAULT_STATE_ATTR <EOL> deferred_scalar_loader = None <...