code
stringlengths
9
256k
<s> import click <EOL> import re <EOL> from senza . aws import resolve_security_groups , resolve_topic_arn , resolve_referenced_resource <EOL> from senza . utils import ensure_keys <EOL> from senza . components . iam_role import get_merged_policies <EOL> def component_auto_scaling_group ( definition , configuration , a...
<s> import click <EOL> from unittest . mock import MagicMock <EOL> from senza . templates . _helper import get_iam_role_policy , get_mint_bucket_name , check_value , prompt , choice <EOL> def test_template_helper_get_mint_bucket_name ( monkeypatch ) : <EOL> monkeypatch . setattr ( '<STR_LIT>' , MagicMock ( return_value...
<s> import json <EOL> def test_errors ( problem_app ) : <EOL> app_client = problem_app . app . test_client ( ) <EOL> greeting404 = app_client . get ( '<STR_LIT>' ) <EOL> assert greeting404 . content_type == '<STR_LIT>' <EOL> assert greeting404 . status_code == <NUM_LIT> <EOL> error404 = json . loads ( greeting404 . dat...
<s> from __future__ import print_function <EOL> import click <EOL> import turnstile . common . config as config <EOL> @ click . command ( '<STR_LIT>' ) <EOL> def cmd ( ) : <EOL> """<STR_LIT>""" <EOL> user_config = config . UserConfiguration ( ) <EOL> current_verbosity = user_config . verbosity <EOL> verbosity_levels = ...
<s> VERSION = ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:1> ) </s>
<s> from django . http import HttpResponseRedirect , HttpResponse <EOL> from django . utils . encoding import force_unicode <EOL> from django . utils . translation import ugettext as _ <EOL> from django . utils . html import escape , escapejs <EOL> from django . views . generic import TemplateView , View <EOL> from dja...
<s> from dockit . forms . forms import DocumentForm </s>
<s> from dockit . schema . loading import get_base_document , cache as app_cache , force_register_documents <EOL> from dockit . schema . schema import create_document <EOL> from dockit import schema <EOL> from django . utils import unittest <EOL> from dockit . tests . schema . common import SimpleDocument <EOL> class L...
<s> from copy import copy <EOL> try : <EOL> from django . conf . urls import patterns <EOL> except ImportError : <EOL> from django . conf . urls . defaults import patterns <EOL> from hyperadmin . clients . common import Client <EOL> from hyperadmin . endpoints import RootEndpoint <EOL> class MediaTypeRootEndpoint ( Roo...
<s> from django . contrib . auth import logout <EOL> from django import forms <EOL> from hyperadmin . links import LinkPrototype <EOL> from hyperadmin . resources . endpoints import ResourceEndpoint <EOL> class LoginLinkPrototype ( LinkPrototype ) : <EOL> def show_link ( self , ** kwargs ) : <EOL> return True <EOL> ret...
<s> from hyperadmin . resources . wizard . resources import Wizard , MultiPartStep <EOL> from hyperadmin . resources . wizard . endpoints import Step , FormStep , StepList </s>
<s> import clang . cindex , asciitree , sys <EOL> clang . cindex . Config . set_library_path ( "<STR_LIT>" ) <EOL> index = clang . cindex . Index ( clang . cindex . conf . lib . clang_createIndex ( False , True ) ) <EOL> translation_unit = index . parse ( sys . argv [ <NUM_LIT:1> ] , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EO...
<s> from bowcaster . common . support import LittleEndian <EOL> from bowcaster . common . support import BigEndian <EOL> from bowcaster . development import OverflowBuffer <EOL> from bowcaster . development import SectionCreator <EOL> from bowcaster . common . support import Logging <EOL> from checksums . libacos impor...
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import sys <EOL> from setuptools . command . test import test as TestCommand <EOL> from setuptools import setup <EOL> class PyTest ( TestCommand ) : <EOL> def finalize_options ( self ) : <EOL> TestCommand . finalize_options ( self ) <EOL> self . test...
<s> from nose . tools import * <EOL> from lamson . testing import * <EOL> from config import settings <EOL> import time <EOL> from app . model import archive , confirmation <EOL> queue_path = archive . store_path ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> sender = "<STR_LIT>" % time . time ( ) <EOL> host = "<STR_LIT>" <EOL> l...
<s> from lamson import queue <EOL> def attach_headers ( message , user_id , post_name , domain ) : <EOL> """<STR_LIT>""" <EOL> message [ '<STR_LIT>' ] = post_name <EOL> message [ '<STR_LIT>' ] = user_id <EOL> message [ '<STR_LIT>' ] = domain <EOL> def defer_to_queue ( message ) : <EOL> index_q = queue . Queue ( "<STR_L...
<s> """<STR_LIT>""" <EOL> from __future__ import with_statement <EOL> from functools import wraps <EOL> import re <EOL> import logging <EOL> import sys <EOL> import shelve <EOL> import threading <EOL> ROUTE_FIRST_STATE = '<STR_LIT>' <EOL> LOG = logging . getLogger ( "<STR_LIT>" ) <EOL> DEFAULT_STATE_KEY = lambda mod , ...
<s> from flask import Flask , render_template <EOL> from flask . ext . uwsgi_websocket import GeventWebSocket <EOL> app = Flask ( __name__ ) <EOL> ws = GeventWebSocket ( app ) <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def index ( ) : <EOL> return render_template ( '<STR_LIT>' ) <EOL> @ ws . route ( '<STR_LIT>' ) <EOL...
<s> import re <EOL> import requests <EOL> from authorizenet . conf import settings <EOL> from authorizenet import AUTHNET_POST_URL , AUTHNET_TEST_POST_URL <EOL> class AIMPaymentHelper ( object ) : <EOL> def __init__ ( self , defaults ) : <EOL> self . defaults = defaults <EOL> if settings . DEBUG : <EOL> self . endpoint...
<s> from django . conf . urls import url , patterns <EOL> from . views import CreateCustomerView , UpdateCustomerView , success_view <EOL> urlpatterns = patterns ( <EOL> '<STR_LIT>' , <EOL> url ( r"<STR_LIT>" , CreateCustomerView . as_view ( ) ) , <EOL> url ( r"<STR_LIT>" , UpdateCustomerView . as_view ( ) ) , <EOL> ur...
<s> """<STR_LIT>""" <EOL> REDMINE_CONSTS = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : <NUM_LIT:2> , <EOL> '<STR_LIT>' : <NUM_LIT:3> <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : <NUM_LIT:2> , <EOL> '<STR_LIT>' : <NUM_LIT:3> , <EOL> '<STR_LIT>' :...
<s> import os <EOL> import shutil <EOL> import tempfile <EOL> from zpmlib import zapptemplate <EOL> class TestPythonTemplate : <EOL> def test_without_ui ( self ) : <EOL> tempdir = tempfile . mkdtemp ( ) <EOL> try : <EOL> files = list ( zapptemplate . template ( tempdir , '<STR_LIT>' , False ) ) <EOL> proj_name = os . p...
<s> from __future__ import division <EOL> from ctypes import * <EOL> from ctypes . util import find_library <EOL> from errno import * <EOL> from os import strerror <EOL> from platform import machine , system <EOL> from signal import signal , SIGINT , SIG_DFL <EOL> from stat import S_IFDIR <EOL> from traceback import pr...
<s> from __future__ import print_function , unicode_literals <EOL> from future . builtins import str , range <EOL> import sys <EOL> PY2 = sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:2> <EOL> if PY2 : <EOL> import os <EOL> DEVNULL = open ( os . devnull , '<STR_LIT:wb>' ) <EOL> else : <EOL> from subprocess import DEVN...
<s> if __name__ == '<STR_LIT:__main__>' : <EOL> import tornado . ioloop <EOL> import tornado . web <EOL> import urllib <EOL> class MainHandler ( tornado . web . RequestHandler ) : <EOL> def get ( self , project ) : <EOL> try : <EOL> with open ( '<STR_LIT>' % project , '<STR_LIT:rb>' ) as f : <EOL> coverage = f . read (...
<s> from flask_wtf import Form <EOL> from wtforms import TextField , PasswordField , BooleanField , validators <EOL> class LoginForm ( Form ) : <EOL> username = TextField ( '<STR_LIT>' , [ validators . Length ( min = <NUM_LIT:2> , max = <NUM_LIT> ) ] ) <EOL> password = PasswordField ( '<STR_LIT>' , [ validators . Requi...
<s> from __future__ import print_function <EOL> import sys <EOL> import mesh . patch as patch <EOL> import numpy <EOL> from util import msg <EOL> def init_data ( my_data , rp ) : <EOL> """<STR_LIT>""" <EOL> msg . bold ( "<STR_LIT>" ) <EOL> if not isinstance ( my_data , patch . CellCenterData2d ) : <EOL> print ( "<STR_L...
<s> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> from diffusion . problems import * <EOL> import mesh . patch as patch <EOL> from simulation_null import NullSimulation , grid_setup <EOL> import multigrid . MG as MG <EOL> from util import msg , profile <EOL> class Simulation ( NullSimulation ) : <EOL...
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import os <EOL> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> import compare <EOL> import mesh . patch as patch <EOL> import multigrid . general_MG as MG <EOL> from util import msg <EOL> def true ( x , y ) : <EOL> return ( x ** <NU...
<s> import random <EOL> class TicTacToe : <EOL> def __init__ ( self , playerX , playerO ) : <EOL> self . board = [ '<STR_LIT:U+0020>' ] * <NUM_LIT:9> <EOL> self . playerX , self . playerO = playerX , playerO <EOL> self . playerX_turn = True <EOL> def display_board ( self ) : <EOL> print '<STR_LIT>' <EOL> print '<STR_LI...
<s> import re <EOL> from ztag . annotation import Annotation <EOL> from ztag . annotation import OperatingSystem <EOL> from ztag import protocols <EOL> import ztag . test <EOL> class FtpCesarFtpd ( Annotation ) : <EOL> protocol = protocols . FTP <EOL> subprotocol = protocols . FTP . BANNER <EOL> port = None <EOL> impl_...
<s> import re <EOL> from ztag . annotation import Annotation <EOL> from ztag . annotation import OperatingSystem <EOL> from ztag . annotation import Type <EOL> from ztag . annotation import Manufacturer <EOL> from ztag import protocols <EOL> import ztag . test <EOL> class FtpMaygion ( Annotation ) : <EOL> protocol = pr...
<s> import re <EOL> from ztag . annotation import Annotation <EOL> from ztag . annotation import OperatingSystem <EOL> from ztag . annotation import Type <EOL> from ztag . annotation import Manufacturer <EOL> from ztag import protocols <EOL> import ztag . test <EOL> class FtpVodaphone ( Annotation ) : <EOL> protocol = ...
<s> from ztag . annotation import * <EOL> class CiscoServer ( Annotation ) : <EOL> protocol = protocols . HTTP <EOL> subprotocol = protocols . HTTP . GET <EOL> port = None <EOL> tests = { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> } <EOL> } <EOL> } <EOL> def process ( self , obj...
<s> from ztag . annotation import * <EOL> class DellIDRACTag ( TLSTag ) : <EOL> protocol = protocols . HTTPS <EOL> subprotocol = protocols . HTTPS . TLS <EOL> port = None <EOL> def process ( self , obj , meta ) : <EOL> s = obj [ "<STR_LIT>" ] [ "<STR_LIT>" ] <EOL> if s [ "<STR_LIT>" ] [ <NUM_LIT:0> ] == "<STR_LIT>" and...
<s> from ztag . annotation import * <EOL> class DellPrinterHTTPS ( Annotation ) : <EOL> protocol = protocols . FTP <EOL> subprotocol = protocols . FTP . BANNER <EOL> port = None <EOL> def process ( self , obj , meta ) : <EOL> cn = obj [ "<STR_LIT>" ] [ "<STR_LIT>" ] [ "<STR_LIT>" ] [ "<STR_LIT>" ] [ <NUM_LIT:0> ] <EOL>...
<s> import argparse <EOL> import importlib <EOL> def subclass_of ( cls ) : <EOL> def check_class ( class_path ) : <EOL> path_parts = class_path . split ( '<STR_LIT:.>' ) <EOL> if len ( path_parts ) < <NUM_LIT:2> : <EOL> msg = "<STR_LIT>" <EOL> raise argparse . ArgumentTypeError ( msg ) <EOL> class_name = path_parts [ -...
<s> from ztag . transform import ZGrabTransform , ZMapTransformOutput <EOL> import https <EOL> from ztag . transform import Transformable <EOL> from ztag import protocols , errors <EOL> class POP3StartTLSTransform ( ZGrabTransform ) : <EOL> name = "<STR_LIT>" <EOL> port = None <EOL> protocol = protocols . POP3 <EOL> su...
<s> from django . conf . urls import patterns , url , include <EOL> from django . contrib import admin <EOL> admin . autodiscover ( ) <EOL> urlpatterns = patterns ( "<STR_LIT>" , <EOL> url ( r'<STR_LIT>' , include ( admin . site . urls ) ) ) </s>
<s> from zohmg . mapper import Mapper <EOL> from zohmg . reducer import Reducer <EOL> from zohmg . combiner import Combiner <EOL> from usermapper import map <EOL> import dumbo <EOL> dumbo . run ( Mapper ( map ) , Reducer ( ) , Combiner ( ) ) </s>
<s> import unittest <EOL> from zohmg . config import Config <EOL> class TestConfig ( unittest . TestCase ) : <EOL> def test_sanity_check ( self ) : <EOL> for x in [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT:c>' ] : <EOL> dataset = '<STR_LIT>' % x <EOL> self . assertRaises ( SystemExit , Config , dataset ) <EOL> dataset...
<s> from . import NeuralLayer <EOL> class Bias ( NeuralLayer ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> super ( Bias , self ) . __init__ ( "<STR_LIT>" ) <EOL> def prepare ( self ) : <EOL> self . output_dim = self . input_dim <EOL> self . B = self . create_bias ( self . output_dim , "<STR_LIT>" ) <EOL...
<s> from . import NeuralNetwork <EOL> class ComputationalGraph ( NeuralNetwork ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , input_dim = <NUM_LIT:0> , model = None , input_tensor = None , <EOL> cost = None , output = None , blocks = None , input_vars = None , target_vars = None ) : <EOL> """<STR_LIT>""" <EOL> s...
<s> class FakeGenerator ( object ) : <EOL> def __init__ ( self , dataset , method_name ) : <EOL> self . dataset = dataset <EOL> self . method_name = method_name <EOL> def __iter__ ( self ) : <EOL> return getattr ( self . dataset , self . method_name ) ( ) </s>
<s> from deepy . layers import NeuralLayer <EOL> from deepy . utils import build_activation <EOL> import theano . tensor as T <EOL> class HighwayLayer ( NeuralLayer ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , activation = '<STR_LIT:relu>' , init = None , gate_bias = - <NUM_LIT:5> ) : <EOL> super ( HighwayLaye...
<s> import logging <EOL> logging . basicConfig ( level = logging . INFO ) <EOL> from deepy . dataset import MnistDataset , MiniBatches <EOL> from deepy . networks import NeuralClassifier <EOL> from deepy . layers import Dense , Softmax <EOL> from deepy . trainers import LearningRateAnnealer , ScipyTrainer <EOL> def run...
<s> """<STR_LIT>""" <EOL> RESULTS = [ ( <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , '<ST...
<s> """<STR_LIT>""" <EOL> from PyQt4 import QtGui <EOL> class Main ( QtGui . QWidget ) : <EOL> def __init__ ( self ) : <EOL> super ( ) . __init__ ( None ) <EOL> b1 = QtGui . QPushButton ( '<STR_LIT:hello>' ) <EOL> b2 = QtGui . QPushButton ( '<STR_LIT>' ) <EOL> l1 = QtGui . QLabel ( '<STR_LIT:foo>' ) <EOL> l2 = QtGui . ...
<s> """<STR_LIT>""" <EOL> import json <EOL> from flexx . pyscript import py2js as py2js_ <EOL> from flexx . pyscript . parser2 import get_class_definition <EOL> from flexx . event . _emitters import BaseEmitter , Property <EOL> from flexx . event . _handler import HandlerDescriptor , Handler <EOL> from flexx . event . ...
<s> """<STR_LIT>""" <EOL> import os <EOL> import tempfile <EOL> from flexx . util . testing import run_tests_if_main , raises <EOL> from flexx . pyscript import py2js , evaljs , evalpy , script2js <EOL> def test_py2js_on_wrong_vals ( ) : <EOL> raises ( ValueError , py2js , [ ] ) <EOL> raises ( ValueError , py2js , { } ...
<s> import time <EOL> import logging <EOL> import flexx <EOL> from flexx import app , ui , react <EOL> import faulthandler <EOL> faulthandler . enable ( ) <EOL> class MyApp ( ui . Widget ) : <EOL> def init ( self ) : <EOL> TEST = <NUM_LIT:6> <EOL> if TEST == <NUM_LIT:0> : <EOL> ui . Button ( text = '<STR_LIT>' , flex =...
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import json <EOL> from . common import DesktopRuntime , create_temp_app_dir <EOL> def get_template ( ) : <EOL> return { "<STR_LIT:name>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : False , <EOL> "<STR_LIT>" : False , <EOL> "<STR_LIT:de...
<s> import sys , os <EOL> extensions = [ ] <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_patterns = [ '<STR_LIT>' ] <EOL> pygm...
<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>' ) ( max_length = <NUM_LIT:25...
<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:status>' , self . gf ( '<STR_LIT>' ) ( default = <NUM_LIT:...
<s> import datetime <EOL> from haystack import indexes <EOL> from haystack import site <EOL> from zorna . fileman . models import ZornaFile <EOL> class ZornaFileIndex ( indexes . SearchIndex ) : <EOL> text = indexes . CharField ( document = True , use_template = True ) <EOL> filename = indexes . CharField ( ) <EOL> des...
<s> import os <EOL> from django . conf import settings <EOL> from django . db import models <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . contrib . contenttypes import generic <EOL> from django . contrib . contenttypes . models import ContentType <EOL> from django . core . files ...
<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> '''<STR_LIT>''' <EOL> import argparse <EOL> import urllib2 <EOL> import json <EOL> import sys <EOL> import os <EOL> def compare_version_numbers ( v1 , v2 ) : <EOL> '''<STR_LIT>''' <EOL> parts1 = v1 . split ( '<STR_LIT:.>' ) <EOL> parts2 = v2 . split ( '<STR_LIT:.>' ) <EOL> for i in range ( len ( parts1 ) ) : <EOL> ...
<s> from __future__ import unicode_literals <EOL> import posixpath <EOL> from django import forms <EOL> from django . contrib . admin . widgets import AdminTextareaWidget <EOL> from django . core . urlresolvers import NoReverseMatch , reverse <EOL> from django . template . loader import render_to_string <EOL> from djan...
<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> from sqlparse3 import engine <EOL> from sqlparse3 import filters <EOL> from sqlparse3 import formatter <EOL> from sqlparse3 . exceptions import SQLParseError <EOL> def parse ( sql , encoding = None ) : <EOL> """<STR_LIT>""" <EOL> return tuple ( parsestream ( sql...
<s> ZULIP_USER = "<STR_LIT>" <EOL> ZULIP_API_KEY = "<STR_LIT>" <EOL> def commit_notice_destination ( repo , branch , commit ) : <EOL> if branch in [ "<STR_LIT>" , "<STR_LIT>" ] : <EOL> return dict ( stream = "<STR_LIT>" , <EOL> subject = u"<STR_LIT:%s>" % ( branch , ) ) <EOL> return None <EOL> def format_commit_message...
<s> import os <EOL> import sys <EOL> import logging <EOL> import subprocess <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> if '<STR_LIT>' in os . name and os . geteuid ( ) == <NUM_LIT:0> : <EOL> from django . core . management . base import CommandError <EOL> raise CommandError ( "<STR_LIT>" ) <EOL> os . environ . s...
<s> from __future__ import absolute_import <EOL> import ujson <EOL> NORMAL_TWEET = """<STR_LIT>""" <EOL> MENTION_IN_LINK_TWEET = """<STR_LIT>""" <EOL> MEDIA_TWEET = """<STR_LIT>""" <EOL> def twitter ( tweet_id ) : <EOL> if tweet_id in [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] : <EOL> return ujson . loads ( NORMAL_TWE...
<s> from __future__ import absolute_import <EOL> from typing import Any , Tuple <EOL> from django . conf import settings <EOL> from zerver . lib . redis_utils import get_redis_client <EOL> from six . moves import zip <EOL> from zerver . models import UserProfile <EOL> import redis <EOL> import time <EOL> import logging...
<s> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> from django . core . management . base import BaseCommand <EOL> import sys <EOL> from zerver . lib . actions import do_deactivate_realm <EOL> from zerver . models import get_realm <EOL> class Command ( BaseCommand ) : <EOL> hel...
<s> from __future__ import absolute_import <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from django . conf import settings <EOL> from django . core . mail import send_mail , BadHeaderError <EOL> class Command ( BaseCommand ) : <EOL> help = """<STR_LIT>""" <EOL> def add_arguments ...
<s> from __future__ import absolute_import <EOL> from django . test import TestCase <EOL> from zerver . lib . test_helpers import ( <EOL> AuthedTestCase , <EOL> most_recent_message , <EOL> most_recent_usermessage , <EOL> ) <EOL> from zerver . models import ( <EOL> get_display_recipient , get_stream , get_user_profile_b...
<s> from __future__ import absolute_import <EOL> from django . db . models import Q <EOL> from django . conf import settings <EOL> from zerver . models import get_client , UserProfile , get_user_profile_by_email <EOL> from zerver . lib . actions import check_send_message <EOL> from zerver . lib . response import json_s...
<s> EXTERNAL_HOST = '<STR_LIT>' <EOL> ZULIP_ADMINISTRATOR = '<STR_LIT>' <EOL> ADMIN_DOMAIN = '<STR_LIT>' <EOL> AUTHENTICATION_BACKENDS = ( <EOL> ) <EOL> SSO_APPEND_DOMAIN = None <EOL> EMAIL_HOST = '<STR_LIT>' <EOL> EMAIL_HOST_USER = '<STR_LIT>' <EOL> EMAIL_PORT = <NUM_LIT> <EOL> EMAIL_USE_TLS = True <EOL> DEFAULT_FROM_...
<s> import os , sys , inspect <EOL> import wx , wx . html <EOL> import numpy , scipy <EOL> from matplotlib . backends . backend_wxagg import FigureCanvasWxAgg as FigureCanvas <EOL> from matplotlib . figure import Figure <EOL> import matplotlib <EOL> import matplotlib . pyplot <EOL> if - <NUM_LIT:1> != sys . path [ <NUM...
<s> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> from __future__ import absolute_import <EOL> import pyeq2 <EOL> from . import IExtendedVersionHandler <EOL> import numpy <EOL> numpy . seterr ( all = '<STR_LIT:ignore>' ) <EOL> class ExtendedVersionHandler_ExponentialDecay ( I...
<s> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> from __future__ import absolute_import <EOL> import sys , os <EOL> if os . path . join ( sys . path [ <NUM_LIT:0> ] [ : sys . path [ <NUM_LIT:0> ] . rfind ( os . sep ) ] , '<STR_LIT:..>' ) not in sys . path : <EOL> sys . path ...
<s> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> from __future__ import absolute_import <EOL> import sys , os , types , unittest <EOL> if - <NUM_LIT:1> != sys . path [ <NUM_LIT:0> ] . find ( '<STR_LIT>' ) : raise Exception ( '<STR_LIT>' ) <EOL> if os . path . join ( sys . pa...
<s> import numpy as np <EOL> denominator_table = np . log2 ( np . arange ( <NUM_LIT:2> , <NUM_LIT> ) ) <EOL> def dcg_at_k ( r , k , method = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> r = np . asfarray ( r ) [ : k ] <EOL> if r . size : <EOL> if method == <NUM_LIT:0> : <EOL> return r [ <NUM_LIT:0> ] + np . sum ( r [ <N...
<s> "<STR_LIT>" <EOL> import pandas as pd <EOL> from sklearn . pipeline import Pipeline <EOL> from sklearn . preprocessing import PolynomialFeatures , MinMaxScaler <EOL> from sklearn . linear_model import LogisticRegression as LR <EOL> train_file = '<STR_LIT>' <EOL> test_file = '<STR_LIT>' <EOL> output_file = '<STR_LIT...
<s> import csv <EOL> import sys <EOL> import argparse <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' ) <EOL> parser . add_argument ( "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_argument ( '<STR_LIT:index>' , metavar = '<STR...
<s> from hiccup import BasePlugin <EOL> from hiccup import SharedFunctions as shared <EOL> import re , pprint , json <EOL> class JsonPrint ( BasePlugin . BasePlugin ) : <EOL> plugin_scope = '<STR_LIT>' <EOL> def __init__ ( self , global_config ) : <EOL> BasePlugin . BasePlugin . __init__ ( self , global_config , self ....
<s> class CaseInsensitiveDict ( dict ) : <EOL> """<STR_LIT>""" <EOL> def __getitem__ ( self , key ) : <EOL> return dict . __getitem__ ( self , str ( key ) . title ( ) ) <EOL> def __setitem__ ( self , key , value ) : <EOL> dict . __setitem__ ( self , str ( key ) . title ( ) , value ) <EOL> def __delitem__ ( self , key )...
<s> import re , copy , polib <EOL> import jasy . js . parse . Node as Node <EOL> import jasy . item . Translation as Translation <EOL> from jasy import UserError <EOL> import jasy . core . Console as Console <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> translationFunctions = ( "<STR_LIT>" , "<STR_L...
<s> import sys , os , unittest , logging <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> jasyroot = os . path . normpath ( os . path . join ( os . path . abspath ( sys . argv [ <NUM_LIT:0> ] ) , os . pardir , os . pardir , os . pardir , os . pardir ) ) <EOL> sys . path . insert ( <NUM_LIT:0> , jasyroot ) <EOL> print ...
<s> import os <EOL> import json <EOL> import logging . config <EOL> import inspect <EOL> def setup_logging ( <EOL> default_path = '<STR_LIT>' , <EOL> default_level = logging . INFO , <EOL> env_key = '<STR_LIT>' <EOL> ) : <EOL> """<STR_LIT>""" <EOL> path = default_path <EOL> value = os . getenv ( env_key , None ) <EOL> ...
<s> """<STR_LIT>""" <EOL> from datetime import datetime <EOL> from sqlalchemy import ( create_engine , MetaData , Table , Column , Integer , <EOL> String , DateTime , Float , ForeignKey , and_ ) <EOL> from sqlalchemy . orm import mapper , relationship , Session <EOL> from sqlalchemy . ext . declarative import declarati...
<s> """<STR_LIT>""" </s>
<s> """<STR_LIT>""" <EOL> from sqlalchemy import Column , String , Integer , ForeignKey , create_engine <EOL> from sqlalchemy . orm . interfaces import SessionExtension <EOL> from sqlalchemy . ext . declarative import declarative_base <EOL> from sqlalchemy . orm import attributes , relationship , backref , sessionmaker...
<s> """<STR_LIT>""" <EOL> import os <EOL> from . mysqldb import MySQLDialect_mysqldb <EOL> from ... pool import NullPool <EOL> import re <EOL> from sqlalchemy . util import warn_deprecated <EOL> def _is_dev_environment ( ) : <EOL> return os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) . startswith ( '<STR_LIT>' ) <EOL...
<s> from sqlalchemy . dialects . sqlite import base , pysqlite , pysqlcipher <EOL> base . dialect = pysqlite . dialect <EOL> from sqlalchemy . dialects . sqlite . base import ( <EOL> BLOB , BOOLEAN , CHAR , DATE , DATETIME , DECIMAL , FLOAT , INTEGER , REAL , <EOL> NUMERIC , SMALLINT , TEXT , TIME , TIMESTAMP , VARCHAR...
<s> from . . import util as _sa_util <EOL> _sa_util . dependencies . resolve_all ( "<STR_LIT>" ) </s>
<s> import weakref <EOL> from . import attributes <EOL> from . . import util <EOL> from . . import exc as sa_exc <EOL> from . import util as orm_util <EOL> class IdentityMap ( object ) : <EOL> def __init__ ( self ) : <EOL> self . _dict = { } <EOL> self . _modified = set ( ) <EOL> self . _wr = weakref . ref ( self ) <EO...
<s> """<STR_LIT>""" <EOL> from . base import Executable , _generative , _from_objects , DialectKWArgs , ColumnCollection <EOL> from . elements import ClauseElement , _literal_as_text , Null , and_ , _clone , _column_as_key <EOL> from . selectable import _interpret_as_from , _interpret_as_select , HasPrefixes , HasCTE <...
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> from . util import gc_collect <EOL> from . import config <EOL> import pstats <EOL> import collections <EOL> import contextlib <EOL> try : <EOL> import cProfile <EOL> except ImportError : <EOL> cProfile = None <EOL> from . . util import jython , pypy , win32 , u...
<s> from sqlalchemy . testing import eq_ <EOL> from sqlalchemy . orm import mapper , relationship , create_session , clear_mappers , sessionmaker , aliased , Session , subqueryload <EOL> from sqlalchemy . orm . mapper import _mapper_registry <EOL> from sqlalchemy . orm . session import _sessions <EOL> from sqlalchemy i...
<s> from sqlalchemy . testing import eq_ , assert_raises_message <EOL> from sqlalchemy import exc <EOL> from sqlalchemy . databases import firebird <EOL> from sqlalchemy . exc import ProgrammingError <EOL> from sqlalchemy . sql import table , column <EOL> from sqlalchemy import types as sqltypes <EOL> from sqlalchemy ....
<s> import datetime <EOL> import os <EOL> from sqlalchemy import * <EOL> from sqlalchemy import event <EOL> from sqlalchemy import sql , util <EOL> from sqlalchemy . orm import * <EOL> from sqlalchemy . ext . horizontal_shard import ShardedSession <EOL> from sqlalchemy . sql import operators <EOL> from sqlalchemy . tes...
<s> from sqlalchemy import testing <EOL> from sqlalchemy import Integer , String , ForeignKey <EOL> from sqlalchemy . testing . schema import Table , Column <EOL> from sqlalchemy . orm import mapper , relationship , create_session <EOL> from sqlalchemy . testing import fixtures <EOL> from sqlalchemy . testing import eq...
<s> from sqlalchemy . testing import assert_raises , assert_raises_message <EOL> import sqlalchemy as sa <EOL> from sqlalchemy import MetaData , Integer , ForeignKey , util , event <EOL> from sqlalchemy . orm import mapper , relationship , create_session , attributes , class_mapper , clear_mappers , instrumentation , e...
<s> from sqlalchemy . testing import eq_ , assert_raises , assert_raises_message <EOL> from sqlalchemy import testing <EOL> from sqlalchemy . testing . schema import Table , Column <EOL> from test . orm import _fixtures <EOL> from sqlalchemy . testing import fixtures <EOL> from sqlalchemy import Integer , String , Fore...
<s> from sqlalchemy . testing import eq_ , assert_raises_message , is_ <EOL> from sqlalchemy import testing <EOL> from sqlalchemy . testing import fixtures , engines <EOL> from sqlalchemy import ( <EOL> exc , sql , String , Integer , MetaData , and_ , ForeignKey , <EOL> VARCHAR , INT , Sequence , func ) <EOL> from sqla...
<s> """<STR_LIT>""" <EOL> import sys <EOL> from unittest import TestCase <EOL> from flask import Flask <EOL> from flask_gravatar import Gravatar <EOL> if sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:3> : <EOL> def b ( s ) : <EOL> return s . encode ( "<STR_LIT>" ) <EOL> else : <EOL> def b ( s ) : <EOL> return s <EOL> ...
<s> """<STR_LIT>""" <EOL> import logging <EOL> import yaml <EOL> from weblayer import RequestHandler <EOL> import model <EOL> class Bootstrap ( RequestHandler ) : <EOL> """<STR_LIT>""" <EOL> def bootstrap_series ( self ) : <EOL> existing = model . Series . all ( ) . fetch ( <NUM_LIT> ) <EOL> number_removed = len ( exis...