code stringlengths 9 256k |
|---|
<s> """<STR_LIT>""" <EOL> __version__ = "<STR_LIT>" <EOL> __svnid__ = "<STR_LIT>" <EOL> __license__ = "<STR_LIT>" <EOL> __author__ = "<STR_LIT>" <EOL> __contributors__ = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<... |
<s> """<STR_LIT>""" <EOL> import itertools <EOL> import random <EOL> from django . conf import settings <EOL> from . pinning import this_thread_is_pinned , db_write <EOL> DEFAULT_DB_ALIAS = '<STR_LIT:default>' <EOL> if getattr ( settings , '<STR_LIT>' ) : <EOL> dbs = list ( settings . SLAVE_DATABASES ) <EOL> random . s... |
<s> try : <EOL> from setuptools import setup <EOL> except ImportError : <EOL> from ez_setup import use_setuptools <EOL> use_setuptools ( ) <EOL> from setuptools import setup <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author... |
<s> from django . core . exceptions import ImproperlyConfigured <EOL> from django . forms import ModelForm <EOL> from django . forms . models import model_to_dict <EOL> class Validation ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , ** kwargs ) : <EOL> pass <EOL> def is_valid ( self , bundle , request =... |
<s> import time <EOL> from django . core . cache import cache <EOL> from django . test import TestCase <EOL> from tastypie . cache import NoCache , SimpleCache <EOL> class NoCacheTestCase ( TestCase ) : <EOL> def tearDown ( self ) : <EOL> cache . delete ( '<STR_LIT:foo>' ) <EOL> cache . delete ( '<STR_LIT>' ) <EOL> sup... |
<s> from django . contrib . auth . models import User <EOL> from tastypie import fields <EOL> from tastypie . resources import ModelResource , NamespacedModelResource <EOL> from tastypie . authorization import Authorization <EOL> from basic . models import Note <EOL> class NamespacedUserResource ( NamespacedModelResour... |
<s> from tastypie . authentication import BasicAuthentication <EOL> class AuthenticationByMethod ( BasicAuthentication ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> '''<STR_LIT>''' <EOL> self . allowed_methods = list ( args ) <EOL> super ( AuthenticationByMethod , self ) . __init__ ... |
<s> import sys , os <EOL> extensions = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <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> exclu... |
<s> import logging <EOL> from datetime import datetime <EOL> from django . conf import settings <EOL> from django . http import Http404 <EOL> from django . shortcuts import render , get_object_or_404 <EOL> from statsd import statsd <EOL> from kitsune . community import api <EOL> from kitsune . community . utils import ... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import kitsune . sumo . models <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterField ( <EOL> model_name... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import datetime <EOL> import kitsune . search . models <EOL> import django . db . models . deletion <EOL> from django . conf import settings <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL>... |
<s> from django . core . exceptions import PermissionDenied <EOL> from django . core . files import File <EOL> from nose . tools import raises <EOL> from kitsune . gallery . models import Image , Video <EOL> from kitsune . gallery . tests import ImageFactory , VideoFactory <EOL> from kitsune . gallery . utils import ch... |
<s> from django . contrib import admin <EOL> from kitsune . karma . models import Title <EOL> class TitleAdmin ( admin . ModelAdmin ) : <EOL> raw_id_fields = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> exclude = ( '<STR_LIT>' , ) <EOL> def queryset ( self , request ) : <EOL> qs = super ( TitleAdmin , self ) . queryset ( reques... |
<s> from django . conf . urls import patterns , url <EOL> from django . contrib . contenttypes . models import ContentType <EOL> from kitsune . kbforums . feeds import ThreadsFeed , PostsFeed <EOL> from kitsune . kbforums . models import Post <EOL> from kitsune . flagit import views as flagit_views <EOL> urlpatterns = ... |
<s> from django import forms <EOL> from django . utils . translation import ugettext_lazy as _lazy <EOL> from kitsune . sumo . form_fields import MultiUsernameField <EOL> TO_PLACEHOLDER = _lazy ( u'<STR_LIT>' ) <EOL> class MessageForm ( forms . Form ) : <EOL> """<STR_LIT>""" <EOL> to = MultiUsernameField ( <EOL> label ... |
<s> from django . contrib import admin <EOL> from kitsune . postcrash . models import Signature <EOL> class SignatureAdmin ( admin . ModelAdmin ) : <EOL> list_display = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> list_editable = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> raw_id_fields = [ '<STR_LIT>' ] <EOL> admin . sit... |
<s> from django . contrib . syndication . views import Feed <EOL> from django . shortcuts import get_object_or_404 <EOL> from django . utils . feedgenerator import Atom1Feed <EOL> from django . utils . html import strip_tags , escape <EOL> from django . utils . translation import ugettext as _ <EOL> from taggit . model... |
<s> from nose . tools import eq_ <EOL> from kitsune . questions . models import Question , Answer <EOL> from kitsune . questions . tests import QuestionFactory , AnswerFactory <EOL> from kitsune . questions . utils import ( <EOL> num_questions , num_answers , num_solutions , mark_content_as_spam ) <EOL> from kitsune . ... |
<s> import json <EOL> import time <EOL> from nose . tools import eq_ <EOL> from rest_framework . test import APIClient <EOL> from django . conf import settings <EOL> from kitsune . search . tests . test_es import ElasticTestCase <EOL> from kitsune . sumo . urlresolvers import reverse <EOL> from kitsune . questions . te... |
<s> import logging <EOL> from datetime import timedelta <EOL> from functools import wraps <EOL> from django . conf import settings <EOL> import httplib2 <EOL> from apiclient . discovery import build <EOL> from apiclient . errors import HttpError <EOL> from oauth2client . client import SignedJwtAssertionCredentials <EOL... |
<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> migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , ... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import kitsune . sumo . models <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterField ( <EOL> model_name... |
<s> from django . utils . translation import ugettext_lazy as _lazy <EOL> TEMPLATE_TITLE_PREFIX = '<STR_LIT>' <EOL> DOCUMENTS_PER_PAGE = <NUM_LIT:100> <EOL> COLLAPSIBLE_DOCUMENTS = { <EOL> u'<STR_LIT>' : [ <EOL> u'<STR_LIT>' , <EOL> u'<STR_LIT>' , <EOL> u'<STR_LIT>' , <EOL> u'<STR_LIT>' , <EOL> u'<STR_LIT>' , <EOL> u'<... |
<s> from datetime import datetime , timedelta <EOL> from nose . tools import eq_ <EOL> from kitsune . products . tests import ProductFactory , TopicFactory <EOL> from kitsune . search . tests . test_es import ElasticTestCase <EOL> from kitsune . wiki . tests import ( <EOL> DocumentFactory , RevisionFactory , HelpfulVot... |
<s> import logging <EOL> import sys <EOL> import textwrap <EOL> import xmlrpclib <EOL> USAGE = '<STR_LIT>' <EOL> HEADER = '<STR_LIT>' <EOL> cache = { } <EOL> log = logging . getLogger ( __name__ ) <EOL> BZ_URL = '<STR_LIT>' <EOL> SESSION_COOKIES_CACHE_KEY = '<STR_LIT>' <EOL> BZ_RESOLUTIONS = [ '<STR_LIT>' , '<STR_LIT>'... |
<s> from selenium . webdriver . common . by import By <EOL> from selenium . webdriver . support . ui import WebDriverWait <EOL> from pages . mobile . base import Base <EOL> class Article ( Base ) : <EOL> _helpful_button_locator = ( By . NAME , '<STR_LIT>' ) <EOL> _helpful_header_text_locator = ( By . CSS_SELECTOR , '<S... |
<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>' , self . gf ( '<STR_LIT>' ) ( default = <NUM_LIT:0> ) , ... |
<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>' , <EOL> self . gf ( '<STR_LIT>' ) ( default = '<STR_LIT>... |
<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 . delete_unique ( '<STR_LIT>' , [ '<STR_LIT:name>' ] ) <EOL> def backwards ( self , orm ) : <EOL>... |
<s> """<STR_LIT>""" <EOL> from ... import model <EOL> from . . lists import finder <EOL> class ManageFinder ( finder . Finder ) : <EOL> template_base = "<STR_LIT>" <EOL> columns = [ <EOL> finder . Column ( <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> model . Product . objects . order_by ( "<STR_LIT:name>" ) , <EOL> "<... |
<s> """<STR_LIT>""" <EOL> import json <EOL> from django . core . exceptions import ValidationError , ObjectDoesNotExist <EOL> import floppyforms . __future__ as forms <EOL> from ... import model <EOL> class EnvironmentSelectionForm ( forms . Form ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ... |
<s> import time <EOL> import urllib <EOL> from datetime import datetime <EOL> from mock import patch <EOL> from django . utils import unittest <EOL> from tests . case . api import ApiTestCase <EOL> import logging <EOL> mozlogger = logging . getLogger ( '<STR_LIT>' ) <EOL> class ApiCrudCases ( ApiTestCase ) : <EOL> """<... |
<s> """<STR_LIT>""" <EOL> from tests . case . api . crud import ApiCrudCases <EOL> import logging <EOL> mozlogger = logging . getLogger ( '<STR_LIT>' ) <EOL> class ProfileResourceTest ( ApiCrudCases ) : <EOL> @ property <EOL> def factory ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . F . ProfileFactory ( ) <EOL> ... |
<s> """<STR_LIT>""" <EOL> import textwrap <EOL> from tests import case <EOL> class ParseBulkTest ( case . TestCase ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def parser ( self ) : <EOL> from moztrap . model . library . bulk import BulkParser <EOL> return BulkParser <EOL> def test_success ( self ) : <EOL> """<STR_... |
<s> """<STR_LIT>""" <EOL> from tests import case <EOL> class EditProductFormTest ( case . DBTestCase ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def form ( self ) : <EOL> """<STR_LIT>""" <EOL> from moztrap . view . manage . products . forms import EditProductForm <EOL> return EditProductForm <EOL> def test_edit_pr... |
<s> """<STR_LIT>""" <EOL> from tests import case <EOL> class PermissionFilterTest ( case . DBTestCase ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def permissions ( self ) : <EOL> """<STR_LIT>""" <EOL> from moztrap . view . templatetags import permissions <EOL> return permissions <EOL> def test_has_perm ( self ) : ... |
<s> from __future__ import absolute_import <EOL> import os <EOL> import warnings <EOL> import dotenv <EOL> from celery import Celery <EOL> _dirname = os . path . dirname <EOL> ROOT = _dirname ( _dirname ( _dirname ( os . path . abspath ( __file__ ) ) ) ) <EOL> def path ( * args ) : <EOL> return os . path . join ( ROOT ... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AddField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_LIT... |
<s> from __future__ import unicode_literals <EOL> from django . db import migrations , models <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AddField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_LIT... |
<s> from collections import defaultdict <EOL> import logging <EOL> import os <EOL> from bulk_update . helper import bulk_update <EOL> from pontoon . base . models import ( <EOL> Entity , <EOL> Locale , <EOL> Resource , <EOL> Translation , <EOL> TranslationMemoryEntry <EOL> ) <EOL> from pontoon . base . utils import mat... |
<s> import os . path <EOL> from django_nose . tools import ( <EOL> assert_equal , <EOL> assert_false , <EOL> assert_not_in , <EOL> assert_raises , <EOL> assert_true <EOL> ) <EOL> from mock import Mock , MagicMock , patch , call <EOL> from pontoon . base . models import Entity <EOL> from pontoon . base . tests import ( ... |
<s> from django . shortcuts import render <EOL> from django . utils . translation import ugettext as _ <EOL> from django . utils . translation import ngettext , pgettext <EOL> def index_view ( request ) : <EOL> return render ( request , '<STR_LIT>' ) <EOL> def jingo_view ( request ) : <EOL> num = <NUM_LIT:2> <EOL> retu... |
<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> from haystack import indexes <EOL> from . models import Person , Organization <EOL> class PersonIndex ( indexes . SearchIndex , indexes . Indexable ) : <EOL> name = indexes . CharField ( model_attr = '<STR_LIT:name>' , boost = <NUM_LIT> ) <EOL> text = indexes . CharField ( document = True , use_template = True ) <E... |
<s> from flask import current_app <EOL> from sqlalchemy import ( Boolean , Column , desc , ForeignKey , Integer , String , <EOL> Table , UniqueConstraint ) <EOL> from sqlalchemy . orm import backref , relationship <EOL> from standup import OrderedDict <EOL> from standup . apps . status . models import Status <EOL> from... |
<s> from pypinyin . phrases_dict import phrases_dict <EOL> from pypinyin import pinyin , TONE <EOL> phrases_list = set ( ) <EOL> phrases_same = set ( ) <EOL> for han , pys in phrases_dict . items ( ) : <EOL> if pinyin ( han , style = TONE , heteronym = True ) != pys : <EOL> phrases_list . add ( han ) <EOL> else : <EOL>... |
<s> from django . contrib . contenttypes . models import ContentType <EOL> from django . db import models <EOL> from filtered_contenttypes . fields import FilteredGenericForeignKey <EOL> class Phone ( models . Model ) : <EOL> name = models . TextField ( ) <EOL> class Meta : <EOL> app_label = '<STR_LIT>' <EOL> class Mon... |
<s> import ldap <EOL> import logging <EOL> from django . contrib . auth . models import User <EOL> from django . contrib . auth . backends import ModelBackend <EOL> from django . conf import settings <EOL> logger = logging . getLogger ( ) <EOL> ldap . set_option ( ldap . OPT_REFERRALS , <NUM_LIT:0> ) <EOL> ldap . set_o... |
<s> from django . conf import settings <EOL> from django . conf . urls . defaults import patterns , include , url <EOL> from django . conf . urls . static import static <EOL> from django . contrib import admin <EOL> admin . autodiscover ( ) <EOL> urlpatterns = static ( settings . MEDIA_URL , document_root = settings . ... |
<s> import bpy <EOL> def show_error_message ( message , wrap = <NUM_LIT> ) : <EOL> lines = [ ] <EOL> if wrap > <NUM_LIT:0> : <EOL> while len ( message ) > wrap : <EOL> i = message . rfind ( '<STR_LIT:U+0020>' , <NUM_LIT:0> , wrap ) <EOL> if i == - <NUM_LIT:1> : <EOL> lines . append ( message [ : wrap ] ) <EOL> message ... |
<s> import sys <EOL> import os <EOL> cwd = os . getcwd ( ) <EOL> project_root = os . path . dirname ( cwd ) <EOL> sys . path . insert ( <NUM_LIT:0> , project_root ) <EOL> import vulyk <EOL> extensions = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> templates_path = [ '<STR_LIT>' ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_d... |
<s> from __future__ import unicode_literals <EOL> import httplib <EOL> import sys <EOL> from functools import wraps <EOL> from itertools import islice <EOL> from flask import jsonify , abort <EOL> def unique ( a ) : <EOL> """<STR_LIT>""" <EOL> seen = set ( ) <EOL> return [ seen . add ( x ) or x for x in a if x not in s... |
<s> from flask import Flask , url_for , redirect , render_template , request <EOL> from flask . ext . mongoengine import MongoEngine <EOL> from wtforms import form , fields , validators <EOL> from flask . ext import admin , login <EOL> from flask . ext . admin . contrib . mongoengine import ModelView <EOL> from flask .... |
<s> try : <EOL> from . helpers import get_current_view <EOL> from flask . ext . babelex import Domain <EOL> from flask . ext . admin import translations <EOL> class CustomDomain ( Domain ) : <EOL> def __init__ ( self ) : <EOL> super ( CustomDomain , self ) . __init__ ( translations . __path__ [ <NUM_LIT:0> ] , domain =... |
<s> import logging <EOL> import shlex <EOL> import warnings <EOL> from flask import request <EOL> from jinja2 import Markup <EOL> from flask . ext . admin . base import BaseView , expose <EOL> from flask . ext . admin . babel import gettext <EOL> from flask . ext . admin . _compat import VER <EOL> log = logging . getLo... |
<s> from flask import Flask <EOL> from flask . ext . admin import Admin <EOL> from flask . ext . sqlalchemy import SQLAlchemy <EOL> def setup ( ) : <EOL> app = Flask ( __name__ ) <EOL> app . config [ '<STR_LIT>' ] = '<STR_LIT:1>' <EOL> app . config [ '<STR_LIT>' ] = False <EOL> app . config [ '<STR_LIT>' ] = '<STR_LIT>... |
<s> from . router import SockJSRouter <EOL> from . conn import SockJSConnection </s>
|
<s> from os import path as op <EOL> from datetime import datetime <EOL> import tornado . web <EOL> import tornadio <EOL> import tornadio . router <EOL> import tornadio . server <EOL> ROOT = op . normpath ( op . dirname ( __file__ ) ) <EOL> class IndexHandler ( tornado . web . RequestHandler ) : <EOL> """<STR_LIT>""" <E... |
<s> from collections import deque <EOL> from nose . tools import eq_ , raises <EOL> from tornadio2 import session , proto , conn , stats <EOL> from simplejson import JSONDecodeError <EOL> class DummyRequest ( object ) : <EOL> def __init__ ( self , ** kwargs ) : <EOL> self . arguments = kwargs <EOL> self . cookies = dic... |
<s> def Decode ( param ) : <EOL> loc_3 = [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] <EOL> loc_4 = [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] <EOL> loc_2 = '<STR_LIT>' <EOL> dec = '<STR_LIT>' <EOL> hash1 = [ "<STR_LIT:L>" , "<STR_LIT:y>" , "<STR_LIT:c>" , "<STR_LIT:X>" , "<STR_LIT:2>" , "<STR_LIT:M>" , "... |
<s> import re , sys , os , cgi <EOL> import urllib , urllib2 <EOL> scriptID = sys . modules [ "<STR_LIT:__main__>" ] . scriptID <EOL> scriptname = "<STR_LIT>" <EOL> class mrknow_Parser : <EOL> def __init__ ( self ) : <EOL> pass <EOL> def getParam ( self , params , name ) : <EOL> try : <EOL> result = params [ name ] <EO... |
<s> """<STR_LIT>""" <EOL> from crypto . keyedHash . michael import Michael <EOL> class TKIP_MIC ( Michael ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , key = None , version = '<STR_LIT>' ) : <EOL> """<STR_LIT:U+0020>""" <EOL> self . version = version <EOL> Michael . __init__ ( self , key ) <EOL> def hash ( self... |
<s> '''<STR_LIT>''' <EOL> import os , sys , re , json , urllib , urlparse , base64 , datetime <EOL> try : action = dict ( urlparse . parse_qsl ( sys . argv [ <NUM_LIT:2> ] . replace ( '<STR_LIT:?>' , '<STR_LIT>' ) ) ) [ '<STR_LIT:action>' ] <EOL> except : action = None <EOL> from resources . lib . libraries import trak... |
<s> import os <EOL> import struct <EOL> import logging <EOL> from primitives import * <EOL> from constants import * <EOL> from astypes import MalformedFLV <EOL> from astypes import get_script_data_variable , make_script_data_variable <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> STRICT_PARSING = False <EOL> def... |
<s> """<STR_LIT>""" <EOL> class TripleDES ( object ) : <EOL> def __init__ ( self , key , mode , IV , implementation ) : <EOL> if len ( key ) != <NUM_LIT> : <EOL> raise ValueError ( ) <EOL> if mode != <NUM_LIT:2> : <EOL> raise ValueError ( ) <EOL> if len ( IV ) != <NUM_LIT:8> : <EOL> raise ValueError ( ) <EOL> self . is... |
<s> '''<STR_LIT>''' <EOL> import re <EOL> from resources . lib . libraries import client <EOL> def resolve ( url ) : <EOL> try : <EOL> id = re . compile ( '<STR_LIT>' ) . findall ( url ) <EOL> id += re . compile ( '<STR_LIT>' ) . findall ( url ) <EOL> id = id [ <NUM_LIT:0> ] <EOL> url = '<STR_LIT>' % id <EOL> result = ... |
<s> '''<STR_LIT>''' <EOL> import re , urllib2 <EOL> from resources . lib . libraries import client <EOL> def resolve ( url ) : <EOL> try : <EOL> url = url . replace ( '<STR_LIT>' , '<STR_LIT:/>' ) <EOL> url = url . replace ( '<STR_LIT>' , '<STR_LIT:/>' ) <EOL> url = re . compile ( '<STR_LIT>' ) . findall ( url ) [ <NUM... |
<s> '''<STR_LIT>''' <EOL> import re <EOL> from resources . lib . libraries import client <EOL> from resources . lib . libraries import jsunpack <EOL> def resolve ( url ) : <EOL> try : <EOL> url = url . replace ( '<STR_LIT>' , '<STR_LIT:/>' ) <EOL> url = re . compile ( '<STR_LIT>' ) . findall ( url ) [ <NUM_LIT:0> ] <EO... |
<s> '''<STR_LIT>''' <EOL> import re , urllib , urlparse <EOL> from resources . lib . libraries import cleantitle <EOL> from resources . lib . libraries import client <EOL> class source : <EOL> def __init__ ( self ) : <EOL> self . base_link = '<STR_LIT>' <EOL> self . search_link = '<STR_LIT>' <EOL> self . detail_link = ... |
<s> '''<STR_LIT>''' <EOL> import re , urllib , urlparse , base64 <EOL> from resources . lib . libraries import cleantitle <EOL> from resources . lib . libraries import client <EOL> from resources . lib import resolvers <EOL> class source : <EOL> def __init__ ( self ) : <EOL> self . base_link = '<STR_LIT>' <EOL> self . ... |
<s> from distutils . core import setup <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> download_url = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> license = '<STR_LIT>' , <EOL> packages = [ '<STR_LIT>' ] , <EOL> description = ... |
<s> import os <EOL> import shutil <EOL> import sys <EOL> MV_FORMAT_STRING = "<STR_LIT>" <EOL> MV_FAILURE_FORMAT_STRING = "<STR_LIT>" <EOL> def main ( args ) : <EOL> ( instruction_file , movie_directory ) = process_args ( args ) <EOL> if instruction_file is None : <EOL> return <NUM_LIT:1> <EOL> instructions = read_instr... |
<s> from addict import Dict <EOL> from circus . client import CircusClient <EOL> from circus import get_arbiter <EOL> from ast import literal_eval <EOL> class Client ( object ) : <EOL> def __init__ ( self , host , port , timeout = <NUM_LIT:15> ) : <EOL> assert type ( host ) == str <EOL> assert type ( port ) == int and ... |
<s> import collections <EOL> import inspect <EOL> import six <EOL> from wiring . providers import ( <EOL> FactoryProvider , <EOL> FunctionProvider , <EOL> InstanceProvider <EOL> ) <EOL> __all__ = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> class InvalidConfigurationEr... |
<s> import warnings <EOL> from collections import OrderedDict <EOL> import numpy as np <EOL> from matplotlib import cm <EOL> from matplotlib . colors import rgb2hex <EOL> from sklearn . manifold import TSNE <EOL> try : <EOL> import pandas as pd <EOL> import bokeh . plotting as bk <EOL> from bokeh . models import HoverT... |
<s> __author__ = '<STR_LIT:root>' </s>
|
<s> </s>
|
<s> """<STR_LIT>""" <EOL> import sys <EOL> required_version = ( <NUM_LIT:2> , <NUM_LIT:3> ) <EOL> if sys . version_info < required_version : <EOL> raise ImportError , "<STR_LIT>" <EOL> from tftpy . TftpShared import * <EOL> from tftpy . TftpPacketTypes import * <EOL> from tftpy . TftpPacketFactory import * <EOL> from t... |
<s> from . . handler import BaseHandler <EOL> from postal . library import form_factory <EOL> class PostalHandler ( BaseHandler ) : <EOL> allowed_methods = ( '<STR_LIT:GET>' , ) <EOL> def read ( self , request ) : <EOL> iso_code = request . GET . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> json = { } <EOL> form_class = for... |
<s> from django . conf import settings <EOL> from django . utils import importlib <EOL> from . base import BaseStaticSiteRenderer <EOL> from . disk import DiskStaticSiteRenderer <EOL> from . appengine import GAEStaticSiteRenderer <EOL> from . s3 import S3StaticSiteRenderer <EOL> __all__ = ( '<STR_LIT>' , '<STR_LIT>' , ... |
<s> import sys <EOL> if sys . version_info [ <NUM_LIT:0> ] < <NUM_LIT:3> : <EOL> import collections <EOL> import re <EOL> import sys <EOL> import warnings <EOL> from pylinkchecker . bs4 . dammit import EntitySubstitution <EOL> DEFAULT_OUTPUT_ENCODING = "<STR_LIT:utf-8>" <EOL> PY3K = ( sys . version_info [ <NUM_LIT:0> ]... |
<s> """<STR_LIT>""" <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> __version__ = '<STR_LIT>' <EOL> try : <EOL> from . ext . pig import PigJob <EOL> from . job import Job <EOL> from . project import Project <EOL> except ImportError : <EOL> pass <EOL> import logging as lg <EOL> CLI_ARGS = { } <EOL> cla... |
<s> """<STR_LIT>""" <EOL> from ... util import HdfsError <EOL> from json import dumps <EOL> from six import integer_types , string_types <EOL> import fastavro <EOL> import io <EOL> import logging as lg <EOL> import os <EOL> import posixpath as psp <EOL> import sys <EOL> _logger = lg . getLogger ( __name__ ) <EOL> def _... |
<s> from nose . tools import ok_ , eq_ </s>
|
<s> from django . contrib import admin <EOL> from models import Invitation , InvitationStats <EOL> class InvitationAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT:user>' , '<STR_LIT:email>' , '<STR_LIT>' ) <EOL> admin . site . register ( Invitation , InvitationAdmin ) <EOL> class InvitationStatsAdmin ( ... |
<s> from django . test import TestCase <EOL> from django . core . urlresolvers import reverse <EOL> from django . contrib . auth . models import User <EOL> from friends . models import FriendshipRequest , Friendship , UserBlocks <EOL> from friends . templatetags import friends_tags <EOL> class BaseTestCase ( TestCase )... |
<s> import os <EOL> from setuptools import setup <EOL> ROOT_DIR = os . path . dirname ( __file__ ) <EOL> SOURCE_DIR = os . path . join ( ROOT_DIR ) <EOL> VERSION = '<STR_LIT>' <EOL> setup ( <EOL> name = "<STR_LIT>" , <EOL> version = VERSION , <EOL> author = "<STR_LIT>" , <EOL> author_email = "<STR_LIT>" , <EOL> url = "... |
<s> import os <EOL> import subprocess <EOL> import plistlib <EOL> from catalogs . models import Catalog <EOL> from django . conf import settings <EOL> USERNAME_KEY = settings . MANIFEST_USERNAME_KEY <EOL> APPNAME = settings . APPNAME <EOL> REPO_DIR = settings . MUNKI_REPO_DIR <EOL> try : <EOL> GIT = settings . GIT_PATH... |
<s> import http <EOL> import urllib <EOL> import datetime <EOL> import util <EOL> import sys <EOL> import oauth_base <EOL> class Error ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __config ( ) : <EOL> return { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>'... |
<s> import numpy as np <EOL> from numpy . testing import assert_array_almost_equal <EOL> from nose . tools import assert_raises <EOL> from . . pairwise import euclidean_distances , pearson_correlation , jaccard_coefficient , manhattan_distances , sorensen_coefficient , tanimoto_coefficient , cosine_distances , spearman... |
<s> from pipegeojson import * <EOL> from pipegeohash import * <EOL> from pipehtml import * <EOL> from piperealtime import * <EOL> from postgis_interface import * <EOL> from quickmaps import * </s>
|
<s> import unittest <EOL> import plyj . parser as plyj <EOL> import plyj . model as model <EOL> class CompilationUnitTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . parser = plyj . Parser ( ) <EOL> def test_class ( self ) : <EOL> m = self . parser . parse_string ( '''<STR_LIT>''' ) <EOL> cls = se... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import localshop . apps . packages . models <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AddField ( <EOL>... |
<s> from django . shortcuts import redirect <EOL> from django . views . decorators . csrf import csrf_exempt <EOL> from localshop . apps . packages import xmlrpc <EOL> @ csrf_exempt <EOL> def index ( request ) : <EOL> if request . method == '<STR_LIT:POST>' : <EOL> return xmlrpc . handle_request ( request ) <EOL> retur... |
<s> import logging <EOL> from zeep . cache import SqliteCache <EOL> from zeep . transports import Transport <EOL> from zeep . wsdl import WSDL <EOL> NSMAP = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> logger = logging . getLogger ( __name__ ) <EO... |
<s> import datetime <EOL> from decimal import Decimal as D <EOL> import isodate <EOL> import six <EOL> from zeep . xsd import builtins <EOL> class TestString : <EOL> def test_xmlvalue ( self ) : <EOL> instance = builtins . String ( ) <EOL> result = instance . xmlvalue ( '<STR_LIT>' ) <EOL> assert result == '<STR_LIT>' ... |
<s> from ant . core import log <EOL> SERIAL = '<STR_LIT>' <EOL> DEBUG = True <EOL> LOG = log . LogWriter ( ) <EOL> print "<STR_LIT>" , LOG . filename <EOL> print "<STR_LIT>" </s>
|
<s> from __future__ import unicode_literals <EOL> import uuid <EOL> from django . conf import settings <EOL> from django . core . files . base import ContentFile <EOL> from django . core . files . storage import default_storage <EOL> from django . core . mail import EmailMessage <EOL> from django . db import connection... |
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> import seaborn as sns <EOL> import matplotlib . pyplot as plt <EOL> sns . set ( style = "<STR_LIT>" ) <EOL> rs = np . random . RandomState ( <NUM_LIT:50> ) <EOL> f , axes = plt . subplots ( <NUM_LIT:3> , <NUM_LIT:3> , figsize = ( <NUM_LIT:9> , <NUM_LIT:9> ) , sharex = ... |
<s> """<STR_LIT>""" <EOL> import seaborn as sns <EOL> sns . set ( ) <EOL> df = sns . load_dataset ( "<STR_LIT>" ) <EOL> sns . pairplot ( df , hue = "<STR_LIT>" ) </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.