code stringlengths 9 256k |
|---|
<s> from __future__ import with_statement <EOL> import os <EOL> import sys <EOL> from optparse import make_option <EOL> from django . core . files . storage import FileSystemStorage <EOL> from django . core . management . base import CommandError , NoArgsCommand <EOL> from django . utils . encoding import smart_str , s... |
<s> from django . utils . timezone import utc <EOL> from django_db_utils import pg_bulk_update <EOL> from example . models import Sample , SampleStatus <EOL> def now ( ) : <EOL> from datetime import datetime <EOL> return datetime . utcnow ( ) . replace ( tzinfo = utc ) <EOL> def make_fake_data ( samples_to_make = <NUM_... |
<s> import numpy <EOL> from theano import config <EOL> from pylearn2 . space import CompositeSpace <EOL> from pylearn2 . utils import safe_zip <EOL> from pylearn2 . utils . data_specs import is_flat_specs <EOL> class FiniteDatasetIterator ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , dataset , subset_i... |
<s> from geventwebsocket . handler import WebSocketHandler <EOL> from gunicorn . workers . ggevent import GeventPyWSGIWorker <EOL> class GeventWebSocketWorker ( GeventPyWSGIWorker ) : <EOL> wsgi_handler = WebSocketHandler </s>
|
<s> from os import kill , system , path , chdir <EOL> from signal import alarm , signal , SIGALRM , SIGKILL <EOL> import time <EOL> import subprocess <EOL> from re import sub , compile , search <EOL> from sys import argv <EOL> import datetime <EOL> import urllib <EOL> REAVER = '<STR_LIT>' <EOL> PIXIEWPS = '<STR_LIT>' <... |
<s> """<STR_LIT>""" </s>
|
<s> from django . conf . urls . defaults import * <EOL> from views import home , places , redirect <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> url ( r'<STR_LIT>' , home , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , places , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , redirect , name = '<STR_LIT>' ) ,... |
<s> import sys <EOL> from m4io import getAlignments , longestNonOverlapping <EOL> from nucio import recordToString <EOL> if not len ( sys . argv ) == <NUM_LIT:2> : <EOL> sys . exit ( "<STR_LIT>" ) <EOL> inm4 = sys . argv [ <NUM_LIT:1> ] <EOL> for read , alignments in getAlignments ( inm4 , longestNonOverlapping ) : <EO... |
<s> def strAppend ( suffix ) : <EOL> return lambda x : x + suffix </s>
|
<s> """<STR_LIT>""" </s>
|
<s> import sys <EOL> import math <EOL> import array <EOL> from . utils import ( <EOL> db_to_float , <EOL> ratio_to_db , <EOL> register_pydub_effect , <EOL> make_chunks , <EOL> audioop , <EOL> get_min_max_value <EOL> ) <EOL> from . silence import split_on_silence <EOL> from . exceptions import TooManyMissingFrames , Inv... |
<s> import datetime <EOL> import threading <EOL> import time <EOL> import os <EOL> try : <EOL> import socks <EOL> NO_SOCKS = False <EOL> except ImportError : <EOL> NO_SOCKS = True <EOL> import socket <EOL> from parsers . base import SiteParserBase <EOL> from parsers . factory import SiteParserFactory <EOL> from util im... |
<s> from random import randint <EOL> from math import hypot <EOL> from random import shuffle <EOL> __all__ = [ "<STR_LIT>" ] <EOL> def dist ( p , q ) : <EOL> return hypot ( p [ <NUM_LIT:0> ] - q [ <NUM_LIT:0> ] , p [ <NUM_LIT:1> ] - q [ <NUM_LIT:1> ] ) <EOL> def cell ( point , pas ) : <EOL> x , y = point <EOL> return (... |
<s> def maximum_border_length ( w ) : <EOL> """<STR_LIT>""" <EOL> n = len ( w ) <EOL> L = [ <NUM_LIT:0> ] * ( n + <NUM_LIT:1> ) <EOL> for i in range ( <NUM_LIT:1> , n ) : <EOL> k = L [ i ] <EOL> while w [ k ] != w [ i ] and k > <NUM_LIT:0> : <EOL> k = L [ k ] <EOL> if w [ k ] == w [ i ] : <EOL> L [ i + <NUM_LIT:1> ] = ... |
<s> def subset_sum ( x , R ) : <EOL> """<STR_LIT>""" <EOL> b = [ False ] * ( R + <NUM_LIT:1> ) <EOL> b [ <NUM_LIT:0> ] = True <EOL> for xi in x : <EOL> for s in range ( R , xi - <NUM_LIT:1> , - <NUM_LIT:1> ) : <EOL> b [ s ] |= b [ s - xi ] <EOL> return b [ R ] <EOL> def coin_change ( x , R ) : <EOL> """<STR_LIT>""" <EO... |
<s> from numbers import Number , Integral <EOL> import scipy . sparse as sp <EOL> import numpy as np <EOL> from tabulate import tabulate <EOL> from . cindexmatrix import _dict2matrix <EOL> class IndexMatrix ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , matrix , row2word = None , col2word = None ) : <EO... |
<s> import os <EOL> from setuptools import setup , find_packages <EOL> _here = os . path . dirname ( __file__ ) <EOL> README = open ( os . path . join ( _here , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , '<STR_LIT:r>' ) . read ( ) <EOL> CHANGES = open ( os . path . join ( _here , '<STR_LIT>' ) , '<STR_LIT:r>' ) . read... |
<s> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> import os <EOL> import sys <EOL> from . . languages import translation_table , print_table <EOL> class TestLanguages ( unittest . TestCase ) : <EOL> def test_translation_table ( self ) : <EOL> table = translation_table (... |
<s> import nmrglue as ng <EOL> import matplotlib . pyplot as plt <EOL> dic , data = ng . bruker . read ( '<STR_LIT>' ) <EOL> data = ng . bruker . remove_digital_filter ( dic , data ) <EOL> data = ng . proc_base . zf_size ( data , <NUM_LIT> ) <EOL> data = ng . proc_base . fft ( data ) <EOL> data = ng . proc_base . ps ( ... |
<s> import nmrglue as ng <EOL> import matplotlib . pyplot as plt <EOL> dic , data = ng . pipe . read ( "<STR_LIT>" ) <EOL> uc = ng . pipe . make_uc ( dic , data ) <EOL> fig = plt . figure ( ) <EOL> ax = fig . add_subplot ( <NUM_LIT> ) <EOL> ax . plot ( uc . ppm_scale ( ) , data , '<STR_LIT>' ) <EOL> ax . set_yticklabel... |
<s> import nmrglue as ng <EOL> dic , data = ng . pipe . read ( "<STR_LIT>" ) <EOL> dic , data = ng . pipe_proc . sp ( dic , data , off = <NUM_LIT> , end = <NUM_LIT> , pow = <NUM_LIT:2> , c = <NUM_LIT:1.0> ) <EOL> dic , data = ng . pipe_proc . zf ( dic , data , auto = True ) <EOL> dic , data = ng . pipe_proc . ft ( dic ... |
<s> """<STR_LIT>""" <EOL> import math <EOL> from warnings import warn <EOL> import numpy as np <EOL> def read ( filename , ftype = None , ndim = None , NP = None , NI = None , spe = None ) : <EOL> """<STR_LIT>""" <EOL> if ftype is None : <EOL> ftype = guess_ftype ( filename ) <EOL> if ftype == "<STR_LIT>" : <EOL> retur... |
<s> """<STR_LIT>""" <EOL> import nmrglue . fileio . pipe as pipe <EOL> import nmrglue . process . pipe_proc as p <EOL> d , a = pipe . read ( "<STR_LIT>" ) <EOL> d , a = p . dx ( d , a ) <EOL> pipe . write ( "<STR_LIT>" , d , a , overwrite = True ) </s>
|
<s> """<STR_LIT>""" <EOL> import nmrglue . fileio . pipe as pipe <EOL> import nmrglue . process . pipe_proc as p <EOL> d , a = pipe . read ( "<STR_LIT>" ) <EOL> d , a = p . shuf ( d , a , mode = "<STR_LIT>" ) <EOL> pipe . write ( "<STR_LIT>" , d , a , overwrite = True ) <EOL> d , a = pipe . read ( "<STR_LIT>" ) <EOL> d... |
<s> from __future__ import unicode_literals <EOL> import threading <EOL> import time <EOL> from django . conf import settings <EOL> from django . db . models . signals import pre_save <EOL> from django . utils . functional import curry <EOL> from django . apps import apps <EOL> from auditlog . models import LogEntry <E... |
<s> from zerotest . forwarder import Forwarder <EOL> request = None <EOL> response = None <EOL> def test_callback ( ) : <EOL> def callback ( req , res ) : <EOL> global request <EOL> global response <EOL> request = req <EOL> response = res <EOL> forwarder = Forwarder ( '<STR_LIT>' ) <EOL> forwarder . on_forward_complete... |
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> __licence__ = '<STR_LIT>' <EOL> class ExitStatus : <EOL> """<STR_LIT>""" <EOL> OK = <NUM_LIT:0> <EOL> ERROR = <NUM_LIT:1> <EOL> ERROR_TIMEOUT = <NUM_LIT:2> <EOL> ERROR_TOO_MANY_REDIRECTS = <NUM_LIT:6> <EOL> ERROR_HTTP_3XX = <NUM_LI... |
<s> """<STR_LIT>""" <EOL> from utils import TestEnvironment , http , HTTP_OK <EOL> from fixtures import FILE_PATH <EOL> class TestImplicitHTTPMethod : <EOL> def test_implicit_GET ( self , httpbin ) : <EOL> r = http ( httpbin . url + '<STR_LIT>' ) <EOL> assert HTTP_OK in r <EOL> def test_implicit_GET_with_headers ( self... |
<s> __author__ = '<STR_LIT>' <EOL> __email__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> from . base import unshorten </s>
|
<s> from flup . server . fcgi import WSGIServer <EOL> from frontend import app <EOL> WSGIServer ( app , bindAddress = app . config [ '<STR_LIT>' ] ) . run ( ) </s>
|
<s> from django . db . models import Q <EOL> from django . contrib . contenttypes . models import ContentType <EOL> from rubberstamp . models import AppPermission , AssignedPermission <EOL> from rubberstamp . utils import get_perm_q_for_user <EOL> from rubberstamp . exceptions import PermissionLookupError <EOL> class A... |
<s> """<STR_LIT>""" <EOL> import json <EOL> from . models import GCMDevice <EOL> try : <EOL> from urllib . request import Request , urlopen <EOL> from urllib . parse import urlencode <EOL> except ImportError : <EOL> from urllib2 import Request , urlopen <EOL> from urllib import urlencode <EOL> from django . core . exce... |
<s> __author__ = '<STR_LIT>' <EOL> class APIError ( Exception ) : <EOL> def __init__ ( self , msg , code = None ) : <EOL> self . msg = msg <EOL> self . code = code <EOL> Exception . __init__ ( self , msg , code ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' . format ( self . code , self . msg ) if self . code ... |
<s> from telegrambot . bot_views . generic . base import TemplateCommandView <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django . db . models . query import QuerySet <EOL> from django . utils import six <EOL> class ListCommandView ( TemplateCommandView ) : <EOL> queryset = None <EOL> co... |
<s> from telegrambot . models import User , Chat , Bot , AuthToken <EOL> from telegrambot . test import factories , testcases <EOL> from factory import DjangoModelFactory , Sequence <EOL> from tests . models import Author <EOL> from django . core . urlresolvers import reverse <EOL> from rest_framework import status <EO... |
<s> import warnings <EOL> import errno <EOL> import hashlib <EOL> import os <EOL> import re <EOL> from pilkit . processors import Anchor , ResizeToFit , MakeOpaque <EOL> from pilkit . utils import save_image <EOL> from flask import current_app <EOL> from PIL import Image , ImageDraw , ImageFont , ImageColor <EOL> from ... |
<s> import os <EOL> import random <EOL> import re <EOL> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( os . path . dirname ( os . path . dirname ( os . path . dirname ( os . path . realpath ( __file__ ) ) ) ) ) ) <EOL> import helper <EOL> from elodie import geolocation <EOL> os . environ [ '... |
<s> from flask import make_response <EOL> from marshmallow import fields , Schema <EOL> from flask_apispec . utils import Ref <EOL> from flask_apispec . views import MethodResource <EOL> from flask_apispec import doc , use_kwargs , marshal_with <EOL> class TestFunctionViews : <EOL> def test_use_kwargs ( self , app , cl... |
<s> """<STR_LIT>""" <EOL> import re <EOL> import requests <EOL> from bs4 import BeautifulSoup <EOL> from werkzeug import cached_property <EOL> from requests . packages . urllib3 . util . retry import Retry <EOL> from robobrowser import helpers <EOL> from robobrowser import exceptions <EOL> from robobrowser . compat imp... |
<s> """<STR_LIT>""" <EOL> import stat <EOL> import time <EOL> import sys <EOL> if sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:7> ) : <EOL> import unittest2 as unittest <EOL> else : <EOL> import unittest <EOL> from pyfakefs import fake_filesystem <EOL> from pyfakefs import fake_filesystem_shutil <EOL> class FakeShutil... |
<s> import xlsxwriter <EOL> workbook = xlsxwriter . Workbook ( '<STR_LIT>' ) <EOL> worksheet = workbook . add_worksheet ( ) <EOL> bold = workbook . add_format ( { '<STR_LIT>' : <NUM_LIT:1> } ) <EOL> headings = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> data = [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ <NUM_... |
<s> import http . server <EOL> import socketserver <EOL> import io <EOL> import xlsxwriter <EOL> class Handler ( http . server . SimpleHTTPRequestHandler ) : <EOL> def do_GET ( self ) : <EOL> output = io . BytesIO ( ) <EOL> workbook = xlsxwriter . Workbook ( output , { '<STR_LIT>' : True } ) <EOL> worksheet = workbook ... |
<s> import xlsxwriter <EOL> workbook = xlsxwriter . Workbook ( '<STR_LIT>' ) <EOL> worksheet = workbook . add_worksheet ( ) <EOL> expenses = ( <EOL> [ '<STR_LIT>' , <NUM_LIT:1000> ] , <EOL> [ '<STR_LIT>' , <NUM_LIT:100> ] , <EOL> [ '<STR_LIT>' , <NUM_LIT> ] , <EOL> [ '<STR_LIT>' , <NUM_LIT:50> ] , <EOL> ) <EOL> row = <... |
<s> from . import xmlwriter <EOL> from . shape import Shape <EOL> from . utility import get_rgb_color <EOL> class Drawing ( xmlwriter . XMLwriter ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( Drawing , self ) . __init__ ( ) <EOL> self . drawings = [ ] <EOL> self . embedded ... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from datetime import date <EOL> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<ST... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . image_dir =... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . image_dir =... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . image_dir =... |
<s> from . . excel_comparsion_test import ExcelComparisonTest <EOL> from ... workbook import Workbook <EOL> class TestCompareXLSXFiles ( ExcelComparisonTest ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . maxDiff = None <EOL> filename = '<STR_LIT>' <EOL> test_dir = '<STR_LIT>' <EOL> self . got_filenam... |
<s> import unittest <EOL> from ... compatibility import StringIO <EOL> from . . helperfunctions import _xml_to_list <EOL> from ... relationships import Relationships <EOL> class TestAssembleRelationships ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_assemble_xml_file ( self ) : <EOL> """<STR_LIT>""" <E... |
<s> import unittest <EOL> from ... compatibility import StringIO <EOL> from ... styles import Styles <EOL> class TestWriteMruColors ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . fh = StringIO ( ) <EOL> self . styles = Styles ( ) <EOL> self . styles . _set_filehandle ( self . fh... |
<s> import unittest <EOL> from ... compatibility import StringIO <EOL> from . . helperfunctions import _xml_to_list , _vml_to_list <EOL> from ... vml import Vml <EOL> class TestAssembleVml ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_assemble_xml_file ( self ) : <EOL> """<STR_LIT>""" <EOL> self . maxD... |
<s> import unittest <EOL> from ... compatibility import StringIO <EOL> from ... workbook import Workbook <EOL> class TestWriteSheet ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . fh = StringIO ( ) <EOL> self . workbook = Workbook ( ) <EOL> self . workbook . _set_filehandle ( sel... |
<s> import unittest <EOL> import datetime <EOL> from ... worksheet import Worksheet <EOL> class TestConvertDateTime ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . worksheet = Worksheet ( ) <EOL> self . excel_seconds = [ <EOL> ( '<STR_LIT>' , <NUM_LIT:0> ) , <EOL> ( '<STR_LIT>' ,... |
<s> import unittest <EOL> from ... compatibility import StringIO <EOL> from ... compat_collections import namedtuple <EOL> from ... worksheet import Worksheet <EOL> class TestWriteCell ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . fh = StringIO ( ) <EOL> self . worksheet = Work... |
<s> import unittest <EOL> from ... compatibility import StringIO <EOL> from ... worksheet import Worksheet <EOL> class TestWriteSheetViews ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . fh = StringIO ( ) <EOL> self . worksheet = Worksheet ( ) <EOL> self . worksheet . _set_fileha... |
<s> class StrategyBase ( object ) : <EOL> def __init__ ( self , instrument ) : <EOL> self . instrument = instrument <EOL> self . positions = [ ] <EOL> if self . current_tick_timeframe and not self . current_tick_timeframe in self . timeframes : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> def open_position ( self , posi... |
<s> '''<STR_LIT>''' <EOL> from sqlalchemy import Column <EOL> from sqlalchemy . orm import deferred , synonym <EOL> from sqlalchemy . ext . associationproxy import association_proxy <EOL> from elixir . statements import ClassMutator <EOL> from elixir . properties import Property <EOL> __doc_all__ = [ '<STR_LIT>' ] <EOL... |
<s> """<STR_LIT>""" <EOL> from elixir import * <EOL> class TestOldMethods ( object ) : <EOL> def setup ( self ) : <EOL> metadata . bind = '<STR_LIT>' <EOL> def teardown ( self ) : <EOL> cleanup_all ( ) <EOL> def test_get ( self ) : <EOL> class A ( Entity ) : <EOL> name = Field ( String ( <NUM_LIT:32> ) ) <EOL> setup_al... |
<s> import time <EOL> import RPi . GPIO as io <EOL> class PingSensor ( object ) : <EOL> def __init__ ( self , trigger , echo , range = ( <NUM_LIT:0> , <NUM_LIT:100> ) ) : <EOL> self . trigger = trigger <EOL> self . echo = echo <EOL> self . range = range <EOL> self . num_values = <NUM_LIT:1> <EOL> io . setmode ( io . BC... |
<s> __version__ = '<STR_LIT>' </s>
|
<s> import mechanize <EOL> from dbconn import DropboxConnection <EOL> def upload_file ( local_file , remote_dir , remote_file , email , password ) : <EOL> """<STR_LIT>""" <EOL> conn = DropboxConnection ( email , password ) <EOL> conn . upload_file ( local_file , remote_dir , remote_file ) </s>
|
<s> import os <EOL> import re <EOL> import signal <EOL> import pytest <EOL> from daemonocle import Daemon , DaemonError <EOL> def test_simple ( pyscript ) : <EOL> script = pyscript ( """<STR_LIT>""" ) <EOL> result = script . run ( '<STR_LIT:start>' ) <EOL> assert result . returncode == <NUM_LIT:0> <EOL> assert result .... |
<s> from django . contrib import admin <EOL> from django . utils . html import format_html <EOL> from django . conf import settings <EOL> from django . contrib import messages <EOL> from django import forms <EOL> from django . forms . models import BaseInlineFormSet <EOL> from cparte . models import Initiative , Campai... |
<s> from distutils . core import setup <EOL> with open ( '<STR_LIT>' ) as f : <EOL> long_description = f . read ( ) <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = "<STR_LIT>" , <EOL> long_description = long_description , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR... |
<s> import unittest <EOL> from pykka import ActorDeadError , ActorProxy , ThreadingActor <EOL> class SomeObject ( object ) : <EOL> cat = '<STR_LIT>' <EOL> pykka_traversable = False <EOL> class AnActor ( object ) : <EOL> bar = SomeObject ( ) <EOL> bar . pykka_traversable = True <EOL> foo = '<STR_LIT:foo>' <EOL> def __in... |
<s> import os . path , time , sys , threading , thread , xml . dom . pulldom <EOL> messageBegin = "<STR_LIT>" % <NUM_LIT:1> <EOL> messageEnd = "<STR_LIT>" % <NUM_LIT:2> <EOL> global logPath <EOL> if sys . platform == "<STR_LIT:win32>" : <EOL> logPath = "<STR_LIT>" <EOL> else : <EOL> logPath = "<STR_LIT>" <EOL> global l... |
<s> import devon , devon . projects <EOL> from devon . tags import * <EOL> import fnmatch , glob , mmap , os . path , re , sys <EOL> reNewLine = re . compile ( "<STR_LIT:\n>" ) <EOL> def search ( path , terms , out , replaceTerms = None , fileTypes = None , caseSensitive = True ) : <EOL> if not terms : <EOL> return <NU... |
<s> import sys , os <EOL> sys . path . append ( os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT>" ) ) <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>' ... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import time <EOL> import datetime <EOL> import random <EOL> import hashlib <EOL> import Cookie <EOL> import pickle <EOL> import sys <EOL> import logging <EOL> from time import strftime <EOL> from google . appengine . ext import db <EOL> from google . appengine . api import memc... |
<s> manual_verstr = "<STR_LIT>" <EOL> auto_build_num = "<STR_LIT>" <EOL> verstr = manual_verstr + "<STR_LIT:.>" + auto_build_num <EOL> try : <EOL> from pyutil . version_class import Version as pyutil_Version <EOL> except ( ImportError , ValueError ) : <EOL> from distutils . version import LooseVersion as distutils_Vers... |
<s> """<STR_LIT>""" <EOL> from pygments . formatter import Formatter <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class EscapeSequence : <EOL> def __init__ ( self , fg = None , bg = None , bold = False , underline = False ) : <EOL> self . fg = fg <EOL> self . bg = bg <EOL> self . bold = bold <EOL> self . underline = underline... |
<s> """<STR_LIT>""" <EOL> from pygments . style import Style <EOL> from pygments . token import Keyword , Name , Comment , String , Error , Number , Operator , Generic , Whitespace <EOL> class FriendlyStyle ( Style ) : <EOL> """<STR_LIT>""" <EOL> background_color = "<STR_LIT>" <EOL> default_style = "<STR_LIT>" <EOL> st... |
<s> """<STR_LIT>""" <EOL> import matplotlib . pyplot as plt <EOL> import numpy as np <EOL> from mpldatacursor import datacursor <EOL> data = np . arange ( <NUM_LIT:100> ) . reshape ( ( <NUM_LIT:10> , <NUM_LIT:10> ) ) <EOL> fig , axes = plt . subplots ( ncols = <NUM_LIT:2> ) <EOL> axes [ <NUM_LIT:0> ] . imshow ( data , ... |
<s> '''<STR_LIT>''' <EOL> from . cli import main <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
|
<s> from django . db import models <EOL> from django . db . models import Q <EOL> from django . template . defaultfilters import slugify <EOL> class ThreadManager ( models . Manager ) : <EOL> def get_user_query_set ( self , user ) : <EOL> qs = self . get_query_set ( ) . order_by ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> if u... |
<s> from wallpaper . items import Wallpaper <EOL> import re <EOL> import scrapy <EOL> from scrapy . contrib . spiders import CrawlSpider , Rule <EOL> from scrapy . contrib . linkextractors import LinkExtractor <EOL> class WallbaseSearch ( CrawlSpider ) : <EOL> name = "<STR_LIT>" <EOL> allowed_domains = [ "<STR_LIT>" , ... |
<s> from setuptools import setup <EOL> import snip_setuptools_verify1 <EOL> setup ( <EOL> zip_safe = False , <EOL> packages = [ '<STR_LIT>' ] , <EOL> ext_modules = [ snip_setuptools_verify1 . ffi . verifier . get_extension ( ) ] ) </s>
|
<s> import sys , os , py <EOL> from cffi import FFI , VerificationError , FFIError <EOL> from cffi import recompiler <EOL> from testing . udir import udir <EOL> from testing . support import u , long <EOL> from testing . support import FdWriteCapture , StdErrCapture <EOL> def check_type_table ( input , expected_output ... |
<s> from django . conf . urls . defaults import * <EOL> from django . contrib import admin <EOL> admin . autodiscover ( ) <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> ( r'<STR_LIT>' , include ( '<STR_LIT>' ) ) , <EOL> ( r'<STR_LIT>' , include ( admin . site . urls ) ) , <EOL> ) </s>
|
<s> from __future__ import print_function <EOL> import json <EOL> import os <EOL> import sys <EOL> import unittest <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from environ import Env , Path , REDIS_DRIVER <EOL> class BaseTests ( unittest . TestCase ) : <EOL> URL = '<STR_LIT>' <EOL> POSTGRES ... |
<s> class TestOptionsLoader ( object ) : <EOL> @ classmethod <EOL> def load_options ( cls , request ) : <EOL> from django_options import add_option , get_option <EOL> add_option ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> @ classmethod <EOL> def unload_options ( cls , request , response ) : <EOL> from django_options import get... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.