code stringlengths 9 256k |
|---|
<s> """<STR_LIT>""" <EOL> from twisted . trial import unittest <EOL> from twisted . mail import bounce <EOL> import rfc822 , cStringIO <EOL> class BounceTestCase ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def testBounceFormat ( self ) : <EOL> from_ , to , s = bounce . generateBounce ( cStringIO . StringIO ( ... |
<s> """<STR_LIT>""" <EOL> __all__ = [ <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT:A>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<ST... |
<s> import sys , types <EOL> from pprint import pformat <EOL> from twisted . trial import unittest <EOL> from twisted . news import database <EOL> from twisted . internet import reactor <EOL> MESSAGE_ID = "<STR_LIT>" <EOL> POST_STRING = """<STR_LIT>""" % ( MESSAGE_ID ) <EOL> class NewsTestCase ( unittest . TestCase ) :... |
<s> """<STR_LIT>""" <EOL> from zope . interface import implements <EOL> from twisted import plugin <EOL> from twisted . cred . strcred import ICheckerFactory <EOL> from twisted . cred . checkers import ICredentialsChecker <EOL> from twisted . cred . credentials import IUsernamePassword <EOL> from twisted . cred . error... |
<s> """<STR_LIT>""" <EOL> import tempfile <EOL> from zope . interface import implements <EOL> from twisted . protocols import policies <EOL> from twisted . internet import interfaces , protocol , main , defer <EOL> from twisted . internet . task import deferLater <EOL> from twisted . python import failure <EOL> from tw... |
<s> """<STR_LIT>""" <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> class _UserRecord ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name , password , uid , gid , gecos , home , shell ) : <EOL> self . pw_name = name <EOL> self . pw_passwd = password <EOL> self . pw_uid = uid <EOL> self . pw_gid = gi... |
<s> """<STR_LIT>""" <EOL> try : <EOL> import pwd <EOL> except ImportError : <EOL> pwd = None <EOL> try : <EOL> import spwd <EOL> except ImportError : <EOL> spwd = None <EOL> import os <EOL> from operator import getitem <EOL> from twisted . trial . unittest import TestCase <EOL> from twisted . python . fakepwd import Us... |
<s> """<STR_LIT>""" <EOL> class InvalidConfError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> class InvalidInetdConfError ( InvalidConfError ) : <EOL> """<STR_LIT>""" <EOL> class InvalidServicesConfError ( InvalidConfError ) : <EOL> """<STR_LIT>""" <EOL> class InvalidRPCServicesConfError ( InvalidConfError ) : <EOL> """... |
<s> """<STR_LIT>""" </s>
|
<s> """<STR_LIT>""" <EOL> import sys , _preamble <EOL> from twisted . internet . protocol import Protocol <EOL> from twisted . internet . stdio import StandardIO <EOL> from twisted . python . reflect import namedAny <EOL> class LastWriteChild ( Protocol ) : <EOL> def __init__ ( self , reactor , magicString ) : <EOL> se... |
<s> """<STR_LIT>""" <EOL> from twisted . trial . unittest import TestCase <EOL> from twisted . cred import credentials , error <EOL> from twisted . tap . ftp import Options <EOL> from twisted . python import versions <EOL> from twisted . python . filepath import FilePath <EOL> class FTPOptionsTestCase ( TestCase ) : <E... |
<s> """<STR_LIT>""" <EOL> import stat , os , sys , types <EOL> import socket <EOL> from twisted . internet import interfaces , reactor , protocol , error , address , defer , utils <EOL> from twisted . python import lockfile <EOL> from twisted . trial import unittest <EOL> from twisted . test . test_tcp import MyServerF... |
<s> """<STR_LIT>""" <EOL> from twisted . trial . unittest import SynchronousTestCase , TestCase <EOL> class TestCaseMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> self . first = self . MyTestCase ( '<STR_LIT>' ) <EOL> self . second = self . MyTestCase ( '<STR_LIT>' ) <EO... |
<s> """<STR_LIT>""" <EOL> import urlparse <EOL> from urllib import quote as urlquote <EOL> from twisted . internet import reactor <EOL> from twisted . internet . protocol import ClientFactory <EOL> from twisted . web . resource import Resource <EOL> from twisted . web . server import NOT_DONE_YET <EOL> from twisted . w... |
<s> from twisted . words . xish import domish , xpath , utility <EOL> from twisted . words . protocols . jabber import xmlstream , sasl , error <EOL> from twisted . words . protocols . jabber . jid import JID <EOL> NS_XMPP_STREAMS = '<STR_LIT>' <EOL> NS_XMPP_BIND = '<STR_LIT>' <EOL> NS_XMPP_SESSION = '<STR_LIT>' <EOL> ... |
<s> """<STR_LIT>""" <EOL> from twisted . trial import unittest <EOL> from twisted . words . protocols . jabber import sasl_mechanisms <EOL> class PlainTest ( unittest . TestCase ) : <EOL> def test_getInitialResponse ( self ) : <EOL> """<STR_LIT>""" <EOL> m = sasl_mechanisms . Plain ( None , '<STR_LIT:test>' , '<STR_LIT... |
<s> """<STR_LIT>""" <EOL> from zope . interface import Interface <EOL> from zope . interface import classImplements <EOL> class IException ( Interface ) : pass <EOL> class IStandardError ( IException ) : pass <EOL> class IWarning ( IException ) : pass <EOL> class ISyntaxError ( IStandardError ) : pass <EOL> class ILook... |
<s> """<STR_LIT>""" <EOL> import unittest <EOL> class _SilencePy3Deprecations ( unittest . TestCase ) : <EOL> def failUnless ( self , expr ) : <EOL> return self . assertTrue ( expr ) <EOL> def failIf ( self , expr ) : <EOL> return self . assertFalse ( expr ) <EOL> class ComponentsTests ( _SilencePy3Deprecations ) : <EO... |
<s> import sys <EOL> import re <EOL> import os <EOL> import codecs <EOL> FIELDED_OUTPUT_RE = re . compile ( r'<STR_LIT>' ) <EOL> class taggedEntity : <EOL> def __init__ ( self , startOff , endOff , eType , idNum ) : <EOL> self . startOff = startOff <EOL> self . endOff = endOff <EOL> self . eType = eType <EOL> self . id... |
<s> '''<STR_LIT>''' <EOL> from sys import stdin , stdout <EOL> from re import compile as _compile <EOL> from codecs import open as _open <EOL> MALT_REGEX = _compile ( ur '<STR_LIT>' <EOL> ur '<STR_LIT>' ) <EOL> OUTPUT_LINE = u'<STR_LIT>' <EOL> def main ( args ) : <EOL> token_cnt = <NUM_LIT:0> <EOL> for line in ( l . de... |
<s> """<STR_LIT>""" <EOL> from nltk . ccg . combinator import ( UndirectedBinaryCombinator , DirectedBinaryCombinator , <EOL> ForwardCombinator , BackwardCombinator , <EOL> UndirectedFunctionApplication , ForwardApplication , <EOL> BackwardApplication , UndirectedComposition , <EOL> ForwardComposition , BackwardComposi... |
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> from os import path , sep , environ <EOL> from subprocess import Popen , PIPE <EOL> from platform import architecture , system <EOL> from nltk . tag . api import TaggerI <EOL> from nltk . compat import text_type , python_2_unicode_compatible <EOL> ... |
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> import os <EOL> import codecs <EOL> import textwrap <EOL> from nltk import compat <EOL> from nltk . tree import Tree <EOL> from nltk . util import LazyMap , LazyConcatenation <EOL> from nltk . tag import map_tag <EOL> from nltk . corpus . reader . ... |
<s> """<STR_LIT>""" <EOL> import os <EOL> from nltk import compat <EOL> from nltk . tag import str2tuple , map_tag <EOL> from nltk . tokenize import * <EOL> from nltk . corpus . reader . api import * <EOL> from nltk . corpus . reader . util import * <EOL> from nltk . corpus . reader . timit import read_timit_block <EOL... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import os <EOL> import subprocess <EOL> import nltk <EOL> from nltk . sem . logic import Expression , ExistsExpression , AllExpression , NegatedExpression , AndExpression , IffExpression , OrExpression , EqualityExpression , ImpExpression <EOL> from ... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function , division , unicode_literals <EOL> import itertools <EOL> import re <EOL> import warnings <EOL> from nltk import compat <EOL> from nltk . tree import Tree <EOL> from nltk . grammar import PCFG , is_nonterminal , is_terminal <EOL> from nltk . util import O... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function , unicode_literals <EOL> import re <EOL> import operator <EOL> from collections import defaultdict <EOL> from functools import reduce <EOL> from nltk . util import Trie <EOL> from nltk . internals import Counter <EOL> from nltk . compat import ( total_orde... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function , unicode_literals <EOL> import re <EOL> from nltk . probability import ConditionalFreqDist <EOL> from nltk . classify import NaiveBayesClassifier <EOL> from nltk . compat import python_2_unicode_compatible <EOL> from nltk . tag . api import TaggerI , Feat... |
<s> """<STR_LIT>""" <EOL> from nltk . util import Trie <EOL> from nltk . tokenize . api import TokenizerI <EOL> class MWETokenizer ( TokenizerI ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , mwes = None , separator = '<STR_LIT:_>' ) : <EOL> """<STR_LIT>""" <EOL> if not mwes : <EOL> mwes = [ ] <EOL> self . _mwes ... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from nltk . tree import Tree <EOL> def chomsky_normal_form ( tree , factor = "<STR_LIT:right>" , horzMarkov = None , vertMarkov = <NUM_LIT:0> , childChar = "<STR_LIT:|>" , parentChar = "<STR_LIT>" ) : <EOL> if horzMarkov is None : horzMarkov = <NUM_L... |
<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> import flask <EOL> from werkzeug . exceptions import HTTPException <EOL> __all__ = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def abort ( code = <NUM_LIT> , message = None , ** kwargs ) : <EOL> '''<STR_LIT>''' <EOL> t... |
<s> from __future__ import unicode_literals <EOL> from flask import url_for , Blueprint <EOL> import flask_restplus as restplus <EOL> from flask_restplus import Namespace , Api <EOL> from . import TestCase <EOL> class NamespaceTest ( TestCase ) : <EOL> def test_parser ( self ) : <EOL> api = Namespace ( '<STR_LIT:test>'... |
<s> import struct <EOL> import datetime <EOL> from pymysql . util import byte2int , int2byte <EOL> class BinLogEvent ( object ) : <EOL> def __init__ ( self , from_packet , event_size , table_map , ctl_connection , <EOL> only_tables = None , <EOL> only_schemas = None , <EOL> freeze_schema = False ) : <EOL> self . packet... |
<s> from cmddocs import Cmddocs <EOL> def test_do_initializaton ( emptyenv , capsys ) : <EOL> c , d = emptyenv <EOL> Cmddocs ( c ) . do_status ( "<STR_LIT:test>" ) <EOL> out , err = capsys . readouterr ( ) <EOL> assert "<STR_LIT>" in out </s>
|
<s> """<STR_LIT>""" <EOL> from nose2 . events import Plugin <EOL> class Coverage ( Plugin ) : <EOL> configSection = '<STR_LIT>' <EOL> commandLineSwitch = ( '<STR_LIT:C>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def __init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> self . conSource = self . config . as_list ( '<STR_LIT>' , [ ]... |
<s> """<STR_LIT>""" <EOL> import os . path <EOL> import tempfile <EOL> import shutil <EOL> import subprocess <EOL> import sys <EOL> import six <EOL> from nose2 . compat import unittest <EOL> from nose2 import discover , util <EOL> HERE = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> SUPPORT = os . path... |
<s> from nose2 . tools import such <EOL> with such . A ( '<STR_LIT>' ) as it : <EOL> @ it . has_teardown <EOL> def teardown_fail ( ) : <EOL> raise RuntimeError ( '<STR_LIT>' ) <EOL> @ it . should ( '<STR_LIT>' ) <EOL> def test_passes ( case ) : <EOL> pass <EOL> it . createTests ( globals ( ) ) </s>
|
<s> def covered_func ( ) : <EOL> a = <NUM_LIT:1> <EOL> a = a + <NUM_LIT:8> <EOL> return a <EOL> def uncovered_func ( ) : <EOL> b = <NUM_LIT:1> <EOL> b = b + <NUM_LIT:8> <EOL> return b </s>
|
<s> import unittest <EOL> from nose2 . plugins import attrib <EOL> from nose2 import events , session <EOL> from nose2 . tests . _common import TestCase <EOL> class TestAttribPlugin ( TestCase ) : <EOL> tags = [ '<STR_LIT>' ] <EOL> def setUp ( self ) : <EOL> class TC_1 ( TestCase ) : <EOL> tags = [ '<STR_LIT:a>' , '<ST... |
<s> from . params import params , cartesian_params <EOL> from . import such <EOL> from . import decorators <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] </s>
|
<s> import unittest <EOL> import tempfile <EOL> import json <EOL> from swift . common import swob <EOL> from slogging import internal_proxy <EOL> class DumbApplicationFactory ( object ) : <EOL> def __init__ ( self , status_codes , body = '<STR_LIT>' ) : <EOL> self . status_codes = status_codes [ : ] <EOL> self . body =... |
<s> from django . views . generic . base import TemplateResponseMixin , ContextMixin , View <EOL> import django_anysign <EOL> import pydocusign <EOL> class SignatureCallbackView ( TemplateResponseMixin , ContextMixin , View ) : <EOL> """<STR_LIT>""" <EOL> template_name = '<STR_LIT>' <EOL> @ property <EOL> def docusign_... |
<s> import os <EOL> from libcloud . compute . types import Provider <EOL> from libcloud . compute . providers import get_driver <EOL> import libcloud . security <EOL> from config import get_config <EOL> PROFILE_ENV_VAR = "<STR_LIT>" <EOL> def get_lc ( profile , resource = None ) : <EOL> if resource is None : <EOL> from... |
<s> from django . http import HttpResponseRedirect , Http404 <EOL> from django . shortcuts import render_to_response <EOL> from django . template import RequestContext <EOL> from complaints . forms import ComplaintForm <EOL> from complaints . models import Complaint <EOL> from pluggables import PluggableApp , url , inc... |
<s> """<STR_LIT>""" <EOL> import urllib <EOL> import urllib2 <EOL> import logging <EOL> import json <EOL> logger = logging . getLogger ( __name__ ) <EOL> CONTACT_PARAMS = { <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> ... |
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals , absolute_import <EOL> import json <EOL> import logging <EOL> from . base import GrantTypeBase <EOL> from . . import errors , utils <EOL> from . . request_validator import RequestValidator <EOL> log = logging . getLogger ( __name__ ) <EOL> class Refresh... |
<s> from json import loads , dumps <EOL> from oauthlib . common import add_params_to_uri , to_unicode <EOL> def linkedin_compliance_fix ( session ) : <EOL> def _missing_token_type ( r ) : <EOL> token = loads ( r . text ) <EOL> token [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> r . _content = to_unicode ( dumps ( token ) ) . enc... |
<s> import re <EOL> import logging <EOL> import random <EOL> import zlib <EOL> from base64 import b64encode <EOL> from hashlib import sha256 <EOL> from twisted . internet import defer <EOL> from twisted . web . client import getPage <EOL> from stem . descriptor import microdescriptor <EOL> from oppy import data_dir <EO... |
<s> import ipaddress <EOL> import struct <EOL> class ExitRequest ( object ) : <EOL> '''<STR_LIT>''' <EOL> __slots__ = ( '<STR_LIT:port>' , '<STR_LIT>' , '<STR_LIT:host>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def __init__ ( self , port , addr = None , host = None ) : <EOL> '''<STR_LIT>''' <EOL> assert bool (... |
<s> from __future__ import absolute_import <EOL> import nsq <EOL> import unittest <EOL> class WriterUnitTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( WriterUnitTest , self ) . setUp ( ) <EOL> def test_constructor ( self ) : <EOL> name = '<STR_LIT:test>' <EOL> reconnect_interval = <NUM_LIT> <EO... |
<s> """<STR_LIT>""" <EOL> import random <EOL> import foox . ga as ga <EOL> from utils import is_parallel , make_generate_function , is_stepwise_motion <EOL> DEFAULT_POPULATION_SIZE = <NUM_LIT> <EOL> DEFAULT_MAX_GENERATION = <NUM_LIT:200> <EOL> DEFAULT_MUTATION_RANGE = <NUM_LIT:3> <EOL> DEFAULT_MUTATION_RATE = <NUM_LIT>... |
<s> """<STR_LIT>""" <EOL> import time <EOL> import base64 <EOL> import copy <EOL> from Crypto . Hash import SHA512 <EOL> from Crypto . Signature import PKCS1_v1_5 <EOL> from Crypto . PublicKey import RSA <EOL> from . . version import get_version <EOL> def get_signed_item ( item , public_key , private_key , expires = No... |
<s> MODE = "<STR_LIT>" <EOL> EVEPATH = "<STR_LIT>" <EOL> OUTPATH = "<STR_LIT>" <EOL> from reverence import blue <EOL> import os <EOL> MODE = MODE . upper ( ) <EOL> if MODE not in ( "<STR_LIT>" , "<STR_LIT>" ) : <EOL> raise RuntimeError ( "<STR_LIT>" , MODE ) <EOL> eve = blue . EVE ( EVEPATH ) <EOL> c = eve . getcachemg... |
<s> from __future__ import unicode_literals <EOL> import posixpath <EOL> import os . path <EOL> import base64 <EOL> from functools import wraps <EOL> from django . conf import settings <EOL> from django . http import HttpResponse <EOL> from django . core . files . base import ContentFile <EOL> from django . core . file... |
<s> """<STR_LIT>""" <EOL> import bisect <EOL> import numpy as np <EOL> from sklearn . metrics . pairwise import * <EOL> from libact . base . interfaces import QueryStrategy <EOL> class QUIRE ( QueryStrategy ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( QUIRE , self ) . __ini... |
<s> from atom . api import Dict , List , Str , Tuple , Typed , observe <EOL> from enaml . application import ScheduledTask , schedule <EOL> from enaml . objectdict import ObjectDict <EOL> from . declarative import Declarative , d_ <EOL> from . template import Template <EOL> class Tagged ( ObjectDict ) : <EOL> """<STR_L... |
<s> from collections import defaultdict <EOL> from atom . api import Atom , Coerced , Int , Range , Str , Tuple , Value <EOL> import kiwisolver as kiwi <EOL> from . box_helper import BoxHelper <EOL> from . constrainable import Constrainable <EOL> from . constraint_helper import ConstraintHelper <EOL> from . geometry im... |
<s> from atom . api import Typed <EOL> from enaml . widgets . action_group import ProxyActionGroup <EOL> from . QtGui import QActionGroup <EOL> from . qt_action import QtAction <EOL> from . qt_toolkit_object import QtToolkitObject <EOL> class QCustomActionGroup ( QActionGroup ) : <EOL> """<STR_LIT>""" <EOL> def __init_... |
<s> from atom . api import Typed <EOL> from enaml . widgets . push_button import ProxyPushButton <EOL> from . QtGui import QPushButton <EOL> from . qt_abstract_button import QtAbstractButton <EOL> from . qt_menu import QtMenu <EOL> class QtPushButton ( QtAbstractButton , ProxyPushButton ) : <EOL> """<STR_LIT>""" <EOL> ... |
<s> from atom . api import List , ForwardTyped , Typed , observe <EOL> from enaml . core . declarative import d_ <EOL> from enaml . layout . constrainable import ConstrainableMixin , PolicyEnum <EOL> from . widget import Widget , ProxyWidget <EOL> class ProxyConstraintsWidget ( ProxyWidget ) : <EOL> """<STR_LIT>""" <EO... |
<s> from atom . api import ( <EOL> Bool , Callable , List , Value , Typed , ForwardTyped , set_default , observe <EOL> ) <EOL> from enaml . core . declarative import d_ <EOL> from . control import Control , ProxyControl <EOL> class ProxyObjectCombo ( ProxyControl ) : <EOL> """<STR_LIT>""" <EOL> declaration = ForwardTyp... |
<s> from atom . api import Atom , Dict , Typed , Value <EOL> from enaml . workbench . workbench import Workbench <EOL> from . command import Command <EOL> class ExecutionEvent ( Atom ) : <EOL> """<STR_LIT>""" <EOL> command = Typed ( Command ) <EOL> workbench = Typed ( Workbench ) <EOL> parameters = Dict ( ) <EOL> trigg... |
<s> from textwrap import dedent <EOL> from nose . tools import raises <EOL> from utils import compile_source <EOL> def test_syntax_1 ( ) : <EOL> source = dedent ( """<STR_LIT>""" ) <EOL> compile_source ( source , '<STR_LIT>' ) <EOL> def test_syntax_2 ( ) : <EOL> source = dedent ( """<STR_LIT>""" ) <EOL> compile_source ... |
<s> from analytics . backends . base import BaseAnalyticsBackend <EOL> class Dummy ( BaseAnalyticsBackend ) : <EOL> def track_count ( self , unique_identifier , metric , inc_amt = <NUM_LIT:1> , ** kwargs ) : <EOL> pass <EOL> def track_metric ( self , unique_identifier , metric , date , inc_amt = <NUM_LIT:1> , ** kwargs... |
<s> from __future__ import absolute_import <EOL> try : <EOL> import enum <EOL> except ImportError : <EOL> raise ImportError ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> from . _version import get_versions <EOL> __version__ = get_versions ( ) [ '<STR_LIT:version>' ] <EOL> del get_versions </s>
|
<s> import sys <EOL> import unittest <EOL> from unittest import TestCase <EOL> try : <EOL> import faulthandler <EOL> except ImportError : <EOL> pass <EOL> else : <EOL> try : <EOL> faulthandler . enable ( ) <EOL> except BaseException as e : <EOL> msg = "<STR_LIT>" <EOL> warnings . warn ( msg . format ( err = e ) ) <EOL>... |
<s> from __future__ import print_function <EOL> from mpi4py import MPI <EOL> from numba import cuda <EOL> import numpy as np <EOL> mpi_comm = MPI . COMM_WORLD <EOL> total_n = <NUM_LIT:10> <EOL> if mpi_comm . rank == <NUM_LIT:0> : <EOL> input_data = np . arange ( total_n , dtype = np . int32 ) <EOL> print ( "<STR_LIT>" ... |
<s> import polynomial as poly <EOL> from numba import * <EOL> import numpy as np <EOL> from timeit import default_timer as time <EOL> import sys <EOL> def main ( ) : <EOL> cu_discriminant = vectorize ( [ f4 ( f4 , f4 , f4 ) , f8 ( f8 , f8 , f8 ) ] , <EOL> target = '<STR_LIT>' ) ( poly . discriminant ) <EOL> N = <NUM_LI... |
<s> from __future__ import print_function <EOL> import re <EOL> import os <EOL> import sys <EOL> import ctypes <EOL> import platform <EOL> from numba . findlib import find_lib , find_file <EOL> if sys . platform == '<STR_LIT:win32>' : <EOL> _dllopener = ctypes . WinDLL <EOL> elif sys . platform == '<STR_LIT>' : <EOL> _... |
<s> from numba . six . moves import reduce as pyreduce <EOL> def Reduce ( func ) : <EOL> def reduce_wrapper ( seq , res = None , init = <NUM_LIT:0> ) : <EOL> r = pyreduce ( func , seq , init ) <EOL> if res is not None : <EOL> res [ <NUM_LIT:0> ] = r <EOL> return None <EOL> else : <EOL> return r <EOL> return reduce_wrap... |
<s> from __future__ import print_function , absolute_import , division <EOL> from numba import unittest_support as unittest <EOL> import numpy as np <EOL> from numba import cuda <EOL> def reinterpret_array_type ( byte_arr , start , stop , output ) : <EOL> val = byte_arr [ start : stop ] . view ( np . int32 ) [ <NUM_LIT... |
<s> from __future__ import print_function , absolute_import , division <EOL> from numba import cuda <EOL> from numba . cuda . testing import unittest <EOL> class TestCudaMandel ( unittest . TestCase ) : <EOL> def test_mandel ( self ) : <EOL> """<STR_LIT>""" <EOL> @ cuda . jit ( '<STR_LIT>' <EOL> '<STR_LIT>' , device = ... |
<s> from __future__ import absolute_import , print_function , division <EOL> from numba . cuda . compiler import compile_kernel <EOL> from numba . cuda . cudadrv import nvvm <EOL> from numba . cuda . testing import skip_on_cudasim <EOL> from numba import unittest_support as unittest <EOL> from numba import types , util... |
<s> from __future__ import absolute_import , print_function <EOL> import os <EOL> import sys <EOL> from collections import namedtuple <EOL> from ctypes import ( c_size_t , byref , c_char_p , c_void_p , Structure , CDLL , <EOL> POINTER , create_string_buffer , c_int , addressof , <EOL> c_byte ) <EOL> from numba import u... |
<s> from __future__ import print_function , division , absolute_import <EOL> from timeit import default_timer as timer <EOL> import numpy as np <EOL> from numba import unittest_support as unittest <EOL> from numba import hsa , float32 <EOL> class TestMatMul ( unittest . TestCase ) : <EOL> def test_matmul_naive ( self )... |
<s> from __future__ import print_function , division , absolute_import <EOL> import collections <EOL> import re <EOL> import numpy <EOL> from . import errors , types , config , npdatetime <EOL> version = tuple ( map ( int , numpy . __version__ . split ( '<STR_LIT:.>' ) [ : <NUM_LIT:2> ] ) ) <EOL> int_divbyzero_returns_... |
<s> from __future__ import print_function <EOL> from collections import namedtuple , defaultdict <EOL> import copy <EOL> import os <EOL> import sys <EOL> import numpy <EOL> from llvmlite import ir as llvmir <EOL> import llvmlite . llvmpy . core as lc <EOL> from llvmlite . llvmpy . core import Type , Constant , LLVMExce... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function , absolute_import , division <EOL> import math <EOL> import os <EOL> import random <EOL> import numpy as np <EOL> from llvmlite import ir <EOL> from numba . extending import overload <EOL> from numba . targets . imputils import ( Registry , impl_ret_untrac... |
<s> from __future__ import absolute_import , print_function , division <EOL> import numpy as np <EOL> from numba import unittest_support as unittest <EOL> from numba import float32 <EOL> from numba . npyufunc import Vectorize <EOL> from . . support import tag <EOL> dtype = np . float32 <EOL> a = np . arange ( <NUM_LIT>... |
<s> from __future__ import print_function <EOL> from numba import jit <EOL> import numba . unittest_support as unittest <EOL> import numpy as np <EOL> import copy <EOL> from . support import MemoryLeakMixin <EOL> try : <EOL> xrange <EOL> except NameError : <EOL> xrange = range <EOL> @ jit <EOL> def inc ( a ) : <EOL> fo... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import numba . unittest_support as unittest <EOL> from collections import defaultdict <EOL> import numpy as np <EOL> from numba import jit , types , utils <EOL> import numba . unittest_support as unittest <EOL> from . support import TestCase , tag , ... |
<s> from __future__ import print_function <EOL> import itertools <EOL> import numba . unittest_support as unittest <EOL> from numba . compiler import compile_isolated <EOL> from numba import types <EOL> def template ( fromty , toty ) : <EOL> def closure ( self ) : <EOL> def cast ( x ) : <EOL> y = x <EOL> return y <EOL>... |
<s> from __future__ import print_function , division , absolute_import <EOL> import collections <EOL> import itertools <EOL> import numpy as np <EOL> from numba import unittest_support as unittest <EOL> from numba . compiler import compile_isolated <EOL> from numba import jit , types , errors <EOL> from . support impor... |
<s> from __future__ import print_function , division , absolute_import <EOL> from . abstract import * <EOL> from . common import * <EOL> class RangeType ( SimpleIterableType ) : <EOL> def __init__ ( self , dtype ) : <EOL> self . dtype = dtype <EOL> name = "<STR_LIT>" % ( dtype , ) <EOL> super ( SimpleIterableType , sel... |
<s> try : <EOL> from setuptools import setup , Extension <EOL> except ImportError : <EOL> from distutils . core import setup , Extension <EOL> import sys <EOL> import os <EOL> import numpy <EOL> import numpy . distutils . misc_util as np_misc <EOL> import versioneer <EOL> versioneer . VCS = '<STR_LIT>' <EOL> versioneer... |
<s> DEBUG = True <EOL> TEMPLATE_DEBUG = DEBUG <EOL> ADMINS = ( <EOL> ) <EOL> MANAGERS = ADMINS <EOL> DATABASES = { <EOL> '<STR_LIT:default>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL>... |
<s> import os <EOL> import logging <EOL> import pyrax as eager_pyrax <EOL> import paramiko <EOL> from scp import SCPClient <EOL> from gevent import sleep <EOL> from django . conf import settings <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> class LazyPyraxProxy ( object ) : <EOL> """<STR_LIT>""" <EOL> def __... |
<s> from django . templatetags . static import static <EOL> from django . views . generic import RedirectView <EOL> from tasks import const <EOL> from tasks . exceptions import TaskDoesNotExists <EOL> from . forms import FindTaskForBadgeForm <EOL> class ProjectBadge ( RedirectView ) : <EOL> """<STR_LIT>""" <EOL> perman... |
<s> import sure <EOL> from django . contrib . auth . models import User <EOL> from tastypie . test import ResourceTestCase <EOL> from projects . tests . factories import ProjectFactory <EOL> from tools . mongo import MongoFlushMixin <EOL> from tools . tests import MockGithubMixin <EOL> from . . import models , const <E... |
<s> import sure <EOL> from django . test import TestCase <EOL> from tasks . const import STATUS_SUCCESS , STATUS_FAILED <EOL> from . . pep8 import pep8_violation <EOL> from . base import get_content <EOL> class PEP8ViolationCase ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_success ( self ) : <EOL> """<STR_LIT>""... |
<s> import pytest <EOL> from thefuck . rules . cd_mkdir import match , get_new_command <EOL> from tests . utils import Command <EOL> @ pytest . mark . parametrize ( '<STR_LIT>' , [ <EOL> Command ( script = '<STR_LIT>' , stderr = '<STR_LIT>' ) , <EOL> Command ( script = '<STR_LIT>' , <EOL> stderr = '<STR_LIT>' ) , <EOL>... |
<s> import pytest <EOL> from thefuck . rules . git_remote_seturl_add import match , get_new_command <EOL> from tests . utils import Command <EOL> @ pytest . mark . parametrize ( '<STR_LIT>' , [ <EOL> Command ( script = '<STR_LIT>' , stderr = "<STR_LIT>" ) ] ) <EOL> def test_match ( command ) : <EOL> assert match ( comm... |
<s> import pytest <EOL> from thefuck . rules . pip_unknown_command import match , get_new_command <EOL> from tests . utils import Command <EOL> @ pytest . fixture <EOL> def pip_unknown_cmd ( ) : <EOL> return '''<STR_LIT>''' <EOL> @ pytest . fixture <EOL> def pip_unknown_cmd_without_recommend ( ) : <EOL> return '''<STR_... |
<s> import pytest <EOL> import six <EOL> from mock import Mock <EOL> from thefuck import const <EOL> @ pytest . fixture <EOL> def load_source ( mocker ) : <EOL> return mocker . patch ( '<STR_LIT>' ) <EOL> @ pytest . fixture <EOL> def environ ( monkeypatch ) : <EOL> data = { } <EOL> monkeypatch . setattr ( '<STR_LIT>' ,... |
<s> import re <EOL> from thefuck . specific . sudo import sudo_support <EOL> from thefuck . utils import for_app <EOL> @ sudo_support <EOL> @ for_app ( '<STR_LIT>' ) <EOL> def match ( command ) : <EOL> stderr = command . stderr . lower ( ) <EOL> return '<STR_LIT>' in stderr or '<STR_LIT>' in stderr <EOL> @ sudo_support... |
<s> from thefuck . utils import for_app <EOL> @ for_app ( '<STR_LIT>' ) <EOL> def match ( command ) : <EOL> return ( command . script . startswith ( '<STR_LIT>' ) <EOL> and not command . script . endswith ( '<STR_LIT>' ) ) <EOL> def get_new_command ( command ) : <EOL> return command . script + '<STR_LIT>' </s>
|
<s> import re <EOL> from thefuck . specific . sudo import sudo_support <EOL> @ sudo_support <EOL> def match ( command ) : <EOL> return ( '<STR_LIT>' in command . script <EOL> and '<STR_LIT>' in command . stderr . lower ( ) ) <EOL> @ sudo_support <EOL> def get_new_command ( command ) : <EOL> arguments = '<STR_LIT>' <EOL... |
<s> import sys <EOL> if sys . platform == '<STR_LIT:win32>' : <EOL> from . win32 import * <EOL> else : <EOL> from . unix import * </s>
|
<s> from distutils . core import setup <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> packages = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> classifiers... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.