code
stringlengths
9
256k
<s> from . mplayer import * </s>
<s> __all__ = [ '<STR_LIT>' ] <EOL> from . . common import * <EOL> def heavymusic_download ( url , output_dir = '<STR_LIT:.>' , merge = True , info_only = False , ** kwargs ) : <EOL> html = get_html ( url ) <EOL> tracks = re . findall ( r'<STR_LIT>' , html ) <EOL> for track in tracks : <EOL> band = r1 ( r'<STR_LIT>' , ...
<s> __all__ = [ '<STR_LIT>' ] <EOL> from . . common import * <EOL> import urllib . error <EOL> from time import time <EOL> from urllib . parse import quote <EOL> from json import loads <EOL> def pixnet_download ( url , output_dir = '<STR_LIT:.>' , merge = True , info_only = False , ** kwargs ) : <EOL> if re . match ( r...
<s> __all__ = [ '<STR_LIT>' ] <EOL> from . . common import * <EOL> import re <EOL> import base64 <EOL> import json <EOL> import time <EOL> import hashlib <EOL> def zhanqi_download ( url , output_dir = '<STR_LIT:.>' , merge = True , info_only = False , ** kwargs ) : <EOL> html = get_content ( url ) <EOL> video_type_patt...
<s> import config <EOL> import utils <EOL> import sublime <EOL> import sublime_plugin <EOL> class SwiDebugView ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , v ) : <EOL> self . view = v <EOL> self . callbacks = [ ] <EOL> self . prev_click_position = <NUM_LIT:0> <EOL> def __getattr__ ( self , attr ) : <E...
<s> class LightState ( object ) : <EOL> def __init__ ( self , state_data ) : <EOL> self . _data = state_data <EOL> self . xy = state_data [ '<STR_LIT>' ] <EOL> self . on = state_data [ '<STR_LIT>' ] <EOL> self . sat = state_data [ '<STR_LIT>' ] <EOL> self . hue = state_data [ '<STR_LIT>' ] <EOL> self . bri = state_data...
<s> import argparse <EOL> import os <EOL> import time <EOL> import zlib <EOL> import sys <EOL> import re <EOL> import socket <EOL> import sqlite3 as lite <EOL> from twisted . internet . protocol import ServerFactory , ClientFactory , Protocol <EOL> from twisted . protocols . basic import LineReceiver , NetstringReceive...
<s> from __future__ import absolute_import , division , print_function , unicode_literals <EOL> import logging <EOL> import os <EOL> import time <EOL> import sys <EOL> from xml . etree import ElementTree <EOL> from benchexec import result <EOL> from benchexec import util <EOL> MEMLIMIT = "<STR_LIT>" <EOL> TIMELIMIT = "...
<s> """<STR_LIT>""" <EOL> import logging <EOL> import xml . etree . ElementTree as ET <EOL> import benchexec . util as util <EOL> import benchexec . tools . template <EOL> import benchexec . result as result <EOL> class Tool ( benchexec . tools . template . BaseTool ) : <EOL> """<STR_LIT>""" <EOL> REQUIRED_PATHS = [ <E...
<s> """<STR_LIT>""" <EOL> import benchexec . util as util <EOL> import benchexec . tools . template <EOL> import benchexec . result as result <EOL> import subprocess <EOL> import os <EOL> import sys <EOL> class Tool ( benchexec . tools . template . BaseTool ) : <EOL> """<STR_LIT>""" <EOL> REQUIRED_PATHS = [ <EOL> "<STR...
<s> import re <EOL> import collections <EOL> try : <EOL> from urllib import quote_plus <EOL> except ImportError : <EOL> from urllib . parse import quote_plus <EOL> import six <EOL> def to_params ( hash ) : <EOL> normalized = [ normalize_param ( k , v ) for ( k , v ) in six . iteritems ( hash ) ] <EOL> return dict ( ( k...
<s> from setuptools import setup <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) , <EOL> packages = [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> scripts = [ '<STR_LIT>' , ] , <EOL> url = '<STR_LIT>' , <EOL> license = ope...
<s> import os <EOL> import djcelery <EOL> djcelery . setup_loader ( ) <EOL> DEBUG = True <EOL> TEMPLATE_DEBUG = DEBUG <EOL> APPEND_SLASH = False <EOL> ADMINS = ( <EOL> ) <EOL> AUTH_USER_MODEL = '<STR_LIT>' <EOL> MANAGERS = ADMINS <EOL> APP_DIR = '<STR_LIT>' <EOL> DB_NAME = '<STR_LIT>' % APP_DIR <EOL> DATABASES = { <EOL...
<s> from __future__ import absolute_import <EOL> import re <EOL> import json <EOL> import copy <EOL> from svtplay_dl . service import Service , OpenGraphThumbMixin <EOL> from svtplay_dl . utils . urllib import urlparse <EOL> from svtplay_dl . fetcher . http import HTTP <EOL> from svtplay_dl . fetcher . hls import hlspa...
<s> from __future__ import absolute_import <EOL> import re <EOL> import os <EOL> import xml . etree . ElementTree as ET <EOL> import json <EOL> import copy <EOL> from svtplay_dl . utils . urllib import urlparse , parse_qs , quote_plus <EOL> from svtplay_dl . service import Service , OpenGraphThumbMixin <EOL> from svtpl...
<s> from abc import ABCMeta , abstractmethod <EOL> import collections <EOL> from datetime import datetime , timedelta <EOL> import math <EOL> import os <EOL> import requests <EOL> import six <EOL> import time <EOL> import busbus . entity <EOL> @ six . add_metaclass ( ABCMeta ) <EOL> class Iterable ( object ) : <EOL> de...
<s> """<STR_LIT>""" <EOL> import os <EOL> import numpy as np <EOL> from . extern . six import string_types <EOL> from . file import FILE_MODES , _File <EOL> from . hdu . base import _BaseHDU , _ValidHDU <EOL> from . hdu . hdulist import fitsopen <EOL> from . hdu . image import PrimaryHDU , ImageHDU <EOL> from . hdu . t...
<s> from __future__ import ( absolute_import , unicode_literals ) <EOL> class SijaxError ( Exception ) : <EOL> """<STR_LIT>""" </s>
<s> """<STR_LIT>""" <EOL> import re <EOL> import sys <EOL> import time <EOL> from guild . actor import * <EOL> class Follow ( Actor ) : <EOL> def __init__ ( self , fname ) : <EOL> self . fname = fname <EOL> self . f = None <EOL> super ( Follow , self ) . __init__ ( ) <EOL> def gen_process ( self ) : <EOL> self . f = f ...
<s> """<STR_LIT>""" <EOL> import six <EOL> from PyQt4 import QtCore , QtGui <EOL> from . actor import ActorMixin , ActorMetaclass , actor_method <EOL> class _QtActorMixinMetaclass ( QtCore . pyqtWrapperType , ActorMetaclass ) : <EOL> pass <EOL> @ six . add_metaclass ( _QtActorMixinMetaclass ) <EOL> class QtActorMixin (...
<s> from psphere import ManagedObject , cached_property <EOL> class ExtensibleManagedObject ( ManagedObject ) : <EOL> _valid_attrs = set ( [ '<STR_LIT>' , '<STR_LIT:value>' ] ) <EOL> def __init__ ( self , mo_ref , client ) : <EOL> ManagedObject . __init__ ( self , mo_ref , client ) <EOL> self . _valid_attrs = set . uni...
<s> class CallbackModule ( object ) : <EOL> def display ( self , event , * args ) : <EOL> play = getattr ( self , '<STR_LIT>' , None ) <EOL> task = getattr ( self , '<STR_LIT>' , None ) <EOL> if play is not None : <EOL> playbook = play . playbook . filename <EOL> else : <EOL> playbook = "<STR_LIT>" <EOL> if task is not...
<s> """<STR_LIT>""" <EOL> import re <EOL> from copy import deepcopy <EOL> from six import iteritems , text_type <EOL> from docutils import nodes <EOL> from sphinx import addnodes <EOL> from sphinx . roles import XRefRole <EOL> from sphinx . locale import l_ , _ <EOL> from sphinx . domains import Domain , ObjType <EOL> ...
<s> """<STR_LIT>""" <EOL> import json <EOL> from six import text_type <EOL> from six . moves import UserString <EOL> class SphinxJSONEncoder ( json . JSONEncoder ) : <EOL> """<STR_LIT>""" <EOL> def default ( self , obj ) : <EOL> if isinstance ( obj , UserString ) : <EOL> return text_type ( obj ) <EOL> return json . JSO...
<s> from sphinx . config import string_classes <EOL> value1 = <NUM_LIT> <EOL> value2 = <NUM_LIT> <EOL> value3 = [ ] <EOL> value4 = True <EOL> value5 = <NUM_LIT:3> <EOL> value6 = ( ) <EOL> value7 = [ '<STR_LIT:foo>' ] <EOL> class A ( object ) : <EOL> pass <EOL> class B ( A ) : <EOL> pass <EOL> class C ( A ) : <EOL> pass...
<s> html_theme = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EOL> exclude_patterns = [ '<STR_LIT>' ] </s>
<s> """<STR_LIT>""" <EOL> import re <EOL> from util import with_app <EOL> @ with_app ( '<STR_LIT:html>' , testroot = '<STR_LIT>' ) <EOL> def test_autosectionlabel_html ( app , status , warning ) : <EOL> app . builder . build_all ( ) <EOL> content = ( app . outdir / '<STR_LIT>' ) . text ( ) <EOL> html = ( '<STR_LIT>' <E...
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from sphinx . util . logging import is_suppressed_warning <EOL> def test_is_suppressed_warning ( ) : <EOL> suppress_warnings = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> assert is_suppressed_warning ( None , None , suppress_warnings ) is False...
<s> import os <EOL> import shutil <EOL> import sys <EOL> import tempfile <EOL> import unittest <EOL> from spinnaker . configurator import Configurator <EOL> from spinnaker . configurator import InstallationParameters <EOL> from spinnaker . yaml_util import YamlBindings <EOL> class ConfiguratorTest ( unittest . TestCase...
<s> import json <EOL> import mock <EOL> from pyramid import testing <EOL> from daybed . renderers import GeoJSON <EOL> from . support import BaseWebTest , force_unicode <EOL> from . test_views import MODEL_DEFINITION , MODEL_RECORD , MODEL_RECORD2 <EOL> class RecordsRendererTest ( BaseWebTest ) : <EOL> def setUp ( self...
<s> import os <EOL> import warnings <EOL> from flask import Flask , g , request , session <EOL> from flask . ext . babel import Babel <EOL> from raven . contrib . flask import Sentry <EOL> from web import main , db , mail <EOL> from api import api <EOL> from utils import PrefixedWSGI <EOL> app = Flask ( __name__ ) <EOL...
<s> from setuptools import setup , find_packages <EOL> setup ( <EOL> name = "<STR_LIT>" , <EOL> version = "<STR_LIT:1.0>" , <EOL> author = "<STR_LIT>" , <EOL> author_email = "<STR_LIT>" , <EOL> url = "<STR_LIT>" , <EOL> include_package_data = True , <EOL> zip_safe = False , <EOL> packages = find_packages ( ) , <EOL> in...
<s> from __future__ import absolute_import , unicode_literals <EOL> """<STR_LIT>""" <EOL> from oauthlib . common import Request , log <EOL> from . base import BaseEndpoint , catch_errors_and_unavailability <EOL> class ResourceEndpoint ( BaseEndpoint ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , default_token , ...
<s> from __future__ import absolute_import <EOL> from splunklib . client import Service <EOL> try : <EOL> from collections import OrderedDict <EOL> except ImportError : <EOL> from ordereddict import OrderedDict <EOL> from inspect import getmembers <EOL> from logging import _levelNames , getLevelName <EOL> from os impor...
<s> from __future__ import absolute_import <EOL> from . search_command_internals import ConfigurationSettingsType <EOL> from . streaming_command import StreamingCommand <EOL> from . search_command import SearchCommand <EOL> from . import csv <EOL> class ReportingCommand ( SearchCommand ) : <EOL> """<STR_LIT>""" <EOL> d...
<s> """<STR_LIT>""" <EOL> from pprint import pprint <EOL> import sys , os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT:..>" , "<STR_LIT:..>" ) ) <EOL> import splunklib . binding as binding <EOL> import splunklib . client as client <EOL> try : <EOL> import uti...
<s> """<STR_LIT>""" <EOL> from code import compile_command , InteractiveInterpreter <EOL> try : <EOL> import readline <EOL> except ImportError : <EOL> pass <EOL> import sys , os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT:..>" ) ) <EOL> import splunklib . cl...
<s> from __future__ import absolute_import , division , print_function , unicode_literals <EOL> from . decorators import ConfigurationSetting <EOL> from . search_command import SearchCommand <EOL> from itertools import imap , ifilter <EOL> class GeneratingCommand ( SearchCommand ) : <EOL> """<STR_LIT>""" <EOL> def gene...
<s> import testlib <EOL> import logging <EOL> import splunklib . client as client <EOL> class TestRead ( testlib . SDKTestCase ) : <EOL> def test_read ( self ) : <EOL> for event_type in self . service . event_types . list ( count = <NUM_LIT:1> ) : <EOL> self . check_entity ( event_type ) <EOL> class TestCreate ( testli...
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> import hashlib <EOL> import logging <EOL> import re <EOL> import random <EOL> from django . conf import settings <EOL> from django . core . urlresolvers import get_callable <EOL> from django . utils . cache import patch_vary_headers <EOL> from djan...
<s> __version__ = "<STR_LIT>" <EOL> def detect ( aBuf ) : <EOL> from . import universaldetector <EOL> u = universaldetector . UniversalDetector ( ) <EOL> u . reset ( ) <EOL> u . feed ( aBuf ) <EOL> u . close ( ) <EOL> return u . result </s>
<s> from __future__ import absolute_import <EOL> """<STR_LIT>""" <EOL> from . rfc5849 import Client , Server </s>
<s> __version__ = "<STR_LIT>" <EOL> from . constants import AlertLevel , AlertDescription , Fault <EOL> from . errors import * <EOL> from . checker import Checker <EOL> from . handshakesettings import HandshakeSettings <EOL> from . session import Session <EOL> from . sessioncache import SessionCache <EOL> from . tlscon...
<s> """<STR_LIT>""" <EOL> import os <EOL> import math <EOL> import base64 <EOL> import binascii <EOL> from . compat import * <EOL> try : <EOL> from M2Crypto import m2 <EOL> m2cryptoLoaded = True <EOL> except ImportError : <EOL> m2cryptoLoaded = False <EOL> try : <EOL> import gmpy <EOL> gmpyLoaded = True <EOL> except Im...
<s> from django . contrib . auth . decorators import login_required <EOL> from splunkdj . decorators . render import render_to <EOL> @ render_to ( '<STR_LIT>' ) <EOL> @ login_required <EOL> def home ( request ) : <EOL> return { <EOL> "<STR_LIT:message>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } </s>
<s> from django . contrib . auth . decorators import login_required as require_login <EOL> from django . shortcuts import render_to_response <EOL> from django . template import RequestContext <EOL> from splunkdj . setup import config_required as require_config <EOL> def render_template ( template , mimetype = None , lo...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ] <EOL> operations = [ <EOL> migrations . CreateModel ( <EOL> name = '<STR_LIT>' , <EOL> fields = [ <EOL> ( '<STR_LIT:id>' , models . AutoField ( ...
<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> """<STR_LIT>""" <EOL> from twisted . internet . protocol import ClientFactory <EOL> from twisted . conch . ssh . transport import SSHClientTransport , DISCONNECT_PROTOCOL_ERROR <EOL> from twisted . internet . error import ConnectionClosed <EOL> class DisconnectError ( ConnectionClosed ) : <EOL> def __init__ ( self ...
<s> from __future__ import with_statement <EOL> import hashlib <EOL> import hmac <EOL> import logging <EOL> import re <EOL> import time <EOL> from crtauth import ssh <EOL> from crtauth import exceptions <EOL> from crtauth import protocol <EOL> from crtauth import msgpack_protocol <EOL> from crtauth . client import crea...
<s> import random <EOL> import luigi <EOL> import luigi . format <EOL> import luigi . contrib . hdfs <EOL> from luigi . contrib . spark import SparkSubmitTask <EOL> class UserItemMatrix ( luigi . Task ) : <EOL> data_size = luigi . IntParameter ( ) <EOL> def run ( self ) : <EOL> """<STR_LIT>""" <EOL> w = self . output (...
<s> """<STR_LIT>""" <EOL> import luigi <EOL> import random <EOL> import warnings <EOL> from luigi . target import FileSystemTarget <EOL> from luigi . contrib . hdfs . config import tmppath <EOL> from luigi . contrib . hdfs import format as hdfs_format <EOL> from luigi . contrib . hdfs import clients as hdfs_clients <EO...
<s> """<STR_LIT>""" <EOL> import os <EOL> import random <EOL> import shutil <EOL> import tempfile <EOL> import io <EOL> import warnings <EOL> from luigi . format import FileWrapper , get_default_format <EOL> from luigi . target import FileAlreadyExists , MissingParentDirectory , NotADirectory , FileSystem , FileSystemT...
<s> import argparse <EOL> import json <EOL> from collections import defaultdict <EOL> from luigi import six <EOL> from luigi . six . moves . urllib . request import urlopen <EOL> class LuigiGrep ( object ) : <EOL> def __init__ ( self , host , port ) : <EOL> self . _host = host <EOL> self . _port = port <EOL> @ property...
<s> from time import sleep <EOL> from helpers import unittest <EOL> try : <EOL> import redis <EOL> except ImportError : <EOL> raise unittest . SkipTest ( '<STR_LIT>' ) <EOL> from luigi . contrib . redis_store import RedisTarget <EOL> HOST = '<STR_LIT:localhost>' <EOL> PORT = <NUM_LIT> <EOL> DB = <NUM_LIT:15> <EOL> PASS...
<s> import getpass <EOL> import os <EOL> import luigi . contrib . hadoop <EOL> import luigi . contrib . hdfs <EOL> from nose . plugins . attrib import attr <EOL> import unittest <EOL> try : <EOL> from snakebite . minicluster import MiniCluster <EOL> except ImportError : <EOL> raise unittest . SkipTest ( '<STR_LIT>' ) <...
<s> from helpers import LuigiTestCase <EOL> import luigi <EOL> import luigi . scheduler <EOL> import luigi . task_history <EOL> import luigi . worker <EOL> luigi . notifications . DEBUG = True <EOL> class SimpleTaskHistory ( luigi . task_history . TaskHistory ) : <EOL> def __init__ ( self ) : <EOL> self . actions = [ ]...
<s> import warnings <EOL> warnings . warn ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> DeprecationWarning , <EOL> stacklevel = <NUM_LIT:2> <EOL> ) <EOL> import pyschema_extensions . avro_to_pyschema <EOL> from pyschema_extensions . avro_to_pyschema import * </s>
<s> import unittest <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import os <EOL> import sys <EOL> names = [ name [ : - <NUM_LIT:3> ] <EOL> for name in os . listdir ( os . path . dirname ( __file__ ) ) <EOL> if name . endswith ( '<STR_LIT>' ) ] <EOL> for name in names : <EOL> __import__ ( '<STR_LIT>' + name ) <EOL>...
<s> import datetime <EOL> def assertListings ( expected , actual , len_method , content_method ) : <EOL> expected = sorted ( expected , key = lambda node : node [ "<STR_LIT:path>" ] ) <EOL> actual = sorted ( actual , key = lambda node : node [ "<STR_LIT:path>" ] ) <EOL> test_attributes = [ '<STR_LIT:path>' , '<STR_LIT>...
<s> """<STR_LIT>""" <EOL> class NodePosition : <EOL> def __init__ ( self , file , line , column ) : <EOL> self . file = file <EOL> self . line = line <EOL> self . column = column <EOL> return <EOL> def GetFile ( self ) : <EOL> return self . file <EOL> def GetLine ( self ) : <EOL> return self . line <EOL> def GetColumn ...
<s> from __future__ import print_function <EOL> def HelloWorld ( ) : <EOL> print ( "<STR_LIT>" ) <EOL> def main ( ) : <EOL> HelloWorld ( ) <EOL> return <NUM_LIT:0> </s>
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> import redhawk . utils . util as U <EOL> import nose . tools <EOL> import tempfile <EOL> import os <EOL> def TestConcat ( ) : <EOL> """<STR_LIT>""" <EOL> assert ( U . Concat ( [ [ <NUM_LIT:1> ] , [ <NUM_LI...
<s> from twisted . internet . protocol import Factory <EOL> from twisted . internet import protocol <EOL> from twisted . protocols . policies import TimeoutMixin <EOL> from protocol import Protocol <EOL> import DataHandler <EOL> import Client <EOL> class Chat ( protocol . Protocol , Client . Client , TimeoutMixin ) : <...
<s> import os <EOL> import sys <EOL> import glob <EOL> import doctest <EOL> import unittest <EOL> optionflags = ( doctest . NORMALIZE_WHITESPACE | <EOL> doctest . ELLIPSIS ) <EOL> def list_doctests ( ) : <EOL> return [ filename <EOL> for filename <EOL> in glob . glob ( os . path . join ( os . path . dirname ( __file__ ...
<s> """<STR_LIT>""" <EOL> from . api import freeze_time <EOL> __title__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> __author__ = '<STR_LIT>' <EOL> __license__ = '<STR_LIT>' <EOL> __copyright__ = '<STR_LIT>' <EOL> __all__ = [ "<STR_LIT>" ] </s>
<s> from __future__ import unicode_literals <EOL> from . responses import LambdaResponse <EOL> url_bases = [ <EOL> "<STR_LIT>" , <EOL> ] <EOL> url_paths = { <EOL> '<STR_LIT>' : LambdaResponse . root , <EOL> '<STR_LIT>' : LambdaResponse . function , <EOL> } </s>
<s> from __future__ import unicode_literals <EOL> import json <EOL> import six <EOL> from moto . core . responses import BaseResponse <EOL> from moto . core . utils import camelcase_to_underscores <EOL> from . models import dynamodb_backend , dynamo_json_dump <EOL> GET_SESSION_TOKEN_RESULT = """<STR_LIT>""" <EOL> def s...
<s> from __future__ import unicode_literals <EOL> from moto . core . responses import BaseResponse <EOL> from moto . ec2 . utils import route_table_ids_from_querystring , filters_from_querystring , optional_from_querystring <EOL> class RouteTables ( BaseResponse ) : <EOL> def associate_route_table ( self ) : <EOL> rout...
<s> from __future__ import unicode_literals <EOL> import random <EOL> import string <EOL> import six <EOL> def random_job_id ( size = <NUM_LIT> ) : <EOL> chars = list ( range ( <NUM_LIT:10> ) ) + list ( string . ascii_uppercase ) <EOL> job_tag = '<STR_LIT>' . join ( six . text_type ( random . choice ( chars ) ) for x i...
<s> from __future__ import unicode_literals <EOL> from . responses import OpsWorksResponse <EOL> url_bases = [ <EOL> "<STR_LIT>" <EOL> ] <EOL> url_paths = { <EOL> '<STR_LIT>' : OpsWorksResponse . dispatch , <EOL> } </s>
<s> from __future__ import unicode_literals <EOL> import json <EOL> import re <EOL> import sys <EOL> import argparse <EOL> from six . moves . urllib . parse import urlencode <EOL> from threading import Lock <EOL> from flask import Flask <EOL> from flask . testing import FlaskClient <EOL> from werkzeug . routing import ...
<s> from . generic_type import GenericType <EOL> class ActivityType ( GenericType ) : <EOL> @ property <EOL> def _configuration_keys ( self ) : <EOL> return [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] <EOL> @ property <EOL> def kind ( self ) : <EOL> return "<STR_LIT>" </s>
<s> from __future__ import unicode_literals <EOL> template = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : { <EOL> "<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> "<S...
<s> from __future__ import unicode_literals <EOL> import boto <EOL> import sure <EOL> from moto import mock_ec2 <EOL> @ mock_ec2 <EOL> def test_describe_regions ( ) : <EOL> conn = boto . connect_ec2 ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> regions = conn . get_all_regions ( ) <EOL> regions . should . have . length_of ( <NUM...
<s> from __future__ import unicode_literals <EOL> import tests . backport_assert_raises <EOL> from nose . tools import assert_raises <EOL> import boto <EOL> from boto . exception import EC2ResponseError <EOL> import sure <EOL> from moto import mock_ec2 <EOL> SAMPLE_DOMAIN_NAME = u'<STR_LIT>' <EOL> SAMPLE_NAME_SERVERS =...
<s> from __future__ import unicode_literals <EOL> import boto <EOL> from boto . route53 . healthcheck import HealthCheck <EOL> from boto . route53 . record import ResourceRecordSets <EOL> import sure <EOL> from moto import mock_route53 <EOL> @ mock_route53 <EOL> def test_hosted_zone ( ) : <EOL> conn = boto . connect_ro...
<s> from freezegun import freeze_time <EOL> from moto . swf . models import Timeout <EOL> from . . utils import make_workflow_execution <EOL> def test_timeout_creation ( ) : <EOL> wfe = make_workflow_execution ( ) <EOL> timeout = Timeout ( wfe , <NUM_LIT> , "<STR_LIT>" ) <EOL> with freeze_time ( "<STR_LIT>" ) : <EOL> t...
<s> from __future__ import unicode_literals <EOL> from lib2to3 . fixer_base import BaseFix <EOL> from lib2to3 . pgen2 import token <EOL> from lib2to3 . pygram import python_symbols as symbols <EOL> class FixWhitespaceBeforeParameters ( BaseFix ) : <EOL> '''<STR_LIT>''' <EOL> def match ( self , node ) : <EOL> if ( node ...
<s> try : <EOL> import shutil <EOL> if xxxx + <NUM_LIT:1> : <EOL> if yyyyy * <NUM_LIT:2> : <EOL> if zzzz / <NUM_LIT:3> : <EOL> aaaaa + <NUM_LIT:4> <EOL> else : <EOL> pass <EOL> except : <EOL> end_of_program </s>
<s> try : <EOL> if one and two : <EOL> print "<STR_LIT>" <EOL> except : <EOL> print "<STR_LIT>" </s>
<s> from collections import namedtuple <EOL> import inspect <EOL> import os <EOL> from ghost import Ghost <EOL> class Client ( object ) : <EOL> def __init__ ( self , url = None ) : <EOL> if url : <EOL> self . url = url <EOL> assert self . url , "<STR_LIT>" <EOL> self . _attributes = self . _collect_attributes ( ) <EOL>...
<s> import threading <EOL> from tempfile import gettempdir <EOL> from . dropbox import * <EOL> DROPBOX_SYNC_SCHEMA = "<STR_LIT>" <EOL> class DropboxPreAuthenticationThread ( threading . Thread ) : <EOL> def __init__ ( self , authenticator , refresh_token ) : <EOL> self . authenticator = authenticator <EOL> threading . ...
<s> import sublime <EOL> import sublime_plugin <EOL> import re <EOL> from ... core import ( <EOL> ActionHistory , <EOL> JavaStructure , <EOL> JavaClassPath , <EOL> JavaUtils , <EOL> StateProperty <EOL> ) <EOL> from ... threads import BackgroundThread <EOL> from ... utils import StatusManager <EOL> class JavatarOrganize...
<s> import sublime <EOL> import os . path <EOL> from . action_history import ActionHistory <EOL> from . logger import Logger <EOL> from . settings import Settings <EOL> from . . utils import Constant , Downloader <EOL> class _Usages : <EOL> @ classmethod <EOL> def instance ( cls ) : <EOL> if not hasattr ( cls , "<STR_L...
<s> from QuickMenu . QuickMenu import * <EOL> import sublime_plugin <EOL> class QuickMenuCommand ( sublime_plugin . WindowCommand ) : <EOL> qm = None <EOL> menu = { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : [ [ "<STR_LIT>" , "<STR_LIT>" ] , [ "<STR_LIT>" , "<STR_LIT>" ] , [ "<STR_LIT>" , "<STR_LIT>" ] ] , <EOL> "<STR_L...
<s> from subprocess import Popen <EOL> from test_common import * <EOL> import urllib . request , urllib . error , urllib . parse , socket , ssl , time , os , signal , json , http . server , threading <EOL> received_metrics = None <EOL> class FakeMetricsBridgeHandler ( http . server . BaseHTTPRequestHandler ) : <EOL> de...
<s> from subprocess import Popen <EOL> from test_common import * <EOL> import urllib . request , urllib . error , urllib . parse , socket , ssl , time , os , signal , json , sys <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> ghostunnel = None <EOL> try : <EOL> root = RootCert ( '<STR_LIT:root>' ) <EOL> root . create...
<s> from pytvmaze . tvmaze import * </s>
<s> import sublime <EOL> def get_plugin_settings ( ) : <EOL> setting_name = '<STR_LIT>' <EOL> plugin_settings = sublime . load_settings ( setting_name ) <EOL> return plugin_settings <EOL> def get_settings_param ( view , param_name , default = None ) : <EOL> plugin_settings = get_plugin_settings ( ) <EOL> project_settin...
<s> import settings <EOL> import sys <EOL> import socket <EOL> import logging <EOL> import statsd <EOL> from twisted . internet import defer <EOL> def load_object ( path ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> dot = path . rindex ( '<STR_LIT:.>' ) <EOL> except ValueError : <EOL> raise ValueError ( "<STR_LIT>" % pat...
<s> import sys <EOL> import os . path <EOL> reload ( sys ) <EOL> sys . setdefaultencoding ( '<STR_LIT:utf-8>' ) <EOL> gettext = lambda s : s <EOL> PROJECT_ROOT = os . path . join ( <EOL> os . path . realpath ( os . path . dirname ( __file__ ) ) , os . pardir ) <EOL> DEBUG = True <EOL> ADMINS = ( <EOL> ) <EOL> MANAGERS ...
<s> from django import forms <EOL> from django . contrib . auth . forms import ( UserCreationForm , UserChangeForm , <EOL> AdminPasswordChangeForm , PasswordChangeForm ) <EOL> from django . contrib . auth . models import Group , Permission <EOL> from django . core . exceptions import PermissionDenied <EOL> from django ...
<s> import sys <EOL> from functools import update_wrapper <EOL> from django . conf import settings <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django . db . models . base import ModelBase <EOL> from django . views . decorators . cache import never_cache <EOL> reload ( sys ) <EOL> sys . ...
<s> def u ( string ) : <EOL> try : <EOL> return string . encode ( '<STR_LIT:utf-8>' ) <EOL> except Exception , e : <EOL> return string </s>
<s> __author__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' </s>
<s> import os <EOL> import subprocess <EOL> import sys <EOL> import urllib2 <EOL> def main ( ) : <EOL> if len ( sys . argv ) < <NUM_LIT:2> : <EOL> sys . stderr . write ( '<STR_LIT>' ) <EOL> return <NUM_LIT:1> <EOL> version = sys . argv [ <NUM_LIT:1> ] <EOL> base_dir = os . path . dirname ( os . path . dirname ( os . pa...
<s> import logging <EOL> from rest_framework . generics import get_object_or_404 <EOL> from . import models , permissions <EOL> logger = logging . getLogger ( __name__ ) <EOL> class CloudProviderRelatedMixin ( object ) : <EOL> permission_classes = ( permissions . CloudProviderParentObjectPermissions , ) <EOL> def get_c...
<s> import logging <EOL> from rest_framework import serializers <EOL> logger = logging . getLogger ( __name__ ) <EOL> class SearchSerializer ( serializers . Serializer ) : <EOL> object_type = serializers . SlugRelatedField ( slug_field = '<STR_LIT>' , read_only = True ) <EOL> title = serializers . CharField ( ) <EOL> u...
<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...