code stringlengths 9 256k |
|---|
<s> """<STR_LIT>""" <EOL> import string <EOL> import math <EOL> from Misc import misc , parameters_misc <EOL> def generate_pipeline_depths ( parameters = { } ) : <EOL> EXTRA_STAGES = parameters . get ( "<STR_LIT>" , <NUM_LIT:0> ) <EOL> assert EXTRA_STAGES % <NUM_LIT:2> == <NUM_LIT:0> , "<STR_LIT>" . format ( EXTRA_STAG... |
<s> import logging <EOL> from acoustid . handler import Handler <EOL> from acoustid . data . fingerprint import decode_fingerprint <EOL> from acoustid . api import v2 , serialize_response , errors <EOL> logger = logging . getLogger ( __name__ ) <EOL> FORMAT = '<STR_LIT>' <EOL> class APIHandlerParams ( v2 . APIHandlerPa... |
<s> import sqlalchemy . event <EOL> from sqlalchemy import ( <EOL> MetaData , Table , Column , Index , <EOL> ForeignKey , CheckConstraint , <EOL> Integer , String , DateTime , Boolean , Date , Text , SmallInteger , BigInteger , CHAR , <EOL> DDL , event , sql , <EOL> ) <EOL> from sqlalchemy . dialects . postgresql impor... |
<s> import os <EOL> import logging <EOL> from werkzeug . serving import run_simple <EOL> from acoustid . server import make_application <EOL> logging . basicConfig ( level = logging . DEBUG ) <EOL> config_path = os . path . dirname ( os . path . abspath ( __file__ ) ) + '<STR_LIT>' <EOL> application = make_application ... |
<s> from __future__ import print_function <EOL> import os . path <EOL> import sys <EOL> import re <EOL> import warnings <EOL> import cx_Oracle <EOL> from django . db import connection , models <EOL> from django . db . backends . util import truncate_name <EOL> from django . core . management . color import no_style <EO... |
<s> """<STR_LIT>""" <EOL> from permission . conf import settings <EOL> from permission . logics . base import PermissionLogic <EOL> class GroupInPermissionLogic ( PermissionLogic ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , <EOL> group_names , <EOL> any_permission = None , <EOL> add_permission = None , <EOL> c... |
<s> from django . test import TestCase <EOL> from permission . utils . field_lookup import field_lookup <EOL> from permission . tests . utils import create_user <EOL> from permission . tests . utils import create_bridge <EOL> from permission . tests . utils import create_article <EOL> class PermissionUtilsFieldLookupTe... |
<s> from django . conf import settings <EOL> def setting ( suffix , default ) : <EOL> @ property <EOL> def fn ( self ) : <EOL> return getattr ( settings , '<STR_LIT>' % suffix , default ) <EOL> return fn <EOL> class AppSettings ( object ) : <EOL> DEFAULT_ENDPOINT_URL = '<STR_LIT>' <EOL> DEFAULT_BACKEND = '<STR_LIT>' if... |
<s> import unittest <EOL> import getpass <EOL> import tempfile <EOL> import os . path <EOL> import mock <EOL> from shellpython import preprocessor <EOL> class TestCodeStart ( unittest . TestCase ) : <EOL> def test_simple ( self ) : <EOL> cmd = '<STR_LIT>' <EOL> intermediate = preprocessor . _process_code_start ( cmd ) ... |
<s> AWS_SECRET_ACCESS_KEY = '<STR_LIT>' </s>
|
<s> import ure <EOL> import bh_plugin <EOL> from bh_logging import debug , log <EOL> def exclude_bracket ( enabled , filter_type , language_list , language ) : <EOL> """<STR_LIT>""" <EOL> exclude = True <EOL> if enabled : <EOL> if filter_type == '<STR_LIT>' : <EOL> exclude = False <EOL> if language is not None : <EOL> ... |
<s> import sublime , sublime_plugin <EOL> import os . path <EOL> class SaveOnFocusLost ( sublime_plugin . EventListener ) : <EOL> def on_deactivated ( self , view ) : <EOL> if ( view . file_name ( ) and view . is_dirty ( ) and <EOL> view . settings ( ) . get ( '<STR_LIT>' ) == True and <EOL> os . path . exists ( view .... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> if sys . version_info [ <NUM_LIT:0> ] < <NUM_LIT:3> : <EOL> PY3 = False <EOL> def b ( s ) : <EOL> return s <EOL> def u ( s ) : <EOL> return unicode ( s , '<STR_LIT>' ) <EOL> import cStringIO as StringIO <EOL> StringIO = BytesIO = StringIO . StringIO <EOL> text_type = unicode <... |
<s> import os , json <EOL> def get_rc_paths ( cwd ) : <EOL> result = [ ] <EOL> subs = cwd . split ( os . sep ) <EOL> fullPath = "<STR_LIT>" <EOL> for value in subs : <EOL> fullPath += value + os . sep <EOL> result . append ( fullPath + '<STR_LIT>' ) <EOL> return result <EOL> def filter_existing_files ( paths ) : <EOL> ... |
<s> '''<STR_LIT>''' <EOL> '''<STR_LIT>''' <EOL> import os <EOL> import hashlib <EOL> import pickle <EOL> _index = { } <EOL> _roots = [ ] <EOL> def reset ( ) : <EOL> global _index <EOL> global _roots <EOL> _index = { } <EOL> _roots = [ ] <EOL> def get_intel_folder ( root ) : <EOL> '''<STR_LIT>''' <EOL> folder = os . pat... |
<s> import threading <EOL> import os <EOL> import sublime <EOL> import sublime_plugin <EOL> from . . show_error import show_error <EOL> from . . package_manager import PackageManager <EOL> from . existing_packages_command import ExistingPackagesCommand <EOL> class ListPackagesCommand ( sublime_plugin . WindowCommand ) ... |
<s> from ctypes import windll , wintypes <EOL> import ctypes <EOL> import time <EOL> import re <EOL> import datetime <EOL> import struct <EOL> import locale <EOL> wininet = windll . wininet <EOL> try : <EOL> from urllib . parse import urlparse <EOL> except ( ImportError ) : <EOL> from urlparse import urlparse <EOL> fro... |
<s> import re <EOL> from . . clients . github_client import GitHubClient <EOL> from . . downloaders . downloader_exception import DownloaderException <EOL> from . . clients . client_exception import ClientException <EOL> from . provider_exception import ProviderException <EOL> class GitHubRepositoryProvider ( ) : <EOL>... |
<s> import re <EOL> import sublime , sublime_plugin <EOL> from vintage import transform_selection <EOL> from vintage import transform_selection_regions <EOL> class ViSpanCountLines ( sublime_plugin . TextCommand ) : <EOL> def run ( self , edit , repeat = <NUM_LIT:1> ) : <EOL> for i in xrange ( repeat - <NUM_LIT:1> ) : ... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> import sys <EOL> import os . path <EOL> import re <EOL> from gensim . corpora import sources , dmlcorpus <EOL> PREFIX = '<STR_LIT>' <EOL> AT_HOME = False <EOL> if AT_HOME : <EOL> SOURCE_LIST = [ <EOL> sources . DmlCzSource ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> sources . Dm... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> import sys <EOL> import itertools <EOL> import os <EOL> import math <EOL> from time import time <EOL> import numpy <EOL> import scipy . sparse <EOL> import gensim <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> logging . basicConfig ( format = '<STR_LIT>' , level = loggi... |
<s> from sklearn . datasets import make_moons <EOL> import numpy as np <EOL> from data_helper import pad_targets <EOL> def _download ( ) : <EOL> train_x , train_t = make_moons ( n_samples = <NUM_LIT> , shuffle = True , noise = <NUM_LIT> , random_state = <NUM_LIT> ) <EOL> test_x , test_t = make_moons ( n_samples = <NUM_... |
<s> from functools import partial <EOL> from warnings import warn <EOL> import numpy as np <EOL> from sklearn . externals import six <EOL> from . _utils import check_random_state <EOL> def bio_f_score ( y_true , y_pred ) : <EOL> """<STR_LIT>""" <EOL> if len ( y_true ) != len ( y_pred ) : <EOL> msg = "<STR_LIT>" "<STR_L... |
<s> """<STR_LIT>""" <EOL> from flask import request , flash , redirect , url_for , _request_ctx_stack <EOL> from functools import wraps <EOL> import logging <EOL> from pyactiveresource . connection import UnauthorizedAccess <EOL> import shopify_api <EOL> def shopify_login_required ( func ) : <EOL> """<STR_LIT>""" <EOL>... |
<s> import numpy <EOL> import theano <EOL> from theano import tensor <EOL> from dl_tutorials . utils . softmax import softmax <EOL> from blocks . utils import shared_floatx_zeros <EOL> floatX = theano . config . floatX <EOL> class NeuralSoftmax ( object ) : <EOL> def __init__ ( self , input_dim , n_hidden , n_classes )... |
<s> from . backend import SMTPBackend </s>
|
<s> from __future__ import unicode_literals <EOL> import emails <EOL> import emails . message <EOL> from emails . django import DjangoMessage <EOL> def test_django_message_proxy ( django_email_backend ) : <EOL> """<STR_LIT>""" <EOL> message_params = { '<STR_LIT:html>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <... |
<s> """<STR_LIT>""" <EOL> from bisect import bisect_right <EOL> class Token ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dst_line = <NUM_LIT:0> , dst_col = <NUM_LIT:0> , src = '<STR_LIT>' , src_line = <NUM_LIT:0> , src_col = <NUM_LIT:0> , name = None ) : <EOL> self . dst_line = dst_line <EOL> self . d... |
<s> from zope . interface import implements <EOL> from lbrynet . interfaces import IRateLimiter <EOL> from twisted . internet import task <EOL> class DummyRateLimiter ( object ) : <EOL> def __init__ ( self ) : <EOL> self . dl_bytes_this_second = <NUM_LIT:0> <EOL> self . ul_bytes_this_second = <NUM_LIT:0> <EOL> self . t... |
<s> import sqlite3 <EOL> import unqlite <EOL> import leveldb <EOL> import shutil <EOL> import os <EOL> import logging <EOL> import json <EOL> log = logging . getLogger ( __name__ ) <EOL> known_dbs = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <... |
<s> from lbrynet . core . StreamDescriptor import BlobStreamDescriptorWriter <EOL> from lbrynet . lbrylive . StreamDescriptor import get_sd_info <EOL> from lbrynet . cryptstream . CryptStreamCreator import CryptStreamCreator <EOL> from lbrynet . lbrylive . LiveBlob import LiveStreamBlobMaker <EOL> from lbrynet . core .... |
<s> import rumps <EOL> import xmlrpclib <EOL> import os <EOL> import webbrowser <EOL> import subprocess <EOL> import argparse <EOL> class DaemonStatusBarApp ( rumps . App ) : <EOL> def __init__ ( self ) : <EOL> icon_path = '<STR_LIT>' <EOL> if os . path . isfile ( icon_path ) : <EOL> rumps . App . __init__ ( self , nam... |
<s> import hashlib <EOL> import unittest <EOL> import lbrynet . dht . constants <EOL> import lbrynet . dht . routingtable <EOL> import lbrynet . dht . contact <EOL> class FakeRPCProtocol ( object ) : <EOL> """<STR_LIT>""" <EOL> def sendRPC ( self , * args , ** kwargs ) : <EOL> return FakeDeferred ( ) <EOL> class FakeDe... |
<s> import unittest <EOL> from lxml import etree <EOL> from nose . tools import eq_ <EOL> import scio <EOL> from scio import gen <EOL> import helpers <EOL> class StubClient ( scio . Client ) : <EOL> sent = [ ] <EOL> def send ( self , method , request ) : <EOL> self . sent . append ( ( method , request ) ) <EOL> class T... |
<s> import os <EOL> import click <EOL> from textkit . utils import output , read_tokens , data_item <EOL> def get_stopwords ( stopword_name ) : <EOL> path = data_item ( '<STR_LIT>' + stopword_name + '<STR_LIT>' ) <EOL> stopwords = [ ] <EOL> with open ( path ) as filename : <EOL> stopwords = read_tokens ( filename ) <EO... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import pycuda . autoinit <EOL> import pycuda . driver as drv <EOL> import numpy as np <EOL> import pycuda . gpuarray as gpuarray <EOL> import skcuda . linalg as culinalg <EOL> import skcuda . misc as cumisc <EOL> culinalg . init ( ) <EOL> import stri... |
<s> """<STR_LIT>""" <EOL> from unittest import main , makeSuite , TestCase , TestSuite <EOL> import pycuda . autoinit <EOL> import pycuda . gpuarray as gpuarray <EOL> import numpy as np <EOL> _SEPS = np . finfo ( np . float32 ) . eps <EOL> _DEPS = np . finfo ( np . float64 ) . eps <EOL> import skcuda . cublas as cublas... |
<s> """<STR_LIT>""" <EOL> from kestrel . plugins . kestrel_manager . manager import kestrel_manager <EOL> from kestrel . plugins . kestrel_manager . commands import * </s>
|
<s> """<STR_LIT>""" <EOL> import os <EOL> print __file__ <EOL> print os . path . dirname ( __file__ ) <EOL> print os . path . dirname ( os . path . dirname ( __file__ ) ) <EOL> BASE_DIR = os . path . dirname ( os . path . dirname ( __file__ ) ) <EOL> TEMPLATE_PATH = os . path . join ( BASE_DIR , '<STR_LIT>' ) <EOL> STA... |
<s> import os <EOL> import json <EOL> from lektor . uilink import UI_LANG <EOL> translations_path = os . path . join ( os . path . abspath ( os . path . dirname ( __file__ ) ) , <EOL> '<STR_LIT>' ) <EOL> KNOWN_LANGUAGES = list ( x [ : - <NUM_LIT:5> ] for x in os . listdir ( translations_path ) <EOL> if x . endswith ( '... |
<s> from flask import Blueprint , render_template , abort , redirect , request , g , url_for <EOL> from lektor . admin . utils import fs_path_to_url_path <EOL> from lektor . environment import PRIMARY_ALT <EOL> from werkzeug . wsgi import extract_path_info <EOL> bp = Blueprint ( '<STR_LIT>' , __name__ , url_prefix = '<... |
<s> from lektor . types import Type <EOL> from lektor . markdown import Markdown <EOL> class MarkdownDescriptor ( object ) : <EOL> def __init__ ( self , source ) : <EOL> self . source = source <EOL> def __get__ ( self , obj , type = None ) : <EOL> if obj is None : <EOL> return self <EOL> return Markdown ( self . source... |
<s> import unittest <EOL> import sys <EOL> import os <EOL> import argparse <EOL> import shutil <EOL> sys . path . append ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ) <EOL> from lemonsync . LemonSync import * <EOL> class TestUpload ( unittest . TestCase ) : <EOL> directory = '<STR_LIT>' <EOL> ... |
<s> '''<STR_LIT>''' <EOL> def enabled ( ) : <EOL> '''<STR_LIT>''' <EOL> return True <EOL> def applicable_types ( ) : <EOL> '''<STR_LIT>''' <EOL> return [ '<STR_LIT:text>' ] <EOL> def commands ( ) : <EOL> '''<STR_LIT>''' <EOL> return [ '<STR_LIT>' ] <EOL> def should_reply ( ) : <EOL> '''<STR_LIT>''' <EOL> return True <E... |
<s> from flask import Flask , redirect , url_for , session , request , jsonify <EOL> from flask_oauthlib . client import OAuth <EOL> app = Flask ( __name__ ) <EOL> app . debug = True <EOL> app . secret_key = '<STR_LIT>' <EOL> oauth = OAuth ( app ) <EOL> linkedin = oauth . remote_app ( <EOL> '<STR_LIT>' , <EOL> consumer... |
<s> import json <EOL> import base64 <EOL> from flask import Flask <EOL> from mock import MagicMock <EOL> from . server import ( <EOL> create_server , <EOL> db , <EOL> cache_provider , <EOL> sqlalchemy_provider , <EOL> default_provider , <EOL> Token <EOL> ) <EOL> from . client import create_client <EOL> from . . _base i... |
<s> from flask import Flask , render_template , redirect <EOL> from flask_turbolinks import turbolinks <EOL> app = Flask ( __name__ ) <EOL> app . secret_key = '<STR_LIT>' <EOL> turbolinks ( app ) <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def home ( ) : <EOL> return render_template ( '<STR_LIT>' ) <EOL> @ app . route ... |
<s> import sys , os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( '<STR_LIT:..>' ) ) <EOL> sys . path . append ( os . path . abspath ( '<STR_LIT>' ) ) <EOL> extensions = [ '<STR_LIT>' ] <EOL> templates_path = [ '<STR_LIT>' ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EOL> ... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> import copy <EOL> class Logger ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , ** kwargs ) : <EOL> self . _indent = <NUM_LIT:0> <EOL> self . _is_verbose = False <EOL> self . _enable_verbose = False <EOL> self . _enable_quiet = False <EOL> self . warn_count = <NU... |
<s> """<STR_LIT>""" <EOL> import UserDict <EOL> import redis_ds . redis_config as redis_config <EOL> from redis_ds . serialization import PassThroughSerializer , PickleSerializer , JSONSerializer <EOL> class RedisDict ( UserDict . DictMixin , PassThroughSerializer ) : <EOL> "<STR_LIT>" <EOL> def __init__ ( self , redis... |
<s> import re <EOL> from lifeflow . markdown import markdown <EOL> from pygments import highlight <EOL> from pygments . formatters import HtmlFormatter <EOL> from pygments . lexers import get_lexer_by_name <EOL> class CodeExtension ( markdown . Extension ) : <EOL> def __name__ ( self ) : <EOL> return u"<STR_LIT:code>" ... |
<s> import os <EOL> import errno <EOL> import urlparse <EOL> import itertools <EOL> from datetime import datetime <EOL> from airy . core . conf import settings <EOL> from airy . core . exceptions import ImproperlyConfigured , SuspiciousOperation <EOL> from airy . core . files import locks , File <EOL> from airy . core ... |
<s> """<STR_LIT>""" <EOL> import datetime <EOL> from itertools import chain <EOL> import time <EOL> from urlparse import urljoin <EOL> from util import flatatt <EOL> import airy . utils . copycompat as copy <EOL> from airy . core . conf import settings <EOL> from airy . utils . datastructures import MultiValueDict , Me... |
<s> """<STR_LIT>""" <EOL> import re <EOL> import sys <EOL> import struct <EOL> from airy . utils . simplejson . scanner import make_scanner <EOL> c_scanstring = None <EOL> __all__ = [ '<STR_LIT>' ] <EOL> FLAGS = re . VERBOSE | re . MULTILINE | re . DOTALL <EOL> def _floatconstants ( ) : <EOL> _BYTES = '<STR_LIT>' . dec... |
<s> """<STR_LIT>""" <EOL> import itertools <EOL> import socket <EOL> import threading <EOL> import time <EOL> import unittest <EOL> import six <EOL> from six . moves import socketserver <EOL> from acme import errors <EOL> from acme import jose <EOL> from acme import test_util <EOL> class SSLSocketAndProbeSNITest ( unit... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import pkg_resources <EOL> from cryptography . hazmat . backends import default_backend <EOL> from cryptography . hazmat . primitives import serialization <EOL> import OpenSSL <EOL> from acme import jose <EOL> def vector_path ( * names ) : <EOL> """<STR_LIT>""" <EOL> return pkg... |
<s> """<STR_LIT>""" </s>
|
<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' </s>
|
<s> """<STR_LIT>""" <EOL> import unittest <EOL> import mock <EOL> import pkg_resources <EOL> import zope . interface <EOL> from certbot import errors <EOL> from certbot import interfaces <EOL> from certbot . plugins import standalone <EOL> from certbot . plugins import webroot <EOL> EP_SA = pkg_resources . EntryPoint (... |
<s> import sys <EOL> import os <EOL> import shlex <EOL> here = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( os . path . join ( here , '<STR_LIT:..>' ) ) ) <EOL> needs_sphinx = '<STR_LIT:1.0>' <EOL> extensions = [ <EOL> '<STR_LIT>' , <EOL> '<STR... |
<s> """<STR_LIT>""" <EOL> revision = '<STR_LIT>' <EOL> down_revision = None <EOL> from alembic import op <EOL> import sqlalchemy as sa <EOL> from sqlalchemy . dialects import postgresql <EOL> def upgrade ( ) : <EOL> op . drop_table ( '<STR_LIT>' ) <EOL> op . add_column ( '<STR_LIT>' , sa . Column ( '<STR_LIT>' , sa . I... |
<s> from bisect import bisect , insort <EOL> try : <EOL> True <EOL> except : <EOL> True = <NUM_LIT:1> <EOL> False = <NUM_LIT:0> <EOL> bool = lambda x : not not x <EOL> hexbinmap = { <EOL> '<STR_LIT:0>' : '<STR_LIT>' , <EOL> '<STR_LIT:1>' : '<STR_LIT>' , <EOL> '<STR_LIT:2>' : '<STR_LIT>' , <EOL> '<STR_LIT:3>' : '<STR_LI... |
<s> from __future__ import absolute_import , division , print_function , unicode_literals <EOL> from liberapay . elsewhere . _base import PlatformOAuth2 <EOL> from liberapay . elsewhere . _extractors import key <EOL> from liberapay . elsewhere . _paginators import keys_paginator <EOL> class Facebook ( PlatformOAuth2 ) ... |
<s> from __future__ import unicode_literals <EOL> from aspen . simplates . pagination import parse_specline , split_and_escape <EOL> from aspen_jinja2_renderer import SimplateLoader <EOL> from jinja2 import Environment <EOL> from liberapay . constants import JINJA_ENV_COMMON <EOL> ( VERIFICATION_MISSING <EOL> , VERIFIC... |
<s> from __future__ import unicode_literals <EOL> import json <EOL> from liberapay . testing import Harness <EOL> class TestSearch ( Harness ) : <EOL> def test_get_non_existent_user ( self ) : <EOL> response = self . client . GET ( '<STR_LIT>' ) <EOL> data = json . loads ( response . body ) [ '<STR_LIT>' ] <EOL> assert... |
<s> from setuptools import setup , find_packages <EOL> setup ( <EOL> name = "<STR_LIT>" , <EOL> version = "<STR_LIT>" , <EOL> description = "<STR_LIT>" , <EOL> author = "<STR_LIT>" , <EOL> url = "<STR_LIT>" , <EOL> packages = find_packages ( ) , <EOL> ) </s>
|
<s> import AutoCopyright . constants <EOL> import sublime <EOL> def error_message ( message ) : <EOL> """<STR_LIT>""" <EOL> text = AutoCopyright . constants . PLUGIN_NAME + '<STR_LIT>' + message <EOL> sublime . error_message ( text ) </s>
|
<s> import requests <EOL> from . session import Session <EOL> from . visualization import Visualization , VisualizationLocal <EOL> class Lightning ( object ) : <EOL> def __init__ ( self , host = "<STR_LIT>" , local = False , ipython = False , auth = None , size = '<STR_LIT>' , quiet = False ) : <EOL> self . quiet = qui... |
<s> from __future__ import with_statement <EOL> from __future__ import division <EOL> from __future__ import absolute_import <EOL> def test_assert ( ) : <EOL> a = <NUM_LIT:1> <EOL> b = <NUM_LIT:1> <EOL> assert a == b </s>
|
<s> from __future__ import absolute_import <EOL> import os <EOL> import shutil <EOL> import subprocess as sub <EOL> from functools import partial <EOL> from . _compat import reraise , u <EOL> class Function ( object ) : <EOL> name = '<STR_LIT>' <EOL> def __init__ ( self , build , log = None , verbose = True , message =... |
<s> import time , sys <EOL> sys . path . insert ( <NUM_LIT:0> , '<STR_LIT>' ) <EOL> from uliweb . orm import * <EOL> import uliweb <EOL> import uliweb . orm <EOL> uliweb . orm . __auto_create__ = True <EOL> uliweb . orm . __nullable__ = True <EOL> uliweb . orm . __server_default__ = False <EOL> import mock <EOL> from u... |
<s> from uliweb . core . SimpleFrame import functions <EOL> from uliweb . i18n import ugettext_lazy as _ <EOL> import urllib <EOL> def add_prefix ( url ) : <EOL> from uliweb import settings <EOL> return settings . DOMAINS . static . get ( '<STR_LIT>' , '<STR_LIT>' ) + url <EOL> def login ( ) : <EOL> from uliweb . contr... |
<s> def get_model_tables ( tables , appname ) : <EOL> t = [ ] <EOL> for tablename , m in tables . iteritems ( ) : <EOL> if hasattr ( m , '<STR_LIT>' ) and m . __appname__ == appname : <EOL> t . append ( tablename ) <EOL> return t <EOL> def safe_str ( s , encoding = '<STR_LIT:utf-8>' ) : <EOL> if isinstance ( s , unicod... |
<s> import os <EOL> from werkzeug . wsgi import SharedDataMiddleware <EOL> from uliweb import settings <EOL> from uliweb . utils . filedown import filedown <EOL> class StaticFilesMiddleware ( SharedDataMiddleware ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , app , STATIC_URL , disallow = None , cache = True , <... |
<s> def make_select_languages ( languages ) : <EOL> from uliweb . i18n import get_language , format_locale <EOL> from uliweb . contrib . i18n import LANGUAGES <EOL> lang = get_language ( ) <EOL> s = [ ] <EOL> s . append ( '''<STR_LIT>''' ) <EOL> s . append ( '''<STR_LIT>''' ) <EOL> for k in languages : <EOL> k = format... |
<s> import cPickle <EOL> from backends . base import KeyError <EOL> import json <EOL> __modules__ = { } <EOL> def wrap_func ( des , src ) : <EOL> des . __name__ = src . __name__ <EOL> des . func_globals . update ( src . func_globals ) <EOL> des . __doc__ = src . __doc__ <EOL> des . __module__ = src . __module__ <EOL> d... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import time <EOL> import errno <EOL> class TimeoutExpired ( Exception ) : <EOL> pass <EOL> def pid_exists ( pid ) : <EOL> """<STR_LIT>""" <EOL> if pid < <NUM_LIT:0> : <EOL> return False <EOL> try : <EOL> os . kill ( pid , <NUM_LIT:0> ) <EOL> except OSError as e : <EOL> return e... |
<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> import sys <EOL> from django . conf import settings <EOL> SETTINGS = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT:default>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> } , <EOL> '<STR_LIT>' : [ <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LI... |
<s> from datetime import datetime <EOL> import os <EOL> import whisper <EOL> from django . conf import settings <EOL> class WhisperDatabase ( object ) : <EOL> def __init__ ( self , name ) : <EOL> self . name = name <EOL> self . path = self . get_db_path ( name ) <EOL> if not os . path . exists ( self . path ) : <EOL> s... |
<s> from django . conf . urls import patterns , url , include <EOL> from django . contrib import admin <EOL> from salmon . metrics import views as metrics_views <EOL> admin . autodiscover ( ) <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> ( r'<STR_LIT>' , include ( admin . site . urls ) ) , <EOL> url ( r'<STR_LIT>'... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from datetime import datetime <EOL> from flask_login import current_user <EOL> class DBAdapter ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , db , UserClass , UserAuthClass = None , UserEmailClass = None , UserProfileClass = None , Us... |
<s> import os <EOL> test = { <EOL> "<STR_LIT>" : os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) ) , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : [ <EOL> os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) ) , "<STR_LIT>" ) ] , <EOL> "<STR_LIT>" : os . path . join ( os . path . di... |
<s> __test__ = False <EOL> def test0 ( ) : <EOL> assert <NUM_LIT:0> == <NUM_LIT:0> <EOL> def validate0 ( ) : <EOL> assert <NUM_LIT:0> == <NUM_LIT:0> <EOL> def test1 ( ) : <EOL> assert <NUM_LIT:1> == <NUM_LIT:1> <EOL> def validate1 ( ) : <EOL> assert <NUM_LIT:1> == <NUM_LIT:1> </s>
|
<s> class Config ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name , mapping ) : <EOL> """<STR_LIT>""" <EOL> self . name = name <EOL> self . mapping = mapping <EOL> self . result = None <EOL> self . start_time = None <EOL> self . end_time = None <EOL> self . naarad_id = None <EOL> self . message = "<S... |
<s> import json <EOL> import os <EOL> import re <EOL> import urllib2 <EOL> from linkedin . mobster . har . visualization . html import generate_html_dir <EOL> from linkedin . mobster . har . visualization . js import generate_js_dir <EOL> TEMPLATE_NAME = '<STR_LIT>' <EOL> def get_script_contents ( script_name ) : <EOL>... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> import shlex <EOL> import subprocess <EOL> import time <EOL> from threading import Timer <EOL> from naarad . run_steps . run_step import Run_Step <EOL> import naarad . naarad_constants as CONSTANTS <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> class Local_Cmd ( ... |
<s> """<STR_LIT>""" </s>
|
<s> import httplib <EOL> import json <EOL> import time <EOL> import yaml <EOL> import os <EOL> import subprocess <EOL> SIMOORG_COMMAND = "<STR_LIT>" <EOL> API_PORT = <NUM_LIT> <EOL> TEST_CONFIG_DIR = '<STR_LIT>' <EOL> TEST_FATEBOOK = '<STR_LIT>' <EOL> SCRIPT_DIR = os . path . dirname ( os . path . realpath ( __file__ )... |
<s> from south . db import db <EOL> from south . v2 import SchemaMigration <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 = True ) ) , <EOL> ( '<STR_LIT:name>' , self . gf ( '<STR_... |
<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 . execute ( "<STR_LIT>" ) <EOL> db . delete_column ( '<STR_LIT>' , '<STR_LIT:body>' ) <EOL> db . ... |
<s> 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>' , models . AutoField ( verbose_name = '<STR_LIT>' , primary_key... |
<s> import pytest <EOL> import rethinkdb as r <EOL> from remodel . errors import OperationError <EOL> from remodel . helpers import create_tables , create_indexes <EOL> from remodel . models import Model , before_save , after_save , before_delete , after_delete , after_init <EOL> from remodel . object_handler import Ob... |
<s> import json <EOL> from django . db import models , connections <EOL> from . . fields import VectorField <EOL> from . . models import SearchManager <EOL> class Person ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:32> ) <EOL> description = models . TextField ( ) <EOL> search_index = Vec... |
<s> import base64 <EOL> import random <EOL> try : <EOL> from django . db . backends . base . creation import BaseDatabaseCreation <EOL> except ImportError : <EOL> from django . db . backends . creation import BaseDatabaseCreation <EOL> from django_pyodbc . compat import b , md5_constructor <EOL> class DataTypesWrapper ... |
<s> from django . conf import settings <EOL> from django . core . files import storage as django_storage <EOL> from storages . backends import s3boto <EOL> STORAGE_BUCKET_NAME = getattr ( settings , '<STR_LIT>' , getattr ( settings , '<STR_LIT>' , None ) ) <EOL> STATIC_URL = getattr ( settings , '<STR_LIT>' , getattr (... |
<s> from __future__ import absolute_import <EOL> from google . appengine . ext import ndb <EOL> from flask . ext import restful <EOL> import flask <EOL> from api import helpers <EOL> import auth <EOL> import model <EOL> import util <EOL> from main import api_v1 <EOL> @ api_v1 . resource ( '<STR_LIT>' , endpoint = '<STR... |
<s> from datetime import datetime <EOL> import argparse <EOL> import json <EOL> import os <EOL> import shutil <EOL> import sys <EOL> import time <EOL> from main import config <EOL> parser = argparse . ArgumentParser ( ) <EOL> parser . add_argument ( <EOL> '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , action = '<STR_... |
<s> from flask . ext import wtf <EOL> from flask . ext . babel import gettext as __ <EOL> from flask . ext . babel import lazy_gettext as _ <EOL> import flask <EOL> import wtforms <EOL> import auth <EOL> import config <EOL> import i18n <EOL> import task <EOL> import util <EOL> from main import app <EOL> class FeedbackF... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import os <EOL> import sys <EOL> import timeit <EOL> import numpy <EOL> import theano <EOL> import theano . tensor as T <EOL> from theano . tensor . shared_randomstreams import RandomStreams <EOL> from logistic_sgd import load_data <EOL> from utils i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.