code stringlengths 9 256k |
|---|
<s> """<STR_LIT>""" <EOL> import re <EOL> import datetime <EOL> from st2common . util import date as date_utils <EOL> __all__ = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> ISO8601_FORMAT = '<STR_LIT>' <EOL> ISO8601_FORMAT_MICROSECOND = '<STR_LIT>' <EOL> ISO8601_UTC_REGEX = '<STR_LIT>' <EOL... |
<s> import plugin . util . randomutil <EOL> class SamplePlugin ( object ) : <EOL> def __init__ ( self ) : <EOL> self . __count = <NUM_LIT:10> <EOL> def do_work ( self ) : <EOL> return plugin . util . randomutil . get_random_numbers ( self . __count ) </s>
|
<s> import jsonschema <EOL> import mock <EOL> import mongoengine . connection <EOL> from oslo_config import cfg <EOL> from st2common . constants . triggers import TRIGGER_INSTANCE_PROCESSED <EOL> from st2common . models . system . common import ResourceReference <EOL> from st2common . transport . publishers import Pool... |
<s> import os <EOL> import sys <EOL> import unittest2 <EOL> BASE_DIR = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> PACK_ACTIONS_DIR = os . path . join ( BASE_DIR , '<STR_LIT>' ) <EOL> PACK_ACTIONS_DIR = os . path . abspath ( PACK_ACTIONS_DIR ) <EOL> sys . path . insert ( <NUM_LIT:0> , PACK_ACTIONS_DI... |
<s> import mock <EOL> import unittest2 <EOL> from st2common . models . api . sensor import SensorTypeAPI <EOL> from st2common . models . utils import sensor_type_utils <EOL> class SensorTypeUtilsTestCase ( unittest2 . TestCase ) : <EOL> def test_to_sensor_db_model_no_trigger_types ( self ) : <EOL> sensor_meta = { <EOL>... |
<s> import os . path <EOL> from setuptools import setup , find_packages <EOL> from dist_utils import fetch_requirements <EOL> from dist_utils import apply_vagrant_workaround <EOL> from st2exporter import __version__ <EOL> ST2_COMPONENT = '<STR_LIT>' <EOL> BASE_DIR = os . path . dirname ( os . path . abspath ( __file__ ... |
<s> import copy <EOL> from st2common . constants . rules import TRIGGER_PAYLOAD_PREFIX <EOL> from st2common . constants . system import SYSTEM_KV_PREFIX <EOL> from st2common . services . keyvalues import KeyValueLookup <EOL> from st2common . util import jinja as jinja_utils <EOL> class Jinja2BasedTransformer ( object )... |
<s> import bson <EOL> import mock <EOL> from st2common . constants . triggers import TIMER_TRIGGER_TYPES <EOL> from st2common . models . db . trigger import TriggerDB <EOL> from st2common . models . system . common import ResourceReference <EOL> from st2common . persistence . trigger import TriggerType <EOL> from st2co... |
<s> import json <EOL> class FakeResponse ( object ) : <EOL> def __init__ ( self , text , status_code , reason ) : <EOL> self . text = text <EOL> self . status_code = status_code <EOL> self . reason = reason <EOL> def json ( self ) : <EOL> return json . loads ( self . text ) <EOL> def raise_for_status ( self ) : <EOL> r... |
<s> from st2reactor . sensor . base import Sensor <EOL> from flask import Flask , request <EOL> import json <EOL> WEBHOOK_TRIGGER_REF = "<STR_LIT>" <EOL> class ActiveCampaignWebhook ( Sensor ) : <EOL> """<STR_LIT>""" <EOL> def setup ( self ) : <EOL> self . host = self . _config [ '<STR_LIT>' ] [ '<STR_LIT:host>' ] <EOL... |
<s> from lib . base import AzureBaseStorageAction <EOL> class AzureDeleteObjectAction ( AzureBaseStorageAction ) : <EOL> def run ( self , container_name , object_name ) : <EOL> obj = self . _driver . get_object ( container_name = container_name , <EOL> object_name = object_name ) <EOL> result = self . _driver . delete_... |
<s> import argparse <EOL> import os <EOL> import sys <EOL> try : <EOL> import yaml <EOL> except ImportError : <EOL> sys . stderr . write ( '<STR_LIT>' + <EOL> '<STR_LIT>' ) <EOL> raise <EOL> def list_seed_nodes ( config_file ) : <EOL> if not os . path . exists ( config_file ) : <EOL> msg = '<STR_LIT>' % config_file <EO... |
<s> from lib import action <EOL> class ConsulParseNodesAction ( action . ConsulBaseAction ) : <EOL> def run ( self , data ) : <EOL> nodes = [ ] <EOL> return nodes </s>
|
<s> from lib import actions <EOL> from libcloud . compute . drivers . dimensiondata import DimensionDataNetwork <EOL> __all__ = [ <EOL> '<STR_LIT>' , <EOL> ] <EOL> class DeleteNetworkAction ( actions . BaseAction ) : <EOL> def run ( self , ** kwargs ) : <EOL> action = kwargs [ '<STR_LIT:action>' ] <EOL> del kwargs [ '<... |
<s> from easydict import EasyDict <EOL> from lib . curator_action import CuratorAction <EOL> import logging <EOL> logger = logging . getLogger ( __name__ ) <EOL> class CuratorRunner ( CuratorAction ) : <EOL> def run ( self , action = None , log_level = '<STR_LIT>' , dry_run = False , operation_timeout = <NUM_LIT> , ** ... |
<s> from lib . base import BaseGithubAction <EOL> __all__ = [ <EOL> '<STR_LIT>' <EOL> ] <EOL> class GetCloneStatsAction ( BaseGithubAction ) : <EOL> def run ( self , repo ) : <EOL> clone_data = self . _get_analytics ( category = '<STR_LIT>' , repo = repo ) <EOL> return clone_data [ '<STR_LIT>' ] </s>
|
<s> from lib import action <EOL> class RGBAction ( action . BaseAction ) : <EOL> def run ( self , light_id , red , green , blue , transition_time ) : <EOL> light = self . hue . lights . get ( light_id ) <EOL> light . rgb ( red , green , blue , transition_time ) </s>
|
<s> from analysis_apiclient import AnalysisClient <EOL> from st2actions . runners . pythonrunner import Action <EOL> class BaseAction ( Action ) : <EOL> def __init__ ( self , config ) : <EOL> super ( BaseAction , self ) . __init__ ( config ) <EOL> self . _url = self . config . get ( '<STR_LIT:url>' , '<STR_LIT>' ) <EOL... |
<s> from lib . actions import BaseAction <EOL> __all__ = [ <EOL> '<STR_LIT>' <EOL> ] <EOL> class ListVMsAction ( BaseAction ) : <EOL> api_type = '<STR_LIT>' <EOL> def run ( self , credentials ) : <EOL> driver = self . _get_driver_for_credentials ( credentials = credentials ) <EOL> vms = driver . list_nodes ( ) <EOL> re... |
<s> from lib . mmonit import MmonitBaseAction <EOL> class MmonitListEvents ( MmonitBaseAction ) : <EOL> def run ( self , active = None , hostid = None , hostgroupid = None , servicenameid = None , <EOL> servicegroupid = None , servicetype = None , eventtype = None , state = None , datefrom = None , <EOL> results = None... |
<s> from lib import actions <EOL> class SetTemperatureAction ( actions . BaseAction ) : <EOL> def run ( self , scale , structure = None , device = None , temp = None , temp_low = None , temp_high = None ) : <EOL> temperature = None <EOL> mode = None <EOL> if temp_low and temp_high : <EOL> temperature = ( self . _conver... |
<s> import sys <EOL> import time <EOL> from lib import openstack <EOL> from novaclient . client import Client <EOL> sys . argv . pop ( <NUM_LIT:0> ) <EOL> time . sleep ( <NUM_LIT> ) <EOL> for server_id in sys . argv : <EOL> ostack = openstack . OpenStack ( '<STR_LIT>' ) <EOL> sess = ostack . getSession ( ) <EOL> client... |
<s> import re <EOL> from lib . actions import OrionBaseAction <EOL> class NodeCreate ( OrionBaseAction ) : <EOL> def run ( self , <EOL> node , <EOL> ip_address , <EOL> platform , <EOL> poller , <EOL> mon_protocol , <EOL> std_community , <EOL> community , <EOL> status ) : <EOL> """<STR_LIT>""" <EOL> results = { } <EOL> ... |
<s> from lib . base import QualysBaseAction <EOL> __all__ = [ <EOL> '<STR_LIT>' <EOL> ] <EOL> class AddHostsAction ( QualysBaseAction ) : <EOL> def run ( self , hosts , vulnerability_management , policy_compliance ) : <EOL> if policy_compliance and vulnerability_management : <EOL> host_type = '<STR_LIT>' <EOL> elif pol... |
<s> from lib . action import PyraxBaseAction <EOL> __all__ = [ <EOL> '<STR_LIT>' <EOL> ] <EOL> class FindVMIdAction ( PyraxBaseAction ) : <EOL> def run ( self , name ) : <EOL> cs = self . pyrax . cloudservers <EOL> vm_id = [ vm for vm in cs . servers . list ( ) <EOL> if vm . name == name ] [ <NUM_LIT:0> ] . id <EOL> re... |
<s> import salt . cloud <EOL> from st2actions . runners . pythonrunner import Action <EOL> class SaltInstaller ( Action ) : <EOL> def run ( self , name , provider , instance_id ) : <EOL> client = salt . cloud . CloudClient ( '<STR_LIT>' ) <EOL> ret = client . create ( names = [ name ] , provider = provider , <EOL> inst... |
<s> import yaml <EOL> import re <EOL> import urllib2 <EOL> from bs4 import BeautifulSoup <EOL> method_dict = { } <EOL> base_url = '<STR_LIT>' <EOL> api_doc_main = urllib2 . urlopen ( '<STR_LIT>' % base_url ) <EOL> soup = BeautifulSoup ( api_doc_main ) <EOL> api_methods = soup . find ( '<STR_LIT>' , id = '<STR_LIT>' ) <... |
<s> from lib . action import St2BaseAction <EOL> from lib . formatters import format_client_list_result <EOL> __all__ = [ <EOL> '<STR_LIT>' <EOL> ] <EOL> def format_result ( result , exclude_attributes ) : <EOL> return format_client_list_result ( result = result , exclude_attributes = exclude_attributes ) <EOL> class S... |
<s> from lib import action <EOL> class FindBoardByNameAction ( action . BaseAction ) : <EOL> def run ( self , name , api_key = None , token = None ) : <EOL> if api_key : <EOL> self . _set_creds ( api_key = api_key , token = token ) <EOL> boards = [ ] <EOL> for board in self . _client . list_boards ( ) : <EOL> if board ... |
<s> from vmwarelib . actions import BaseAction <EOL> class GetVMConsoleUrls ( BaseAction ) : <EOL> def run ( self , vms ) : <EOL> meta_url_template = '<STR_LIT>' '<STR_LIT>' <EOL> si_content = self . si . RetrieveContent ( ) <EOL> si_uuid = si_content . about . instanceUuid <EOL> host = self . config [ '<STR_LIT:host>'... |
<s> import six <EOL> def one_of_two_strings ( stringa = None , stringb = None , desc = "<STR_LIT>" ) : <EOL> if ( stringb and isinstance ( stringb , six . string_types ) ) or ( stringa and isinstance ( stringa , six . string_types ) ) : <EOL> return <EOL> else : <EOL> raise Exception ( "<STR_LIT>" % desc ) </s>
|
<s> from unittest import TestCase <EOL> from thunderdome import connection <EOL> class BaseThunderdomeTestCase ( TestCase ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> super ( BaseThunderdomeTestCase , cls ) . setUpClass ( ) <EOL> if not connection . _hosts : <EOL> connection . setup ( [ '<STR_LIT:localh... |
<s> import thread <EOL> import time <EOL> from settings import Settings <EOL> import requests <EOL> import json <EOL> from logger import Logger <EOL> from BaseHTTPServer import BaseHTTPRequestHandler , HTTPServer <EOL> from urlparse import urlparse , parse_qs <EOL> from SocketServer import ThreadingMixIn <EOL> import t... |
<s> import copy <EOL> import itertools <EOL> import functools <EOL> import re <EOL> __all__ = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] <EOL> """<STR_LIT>""" <EOL> storage_ty... |
<s> from setuptools import setup , find_packages <EOL> install_requires = [ ] <EOL> try : <EOL> import json <EOL> except ImportError : <EOL> install_requires . append ( "<STR_LIT>" ) <EOL> setup ( <EOL> name = "<STR_LIT>" , <EOL> version = '<STR_LIT>' , <EOL> install_requires = install_requires , <EOL> packages = find_... |
<s> from . . metadata import * <EOL> from . . operation import operation <EOL> from . . prototypes import * <EOL> from . . datautil import guess_type <EOL> class BasicAuditProbe ( object ) : <EOL> def __init__ ( self , key = None , distinct_threshold = <NUM_LIT:10> ) : <EOL> self . field = key <EOL> self . value_count ... |
<s> from queue import Queue <EOL> from threading import Thread <EOL> class Worker ( Thread ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , tasks ) : <EOL> Thread . __init__ ( self ) <EOL> self . tasks = tasks <EOL> self . daemon = True <EOL> self . start ( ) <EOL> def run ( self ) : <EOL> while True : <EOL> func ... |
<s> from downstream_farmer . shell import main <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
|
<s> """<STR_LIT>""" <EOL> __all__ = '<STR_LIT>' , '<STR_LIT>' <EOL> VERSION = ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:0> ) <EOL> VERSION_INFO = '<STR_LIT>' % VERSION </s>
|
<s> import os <EOL> import sublime <EOL> from sublime_plugin import WindowCommand <EOL> from . util import noop , abbreviate_dir <EOL> from . cmd import GitCmd <EOL> GIT_INIT_NO_DIR_ERROR = "<STR_LIT>" <EOL> GIT_INIT_DIR_NOT_EXISTS_MSG = "<STR_LIT>" <EOL> GIT_INIT_NOT_ISDIR_ERROR = "<STR_LIT>" <EOL> GIT_INIT_DIR_EXISTS... |
<s> """<STR_LIT>""" <EOL> from SublimeLinter . lint import Linter , util <EOL> class Cpplint ( Linter ) : <EOL> """<STR_LIT>""" <EOL> syntax = '<STR_LIT>' <EOL> cmd = ( '<STR_LIT>' , '<STR_LIT:*>' , '<STR_LIT:@>' ) <EOL> regex = r'<STR_LIT>' <EOL> tempfile_suffix = '<STR_LIT:->' <EOL> error_stream = util . STREAM_BOTH ... |
<s> """<STR_LIT>""" <EOL> import re <EOL> import sublime <EOL> from . import persist <EOL> WARNING = '<STR_LIT>' <EOL> ERROR = '<STR_LIT:error>' <EOL> MARK_KEY_FORMAT = '<STR_LIT>' <EOL> GUTTER_MARK_KEY_FORMAT = '<STR_LIT>' <EOL> MARK_SCOPE_FORMAT = '<STR_LIT>' <EOL> UNDERLINE_FLAGS = sublime . DRAW_NO_FILL | sublime .... |
<s> import sys <EOL> import sublime_plugin <EOL> if sys . version_info < ( <NUM_LIT:3> , ) : <EOL> from sublime_lib . path import root_at_packages , get_package_name <EOL> else : <EOL> from . sublime_lib . path import root_at_packages , get_package_name <EOL> PLUGIN_NAME = get_package_name ( ) <EOL> COMPLETIONS_SYNTAX_... |
<s> from vex . parsers . parsing import RegexToken <EOL> from vex . parsers . parsing import Lexer <EOL> from vex . parsers . parsing import EOF <EOL> class GlobalLexer ( Lexer ) : <EOL> DELIMITER = RegexToken ( r'<STR_LIT>' ) <EOL> WHITE_SPACE = '<STR_LIT>' <EOL> def __init__ ( self ) : <EOL> self . delimiter = None <... |
<s> import django . dispatch <EOL> cache_read = django . dispatch . Signal ( providing_args = [ "<STR_LIT>" , "<STR_LIT>" ] ) </s>
|
<s> import ast <EOL> import os <EOL> import re <EOL> from collections import defaultdict <EOL> from funcy import cached_property , any , imapcat , isa , ikeep , first , all , imapcat , split , map <EOL> from tqdm import tqdm <EOL> from . asttools import ( is_write , is_use , is_constant , is_param , is_import , is_name... |
<s> from __future__ import print_function <EOL> import re <EOL> import time <EOL> import traceback <EOL> from itertools import chain <EOL> from . cross import imap , basestring <EOL> from . decorators import decorator , wraps , Call <EOL> __all__ = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT... |
<s> from funcy . strings import * <EOL> def test_re_find ( ) : <EOL> assert re_find ( r'<STR_LIT>' , '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert re_find ( r'<STR_LIT>' , '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert re_find ( r'<STR_LIT>' , '<STR_LIT>' ) == ( '<STR_LIT:x>' , '<STR_LIT>' ) <EOL> assert re_find ( r'<STR_LIT>' ... |
<s> """<STR_LIT>""" <EOL> import operator , sys <EOL> __all__ = [ '<STR_LIT:_>' , '<STR_LIT>' ] <EOL> _py_version = sys . version_info [ <NUM_LIT:0> ] <EOL> PYPY3 = _py_version == <NUM_LIT:3> and '<STR_LIT>' in sys . version <EOL> if PYPY3 : <EOL> import collections <EOL> CodeType = collections . namedtuple ( '<STR_LIT... |
<s> '''<STR_LIT>''' <EOL> from . version import __version__ </s>
|
<s> '''<STR_LIT>''' <EOL> import zerorpc <EOL> import os <EOL> import pprint <EOL> import gevent <EOL> def gsleep ( ) : <EOL> '''<STR_LIT>''' <EOL> print '<STR_LIT>' <EOL> gevent . sleep ( <NUM_LIT:0> ) <EOL> class PcapGraph ( object ) : <EOL> '''<STR_LIT>''' <EOL> dependencies = [ '<STR_LIT>' ] <EOL> def __init__ ( se... |
<s> '''<STR_LIT>''' <EOL> import pprint <EOL> class ViewPDF ( object ) : <EOL> '''<STR_LIT>''' <EOL> dependencies = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> def execute ( self , input_data ) : <EOL> '''<STR_LIT>''' <EOL> if ( input_data [ '<STR_LIT>' ] [ '<STR_LIT>' ] != '<STR_LIT>' ) : <EOL> return { '<STR_LIT:error>' : se... |
<s> doc = """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> from supervisor import childutils <EOL> def usage ( ) : <EOL> print ( doc ) <EOL> sys . exit ( <NUM_LIT:255> ) <EOL> class CrashMail : <EOL> def __init__ ( self , programs , any , email , sendmail , optionalheader ) : <EOL> self . programs = programs <EOL... |
<s> import sys <EOL> sys . path . append ( '<STR_LIT>' ) <EOL> import os <EOL> import sqlite3 <EOL> import json <EOL> import itty <EOL> from pycast . methods . exponentialsmoothing import HoltWintersMethod <EOL> from pycast . optimization import GridSearch <EOL> from pycast . errors import SymmetricMeanAbsolutePercenta... |
<s> import types <EOL> from pycast . errors . baseerrormeasure import BaseErrorMeasure <EOL> from pycast . common . pycastobject import PyCastObject <EOL> class BaseOptimizationMethod ( PyCastObject ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , errorMeasureClass , errorMeasureInitializationParameters = None , p... |
<s> from __future__ import unicode_literals , print_function , division <EOL> __author__ = "<STR_LIT>" <EOL> import ezodf <EOL> NCOLS = <NUM_LIT:10> <EOL> NROWS = <NUM_LIT:10> <EOL> ods = ezodf . newdoc ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> sheet = ezodf . Sheet ( '<STR_LIT>' , size = ( NROWS , NCOLS ) ) <EOL> ods . shee... |
<s> from __future__ import unicode_literals , print_function , division <EOL> __author__ = "<STR_LIT>" <EOL> from . nodestructuretags import TEXT_PRELUDE , TEXT_CONTENT_STREAM , TEXT_CONTENT_PAGED , TEXT_EPILOGUE <EOL> from . nodeorganizer import PreludeTagBlock , EpilogueTagBlock <EOL> class NodeStructureChecker ( obj... |
<s> from __future__ import unicode_literals , print_function , division <EOL> __author__ = "<STR_LIT>" <EOL> import os <EOL> import zipfile <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> from mytesttools import getdatafile <EOL> from ezodf . filemanager import chec... |
<s> from __future__ import unicode_literals , print_function , division <EOL> __author__ = "<STR_LIT>" <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> from mytesttools import in_XML <EOL> from ezodf . xmlns import XML , CN , etree , fake_element <EOL> from ezodf . c... |
<s> import logging <EOL> import logging . config <EOL> import os <EOL> import random <EOL> import socket <EOL> import struct <EOL> import threading <EOL> from coapthon . messages . message import Message <EOL> from coapthon import defines <EOL> from coapthon . messages . response import Response <EOL> from coapthon . u... |
<s> from teradata import pulljson <EOL> import unittest <EOL> import sys <EOL> if sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:2> : <EOL> from StringIO import StringIO <EOL> else : <EOL> from io import StringIO <EOL> class TestJSONPullParser ( unittest . TestCase ) : <EOL> def testNextEvent ( self ) : <EOL> stream = ... |
<s> import os <EOL> import codecs <EOL> from setuptools import setup <EOL> def read ( fname ) : <EOL> file_path = os . path . join ( os . path . dirname ( __file__ ) , fname ) <EOL> return codecs . open ( file_path , encoding = '<STR_LIT:utf-8>' ) . read ( ) <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<ST... |
<s> import os <EOL> import six <EOL> import csv <EOL> from oct . results . models import db , Result , set_database <EOL> def to_csv ( args ) : <EOL> """<STR_LIT>""" <EOL> result_file = args . result_file <EOL> output_file = args . output_file <EOL> delimiter = args . delimiter <EOL> if not os . path . isfile ( result_... |
<s> import numpy as np <EOL> import numpy <EOL> class LinRegLearner ( object ) : <EOL> def __init__ ( self ) : <EOL> super ( LinRegLearner , self ) . __init__ ( ) <EOL> def addEvidence ( self , XTrain , Ytrain ) : <EOL> self . XTrain = XTrain <EOL> self . Ytrain = Ytrain <EOL> final_XTrain = numpy . insert ( XTrain , <... |
<s> import re <EOL> import os <EOL> import gnupg <EOL> import hashlib <EOL> import ConfigParser <EOL> import dropbox <EOL> import gettor . core <EOL> from gettor . utils import get_bundle_info , get_file_sha256 , valid_format <EOL> def upload_files ( basedir , client ) : <EOL> """<STR_LIT>""" <EOL> files = [ ] <EOL> fo... |
<s> from ooni . utils import log <EOL> from ooni . templates import httpt <EOL> from hashlib import sha256 <EOL> class SHA256HTTPBodyTest ( httpt . HTTPTest ) : <EOL> name = "<STR_LIT>" <EOL> author = "<STR_LIT>" <EOL> version = <NUM_LIT:0.1> <EOL> inputFile = [ '<STR_LIT:file>' , '<STR_LIT:f>' , None , <EOL> '<STR_LIT... |
<s> from twisted . trial import unittest <EOL> from twisted . names import dns <EOL> from twisted . names . client import Resolver <EOL> class DNSTest ( unittest . TestCase ) : <EOL> def test_a_lookup_ooni_query ( self ) : <EOL> def done_query ( message , * arg ) : <EOL> answer = message . answers [ <NUM_LIT:0> ] <EOL>... |
<s> import os <EOL> import sys <EOL> import yaml <EOL> import xmlrpclib <EOL> from StringIO import StringIO <EOL> from fabric . operations import get <EOL> from fabric . api import run , cd , sudo , env <EOL> api_auth = { } <EOL> api_auth [ '<STR_LIT>' ] = "<STR_LIT>" <EOL> api_auth [ '<STR_LIT>' ] = "<STR_LIT>" <EOL> ... |
<s> from __future__ import absolute_import , print_function , division <EOL> import numpy <EOL> import theano <EOL> import theano . tensor as tt <EOL> theano . config . floatX = '<STR_LIT>' <EOL> rng = numpy . random <EOL> N = <NUM_LIT> <EOL> feats = <NUM_LIT> <EOL> D = ( rng . randn ( N , feats ) . astype ( theano . c... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function , division <EOL> import copy <EOL> import unittest <EOL> import theano <EOL> import theano . tensor as T <EOL> from theano . compile import Mode , ProfileMode <EOL> class T_bunch_of_modes ( unittest . TestCase ) : <EOL> def test1 ( self )... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function , division <EOL> from copy import copy , deepcopy <EOL> from sys import getsizeof <EOL> import sys <EOL> import traceback <EOL> import numpy <EOL> import theano <EOL> from theano . compat import izip <EOL> from six import reraise <EOL> fr... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function , division <EOL> import six . moves . builtins as builtins <EOL> import logging <EOL> import time <EOL> import warnings <EOL> import numpy <EOL> from six import itervalues <EOL> import theano <EOL> from theano import gof <EOL> from theano... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function , division <EOL> import numpy <EOL> import theano <EOL> try : <EOL> import scipy . sparse <EOL> scipy_imported = True <EOL> except ImportError : <EOL> scipy_imported = False <EOL> from theano . misc . may_share_memory import may_share_mem... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function , division <EOL> __authors__ = "<STR_LIT>" <EOL> __copyright__ = "<STR_LIT>" <EOL> __license__ = "<STR_LIT>" <EOL> __contact__ = "<STR_LIT>" <EOL> import numpy <EOL> import theano . gof <EOL> from theano . compat import PY3 <EOL> from the... |
<s> from __future__ import absolute_import , print_function , division <EOL> from __future__ import print_function <EOL> import sys , time <EOL> from six import iteritems <EOL> from theano . compile . pfunc import pfunc <EOL> from theano import tensor <EOL> import numpy <EOL> from six . moves import xrange <EOL> import... |
<s> from __future__ import absolute_import , print_function , division <EOL> import numpy <EOL> import theano <EOL> from theano import scalar , gof <EOL> from theano . tests . unittest_tools import SkipTest , assert_allclose <EOL> from theano . tensor . tests import test_elemwise <EOL> from . config import mode_with_gp... |
<s> from __future__ import absolute_import , print_function , division <EOL> import itertools as it <EOL> from theano . scalar . basic import Apply , ScalarOp , as_scalar , float64 , float32 , int64 <EOL> from theano . gof . utils import remove <EOL> imported_sympy = False <EOL> try : <EOL> from sympy . utilities . cod... |
<s> from __future__ import absolute_import , print_function , division <EOL> import unittest <EOL> from nose . plugins . skip import SkipTest <EOL> import numpy <EOL> try : <EOL> import scipy . sparse as sp <EOL> except ImportError : <EOL> pass <EOL> import theano <EOL> from theano import config <EOL> from theano impor... |
<s> from __future__ import absolute_import , print_function , division <EOL> import numpy <EOL> import theano <EOL> from theano import Op , Apply <EOL> from theano . tensor import discrete_dtypes <EOL> from theano . gradient import grad_undefined <EOL> class SparseBlockGemv ( Op ) : <EOL> """<STR_LIT>""" <EOL> __props_... |
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function , division <EOL> import logging <EOL> from theano import gof <EOL> from theano . tensor . elemwise import CAReduce <EOL> from theano . tensor import basic as T <EOL> from theano . tensor . basic import ( get_scalar_constant_value , <EOL> ... |
<s> from __future__ import absolute_import , print_function , division <EOL> import numpy <EOL> import unittest <EOL> from theano . tests import unittest_tools as utt <EOL> import theano <EOL> import theano . tensor as tt <EOL> class Test_inc_subtensor ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( s... |
<s> from __future__ import absolute_import , print_function , division <EOL> try : <EOL> from theano . tests . main import main , TheanoNoseTester <EOL> except ImportError : <EOL> pass </s>
|
<s> from __future__ import absolute_import , print_function , division <EOL> from theano import gof <EOL> from theano import compile <EOL> from theano . gof import TopoOptimizer <EOL> from theano . typed_list . basic import Reverse , Append , Extend , Insert , Remove <EOL> @ gof . local_optimizer ( [ Append , Extend , ... |
<s> import sys <EOL> collect_ignore = [ ] <EOL> if sys . version_info [ : <NUM_LIT:2> ] < ( <NUM_LIT:3> , <NUM_LIT:5> ) : <EOL> collect_ignore . append ( "<STR_LIT>" ) <EOL> collect_ignore . append ( "<STR_LIT>" ) </s>
|
<s> from __future__ import print_function , unicode_literals , with_statement , division <EOL> from django import template <EOL> from django . forms import widgets <EOL> from django . template . loader import get_template <EOL> from django . template import Context <EOL> register = template . Library ( ) <EOL> class Fo... |
<s> from settings_base import * <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> } <EOL> } </s>
|
<s> from wagtail . wagtailadmin . edit_handlers import FieldPanel <EOL> from wagtail . wagtailimages . edit_handlers import ImageChooserPanel <EOL> from models import BlogPage , BlogIndexPage <EOL> BlogIndexPage . content_panels = [ <EOL> FieldPanel ( '<STR_LIT:title>' , classname = "<STR_LIT>" ) , <EOL> FieldPanel ( '... |
<s> """<STR_LIT>""" <EOL> import inspect <EOL> import textwrap <EOL> import re <EOL> import pydoc <EOL> from StringIO import StringIO <EOL> from warnings import warn <EOL> <NUM_LIT:4> <EOL> class Reader ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , data ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( d... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> if sys . version_info [ <NUM_LIT:0> ] < <NUM_LIT:3> : <EOL> range = xrange <EOL> from ctypes import c_void_p , cast <EOL> from shapely . geos import lgeos <EOL> from shapely . geometry . base import BaseMultipartGeometry , geos_geom_from_py <EOL> from shapely . geometry import... |
<s> import os <EOL> import doctest <EOL> from . import unittest <EOL> from glob import glob <EOL> optionflags = ( doctest . REPORT_ONLY_FIRST_FAILURE | <EOL> doctest . NORMALIZE_WHITESPACE | <EOL> doctest . ELLIPSIS ) <EOL> def list_doctests ( ) : <EOL> print ( __file__ ) <EOL> source_files = glob ( os . path . join ( ... |
<s> from . import unittest , numpy <EOL> from shapely . geometry import Point , asPoint <EOL> from shapely . geos import DimensionError <EOL> class LineStringTestCase ( unittest . TestCase ) : <EOL> def test_point ( self ) : <EOL> p = Point ( <NUM_LIT:1.0> , <NUM_LIT> ) <EOL> self . assertEqual ( p . x , <NUM_LIT:1.0> ... |
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> import pandas as pd <EOL> from engarde import generic <EOL> from engarde . generic import verify , verify_all , verify_any <EOL> def none_missing ( df , columns = None ) : <EOL> """<STR_LIT>""" <EOL> if columns is None : <EOL> columns = df . columns <EOL> try : <EOL> a... |
<s> from __future__ import unicode_literals <EOL> import pytest <EOL> from tests . helpers import verify_table_html <EOL> from tests . models import Foo <EOL> from tri . table import Column , Table , Struct , order_by_on_list <EOL> def test_sort_list ( ) : <EOL> class TestTable ( Table ) : <EOL> foo = Column ( ) <EOL> ... |
<s> import threading <EOL> class WolkTimerDaemon ( ) : <EOL> def __init__ ( self ) : <EOL> pass <EOL> def start_timers ( self ) : <EOL> start_repo_watcher ( ) <EOL> start_remote_location_service ( ) </s>
|
<s> __author__ = '<STR_LIT>' <EOL> import doctest <EOL> def test__record_history_decorate_class ( ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> test__record_history_decorate_class . __doc__ = test__record_history_decorate_class . __doc__ . replace ( "<STR_LIT:__main__>" , __name__ ) <EOL> def load_tests ( loader , tests ,... |
<s> from authy import AuthyApiException <EOL> from flask import flash , jsonify , redirect , render_template , request , session , url_for <EOL> from . import auth <EOL> from . forms import LoginForm , SignUpForm , VerifyForm <EOL> from . . import db <EOL> from . . decorators import login_required , verify_authy_reques... |
<s> '''<STR_LIT>''' <EOL> from docpie import docpie <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> print ( docpie ( __doc__ ) ) </s>
|
<s> import os <EOL> import orca <EOL> from activitysim import activitysim as asim <EOL> from . util . misc import add_dependent_columns <EOL> @ orca . injectable ( ) <EOL> def auto_ownership_spec ( configs_dir ) : <EOL> f = os . path . join ( configs_dir , '<STR_LIT>' , "<STR_LIT>" ) <EOL> return asim . read_model_spec... |
<s> import orca <EOL> import pandas as pd <EOL> from activitysim . util . reindex import reindex <EOL> @ orca . table ( ) <EOL> def tours ( non_mandatory_tours , mandatory_tours , tdd_alts ) : <EOL> tours = pd . concat ( [ non_mandatory_tours . to_frame ( ) , <EOL> mandatory_tours . to_frame ( ) ] , <EOL> ignore_index ... |
<s> """<STR_LIT>""" <EOL> from collections import namedtuple <EOL> import pandas as pd <EOL> from zbox import toolz as tz <EOL> Transaction = namedtuple ( '<STR_LIT>' , ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> COLS = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> def _column_names_from_metadata ( dicts ) : <EOL> """<ST... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.