code stringlengths 9 256k |
|---|
<s> import gevent <EOL> import logging <EOL> import os <EOL> import random <EOL> import re <EOL> import sys <EOL> import time <EOL> from gevent import socket <EOL> from gevent . event import Event <EOL> from gevent . queue import Queue <EOL> from logging . handlers import RotatingFileHandler <EOL> from optparse import ... |
<s> import re <EOL> from micawber . providers import Provider <EOL> class ImageProvider ( Provider ) : <EOL> """<STR_LIT>""" <EOL> regex = '<STR_LIT>' <EOL> def request ( self , url , ** params ) : <EOL> return { <EOL> '<STR_LIT:url>' : url , <EOL> '<STR_LIT:type>' : '<STR_LIT>' , <EOL> '<STR_LIT:title>' : '<STR_LIT>' ... |
<s> class hybrid_method ( object ) : <EOL> def __init__ ( self , func , expr = None ) : <EOL> self . func = func <EOL> self . expr = expr or func <EOL> def __get__ ( self , instance , instance_type ) : <EOL> if instance is None : <EOL> return self . expr . __get__ ( instance_type , instance_type . __class__ ) <EOL> ret... |
<s> from peewee import * <EOL> from playhouse . gfk import * <EOL> from playhouse . tests . base import database_initializer <EOL> from playhouse . tests . base import ModelTestCase <EOL> db = database_initializer . get_in_memory_database ( ) <EOL> class BaseModel ( Model ) : <EOL> class Meta : <EOL> database = db <EOL... |
<s> import os <EOL> import sys <EOL> import warnings <EOL> from distutils . core import setup <EOL> from distutils . extension import Extension <EOL> from distutils . version import StrictVersion <EOL> f = open ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ) <EOL> readme = f . read ( ) <EOL> f .... |
<s> from functools import wraps <EOL> def chainable_method ( fn ) : <EOL> @ wraps ( fn ) <EOL> def inner ( self , * args , ** kwargs ) : <EOL> fn ( self , * args , ** kwargs ) <EOL> return self <EOL> return inner <EOL> class Sortable ( object ) : <EOL> def sort ( self , pattern = None , limit = None , offset = None , g... |
<s> """<STR_LIT>""" <EOL> import argparse <EOL> import sys <EOL> import re <EOL> import pandas as pd <EOL> def _cli ( ) : <EOL> epilog = """<STR_LIT>""" <EOL> parser = argparse . ArgumentParser ( <EOL> description = globals ( ) [ '<STR_LIT>' ] , epilog = epilog , <EOL> formatter_class = argparse . RawDescriptionHelpFor... |
<s> """<STR_LIT>""" <EOL> def get_doc_id_filter ( doc_id_set ) : <EOL> """<STR_LIT>""" <EOL> def doc_id_filter ( record_dict ) : <EOL> doc_id = record_dict [ '<STR_LIT>' ] <EOL> keep_doc = doc_id in doc_id_set <EOL> return keep_doc <EOL> return doc_id_filter <EOL> def get_tf_idf_filter ( sfile_filter , min_tf_idf ) : <... |
<s> '''<STR_LIT>''' <EOL> import envi <EOL> import ctypes <EOL> import platform <EOL> def isSysWow64 ( ) : <EOL> k32 = ctypes . windll . kernel32 <EOL> if not hasattr ( k32 , '<STR_LIT>' ) : <EOL> return False <EOL> ret = ctypes . c_ulong ( <NUM_LIT:0> ) <EOL> myproc = ctypes . c_size_t ( - <NUM_LIT:1> ) <EOL> if not k... |
<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> from telesphorus . helpers import stats <EOL> PATH_DELIMITER = '<STR_LIT>' <EOL> def obscurity_ratio ( trace_graph , settings ) : <EOL> threashold = settings . OBSCURITY_SAMPLES <EOL> temp_dict = { } <EOL> total = stats . posix_invocations ( trace_graph ) ... |
<s> import sys <EOL> import StringIO <EOL> import glob <EOL> import os <EOL> from nose . tools import * <EOL> import pickle <EOL> from flashcardstudy import stack , card , errors , cliparser , stack , sfile <EOL> def parser_cleanup ( ) : <EOL> """<STR_LIT>""" <EOL> cliparser . passed_files = [ ] <EOL> cliparser . passe... |
<s> """<STR_LIT>""" <EOL> import tornado . ioloop <EOL> from optparse import OptionParser <EOL> from kpages import LogicContext , run_test , pro_test , reflesh_config , set_default_encoding <EOL> def _get_opt ( ) : <EOL> parser = OptionParser ( "<STR_LIT>" , version = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT... |
<s> import time , sys , os , helper , config <EOL> from comodit_client . api import Client <EOL> from comodit_client . api . exceptions import PythonApiException <EOL> from comodit_client . rest . exceptions import ApiException <EOL> def teardown ( ) : <EOL> print "<STR_LIT>" <EOL> client = Client ( config . endpoint ,... |
<s> import json <EOL> import traceback <EOL> from threading import Thread <EOL> from synapse . synapse_exceptions import ResourceException <EOL> from synapse . resource_locator import ResourceLocator <EOL> from synapse . config import config <EOL> from synapse . logger import logger <EOL> from synapse . scheduler impor... |
<s> import grp <EOL> from synapse . synapse_exceptions import ResourceException <EOL> from synapse . syncmd import exec_cmd <EOL> def exists ( name ) : <EOL> res = False <EOL> try : <EOL> res = format_group_info ( name ) . get ( '<STR_LIT>' , False ) <EOL> except Exception : <EOL> pass <EOL> return res <EOL> def get_gr... |
<s> import re <EOL> from synapse . synapse_exceptions import ResourceException <EOL> from synapse . syncmd import exec_cmd <EOL> def user_exists ( name ) : <EOL> try : <EOL> get_user_infos ( name ) <EOL> except ResourceException : <EOL> return False <EOL> return True <EOL> def get_user_infos ( name ) : <EOL> pass <EOL>... |
<s> import unittest <EOL> from gooddataclient . project import Project , delete_projects_by_name <EOL> from gooddataclient . connection import Connection <EOL> from gooddataclient . dataset import DateDimension <EOL> from tests . credentials import password , username <EOL> from tests . test_project import TEST_PROJECT... |
<s> '''<STR_LIT>''' <EOL> import os <EOL> import jinja2 <EOL> from ponywhoosh import PonyWhoosh as MyPonyWhoosh <EOL> from ponywhoosh import search , full_search , delete_field <EOL> from views import IndexView <EOL> __author__ = "<STR_LIT>" <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL... |
<s> import os <EOL> from conans . paths import ( CONANFILE , CONANINFO , CONANFILE_TXT , BUILD_INFO ) <EOL> from conans . client . loader import ConanFileLoader <EOL> from conans . client . export import export_conanfile <EOL> from conans . client . deps_builder import DepsBuilder <EOL> from conans . client . userio im... |
<s> from conans . util . files import load , save <EOL> from conans . model . version import Version <EOL> from conans . errors import ConanException <EOL> import os <EOL> CONAN_VERSION = "<STR_LIT>" <EOL> class Migrator ( object ) : <EOL> def __init__ ( self , conf_path , store_path , current_version , out ) : <EOL> s... |
<s> from bottle import HTTPResponse , request <EOL> class NonSSLBlocker ( object ) : <EOL> '''<STR_LIT>''' <EOL> name = '<STR_LIT>' <EOL> def apply ( self , callback , context ) : <EOL> '''<STR_LIT>''' <EOL> def wrapper ( * args , ** kwargs ) : <EOL> '''<STR_LIT>''' <EOL> if request . headers . get ( '<STR_LIT>' , '<ST... |
<s> import unittest <EOL> from conans . test . tools import TestClient <EOL> from conans . paths import PACKAGES_FOLDER , CONANINFO <EOL> conan_vars1 = '''<STR_LIT>''' <EOL> conan_vars2 = '''<STR_LIT>''' <EOL> conan_vars3 = '''<STR_LIT>''' <EOL> conan_vars4 = """<STR_LIT>""" <EOL> class SearchTest ( unittest . TestCase... |
<s> import unittest <EOL> from conans . test . tools import TestClient <EOL> from conans . model . ref import ConanFileReference , PackageReference <EOL> import os <EOL> from conans . paths import CONANFILE <EOL> from conans . util . files import save <EOL> class PackageCommandTest ( unittest . TestCase ) : <EOL> def p... |
<s> from conans . client . runner import ConanRunner <EOL> class TestRunner ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , output ) : <EOL> self . _output = output <EOL> self . runner = ConanRunner ( ) <EOL> def __call__ ( self , command , output = None , cwd = None ) : <EOL> return self . runner ( comm... |
<s> from django . test import TestCase <EOL> class SkyVisitorTestCase ( TestCase ) : <EOL> def assertLoggedIn ( self , user , backend = None ) : <EOL> self . assertEqual ( self . client . session [ '<STR_LIT>' ] , user . id ) <EOL> if backend : <EOL> self . assertEqual ( self . client . session [ '<STR_LIT>' ] , backen... |
<s> from libtree . core . query import ( get_ancestors , get_child_ids , get_children , <EOL> get_children_count , get_descendants , <EOL> get_descendant_ids , get_node , get_root_node , <EOL> get_tree_size ) <EOL> import libtree <EOL> import pytest <EOL> def test_get_root_node_non_existing ( cur ) : <EOL> with pytest ... |
<s> from __future__ import unicode_literals , absolute_import , division <EOL> from sqlalchemy import orm <EOL> from sqlalchemy . ext . declarative . api import DeclarativeMeta <EOL> class Query ( orm . Query ) : <EOL> """<STR_LIT>""" <EOL> def __new__ ( cls , entities = None , * args , ** kwargs ) : <EOL> entity = ent... |
<s> import sys <EOL> import logging <EOL> import exceptions <EOL> from datetime import datetime <EOL> from concurrence . database . mysql import client <EOL> from concurrence import TimeoutError as ConcurrenceTimeoutError <EOL> threadsafety = <NUM_LIT:1> <EOL> apilevel = "<STR_LIT>" <EOL> paramstyle = "<STR_LIT>" <EOL>... |
<s> import logging <EOL> import time <EOL> import sys <EOL> from concurrence import unittest , Tasklet , Channel , TimeoutError , TaskletError , JoinError , Message <EOL> class TestTasklet ( unittest . TestCase ) : <EOL> def testSleep ( self ) : <EOL> start = time . time ( ) <EOL> Tasklet . sleep ( <NUM_LIT:1.0> ) <EOL... |
<s> from __future__ import absolute_import , division , print_function <EOL> import sys <EOL> from os . path import islink , isfile <EOL> NO_EXT = ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR... |
<s> from __future__ import absolute_import , division , print_function <EOL> import os <EOL> import sys <EOL> import shutil <EOL> from os . path import dirname , isdir , isfile , join , exists <EOL> import conda . config as cc <EOL> from conda_build . config import config <EOL> from conda_build import environ <EOL> fro... |
<s> def main ( ) : <EOL> import argparse <EOL> parser = argparse . ArgumentParser ( <EOL> description = "<STR_LIT>" <EOL> ) <EOL> parser . parse_args ( ) <EOL> print ( "<STR_LIT>" ) </s>
|
<s> from __future__ import print_function , division , absolute_import <EOL> from conda . cli import common , install <EOL> help = "<STR_LIT>" <EOL> descr = ( help + <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> example = """<STR_LIT>""" <EOL> def configure_parser ( sub_parsers ) : <EOL> p = sub_parsers... |
<s> from __future__ import print_function , division , absolute_import <EOL> import logging <EOL> from collections import defaultdict <EOL> from itertools import chain <EOL> from conda . compat import iterkeys , itervalues , iteritems , string_types <EOL> from conda . logic import minimal_unsatisfiable_subset , Clauses... |
<s> import os <EOL> import subprocess as sp <EOL> import sys <EOL> import time <EOL> from os . path import exists , join <EOL> from shutil import rmtree <EOL> from tempfile import mkdtemp <EOL> base = mkdtemp ( ) <EOL> myenv = join ( base , "<STR_LIT>" ) <EOL> if '<STR_LIT>' in sys . platform and '<STR_LIT>' not in sys... |
<s> from __future__ import absolute_import <EOL> from contextio . lib . v2_0 import V2_0 <EOL> from contextio . lib . lite import Lite <EOL> def ContextIO ( consumer_key , consumer_secret , ** kwargs ) : <EOL> if kwargs . get ( "<STR_LIT>" ) == "<STR_LIT>" : <EOL> return Lite ( consumer_key , consumer_secret , ** kwarg... |
<s> import unittest <EOL> from mock import Mock <EOL> from contextio . lib . resources . discovery import Discovery <EOL> class TestDiscovery ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . discovery = Discovery ( Mock ( ) , { } ) <EOL> def test_constructor_creates_discovery_object_with_all_attributes... |
<s> '''<STR_LIT>''' <EOL> import combi . _python_toolbox . _bootstrap <EOL> import combi . _python_toolbox <EOL> import combi . _python_toolbox . monkeypatch_envelopes </s>
|
<s> '''<STR_LIT>''' <EOL> import nose <EOL> import sys <EOL> from combi . _python_toolbox . third_party import unittest2 <EOL> from combi . _python_toolbox import cute_inspect <EOL> from combi . _python_toolbox import context_management <EOL> from combi . _python_toolbox . exceptions import CuteException <EOL> from com... |
<s> from combi . _python_toolbox . third_party import enum <EOL> from combi . _python_toolbox . third_party import functools <EOL> from combi . _python_toolbox import caching <EOL> del enum . EnumMeta . __dir__ <EOL> class EnumType ( enum . EnumMeta ) : <EOL> '''<STR_LIT>''' <EOL> __getitem__ = lambda self , i : self .... |
<s> import sys <EOL> def encoded ( _str , coding ) : <EOL> if sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:3> : <EOL> return _str <EOL> else : <EOL> if isinstance ( _str , unicode ) : <EOL> return _str . encode ( coding ) <EOL> else : <EOL> return _str </s>
|
<s> import collections <EOL> from combi . _python_toolbox import binary_search <EOL> from combi . _python_toolbox import nifty_collections <EOL> from combi . _python_toolbox import caching <EOL> from combi . _python_toolbox import sequence_tools <EOL> from combi . _python_toolbox import nifty_collections <EOL> infinity... |
<s> '''<STR_LIT>''' <EOL> import combi . _python_toolbox . version_info <EOL> from combi . _python_toolbox . math_tools import binomial <EOL> from combi . _python_toolbox . nifty_collections import ( Bag , OrderedBag , <EOL> FrozenBag , <EOL> FrozenOrderedBag ) <EOL> from . chain_space import ChainSpace <EOL> from . pr... |
<s> import numbers <EOL> import math <EOL> infinity = float ( '<STR_LIT>' ) <EOL> infinities = ( infinity , - infinity ) <EOL> def cute_floor_div ( x , y ) : <EOL> '''<STR_LIT>''' <EOL> if ( ( x in infinities ) and ( y != <NUM_LIT:0> ) ) or ( y in infinities ) and ( x not in infinities ) : <EOL> return x / y <EOL> else... |
<s> import pickle <EOL> import itertools <EOL> import functools <EOL> import math <EOL> from combi . _python_toolbox import cute_testing <EOL> from combi . _python_toolbox import math_tools <EOL> from combi . _python_toolbox import cute_iter_tools <EOL> from combi . _python_toolbox import nifty_collections <EOL> from c... |
<s> import collections <EOL> import abc <EOL> import functools <EOL> import types <EOL> import math <EOL> import numbers <EOL> import inspect <EOL> from python_toolbox import caching <EOL> from python_toolbox import math_tools <EOL> from python_toolbox import sequence_tools <EOL> from python_toolbox import cute_iter_to... |
<s> '''<STR_LIT>''' <EOL> from . import _name_list <EOL> name_list = _name_list . data . split ( '<STR_LIT:\n>' ) </s>
|
<s> '''<STR_LIT>''' <EOL> import zlib <EOL> import cPickle as pickle_module <EOL> def compickle ( thing ) : <EOL> '''<STR_LIT>''' <EOL> return zlib . compress ( pickle_module . dumps ( thing , protocol = <NUM_LIT:2> ) ) <EOL> def decompickle ( thing ) : <EOL> '''<STR_LIT>''' <EOL> return pickle_module . loads ( zlib . ... |
<s> import collections <EOL> import os <EOL> import sys <EOL> from python_toolbox . third_party import six <EOL> try : <EOL> from functools import wraps <EOL> except ImportError : <EOL> def wraps ( _ ) : <EOL> def _wraps ( func ) : <EOL> return func <EOL> return _wraps <EOL> __unittest = True <EOL> def _relpath_nt ( pa... |
<s> from . bind_savvy_evt_handler import BindSavvyEvtHandler </s>
|
<s> '''<STR_LIT>''' </s>
|
<s> '''<STR_LIT>''' <EOL> import nose <EOL> from python_toolbox import cute_testing <EOL> from python_toolbox . context_management import ( ContextManager , <EOL> ContextManagerType , <EOL> SelfHook ) <EOL> def test_defining_enter_and_manage_context ( ) : <EOL> '''<STR_LIT>''' <EOL> with cute_testing . RaiseAssertor ( ... |
<s> '''<STR_LIT>''' <EOL> from python_toolbox import dict_tools <EOL> def test ( ) : <EOL> '''<STR_LIT>''' <EOL> my_dict = { <NUM_LIT:1> : <NUM_LIT:2> , <NUM_LIT:3> : <NUM_LIT:4> , <NUM_LIT:5> : <NUM_LIT:6> , } <EOL> assert set ( dict_tools . devour_keys ( my_dict ) ) == set ( ( <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:5> ... |
<s> from python_toolbox . math_tools import ( inverse_factorial , from_factoradic , <EOL> to_factoradic ) <EOL> def test_inverse_factorial ( ) : <EOL> assert inverse_factorial ( <NUM_LIT:0> , round_up = True ) == <NUM_LIT:0> <EOL> assert inverse_factorial ( <NUM_LIT:0> , round_up = False ) == <NUM_LIT:0> <EOL> assert i... |
<s> import uuid <EOL> import pickle <EOL> import itertools <EOL> import collections <EOL> from python_toolbox import cute_iter_tools <EOL> from python_toolbox import sequence_tools <EOL> from python_toolbox import cute_testing <EOL> from python_toolbox . nifty_collections import FrozenDict <EOL> def test ( ) : <EOL> fr... |
<s> from python_toolbox import cute_testing <EOL> from python_toolbox . segment_tools import crop_segment <EOL> base_segment = ( <NUM_LIT:10> , <NUM_LIT:20> ) <EOL> segment_to_cropped_segment = { <EOL> ( <NUM_LIT:0> , <NUM_LIT:15> ) : ( <NUM_LIT:10> , <NUM_LIT:15> ) , <EOL> ( <NUM_LIT:0> , <NUM_LIT:12> ) : ( <NUM_LIT:1... |
<s> '''<STR_LIT>''' <EOL> import tempfile <EOL> import os . path <EOL> try : <EOL> import pathlib <EOL> except : <EOL> from python_toolbox . third_party import pathlib <EOL> import nose . tools <EOL> import python_toolbox <EOL> from python_toolbox . temp_file_tools import create_temp_folder <EOL> def test_basic ( ) : <... |
<s> import itertools <EOL> from python_toolbox import nifty_collections <EOL> _length_of_recurrent_perm_space_cache = { } <EOL> def calculate_length_of_recurrent_perm_space ( k , fbb ) : <EOL> '''<STR_LIT>''' <EOL> cache = _length_of_recurrent_perm_space_cache <EOL> if not isinstance ( fbb , nifty_collections . FrozenB... |
<s> '''<STR_LIT>''' <EOL> import collections <EOL> import inspect <EOL> import types <EOL> from python_toolbox import misc_tools <EOL> from python_toolbox import dict_tools <EOL> from python_toolbox import decorator_tools <EOL> from python_toolbox import caching <EOL> @ decorator_tools . helpful_decorator_builder <EOL>... |
<s> class CuteBaseTimer : <EOL> '''<STR_LIT>''' <EOL> __timers = [ ] <EOL> def __init__ ( self , parent ) : <EOL> self . __parent = parent <EOL> CuteBaseTimer . __timers . append ( self ) <EOL> @ staticmethod <EOL> def stop_timers_by_frame ( frame ) : <EOL> '''<STR_LIT>''' <EOL> for timer in CuteBaseTimer . __timers : ... |
<s> '''<STR_LIT>''' <EOL> import itertools <EOL> from python_toolbox . cute_iter_tools import get_items <EOL> def test ( ) : <EOL> '''<STR_LIT>''' <EOL> iterable = iter ( range ( <NUM_LIT:10> ) ) <EOL> assert get_items ( iterable , <NUM_LIT:3> ) == ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> assert get_items ( it... |
<s> import sys <EOL> import uuid <EOL> import types <EOL> import nose <EOL> from python_toolbox import cute_inspect <EOL> from python_toolbox import cute_testing <EOL> from python_toolbox import monkeypatching_tools <EOL> from python_toolbox import caching <EOL> class EqualByIdentity : <EOL> def __eq__ ( self , other )... |
<s> try : <EOL> import pathlib <EOL> except : <EOL> from python_toolbox . third_party import pathlib <EOL> from python_toolbox import cute_testing <EOL> from python_toolbox import temp_file_tools <EOL> from python_toolbox import zip_tools <EOL> def test ( ) : <EOL> with temp_file_tools . create_temp_folder ( ) as temp_... |
<s> from coreapi . codecs . base import BaseCodec <EOL> from coreapi . codecs . csv import CSVCodec <EOL> from coreapi . codecs . corehtml import CoreHTMLCodec <EOL> from coreapi . codecs . corejson import CoreJSONCodec <EOL> from coreapi . codecs . coretext import CoreTextCodec <EOL> from coreapi . codecs . hal import... |
<s> from coreapi import Document , Link , Client <EOL> from coreapi . transports import HTTPTransport <EOL> from coreapi . transports . http import _handle_inplace_replacements <EOL> import pytest <EOL> class MockTransport ( HTTPTransport ) : <EOL> schemes = [ '<STR_LIT>' ] <EOL> def transition ( self , link , params =... |
<s> from xml . dom . minidom import parse <EOL> from xmlutils import getFirstChildByTagName <EOL> from xmlparser0 import CoreDocumentParser0 <EOL> from xmlparser1 import CoreDocumentParser1 <EOL> class CoreVersionParser ( object ) : <EOL> DEFAULT_SCENARIO_VERSION = '<STR_LIT:1.0>' <EOL> '''<STR_LIT>''' <EOL> def __init... |
<s> '''<STR_LIT>''' <EOL> import os , sys , tempfile , shutil , shlex , atexit , gc , pwd <EOL> import threading , time , random <EOL> import traceback <EOL> from core . api import coreapi <EOL> if os . uname ( ) [ <NUM_LIT:0> ] == "<STR_LIT>" : <EOL> from core . netns import nodes <EOL> from core . netns . vnet import... |
<s> import os , glob <EOL> from distutils . core import setup , Extension <EOL> netns = Extension ( "<STR_LIT>" , sources = [ "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> vcmd = Extension ( "<STR_LIT>" , <EOL> sources = [ "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_L... |
<s> from __future__ import print_function <EOL> import pytest <EOL> import collections <EOL> from pymtl import * <EOL> from pclib . test import * <EOL> from pclib . ifcs import InValRdyBundle , OutValRdyBundle <EOL> from QueuePortProxy import InQueuePortProxy , OutQueuePortProxy <EOL> def queue_copy ( n , in_queue , ou... |
<s> '''<STR_LIT>''' <EOL> from pymtl import * <EOL> from pclib . rtl import Mux , RegEnRst <EOL> class RoundRobinArbiter ( Model ) : <EOL> def __init__ ( s , nreqs ) : <EOL> nreqsX2 = nreqs * <NUM_LIT:2> <EOL> s . reqs = InPort ( nreqs ) <EOL> s . grants = OutPort ( nreqs ) <EOL> s . priority_en = Wire ( <NUM_LIT:1> ) ... |
<s> from __future__ import print_function <EOL> import pytest <EOL> from pymtl import * <EOL> from pclib . test import TestSource , TestRandomDelay <EOL> from TestSimpleSink import TestSimpleSink <EOL> class TestHarness ( Model ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( s , dtype , msgs , delay ) : <EOL> s . src = ... |
<s> from ast_typer import TypeAST <EOL> from . . ast_helpers import get_method_ast , print_simple_ast , print_ast <EOL> from ... datatypes . Bits import Bits <EOL> class M ( object ) : <EOL> def __init__ ( self , * args ) : <EOL> for x in args : <EOL> setattr ( self , x , Bits ( <NUM_LIT:4> ) ) <EOL> def lists ( self ,... |
<s> from __future__ import print_function <EOL> import os <EOL> import shutil <EOL> import verilog_structural <EOL> from ... tools . simulation . vcd import get_vcd_timescale <EOL> from subprocess import check_output , STDOUT , CalledProcessError <EOL> from ... model . signals import InPort , OutPort <EOL> from ... mod... |
<s> """<STR_LIT>""" <EOL> NULL = [ ] <EOL> from basictypes import latebind <EOL> class Boundary ( object ) : <EOL> """<STR_LIT>""" <EOL> def __call__ ( self , value , property = None , client = None ) : <EOL> """<STR_LIT>""" <EOL> class Type ( Boundary ) : <EOL> """<STR_LIT>""" <EOL> __resolved = <NUM_LIT:0> <EOL> def ... |
<s> from xml . sax import saxutils <EOL> import locale <EOL> defaultEncoding = locale . getdefaultlocale ( ) [ - <NUM_LIT:1> ] <EOL> class Generator ( saxutils . XMLGenerator ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , out = None , encoding = "<STR_LIT:utf-8>" ) : <EOL> """<STR_LIT>""" <EOL> super ( self , Ge... |
<s> import libpry <EOL> import module . two <EOL> class Two ( libpry . AutoTree ) : <EOL> def test_a ( self ) : <EOL> assert module . two . method ( ) == <NUM_LIT:1> <EOL> tests = [ <EOL> Two ( ) <EOL> ] </s>
|
<s> def foo ( ) : <EOL> x = <NUM_LIT:1> <EOL> if x * x : <EOL> <NUM_LIT:1> <EOL> else : <EOL> x = x <EOL> try : <EOL> oink <EOL> except : <EOL> <NUM_LIT:1> <EOL> if <NUM_LIT:0> + <NUM_LIT:0> : <EOL> <NUM_LIT:1> <EOL> elif x : <EOL> <NUM_LIT:1> <EOL> if x : <EOL> <NUM_LIT:1> <EOL> elif <NUM_LIT:0> + <NUM_LIT:0> : <EOL> ... |
<s> """<STR_LIT>""" <EOL> class Metric ( object ) : <EOL> def __init__ ( self , cosineSimilarity = None , jaccardDistance = None , overlappingAll = None , overlappingLeftRight = None , overlappingRightLeft = None , sizeLeft = None , sizeRight = None , weightedScoring = None , euclideanDistance = None ) : <EOL> self . c... |
<s> """<STR_LIT>""" </s>
|
<s> from selenium import webdriver <EOL> from selenium . webdriver . common . by import By <EOL> from selenium . webdriver . support . ui import Select <EOL> from selenium . common . exceptions import NoSuchElementException <EOL> import unittest , time , re <EOL> class HackadayRaw ( unittest . TestCase ) : <EOL> def se... |
<s> from datetime import datetime <EOL> from unittest2 import TestCase <EOL> from cosmic . types import * <EOL> class TestURLParams ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . schema = URLParams ( [ <EOL> optional ( "<STR_LIT:foo>" , String ) , <EOL> required ( "<STR_LIT>" , Array ( Integer ) ) <EOL> ] ) <EO... |
<s> import couchbase . _bootstrap <EOL> from couchbase . _libcouchbase import ( <EOL> AsyncResult , <EOL> PYCBC_CONN_F_ASYNC , <EOL> PYCBC_CONN_F_ASYNC_DTOR ) <EOL> from couchbase . result import AsyncResult <EOL> from couchbase . async . view import AsyncViewBase <EOL> from couchbase . bucket import Bucket <EOL> from ... |
<s> import json <EOL> from couchbase . views . params import ( make_options_string , <EOL> Query , <EOL> ulp , <EOL> UNSPEC , <EOL> _HANDLER_MAP ) <EOL> from couchbase . exceptions import ArgumentError <EOL> from couchbase . tests . base import CouchbaseTestCase <EOL> class ViewStringTest ( CouchbaseTestCase ) : <EOL> ... |
<s> from couchbase . tests import * </s>
|
<s> import ctypes <EOL> import sys <EOL> import threading <EOL> import platform <EOL> try : <EOL> from cStringIO import StringIO <EOL> except ImportError : <EOL> try : <EOL> from StringIO import StringIO <EOL> except ImportError : <EOL> from io import StringIO <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ]... |
<s> from bento . commands . configure import _compute_scheme , set_scheme_options <EOL> from bento . commands . registries import CommandRegistry , ContextRegistry , OptionsRegistry <EOL> from bento . commands . dependency import CommandScheduler <EOL> from bento . commands . hooks import HookRegistry <EOL> from bento ... |
<s> import os <EOL> import os . path as op <EOL> import tempfile <EOL> import shutil <EOL> import zipfile <EOL> from bento . compat . api . moves import unittest <EOL> from bento . core . package import PackageDescription <EOL> from bento . core . node import create_root_with_source_tree <EOL> from bento . commands . o... |
<s> import sys <EOL> import traceback <EOL> import optparse <EOL> import os . path as op <EOL> from six . moves import cStringIO <EOL> from bento . utils . utils import pprint , extract_exception , comma_list_split <EOL> from bento . core . package import static_representation <EOL> from bento . commands . core import ... |
<s> import sys <EOL> import os <EOL> import os . path as op <EOL> import warnings <EOL> from distutils . cmd import Command <EOL> from distutils . command . install import INSTALL_SCHEMES <EOL> from bento . _config import BUILD_MANIFEST_PATH <EOL> from bento . installed_package_description import BuildManifest , iter_f... |
<s> import sys <EOL> import copy <EOL> from bento . parser . nodes import Node <EOL> _LIT_BOOL = { "<STR_LIT:true>" : True , "<STR_LIT:false>" : False , True : True , False : False } <EOL> class Dispatcher ( object ) : <EOL> def __init__ ( self , user_values = None ) : <EOL> self . _d = { <EOL> "<STR_LIT>" : { } , <EOL... |
<s> import sys <EOL> def get_exception ( ) : <EOL> return sys . exc_info ( ) [ <NUM_LIT:1> ] </s>
|
<s> import yaku . utils <EOL> def setup ( ctx ) : <EOL> env = ctx . env <EOL> ctx . env [ "<STR_LIT>" ] = [ "<STR_LIT>" ] <EOL> ctx . env [ "<STR_LIT>" ] = [ "<STR_LIT:-c>" , "<STR_LIT>" ] <EOL> ctx . env [ "<STR_LIT>" ] = [ ] <EOL> ctx . env [ "<STR_LIT>" ] = [ "<STR_LIT>" ] <EOL> ctx . env [ "<STR_LIT>" ] = [ "<STR_L... |
<s> class BentoWarning ( UserWarning ) : <EOL> pass <EOL> class NoBentoInfoWarning ( BentoWarning ) : <EOL> pass </s>
|
<s> from ctypeslib . codegen import typedesc <EOL> def typedef_def ( tp ) : <EOL> if not isinstance ( tp . typ , typedesc . PointerType ) : <EOL> return "<STR_LIT>" % ( tp . typ . name , tp . name ) <EOL> else : <EOL> return "<STR_LIT>" % ( pointer_decl ( tp . typ ) % tp . name ) <EOL> def pointer_decl ( tp ) : <EOL> i... |
<s> """<STR_LIT>""" <EOL> from pyparsing import MatchFirst <EOL> from pyparsing import ParseException <EOL> from pyparsing import Word <EOL> from pyparsing import WordStart <EOL> from pyparsing import delimitedList <EOL> from pyparsing import printables <EOL> from pyparsing import restOfLine <EOL> from . utils import _... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import unittest <EOL> from testfixtures import TempDirectory <EOL> from nose . tools import raises <EOL> from nose . tools import eq_ <EOL> from . . etl_actions import read_pipeline_definition <EOL> from . . etl_actions import create_pipeline <EOL> from ... utils . exceptions i... |
<s> """<STR_LIT>""" <EOL> from . check import Check <EOL> from . utils import render_output <EOL> class CountCheck ( Check ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , source_count , destination_count , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> super ( CountCheck , self ) . __init__ ( ** kwargs ) <EOL> self . ... |
<s> """<STR_LIT>""" <EOL> from . . s3 import S3Path <EOL> from . . utils . exceptions import ETLInputError <EOL> from . . utils . helpers import exactly_one <EOL> from . . utils . helpers import get_modified_s3_path <EOL> from . etl_step import ETLStep <EOL> class ExtractS3Step ( ETLStep ) : <EOL> """<STR_LIT>""" <EOL>... |
<s> import random <EOL> import re <EOL> from twisted . internet import reactor , defer <EOL> from twisted . internet . defer import inlineCallbacks <EOL> from cowrie . core . honeypot import HoneyPotCommand <EOL> commands = { } <EOL> class command_faked_package_class_factory ( object ) : <EOL> @ staticmethod <EOL> def ... |
<s> """<STR_LIT>""" <EOL> from twisted . python import log <EOL> def formatCef ( logentry ) : <EOL> """<STR_LIT>""" <EOL> cefVendor = "<STR_LIT>" <EOL> cefProduct = "<STR_LIT>" <EOL> cefVersion = "<STR_LIT:1.0>" <EOL> cefSignature = logentry [ "<STR_LIT>" ] <EOL> cefName = logentry [ "<STR_LIT>" ] <EOL> cefSeverity = "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.