code stringlengths 9 256k |
|---|
<s> """<STR_LIT>""" <EOL> import sudo <EOL> import socketlib <EOL> def port_forward ( srcport , destport , rule = None ) : <EOL> """<STR_LIT>""" <EOL> myself = socketlib . get_myaddress ( ) <EOL> rule = rule or srcport <EOL> cmd = "<STR_LIT>" % ( rule , myself , destport , srcport ) <EOL> sudo . sudo_command ( cmd ) <E... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import struct <EOL> from pycopia . aid import sortedlist <EOL> class ProcStat ( object ) : <EOL> """<STR_LIT>""" <EOL> _FF = "<STR_LIT>" <EOL> _STATINDEX = { <EOL> "<STR_LIT>" : <NUM_LIT:0> , <EOL> "<STR_LIT>" : <NUM_LIT:1> , <EOL> "<STR_LIT>" : <NUM_LIT:2> , <EOL> "<STR_LIT>" ... |
<s> import sys <EOL> import os <EOL> import pycopia . inet . XHTMLcgi as CGI <EOL> def test ( environ = os . environ ) : <EOL> """<STR_LIT>""" <EOL> print "<STR_LIT>" <EOL> print <EOL> print_head ( ) <EOL> try : <EOL> print_directory ( ) <EOL> print_arguments ( ) <EOL> form = CGI . get_form ( sys . stdin ) <EOL> print_... |
<s> """<STR_LIT>""" <EOL> import mmap <EOL> def _get_buf ( size ) : <EOL> _buf = mmap . mmap ( - <NUM_LIT:1> , size , flags = mmap . MAP_PRIVATE | mmap . MAP_ANONYMOUS , <EOL> prot = mmap . PROT_READ | mmap . PROT_WRITE ) <EOL> _buf . seek ( <NUM_LIT:0> , <NUM_LIT:2> ) <EOL> return _buf <EOL> class RingBuffer ( object ... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> import clr <EOL> import Pyro . core <EOL> import Pyro . naming <EOL> from Pyro . errors import NamingError <EOL> _EXIT = False <EOL> class IronPythonBase ( Pyro . core . ObjBase ) : <EOL> def version ( self ) : <EOL> return sys . version <EOL> def alive ( self ) : <EOL> return... |
<s> from pycopia . aid import Enum <EOL> import pycopia . SMI . Basetypes <EOL> Range = pycopia . SMI . Basetypes . Range <EOL> Ranges = pycopia . SMI . Basetypes . Ranges <EOL> from pycopia . SMI . Objects import ColumnObject , MacroObject , NotificationObject , RowObject , ScalarObject , NodeObject , ModuleObject , G... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> from __future__ import division <EOL> from pycopia import socket <EOL> from pycopia import asyncserver <EOL> from pycopia . clientservers . servers import http_protocols <EOL> def simple_http_server ( argv... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> from __future__ import division <EOL> from pycopia import proctools <EOL> RSYNC = proctools . which ( "<STR_LIT>" ) <EOL> TESTED_VERSIONS = [ "<STR_LIT>" ] <EOL> def rsync ( src , dst , password = None , ... |
<s> """<STR_LIT>""" </s>
|
<s> from sumpy . system . _base import AverageFeatureRankerBase <EOL> from sumpy . system . _baseline import ( LedeSummarizer , CentroidSummarizer , <EOL> MMRSummarizer ) <EOL> from sumpy . system . _graph import TextRankSummarizer , LexRankSummarizer <EOL> from sumpy . system . _submodular import MonotoneSubmodularBas... |
<s> from setuptools import setup <EOL> import os , sys <EOL> try : <EOL> import multiprocessing <EOL> except ImportError : <EOL> pass <EOL> setup_path = os . path . dirname ( __file__ ) <EOL> reqs_file = open ( os . path . join ( setup_path , '<STR_LIT>' ) , '<STR_LIT:r>' ) <EOL> reqs = reqs_file . readlines ( ) <EOL> ... |
<s> from __future__ import unicode_literals <EOL> import os <EOL> PROJECT_ROOT = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> settings_module = "<STR_LIT>" % PROJECT_ROOT . split ( os . sep ) [ - <NUM_LIT:1> ] <EOL> os . environ . setdefault ( "<STR_LIT>" , settings_module ) <EOL> from django . core .... |
<s> from google . appengine . ext import db <EOL> class CountModel ( db . Model ) : <EOL> name = db . StringProperty ( ) <EOL> value = db . IntegerProperty ( ) </s>
|
<s> from wtforms import Form <EOL> class BaseForm ( Form ) : <EOL> def validated_messages ( self ) : <EOL> result = { } <EOL> keys = self . _fields . keys ( ) <EOL> for key in keys : <EOL> field = self . _fields [ key ] <EOL> result [ self . _prefix + key ] = field . errors [ <NUM_LIT:0> ] if field . errors else None <... |
<s> from . models import AccessAttempt <EOL> def store_login_attempt ( user_agent , ip_address , username , <EOL> http_accept , path_info , login_valid ) : <EOL> """<STR_LIT>""" <EOL> AccessAttempt . objects . create ( <EOL> user_agent = user_agent , <EOL> ip_address = ip_address , <EOL> username = username , <EOL> htt... |
<s> import engines as query <EOL> import process <EOL> import utils <EOL> import postproc_modules <EOL> import http_service_helper <EOL> from gevent import monkey <EOL> monkey . patch_all ( thread = False , select = False , httplib = False ) </s>
|
<s> __version__ = "<STR_LIT>" </s>
|
<s> """<STR_LIT>""" <EOL> import sys <EOL> import os <EOL> import tempfile <EOL> import random <EOL> import csv <EOL> import pytest <EOL> from pprint import pprint as pp <EOL> import test_tools <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . dirname ( os . path . dirname ( os . path . dirname ( os . path . abspat... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import textwrap <EOL> import types <EOL> from itertools import imap <EOL> from exceptions import * <EOL> from helpers import * <EOL> __author__ = '<STR_LIT>' <EOL> __email__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> __license__ = '<STR_LIT>' <EOL> __all__ = ( '<STR_LI... |
<s> """<STR_LIT>""" <EOL> import json <EOL> import requests <EOL> from . helpers import is_collection <EOL> from . structures import KeyedListResource <EOL> from . models import * <EOL> GITHUB_URL = '<STR_LIT>' <EOL> class GithubCore ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> super ( GithubC... |
<s> import sys <EOL> import os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( '<STR_LIT:..>' ) ) <EOL> from clint . textui import puts , colored <EOL> from clint . textui import columns <EOL> lorem = '<STR_LIT>' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> col = <NUM_LIT> <EOL> puts ( columns ( [ ... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> from subprocess import call <EOL> from time import sleep <EOL> import difflib <EOL> import clint . resources <EOL> try : <EOL> from clint import Args <EOL> args = Args ( ) <EOL> except ImportError : <EOL> from clint import args <EOL> from clint . eng import joi... |
<s> from __future__ import absolute_import <EOL> import email . utils <EOL> import mimetypes <EOL> from . packages import six <EOL> def guess_content_type ( filename , default = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> if filename : <EOL> return mimetypes . guess_type ( filename ) [ <NUM_LIT:0> ] or default <EOL> re... |
<s> import threading <EOL> import socket <EOL> import select <EOL> def consume_socket_content ( sock , timeout = <NUM_LIT:0.5> ) : <EOL> chunks = <NUM_LIT> <EOL> content = b'<STR_LIT>' <EOL> more_to_read = select . select ( [ sock ] , [ ] , [ ] , timeout ) [ <NUM_LIT:0> ] <EOL> while more_to_read : <EOL> new_content = ... |
<s> """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> __version__ = "<STR_LIT>" [ <NUM_LIT:11> : - <NUM_LIT:2> ] <EOL> __date__ = "<STR_LIT>" [ <NUM_LIT:7> : - <NUM_LIT:2> ] <EOL> import datetime <EOL> import time <EOL> def unzfill ( str ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return str [ : str . index ( '<STR_LIT>' ) ]... |
<s> '''<STR_LIT>''' <EOL> import BIFFRecords <EOL> import Style <EOL> class Workbook ( object ) : <EOL> def __init__ ( self , encoding = '<STR_LIT:ascii>' , style_compression = <NUM_LIT:0> ) : <EOL> self . encoding = encoding <EOL> self . __owner = '<STR_LIT:None>' <EOL> self . __country_code = None <EOL> self . __wnd_... |
<s> from xlwt import * <EOL> font0 = Formatting . Font ( ) <EOL> font0 . name = '<STR_LIT>' <EOL> font1 = Formatting . Font ( ) <EOL> font1 . name = '<STR_LIT>' <EOL> font2 = Formatting . Font ( ) <EOL> font2 . name = '<STR_LIT>' <EOL> font3 = Formatting . Font ( ) <EOL> font3 . name = '<STR_LIT>' <EOL> num_format0 = '... |
<s> from test . testlib import * <EOL> from git import * <EOL> class TestTree ( object ) : <EOL> def setup ( self ) : <EOL> self . repo = Repo ( GIT_REPO ) <EOL> @ patch_object ( Git , '<STR_LIT>' ) <EOL> def test_contents_should_cache ( self , git ) : <EOL> git . return_value = fixture ( '<STR_LIT>' ) + fixture ( '<ST... |
<s> from django . http import HttpResponse <EOL> from rest_framework import viewsets <EOL> from tests import models <EOL> from tests import serializers <EOL> class EchoMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> http_method_names = viewsets . ModelViewSet . http_method_names + [ "<STR_LIT>" ] <EOL> def echo ( self ,... |
<s> import vcr <EOL> import six . moves . http_client as httplib <EOL> def _headers_are_case_insensitive ( ) : <EOL> conn = httplib . HTTPConnection ( '<STR_LIT>' ) <EOL> conn . request ( '<STR_LIT:GET>' , "<STR_LIT>" ) <EOL> r1 = conn . getresponse ( ) <EOL> cookie_data1 = r1 . getheader ( '<STR_LIT>' ) <EOL> conn = h... |
<s> from vcr . serializers import compat <EOL> from vcr . request import Request <EOL> import yaml <EOL> CASSETTE_FORMAT_VERSION = <NUM_LIT:1> <EOL> """<STR_LIT>""" <EOL> def _looks_like_an_old_cassette ( data ) : <EOL> return isinstance ( data , list ) and len ( data ) and '<STR_LIT>' in data [ <NUM_LIT:0> ] <EOL> def... |
<s> import sys , os <EOL> extensions = [ '<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> exclude_patterns = ... |
<s> from distutils . core import setup <EOL> from notifications import __version__ as version <EOL> setup ( <EOL> name = "<STR_LIT>" , <EOL> version = version , <EOL> description = "<STR_LIT>" , <EOL> long_description = open ( "<STR_LIT>" ) . read ( ) , <EOL> author = "<STR_LIT>" , <EOL> author_email = "<STR_LIT>" , <E... |
<s> """<STR_LIT>""" <EOL> from sys import version_info <EOL> from pyflakes import messages as m <EOL> from pyflakes . test import harness <EOL> class Test ( harness . Test ) : <EOL> def test_duplicateArgs ( self ) : <EOL> self . flakes ( '<STR_LIT>' , m . DuplicateArgument ) <EOL> def test_localReferencedBeforeAssignme... |
<s> from django . conf import settings <EOL> from django . core . management . commands . diffsettings import module_to_dict <EOL> import logging <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django . template . defaultfilters import yesno <EOL> from haystack . constants import VALID_FILT... |
<s> import sys <EOL> import os <EOL> import shlex <EOL> on_rtd = os . environ . get ( '<STR_LIT>' , None ) == '<STR_LIT:True>' <EOL> if on_rtd : <EOL> os . environ [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> else : <EOL> html_theme = '<STR_LIT>' <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( '<STR_LIT>' ) ) <E... |
<s> import kite . lockfile <EOL> from kite . lockfile import FileLock <EOL> import unittest <EOL> import tempfile <EOL> import fcntl <EOL> import tmpdir <EOL> class TestLockfile ( tmpdir . TestCaseWithTempFile ) : <EOL> def test_lock ( self ) : <EOL> with FileLock ( self . tmpfile , "<STR_LIT>" ) : <EOL> try : <EOL> fc... |
<s> import datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import models <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ( self , orm ) : <EOL> db . alter_column ( '<STR_LIT>' , '<STR_LIT>' , self . gf ( '<STR_LIT>' ) ( default = datetime . dat... |
<s> import datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import models <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ( self , orm ) : <EOL> db . alter_column ( '<STR_LIT>' , '<STR_LIT:text>' , self . gf ( '<STR_LIT>' ) ( ) ) <EOL> def backw... |
<s> import datetime <EOL> from cStringIO import StringIO <EOL> from django . shortcuts import render_to_response <EOL> from django . template import RequestContext , Context <EOL> from django . conf import settings <EOL> from django . http import HttpResponseRedirect , HttpResponse <EOL> from django . contrib . auth . ... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> import socket <EOL> import SocketServer <EOL> import metrics <EOL> import parser <EOL> class Collector ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , aggregator ) : <EOL> """<STR_LIT>""" <EOL> self . logger = logging . getLogger ( "<STR_LIT>" ) <EOL> self .... |
<s> import os <EOL> import sys <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> os . environ . setdefault ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> from django . core . management import execute_from_command_line <EOL> execute_from_command_line ( sys . argv ) </s>
|
<s> from __future__ import unicode_literals <EOL> def crumb ( text , parent = None , parent_args = [ ] , parent_kwargs = { } ) : <EOL> '''<STR_LIT>''' <EOL> def _crumbed ( view ) : <EOL> view . crumb_text = text <EOL> view . crumb_parent = parent <EOL> view . crumb_p_args = parent_args <EOL> view . crumb_p_kwargs = par... |
<s> """<STR_LIT>""" <EOL> import unittest <EOL> from pcapfile import savefile <EOL> from pcapfile import linklayer <EOL> from pcapfile . protocols . linklayer import ethernet <EOL> class TestCase ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> capfile = None <EOL> def init_capfile ( self , layers = <NUM_LIT:0> ) ... |
<s> from kivy . app import App <EOL> from . import Webbrowser <EOL> class BerkeliumBrowserApp ( App ) : <EOL> def build ( self ) : <EOL> return Webbrowser ( url = '<STR_LIT>' , transparency = False ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> BerkeliumBrowserApp ( ) . run ( ) </s>
|
<s> from toolchain import Recipe , shprint <EOL> from os . path import join <EOL> import sh <EOL> import os <EOL> class PythonRecipe ( Recipe ) : <EOL> version = "<STR_LIT>" <EOL> url = "<STR_LIT>" <EOL> depends = [ "<STR_LIT>" , "<STR_LIT>" , ] <EOL> optional_depends = [ "<STR_LIT>" ] <EOL> library = "<STR_LIT>" <EOL>... |
<s> from sphinx . ext . autodoc import Documenter , ClassDocumenter <EOL> from sphinx . ext . autodoc import setup as core_setup <EOL> from sphinx . locale import _ <EOL> class KivyClassDocumenter ( ClassDocumenter ) : <EOL> def add_directive_header ( self , sig ) : <EOL> if self . doc_as_attr : <EOL> self . directivet... |
<s> from kivy . app import App <EOL> from kivy . uix . widget import Widget <EOL> from kivy . graphics import Color , Ellipse , Rectangle , RoundedRectangle <EOL> from kivy . lang import Builder <EOL> TEXTURE = '<STR_LIT>' <EOL> YELLOW = ( <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT:0> ) <EOL> ORANGE = ( <NUM_LIT:1> , <NUM_LIT>... |
<s> from random import random <EOL> from kivy . app import App <EOL> from kivy . uix . widget import Widget <EOL> from kivy . uix . button import Button <EOL> from kivy . graphics import Color , Ellipse , Line <EOL> class MyPaintWidget ( Widget ) : <EOL> def on_touch_down ( self , touch ) : <EOL> color = ( random ( ) ,... |
<s> from kivy . app import App <EOL> from kivy . lang import Builder <EOL> kv = '''<STR_LIT>''' <EOL> class CameraApp ( App ) : <EOL> def build ( self ) : <EOL> return Builder . load_string ( kv ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> CameraApp ( ) . run ( ) </s>
|
<s> from kivy . uix . listview import ListView <EOL> from kivy . uix . gridlayout import GridLayout <EOL> class MainView ( GridLayout ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , ** kwargs ) : <EOL> kwargs [ '<STR_LIT>' ] = <NUM_LIT:2> <EOL> super ( MainView , self ) . __init__ ( ** kwargs ) <EOL> list_view = ... |
<s> '''<STR_LIT>''' <EOL> __all__ = ( '<STR_LIT>' , ) <EOL> import inspect <EOL> from kivy . event import EventDispatcher <EOL> from kivy . adapters . adapter import Adapter <EOL> from kivy . adapters . models import SelectableDataItem <EOL> from kivy . properties import ListProperty <EOL> from kivy . properties import... |
<s> '''<STR_LIT>''' <EOL> __all__ = ( '<STR_LIT>' , ) <EOL> from kivy . core . camera import CameraBase <EOL> from kivy . clock import Clock <EOL> try : <EOL> from VideoCapture import Device <EOL> except : <EOL> raise <EOL> class CameraVideoCapture ( CameraBase ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , ** k... |
<s> '''<STR_LIT>''' <EOL> __all__ = ( '<STR_LIT>' , ) <EOL> from kivy . compat import PY2 <EOL> from kivy . core . text import LabelBase <EOL> from kivy . core . image import ImageData <EOL> try : <EOL> import pygame <EOL> except : <EOL> raise <EOL> pygame_cache = { } <EOL> pygame_font_handles = { } <EOL> pygame_cache_... |
<s> '''<STR_LIT>''' <EOL> __all__ = ( '<STR_LIT>' , ) <EOL> class MotionEventFactory : <EOL> '''<STR_LIT>''' <EOL> __providers__ = { } <EOL> @ staticmethod <EOL> def register ( name , classname ) : <EOL> '''<STR_LIT>''' <EOL> MotionEventFactory . __providers__ [ name ] = classname <EOL> @ staticmethod <EOL> def list ( ... |
<s> '''<STR_LIT>''' <EOL> import os <EOL> import re <EOL> import sys <EOL> import traceback <EOL> from re import sub , findall <EOL> from types import CodeType <EOL> from functools import partial <EOL> from collections import OrderedDict , defaultdict <EOL> import kivy . lang . builder <EOL> from kivy . logger import L... |
<s> '''<STR_LIT>''' <EOL> from kivy . clock import Clock <EOL> from kivy . event import EventDispatcher <EOL> class AbstractStore ( EventDispatcher ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , ** kwargs ) : <EOL> super ( AbstractStore , self ) . __init__ ( ** kwargs ) <EOL> self . store_load ( ) <EOL> def exis... |
<s> import unittest <EOL> import kivy . multistroke <EOL> from kivy . multistroke import Recognizer , MultistrokeGesture <EOL> from kivy . vector import Vector <EOL> best_score = <NUM_LIT:0.0> <EOL> counter = <NUM_LIT:0> <EOL> def best_score_cb ( result ) : <EOL> global best_score <EOL> best_score = result . best [ '<S... |
<s> r"""<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> import os <EOL> import sys <EOL> import re <EOL> import time <EOL> import inspect <EOL> import keyword <EOL> import tokenize <EOL> from optparse import OptionParser <EOL> from fnmatch import fnmatch <EOL> try : <EOL> from ConfigParser import RawConfigParser <EO... |
<s> '''<STR_LIT>''' <EOL> __all__ = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> from kivy . uix . floatlayout import FloatLayout <EOL> from kivy . uix . scatter import Scatter , ScatterPlane <EOL> from kivy . properties import ObjectProperty <EOL> class ScatterLayout ( Scatter ) : <EOL> '''<STR_LIT>''' <EOL> content = ObjectPr... |
<s> from kivy . app import App <EOL> from kivy . uix . boxlayout import BoxLayout <EOL> from kivy . uix . button import Button <EOL> from kivy . lang import Builder <EOL> from kivy . properties import StringProperty , ObjectProperty <EOL> from plyer import battery <EOL> Builder . load_string ( '''<STR_LIT>''' ) <EOL> c... |
<s> class Sms ( object ) : <EOL> '''<STR_LIT>''' <EOL> def send ( self , recipient , message ) : <EOL> self . _send ( recipient = recipient , message = message ) <EOL> def _send ( self , ** kwargs ) : <EOL> raise NotImplementedError ( ) </s>
|
<s> """<STR_LIT>""" <EOL> from pyobjus import autoclass <EOL> NSString = autoclass ( "<STR_LIT>" ) <EOL> AVCaptureDevice = autoclass ( "<STR_LIT>" ) <EOL> AVMediaTypeVideo = NSString . alloc ( ) . initWithUTF8String_ ( "<STR_LIT>" ) <EOL> AVCaptureTorchModeOff = <NUM_LIT:0> <EOL> AVCaptureTorchModeOn = <NUM_LIT:1> <EOL... |
<s> import subprocess <EOL> from plyer . facades import TTS <EOL> from plyer . utils import whereis_exe <EOL> class EspeakTextToSpeech ( TTS ) : <EOL> '''<STR_LIT>''' <EOL> def _speak ( self , ** kwargs ) : <EOL> subprocess . call ( [ "<STR_LIT>" , kwargs . get ( '<STR_LIT:message>' ) ] ) <EOL> def instance ( ) : <EOL>... |
<s> import unittest <EOL> from jnius import autoclass , java_method , PythonJavaClass , cast <EOL> from jnius . signatures import * <EOL> JObject = autoclass ( '<STR_LIT>' ) <EOL> JString = autoclass ( '<STR_LIT>' ) <EOL> JListIterator = autoclass ( "<STR_LIT>" ) <EOL> class TestImplemIterator ( PythonJavaClass ) : <EO... |
<s> from jnius import PythonJavaClass , java_method , autoclass , cast <EOL> from android . config import JAVA_NAMESPACE , JNI_NAMESPACE <EOL> _activity = autoclass ( JAVA_NAMESPACE + '<STR_LIT>' ) . mActivity <EOL> _callbacks = { <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : [ ] } <EOL> class NewIntentListener ( Pytho... |
<s> from pythonforandroid . toolchain import CythonRecipe , shprint , current_directory , ArchARM <EOL> from os . path import exists , join <EOL> import sh <EOL> import glob <EOL> class KivySDL2Recipe ( CythonRecipe ) : <EOL> version = '<STR_LIT>' <EOL> url = '<STR_LIT>' <EOL> site_packages_name = '<STR_LIT>' <EOL> dep... |
<s> from pythonforandroid . recipe import CythonRecipe , Recipe <EOL> from os . path import join <EOL> from pythonforandroid . util import current_directory <EOL> import sh <EOL> from pythonforandroid . logger import shprint <EOL> import glob <EOL> class PyZMQRecipe ( CythonRecipe ) : <EOL> name = '<STR_LIT>' <EOL> ver... |
<s> def box_shadow ( value ) : <EOL> return output ( [ <EOL> '<STR_LIT>' + value + '<STR_LIT:;>' , <EOL> '<STR_LIT>' + value + '<STR_LIT>' <EOL> ] ) <EOL> def transition ( value ) : <EOL> return output ( [ <EOL> '<STR_LIT>' + value + '<STR_LIT:;>' , <EOL> '<STR_LIT>' + value + '<STR_LIT>' <EOL> ] ) <EOL> def transform ... |
<s> from PIL import Image <EOL> def BuildMultilayer ( src_filenames ) : <EOL> assert <NUM_LIT:1> <= len ( src_filenames ) and len ( src_filenames ) <= <NUM_LIT:4> <EOL> imgs = [ Image . open ( filename ) for filename in src_filenames ] <EOL> expected_size = imgs [ <NUM_LIT:0> ] . size <EOL> image_mode = "<STR_LIT>" <EO... |
<s> """<STR_LIT>""" <EOL> try : <EOL> from collections import OrderedDict as _default_dict <EOL> except ImportError : <EOL> _default_dict = dict <EOL> import re <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR... |
<s> """<STR_LIT>""" <EOL> from _ast import * <EOL> from _ast import __version__ <EOL> def parse ( source , filename = '<STR_LIT>' , mode = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> return compile ( source , filename , mode , PyCF_ONLY_AST ) <EOL> def literal_eval ( node_or_string ) : <EOL> """<STR_LIT>""" <EOL> _safe... |
<s> """<STR_LIT>""" <EOL> from warnings import warnpy3k <EOL> warnpy3k ( "<STR_LIT>" <EOL> "<STR_LIT>" , stacklevel = <NUM_LIT:2> ) <EOL> del warnpy3k <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> def getstatus ( file ) : <EOL> """<STR_LIT>""" <EOL> import warnings <EOL> warnings . warn ( "<STR_LIT>... |
<s> """<STR_LIT>""" <EOL> NUL = <NUM_LIT> <EOL> SOH = <NUM_LIT> <EOL> STX = <NUM_LIT> <EOL> ETX = <NUM_LIT> <EOL> EOT = <NUM_LIT> <EOL> ENQ = <NUM_LIT> <EOL> ACK = <NUM_LIT> <EOL> BEL = <NUM_LIT> <EOL> BS = <NUM_LIT> <EOL> TAB = <NUM_LIT> <EOL> HT = <NUM_LIT> <EOL> LF = <NUM_LIT> <EOL> NL = <NUM_LIT> <EOL> VT = <NUM_LI... |
<s> """<STR_LIT>""" <EOL> __all__ = [ "<STR_LIT>" ] <EOL> from email import encoders <EOL> from email . mime . nonmultipart import MIMENonMultipart <EOL> class MIMEApplication ( MIMENonMultipart ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , _data , _subtype = '<STR_LIT>' , <EOL> _encoder = encoders . encode_bas... |
<s> """<STR_LIT>""" <EOL> import codecs , quopri <EOL> try : <EOL> from cStringIO import StringIO <EOL> except ImportError : <EOL> from StringIO import StringIO <EOL> def quopri_encode ( input , errors = '<STR_LIT:strict>' ) : <EOL> """<STR_LIT>""" <EOL> assert errors == '<STR_LIT:strict>' <EOL> f = StringIO ( str ( in... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> try : <EOL> import SOCKS ; socket = SOCKS ; del SOCKS <EOL> from socket import getfqdn ; socket . getfqdn = getfqdn ; del getfqdn <EOL> except ImportError : <EOL> import socket <EOL> from socket import _GLOBAL_DEFAULT_TIMEOUT <EOL> __all__ = [ "<STR_LIT>" , "<S... |
<s> """<STR_LIT>""" <EOL> import re <EOL> try : <EOL> from _json import make_scanner as c_make_scanner <EOL> except ImportError : <EOL> c_make_scanner = None <EOL> __all__ = [ '<STR_LIT>' ] <EOL> NUMBER_RE = re . compile ( <EOL> r'<STR_LIT>' , <EOL> ( re . VERBOSE | re . MULTILINE | re . DOTALL ) ) <EOL> def py_make_sc... |
<s> """<STR_LIT>""" <EOL> from . . import fixer_base <EOL> from . . fixer_util import BlankLine <EOL> class FixFuture ( fixer_base . BaseFix ) : <EOL> BM_compatible = True <EOL> PATTERN = """<STR_LIT>""" <EOL> run_order = <NUM_LIT:10> <EOL> def transform ( self , node , results ) : <EOL> new = BlankLine ( ) <EOL> new .... |
<s> """<STR_LIT>""" <EOL> from lib2to3 import fixer_base , pytree <EOL> from lib2to3 . fixer_util import token , syms <EOL> class FixSetLiteral ( fixer_base . BaseFix ) : <EOL> BM_compatible = True <EOL> explicit = True <EOL> PATTERN = """<STR_LIT>""" <EOL> def transform ( self , node , results ) : <EOL> single = resul... |
<s> from lib2to3 . fixer_base import BaseFix <EOL> class FixFirst ( BaseFix ) : <EOL> run_order = <NUM_LIT:1> <EOL> def match ( self , node ) : return False </s>
|
<s> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> import os <EOL> import sys <EOL> import socket <EOL> import errno <EOL> import time <EOL> import tempfile <EOL> import itertools <EOL> import _multiprocessing <EOL> from multiprocessing import current_process , AuthenticationError <EOL> from multiprocessin... |
<s> import warnings <EOL> warnings . warn ( "<STR_LIT>" , <EOL> DeprecationWarning , <NUM_LIT:2> ) <EOL> from hashlib import sha1 as sha <EOL> new = sha <EOL> blocksize = <NUM_LIT:1> <EOL> digest_size = <NUM_LIT:20> <EOL> digestsize = <NUM_LIT:20> </s>
|
<s> VERSION = "<STR_LIT>" <EOL> try : <EOL> import warnings <EOL> except ImportError : <EOL> warnings = None <EOL> class _imaging_not_installed : <EOL> def __getattr__ ( self , id ) : <EOL> raise ImportError ( "<STR_LIT>" ) <EOL> try : <EOL> __import__ ( "<STR_LIT>" ) <EOL> except ImportError : <EOL> pass <EOL> try : <... |
<s> __version__ = "<STR_LIT>" <EOL> import struct <EOL> import Image , ImageFile <EOL> def _accept ( s ) : <EOL> return s [ : <NUM_LIT:8> ] == "<STR_LIT>" <EOL> class McIdasImageFile ( ImageFile . ImageFile ) : <EOL> format = "<STR_LIT>" <EOL> format_description = "<STR_LIT>" <EOL> def _open ( self ) : <EOL> s = self .... |
<s> </s>
|
<s> """<STR_LIT>""" <EOL> import _symtable <EOL> from _symtable import ( USE , DEF_GLOBAL , DEF_LOCAL , DEF_PARAM , <EOL> DEF_IMPORT , DEF_BOUND , OPT_IMPORT_STAR , OPT_EXEC , OPT_BARE_EXEC , <EOL> SCOPE_OFF , SCOPE_MASK , FREE , GLOBAL_IMPLICIT , GLOBAL_EXPLICIT , CELL , LOCAL ) <EOL> import weakref <EOL> __all__ = [ ... |
<s> """<STR_LIT>""" <EOL> import base64 <EOL> import hashlib <EOL> import httplib <EOL> import mimetools <EOL> import os <EOL> import posixpath <EOL> import random <EOL> import re <EOL> import socket <EOL> import sys <EOL> import time <EOL> import urlparse <EOL> import bisect <EOL> import warnings <EOL> try : <EOL> fro... |
<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> from pyexpat import * </s>
|
<s> """<STR_LIT>""" <EOL> from . base import BaseStorage <EOL> class Storage ( BaseStorage ) : <EOL> """<STR_LIT>""" <EOL> def run ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ f for f in self ] </s>
|
<s> from flask import render_template , Blueprint , current_app <EOL> from . . auth . forms import LoginForm <EOL> core = Blueprint ( '<STR_LIT>' , __name__ , <EOL> template_folder = '<STR_LIT>' , <EOL> static_url_path = '<STR_LIT>' , <EOL> static_folder = '<STR_LIT>' ) <EOL> if current_app and current_app . config . g... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> PY2 = sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:2> <EOL> _identity = lambda x : x <EOL> if not PY2 : <EOL> text_type = str <EOL> string_types = ( str , ) <EOL> integer_types = ( int , ) <EOL> iterkeys = lambda d : iter ( d . keys ( ) ) <EOL> itervalues = lambda d : iter (... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from peewee import * <EOL> import datetime <EOL> import decimal <EOL> from . . import mix_types as t <EOL> from . . main import ( <EOL> TypeMixer as BaseTypeMixer , Mixer as BaseMixer , SKIP_VALUE , <EOL> GenFactory as BaseFactory , partial , faker ... |
<s> from django import VERSION as django_version <EOL> if django_version >= ( <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:0> ) : <EOL> import json <EOL> else : <EOL> from django . utils import simplejson as json <EOL> from django . http import HttpResponseNotAllowed , HttpResponseServerError <EOL> from util import to_json_res... |
<s> DATABASE = '<STR_LIT>' <EOL> XML = '<STR_LIT>' <EOL> INDEX = '<STR_LIT:index>' <EOL> CRS_EXCEPTIONS = '<STR_LIT>' <EOL> FILES = [ "<STR_LIT>" , <EOL> "<STR_LIT>" ] <EOL> kind_list = { <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>... |
<s> from django . contrib import admin <EOL> from vk_iframe . models import Country , City , Profile <EOL> from django . conf import settings <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> class CountryAdmin ( admin . ModelAdmin ) : <EOL> list_display = [ '<STR_LIT:title>' , '<STR_LIT:id>' ] <E... |
<s> from __future__ import absolute_import , with_statement <EOL> import os <EOL> try : <EOL> from ConfigParser import ConfigParser , DEFAULTSECT <EOL> except ImportError : <EOL> from configparser import ConfigParser , DEFAULTSECT <EOL> from . api import select_random <EOL> from . exceptions import PortForException <EO... |
<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 . rename_column ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def backwards ( self , orm ) : ... |
<s> from django . conf . urls . defaults import patterns , include <EOL> from django . contrib import admin <EOL> from django . test import TestCase <EOL> from django_any . test import Client <EOL> def view ( request ) : <EOL> """<STR_LIT>""" <EOL> from django import forms <EOL> from django . http import HttpResponse <... |
<s> from django . db import models <EOL> from django . test import TestCase <EOL> from django_fsm import FSMField , transition <EOL> class BlogPostWithStringField ( models . Model ) : <EOL> state = FSMField ( default = '<STR_LIT>' ) <EOL> @ transition ( field = '<STR_LIT:state>' , source = '<STR_LIT>' , target = '<STR_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.