code
stringlengths
9
256k
<s> '''<STR_LIT>''' <EOL> import numpy as np <EOL> from pomegranate import * <EOL> guest = DiscreteDistribution ( { '<STR_LIT:A>' : <NUM_LIT:1.> / <NUM_LIT:3> , '<STR_LIT:B>' : <NUM_LIT:1.> / <NUM_LIT:3> , '<STR_LIT:C>' : <NUM_LIT:1.> / <NUM_LIT:3> } ) <EOL> prize = DiscreteDistribution ( { '<STR_LIT:A>' : <NUM_LIT:1.>...
<s> from __future__ import print_function <EOL> from bloom . commands . git . patch . common import get_patch_config <EOL> from bloom . commands . git . patch . common import set_patch_config <EOL> from bloom . git import branch_exists <EOL> from bloom . git import checkout <EOL> from bloom . git import get_commit_hash...
<s> import os <EOL> if '<STR_LIT>' in os . environ : <EOL> scripts = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' , '<STR_LIT>' ) <EOL> scripts = os . path . abspath ( scripts ) <EOL> os . environ [ '<STR_LIT>' ] = scripts + '<STR_LIT::>' + os . environ [ '<STR_LIT>' ] </s>
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import os <EOL> CATKIN_WORKSPACE_MARKER_FILE = '<STR_LIT>' <EOL> def get_spaces ( paths = None ) : <EOL> """<STR_LIT>""" <EOL> if paths is None : <EOL> if '<STR_LIT>' not in os . environ : <EOL> raise RuntimeError ( '<STR_LIT>' ) <EOL> paths = os . e...
<s> import subprocess <EOL> from . . installers import PackageManagerInstaller <EOL> from . source import SOURCE_INSTALLER <EOL> ARCH_OS_NAME = '<STR_LIT>' <EOL> PACMAN_INSTALLER = '<STR_LIT>' <EOL> def register_installers ( context ) : <EOL> context . set_installer ( PACMAN_INSTALLER , PacmanInstaller ( ) ) <EOL> def ...
<s> import os <EOL> import traceback <EOL> from mock import Mock , patch <EOL> import rospkg . os_detect <EOL> def is_gentoo ( ) : <EOL> return rospkg . os_detect . Gentoo ( ) . is_os ( ) <EOL> def get_test_dir ( ) : <EOL> return os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ...
<s> from __future__ import print_function <EOL> import os <EOL> from catkin . workspace import get_source_paths , get_workspaces <EOL> from catkin_pkg . packages import find_packages <EOL> def _get_valid_search_dirs ( search_dirs , project ) : <EOL> """<STR_LIT>""" <EOL> valid_global_search_dirs = [ '<STR_LIT>' , '<STR...
<s> import em <EOL> import os <EOL> import sys <EOL> import stat <EOL> import unittest <EOL> import tempfile <EOL> import shutil <EOL> class OrderPackagesEmTest ( unittest . TestCase ) : <EOL> def test_env_cached_static ( self ) : <EOL> sys . stdout = em . ProxyFile ( sys . stdout ) <EOL> template_file = os . path . jo...
<s> from . import formats <EOL> from . core . format_manager import convert , format_manager <EOL> from . core . contents_manager import IPymdContentsManager <EOL> from . core . scripts import convert_files <EOL> __version__ = '<STR_LIT>' </s>
<s> """<STR_LIT>""" <EOL> from . . python import _is_python , PythonFilter <EOL> def test_python ( ) : <EOL> assert _is_python ( "<STR_LIT>" ) <EOL> assert not _is_python ( "<STR_LIT>" ) <EOL> def test_python_filter ( ) : <EOL> filter = PythonFilter ( ) <EOL> assert filter ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> filter = ...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_L...
<s> from django . core . urlresolvers import reverse <EOL> from django . test import TestCase <EOL> from helpdesk . tests . helpers import get_staff_user , reload_urlconf <EOL> class TestKBDisabled ( TestCase ) : <EOL> def setUp ( self ) : <EOL> from helpdesk import settings <EOL> self . HELPDESK_KB_ENABLED = settings ...
<s> from djangojy . db . backends import BaseDatabaseIntrospection <EOL> class DatabaseIntrospection ( BaseDatabaseIntrospection ) : <EOL> data_types_reverse = { <EOL> <NUM_LIT:16> : '<STR_LIT>' , <EOL> <NUM_LIT:20> : '<STR_LIT>' , <EOL> <NUM_LIT> : '<STR_LIT>' , <EOL> <NUM_LIT> : '<STR_LIT>' , <EOL> <NUM_LIT> : '<STR_...
<s> """<STR_LIT>""" <EOL> import os . path <EOL> __all__ = [ <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] <EOL> class render_cheetah : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , path ) : <EOL> from Cheetah . Template import Template <EOL> self . path = path <EOL> def __getattr__ ( ...
<s> '''<STR_LIT>''' <EOL> from freetype import * <EOL> def bits ( x ) : <EOL> data = [ ] <EOL> for i in range ( <NUM_LIT:8> ) : <EOL> data . insert ( <NUM_LIT:0> , int ( ( x & <NUM_LIT:1> ) == <NUM_LIT:1> ) ) <EOL> x = x >> <NUM_LIT:1> <EOL> return data <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import numpy <EO...
<s> """<STR_LIT>""" <EOL> FT_STROKER_LINECAPS = { '<STR_LIT>' : <NUM_LIT:0> , <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : <NUM_LIT:2> } <EOL> globals ( ) . update ( FT_STROKER_LINECAPS ) </s>
<s> from setuptools import setup , find_packages <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = "<STR_LIT>" , <EOL> description = '<STR_LIT>' , <EOL> long_description = open ( '<STR_LIT>' ) . read ( ) , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> maintainer = '<STR_LIT>' , <EOL> main...
<s> import quantities as pq <EOL> import neo <EOL> from PyQt4 . Qt import QMessageBox <EOL> from spykeutils . plugin import analysis_plugin , gui_data <EOL> from spykeutils import plot <EOL> stop_prop = gui_data . ValueProp ( False ) <EOL> align_prop = gui_data . ValueProp ( False ) <EOL> optimize_prop = gui_data . Val...
<s> import subprocess <EOL> import os <EOL> import re <EOL> import argparse <EOL> from logging import debug , info , warning as warn <EOL> from servi . command import Command , process_and_run_command_line as servi_run <EOL> import servi . config as c <EOL> from servi . utils import timeit , nice_temporary_directory <E...
<s> from tests . fixtures import * <EOL> import servi . config as c <EOL> from servi . command import process_and_run_command_line as servi_run <EOL> @ pytest . fixture <EOL> def mock_ansible_inventory ( ) : <EOL> inv_path = os . path . join ( <EOL> c . MASTER_DIR , '<STR_LIT>' ) <EOL> inv_file = os . path . join ( inv...
<s> __author__ = '<STR_LIT>' <EOL> __copyright__ = '<STR_LIT>' <EOL> __license__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> from google . protobuf . descriptor_pb2 import FileDescriptorProto <EOL> class Pbd ( ) : <EOL> """<STR_LIT>""" <EOL> LABELS = [ None...
<s> import os <EOL> import sys <EOL> import urllib <EOL> import simplejson as json <EOL> from grit . repo import Local <EOL> from grit . repo import is_repo , get_repos <EOL> from grit . repo . version import Item <EOL> from grit . util import serialize <EOL> from grit . exc import * <EOL> from grit . log import log <E...
<s> import os <EOL> from smisk . core import Application <EOL> from smisk . ipc . bsddb import shared_dict <EOL> from smisk . serialization . json import json_encode , json_decode <EOL> class KeyValueStore ( Application ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , * va , ** kw ) : <EOL> '''<STR_LIT>''' <EOL> A...
<s> from smisk . test import * <EOL> from smisk . config import * <EOL> import logging <EOL> log = logging . getLogger ( __name__ ) <EOL> FILESDIR = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) <EOL> class ConfigTests ( TestCase ) : <EOL> def test1_basics ( self ) : <EOL> log . info ( '<STR_LIT>'...
<s> '''<STR_LIT>''' <EOL> import inspect <EOL> try : <EOL> import reprlib <EOL> except ImportError : <EOL> import repr as reprlib <EOL> from smisk . util . type import * <EOL> from smisk . util . cache import callable_cache_key <EOL> from smisk . util . frozen import frozendict <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT...
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import os <EOL> import sys <EOL> import errno <EOL> import struct <EOL> import select <EOL> import socket <EOL> import optparse <EOL> BACKLOG = <NUM_LIT:5> <EOL> CHILDREN = [ ] <EOL> FREE , BUSY = <NUM_LIT:0> , <NUM_LIT:1> <EOL> FMT = '<STR_LIT>' <EOL> def write_...
<s> __author__ = '<STR_LIT>' <EOL> import itertools <EOL> try : <EOL> from collections import OrderedDict <EOL> except ImportError : <EOL> from odict import odict as OrderedDict <EOL> from slimit . lexer import Lexer <EOL> ID_CHARS = '<STR_LIT>' <EOL> def powerset ( iterable ) : <EOL> """<STR_LIT>""" <EOL> s = list ( i...
<s> import genelements <EOL> import genpdftext <EOL> from genpdftext import NodeHandler , FontHandler , HandleEmphasis <EOL> nodehandlers = NodeHandler ( ) </s>
<s> import sys , os <EOL> extensions = [ '<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>' <EOL> copyright = u'<STR_LIT>' <EOL> version = '<STR_LIT:1>' <EOL> release = '<STR_LIT:1>' <EOL> exclude_trees =...
<s> from math import atan2 , pi <EOL> import PIL <EOL> from app import _ , Bezier , EmptyPattern , Rotation , Translation , _sketch <EOL> from app . Graphics . curveop import arrow_trafos <EOL> import reportlab . pdfgen . canvas <EOL> import app <EOL> def make_pdf_path ( pdfpath , paths ) : <EOL> for path in paths : <E...
<s> """<STR_LIT>""" <EOL> NSID = <NUM_LIT:3> <EOL> class Option ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , otype ) : <EOL> """<STR_LIT>""" <EOL> self . otype = otype <EOL> def to_wire ( self , file ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def from_wire ( cls , otype , wire , c...
<s> import dns . rdtypes . nsbase <EOL> class DNAME ( dns . rdtypes . nsbase . UncompressedNS ) : <EOL> """<STR_LIT>""" <EOL> def to_digestable ( self , origin = None ) : <EOL> return self . target . to_digestable ( origin ) </s>
<s> import dns . exception <EOL> import dns . ipv4 <EOL> import dns . rdata <EOL> import dns . tokenizer <EOL> class A ( dns . rdata . Rdata ) : <EOL> """<STR_LIT>""" <EOL> __slots__ = [ '<STR_LIT:address>' ] <EOL> def __init__ ( self , rdclass , rdtype , address ) : <EOL> super ( A , self ) . __init__ ( rdclass , rdty...
<s> """<STR_LIT>""" <EOL> import dns . exception <EOL> class BadTTL ( dns . exception . SyntaxError ) : <EOL> """<STR_LIT>""" <EOL> def from_text ( text ) : <EOL> """<STR_LIT>""" <EOL> if text . isdigit ( ) : <EOL> total = long ( text ) <EOL> else : <EOL> if not text [ <NUM_LIT:0> ] . isdigit ( ) : <EOL> raise BadTTL <...
<s> import cStringIO <EOL> import select <EOL> import sys <EOL> import time <EOL> import unittest <EOL> import dns . name <EOL> import dns . message <EOL> import dns . name <EOL> import dns . rdataclass <EOL> import dns . rdatatype <EOL> import dns . resolver <EOL> resolv_conf = """<STR_LIT>""" <EOL> message_text = """...
<s> from django import forms <EOL> from django . core . exceptions import ValidationError <EOL> from core . interface . static_intr . models import StaticInterface <EOL> from mozdns . view . models import View <EOL> from core . range . models import Range <EOL> from mozdns . validation import validate_label <EOL> from ...
<s> from settings import CORE_BASE_URL <EOL> class ObjectUrlMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> def get_absolute_url ( self ) : <EOL> """<STR_LIT>""" <EOL> return CORE_BASE_URL + "<STR_LIT>" . format ( <EOL> self . _meta . db_table , self . pk <EOL> ) <EOL> def absolute_url ( self ) : <EOL> return self . get...
<s> from django . db . models import Q <EOL> from django . core . exceptions import ValidationError <EOL> import ipaddr <EOL> import smtplib <EOL> from email . mime . text import MIMEText <EOL> from settings . local import people_who_need_to_know_about_failures <EOL> from settings . local import inventorys_email <EOL> ...
<s> from django . test import TestCase <EOL> from mozdns . address_record . models import AddressRecord <EOL> from mozdns . cname . models import CNAME <EOL> from mozdns . txt . models import TXT <EOL> from mozdns . mx . models import MX <EOL> from mozdns . srv . models import SRV <EOL> from mozdns . domain . models im...
<s> from django . db import models <EOL> from mozdns . domain . models import Domain <EOL> from mozdns . models import MozdnsRecord <EOL> from mozdns . validation import validate_srv_label , validate_srv_port <EOL> from mozdns . validation import validate_srv_priority , validate_srv_weight <EOL> from mozdns . validatio...
<s> from django . db import models <EOL> from django . core . exceptions import ValidationError <EOL> from django . db . models . signals import post_save <EOL> from django . db . models . query import QuerySet <EOL> from django . contrib . auth . models import User <EOL> from dhcp . models import DHCP <EOL> from setti...
<s> '''<STR_LIT>''' <EOL> import getpass <EOL> import os <EOL> import socket <EOL> import smtplib <EOL> import sys <EOL> from optparse import OptionParser <EOL> SMTP_SERVER = '<STR_LIT>' <EOL> MAIL_SUFFIX = '<STR_LIT>' <EOL> def find_attn ( commit ) : <EOL> rc = re . findall ( r'<STR_LIT>' , commit ) <EOL> if not rc : ...
<s> import os <EOL> from setuptools import setup <EOL> import xenon <EOL> with open ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ) as fobj : <EOL> readme = fobj . read ( ) <EOL> setup ( name = '<STR_LIT>' , <EOL> version = xenon . __version__ , <EOL> author = '<STR_LIT>' , <EOL> author_email = ...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from . base import Resource , BaseManagerWithList <EOL> from . exception import ResourceNotFoundError <EOL> class FlavorManager ( BaseManagerWithList ) : <EOL> """<STR_LIT>""" <EOL> basepath = '<STR_LIT>' <EOL> def _dict_to_obj ( self , flavor ) : <...
<s> """<STR_LIT>""" <EOL> from runtime import * <EOL> class A : <EOL> def __init__ ( self ) : <EOL> self . x = <NUM_LIT:5> <EOL> def __call__ ( self ) : <EOL> print self . x <EOL> return '<STR_LIT>' <EOL> def foo ( self ) : <EOL> return self . x <EOL> def main ( ) : <EOL> print '<STR_LIT>' <EOL> a = A ( ) <EOL> assert ...
<s> '''<STR_LIT>''' <EOL> def main ( ) : <EOL> a = { '<STR_LIT:x>' : <NUM_LIT:100> , '<STR_LIT:y>' : <NUM_LIT:200> } <EOL> b = '<STR_LIT>' <EOL> c = <NUM_LIT:0> <EOL> for key , value in a : <EOL> print ( key ) <EOL> print ( value ) <EOL> b += key <EOL> c += value <EOL> print ( b ) <EOL> print ( c ) </s>
<s> from runtime import * <EOL> """<STR_LIT>""" <EOL> def main ( ) : <EOL> global a <EOL> print '<STR_LIT>' <EOL> print [ ] <EOL> print '<STR_LIT>' <EOL> a = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] <EOL> print a . length <EOL> print Object . keys ( a ) <EOL> print '<STR_LIT>' <EOL> print a <EOL> asser...
<s> from django . core . urlresolvers import reverse <EOL> from django . contrib . auth . decorators import login_required <EOL> from django . http import HttpResponse , HttpResponseBadRequest <EOL> from django . utils import simplejson <EOL> from django . utils . translation import ugettext as _ <EOL> from transifex ....
<s> import os , sys <EOL> from optparse import make_option <EOL> from django . core . management . base import CommandError , BaseCommand <EOL> from django . db . models import Q , get_model <EOL> from django . template . defaultfilters import slugify <EOL> from django . utils import simplejson <EOL> from transifex . t...
<s> from django . conf . urls . defaults import * <EOL> from django . conf import settings <EOL> from lotte . views import * <EOL> from transifex . projects . urls import PROJECT_URL <EOL> from transifex . resources . urls import RESOURCE_URL <EOL> from transifex . resources . views import clone_language <EOL> PROJECT_...
<s> import datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import models <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ( self , orm ) : <EOL> db . add_column ( '<STR_LIT>' , '<STR_LIT>' , self . gf ( '<STR_LIT>' ) ( null = True ) , keep_defau...
<s> from django . conf . urls . defaults import * <EOL> from views import view_project_widgets <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> url ( <EOL> regex = '<STR_LIT>' , <EOL> view = view_project_widgets , <EOL> name = '<STR_LIT>' , <EOL> ) <EOL> ) </s>
<s> import datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import models <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ( self , orm ) : <EOL> db . add_column ( '<STR_LIT>' , '<STR_LIT>' , self . gf ( '<STR_LIT>' ) ( null = True ) , keep_defau...
<s> import datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import models <EOL> """<STR_LIT>""" <EOL> class Migration ( SchemaMigration ) : <EOL> depends_on = ( <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "...
<s> """<STR_LIT>""" <EOL> import re <EOL> import time <EOL> import xml . dom . minidom <EOL> import xml . parsers . expat <EOL> from xml . sax . saxutils import escape as xml_escape <EOL> from django . db import transaction <EOL> from django . db . models import get_model <EOL> from django . utils . translation import ...
<s> import datetime <EOL> from south . db import db <EOL> from south . v2 import DataMigration <EOL> from django . db import models , transaction <EOL> class Migration ( DataMigration ) : <EOL> def forwards ( self , orm ) : <EOL> po_resources = orm [ '<STR_LIT>' ] . objects . filter ( i18n_type = '<STR_LIT>' ) <EOL> po...
<s> from django . contrib import admin <EOL> from transifex . storage . models import StorageFile <EOL> class StorageAdmin ( admin . ModelAdmin ) : <EOL> search_fields = [ '<STR_LIT:name>' , '<STR_LIT:size>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EOL> list_display = [ '<STR_LIT:name>' , '<STR_LIT:size>' , '...
<s> import re , operator <EOL> from pysolr import SolrCoreAdmin <EOL> from django . conf import settings <EOL> from transifex . txcommon . log import logger <EOL> class HaystackError ( Exception ) : <EOL> pass <EOL> def check_haystack_error ( func ) : <EOL> """<STR_LIT>""" <EOL> from haystack . query import SearchQuery...
<s> """<STR_LIT>""" <EOL> from django import template <EOL> register = template . Library ( ) <EOL> @ register . filter <EOL> def truncate_chars ( value , max_length ) : <EOL> """<STR_LIT>""" <EOL> max_length = int ( max_length ) <EOL> if len ( value ) > max_length : <EOL> truncd_val = value [ : max_length - <NUM_LIT:1...
<s> from setuptools import setup <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> classifiers = [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <E...
<s> '''<STR_LIT>''' <EOL> import twython , json , re , argparse , subprocess , os , sys , time <EOL> from socket import timeout <EOL> from kafka import SimpleProducer , KafkaClient <EOL> access_token = os . environ [ "<STR_LIT>" ] <EOL> access_token_secret = os . environ [ "<STR_LIT>" ] <EOL> consumer_key = os . enviro...
<s> try : <EOL> from cStringIO import StringIO <EOL> except ImportError : <EOL> from StringIO import StringIO <EOL> from muntjac . addon . google_maps . overlay . marker_source import IMarkerSource <EOL> class BasicMarkerSource ( IMarkerSource ) : <EOL> def __init__ ( self ) : <EOL> super ( BasicMarkerSource , self ) ....
<s> """<STR_LIT>""" <EOL> class IProperty ( object ) : <EOL> """<STR_LIT>""" <EOL> def getValue ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def setValue ( self , newValue ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def __str__ ( self ) : <EOL> """<STR_LIT>""" <EOL> raise N...
<s> """<STR_LIT>""" <EOL> from muntjac . data . validator import IValidator , InvalidValueException <EOL> class NullValidator ( IValidator ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , errorMessage , onlyNullAllowed ) : <EOL> """<STR_LIT>""" <EOL> self . _onlyNullAllowed = None <EOL> self . _errorMessage = None...
<s> from muntjac . api import VerticalLayout , HorizontalLayout , Button , Alignment <EOL> from muntjac . ui . themes import BaseTheme <EOL> from muntjac . ui . button import IClickListener <EOL> class ProminentPrimaryActionExample ( VerticalLayout , IClickListener ) : <EOL> def __init__ ( self ) : <EOL> super ( Promin...
<s> from muntjac . api import DateField , PopupDateField <EOL> from muntjac . demo . sampler . APIResource import APIResource <EOL> from muntjac . demo . sampler . Feature import Feature , Version <EOL> class DatePopup ( Feature ) : <EOL> def getSinceVersion ( self ) : <EOL> return Version . OLD <EOL> def getName ( sel...
<s> from muntjac . data . validatable import IValidatable <EOL> from muntjac . data . validator import IValidator <EOL> from muntjac . ui . form import Form <EOL> from muntjac . demo . sampler . features . form . FormPojoExample import FormPojoExample <EOL> from muntjac . demo . sampler . APIResource import APIResource...
<s> from muntjac . demo . sampler . APIResource import APIResource <EOL> from muntjac . demo . sampler . Feature import Feature , Version <EOL> from muntjac . api import HorizontalSplitPanel , VerticalSplitPanel <EOL> class SplitPanelBasic ( Feature ) : <EOL> def getSinceVersion ( self ) : <EOL> return Version . OLD <E...
<s> from muntjac . api import VerticalLayout , MenuBar <EOL> from muntjac . terminal . external_resource import ExternalResource <EOL> from muntjac . ui . menu_bar import ICommand <EOL> class MenuBarTooltipsExample ( VerticalLayout ) : <EOL> def __init__ ( self ) : <EOL> super ( MenuBarTooltipsExample , self ) . __init...
<s> from muntjac . demo . sampler . APIResource import APIResource <EOL> from muntjac . demo . sampler . Feature import Feature , Version <EOL> from muntjac . ui . combo_box import ComboBox <EOL> class ComboBoxContains ( Feature ) : <EOL> def getSinceVersion ( self ) : <EOL> return Version . OLD <EOL> def getName ( sel...
<s> from muntjac . ui . slider import Slider <EOL> from muntjac . demo . sampler . APIResource import APIResource <EOL> from muntjac . demo . sampler . Feature import Feature , Version <EOL> class SliderHorizontal ( Feature ) : <EOL> def getSinceVersion ( self ) : <EOL> return Version . V62 <EOL> def getName ( self ) :...
<s> from muntjac . api import VerticalLayout , Label , TabSheet <EOL> from muntjac . ui import tab_sheet <EOL> class TabSheetClosingExample ( VerticalLayout , <EOL> tab_sheet . ISelectedTabChangeListener , tab_sheet . ICloseHandler ) : <EOL> def __init__ ( self ) : <EOL> super ( TabSheetClosingExample , self ) . __init...
<s> from muntjac . ui . tree import Tree <EOL> from muntjac . demo . sampler . features . trees . TreeMultiSelect import TreeMultiSelect <EOL> from muntjac . demo . sampler . features . trees . TreeActions import TreeActions <EOL> from muntjac . demo . sampler . APIResource import APIResource <EOL> from muntjac . demo ...
<s> """<STR_LIT>""" </s>
<s> """<STR_LIT>""" <EOL> class IMethodEventSource ( object ) : <EOL> """<STR_LIT>""" <EOL> def addListener ( self , eventType , obj , method ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def removeListener ( self , eventType , obj , method ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError </s...
<s> class VEmbedded ( object ) : <EOL> CLICK_EVENT_IDENTIFIER = '<STR_LIT>' </s>
<s> from gaesessions import get_current_session <EOL> from muntjac . terminal . gwt . server . application_servlet import ApplicationServlet <EOL> from muntjac . terminal . gwt . server . abstract_application_servlet import RequestType <EOL> from muntjac . util import totalseconds <EOL> class GaeApplicationServlet ( Ap...
<s> from muntjac . data . util . abstract_property import AbstractProperty <EOL> from muntjac . data . property import ValueChangeEvent , IValueChangeListener , IReadOnlyStatusChangeEvent , IReadOnlyStatusChangeListener <EOL> from muntjac . data . util . object_property import ObjectProperty <EOL> from muntjac . test ....
<s> from unittest import TestCase <EOL> from muntjac . test . server . component . table . table_generator import TableGenerator <EOL> from muntjac . ui . table import Table <EOL> class TableColumnAlignments ( TestCase ) : <EOL> def testDefaultColumnAlignments ( self ) : <EOL> for properties in range ( <NUM_LIT:10> ) :...
<s> from muntjac . test . server . data . util . abstract_hierarchical_container_test import AbstractHierarchicalContainerTest <EOL> from muntjac . data . container import IFilter <EOL> from muntjac . data . util . hierarchical_container import HierarchicalContainer <EOL> class TestHierarchicalContainer ( AbstractHiera...
<s> """<STR_LIT>""" <EOL> from muntjac . ui . tab_sheet import TabSheet <EOL> class Accordion ( TabSheet ) : <EOL> """<STR_LIT>""" <EOL> CLIENT_WIDGET = None </s>
<s> """<STR_LIT>""" <EOL> from muntjac . ui . component_container import IComponentContainer <EOL> from muntjac . terminal . gwt . client . ui . v_margin_info import VMarginInfo <EOL> from muntjac . terminal . gwt . client . ui . alignment_info import Bits <EOL> class ILayout ( IComponentContainer ) : <EOL> """<STR_LIT...
<s> from muntjac . ui . themes . base_theme import BaseTheme <EOL> class Reindeer ( BaseTheme ) : <EOL> THEME_NAME = '<STR_LIT>' <EOL> LABEL_H1 = '<STR_LIT>' <EOL> LABEL_H2 = '<STR_LIT>' <EOL> LABEL_SMALL = '<STR_LIT>' <EOL> LABEL_LIGHT = '<STR_LIT>' <EOL> BUTTON_DEFAULT = '<STR_LIT>' <EOL> BUTTON_PRIMARY = BUTTON_DEFA...
<s> """<STR_LIT>""" <EOL> def get_connection ( ) : <EOL> """<STR_LIT>""" <EOL> from cloud_browser . cloud . config import Config <EOL> return Config . get_connection ( ) <EOL> def get_connection_cls ( ) : <EOL> """<STR_LIT>""" <EOL> from cloud_browser . cloud . config import Config <EOL> return Config . get_connection_...
<s> import re <EOL> from six . moves . urllib . parse import quote , urlparse <EOL> """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> __version__ = "<STR_LIT:1.0>" <EOL> class Color ( object ) : <EOL> COLORS = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_L...
<s> """<STR_LIT>""" <EOL> import cPickle as pkl <EOL> import numpy <EOL> from collections import OrderedDict <EOL> def build_dictionary ( text ) : <EOL> """<STR_LIT>""" <EOL> wordcount = OrderedDict ( ) <EOL> for cc in text : <EOL> words = cc . split ( ) <EOL> for w in words : <EOL> if w not in wordcount : <EOL> wordco...
<s> from twython import TwythonStreamer <EOL> class MyStreamer ( TwythonStreamer ) : <EOL> def on_success ( self , data ) : <EOL> if '<STR_LIT:text>' in data : <EOL> print data [ '<STR_LIT:text>' ] . encode ( '<STR_LIT:utf-8>' ) <EOL> def on_error ( self , status_code , data ) : <EOL> print status_code , data <EOL> str...
<s> try : <EOL> from setuptools import setup , find_packages <EOL> except ImportError : <EOL> from ez_setup import use_setuptools <EOL> use_setuptools ( ) <EOL> from setuptools import setup , find_packages <EOL> from cleaver import __version__ <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = __version__ , <EOL>...
<s> """<STR_LIT>""" <EOL> __all__ = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def system_specific_module ( system ) : <EOL> """<STR_LIT>""" <EOL> return __import__ ( '<STR_LIT>' + system , fromlist = [ system ] ) </s>
<s> from distutils . core import setup <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> packages = [ '<STR_LIT>' , ] , <EOL> classifiers = [ <EOL> '<STR_LIT>' , <EOL> '<STR_L...
<s> import json <EOL> with open ( '<STR_LIT>' , '<STR_LIT>' ) as f : <EOL> j1 = json . load ( f ) <EOL> with open ( '<STR_LIT>' , '<STR_LIT>' ) as f : <EOL> j2 = json . load ( f ) <EOL> assert ( j1 [ '<STR_LIT:info>' ] == j2 [ '<STR_LIT:info>' ] ) <EOL> assert ( j1 [ '<STR_LIT:type>' ] == j2 [ '<STR_LIT:type>' ] ) <EOL...
<s> """<STR_LIT>""" <EOL> import unittest <EOL> from retdec . exceptions import AnalysisFailedError <EOL> from retdec . exceptions import ArchiveGenerationFailedError <EOL> from retdec . exceptions import AuthenticationError <EOL> from retdec . exceptions import ConnectionError <EOL> from retdec . exceptions import Dec...
<s> from arangodb . index . general import BaseIndex <EOL> class HashIndex ( BaseIndex ) : <EOL> """<STR_LIT:U+0020>""" <EOL> type_name = '<STR_LIT>' <EOL> def __init__ ( self , fields , unique = True ) : <EOL> """<STR_LIT>""" <EOL> super ( HashIndex , self ) . __init__ ( ) <EOL> self . fields = fields <EOL> self . uni...
<s> import unittest <EOL> from arangodb . api import Database <EOL> from arangodb . orm . fields import CharField , ForeignKeyField <EOL> from arangodb . orm . models import CollectionModel <EOL> class CollectionModelForeignKeyFieldTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . database_name...
<s> """<STR_LIT>""" <EOL> FEATURES_PER_LANG = <NUM_LIT> <EOL> import os , sys , argparse <EOL> import csv <EOL> import marshal <EOL> import numpy <EOL> import multiprocessing as mp <EOL> from collections import defaultdict <EOL> from common import read_weights , Enumerator , write_features <EOL> def select_LD_features ...
<s> '''<STR_LIT>''' <EOL> import logging <EOL> import threading <EOL> import datetime <EOL> import sys <EOL> import os <EOL> import pickle <EOL> import pdb <EOL> import time <EOL> import socket <EOL> from bigjob import logger <EOL> import redis <EOL> logging . debug ( str ( sys . path ) ) <EOL> import uuid <EOL> REDIS_...
<s> import os <EOL> import sys <EOL> import saga <EOL> import pilot <EOL> import traceback <EOL> """<STR_LIT>""" <EOL> REDIS_PWD = "<STR_LIT>" <EOL> REDIS_URL = "<STR_LIT>" % REDIS_PWD <EOL> HOSTNAME = "<STR_LIT>" <EOL> USER_NAME = "<STR_LIT>" <EOL> SAGA_ADAPTOR = "<STR_LIT>" <EOL> QUEUE = "<STR_LIT>" <EOL> PROJECT = "...
<s> """<STR_LIT>""" <EOL> import sys <EOL> import os <EOL> import time <EOL> import threading <EOL> import logging <EOL> import pdb <EOL> import Queue <EOL> import uuid <EOL> import traceback <EOL> import urlparse <EOL> from bigjob import logger <EOL> import pilot <EOL> from pilot . api import ComputeDataService , Stat...
<s> import pycares <EOL> for code , name in pycares . errno . errorcode . items ( ) : <EOL> globals ( ) [ name ] = code <EOL> class DNSError ( Exception ) : <EOL> pass </s>
<s> __author__ = '<STR_LIT>' <EOL> import unittest <EOL> import requests <EOL> import json <EOL> import datetime <EOL> from Testing . config import __CONFIG__ <EOL> class UserTestPlan ( unittest . TestCase ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> debug = __CONFIG__ [ '<STR_LIT>' ] <EOL> if debug : <...