code stringlengths 9 256k |
|---|
<s> from pycket . arity import Arity <EOL> from pycket . error import SchemeException <EOL> from rpython . tool . pairtype import extendabletype <EOL> from rpython . rlib import jit , objectmodel <EOL> class UnhashableType ( Exception ) : <EOL> pass <EOL> class W_ProtoObject ( object ) : <EOL> """<STR_LIT>""" <EOL> _at... |
<s> from rpython . rlib import jit , unroll <EOL> from pycket . error import SchemeException <EOL> from pycket . arity import Arity <EOL> prim_env = { } <EOL> SAFE = <NUM_LIT:0> <EOL> UNSAFE = <NUM_LIT:1> <EOL> SUBCLASS_UNSAFE = <NUM_LIT:2> <EOL> if not hasattr ( jit , '<STR_LIT>' ) : <EOL> known = getattr ( jit , '<ST... |
<s> from pycket . values import * <EOL> from pycket . test . testhelper import execute , run_fix , run <EOL> class TestConses ( object ) : <EOL> def test_basics ( self ) : <EOL> _1 , _2 , _3 = W_Fixnum ( <NUM_LIT:1> ) , W_Fixnum ( <NUM_LIT:2> ) , W_Fixnum ( <NUM_LIT:3> ) <EOL> c = W_Cons . make ( _1 , _2 ) <EOL> assert... |
<s> from kokki import Environment , File , Template <EOL> def config ( name ) : <EOL> env = Environment . get_instance ( ) <EOL> File ( "<STR_LIT>" % ( env . config . apache . dir , name ) , <EOL> content = Template ( '<STR_LIT>' % name ) , <EOL> notifies = [ ( "<STR_LIT>" , env . resources [ "<STR_LIT>" ] [ "<STR_LIT>... |
<s> from kokki import Package , Directory , Link , File , Template <EOL> env . include_recipe ( "<STR_LIT>" ) <EOL> Package ( "<STR_LIT>" ) <EOL> Directory ( "<STR_LIT>" , <EOL> owner = "<STR_LIT:root>" , <EOL> group = "<STR_LIT:root>" , <EOL> mode = <NUM_LIT:0> <NUM_LIT> ) <EOL> Link ( "<STR_LIT>" , <EOL> to = "<STR_L... |
<s> __description__ = "<STR_LIT>" <EOL> __config__ = { <EOL> "<STR_LIT>" : dict ( <EOL> description = "<STR_LIT>" , <EOL> default = False , <EOL> ) , <EOL> "<STR_LIT>" : dict ( <EOL> description = "<STR_LIT>" , <EOL> default = "<STR_LIT>" , <EOL> ) , <EOL> "<STR_LIT>" : dict ( <EOL> description = "<STR_LIT>" , <EOL> de... |
<s> from kokki import Package <EOL> Package ( "<STR_LIT>" , <EOL> provider = "<STR_LIT>" <EOL> ) </s>
|
<s> import os <EOL> import re <EOL> import subprocess <EOL> from kokki import Provider , Fail <EOL> whitespace_re = re . compile ( r'<STR_LIT>' ) <EOL> class SupervisorServiceProvider ( Provider ) : <EOL> def action_start ( self ) : <EOL> if not self . status ( ) : <EOL> self . _init_cmd ( "<STR_LIT:start>" , <NUM_LIT:... |
<s> __all__ = [ "<STR_LIT>" ] <EOL> from kokki . base import Resource , ResourceArgument , BooleanArgument <EOL> class Service ( Resource ) : <EOL> service_name = ResourceArgument ( default = lambda obj : obj . name ) <EOL> enabled = ResourceArgument ( ) <EOL> running = ResourceArgument ( ) <EOL> pattern = ResourceArgu... |
<s> import os , sys , signal <EOL> import unittest , time , socket <EOL> from gearman import GearmanClient , GearmanWorker <EOL> from gearman . connection import GearmanConnection <EOL> from gearman . manager import GearmanManager <EOL> from gearman . server import GearmanServer <EOL> from gearman . task import Task <E... |
<s> import re <EOL> import sys <EOL> import six <EOL> from inspect import getargspec <EOL> from jsonrpc . site import jsonrpc_site <EOL> from jsonrpc . _types import * <EOL> from jsonrpc . exceptions import * <EOL> try : <EOL> from collections import OrderedDict <EOL> except ImportError : <EOL> from django . utils . da... |
<s> NAME = '<STR_LIT>' <EOL> def is_waf ( self ) : <EOL> if self . matchheader ( ( '<STR_LIT>' , '<STR_LIT>' ) ) : <EOL> return True <EOL> return False </s>
|
<s> NAME = '<STR_LIT>' <EOL> def is_waf ( self ) : <EOL> detected = False <EOL> for attack in self . attacks : <EOL> r = attack ( self ) <EOL> if r is None : <EOL> return <EOL> response , responsebody = r <EOL> if response . status == <NUM_LIT> : <EOL> detected = True <EOL> break <EOL> return detected </s>
|
<s> """<STR_LIT>""" <EOL> import os , sys , logging <EOL> sys . path . append ( '<STR_LIT>' ) <EOL> from config import settings <EOL> log = logging . getLogger ( ) <EOL> from bottle import route , view , HTTPError , response <EOL> import app , utils , proxy <EOL> @ route ( '<STR_LIT>' ) <EOL> def route_feeds ( name ) :... |
<s> from setuptools import setup , find_packages <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 = find_packages ( ) , <EOL> classifiers = [ <EOL> '<STR_LIT>'... |
<s> from __future__ import unicode_literals <EOL> import os <EOL> import os . path <EOL> import subprocess <EOL> import platform <EOL> from mock import patch <EOL> from pytest import raises <EOL> from vex import run <EOL> from vex import exceptions <EOL> from . fakes import FakeEnviron , PatchedModule , FakePopen <EOL>... |
<s> import inspect , itertools , re , time <EOL> from conary import trove , versions <EOL> from conary . build import defaultrecipes , use <EOL> from conary . build import lookaside <EOL> from conary . build . errors import CookError <EOL> from conary . build . grouprecipe import _BaseGroupRecipe , _SingleGroup <EOL> f... |
<s> import itertools <EOL> import os <EOL> from conary import trove , versions <EOL> from conary . conaryclient import modelgraph , troveset , update <EOL> from conary . conaryclient import cml <EOL> from conary . conaryclient import systemmodel <EOL> from conary . deps import deps <EOL> from conary . lib import api <E... |
<s> def apiDecorator ( api_type ) : <EOL> def _apiDecorator ( func ) : <EOL> lines = [ '<STR_LIT>' ] <EOL> marked = False <EOL> if not func . __doc__ : <EOL> func . __doc__ = func . __name__ <EOL> lines = func . __doc__ . split ( '<STR_LIT:\n>' ) <EOL> for idx , line in enumerate ( lines ) : <EOL> if '<STR_LIT:@>' in l... |
<s> from ctypes import c_int , c_void_p , create_string_buffer <EOL> from conary . lib . ext import ctypes_utils <EOL> def digest ( data ) : <EOL> buf = create_string_buffer ( <NUM_LIT:32> ) <EOL> helper = ctypes_utils . get_helper ( '<STR_LIT>' ) <EOL> func = helper . sha256ns_digest <EOL> func . argtypes = ( c_void_p... |
<s> """<STR_LIT>""" <EOL> from conary . lib import fixeddifflib , log <EOL> import types <EOL> class Hunk : <EOL> def apply ( self , src , srcLine ) : <EOL> result = [ ] <EOL> fromLine = srcLine <EOL> for line in self . lines : <EOL> if line [ <NUM_LIT:0> ] == "<STR_LIT:U+0020>" : <EOL> if fromLine >= len ( src ) : <EO... |
<s> import os , sys <EOL> from distutils . core import setup <EOL> from distutils . extension import Extension <EOL> __version__ = "<STR_LIT>" <EOL> sqlite = "<STR_LIT>" <EOL> sources = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> macros = [ ] <EOL> if sys . platform in ( "<STR_LIT>" , "<STR_LIT>" ) : <EOL> includ... |
<s> import time as pytime <EOL> class EmptyCache ( dict ) : <EOL> def __init__ ( self , limit = <NUM_LIT> ) : <EOL> dict . __init__ ( self ) <EOL> def get ( self , key , key_prefix = None ) : <EOL> return None <EOL> def get_multi ( self , keys , key_prefix = None ) : <EOL> return { } <EOL> def set ( self , key , val , ... |
<s> import itertools <EOL> from conary import errors as conaryerrors <EOL> from conary import files <EOL> from conary import trove <EOL> from conary import trovetup <EOL> from conary . deps import arch , deps <EOL> from conary . local import deptable <EOL> from conary . repository import changeset , errors , findtrove ... |
<s> from testrunner import testhelp <EOL> from conary_test import rephelp <EOL> import os <EOL> from conary_test . cvctest . buildtest import policytest <EOL> from conary import versions <EOL> from conary . build import action , trovefilter <EOL> from conary . conaryclient import cmdline <EOL> from conary . deps import... |
<s> from conary . build import cook , policy , usergroup <EOL> from conary import files , versions <EOL> from conary_test import rephelp <EOL> class PwClass : <EOL> def restore ( self ) : <EOL> files . userCache . nameLookupFn = self . real <EOL> def getpwnam ( self , user ) : <EOL> if user == '<STR_LIT:root>' : <EOL> ... |
<s> import os <EOL> import subprocess <EOL> from conary . lib import fixeddifflib <EOL> from conary_test import rephelp <EOL> class DifflibTest ( rephelp . RepositoryHelper ) : <EOL> def testInfiniteRecursionPatch ( self ) : <EOL> first = [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL>... |
<s> from testrunner import testhelp <EOL> import base64 <EOL> import os <EOL> import time <EOL> import tempfile <EOL> import urllib2 <EOL> from conary_test import rephelp <EOL> from conary_test import resources <EOL> from conary import conaryclient <EOL> from conary import dbstore <EOL> from conary import trove <EOL> f... |
<s> filters = ( '<STR_LIT>' , ( '<STR_LIT>' , ) ) </s>
|
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> from django . conf import urls <EOL> from django . contrib . auth import decorators <EOL> from django . views . generic import TemplateView <EOL> from services . accounts import ajax , views <EOL> urlpatterns = urls . patterns ( <EOL> '<STR_LIT>' , <EOL> urls . u... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterField ( <EOL> model_name = '<STR_LIT:message>' , <EOL> name =... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . RemoveField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_... |
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import logging <EOL> from django import test <EOL> from services . common import misc , helpers as db_tools <EOL> from services . configuration . jrpc . serializers import segments as segment_serializaers <EOL> from services . configuration . jrpc . views . segme... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import django . core . validators <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterField ( <EOL> model_n... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_L... |
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import rpc4django <EOL> from services . configuration . models import segments as segment_models <EOL> from services . simulation . models import groundtracks as simulation_models <EOL> from services . simulation . jrpc . serializers import groundtracks <EOL> fro... |
<s> import argparse <EOL> import glob <EOL> import os <EOL> import os . path <EOL> import shutil <EOL> from subprocess import call , Popen <EOL> import tempfile <EOL> CODESIGN_BIN = '<STR_LIT>' <EOL> PLIST_BUDDY_BIN = '<STR_LIT>' <EOL> SECURITY_BIN = '<STR_LIT>' <EOL> ZIP_BIN = '<STR_LIT>' <EOL> UNZIP_BIN = '<STR_LIT>'... |
<s> import sys <EOL> import monocle <EOL> from monocle import _o <EOL> monocle . init ( sys . argv [ <NUM_LIT:1> ] ) <EOL> from monocle . stack import eventloop <EOL> from monocle . stack . network . http import HttpClient <EOL> @ _o <EOL> def req ( ) : <EOL> client = HttpClient ( ) <EOL> try : <EOL> yield client . con... |
<s> import os <EOL> import logging <EOL> from monocle import _o , Return , VERSION , launch , log_exception <EOL> from monocle . callback import Callback <EOL> from monocle . stack . network . http import HttpHeaders , HttpRequest , HttpRouter , write_request , read_response , extract_response <EOL> from monocle . twis... |
<s> import os <EOL> from cardtranslator import * <EOL> from input_reader import * <EOL> def user_setattr ( obj , inputs ) : <EOL> for k , v in inputs . iteritems ( ) : <EOL> if k . find ( '<STR_LIT:blank>' ) > - <NUM_LIT:1> : <EOL> continue <EOL> str_test = str ( v ) <EOL> if str_test . find ( '<STR_LIT:.>' ) > - <NUM_... |
<s> __author__ = '<STR_LIT>' <EOL> __credits__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> __maintainer__ = '<STR_LIT>' <EOL> __email__ = '<STR_LIT>' <EOL> __license__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' </s>
|
<s> import unittest <EOL> from libnmap . parser import NmapParser <EOL> host1 = """<STR_LIT>""" <EOL> host2 = """<STR_LIT>""" <EOL> host3 = """<STR_LIT>""" <EOL> host4 = """<STR_LIT>""" <EOL> class TestNmapHost ( unittest . TestCase ) : <EOL> def test_eq_host ( self ) : <EOL> h1 = NmapParser . parse ( host1 ) <EOL> h2 ... |
<s> from setuptools import setup , find_packages <EOL> import os <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> packages = find_packages ( <EOL> exclude = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> ) , <EOL> package_data = { <EOL> '<... |
<s> __author__ = '<STR_LIT>' <EOL> import os <EOL> import re <EOL> import scalyr_agent . third_party . tcollector . tcollector as tcollector <EOL> from Queue import Empty <EOL> from scalyr_agent import ScalyrMonitor , BadMonitorConfiguration , define_metric , define_log_field , define_config_option <EOL> from scalyr_ag... |
<s> import sys <EOL> __author__ = '<STR_LIT>' <EOL> import datetime <EOL> import errno <EOL> import glob <EOL> import os <EOL> import random <EOL> import re <EOL> import threading <EOL> import time <EOL> import timeit <EOL> import scalyr_agent . json_lib as json_lib <EOL> import scalyr_agent . scalyr_logging as scalyr_... |
<s> __author__ = '<STR_LIT>' <EOL> import scalyr_agent . scalyr_logging as scalyr_logging <EOL> from scalyr_agent . run_monitor import run_standalone_monitor <EOL> from scalyr_agent . test_base import ScalyrTestCase <EOL> class RunMonitorTest ( ScalyrTestCase ) : <EOL> def test_run_standalone_monitor ( self ) : <EOL> c... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import socket <EOL> import sys <EOL> import time <EOL> COLLECTION_INTERVAL = <NUM_LIT:30> <EOL> try : <EOL> if "<STR_LIT>" in os . environ : <EOL> COLLECTION_INTERVAL = float ( os . environ [ "<STR_LIT>" ] ) <EOL> except ValueError : <EOL> pass <EOL> FIELDS_DISK = ( <EOL> "<STR... |
<s> import sys , time , random , struct , cStringIO , binascii <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> def break_up_addresses ( device , addrs , block_wordcount ) : <EOL> """<STR_LIT>""" <EOL> parts = [ ] <EOL> block_bytecount = block_wordcount * <NUM_LIT:4> <EOL> for addr in addrs : <EOL> if len ( addr ) =... |
<s> from distutils . core import setup <EOL> from asimap import __version__ <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = __version__ , <EOL> description = '<STR_LIT>' , <EOL> long_description = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> down... |
<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> import pptx . exc as exceptions <EOL> import sys <EOL> sys . modules [ '<STR_LIT>' ] = exceptions <EOL> del sys <EOL> from pptx . api import Presentation <EOL> from pptx . opc . constants import CONTENT_TYPE as CT <EOL> from pptx . opc . package import PartFacto... |
<s> """<STR_LIT>""" <EOL> import posixpath <EOL> import re <EOL> class PackURI ( str ) : <EOL> """<STR_LIT>""" <EOL> _filename_re = re . compile ( '<STR_LIT>' ) <EOL> def __new__ ( cls , pack_uri_str ) : <EOL> if not pack_uri_str [ <NUM_LIT:0> ] == '<STR_LIT:/>' : <EOL> tmpl = "<STR_LIT>" <EOL> raise ValueError ( tmpl ... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from ... enum . shapes import PP_PLACEHOLDER <EOL> from . . ns import qn <EOL> from . . simpletypes import ( <EOL> ST_Angle , ST_Coordinate , ST_Direction , ST_DrawingElementId , ST_LineWidth , <EOL> ST_PlaceholderSize , ST_PositiveCoordinate , XsdS... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , division , print_function <EOL> import platform <EOL> from warnings import warn <EOL> class Length ( int ) : <EOL> """<STR_LIT>""" <EOL> _EMUS_PER_INCH = <NUM_LIT> <EOL> _EMUS_PER_CENTIPOINT = <NUM_LIT> <EOL> _EMUS_PER_CM = <NUM_LIT> <EOL> _EMUS_PER_MM ... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function <EOL> import pytest <EOL> from pptx . oxml . shapes . autoshape import CT_Shape <EOL> from pptx . oxml . shapes . graphfrm import CT_GraphicalObjectFrame <EOL> from pptx . oxml . shapes . groupshape import CT_GroupShape <EOL> from pptx . ... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function , unicode_literals <EOL> import pytest <EOL> from pptx . chart . data import ChartData <EOL> from pptx . enum . shapes import MSO_SHAPE_TYPE , PP_PLACEHOLDER <EOL> from pptx . oxml . shapes . shared import ST_Direction , ST_PlaceholderSiz... |
<s> from MessagePresenter import MessagePresenter <EOL> import random <EOL> class BroadcastPresenter ( MessagePresenter ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , <EOL> presenters = [ ] , <EOL> * args , ** kwargs <EOL> ) : <EOL> MessagePresenter . __init__ ( self , * args , ** kwargs ) <EOL> self . presenter... |
<s> from sys import version_info <EOL> if version_info >= ( <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:0> ) : <EOL> def swig_import_helper ( ) : <EOL> from os . path import dirname <EOL> import imp <EOL> fp = None <EOL> try : <EOL> fp , pathname , description = imp . find_module ( '<STR_LIT>' , [ dirname ( __file__ ) ] ) <EO... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> import socket <EOL> import time <EOL> import logging <EOL> from rpyc . core import brine <EOL> DEFAULT_PRUNING_TIMEOUT = <NUM_LIT:4> * <NUM_LIT> <EOL> MAX_DGRAM_SIZE = <NUM_LIT> <EOL> REGISTRY_PORT = <NUM_LIT> <EOL> class RegistryServer ( object ) : <EOL> """<STR_LIT>""" <EOL>... |
<s> from __future__ import unicode_literals , absolute_import <EOL> import copy <EOL> from . . common import * <EOL> from . . util import setdefault <EOL> from . base import BaseType <EOL> def serializable ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> def wrapper ( func ) : <EOL> serialized_type = kwargs . pop (... |
<s> from emogenerator import main , emogenerator </s>
|
<s> import factory <EOL> from editorialmanager import models <EOL> from journalmanager . tests . modelfactories import IssueFactory , LanguageFactory <EOL> class EditorialBoardFactory ( factory . Factory ) : <EOL> FACTORY_FOR = models . EditorialBoard <EOL> issue = factory . SubFactory ( IssueFactory ) <EOL> class Role... |
<s> from south . utils import datetime_utils as datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import models <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ( self , orm ) : <EOL> db . create_table ( '<STR_LIT>' , ( <EOL> ( '<STR_LIT:id>' , se... |
<s> from django . test import TestCase <EOL> from django import forms <EOL> from django . template import Template , Context <EOL> class StampRegularFieldTests ( TestCase ) : <EOL> def test_field_is_printed ( self ) : <EOL> out = Template ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) . render ( Context ( { <EOL> '<STR_... |
<s> from django . db . models import DateTimeField <EOL> def safe_autodatetime ( modelname ) : <EOL> """<STR_LIT>""" <EOL> def rewrapper ( func ) : <EOL> def wrapper ( instance , orm ) : <EOL> attr = getattr ( orm , modelname ) <EOL> fields = [ field for field in attr . _meta . fields if isinstance ( <EOL> field , Date... |
<s> import os <EOL> import tempfile <EOL> output_dir = os . path . join ( tempfile . gettempdir ( ) , '<STR_LIT>' ) <EOL> notebooks = sorted ( [ os . path . join ( output_dir , f ) for f in os . listdir ( output_dir ) if f . endswith ( '<STR_LIT>' ) ] ) <EOL> c . NbConvertApp . notebooks = notebooks </s>
|
<s> from __future__ import absolute_import , division , print_function <EOL> import logging <EOL> logger = logging . getLogger ( __name__ ) <EOL> from . background import snip_method <EOL> from . models import ( Lorentzian2Model , ComptonModel , ElasticModel ) <EOL> from . lineshapes import ( gaussian , lorentzian , lo... |
<s> from __future__ import absolute_import , division , print_function <EOL> import logging <EOL> import numpy as np <EOL> from numpy . testing import assert_array_almost_equal <EOL> import skbeam . core . speckle as xsvs <EOL> import skbeam . core . mask as mask <EOL> from skbeam . core import roi <EOL> logger = loggi... |
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> from scipy . ndimage import gaussian_filter <EOL> import matplotlib . pyplot as plt <EOL> from skimage import data <EOL> from skimage import img_as_float <EOL> from skimage . morphology import reconstruction <EOL> image = img_as_float ( data . coins ( ) ) <EOL> image =... |
<s> from __future__ import division <EOL> """<STR_LIT>""" <EOL> import numpy as np <EOL> import matplotlib <EOL> import matplotlib . pyplot as plt <EOL> from skimage import data , transform <EOL> from skimage . util import img_as_ubyte <EOL> from skimage . morphology import disk <EOL> from skimage . filters import rank... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import numpy as np <EOL> from matplotlib import pyplot as plt <EOL> from skimage import data <EOL> from skimage . util import img_as_float <EOL> from skimage . feature import ( corner_harris , corner_subpix , corner_peaks , <EOL> plot_matches ) <EOL>... |
<s> """<STR_LIT>""" <EOL> import os . path as osp <EOL> import imp <EOL> import functools <EOL> import warnings <EOL> import sys <EOL> pkg_dir = osp . abspath ( osp . dirname ( __file__ ) ) <EOL> data_dir = osp . join ( pkg_dir , '<STR_LIT:data>' ) <EOL> __version__ = '<STR_LIT>' <EOL> try : <EOL> imp . find_module ( '... |
<s> import numpy as np <EOL> from . . filters import gaussian <EOL> def binary_blobs ( length = <NUM_LIT> , blob_size_fraction = <NUM_LIT:0.1> , n_dim = <NUM_LIT:2> , <EOL> volume_fraction = <NUM_LIT:0.5> , seed = None ) : <EOL> """<STR_LIT>""" <EOL> rs = np . random . RandomState ( seed ) <EOL> shape = tuple ( [ lengt... |
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> def _upsampled_dft ( data , upsampled_region_size , <EOL> upsample_factor = <NUM_LIT:1> , axis_offsets = None ) : <EOL> """<STR_LIT>""" <EOL> if not hasattr ( upsampled_region_size , "<STR_LIT>" ) : <EOL> upsampled_region_size = [ upsampled_region_size , ] * data . ndi... |
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> from ... _shared . utils import assert_nD <EOL> from . import percentile_cy <EOL> from . generic import _handle_input <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EO... |
<s> import skimage . graph . mcp as mcp <EOL> from numpy . testing import ( assert_array_equal , <EOL> assert_almost_equal , <EOL> ) <EOL> import numpy as np <EOL> a = np . ones ( ( <NUM_LIT:8> , <NUM_LIT:8> ) , dtype = np . float32 ) <EOL> count = <NUM_LIT:0> <EOL> class MCP ( mcp . MCP_Connect ) : <EOL> def _reset ( ... |
<s> """<STR_LIT>""" <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> import numpy as np <EOL> def _sift_read ( f , mode = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> if not hasattr ( f , '<STR_LIT>' ) : <EOL> f = file ( f , '<STR_LIT:r>' ) <EOL> if mode == '<STR_LIT>' : <EOL> nr_features , feature_len = map ( int , ... |
<s> import numpy as np <EOL> from scipy import ndimage as ndi <EOL> def profile_line ( img , src , dst , linewidth = <NUM_LIT:1> , <EOL> order = <NUM_LIT:1> , mode = '<STR_LIT>' , cval = <NUM_LIT:0.0> ) : <EOL> """<STR_LIT>""" <EOL> perp_lines = _line_profile_coordinates ( src , dst , linewidth = linewidth ) <EOL> if i... |
<s> import numpy as np <EOL> from numpy . testing import ( assert_array_equal , assert_equal , assert_raises , <EOL> assert_warns ) <EOL> from skimage . morphology import remove_small_objects , remove_small_holes <EOL> from ... _shared . _warnings import expected_warnings <EOL> test_image = np . array ( [ [ <NUM_LIT:0>... |
<s> import numpy as np <EOL> from skimage import img_as_float <EOL> import scipy <EOL> import scipy . linalg <EOL> from scipy . interpolate import RectBivariateSpline , interp2d <EOL> from skimage . filters import sobel <EOL> def active_contour ( image , snake , alpha = <NUM_LIT> , beta = <NUM_LIT:0.1> , <EOL> w_line =... |
<s> import numpy as np <EOL> from numpy . testing import assert_equal <EOL> from skimage . transform import integral_image , integrate <EOL> np . random . seed ( <NUM_LIT:0> ) <EOL> x = ( np . random . rand ( <NUM_LIT:50> , <NUM_LIT:50> ) * <NUM_LIT:255> ) . astype ( np . uint8 ) <EOL> s = integral_image ( x ) <EOL> de... |
<s> from matplotlib . widgets import RectangleSelector <EOL> from ... viewer . canvastools . base import CanvasToolBase <EOL> from ... viewer . canvastools . base import ToolHandles <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class RectangleTool ( CanvasToolBase , RectangleSelector ) : <EOL> """<STR_LIT>""" <EOL> def __init_... |
<s> import subprocess <EOL> import shlex <EOL> import numpy as np <EOL> from collections import defaultdict <EOL> from editdistance import eval as dist <EOL> threshold = <NUM_LIT:5> <EOL> def call ( cmd ) : <EOL> return subprocess . check_output ( shlex . split ( cmd ) , universal_newlines = True ) . split ( '<STR_LIT:... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from collections import defaultdict <EOL> import gc <EOL> import sys <EOL> from time import time <EOL> import numpy as np <EOL> from sklearn . linear_model import lars_path <EOL> from sklearn . linear_model import lasso_path <EOL> from sklearn . data... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import tarfile <EOL> from contextlib import closing <EOL> try : <EOL> from urllib import urlopen <EOL> except ImportError : <EOL> from urllib . request import urlopen <EOL> URL = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> ARCHIVE_NAME = URL . rsplit ( '<STR_LIT:/>' , <NUM_LIT:1> )... |
<s> """<STR_LIT>""" <EOL> print ( __doc__ ) <EOL> import matplotlib . pyplot as plt <EOL> from sklearn import datasets , svm , metrics <EOL> digits = datasets . load_digits ( ) <EOL> images_and_labels = list ( zip ( digits . images , digits . target ) ) <EOL> for index , ( image , label ) in enumerate ( images_and_labe... |
<s> """<STR_LIT>""" <EOL> print ( __doc__ ) <EOL> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> from scipy import linalg <EOL> from sklearn . covariance import LedoitWolf , OAS , ShrunkCovariance , log_likelihood , empirical_covariance <EOL> from sklearn . model_selection import GridSearchCV <EOL> n_... |
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> np . random . seed ( <NUM_LIT:10> ) <EOL> import matplotlib . pyplot as plt <EOL> from sklearn . datasets import make_classification <EOL> from sklearn . linear_model import LogisticRegression <EOL> from sklearn . ensemble import ( RandomTreesEmbedding , RandomForestCl... |
<s> """<STR_LIT>""" <EOL> print ( __doc__ ) <EOL> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> from sklearn import datasets <EOL> from sklearn . gaussian_process import GaussianProcessClassifier <EOL> from sklearn . gaussian_process . kernels import RBF <EOL> iris = datasets . load_iris ( ) <EOL> X ... |
<s> """<STR_LIT>""" <EOL> print ( __doc__ ) <EOL> import matplotlib . pyplot as plt <EOL> import numpy as np <EOL> from sklearn . datasets import make_regression <EOL> from sklearn . linear_model import Ridge <EOL> from sklearn . metrics import mean_squared_error <EOL> clf = Ridge ( ) <EOL> X , y , w = make_regression ... |
<s> """<STR_LIT>""" <EOL> print ( __doc__ ) <EOL> import numpy as np <EOL> from scipy import interp <EOL> import matplotlib . pyplot as plt <EOL> from itertools import cycle <EOL> from sklearn import svm , datasets <EOL> from sklearn . metrics import roc_curve , auc <EOL> from sklearn . model_selection import Stratifie... |
<s> """<STR_LIT>""" <EOL> print ( __doc__ ) <EOL> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> from scipy import stats <EOL> from sklearn import datasets <EOL> from sklearn . semi_supervised import label_propagation <EOL> from sklearn . metrics import classification_report , confusion_matrix <EOL> d... |
<s> """<STR_LIT>""" <EOL> import copy <EOL> import warnings <EOL> import numpy as np <EOL> from scipy import sparse <EOL> from . externals import six <EOL> from . utils . fixes import signature <EOL> from . utils . deprecation import deprecated <EOL> from . exceptions import ChangedBehaviorWarning as _ChangedBehaviorWa... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> import numpy as np <EOL> from scipy import linalg <EOL> from sklearn . utils . testing import assert_array_almost_equal <EOL> from sklearn . utils . testing import assert_array_less <EOL> from sklearn . covariance import ( graph_lasso , GraphLasso , GraphLassoCV , <EOL> empiri... |
<s> from __future__ import division <EOL> from collections import defaultdict <EOL> from functools import partial <EOL> import numpy as np <EOL> import scipy . sparse as sp <EOL> from sklearn . externals . six . moves import zip <EOL> from sklearn . utils . testing import assert_equal <EOL> from sklearn . utils . testi... |
<s> """<STR_LIT>""" <EOL> from . base import BaseEnsemble <EOL> from . forest import RandomForestClassifier <EOL> from . forest import RandomForestRegressor <EOL> from . forest import RandomTreesEmbedding <EOL> from . forest import ExtraTreesClassifier <EOL> from . forest import ExtraTreesRegressor <EOL> from . bagging... |
<s> """<STR_LIT>""" <EOL> import inspect <EOL> import keyword <EOL> import linecache <EOL> import os <EOL> import pydoc <EOL> import sys <EOL> import time <EOL> import tokenize <EOL> import traceback <EOL> try : <EOL> generate_tokens = tokenize . generate_tokens <EOL> except AttributeError : <EOL> generate_tokens = tok... |
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> from . . utils import check_X_y , safe_sqr <EOL> from . . utils . metaestimators import if_delegate_has_method <EOL> from . . base import BaseEstimator <EOL> from . . base import MetaEstimatorMixin <EOL> from . . base import clone <EOL> from . . base import is_classifi... |
<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> from abc import ABCMeta , abstractmethod <EOL> import numbers <EOL> import warnings <EOL> import numpy as np <EOL> import scipy . sparse as sp <EOL> from scipy import linalg <EOL> from scipy import sparse <EOL> from . . externals import six <EOL> from . . ... |
<s> import pickle <EOL> import unittest <EOL> import numpy as np <EOL> import scipy . sparse as sp <EOL> from sklearn . utils . testing import assert_array_equal <EOL> from sklearn . utils . testing import assert_almost_equal <EOL> from sklearn . utils . testing import assert_array_almost_equal <EOL> from sklearn . uti... |
<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> import warnings <EOL> import numpy as np <EOL> from scipy . sparse import csr_matrix <EOL> from . . utils import check_consistent_length <EOL> from . . utils import column_or_1d , check_array <EOL> from . . utils . multiclass import type_of_target <EOL> fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.