code stringlengths 9 256k |
|---|
<s> import datetime <EOL> from unittest import TestCase <EOL> import unittest . mock as mock <EOL> from esrally import config , metrics <EOL> class MockClientFactory : <EOL> def __init__ ( self , config ) : <EOL> self . _es = mock . create_autospec ( metrics . EsClient ) <EOL> def create ( self ) : <EOL> return self . ... |
<s> from django import template <EOL> from brabeion . models import BadgeAward <EOL> register = template . Library ( ) <EOL> class BadgeCountNode ( template . Node ) : <EOL> @ classmethod <EOL> def handle_token ( cls , parser , token ) : <EOL> bits = token . split_contents ( ) <EOL> if len ( bits ) == <NUM_LIT:2> : <EO... |
<s> from django . conf . urls . defaults import patterns , url <EOL> urlpatterns = patterns ( <EOL> "<STR_LIT>" , <EOL> url ( <EOL> regex = r"<STR_LIT>" , <EOL> view = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> ) , <EOL> url ( <EOL> regex = r"<STR_LIT>" , <EOL> view = "<STR_LIT>" , <EOL> name = "<STR_LIT>" <EOL> ) ... |
<s> def runserver ( port = <NUM_LIT> ) : <EOL> from polaris import create_app <EOL> from polaris . models import db <EOL> app = create_app ( ) <EOL> app . debug = True <EOL> db . app = app <EOL> db . create_all ( ) <EOL> app . run ( host = '<STR_LIT>' , port = port ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> ru... |
<s> """<STR_LIT>""" <EOL> import http . client as http <EOL> from flask import ( <EOL> Blueprint , <EOL> abort , <EOL> current_app , <EOL> render_template , <EOL> ) <EOL> from flask_login import login_required , current_user <EOL> from polaris . models import db , Chart , ChartStar <EOL> from polaris . auth . principal... |
<s> import re <EOL> import sys <EOL> import platform <EOL> from os . path import join , dirname <EOL> from setuptools import setup , find_packages <EOL> from setuptools . extension import Extension <EOL> with open ( join ( dirname ( __file__ ) , '<STR_LIT>' , '<STR_LIT>' ) , '<STR_LIT:r>' ) as f : <EOL> version = re . ... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> import os . path <EOL> import time <EOL> from ... thrift import TClient , TApplicationException , TMessageType , TProcessor , TType <EOL> from ... parser import load <EOL> track_method = "<STR_LIT>" <EOL> track_thrift = load ( os . path . join ( os ... |
<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 . create_table ( '<STR_LIT>' , <EOL> sa . Column ( '<STR_LIT>' , sa . Integer ( ) , nullable = True ) , <EOL> sa . Column ( '<STR_LIT>' , sa . In... |
<s> import datetime <EOL> import os , os . path <EOL> import mimetypes <EOL> import pkg_resources <EOL> from solariwsgi import context , DispatchTarget , controller <EOL> from solariwsgi . core import packageCallback <EOL> _package_set = set ( ) <EOL> @ packageCallback <EOL> def packageCallback_static ( packagename ) :... |
<s> import sys , os <EOL> extensions = [ '<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>' <EOL> release = '<STR_LIT>' <EOL> exclude_trees = [ ] <EOL> pygment... |
<s> VERSION = ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> ) <EOL> __version__ = VERSION <EOL> __versionstr__ = '<STR_LIT:.>' . join ( map ( str , VERSION ) ) </s>
|
<s> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ( self , orm ) : <EOL> db . delete_table ( '<STR_LIT>' ) <EOL> def backwards ( self , orm ) : <EOL> pass <EOL> models = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT:Meta>' : { '<STR_LIT:o... |
<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>' ) ( default = '<STR_LIT:{}>' )... |
<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 . alter_column ( '<STR_LIT>' , '<STR_LIT>' , self . gf ( '<STR_LIT>' ) ( auto_now_add = True ) ) ... |
<s> """<STR_LIT>""" <EOL> try : <EOL> import traitlets as T <EOL> from traitlets . config import Configurable , Config <EOL> except ImportError : <EOL> from IPython . utils import traitlets as T <EOL> from . utils import parse_shorthand , infer_vegalite_type , DataFrameTrait <EOL> from . _py3k_compat import string_type... |
<s> """<STR_LIT>""" <EOL> from . . exceptions import ShorteningErrorException , ExpandingErrorException <EOL> from . base import BaseShortener <EOL> class Bitly ( BaseShortener ) : <EOL> api_url = '<STR_LIT>' <EOL> def __init__ ( self , ** kwargs ) : <EOL> if not kwargs . get ( '<STR_LIT>' , False ) : <EOL> raise TypeE... |
<s> import sys <EOL> import os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( '<STR_LIT:..>' ) ) <EOL> os . environ . setdefault ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> machina = __import__ ( '<STR_LIT>' ) <EOL> import django <EOL> django . setup ( ) <EOL> ON_RTD = os . environ . get ( '<STR_LIT>' , None )... |
<s> from __future__ import unicode_literals <EOL> from django . core . exceptions import ValidationError <EOL> from django . db import models <EOL> from django . utils . encoding import force_text <EOL> from django . utils . encoding import python_2_unicode_compatible <EOL> from django . utils . text import slugify <EO... |
<s> from __future__ import unicode_literals <EOL> from django . contrib import admin <EOL> from machina . core . db . models import get_model <EOL> TopicPoll = get_model ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> TopicPollOption = get_model ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> TopicPollVote = get_model ( '<STR_LIT>' , '<STR_LI... |
<s> from __future__ import unicode_literals <EOL> from django import forms <EOL> from machina . core . db . models import get_model <EOL> ForumProfile = get_model ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class ForumProfileForm ( forms . ModelForm ) : <EOL> class Meta : <EOL> model = ForumProfile <EOL> fields = [ '<STR_LIT>'... |
<s> from __future__ import unicode_literals <EOL> from django import forms <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from haystack . forms import FacetedSearchForm <EOL> from haystack . inputs import AutoQuery <EOL> from machina . core . db . models import get_model <EOL> from machina . co... |
<s> from django import template <EOL> from django . template . defaultfilters import stringfilter <EOL> from machina . models . fields import render_func <EOL> register = template . Library ( ) <EOL> @ register . filter ( is_safe = True ) <EOL> @ stringfilter <EOL> def rendered ( value ) : <EOL> return render_func ( va... |
<s> from machina . core . db . models import get_model <EOL> from machina . test . mixins import AdminBaseViewTestMixin <EOL> from machina . test . testcases import AdminClientTestCase <EOL> Post = get_model ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> Topic = get_model ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class TestPostAdmin ( ... |
<s> from __future__ import unicode_literals <EOL> from django . core . exceptions import ValidationError <EOL> import pytest <EOL> from machina . test . factories import create_forum <EOL> from machina . test . factories import create_topic <EOL> from machina . test . factories import PostFactory <EOL> from machina . t... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import precise_bbcode . fields <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ] <EOL> operations = [ <EOL> migrations . CreateModel ( <EOL> name = '<STR_LIT>' , <EOL> fields = [ <EOL> ( '... |
<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 . create_table ( '<STR_LIT>' , ( <EOL> ( '<STR_LIT:id>' , self . gf ( '<STR_LIT>' ) ( primary_key... |
<s> import vii . App <EOL> vii . App . main ( ) </s>
|
<s> from flask import session , redirect , request <EOL> from functools import wraps <EOL> import urllib <EOL> import uuid <EOL> import django <EOL> from django . http import HttpResponseRedirect <EOL> from ecl_facebook . facebook import Facebook , FacebookError <EOL> from ecl_facebook . settings import DIALOG_URL , DI... |
<s> import math , json <EOL> class ConfusionMatrix ( object ) : <EOL> def __init__ ( self , true_positives = <NUM_LIT:0> , false_positives = <NUM_LIT:0> , false_negatives = <NUM_LIT:0> , true_negatives = <NUM_LIT:0> ) : <EOL> self . true_positives = true_positives <EOL> self . false_positives = false_positives <EOL> se... |
<s> """<STR_LIT>""" <EOL> from nubo . clouds . base import BaseCloud <EOL> from nubo . clouds . base import AVAILABLE_CLOUDS , CLOUDS_MAPPING <EOL> class OpenNebula ( BaseCloud ) : <EOL> PROVIDER_NAME = '<STR_LIT>' <EOL> NEEDED_PARAMS = [ '<STR_LIT:key>' , '<STR_LIT>' , '<STR_LIT:host>' , '<STR_LIT:port>' , '<STR_LIT>'... |
<s> """<STR_LIT>""" <EOL> from uuid import uuid4 <EOL> from bitmath import Byte , GiB <EOL> from twisted . trial . unittest import SynchronousTestCase <EOL> from . testtools_emc_sio import tidy_scaleio_client_for_test <EOL> from . emc_sio import ( <EOL> scaleio_client , emc_scaleio_api <EOL> ) <EOL> from flocker . node... |
<s> from django . conf . urls import patterns , url <EOL> from api . views import default , user , session , testplan , auth , traffic , rule , testplan_rule , recording , log , proxy , config , qos , serveroverload <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> url ( r'<STR_LIT>' , default . index ) , <EOL> url ( ... |
<s> import json <EOL> import re <EOL> from django . test import TestCase <EOL> import subprocess <EOL> import logging <EOL> import time <EOL> import uuid <EOL> from webui . forms import TestPlanForm <EOL> class BaseTest ( TestCase ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> """<STR_LIT>""" <EOL> loggin... |
<s> import argparse <EOL> from settings import Common <EOL> from service . server import HBProxyServer <EOL> def get_arg_parser ( ) : <EOL> description = "<STR_LIT>" <EOL> parser = argparse . ArgumentParser ( description = description ) <EOL> parser . add_argument ( '<STR_LIT>' , <EOL> action = "<STR_LIT:store_true>" ,... |
<s> """<STR_LIT>""" <EOL> try : <EOL> from oslo_log import log as logging <EOL> except ImportError : <EOL> from cinder . openstack . common import log as logging <EOL> from cinder . volume import driver <EOL> from cinder . volume . drivers . emc . vipr import common as vipr_common <EOL> LOG = logging . getLogger ( __na... |
<s> from django import forms <EOL> from django . utils . translation import ugettext as _ <EOL> from diff_match_patch import diff_match_patch <EOL> from . import models , utils <EOL> class PageEditForm ( forms . ModelForm ) : <EOL> prev_revision = forms . ModelChoiceField ( <EOL> queryset = models . PageRevision . obje... |
<s> import urllib . request <EOL> url = "<STR_LIT>" <EOL> data = urllib . request . urlopen ( url + "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" , data . read ( ) . decode ( "<STR_LIT:utf-8>" ) ) </s>
|
<s> from setuptools import setup <EOL> setup ( <EOL> packages = [ '<STR_LIT>' ] , <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> entry_points = { <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> } , <EOL> ... |
<s> import os <EOL> import signal <EOL> import socket <EOL> import subprocess <EOL> import time <EOL> import shutil <EOL> import sexpdata <EOL> from ensime_shared . util import Util , catch <EOL> class EnsimeProcess ( object ) : <EOL> def __init__ ( self , cache_dir , process , log_path , cleanup ) : <EOL> self . log_p... |
<s> class Patch ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , target ) : <EOL> self . target = target <EOL> def __call__ ( self , patches ) : <EOL> for name , value in vars ( patches ) . items ( ) : <EOL> if name in vars ( ReferenceEmptyClass ) : <EOL> continue <EOL> no_replace = getattr ( value , '<ST... |
<s> import glob <EOL> import os <EOL> import unittest <EOL> import warnings <EOL> import comtypes . typeinfo <EOL> import comtypes . client <EOL> import comtypes . client . _generate <EOL> from comtypes . test import requires <EOL> requires ( "<STR_LIT>" ) <EOL> warnings . filterwarnings ( "<STR_LIT:ignore>" , <EOL> "<... |
<s> import os <EOL> import sys <EOL> import weakref <EOL> from ctypes import * <EOL> from ctypes . wintypes import ULONG <EOL> from comtypes import STDMETHOD <EOL> from comtypes import COMMETHOD <EOL> from comtypes import _GUID , GUID <EOL> from comtypes . automation import BSTR <EOL> from comtypes . automation import ... |
<s> import collections <EOL> import six <EOL> from . . compat import OrderedDict <EOL> from . . errors import DepSolverError <EOL> from . . requirement import Requirement <EOL> from . . version import MaxVersion <EOL> R = Requirement . from_string <EOL> class DefaultPolicy ( object ) : <EOL> """<STR_LIT>""" <EOL> def _... |
<s> import setuptools <EOL> import os . path as op <EOL> from distutils . core import setup <EOL> VERSION = "<STR_LIT>" <EOL> with open ( "<STR_LIT>" , "<STR_LIT>" ) as fp : <EOL> DESCRIPTION = fp . read ( ) <EOL> with open ( op . join ( "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT>" ) as fp : <EOL> fp . write ( "<STR_LIT>"... |
<s> """<STR_LIT>""" <EOL> from envisage . api import Plugin <EOL> from traits . api import List <EOL> class DeveloperUIPlugin ( Plugin ) : <EOL> """<STR_LIT>""" <EOL> ID = '<STR_LIT>' <EOL> PERSPECTIVES = '<STR_LIT>' <EOL> VIEWS = '<STR_LIT>' <EOL> id = ID <EOL> name = '<STR_LIT>' <EOL> perspectives = List ( contribute... |
<s> """<STR_LIT>""" <EOL> from traits . api import Instance , Interface , Str <EOL> from . i_plugin_activator import IPluginActivator <EOL> class IPlugin ( Interface ) : <EOL> """<STR_LIT>""" <EOL> activator = Instance ( IPluginActivator ) <EOL> application = Instance ( '<STR_LIT>' ) <EOL> home = Str <EOL> id = Str <EO... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> import traceback <EOL> from IPython . kernel . core . interpreter import Interpreter <EOL> from envisage . api import IExtensionRegistry <EOL> from envisage . api import ExtensionPoint <EOL> from envisage . plugins . python_shell . api import IPythonShell <EOL> from envisa... |
<s> """<STR_LIT>""" <EOL> from traits . api import provides <EOL> from envisage . plugins . remote_editor . communication . client import Client <EOL> from . i_remote_shell import IRemoteShell <EOL> @ provides ( IRemoteShell ) <EOL> class RemoteShellController ( Client ) : <EOL> """<STR_LIT>""" <EOL> self_type = "<STR_... |
<s> """<STR_LIT>""" <EOL> import os , shutil , unittest <EOL> from traits . etsconfig . api import ETSConfig <EOL> from envisage . api import Application , ExtensionPoint <EOL> from envisage . api import Plugin , PluginManager <EOL> from traits . api import Bool , Int , List <EOL> from envisage . tests . event_tracker ... |
<s> """<STR_LIT>""" <EOL> from os . path import dirname , join <EOL> from envisage . package_plugin_manager import PackagePluginManager <EOL> from traits . testing . unittest_tools import unittest <EOL> class PackagePluginManagerTestCase ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> "... |
<s> """<STR_LIT>""" <EOL> from envisage . ui . single_project . project_action import ProjectAction <EOL> from pyface . api import ImageResource <EOL> class CloseProjectAction ( ProjectAction ) : <EOL> """<STR_LIT>""" <EOL> uol = '<STR_LIT>' <EOL> method_name = '<STR_LIT>' <EOL> description = '<STR_LIT>' <EOL> image = ... |
<s> from . preferences_category import PreferencesCategory <EOL> from . preferences_pane import PreferencesPane <EOL> from . task_extension import TaskExtension <EOL> from . task_factory import TaskFactory <EOL> from . task_window import TaskWindow <EOL> from . tasks_application import TasksApplication </s>
|
<s> """<STR_LIT>""" <EOL> import logging <EOL> from envisage . api import Application , ExtensionPoint , Plugin <EOL> from traits . api import List , Str <EOL> logger = logging . getLogger ( ) <EOL> logger . addHandler ( logging . StreamHandler ( file ( '<STR_LIT>' , '<STR_LIT:w>' ) ) ) <EOL> logger . setLevel ( loggin... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> from envisage . core_plugin import CorePlugin <EOL> from envisage . developer . developer_plugin import DeveloperPlugin <EOL> from envisage . developer . ui . developer_ui_plugin import DeveloperUIPlugin <EOL> from envisage . ui . workbench . workbench_plugin import Workbe... |
<s> from bar_perspective import BarPerspective <EOL> from foo_perspective import FooPerspective </s>
|
<s> requirements = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>'... |
<s> """<STR_LIT>""" <EOL> import os <EOL> if not os . path . exists ( '<STR_LIT>' ) : <EOL> try : <EOL> from urllib import urlopen <EOL> except ImportError : <EOL> from urllib . request import urlopen <EOL> print ( "<STR_LIT>" ) <EOL> opener = urlopen ( <EOL> '<STR_LIT>' ) <EOL> open ( '<STR_LIT>' , '<STR_LIT:wb>' ) . ... |
<s> """<STR_LIT>""" <EOL> from mayavi . core . registry import registry <EOL> from mayavi . core . pipeline_info import PipelineInfo <EOL> from mayavi . core . metadata import ModuleMetadata <EOL> user_outline = ModuleMetadata ( <EOL> id = "<STR_LIT>" , <EOL> menu_name = "<STR_LIT>" , <EOL> factory = '<STR_LIT>' , <EOL... |
<s> """<STR_LIT>""" <EOL> import os . path <EOL> import logging <EOL> from apptools . logger . api import LogFileHandler , FORMATTER <EOL> from traits . etsconfig . api import ETSConfig <EOL> from traits . api import List <EOL> from envisage . api import Plugin <EOL> from envisage . ui . workbench . api import Workbenc... |
<s> """<STR_LIT>""" <EOL> from inspect import getmembers <EOL> import sys <EOL> from time import sleep <EOL> from pyface . api import GUI <EOL> from common import TestCase <EOL> def is_timer_running ( timer ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( timer , '<STR_LIT>' ) : <EOL> return timer . isActive ( ) <EOL> else... |
<s> """<STR_LIT>""" <EOL> from traits . api import Instance , Int , Range <EOL> from traitsui . api import View , Group , Item <EOL> from tvtk . api import tvtk <EOL> from mayavi . core . component import Component <EOL> from mayavi . core . common import error <EOL> class CustomGridPlane ( Component ) : <EOL> __versio... |
<s> """<STR_LIT>""" <EOL> from traits . api import HasTraits , Dict , Instance , Enum , Int , Callable , on_trait_change , List , Tuple , WeakRef <EOL> from mayavi . core . scene import Scene <EOL> from tvtk . api import tvtk <EOL> VTK_VERSION = tvtk . Version ( ) . vtk_major_version + <NUM_LIT> * tvtk . Version ( ) . ... |
<s> """<STR_LIT>""" <EOL> from traits . api import Instance , Int , Range <EOL> from traitsui . api import View , Group , Item <EOL> from tvtk . api import tvtk <EOL> from mayavi . core . common import error <EOL> from mayavi . filters . filter_base import FilterBase <EOL> from mayavi . core . pipeline_info import Pipe... |
<s> from traits . api import Instance <EOL> from tvtk . api import tvtk <EOL> from mayavi . filters . poly_data_normals import PolyDataNormals <EOL> from mayavi . core . pipeline_info import PipelineInfo <EOL> class WarpScalar ( PolyDataNormals ) : <EOL> """<STR_LIT>""" <EOL> __version__ = <NUM_LIT:0> <EOL> filter = In... |
<s> """<STR_LIT>""" <EOL> from traitsui . api import Item , Group , View , InstanceEditor <EOL> from mayavi . components . ui . actor import actor_view , texture_view <EOL> view = View ( <EOL> Group ( Item ( name = '<STR_LIT>' , label = '<STR_LIT>' ) , <EOL> Group ( Item ( name = '<STR_LIT>' , <EOL> style = '<STR_LIT>'... |
<s> """<STR_LIT>""" <EOL> from os . path import basename <EOL> from traits . api import Instance , Str , Dict <EOL> from traitsui . api import View , Group , Item , Include <EOL> from tvtk . api import tvtk <EOL> from mayavi . core . file_data_source import FileDataSource <EOL> from mayavi . core . pipeline_info import... |
<s> { '<STR_LIT>' : array ( [ ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , <EOL> ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , <EOL> ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , <EOL> ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , <EOL> ( <NUM_LIT... |
<s> """<STR_LIT>""" <EOL> import unittest <EOL> import numpy as np <EOL> from traits . api import HasTraits , Instance <EOL> from mayavi . tools . mlab_scene_model import MlabSceneModel <EOL> from mayavi import mlab <EOL> from mayavi . tests . test_mlab_integration import TestMlabNullEngine <EOL> class TestMlabSceneMod... |
<s> from traits . api import HasTraits , Str , Int , Array , List , Instance , on_trait_change , Property , Button <EOL> from pyface . api import GUI <EOL> from traitsui . api import View , Item , HGroup , Group , ListEditor , TabularEditor , spring , TextEditor , Controller , VSplit <EOL> from traitsui . tabular_adapt... |
<s> """<STR_LIT>""" <EOL> from os . path import exists , join , dirname , isdir <EOL> _zip = join ( dirname ( __file__ ) , '<STR_LIT>' ) <EOL> tvtk_class_dir = join ( dirname ( __file__ ) , '<STR_LIT>' ) <EOL> if exists ( tvtk_class_dir ) and isdir ( tvtk_class_dir ) : <EOL> pass <EOL> elif exists ( _zip ) : <EOL> __pa... |
<s> """<STR_LIT>""" <EOL> from traits . api import HasTraits , Trait , Long , Array , Any , Float , Instance , Range , true , Str <EOL> from traitsui . api import View , Group , Item , Handler <EOL> from tvtk . api import tvtk <EOL> from tvtk . tvtk_base import TraitRevPrefixMap , false_bool_trait <EOL> from tvtk . com... |
<s> """<STR_LIT>""" <EOL> import unittest <EOL> try : <EOL> import cStringIO <EOL> except ImportError : <EOL> import io as cStringIO <EOL> from tvtk import indenter <EOL> class TestIndent ( unittest . TestCase ) : <EOL> def test_basic ( self ) : <EOL> """<STR_LIT>""" <EOL> id = indenter . Indent ( ) <EOL> self . assert... |
<s> import os <EOL> from random import random <EOL> import numpy as np <EOL> import psutil <EOL> from pikos . external . api import PythonCProfiler <EOL> cprofiler = PythonCProfiler ( ) <EOL> class Leaker ( object ) : <EOL> def __init__ ( self , number , shape ) : <EOL> self . number = number <EOL> self . shape = shape... |
<s> class OnChange ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , field ) : <EOL> """<STR_LIT>""" <EOL> self . field = field <EOL> self . previous = None <EOL> def __call__ ( self , record ) : <EOL> """<STR_LIT>""" <EOL> new = getattr ( record , self . field ) <EOL> check = self . previous != new <EOL> ... |
<s> import abc <EOL> from pikos . _internal . attach_decorators import basic_attach <EOL> class Monitor ( object ) : <EOL> """<STR_LIT>""" <EOL> __metaclass__ = abc . ABCMeta <EOL> @ abc . abstractmethod <EOL> def enable ( self ) : <EOL> """<STR_LIT>""" <EOL> @ abc . abstractmethod <EOL> def disable ( self ) : <EOL> ""... |
<s> import StringIO <EOL> import unittest <EOL> from pikos . recorders . list_recorder import ListRecorder <EOL> from pikos . tests . compat import TestCase <EOL> from pikos . tests . focused_monitoring_helper import FocusedMonitoringHelper <EOL> class TestFocusedLineMemoryMonitor ( TestCase ) : <EOL> def setUp ( self ... |
<s> import sys <EOL> from traits . api import * <EOL> from traitsui . api import * <EOL> from traitsui . menu import * <EOL> from pyface . image_resource import ImageResource <EOL> from etsdevtools . developer . tools . ui_debugger import UIDebugger <EOL> image1 = ImageResource ( '<STR_LIT>' ) <EOL> image2 = ImageResou... |
<s> import os . path <EOL> from pyface . api import PythonEditor <EOL> from pyface . tasks . api import TaskPane , TraitsDockPane <EOL> from traits . api import Event , File , Instance , List , Str <EOL> from traitsui . api import View , Item , FileEditor <EOL> class FileBrowserPane ( TraitsDockPane ) : <EOL> """<STR_L... |
<s> """<STR_LIT>""" <EOL> from traits . api import Bool , Constant , Event , HasTraits , Instance <EOL> from traits . api import List , Property , Str <EOL> from pyface . action . action_controller import ActionController <EOL> from pyface . action . group import Group <EOL> class ActionManager ( HasTraits ) : <EOL> ""... |
<s> """<STR_LIT>""" <EOL> import shelve <EOL> import os <EOL> import wx <EOL> import sys <EOL> from pyface . api import SystemMetrics <EOL> from traits . api import HasPrivateTraits , Instance , Tuple , Property , Any , Str , List , false <EOL> from traits . trait_base import traits_home <EOL> from traitsui . api impor... |
<s> import logging <EOL> logger = logging . getLogger ( __name__ ) <EOL> logger . warning ( '<STR_LIT>' ) <EOL> from pyface . ui . wx . grid . trait_grid_cell_adapter import * </s>
|
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from . toolkit import toolkit_object <EOL> ImageResource = toolkit_object ( '<STR_LIT>' ) </s>
|
<s> """<STR_LIT>""" </s>
|
<s> """<STR_LIT>""" <EOL> import logging <EOL> from traits . api import Str , List , Dict , Instance <EOL> from pyface . api import PythonShell , FileDialog , OK <EOL> from pyface . tasks . api import Task , TaskPane <EOL> from pyface . tasks . action . api import SMenuBar , SMenu , TaskAction <EOL> logger = logging . ... |
<s> import unittest <EOL> from traits . api import HasTraits , Int <EOL> from pyface . tasks . topological_sort import before_after_sort , topological_sort <EOL> class TestItem ( HasTraits ) : <EOL> id = Int <EOL> before = Int <EOL> after = Int <EOL> def __init__ ( self , id , ** traits ) : <EOL> super ( TestItem , sel... |
<s> from __future__ import absolute_import <EOL> from traits . testing . unittest_tools import unittest , UnittestTools <EOL> from . . widget import Widget <EOL> class TestWidget ( unittest . TestCase , UnittestTools ) : <EOL> def setUp ( self ) : <EOL> self . widget = Widget ( ) <EOL> def test_create ( self ) : <EOL> ... |
<s> raise ImportError ( '<STR_LIT>' ) </s>
|
<s> from pyface . qt import QtGui <EOL> from traits . api import Bool , provides , Unicode <EOL> from pyface . i_directory_dialog import IDirectoryDialog , MDirectoryDialog <EOL> from . dialog import Dialog <EOL> @ provides ( IDirectoryDialog ) <EOL> class DirectoryDialog ( MDirectoryDialog , Dialog ) : <EOL> """<STR_L... |
<s> from pyface . qt import QtCore <EOL> class Timer ( QtCore . QTimer ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , millisecs , callable , * args , ** kw_args ) : <EOL> """<STR_LIT>""" <EOL> QtCore . QTimer . __init__ ( self ) <EOL> self . callable = callable <EOL> self . args = args <EOL> self . kw_args = kw_... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> import wx <EOL> from traits . api import Bool , Enum , Int , provides , Str , Unicode <EOL> from pyface . i_dialog import IDialog , MDialog <EOL> from pyface . constant import OK , CANCEL , YES , NO <EOL> from . window import Window <EOL> _RESULT_MAP = { <EOL> wx . ID_OK : OK ... |
<s> """<STR_LIT>""" <EOL> import wx <EOL> from traits . api import Enum , provides , Unicode <EOL> from pyface . i_message_dialog import IMessageDialog , MMessageDialog <EOL> from . dialog import Dialog <EOL> _SEVERITY_TO_ICON_MAP = { <EOL> '<STR_LIT>' : wx . ICON_INFORMATION , <EOL> '<STR_LIT>' : wx . ICON_WARNING , <... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> def get_app_wx ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> import wx <EOL> app = wx . GetApp ( ) <EOL> if app is None : <EOL> if not kwargs . has_key ( '<STR_LIT>' ) : <EOL> kwargs [ '<STR_LIT>' ] = False <EOL> app = wx . PySimpleApp ( * ar... |
<s> """<STR_LIT>""" <EOL> from traits . api import Bool , Interface , Str , Tuple , Unicode <EOL> class IWizardPage ( Interface ) : <EOL> """<STR_LIT>""" <EOL> id = Str <EOL> next_id = Str <EOL> last_page = Bool ( False ) <EOL> complete = Bool ( False ) <EOL> heading = Unicode <EOL> subheading = Unicode <EOL> size = Tu... |
<s> """<STR_LIT>""" <EOL> from pyface . workbench . api import View , WorkbenchWindow <EOL> from traits . api import HasTraits , Instance , Str , on_trait_change <EOL> from traitsui . api import View as TraitsView <EOL> class DebugViewModel ( HasTraits ) : <EOL> """<STR_LIT>""" <EOL> active_editor = Str <EOL> active_pa... |
<s> """<STR_LIT>""" <EOL> import inspect <EOL> import wx <EOL> class Clipboard : <EOL> """<STR_LIT>""" <EOL> pass <EOL> clipboard = Clipboard ( ) <EOL> clipboard . drop_source = None <EOL> clipboard . source = None <EOL> clipboard . data = None <EOL> class FileDropTarget ( wx . FileDropTarget ) : <EOL> """<STR_LIT>""" ... |
<s> from traits . api import HasTraits , Instance <EOL> from interface_definition import IName <EOL> class Apartment ( HasTraits ) : <EOL> renter = Instance ( IName , adapt = '<STR_LIT>' ) </s>
|
<s> from traits . api import HasTraits , Float <EOL> class Person ( HasTraits ) : <EOL> weight_kg = Float ( <NUM_LIT:0.0> ) <EOL> height_m = Float ( <NUM_LIT:1.0> ) <EOL> bmi = Float ( <NUM_LIT:0.0> ) <EOL> def _weight_kg_changed ( self , old , new ) : <EOL> print '<STR_LIT>' % ( old , new ) <EOL> if self . height_m !=... |
<s> from __future__ import absolute_import <EOL> from traits . _version import full_version as __version__ <EOL> import logging <EOL> class NullHandler ( logging . Handler ) : <EOL> def handle ( self , record ) : <EOL> pass <EOL> def emit ( self , record ) : <EOL> pass <EOL> def createLock ( self ) : <EOL> self . lock ... |
<s> """<STR_LIT>""" </s>
|
<s> from traits . testing . unittest_tools import unittest <EOL> from traits . api import Enum , HasTraits , List , Property , TraitError <EOL> class ExampleModel ( HasTraits ) : <EOL> valid_models = Property ( List ) <EOL> root = Enum ( values = '<STR_LIT>' ) <EOL> def _get_valid_models ( self ) : <EOL> return [ '<STR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.