code stringlengths 9 256k |
|---|
<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:1.0>' <EOL> release = '<STR_LIT>' <EOL> exclude_patterns = [ '<STR_LIT>' ] <EOL> ... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function , unicode_literals , division , absolute_import <EOL> import time <EOL> import dxpy <EOL> from dxpy . bindings import ( DXObject , ) <EOL> from dxpy . exceptions import DXJobFailureError <EOL> class DXAnalysis ( DXObject ) : <EOL> '''<STR_LIT>''' <EOL> _cl... |
<s> """<STR_LIT>""" <EOL> import os . path , sys , re <EOL> from collections import deque <EOL> try : <EOL> from StringIO import StringIO <EOL> except ImportError : <EOL> from io import StringIO <EOL> try : <EOL> basestring <EOL> except NameError : <EOL> basestring = str <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" ] <E... |
<s> from __future__ import print_function , unicode_literals , division , absolute_import <EOL> import filecmp <EOL> import os <EOL> import shutil <EOL> import sys <EOL> import tempfile <EOL> import unittest <EOL> import dxpy <EOL> import dxpy_testutil as testutil <EOL> def setUpTempProjects ( thing ) : <EOL> thing . o... |
<s> import django_filters2 <EOL> from dnd . models import ( <EOL> Spell , DndEdition , SpellSchool , SpellSubSchool , SpellDescriptor , FeatCategory , <EOL> CharacterClass , Rulebook , Domain , Feat , Skill , Item , Language , RaceType , ItemSlot , <EOL> ItemProperty , Deity , Rule ) <EOL> from dnd . filters_fields imp... |
<s> from django . conf . urls import patterns , url <EOL> urlpatterns = patterns ( <EOL> '<STR_LIT>' , <EOL> url ( <EOL> r'<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> name = '<STR_LIT>' , <EOL> ) , <EOL> url ( <EOL> r'<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> name = '<STR_LIT>' , <EOL> ) , <EOL> url ( <EOL> r'<STR_LIT>' , <EOL... |
<s> import os <EOL> import urlparse <EOL> from django import template <EOL> from django . contrib . sites . models import Site <EOL> from django . utils . safestring import mark_safe <EOL> import dndproject . settings <EOL> register = template . Library ( ) <EOL> class SetVarNode ( template . Node ) : <EOL> def __init_... |
<s> import pytest <EOL> import six <EOL> from testing . testifycompat import ( <EOL> assert_equal , <EOL> assert_raises , <EOL> mock , <EOL> ) <EOL> from staticconf import testing , schema , validation , config , errors <EOL> class TestCreateValueType ( object ) : <EOL> def test_build_value_type ( self ) : <EOL> help_t... |
<s> import cairo <EOL> from PIL import Image <EOL> import numpy as np <EOL> import math <EOL> from colour import Color <EOL> PI = np . pi <EOL> TWOPI = PI * <NUM_LIT> <EOL> SIZE = <NUM_LIT:1000> <EOL> NUM = <NUM_LIT> <EOL> BACK = <NUM_LIT:1.> <EOL> GRAINS = <NUM_LIT:30> <EOL> ALPHA = <NUM_LIT> <EOL> ONE = <NUM_LIT:1.> ... |
<s> from collections import OrderedDict <EOL> from csv import DictWriter <EOL> from datetime import datetime <EOL> from functools import reduce <EOL> import operator <EOL> import sys <EOL> import numpy <EOL> from tabulate import tabulate <EOL> from . . _compat import pickle <EOL> from . util import ansi <EOL> from . ut... |
<s> import json <EOL> from django . http import HttpResponse <EOL> from . models import Author , Book <EOL> class JsonResponse ( HttpResponse ) : <EOL> def __init__ ( self , data ) : <EOL> super ( JsonResponse , self ) . __init__ ( json . dumps ( data ) , <EOL> content_type = '<STR_LIT>' ) <EOL> def get_authors_with_bo... |
<s> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> import logging <EOL> import os <EOL> import re <EOL> import six <EOL> from . import verbose_proxy <EOL> from . . import config <EOL> from . . config . environment import Environment <EOL> from . . const import API_VERSIONS <E... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> import argparse <EOL> import logging <EOL> import sys <EOL> import ruamel . yaml <EOL> from compose . config . types import VolumeSpec <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> def migrate ( ... |
<s> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> import six <EOL> from docker . errors import APIError <EOL> from compose . parallel import parallel_execute <EOL> from compose . parallel import parallel_execute_iter <EOL> from compose . parallel import UpstreamError <EOL> w... |
<s> import functools <EOL> from . . import errors <EOL> from . import utils <EOL> def check_resource ( f ) : <EOL> @ functools . wraps ( f ) <EOL> def wrapped ( self , resource_id = None , * args , ** kwargs ) : <EOL> if resource_id is None : <EOL> if kwargs . get ( '<STR_LIT>' ) : <EOL> resource_id = kwargs . pop ( '<... |
<s> from docker . ssladapter import ssladapter <EOL> try : <EOL> from backports . ssl_match_hostname import ( <EOL> match_hostname , CertificateError <EOL> ) <EOL> except ImportError : <EOL> from ssl import ( <EOL> match_hostname , CertificateError <EOL> ) <EOL> try : <EOL> from ssl import OP_NO_SSLv3 , OP_NO_SSLv2 , O... |
<s> def boot ( config_file , license ) : <EOL> if ( config_file or license ) : <EOL> try : <EOL> import newrelic . agent <EOL> newrelic . agent . initialize ( ) <EOL> except Exception as e : <EOL> raise Exception ( '<STR_LIT>' % e ) </s>
|
<s> import hashlib <EOL> import os <EOL> import random <EOL> import string <EOL> import unittest <EOL> from docker_registry . core import compat <EOL> import docker_registry . wsgi as wsgi <EOL> data_dir = os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT:data>" ) <EOL> class TestCase ( unittest . TestCas... |
<s> from . data import diamonds <EOL> from . dplython import * <EOL> diamonds = DplyFrame ( diamonds ) </s>
|
<s> """<STR_LIT>""" <EOL> from heapq import heapify , heappop , heapreplace <EOL> class ReadTooFar ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class PostingWriter ( object ) : <EOL> def write ( self , id , value ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def finish ( self ) : <EOL> "<STR... |
<s> import os , os . path , unittest <EOL> from random import random , randint <EOL> from whoosh . formats import * <EOL> from whoosh . postings import FakeReader , IntersectionScorer , UnionScorer , Exclude <EOL> from whoosh . filedb . filestore import FileStorage <EOL> from whoosh . filedb . filepostings import FileP... |
<s> def active_gateways ( ) : <EOL> """<STR_LIT>""" <EOL> from django . db import models <EOL> gateways = [ ] <EOL> for app in models . get_apps ( ) : <EOL> if hasattr ( app , '<STR_LIT>' ) : <EOL> parts = app . __name__ . split ( '<STR_LIT:.>' ) [ : - <NUM_LIT:1> ] <EOL> module = "<STR_LIT:.>" . join ( parts ) <EOL> g... |
<s> from livesettings import * <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> gettext = lambda s : s <EOL> PAYMENT_GROUP = ConfigurationGroup ( '<STR_LIT>' , <EOL> _ ( '<STR_LIT>' ) , <EOL> ordering = <NUM_LIT:100> ) <EOL> config_register_list ( <EOL> BooleanValue ( PAYMENT_GROUP , <EOL> '<STR_... |
<s> from decimal import Decimal <EOL> from django . db import models <EOL> from django . utils . safestring import mark_safe <EOL> from django . utils . translation import ugettext , ugettext_lazy as _ <EOL> from l10n . utils import moneyfmt <EOL> from satchmo_store . shop . models import Order <EOL> class PurchaseOrde... |
<s> from datetime import datetime , timedelta <EOL> from decimal import Decimal <EOL> from django . http import HttpResponse <EOL> from django . utils . translation import ugettext , ugettext_lazy as _ <EOL> from livesettings import config_get_group , config_value <EOL> from satchmo_store . shop . models import Order ,... |
<s> from decimal import Decimal <EOL> from django import forms <EOL> from django . db import models <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . utils . encoding import smart_str <EOL> from product . models import Option , Product , ProductPriceLookup , OptionGroup , Price , mak... |
<s> from category import urlpatterns as catpatterns <EOL> from django . conf . urls . defaults import * <EOL> from products import urlpatterns as prodpatterns <EOL> import product <EOL> from signals_ahoy . signals import collect_urls <EOL> from satchmo_store . shop import get_satchmo_setting <EOL> catbase = r'<STR_LIT>... |
<s> from django . shortcuts import render_to_response <EOL> from django . template import RequestContext <EOL> from django . utils . translation import ugettext_lazy as _ , ugettext <EOL> from satchmo_ext . newsletter . forms import NewsletterForm <EOL> def add_subscription ( request , template = "<STR_LIT>" , <EOL> re... |
<s> """<STR_LIT>""" <EOL> from datetime import date <EOL> from decimal import Decimal , getcontext <EOL> from django . conf import settings <EOL> from django . db import models <EOL> from django . utils . translation import get_language , gettext_lazy as _ <EOL> from django . utils . translation import ugettext , ugett... |
<s> from django . test import TestCase <EOL> from satchmo_store . contact . forms import ContactInfoForm <EOL> from satchmo_store . contact . models import * <EOL> from l10n . models import Country <EOL> from satchmo_store . shop . models import Config <EOL> class ContactTest ( TestCase ) : <EOL> fixtures = [ '<STR_LIT... |
<s> from decimal import Decimal , InvalidOperation <EOL> from django import template <EOL> from django . utils . safestring import mark_safe <EOL> from l10n . utils import moneyfmt <EOL> from satchmo_utils . templatetags import get_filter_args <EOL> import logging <EOL> log = logging . getLogger ( "<STR_LIT>" ) <EOL> r... |
<s> def _stripquotes ( val ) : <EOL> stripping = True <EOL> while stripping : <EOL> stripping = False <EOL> if val [ <NUM_LIT:0> ] in ( '<STR_LIT:">' , "<STR_LIT:'>" ) : <EOL> val = val [ <NUM_LIT:1> : ] <EOL> stripping = True <EOL> if val [ - <NUM_LIT:1> ] in ( '<STR_LIT:">' , "<STR_LIT:'>" ) : <EOL> val = val [ : - <... |
<s> """<STR_LIT>""" <EOL> from decimal import Decimal <EOL> from django . utils . translation import ugettext , ugettext_lazy as _ <EOL> from shipping . modules . base import BaseShipper <EOL> class Shipper ( BaseShipper ) : <EOL> id = "<STR_LIT>" <EOL> def __str__ ( self ) : <EOL> """<STR_LIT>""" <EOL> return "<STR_LI... |
<s> """<STR_LIT>""" <EOL> from decimal import Decimal <EOL> from django . core . cache import cache <EOL> from django . template import Context , loader <EOL> from django . utils . translation import ugettext as _ <EOL> from livesettings import config_get_group , config_value <EOL> from shipping import signals <EOL> fr... |
<s> import urllib <EOL> from os . path import isdir , isfile , join , dirname <EOL> import os <EOL> import sys <EOL> import string <EOL> import csv <EOL> import tarfile <EOL> import shutil <EOL> from decimal import Decimal <EOL> if "<STR_LIT>" not in os . environ : <EOL> from settings import DJANGO_SETTINGS_MODULE <EOL... |
<s> from django . db import models <EOL> from django . conf import settings <EOL> from django import VERSION <EOL> class ExampleUserProfile ( models . Model ) : <EOL> user = models . ForeignKey ( getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> description = models . TextField ( ) <EOL> url = models . URLField ... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> from django . conf import settings <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) , ... |
<s> import twitter_worker </s>
|
<s> from _base import * <EOL> import numpy <EOL> A0 = <NUM_LIT> <EOL> A1 = <NUM_LIT> <EOL> A2 = <NUM_LIT> <EOL> C8 = <NUM_LIT> <EOL> A8 = <NUM_LIT> <EOL> class Spectrum ( SpectrumBase ) : <EOL> '''<STR_LIT>''' <EOL> @ staticmethod <EOL> def pre_calculate ( Q , k_max , win , win_shape ) : <EOL> var = { } <EOL> t = <NUM_... |
<s> import time <EOL> from mrjob . job import MRJob <EOL> from mrjob . protocol import RawValueProtocol , ReprProtocol <EOL> import re <EOL> class MrS3LogParser ( MRJob ) : <EOL> """<STR_LIT>""" <EOL> LOGPATS = r'<STR_LIT>' r'<STR_LIT>' r'<STR_LIT>' r'<STR_LIT>' <EOL> NUM_ENTRIES_PER_LINE = <NUM_LIT> <EOL> logpat = re ... |
<s> from __future__ import print_function <EOL> from __future__ import division <EOL> import click <EOL> import time <EOL> def timeit ( method ) : <EOL> """<STR_LIT>""" <EOL> def timed ( * args , ** kw ) : <EOL> ts = time . time ( ) <EOL> result = method ( * args , ** kw ) <EOL> te = time . time ( ) <EOL> message = '<S... |
<s> from __future__ import print_function <EOL> from __future__ import division <EOL> import mock <EOL> from tests . compat import unittest <EOL> from click . testing import CliRunner <EOL> from haxor_news . hacker_news_cli import HackerNewsCli <EOL> class HackerNewsCliTest ( unittest . TestCase ) : <EOL> def setUp ( s... |
<s> from nose . tools import assert_equal <EOL> class TestTreeLevelLists ( object ) : <EOL> def test_tree_level_lists ( self ) : <EOL> node = Node ( <NUM_LIT:5> ) <EOL> insert ( node , <NUM_LIT:3> ) <EOL> insert ( node , <NUM_LIT:8> ) <EOL> insert ( node , <NUM_LIT:2> ) <EOL> insert ( node , <NUM_LIT:4> ) <EOL> insert ... |
<s> class Node ( object ) : <EOL> def __init__ ( self , data , next = None ) : <EOL> self . data = data <EOL> self . next = next <EOL> class Stack ( object ) : <EOL> def __init__ ( self , top = None ) : <EOL> self . top = top <EOL> def push ( self , data ) : <EOL> node = Node ( data , self . top ) <EOL> self . top = no... |
<s> from pygments . token import Token <EOL> from pygments . style import Style <EOL> from pygments . util import ClassNotFound <EOL> from prompt_toolkit . styles import default_style_extensions <EOL> import pygments . styles <EOL> class StyleFactory ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name )... |
<s> import argparse <EOL> import pprint <EOL> import sys , os . path <EOL> sys . path . append ( '<STR_LIT>' ) <EOL> from core . parser . ArgsParser import ArgsParser <EOL> import core . conf . appvulnms as conf <EOL> def display_banner ( ) : <EOL> """<STR_LIT>""" <EOL> print ( conf . appvulnms [ '<STR_LIT>' ] ) <EOL> ... |
<s> import argparse <EOL> import cbor <EOL> import dblogger <EOL> import kvlayer <EOL> import yakonfig <EOL> from . worker import traverse_extract_fetch <EOL> from dossier . models . web . config import Config <EOL> def main ( ) : <EOL> p = argparse . ArgumentParser ( '<STR_LIT>' ) <EOL> p . add_argument ( '<STR_LIT:ac... |
<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import , division , print_function <EOL> import inspect <EOL> import json <EOL> import logging <EOL> import bottle <EOL> from dossier . web import search_engines as builtin_engines <EOL> from dossier . web . config import Config <EOL> from dossier . web . filter... |
<s> from django . conf . urls . defaults import patterns , url <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , '<STR_LIT:list>' , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' , name = '<STR_LIT>' ) , <EOL> url ( r'<... |
<s> import os <EOL> import socket <EOL> import datetime <EOL> import copy <EOL> import gluon . contenttype <EOL> import gluon . fileutils <EOL> global_env = copy . copy ( globals ( ) ) <EOL> global_env [ '<STR_LIT>' ] = datetime <EOL> http_host = request . env . http_host . split ( '<STR_LIT::>' ) [ <NUM_LIT:0> ] <EOL>... |
<s> from six import with_metaclass <EOL> from werkzeug . utils import cached_property <EOL> from brownant . pipeline . network import HTTPClientProperty <EOL> class DinergateType ( type ) : <EOL> """<STR_LIT>""" <EOL> def __new__ ( metacls , name , bases , members ) : <EOL> cls = type . __new__ ( metacls , name , bases... |
<s> import os <EOL> import multiprocessing <EOL> import logging <EOL> import marshal <EOL> import cPickle <EOL> import shutil <EOL> import struct <EOL> import urllib <EOL> import msgpack <EOL> from dpark . env import env <EOL> from dpark . util import mkdir_p , atomic_file <EOL> from dpark . tracker import GetValueMess... |
<s> from dpark import _ctx as dpark <EOL> from dpark . mutable_dict import MutableDict <EOL> from random import shuffle <EOL> import cPickle <EOL> import numpy <EOL> with open ( '<STR_LIT>' ) as f : <EOL> ori = cPickle . loads ( f . read ( ) ) <EOL> k = <NUM_LIT:50> <EOL> d = <NUM_LIT:20> <EOL> M = len ( ori ) <EOL> V ... |
<s> from ellen . utils . process import git_with_repo <EOL> from ellen . utils . format import format_merge_analysis , format_index <EOL> def merge ( repository , ref , msg = '<STR_LIT>' , commit_msg = '<STR_LIT>' , <EOL> no_ff = False , _raise = True , _env = None ) : <EOL> git = git_with_repo ( repository ) <EOL> git... |
<s> from _base import BareRepoTest , BARE_REPO_TAGS <EOL> from ellen . repo import Jagare <EOL> class TestShow ( BareRepoTest ) : <EOL> def test_show_commit ( self ) : <EOL> repo = Jagare ( self . path ) <EOL> ret = repo . show ( '<STR_LIT>' ) <EOL> assert ret <EOL> def test_show_tree ( self ) : <EOL> repo = Jagare ( s... |
<s> from wsgiref . simple_server import make_server <EOL> from sina import Sina <EOL> from sina . config import DEFAULT_CONFIG <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> DEFAULT_CONFIG [ '<STR_LIT>' ] = True <EOL> app = Sina ( DEFAULT_CONFIG ) <EOL> server = make_server ( '<STR_LIT>' , <NUM_LIT> , app ) <EOL> se... |
<s> def renyi_entropy_knns ( knns , dim , alphas , Ks ) : <EOL> '''<STR_LIT>''' <EOL> alphas = np . asarray ( alphas ) . reshape ( - <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> Ks = np . asarray ( Ks ) . reshape ( <NUM_LIT:1> , - <NUM_LIT:1> ) <EOL> N , num_ks = knns . shape <EOL> if num_ks < np . max ( Ks ) : <EOL> raise ValueE... |
<s> """<STR_LIT>""" <EOL> import os <EOL> os . environ . setdefault ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> from django . core . wsgi import get_wsgi_application <EOL> application = get_wsgi_application ( ) </s>
|
<s> """<STR_LIT>""" <EOL> import threading <EOL> from emailer import send <EOL> from email_utils import get_text_from_html <EOL> from config import server_auto_email <EOL> from network import get_url <EOL> class reply_time ( threading . Thread ) : <EOL> """<STR_LIT>""" <EOL> email_dict = None <EOL> sender = None <EOL> ... |
<s> import os <EOL> import logging <EOL> from flask import Flask <EOL> from flask . ext . appbuilder import SQLA <EOL> from flask . ext . appbuilder import AppBuilder <EOL> from sqlalchemy . engine import Engine <EOL> from sqlalchemy import event <EOL> from . security import MySecurityManager <EOL> logging . basicConfi... |
<s> import os <EOL> from flask_appbuilder . security . manager import AUTH_OID , AUTH_REMOTE_USER , AUTH_DB , AUTH_LDAP , AUTH_OAUTH <EOL> basedir = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> CSRF_ENABLED = True <EOL> SECRET_KEY = '<STR_LIT>' <EOL> OPENID_PROVIDERS = [ <EOL> { '<STR_LIT:name>' : '<S... |
<s> from flask . ext . appbuilder import Model <EOL> from flask . ext . appbuilder . models . mixins import AuditMixin , FileColumn , ImageColumn <EOL> """<STR_LIT>""" </s>
|
<s> import calendar <EOL> from flask import redirect , flash , url_for , Markup <EOL> from . forms import TestForm <EOL> from flask_appbuilder . _compat import as_unicode <EOL> from flask_appbuilder import ModelView , GroupByChartView , aggregate_count , action , expose , BaseView , has_access <EOL> from flask_appbuild... |
<s> import calendar <EOL> from flask . ext . appbuilder import ModelView , GroupByChartView <EOL> from flask . ext . appbuilder . widgets import ListThumbnail , ListWidget , ListItem , ListBlock , ShowBlockWidget , ListLinkWidget <EOL> from flask . ext . appbuilder . models . sqla . interface import SQLAInterface <EOL>... |
<s> from flask . ext . babelpkg import lazy_gettext <EOL> from . . filters import BaseFilter , FilterRelation , BaseFilterConverter <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> class FilterContains ( BaseFilte... |
<s> import os <EOL> import sys <EOL> import imp <EOL> import multiprocessing <EOL> from setuptools import setup , find_packages <EOL> version = imp . load_source ( '<STR_LIT:version>' , os . path . join ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> def fpath ( name ) : <EOL> return os . path . join ( os . path . dirname ( __fi... |
<s> import theano <EOL> import theano . tensor as T <EOL> import numpy as np <EOL> import sys ; sys . path . append ( '<STR_LIT>' ) <EOL> import anglepy as ap <EOL> from anglepy . misc import lazytheanofunc <EOL> import anglepy . ndict as ndict <EOL> class MLP_Categorical ( ap . BNModel ) : <EOL> def __init__ ( self , ... |
<s> from . simple import SimpleConsumer <EOL> from . multiprocess import MultiProcessConsumer <EOL> from . group import KafkaConsumer <EOL> __all__ = [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' <EOL> ] </s>
|
<s> from . avg import Avg <EOL> from . count import Count <EOL> from . histogram import Histogram <EOL> from . max_stat import Max <EOL> from . min_stat import Min <EOL> from . percentile import Percentile <EOL> from . percentiles import Percentiles <EOL> from . rate import Rate <EOL> from . sensor import Sensor <EOL> ... |
<s> import abc <EOL> class AbstractType ( object ) : <EOL> __metaclass__ = abc . ABCMeta <EOL> @ abc . abstractmethod <EOL> def encode ( cls , value ) : <EOL> pass <EOL> @ abc . abstractmethod <EOL> def decode ( cls , data ) : <EOL> pass <EOL> @ classmethod <EOL> def repr ( cls , value ) : <EOL> return repr ( value ) <... |
<s> import os <EOL> from kafka . errors import KafkaTimeoutError <EOL> from kafka . protocol import create_message <EOL> from kafka . structs import ( <EOL> FetchRequestPayload , OffsetCommitRequestPayload , OffsetFetchRequestPayload , <EOL> ProduceRequestPayload ) <EOL> from test . fixtures import ZookeeperFixture , K... |
<s> import sys <EOL> verbose = False <EOL> onefile = False <EOL> if len ( sys . argv ) == <NUM_LIT:2> : <EOL> onefile = True <EOL> print "<STR_LIT>" <EOL> elif len ( sys . argv ) < <NUM_LIT:3> : <EOL> print "<STR_LIT>" , sys . argv [ <NUM_LIT:0> ] , "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> file1 = sys . argv ... |
<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" + "<STR_LIT>" <EOL> from pprint import pformat <EOL> import inspect <EOL> _INCLUDE_NAMESPACE_REPR_IN_NOTFOUND_EXCEPTIONS = False <EOL> _ALLOW_WRAPPING_OF_NOTFOUND_EXCEPTIONS = True <EOL> __all__ = [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>... |
<s> """<STR_LIT>""" </s>
|
<s> from disthelpers import Distribution </s>
|
<s> """<STR_LIT>""" <EOL> import dpkt <EOL> IPX_HDR_LEN = <NUM_LIT:30> <EOL> class IPX ( dpkt . Packet ) : <EOL> __hdr__ = ( <EOL> ( '<STR_LIT>' , '<STR_LIT:H>' , <NUM_LIT> ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:H>' , IPX_HDR_LEN ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:B>' , <NUM_LIT:0> ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:B>'... |
<s> """<STR_LIT>""" <EOL> import dpkt <EOL> TH_FIN = <NUM_LIT> <EOL> TH_SYN = <NUM_LIT> <EOL> TH_RST = <NUM_LIT> <EOL> TH_PUSH = <NUM_LIT> <EOL> TH_ACK = <NUM_LIT> <EOL> TH_URG = <NUM_LIT> <EOL> TH_ECE = <NUM_LIT> <EOL> TH_CWR = <NUM_LIT> <EOL> TCP_PORT_MAX = <NUM_LIT> <EOL> TCP_WIN_MAX = <NUM_LIT> <EOL> class TCP ( dp... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> from . import Extension <EOL> from . . blockprocessors import OListProcessor , UListProcessor <EOL> import re <EOL> class SaneOListProcessor ( OListProcessor ) : <EOL> SIBLING_TAGS = [ '<STR_LIT>' ] <EOL... |
<s> """<STR_LIT>""" <EOL> import os <EOL> from . import QT_API <EOL> from . import PYQT5_API <EOL> from . import PYQT4_API <EOL> from . import PYSIDE_API <EOL> if os . environ [ QT_API ] == PYQT5_API : <EOL> from PyQt5 . QtWebKit import * <EOL> from PyQt5 . QtWebKitWidgets import * <EOL> elif os . environ [ QT_API ] ==... |
<s> from django . dispatch import receiver <EOL> from django_jenkins . runner import CITestSuiteRunner <EOL> from django_jenkins . signals import build_suite <EOL> from django_selenium . selenium_runner import SeleniumTestRunner <EOL> class JenkinsTestRunner ( CITestSuiteRunner , SeleniumTestRunner ) : <EOL> def __init... |
<s> from __future__ import division , absolute_import <EOL> from unittest2 import TestCase <EOL> from yunomi . compat import xrange <EOL> from yunomi . stats . exp_decay_sample import ExponentiallyDecayingSample <EOL> from yunomi . tests . util import Clock <EOL> class ExponentiallyDecayingSampleTests ( TestCase ) : <E... |
<s> import os <EOL> import sys <EOL> from unittest2 import TestLoader , TextTestRunner <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> tests_dir = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> authorize_dir = os . path . join ( tests_dir , os . path . pardir ) <EOL> sys . path . append ( authorize_di... |
<s> APPLICATION_NAME = u'<STR_LIT>' </s>
|
<s> """<STR_LIT>""" <EOL> import os . path as _path <EOL> import csv as _csv <EOL> from netaddr . core import Subscriber , Publisher <EOL> OUI_REGISTRY = _path . join ( _path . dirname ( __file__ ) , '<STR_LIT>' ) <EOL> OUI_METADATA = _path . join ( _path . dirname ( __file__ ) , '<STR_LIT>' ) <EOL> OUI_INDEX = { } <EO... |
<s> import pickle <EOL> import types <EOL> import random <EOL> import pytest <EOL> from netaddr import IPAddress , IPNetwork , INET_PTON , AddrFormatError , ZEROFILL , Z , P , NOHOST <EOL> def test_ipaddress_v4 ( ) : <EOL> ip = IPAddress ( '<STR_LIT>' ) <EOL> assert ip . version == <NUM_LIT:4> <EOL> assert repr ( ip ) ... |
<s> import time <EOL> import sys <EOL> import os <EOL> from dronekit import connect , VehicleMode <EOL> from dronekit . test import with_sitl , wait_for <EOL> from nose . tools import assert_equals <EOL> @ with_sitl <EOL> def test_110 ( connpath ) : <EOL> vehicle = connect ( connpath , wait_ready = True ) <EOL> vehicle... |
<s> from dronekit import connect , VehicleMode <EOL> from pymavlink import mavutil <EOL> from Tkinter import * <EOL> global root <EOL> import argparse <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , <EOL> help = "<STR_LIT>" ) <EOL> args = parser . parse... |
<s> from flask . ext . restful import reqparse <EOL> from changes . api . base import APIView <EOL> from changes . lib . coverage import get_coverage_by_build_id , merged_coverage_data , get_coverage_stats <EOL> from changes . models import Build <EOL> from changes . utils . diff_parser import DiffParser <EOL> class Bu... |
<s> from __future__ import absolute_import <EOL> from sqlalchemy . orm import joinedload <EOL> from changes . api . base import APIView <EOL> from changes . api . serializer . models . testcase import TestCaseWithOriginCrumbler <EOL> from changes . constants import Result <EOL> from changes . config import db <EOL> fro... |
<s> from __future__ import absolute_import , division , unicode_literals <EOL> from flask . ext . restful import reqparse <EOL> from changes . api . base import APIView <EOL> from changes . api . serializer import Crumbler <EOL> from changes . config import db <EOL> from changes . constants import Result , Status <EOL>... |
<s> from changes . api . serializer import Crumbler , register <EOL> from changes . models . change import Change <EOL> from changes . utils . http import build_uri <EOL> @ register ( Change ) <EOL> class ChangeCrumbler ( Crumbler ) : <EOL> def crumble ( self , instance , attrs ) : <EOL> result = { <EOL> '<STR_LIT:id>'... |
<s> from __future__ import absolute_import , division , unicode_literals <EOL> from changes . api . base import APIView <EOL> from changes . models import Source <EOL> from changes . lib . coverage import get_coverage_by_source_id , merged_coverage_data <EOL> import logging <EOL> class SourceDetailsAPIView ( APIView ) ... |
<s> from __future__ import absolute_import <EOL> from jinja2 import Markup <EOL> from changes . buildfailures . base import BuildFailure <EOL> class MalformedManifestJson ( BuildFailure ) : <EOL> def get_html_label ( self , build ) : <EOL> return Markup ( '<STR_LIT>' ) </s>
|
<s> from __future__ import absolute_import <EOL> import logging <EOL> from celery import Celery as CeleryApp <EOL> from uuid import uuid4 <EOL> from . container import Container <EOL> class _Celery ( object ) : <EOL> def __init__ ( self , app , options ) : <EOL> celery = CeleryApp ( app . import_name , broker = app . c... |
<s> import re <EOL> import urllib <EOL> from flask import current_app <EOL> from changes . config import db <EOL> from changes . constants import Result , Status <EOL> from changes . db . utils import try_create <EOL> from changes . lib import build_context_lib , build_type <EOL> from changes . lib . coverage import ge... |
<s> from uuid import uuid4 <EOL> from datetime import datetime <EOL> from enum import Enum <EOL> from sqlalchemy import Column , DateTime , ForeignKey , Integer , String <EOL> from sqlalchemy . orm import backref , relationship <EOL> from changes . config import db <EOL> from changes . db . types . enum import Enum as ... |
<s> from __future__ import absolute_import , division <EOL> import os <EOL> from changes . constants import PROJECT_ROOT <EOL> def enforce_is_subdir ( path , root = PROJECT_ROOT ) : <EOL> """<STR_LIT>""" <EOL> if not os . path . abspath ( path ) . startswith ( root ) : <EOL> raise RuntimeError ( '<STR_LIT>' ) </s>
|
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> from alembic import op <EOL> from sqlalchemy . dialects import postgresql <EOL> def upgrade ( ) : <EOL> op . alter_column ( '<STR_LIT>' , '<STR_LIT>' , <EOL> existing_type = postgresql . UUID ( ) , <EOL> nullable = False ) <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> def upgrade ( ) : <EOL> op . add_column ( '<STR_LIT>' , sa . Column ( '<STR_LIT>' , sa . Enum ( ) , nullable = False , server_default = '<STR_LIT:0>' ) ) <EOL> def downgrad... |
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> from alembic import op <EOL> import sqlalchemy as sa <EOL> def upgrade ( ) : <EOL> op . create_table ( <EOL> '<STR_LIT:source>' , <EOL> sa . Column ( '<STR_LIT:id>' , sa . GUID ( ) , nullable = False ) , <EOL> sa . Column ( '<STR_L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.