code
stringlengths
9
256k
<s> from r3 . worker . mapper import Mapper <EOL> class CountWordsMapper ( Mapper ) : <EOL> job_type = '<STR_LIT>' <EOL> def map ( self , lines ) : <EOL> return list ( self . split_words ( lines ) ) <EOL> def split_words ( self , lines ) : <EOL> for line in lines : <EOL> for word in line . split ( ) : <EOL> yield word ...
<s> import pyclbr <EOL> import pkgutil <EOL> import importlib <EOL> import inspect <EOL> from itertools import chain <EOL> from functools import reduce <EOL> from tornado_json . constants import HTTP_METHODS <EOL> from tornado_json . utils import extract_method , is_method , is_handler_subclass <EOL> def get_routes ( p...
<s> class ESipHeaderCSV ( Exception ) : <EOL> def __init__ ( self , name , bodys ) : <EOL> Exception . __init__ ( self ) <EOL> self . name = name <EOL> self . bodys = bodys </s>
<s> from socket import gethostbyname , gethostname <EOL> class MyAddress ( object ) : <EOL> my = True <EOL> def __str__ ( self ) : <EOL> try : <EOL> return gethostbyname ( gethostname ( ) ) <EOL> except : <EOL> return '<STR_LIT:127.0.0.1>' <EOL> class MyPort ( object ) : <EOL> my = True <EOL> default_port = None <EOL> ...
<s> from random import random <EOL> from hashlib import md5 <EOL> from time import time <EOL> from SipGenericHF import SipGenericHF <EOL> from SipConf import SipConf <EOL> from ESipHeaderCSV import ESipHeaderCSV <EOL> class SipVia ( SipGenericHF ) : <EOL> hf_names = ( '<STR_LIT>' , '<STR_LIT:v>' ) <EOL> sipver = None <...
<s> import sublime <EOL> import sublime_plugin <EOL> import os <EOL> import subprocess <EOL> from os . path import basename <EOL> installed_dir = os . path . basename ( os . getcwd ( ) ) <EOL> '''<STR_LIT>''' <EOL> def msg ( msg ) : <EOL> print "<STR_LIT>" % msg <EOL> def shellquote ( s ) : <EOL> return "<STR_LIT>" + s...
<s> """<STR_LIT>""" <EOL> from __future__ import division , unicode_literals , print_function , absolute_import <EOL> import contextlib <EOL> import collections <EOL> import pkgutil <EOL> from collections import defaultdict <EOL> from . import logger <EOL> from . import constants <EOL> from . import errors <EOL> from ....
<s> from setuptools import setup <EOL> with open ( '<STR_LIT>' ) as f : <EOL> readme = f . read ( ) <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> long_description = readme , <EOL> license = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_L...
<s> spam ( <NUM_LIT:1> ) <EOL> dict [ '<STR_LIT:key>' ] = list [ index ] <EOL> dict [ '<STR_LIT:key>' ] [ '<STR_LIT>' ] = list [ index ] <EOL> spam ( <NUM_LIT:1> ) <EOL> dict [ '<STR_LIT:key>' ] = list [ index ] <EOL> class Foo ( Bar , Baz ) : <EOL> pass </s>
<s> from gruffy import AccumulatorBar <EOL> g = AccumulatorBar ( ) <EOL> g . title = "<STR_LIT>" <EOL> g . data ( "<STR_LIT>" , [ <NUM_LIT:10> , <NUM_LIT:50> , <NUM_LIT> , <NUM_LIT:20> ] ) <EOL> g . hide_legend = True <EOL> g . labels = { <NUM_LIT:0> : '<STR_LIT>' , <NUM_LIT:1> : '<STR_LIT>' , <NUM_LIT:2> : '<STR_LIT>'...
<s> import os <EOL> from unittest import TestCase , main <EOL> from gruffy import Line <EOL> TARGET_FILE = '<STR_LIT>' <EOL> class TestLine ( TestCase ) : <EOL> def tearDown ( self ) : <EOL> os . remove ( TARGET_FILE ) <EOL> def test_writable ( self ) : <EOL> g = Line ( ) <EOL> g . theme_greyscale ( ) <EOL> g . data ( ...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from logging import getLogger , StreamHandler , Formatter , getLoggerClass , DEBUG <EOL> def create_logger ( app ) : <EOL> """<STR_LIT>""" <EOL> Logger = getLoggerClass ( ) <EOL> class DebugLogger ( Logger ) : <EOL> def getEffectiveLevel ( x ) : <EO...
<s> from django . conf . urls . defaults import patterns , url <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> ( r'<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( r'<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( r'<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( r'<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) </s>
<s> from django . utils import unittest <EOL> from oauth2app . exceptions import OAuth2Exception <EOL> from oauth2app . authorize import Authorizer <EOL> from oauth2app . authenticate import Authenticator <EOL> class ConfigTestCase ( unittest . TestCase ) : <EOL> def test_00_authorize ( self ) : <EOL> self . assertRais...
<s> from testfixtures import OutputCapture <EOL> from django . test import TestCase <EOL> from django . test . utils import override_settings <EOL> class TestReporter ( TestCase ) : <EOL> def _getTarget ( self ) : <EOL> from reportmail . reporter import Reporter <EOL> return Reporter <EOL> def _makeOne ( self , * args ...
<s> from pyhistorian import Step <EOL> class BeforeAll ( Step ) : <EOL> name = '<STR_LIT>' <EOL> class AfterAll ( Step ) : <EOL> name = '<STR_LIT>' <EOL> class BeforeEach ( Step ) : <EOL> name = '<STR_LIT>' <EOL> class AfterEach ( Step ) : <EOL> name = '<STR_LIT>' </s>
<s> from pycukes import * <EOL> @ Given ( '<STR_LIT>' ) <EOL> def i_have_a_calculator ( context ) : <EOL> pass <EOL> @ When ( '<STR_LIT>' ) <EOL> def i_enter_with_one_and_two ( context ) : <EOL> assert False <EOL> @ Then ( '<STR_LIT>' ) <EOL> def i_see_three_in_my_lcd ( context ) : <EOL> raise Exception ( ) </s>
<s> '''<STR_LIT>''' <EOL> from pyhistorian import * <EOL> from pyhistorian . output import colored <EOL> from cStringIO import StringIO <EOL> output = StringIO ( ) <EOL> class StoryWithRedColorsToPendingStuff ( Story ) : <EOL> """<STR_LIT>""" <EOL> pending_color = '<STR_LIT>' <EOL> output = output <EOL> class ScenarioW...
<s> from django . conf import settings <EOL> from django import forms <EOL> from django . utils . safestring import mark_safe <EOL> from django . utils . encoding import smart_unicode <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . forms . widgets import Widget , Select , TextInput...
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import datetime <EOL> import numpy as np <EOL> from matplotlib import cm , pyplot as plt <EOL> from matplotlib . dates import YearLocator , MonthLocator <EOL> try : <EOL> from matplotlib . finance import quotes_historical_yahoo_ochl <EOL> except Impo...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> def add_id_to_detail_page_url_scraped_obj_attributes ( apps , schema_editor ) : <EOL> ScrapedObjAttr = apps . get_model ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> for soa in ScrapedObjAttr . objects . all ( ) : <EOL> if soa . a...
<s> from builtins import map <EOL> import unittest <EOL> def build_test_suite_from ( test_cases ) : <EOL> """<STR_LIT>""" <EOL> test_suites = [ ] <EOL> for test_case in test_cases : <EOL> mod = __import__ ( test_case . __module__ ) <EOL> components = test_case . __module__ . split ( '<STR_LIT:.>' ) <EOL> for comp in co...
<s> from __future__ import unicode_literals <EOL> import os , unittest <EOL> from scraper . models import Event <EOL> from scraper . scraper_test import EventSpider , ScraperTest <EOL> class ScraperReqOptionsRunTest ( ScraperTest ) : <EOL> def setUpWithRequestTypeMethodScraper ( self , test_case ) : <EOL> self . event_...
<s> """<STR_LIT>""" <EOL> import enum <EOL> import logging <EOL> from homeassistant . const import HTTP_OK , HTTP_UNPROCESSABLE_ENTITY <EOL> from homeassistant . helpers import template , script <EOL> DOMAIN = '<STR_LIT>' <EOL> DEPENDENCIES = [ '<STR_LIT:http>' ] <EOL> _LOGGER = logging . getLogger ( __name__ ) <EOL> _...
<s> """<STR_LIT>""" <EOL> import logging <EOL> from homeassistant . components . binary_sensor import BinarySensorDevice <EOL> from homeassistant . loader import get_component <EOL> DEPENDENCIES = [ '<STR_LIT>' ] <EOL> _LOGGER = logging . getLogger ( __name__ ) <EOL> def setup_platform ( hass , config , add_devices_cal...
<s> """<STR_LIT>""" <EOL> import json <EOL> import logging <EOL> import re <EOL> import threading <EOL> from datetime import timedelta <EOL> import requests <EOL> from homeassistant . components . device_tracker import DOMAIN <EOL> from homeassistant . const import CONF_HOST , CONF_PASSWORD , CONF_USERNAME <EOL> from h...
<s> """<STR_LIT>""" <EOL> import logging <EOL> import voluptuous as vol <EOL> from homeassistant . const import ( <EOL> ATTR_ENTITY_ID , SERVICE_TURN_OFF , SERVICE_TURN_ON , STATE_ON ) <EOL> import homeassistant . helpers . config_validation as cv <EOL> from homeassistant . helpers . entity import ToggleEntity <EOL> fr...
<s> """<STR_LIT>""" <EOL> from homeassistant . components . lock import LockDevice <EOL> from homeassistant . const import STATE_LOCKED , STATE_UNLOCKED <EOL> def setup_platform ( hass , config , add_devices_callback , discovery_info = None ) : <EOL> """<STR_LIT>""" <EOL> add_devices_callback ( [ <EOL> DemoLock ( '<STR...
<s> """<STR_LIT>""" <EOL> import logging <EOL> import socket <EOL> import homeassistant . bootstrap as bootstrap <EOL> from homeassistant . const import ( ATTR_DISCOVERED , ATTR_SERVICE , <EOL> CONF_OPTIMISTIC , EVENT_HOMEASSISTANT_START , <EOL> EVENT_HOMEASSISTANT_STOP , <EOL> EVENT_PLATFORM_DISCOVERED , TEMP_CELSIUS ...
<s> """<STR_LIT>""" <EOL> import logging <EOL> import subprocess <EOL> from homeassistant . components . rollershutter import RollershutterDevice <EOL> from homeassistant . const import CONF_VALUE_TEMPLATE <EOL> from homeassistant . helpers import template <EOL> _LOGGER = logging . getLogger ( __name__ ) <EOL> def setu...
<s> """<STR_LIT>""" <EOL> import logging <EOL> from homeassistant . components . isy994 import ( <EOL> HIDDEN_STRING , ISY , SENSOR_STRING , ISYDeviceABC ) <EOL> from homeassistant . const import ( <EOL> STATE_CLOSED , STATE_HOME , STATE_NOT_HOME , STATE_OFF , STATE_ON , STATE_OPEN ) <EOL> DEFAULT_HIDDEN_WEATHER = [ '<...
<s> """<STR_LIT>""" <EOL> from homeassistant . helpers . entity import Entity <EOL> STATE_STREAMING = '<STR_LIT>' <EOL> STATE_OFFLINE = '<STR_LIT>' <EOL> ATTR_GAME = '<STR_LIT>' <EOL> ATTR_TITLE = '<STR_LIT:title>' <EOL> ICON = '<STR_LIT>' <EOL> REQUIREMENTS = [ '<STR_LIT>' ] <EOL> DOMAIN = '<STR_LIT>' <EOL> def setup_...
<s> """<STR_LIT>""" <EOL> import logging <EOL> import re <EOL> import socket <EOL> from datetime import timedelta <EOL> import homeassistant . util as util <EOL> from homeassistant . components . switch import SwitchDevice <EOL> from homeassistant . util import convert <EOL> _LOGGER = logging . getLogger ( __name__ ) <...
<s> """<STR_LIT>""" <EOL> import voluptuous as vol <EOL> import homeassistant . components . nest as nest <EOL> from homeassistant . components . thermostat import ( <EOL> STATE_COOL , STATE_HEAT , STATE_IDLE , ThermostatDevice ) <EOL> from homeassistant . const import TEMP_CELSIUS , CONF_PLATFORM , CONF_SCAN_INTERVAL ...
<s> """<STR_LIT>""" <EOL> import functools <EOL> import logging <EOL> import voluptuous as vol <EOL> from homeassistant . const import ATTR_ENTITY_ID <EOL> from homeassistant . exceptions import TemplateError <EOL> from homeassistant . helpers import template <EOL> from homeassistant . loader import get_component <EOL>...
<s> """<STR_LIT>""" <EOL> import unittest <EOL> from datetime import timedelta <EOL> from unittest . mock import patch <EOL> from homeassistant . bootstrap import _setup_component <EOL> import homeassistant . util . dt as dt_util <EOL> import homeassistant . components . automation as automation <EOL> from tests . comm...
<s> """<STR_LIT>""" <EOL> import unittest <EOL> from homeassistant . components import lock <EOL> from tests . common import get_test_home_assistant <EOL> FRONT = '<STR_LIT>' <EOL> KITCHEN = '<STR_LIT>' <EOL> class TestLockDemo ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> """<STR_LIT...
<s> """<STR_LIT>""" <EOL> import unittest <EOL> from unittest import mock <EOL> import homeassistant . core as ha <EOL> import homeassistant . components . statsd as statsd <EOL> from homeassistant . const import STATE_ON , STATE_OFF , EVENT_STATE_CHANGED <EOL> class TestStatsd ( unittest . TestCase ) : <EOL> """<STR_L...
<s> """<STR_LIT>""" <EOL> import unittest <EOL> import homeassistant . loader as loader <EOL> import homeassistant . components . http as http <EOL> from tests . common import get_test_home_assistant , MockModule <EOL> class TestLoader ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> """...
<s> from base import BaseMatcher <EOL> class SandwichMatcher ( BaseMatcher ) : <EOL> text = "<STR_LIT>" <EOL> name = "<STR_LIT>" <EOL> def respond ( self , message , user = None ) : <EOL> if self . text in message . lower ( ) : <EOL> if '<STR_LIT>' in message : <EOL> message = "<STR_LIT>" <EOL> else : <EOL> message = "...
<s> import pytest <EOL> from webdriverwrapper . exceptions import InfoMessagesException <EOL> def test_check_info_messages ( driver_info_msgs ) : <EOL> with pytest . raises ( InfoMessagesException ) as excinfo : <EOL> driver_info_msgs . check_infos ( expected_info_messages = ( '<STR_LIT>' , ) ) <EOL> def test_check_exp...
<s> import os <EOL> import sys <EOL> from setuptools import setup , find_packages <EOL> py_version = sys . version_info [ : <NUM_LIT:2> ] <EOL> if py_version < ( <NUM_LIT:3> , <NUM_LIT:3> ) : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> here = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> with open ( os...
<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 . AddField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_LIT...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import django . utils . timezone <EOL> from django . conf import settings <EOL> import pybb . util <EOL> from pybb . compat import get_image_field_class <EOL> class Migration ( migrations . Migration ) : <EOL> dependenci...
<s> from parameters import applyPreset , preset , presetTree , group , registerPreset , allPresets , BadPreset , defaults , PCall , pcall <EOL> from parameters . runtime import Delta , Direct <EOL> from pmodule import PModule , pmodule , addToRunQueue <EOL> from manager import initialize , manager , reset , clean <EOL>...
<s> from lazyrunner import manager , initialize , reset , PCall <EOL> from treedict import TreeDict <EOL> from os . path import exists , join <EOL> import shutil <EOL> import unittest <EOL> if exists ( '<STR_LIT>' ) : <EOL> project_directory = '<STR_LIT>' <EOL> elif exists ( '<STR_LIT>' ) : <EOL> project_directory = '<...
<s> """<STR_LIT>""" <EOL> import logging <EOL> from datetime import datetime , timedelta , tzinfo , date <EOL> from collections import namedtuple <EOL> from weakref import WeakKeyDictionary , WeakValueDictionary <EOL> import pytz <EOL> from units . quantity import Quantity <EOL> import stravalib . model <EOL> META = <N...
<s> import logging <EOL> from monasca_setup import agent_config <EOL> import monasca_setup . detection <EOL> from monasca_setup . detection . utils import _get_dimensions <EOL> log = logging . getLogger ( __name__ ) <EOL> class CinderLMDetect ( monasca_setup . detection . ArgsPlugin ) : <EOL> """<STR_LIT>""" <EOL> CHEC...
<s> import logging <EOL> import monasca_setup . agent_config <EOL> import monasca_setup . detection <EOL> log = logging . getLogger ( __name__ ) <EOL> PROCESS = "<STR_LIT>" <EOL> class ApacheDetect ( monasca_setup . detection . Plugin ) : <EOL> """<STR_LIT>""" <EOL> def _detect ( self ) : <EOL> """<STR_LIT>""" <EOL> if...
<s> import os <EOL> import os . path <EOL> import pwd <EOL> from swiftlm . utils . utility import server_type <EOL> from swiftlm . utils . metricdata import MetricData <EOL> from swiftlm . utils . values import Severity , ServerType <EOL> SWIFT_DIR = '<STR_LIT>' <EOL> CONF_DIR = '<STR_LIT>' <EOL> NODE_DIR = '<STR_LIT>'...
<s> import unittest <EOL> from yaml import safe_load <EOL> from swiftlm . rings . ring_model import RingSpecifications , RingSpecification , DeviceInfo , DriveConfiguration , SwiftModelException <EOL> from swiftlm . rings . hlm_model import InputModel <EOL> from tests . data . rings_ringspecs import ringspec_simple , r...
<s> MODEL_VERSION = <NUM_LIT:1> <EOL> CHECKPOINT_DIRECTORY = '<STR_LIT>' <EOL> PATCH_DIRECTORY = '<STR_LIT>' + str ( MODEL_VERSION ) + '<STR_LIT>' </s>
<s> import yaml <EOL> import os <EOL> class StatePersistor ( ) : <EOL> def __init__ ( self , models , controllers , <EOL> persistence_file = '<STR_LIT>' , <EOL> persistence_path = None ) : <EOL> if persistence_path : <EOL> self . _persistence_path = persistence_path <EOL> else : <EOL> cloud_config = controllers [ '<STR...
<s> import logging <EOL> import timeit <EOL> import traceback <EOL> from . . model . CPProcessor import CPProcessor <EOL> from . . model . CPLogging import CPLogging as KenLog <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class ExplainerProcessor ( CPProcessor ) : <EOL> def __init__ ( self , instructions , models ...
<s> import six <EOL> import logging <EOL> import logging . config <EOL> from collections import OrderedDict <EOL> from helion_configurationprocessor . cp . model . ControlPlane import ControlPlane <EOL> from helion_configurationprocessor . cp . model . Tier import Tier <EOL> from helion_configurationprocessor . cp . mo...
<s> import logging <EOL> import logging . config <EOL> from helion_configurationprocessor . cp . model . ValidatorPlugin import ValidatorPlugin <EOL> from helion_configurationprocessor . cp . model . CPLogging import CPLogging as KenLog <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class RingSpecificationsValidato...
<s> import sys <EOL> import py <EOL> import time <EOL> import threading <EOL> tw = py . io . TerminalWriter ( ) <EOL> class _GetchUnix : <EOL> def __init__ ( self ) : <EOL> import tty , sys <EOL> def __call__ ( self ) : <EOL> import sys , tty , termios <EOL> fd = sys . stdin . fileno ( ) <EOL> old_settings = termios . ...
<s> from faker import frandom <EOL> from faker import helper <EOL> from faker import definitions <EOL> import random <EOL> def phone_number ( ) : <EOL> return helper . replace_symbol_with_number ( frandom . phone_formats ( ) ) <EOL> def phone_number_format ( phone_formats_array_index ) : <EOL> return helper . replace_s...
<s> import numpy as np <EOL> from chaco . api import AbstractPlotData <EOL> from traits . api import Dict , Instance , Str , Array , Enum <EOL> from collections import OrderedDict <EOL> from operator import itemgetter <EOL> from pandas import DataFrame <EOL> class PandasPlotData ( AbstractPlotData ) : <EOL> '''<STR_LIT...
<s> from skspec . plotting . advanced_plots import PLOTPARSER <EOL> from IPython . html . widgets import ( <EOL> FlexBox , VBox , HBox , HTML , Box , RadioButtons , <EOL> Text , Dropdown , Checkbox , Image , <EOL> IntSlider , Button , Text , FloatSlider , IntText , <EOL> ContainerWidget , FloatText <EOL> ) <EOL> import...
<s> from abcunits import ConversionUnit <EOL> class SoluteUnit ( ConversionUnit ) : <EOL> """<STR_LIT>""" <EOL> class Moles ( SoluteUnit ) : <EOL> short = '<STR_LIT:M>' <EOL> full = '<STR_LIT>' <EOL> symbol = '<STR_LIT:M>' <EOL> _canonical = True <EOL> class Millimoles ( SoluteUnit ) : <EOL> short = '<STR_LIT>' <EOL> f...
<s> from __future__ import absolute_import , unicode_literals , print_function , division <EOL> DIFF = '<STR_LIT>' <EOL> GZIP = '<STR_LIT>' <EOL> JSON = '<STR_LIT:application/json>' <EOL> OCTET_STREAM = '<STR_LIT>' <EOL> TAR = '<STR_LIT>' <EOL> ZIP = '<STR_LIT>' </s>
<s> import sublime <EOL> import sublime_plugin <EOL> import os . path <EOL> import platform <EOL> import re <EOL> import webbrowser <EOL> class WordpressdocCommand ( sublime_plugin . TextCommand ) : <EOL> def run ( self , edit ) : <EOL> print ( '<STR_LIT>' ) <EOL> for region in self . view . sel ( ) : <EOL> if not regi...
<s> if "<STR_LIT:__main__>" == __name__ : <EOL> """<STR_LIT>""" <EOL> s = '<STR_LIT:0>' <EOL> n = int ( s ) <EOL> print ( <NUM_LIT:10> / n ) </s>
<s> from collections import namedtuple <EOL> import re <EOL> class BadNestingException ( Exception ) : <EOL> pass <EOL> class MissingAuthorException ( Exception ) : <EOL> pass <EOL> class EmptyCommentException ( Exception ) : <EOL> pass <EOL> class CommentInHeaderException ( Exception ) : <EOL> pass <EOL> DIFF_HEADER =...
<s> try : <EOL> import xml . etree . cElementTree as ET <EOL> except ImportError : <EOL> import xml . etree . ElementTree as ET <EOL> class Scheme ( object ) : <EOL> """<STR_LIT>""" <EOL> streaming_mode_simple = "<STR_LIT>" <EOL> streaming_mode_xml = "<STR_LIT>" <EOL> def __init__ ( self , title ) : <EOL> """<STR_LIT>"...
<s> import os <EOL> import os . path as osp <EOL> import waflib . Utils <EOL> import waflib . Logs as msg <EOL> from waflib . Configure import conf <EOL> _heptooldir = osp . dirname ( osp . abspath ( __file__ ) ) <EOL> def options ( ctx ) : <EOL> ctx . load ( '<STR_LIT>' , tooldir = _heptooldir ) <EOL> return <EOL> def...
<s> import os <EOL> import os . path as osp <EOL> import waflib . Utils <EOL> import waflib . Logs as msg <EOL> from waflib . Configure import conf <EOL> _heptooldir = osp . dirname ( osp . abspath ( __file__ ) ) <EOL> def options ( ctx ) : <EOL> ctx . load ( '<STR_LIT>' , tooldir = _heptooldir ) <EOL> ctx . add_option...
<s> '''<STR_LIT>''' <EOL> from waflib . TaskGen import feature <EOL> import orch . features <EOL> orch . features . register_defaults ( <EOL> '<STR_LIT>' , <EOL> build_cmd = '<STR_LIT>' , <EOL> build_cmd_options = '<STR_LIT>' , <EOL> build_target = '<STR_LIT>' , <EOL> build_target_path = '<STR_LIT>' , <EOL> install_cmd...
<s> '''<STR_LIT>''' <EOL> import win32gui <EOL> import re <EOL> import SendKeys <EOL> import time <EOL> import log <EOL> class WindowFinder : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . _handle = None <EOL> def find_window ( self , class_name , window_name = None ) : <EOL> """<STR_LIT>""" <EOL> sel...
<s> """<STR_LIT>""" <EOL> import sys <EOL> import copy <EOL> import logging <EOL> import time <EOL> import warnings <EOL> import numpy as np <EOL> import sklearn . preprocessing as preproc <EOL> try : <EOL> from scipy import linalg <EOL> except ImportError : <EOL> warnings . warn ( "<STR_LIT>" ) <EOL> from theano impor...
<s> import os <EOL> import theano <EOL> import theano . tensor as T <EOL> import numpy as np <EOL> from pynet . model import AutoEncoder <EOL> from pynet . layer import * <EOL> from pynet . datasets . mnist import Mnist <EOL> from pynet . learning_rule import LearningRule <EOL> from pynet . learning_method import * <EO...
<s> __author__ = "<STR_LIT>" <EOL> __copyright__ = "<STR_LIT>" <EOL> __credits__ = [ "<STR_LIT>" ] <EOL> __license__ = "<STR_LIT>" <EOL> __email__ = "<STR_LIT>" <EOL> __maintainer__ = "<STR_LIT>" <EOL> import pynet . datasets . iterator as iterators <EOL> import numpy as np <EOL> import theano <EOL> floatX = theano . c...
<s> import numpy as np <EOL> import cPickle <EOL> import os <EOL> def make_posterior_npy ( filename , save_dir , splits ) : <EOL> basename = os . path . basename ( filename ) <EOL> with open ( "<STR_LIT>" % save_dir ) as fname : <EOL> fnames_ls = cPickle . load ( fname ) <EOL> num_file = len ( fnames_ls ) <EOL> file_co...
<s> """<STR_LIT>""" <EOL> from commando import * <EOL> from mock import patch <EOL> def trap_exit_fail ( f ) : <EOL> def test_wrapper ( * args ) : <EOL> try : <EOL> f ( * args ) <EOL> except SystemExit : <EOL> import traceback <EOL> print ( traceback . format_exc ( ) ) <EOL> assert False <EOL> test_wrapper . __name__ =...
<s> """<STR_LIT>""" <EOL> from docutils import nodes <EOL> from docutils . parsers . rst import directives , Directive <EOL> from pygments import highlight <EOL> from pygments . formatters import HtmlFormatter <EOL> from pygments . lexers import get_lexer_by_name , TextLexer <EOL> INLINESTYLES = False <EOL> DEFAULT = H...
<s> """<STR_LIT>""" <EOL> from hyde . _compat import quote <EOL> from hyde . generator import Generator <EOL> from hyde . site import Site <EOL> from fswrap import File <EOL> TEST_SITE = File ( __file__ ) . parent . parent . child_folder ( '<STR_LIT>' ) <EOL> class TestTextlinks ( object ) : <EOL> def setUp ( self ) : ...
<s> import json <EOL> import cPickle <EOL> import shutil <EOL> from collections import OrderedDict <EOL> from hashlib import md5 <EOL> from datetime import datetime <EOL> from urllib2 import urlopen <EOL> import time <EOL> import math <EOL> from sqlite3 import dbapi2 as db <EOL> from django . utils . timezone import ut...
<s> </s>
<s> import ClientConstants as CC <EOL> import ClientDefaults <EOL> import ClientDownloading <EOL> import ClientFiles <EOL> import ClientNetworking <EOL> import ClientThreading <EOL> import collections <EOL> import datetime <EOL> import HydrusConstants as HC <EOL> import HydrusExceptions <EOL> import HydrusFileHandling ...
<s> import gc <EOL> import HydrusConstants as HC <EOL> import HydrusData <EOL> import os <EOL> import psutil <EOL> import send2trash <EOL> import shutil <EOL> import subprocess <EOL> import sys <EOL> import tempfile <EOL> import threading <EOL> import traceback <EOL> def AppendPathUntilNoConflicts ( path ) : <EOL> ( pa...
<s> import contextlib <EOL> import os <EOL> import re <EOL> import sys <EOL> import hy . macros <EOL> import hy . compiler <EOL> from hy . _compat import builtins , string_types <EOL> docomplete = True <EOL> try : <EOL> import readline <EOL> except ImportError : <EOL> try : <EOL> import pyreadline . rlmain <EOL> import...
<s> import ast <EOL> import sys <EOL> from hy import compiler <EOL> from hy . models . expression import HyExpression <EOL> from hy . models . list import HyList <EOL> from hy . models . symbol import HySymbol <EOL> from hy . models . integer import HyInteger <EOL> from hy . _compat import PY33 <EOL> if sys . version_i...
<s> import matplotlib . pyplot as plt <EOL> from hyperion . model import ModelOutput <EOL> from hyperion . util . constants import pc <EOL> mo = ModelOutput ( '<STR_LIT>' ) <EOL> sed = mo . get_sed ( aperture = - <NUM_LIT:1> , distance = <NUM_LIT> * pc ) <EOL> fig = plt . figure ( figsize = ( <NUM_LIT:5> , <NUM_LIT:4> ...
<s> from astropy . tests . helper import pytest <EOL> from . . conf_files import RunConf <EOL> @ pytest . mark . parametrize ( ( '<STR_LIT:value>' ) , [ <NUM_LIT:0> , <NUM_LIT:0.> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1.> , <NUM_LIT:1> ] ) <EOL> def test_propagation_check_frequency ( value ) : <EOL> r = RunConf ( ) <EOL> ...
<s> import h5py <EOL> from . . util . otf_hdf5 import on_the_fly_hdf5 <EOL> class GridOnDisk ( object ) : <EOL> def __init__ ( self , filename , path = '<STR_LIT:/>' ) : <EOL> self . filename = filename <EOL> self . path = path <EOL> self . file = None <EOL> @ on_the_fly_hdf5 <EOL> def __contains__ ( self , item ) : <E...
<s> import os <EOL> import shutil <EOL> import itertools <EOL> from astropy . tests . helper import pytest <EOL> import numpy as np <EOL> from . test_helpers import random_id , assert_identical_results <EOL> from . . import Model , AnalyticalYSOModel <EOL> from ... util . constants import pc , lsun , c , au , msun , pi...
<s> from __future__ import print_function , division <EOL> from numpy import pi <EOL> lsun = <NUM_LIT> <EOL> '''<STR_LIT>''' <EOL> rsun = <NUM_LIT> <EOL> '''<STR_LIT>''' <EOL> msun = <NUM_LIT> <EOL> '''<STR_LIT>''' <EOL> tsun = <NUM_LIT> <EOL> '''<STR_LIT>''' <EOL> au = <NUM_LIT> <EOL> '''<STR_LIT>''' <EOL> year = <NUM...
<s> """<STR_LIT>""" <EOL> __authors__ = "<STR_LIT>" <EOL> __license__ = "<STR_LIT>" <EOL> __contact__ = "<STR_LIT>" <EOL> import cPickle <EOL> import logging <EOL> import os <EOL> import base <EOL> import utils <EOL> logger = logging . getLogger ( __name__ ) <EOL> from . base import SerialExperiment <EOL> import sys <E...
<s> """<STR_LIT>""" <EOL> __authors__ = "<STR_LIT>" <EOL> __license__ = "<STR_LIT>" <EOL> __contact__ = "<STR_LIT>" <EOL> import logging <EOL> import time <EOL> import numpy as np <EOL> from scipy . special import erf <EOL> import pyll <EOL> from pyll import scope <EOL> from pyll . stochastic import implicit_stochastic...
<s> from mock import Mock <EOL> from pyramid import httpexceptions <EOL> from pyramid . testing import DummyRequest <EOL> import pytest <EOL> from h import accounts <EOL> from h . admin . views import admins as views <EOL> admins_index_fixtures = pytest . mark . usefixtures ( '<STR_LIT>' ) <EOL> @ admins_index_fixtures...
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> import logging <EOL> import elasticsearch <EOL> log = logging . getLogger ( __name__ ) <EOL> ANNOTATION_MAPPING = { <EOL> '<STR_LIT>' : { '<STR_LIT:path>' : '<STR_LIT:id>' } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : [ '<STR_LIT:id>' ] } , <EOL> '<STR_L...
<s> Admin = '<STR_LIT>' <EOL> Staff = '<STR_LIT>' </s>
<s> """<STR_LIT>""" <EOL> from h . feeds . render import render_atom <EOL> from h . feeds . render import render_rss <EOL> __all__ = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def includeme ( config ) : <EOL> config . include ( '<STR_LIT>' ) </s>
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> import json <EOL> from alembic import op <EOL> import sqlalchemy as sa <EOL> from sqlalchemy . types import TypeDecorator , VARCHAR <EOL> class JSONEncodedDict ( TypeDecorator ) : <EOL> """<STR_LIT>""" <EOL> impl = VARCHAR <EOL> de...
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> from alembic import op <EOL> import sqlalchemy as sa <EOL> from sqlalchemy import orm <EOL> Session = orm . sessionmaker ( ) <EOL> user = sa . table ( '<STR_LIT:user>' , sa . column ( '<STR_LIT>' , sa . Boolean ) ) <EOL> def upgrad...
<s> from __future__ import print_function <EOL> import argparse <EOL> import collections <EOL> import logging <EOL> import os <EOL> import sys <EOL> import textwrap <EOL> from pkg_resources import iter_entry_points <EOL> from elasticsearch import helpers as es_helpers <EOL> from pyramid import paster <EOL> from pyramid...
<s> from django . conf import settings <EOL> from django . contrib . staticfiles import finders <EOL> from django . core . management . base import NoArgsCommand <EOL> from django . utils . datastructures import SortedDict <EOL> import os <EOL> from . . utils import StorageOverrideMixin <EOL> from ... manifests import ...
<s> import sys <EOL> import importlib <EOL> from setuptools import setup , find_packages <EOL> from setuptools . command . test import test as TestCommand <EOL> PACKAGES = find_packages ( ) <EOL> main_module = importlib . import_module ( PACKAGES [ <NUM_LIT:0> ] ) <EOL> try : <EOL> PROJECT_NAME = main_module . __app_na...
<s> """<STR_LIT>""" <EOL> import glob <EOL> import os <EOL> import py_compile <EOL> from mochi . core . main import make_py_source_file , MONKEY_PATCH_ENV <EOL> from mochi . utils . path_helper import TempDir <EOL> def make_target_file_name ( file_name , dst_path , ext ) : <EOL> """<STR_LIT>""" <EOL> target_file_name =...