code
stringlengths
9
256k
<s> import os <EOL> import shlex <EOL> import shutil <EOL> from subprocess import Popen , PIPE , STDOUT <EOL> def run_command ( cmd , data , location , chw ) : <EOL> """<STR_LIT>""" <EOL> output = None <EOL> cwd = os . getcwd ( ) <EOL> if location is not None and chw is True : <EOL> cwd = location <EOL> elif location i...
<s> import sys <EOL> from os . path import dirname , abspath <EOL> import django <EOL> from django . conf import settings <EOL> if not settings . configured : <EOL> test_settings = { <EOL> '<STR_LIT>' : { '<STR_LIT:default>' : { '<STR_LIT>' : '<STR_LIT>' } } , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ <EO...
<s> from flask_assets import Bundle <EOL> from flask_assets import Environment <EOL> assets = Environment ( ) <EOL> js = Bundle ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> filters = '<STR_LIT>' , output = '<STR_LIT>' ) <EOL> assets . register ( '<STR_LIT>' , js ...
<s> from flask import request <EOL> def get_page ( ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> page = request . args . get ( '<STR_LIT>' , <NUM_LIT:1> ) <EOL> return int ( page ) <EOL> except ValueError : <EOL> return <NUM_LIT:1> </s>
<s> import requests <EOL> import urllib <EOL> import simplejson as json <EOL> import random <EOL> import string <EOL> AUTHORISE_URL = '<STR_LIT>' <EOL> ACCESS_TOKEN_URL = '<STR_LIT>' <EOL> REDIRECT_URL = '<STR_LIT>' <EOL> PROFILE_API = '<STR_LIT>' <EOL> class GooglePlus : <EOL> access_token = None <EOL> session_id = No...
<s> import re <EOL> import sys <EOL> def getDigraphString ( filename ) : <EOL> '''<STR_LIT>''' <EOL> with open ( filename , '<STR_LIT:r>' ) as template : <EOL> content = template . read ( ) <EOL> extends = re . search ( '<STR_LIT>' , content ) <EOL> if extends is None : <EOL> return False <EOL> extended = filename [ fi...
<s> from django . contrib . auth . models import Permission <EOL> from django . db . models . aggregates import Max <EOL> from django . db . models . signals import post_save , pre_delete <EOL> from django . dispatch import receiver <EOL> from cardbox . card_model import Card <EOL> from guardian . shortcuts import assi...
<s> from django . conf . urls import patterns , url <EOL> from django . contrib . auth . decorators import login_required <EOL> import views <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> url ( r'<STR_LIT>' , <EOL> login_required ( views . upload_file ) , name = '<STR_LIT>' ) <EOL> ) </s>
<s> import unittest <EOL> from arbalest . core import SchemaException <EOL> from arbalest . redshift . schema import Property <EOL> class PropertyShould ( unittest . TestCase ) : <EOL> def test_throw_schema_exception_when_adding_invalid_type ( self ) : <EOL> self . assertRaises ( SchemaException , Property , '<STR_LIT>...
<s> from flask import Blueprint <EOL> from flask import request <EOL> import api <EOL> from api . annotations import * <EOL> from api . common import flat_multi <EOL> from api . exceptions import * <EOL> blueprint = Blueprint ( "<STR_LIT>" , __name__ ) <EOL> @ blueprint . route ( "<STR_LIT>" , methods = [ "<STR_LIT:GET...
<s> def grade ( tid , answer ) : <EOL> if answer . find ( "<STR_LIT>" ) != - <NUM_LIT:1> : <EOL> return { "<STR_LIT>" : True , "<STR_LIT:message>" : "<STR_LIT>" } <EOL> return { "<STR_LIT>" : False , "<STR_LIT:message>" : "<STR_LIT>" } </s>
<s> def grade ( tid , answer ) : <EOL> if answer . find ( "<STR_LIT>" ) != - <NUM_LIT:1> : <EOL> return { "<STR_LIT>" : True , "<STR_LIT:message>" : "<STR_LIT>" } <EOL> return { "<STR_LIT>" : False , "<STR_LIT:message>" : "<STR_LIT>" } </s>
<s> import math <EOL> import os <EOL> import random <EOL> def generate ( full_path ) : <EOL> try : <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> output = "<STR_LIT>" <EOL> f = open ( full_path + os . sep + "<STR_LIT:test>" + str ( i ) + "<STR_LIT>" , "<STR_LIT:w>" ) <EOL> f . write ( "<STR_LIT>" ) <EOL> f . close ( ) <...
<s> from ee . cli . plugins . stack import EEStackController <EOL> from ee . core . fileutils import EEFileUtils <EOL> from ee . core . mysql import * <EOL> from ee . core . shellexec import * <EOL> from ee . core . sslutils import SSL <EOL> from ee . core . variables import EEVariables <EOL> from ee . cli . plugins . ...
<s> from ee . utils import test <EOL> from ee . cli . main import get_test_app <EOL> class CliTestCaseStack ( test . EETestCase ) : <EOL> def test_ee_cli ( self ) : <EOL> self . app . setup ( ) <EOL> self . app . run ( ) <EOL> self . app . close ( ) <EOL> def test_ee_cli_stack_purge_web ( self ) : <EOL> self . app = ge...
<s> import unittest <EOL> import easypost <EOL> from constants import API_KEY as api_key <EOL> easypost . api_key = api_key <EOL> class ParcelTests ( unittest . TestCase ) : <EOL> def test_parcel_creation ( self ) : <EOL> parcel = easypost . Parcel . create ( <EOL> predefined_package = "<STR_LIT>" , <EOL> length = <NUM...
<s> from os . path import abspath , dirname , join as path_join <EOL> from setuptools import setup <EOL> CURDIR = abspath ( dirname ( __file__ ) ) <EOL> execfile ( '<STR_LIT>' ) <EOL> KEYWORDS = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> SHORT_DESC = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> with open ( path_join ( CURDIR ,...
<s> import idaapi <EOL> import idautils <EOL> from idaapi import PluginForm <EOL> from PySide import QtGui , QtCore <EOL> class ImpExpForm_t ( PluginForm ) : <EOL> def imports_names_cb ( self , ea , name , ord ) : <EOL> self . items . append ( ( ea , '<STR_LIT>' if not name else name , ord ) ) <EOL> return True <EOL> d...
<s> from idaapi import PluginForm <EOL> from PyQt4 import QtCore , QtGui <EOL> import sip <EOL> class MyPluginFormClass ( PluginForm ) : <EOL> def OnCreate ( self , form ) : <EOL> """<STR_LIT>""" <EOL> self . parent = self . FormToPyQtWidget ( form ) <EOL> self . PopulateForm ( ) <EOL> def PopulateForm ( self ) : <EOL>...
<s> import os <EOL> import sys <EOL> import idaapi <EOL> import _idaapi <EOL> from sys import getrefcount <EOL> import gc <EOL> try : <EOL> import pywraps <EOL> pywraps_there = True <EOL> _idaapi . pyw_register_idc_func = pywraps . pyw_register_idc_func <EOL> _idaapi . pyw_unregister_idc_func = pywraps . pyw_unregister...
<s> </s>
<s> import unicodedata as ud <EOL> from collections import defaultdict <EOL> class AlphabetDetector : <EOL> def __init__ ( self , no_memory = False ) : <EOL> self . alphabet_letters = defaultdict ( dict ) <EOL> self . no_memory = no_memory <EOL> def is_in_alphabet ( self , uchr , alphabet ) : <EOL> if self . no_memory ...
<s> from django . conf . urls import patterns , include , url <EOL> from django . contrib import admin <EOL> admin . autodiscover ( ) <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> url ( r'<STR_LIT>' , include ( admin . site . urls ) ) , <EOL> url ( r'<STR_LIT>' , include ( '<STR_LIT>' ) ) , <EOL> ) </s>
<s> """<STR_LIT>""" <EOL> import random <EOL> import sys <EOL> import unittest <EOL> import mock <EOL> import lifter . models <EOL> class TestObject ( object ) : <EOL> def __init__ ( self , name , ** kwargs ) : <EOL> self . name = name <EOL> for key , value in kwargs . items ( ) : <EOL> setattr ( self , key , value ) <...
<s> '''<STR_LIT>''' <EOL> import sys <EOL> import pefile <EOL> import struct <EOL> from datetime import datetime <EOL> from pyasn1 . codec . der . decoder import decode <EOL> from pyasn1_modules import rfc2315 <EOL> def hash_alg_oid_mapping ( ) : <EOL> db = { } <EOL> db [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> db [ '<STR_LI...
<s> import pandas as pd <EOL> from prophet . orders import Orders <EOL> from prophet . data import DataGenerator <EOL> class BollingerEventStudy ( DataGenerator ) : <EOL> name = "<STR_LIT>" <EOL> def run ( self , data , symbols , start , end , lookback , ** kwargs ) : <EOL> bollinger_data = data [ '<STR_LIT>' ] <EOL> s...
<s> import logging <EOL> import blogofile <EOL> import blogofile . plugin <EOL> from blogofile . cache import bf , HierarchicalCache as HC <EOL> try : <EOL> import urllib . parse as urlparse <EOL> except ImportError : <EOL> import urlparse <EOL> from . import commands <EOL> __dist__ = dict ( <EOL> name = "<STR_LIT>" , ...
<s> import sys <EOL> import time <EOL> import logging <EOL> import tempfile <EOL> import subprocess <EOL> import _thread <EOL> import hashlib <EOL> import base64 <EOL> import traceback <EOL> import tornado . web <EOL> import tornado . ioloop <EOL> import tornado . gen <EOL> import requests <EOL> from . ssh import SSHRe...
<s> import argparse <EOL> import time <EOL> import json <EOL> import traceback <EOL> import logging <EOL> import os <EOL> _conf = None <EOL> _log = None <EOL> def parse_arguments ( ) : <EOL> long_description = """<STR_LIT>""" <EOL> argparser = argparse . ArgumentParser ( description = long_description ) <EOL> argparser...
<s> from calvin . actor . actor import Actor , ActionResult , manage , condition , guard <EOL> from calvin . runtime . north . calvin_token import EOSToken , ExceptionToken <EOL> class List ( Actor ) : <EOL> """<STR_LIT>""" <EOL> def exception_handler ( self , action , args , context ) : <EOL> exception = args [ contex...
<s> import sys <EOL> from calvin . actor . actor import Actor , ActionResult , manage , condition , guard <EOL> class CountTimer ( Actor ) : <EOL> """<STR_LIT>""" <EOL> @ manage ( exclude = [ '<STR_LIT>' ] ) <EOL> def init ( self , sleep = <NUM_LIT:0.1> , steps = sys . maxint ) : <EOL> self . count = <NUM_LIT:0> <EOL> ...
<s> from calvin . utilities . calvinlogger import get_logger <EOL> _log = get_logger ( __name__ ) <EOL> class PrivateAttribute ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , node , actor ) : <EOL> self . _node = node <EOL> self . _actor = actor <EOL> def exists ( self , index ) : <EOL> """<STR_LIT>""" <...
<s> from calvin . actor . actor import Actor , ActionResult , condition <EOL> class Display ( Actor ) : <EOL> """<STR_LIT>""" <EOL> def init ( self ) : <EOL> self . setup ( ) <EOL> def setup ( self ) : <EOL> self . use ( "<STR_LIT>" , shorthand = "<STR_LIT>" ) <EOL> self . display = self [ "<STR_LIT>" ] <EOL> self . di...
<s> from calvin . utilities . calvin_callback import CalvinCB <EOL> from calvin . utilities import dynops <EOL> from calvin . utilities . calvinlogger import get_logger <EOL> _log = get_logger ( __name__ ) <EOL> def get_description ( out_iter , kwargs , final , signature ) : <EOL> _log . debug ( "<STR_LIT>" ) <EOL> if ...
<s> class GPIOPinBase ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , trigger , pin , direction , pull_up_down = None ) : <EOL> pass <EOL> def detect_edge ( self , edge ) : <EOL> """<STR_LIT>""" <EOL> def edge_detected ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError ( ) <EOL> def set_sta...
<s> import pytest <EOL> import sys <EOL> import os <EOL> import traceback <EOL> import hashlib <EOL> import twisted <EOL> import shutil <EOL> from calvin . utilities . calvin_callback import CalvinCB <EOL> from calvin . utilities import calvinlogger <EOL> from calvin . utilities . utils import get_home <EOL> from calvi...
<s> import pytest <EOL> from mock import Mock , call <EOL> from calvin . runtime . north . actormanager import ActorManager <EOL> from calvin . tests import DummyNode <EOL> from calvin . runtime . south . endpoint import LocalOutEndpoint , LocalInEndpoint <EOL> from calvin . actor . actorport import InPort , OutPort <E...
<s> """<STR_LIT>""" <EOL> from operator import itemgetter , attrgetter , methodcaller <EOL> class Options : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . options = [ ] <EOL> def insert ( self , option ) : <EOL> """<STR_LIT>""" <EOL> self . options . append ( option ) <EOL> def __repr__ ( self ) : <EO...
<s> import csv <EOL> import argparse <EOL> import sys <EOL> from agoTools . admin import Admin <EOL> from agoTools . admin import AGOLItems <EOL> def _raw_input ( prompt = None , stream = None , input = None ) : <EOL> if not stream : <EOL> stream = sys . stderr <EOL> if not input : <EOL> input = sys . stdin <EOL> promp...
<s> """<STR_LIT>""" <EOL> HOOKS = [ '<STR_LIT>' ] <EOL> def default_hooks ( ) : <EOL> hooks = { } <EOL> for event in HOOKS : <EOL> hooks [ event ] = [ ] <EOL> return hooks <EOL> def dispatch_hook ( key , hooks , hook_data ) : <EOL> """<STR_LIT>""" <EOL> hooks = hooks or dict ( ) <EOL> if key in hooks : <EOL> hooks = ho...
<s> import os <EOL> import socket <EOL> from Utilities import makePath <EOL> valid_ops_types = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> serverName = socket . gethostname ( ) . lower ( ) <EOL> serverFullyQualifiedDomainName = socket . getfqdn ( ) . lower ( ) <EOL> serve...
<s> import numpy as np <EOL> class MaskRaster ( ) : <EOL> def __init__ ( self ) : <EOL> self . name = "<STR_LIT>" <EOL> self . description = "<STR_LIT>" <EOL> def getParameterInfo ( self ) : <EOL> return [ <EOL> { <EOL> '<STR_LIT:name>' : '<STR_LIT:r>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:value>' : None ...
<s> import arcpy <EOL> import sys <EOL> import traceback <EOL> import TestUtilities <EOL> import os <EOL> import datetime <EOL> try : <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> arcpy . Impo...
<s> import arcpy <EOL> import os <EOL> import sys <EOL> import traceback <EOL> import TestUtilities <EOL> def UniquePointGUIDs ( pointFC , guidFieldName ) : <EOL> countPointGUIDs = <NUM_LIT:0> <EOL> freqTable = os . path . join ( TestUtilities . scratchGDB , "<STR_LIT>" ) <EOL> arcpy . Frequency_analysis ( pointFC , fr...
<s> import arcpy <EOL> import sys , os <EOL> from xml . dom import minidom <EOL> from string import ascii_letters , digits <EOL> scriptPath = os . path . dirname ( __file__ ) <EOL> sys . path . append ( os . path . join ( scriptPath , '<STR_LIT>' ) ) <EOL> import Base <EOL> class Solutions ( Base . Base ) : <EOL> proce...
<s> import os <EOL> import arcpy <EOL> import traceback <EOL> import sys <EOL> inputTDSFeatureDataset = arcpy . GetParameterAsText ( <NUM_LIT:0> ) <EOL> inputMAOTWorkspace = arcpy . GetParameterAsText ( <NUM_LIT:1> ) <EOL> FEATURECLASSES_TO_MERGE = [ "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "...
<s> import collections <EOL> class OrderedSet ( collections . MutableSet ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , <EOL> iterable = [ ] ) : <EOL> self . elements = collections . OrderedDict ( ) <EOL> for element in iterable : <EOL> self . elements [ element ] = True <EOL> def __repr__ ( self ) : <EOL> retur...
<s> '''<STR_LIT>''' <EOL> import unittest <EOL> import Configuration <EOL> from . import HelicopterLandingZoneToolsTestSuite <EOL> from . import ERGToolsTestSuite <EOL> def getCapabilityTestSuites ( ) : <EOL> '''<STR_LIT>''' <EOL> if Configuration . DEBUG == True : <EOL> print ( "<STR_LIT>" ) <EOL> Configuration . Logg...
<s> import unittest <EOL> import arcpy <EOL> import os <EOL> import UnitTestUtilities <EOL> import Configuration <EOL> import DataDownload <EOL> class SubDepthRestrictionSuitabilityTestCase ( unittest . TestCase ) : <EOL> '''<STR_LIT>''' <EOL> def setUp ( self ) : <EOL> if Configuration . DEBUG == True : print ( "<STR_...
<s> import os , sys , traceback , math , decimal <EOL> import arcpy <EOL> from arcpy import env <EOL> from arcpy import sa <EOL> def zfactor ( dataset ) : <EOL> desc = arcpy . Describe ( dataset ) <EOL> if desc . spatialReference . type != "<STR_LIT>" : <EOL> return <NUM_LIT:1.0> <EOL> extent = desc . Extent <EOL> exte...
<s> from unittest import TestCase , mock <EOL> from thorium import Endpoint , Request , auth , errors <EOL> class TestEndpoint ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . request = mock . MagicMock ( spec = Request ) <EOL> self . response = mock . MagicMock ( spec = Request ) <EOL> self . auth_cls = mock . M...
<s> from teleport import Teleport , TeleportationProvider <EOL> from teleporter import Teleporter <EOL> from luminati import Luminati <EOL> from vpn import VPN , OpenVPN <EOL> from hidemyass import HideMyAss </s>
<s> """<STR_LIT>""" <EOL> from model_utils import Choices <EOL> STATUS = Choices ( '<STR_LIT>' , '<STR_LIT>' ) </s>
<s> from __future__ import unicode_literals <EOL> from django . db import migrations , models <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> """<STR_LIT>""" <EOL> import re <EOL> from pytz import utc <EOL> from datetime import datetime <EOL> from django . db import models <EOL> from django . conf import settings <EOL> from django . core . exceptions import ValidationError <EOL> from django . dispatch import receiver <EOL> from django . db . models . sig...
<s> """<STR_LIT>""" <EOL> from django . core . exceptions import PermissionDenied <EOL> from django . views . decorators . gzip import gzip_page <EOL> from rest_framework import status <EOL> from rest_framework . response import Response <EOL> from rest_framework . views import APIView <EOL> from geokey . core . decora...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import django . contrib . gis . db . models . fields <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ] <EOL> operations = [ <EOL> migrations . CreateModel ( <EOL> name = '<STR_LIT>' , <EOL...
<s> """<STR_LIT>""" <EOL> from django import forms <EOL> from django . utils . html import strip_tags <EOL> from django . core . exceptions import ValidationError <EOL> from allauth . account . forms import ( <EOL> ChangePasswordForm , <EOL> ResetPasswordKeyForm , <EOL> SignupForm <EOL> ) <EOL> from oauth2_provider . m...
<s> """<STR_LIT>""" <EOL> import os <EOL> from django . core . wsgi import get_wsgi_application <EOL> try : <EOL> import local_settings <EOL> settings_module = '<STR_LIT>' <EOL> except ImportError : <EOL> settings_module = '<STR_LIT>' <EOL> os . environ . setdefault ( '<STR_LIT>' , settings_module ) <EOL> application =...
<s> """<STR_LIT>""" <EOL> from struct import pack <EOL> from struct import unpack <EOL> from exabgp . protocol . resource import Resource <EOL> class ASN ( Resource ) : <EOL> MAX = pow ( <NUM_LIT:2> , <NUM_LIT:16> ) - <NUM_LIT:1> <EOL> def asn4 ( self ) : <EOL> return self > self . MAX <EOL> def pack ( self , negotiate...
<s> """<STR_LIT>""" <EOL> import collections <EOL> from struct import unpack <EOL> from exabgp . configuration . environment import environment <EOL> from exabgp . bgp . message . update . attribute . attribute import Attribute <EOL> from exabgp . bgp . message . update . attribute . generic import GenericAttribute <EO...
<s> """<STR_LIT>""" <EOL> from exabgp . protocol . ip import IP <EOL> from exabgp . bgp . message . update . nlri . qualifier import RouteDistinguisher <EOL> from exabgp . bgp . message . update . nlri . qualifier import Labels <EOL> from exabgp . bgp . message . update . nlri . qualifier import ESI <EOL> from exabgp ....
<s> """<STR_LIT>""" <EOL> from exabgp . configuration . core . error import Error <EOL> from exabgp . configuration . core . scope import Scope <EOL> from exabgp . configuration . core . section import Section <EOL> from exabgp . configuration . core . tokeniser import Tokeniser </s>
<s> """<STR_LIT>""" <EOL> from struct import pack <EOL> from exabgp . bgp . message . update . nlri . qualifier import Labels <EOL> from exabgp . bgp . message . update . nlri . qualifier import RouteDistinguisher <EOL> def label ( tokeniser ) : <EOL> labels = [ ] <EOL> value = tokeniser ( ) <EOL> if value == '<STR_LIT...
<s> """<STR_LIT>""" <EOL> import socket <EOL> from struct import calcsize <EOL> from collections import namedtuple <EOL> from exabgp . netlink . message import NetLink <EOL> from exabgp . netlink . message import Message <EOL> class Network ( Message ) : <EOL> class Header ( object ) : <EOL> PACK = '<STR_LIT>' <EOL> LE...
<s> from exabgp . util . errstr import errstr <EOL> from . connection import Connection <EOL> from . tcp import nagle <EOL> from . tcp import async <EOL> from . error import NetworkError <EOL> from . error import NotConnected <EOL> from exabgp . bgp . message import Notify <EOL> class Incoming ( Connection ) : <EOL> di...
<s> import os <EOL> import sys <EOL> import time <EOL> import syslog <EOL> def _prefixed ( level , message ) : <EOL> now = time . strftime ( '<STR_LIT>' , time . localtime ( ) ) <EOL> return "<STR_LIT>" % ( now , level , os . getpid ( ) , message ) <EOL> syslog . openlog ( "<STR_LIT>" ) <EOL> counter = <NUM_LIT:0> <EOL...
<s> from __future__ import print_function <EOL> import abc <EOL> class ISpeller ( object ) : <EOL> __metaclass__ = abc . ABCMeta <EOL> @ abc . abstractmethod <EOL> def process_word ( self , word ) : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> def get_return_obj ( self , word ) : <EOL> return { '<STR_LIT>' : word , '<ST...
<s> from . encode2unicode import * <EOL> from . unicode2encode import * </s>
<s> """<STR_LIT>""" <EOL> from behave import * <EOL> import shlex <EOL> import subprocess <EOL> import select <EOL> import requests <EOL> import json <EOL> import time <EOL> import re <EOL> import logging <EOL> import os <EOL> from mittn . headlessscanner . proxy_comms import * <EOL> import mittn . headlessscanner . db...
<s> import xml . etree . ElementTree as etree <EOL> def subelement ( element , xpath , tag , text , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> subelm = element . find ( xpath ) <EOL> if subelm is None : <EOL> subelm = etree . SubElement ( element , tag ) <EOL> else : <EOL> subelm . tag = tag <EOL> subelm . text = text <...
<s> __author__ = '<STR_LIT>' <EOL> from . mac_soup import MacSoup </s>
<s> """<STR_LIT>""" <EOL> import sys <EOL> import json <EOL> import requests <EOL> from copy import deepcopy <EOL> from requests . exceptions import ConnectionError , HTTPError , Timeout , TooManyRedirects <EOL> image_b64 = "<STR_LIT>" <EOL> class NoChangeError ( Exception ) : <EOL> pass <EOL> class BigipConfig ( objec...
<s> import unittest <EOL> import os <EOL> from yaksh . cpp_code_evaluator import CppCodeEvaluator <EOL> from yaksh . settings import SERVER_TIMEOUT <EOL> class CEvaluationTestCases ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . language = "<STR_LIT:C>" <EOL> self . ref_code_path = "<STR_LIT>" <EOL> s...
<s> """<STR_LIT>""" <EOL> import sys <EOL> import socket <EOL> from tornado . ioloop import IOLoop <EOL> from tornado import iostream <EOL> import hiredis <EOL> from . exceptions import PoolError <EOL> from . utils import redis_request <EOL> if sys . version_info [ <NUM_LIT:0> ] < <NUM_LIT:3> : <EOL> DELIMITER = '<STR_...
<s> """<STR_LIT>""" <EOL> import re <EOL> from functools import wraps <EOL> from datetime import datetime <EOL> from django . utils . dateformat import format <EOL> from django . utils . timezone import is_aware <EOL> from django . utils . timezone import localtime <EOL> from django . core . urlresolvers import reverse...
<s> """<STR_LIT>""" <EOL> import inspect <EOL> from functools import wraps <EOL> from django . db . models import F <EOL> from django . dispatch import Signal <EOL> from django . db . models . signals import post_save <EOL> from django . db . models . signals import pre_delete <EOL> from django . db . models . signals ...
<s> """<STR_LIT>""" <EOL> from django . test import TestCase <EOL> from mots_vides import stop_words <EOL> from zinnia import comparison <EOL> from zinnia . models . entry import Entry <EOL> from zinnia . comparison import pearson_score <EOL> from zinnia . comparison import ModelVectorBuilder <EOL> from zinnia . compar...
<s> """<STR_LIT>""" <EOL> from django . conf . urls import url <EOL> from zinnia . urls import _ <EOL> from zinnia . views . archives import EntryDay <EOL> from zinnia . views . archives import EntryWeek <EOL> from zinnia . views . archives import EntryYear <EOL> from zinnia . views . archives import EntryMonth <EOL> f...
<s> """<STR_LIT>""" <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> class PrefetchRelatedMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> relation_names = None <EOL> def get_queryset ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . relation_names is None : <EOL> raise ImproperlyConfigured ( <EOL> ...
<s> """<STR_LIT>""" <EOL> from bs4 import BeautifulSoup <EOL> from django . utils . encoding import smart_str <EOL> class LiveReloadScript ( object ) : <EOL> """<STR_LIT>""" <EOL> def process_response ( self , request , response ) : <EOL> if response . status_code != <NUM_LIT:200> : <EOL> return response <EOL> content_...
<s> import sublime <EOL> import sublime_plugin <EOL> from . tinycsscheme . dumper import CSSchemeDumper <EOL> from . scope_data import COMPILED_HEADS <EOL> from . convert import status <EOL> class CSSchemeCompletionListener ( sublime_plugin . EventListener ) : <EOL> def __init__ ( self ) : <EOL> properties = set ( ) <E...
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> from pytest import raises <EOL> from . . import make_parser <EOL> from . . page3 import CSSPage3Parser <EOL> def test_make_parser ( ) : <EOL> class MyParser ( object ) : <EOL> def __init__ ( self , some_config ) : <EOL> self . some_config = some_co...
<s> import os <EOL> import sys <EOL> import json <EOL> import copy <EOL> import psutil <EOL> import threading <EOL> import netifaces <EOL> import socket <EOL> import time <EOL> import signal <EOL> import Tkinter as tk <EOL> from macdivert import MacDivert <EOL> from tkMessageBox import showerror , showwarning <EOL> fro...
<s> import math <EOL> import logging <EOL> class NavigationUnit : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , perception_unit , drive_controller , vehicle_constants ) : <EOL> self . _perception_unit = perception_unit <EOL> self . _drive_controller = drive_controller <EOL> self . _vehicle_constants = vehicle_const...
<s> from Adafruit_I2C import Adafruit_I2C <EOL> class TemperatureSensor : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , address = <NUM_LIT> , interface = "<STR_LIT>" , hw_interface = "<STR_LIT>" , debug = False ) : <EOL> if hw_interface is None : <EOL> self . i2c = Adafruit_I2C ( address , debug = debug ) <EOL> els...
<s> from . exceptions import MissingArgError <EOL> def _check_input ( arg ) : <EOL> if arg is None : <EOL> return False <EOL> if type ( arg ) in ( list , dict , tuple ) and len ( arg ) == <NUM_LIT:0> : <EOL> return False <EOL> return True <EOL> def _check_type ( key , type_ , arg ) : <EOL> if isinstance ( type_ , bases...
<s> from __future__ import unicode_literals , print_function <EOL> from types import FunctionType <EOL> from socket import timeout as timeout_error <EOL> from gevent import joinall <EOL> from termcolor import colored <EOL> from pyinfra import logger <EOL> from pyinfra . api . exceptions import PyinfraError <EOL> from ....
<s> '''<STR_LIT>''' <EOL> from __future__ import unicode_literals <EOL> from pyinfra . api import operation <EOL> from . util . packaging import ensure_packages <EOL> @ operation <EOL> def packages ( <EOL> state , host , <EOL> packages = None , present = True , latest = False , <EOL> requirements = None , virtualenv = ...
<s> import Base <EOL> from Base import ServerError <EOL> def revlookup ( name ) : <EOL> "<STR_LIT>" <EOL> names = revlookupall ( name ) <EOL> if not names : return None <EOL> return names [ <NUM_LIT:0> ] <EOL> def revlookupall ( name ) : <EOL> "<STR_LIT>" <EOL> a = name . split ( '<STR_LIT:.>' ) <EOL> a . reverse ( ) <...
<s> from . diff_match_patch import diff_match_patch as dmp <EOL> def patch_apply ( self , patches , text ) : <EOL> """<STR_LIT>""" <EOL> if not patches : <EOL> return ( text , [ ] , [ ] ) <EOL> patches = self . patch_deepCopy ( patches ) <EOL> nullPadding = self . patch_addPadding ( patches ) <EOL> np_len = len ( nullP...
<s> import os <EOL> import errno <EOL> import json <EOL> import re <EOL> import hashlib <EOL> import webbrowser <EOL> from functools import wraps <EOL> try : <EOL> from urllib . parse import urlparse <EOL> assert urlparse <EOL> except ImportError : <EOL> from urlparse import urlparse <EOL> try : <EOL> from . . import e...
<s> import os , sys , subprocess <EOL> from optparse import * <EOL> __AUTHOR__ = "<STR_LIT>" <EOL> __VERSION__ = '<STR_LIT>' <EOL> class EApp ( Exception ) : <EOL> '''<STR_LIT>''' <EOL> pass <EOL> class Application ( ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , argv = None ) : <EOL> format_output = subprocess ...
<s> '''<STR_LIT>''' <EOL> from xml . dom import minidom <EOL> from sqlalchemy import create_engine <EOL> from sqlalchemy . orm import sessionmaker <EOL> from sqlalchemy . pool import StaticPool <EOL> from DataAccess import DataString <EOL> __author__ = '<STR_LIT>' <EOL> import xml . etree . cElementTree as ET <EOL> cla...
<s> try : <EOL> from setuptools import setup , Extension <EOL> has_setuptools = True <EOL> except ImportError : <EOL> from distutils . core import setup , Extension <EOL> has_setuptools = False <EOL> version_string = '<STR_LIT>' <EOL> setup_kwargs = { } <EOL> install_requires = [ <EOL> ] <EOL> dependency_links = [ <EOL...
<s> from setuptools import setup <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> license = '<STR_LIT>' , <EOL> install_requires = [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> packa...
<s> """<STR_LIT>""" <EOL> from pwn import * <EOL> out = '''<STR_LIT>''' <EOL> def append_example ( _arg , top , names ) : <EOL> global out <EOL> for name in names : <EOL> if not ( name . endswith ( '<STR_LIT>' ) and name != __file__ ) : <EOL> continue <EOL> path = os . path . join ( top , name ) [ <NUM_LIT:2> : ] <EOL>...
<s> import argparse <EOL> import sys <EOL> import pwnlib . log <EOL> from pwnlib . elf import ELF <EOL> from pwnlib . util . fiddling import unhex <EOL> pwnlib . log . install_default_handler ( ) <EOL> p = argparse . ArgumentParser ( ) <EOL> p . add_argument ( '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> p . add_argument (...
<s> import os <EOL> import random <EOL> import re <EOL> import shlex <EOL> import tempfile <EOL> from . import atexit <EOL> from . import elf <EOL> from . import tubes <EOL> from . asm import make_elf <EOL> from . context import context <EOL> from . log import getLogger <EOL> from . util import misc <EOL> from . util i...
<s> _const_codes = [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' <EOL> ] <EOL> _expr_codes = _const_codes + [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<...