code stringlengths 9 256k |
|---|
<s> from graph import graph <EOL> from copy import deepcopy <EOL> class digraph ( graph ) : <EOL> """<STR_LIT>""" <EOL> DEFAULT_WEIGHT = <NUM_LIT:1> <EOL> DIRECTED = True <EOL> def __init__ ( self ) : <EOL> self . node_neighbors = { } <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . nodes ( ) , self . e... |
<s> import os , sys <EOL> sys . path . append ( os . path . join ( os . getcwd ( ) , os . path . pardir ) ) <EOL> import unittest <EOL> from heaps . minheap import minheap <EOL> from heaps . maxheap import maxheap <EOL> import random <EOL> class test_heap ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self ... |
<s> import logging <EOL> import abc <EOL> import six <EOL> from vk_requests . exceptions import VkAuthError , VkAPIError , VkParseError <EOL> from vk_requests . utils import parse_url_query_params , VerboseHTTPSession , parse_form_action_url , json_iter_parse , stringify_values , parse_masked_phone_number , check_html_... |
<s> from __future__ import print_function <EOL> import argparse <EOL> import re <EOL> import sys <EOL> from os . path import basename <EOL> def validate_files ( argv = None ) : <EOL> parser = argparse . ArgumentParser ( ) <EOL> parser . add_argument ( '<STR_LIT>' , nargs = '<STR_LIT:*>' ) <EOL> parser . add_argument ( ... |
<s> from __future__ import absolute_import <EOL> from pre_commit . main import main <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> exit ( main ( ) ) </s>
|
<s> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> try : <EOL> from collections import OrderedDict <EOL> except ImportError : <EOL> from ordereddict import OrderedDict </s>
|
<s> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> import io <EOL> import logging <EOL> import os <EOL> import os . path <EOL> import mock <EOL> import pytest <EOL> from pre_commit import five <EOL> from pre_commit . prefixed_command_runner import PrefixedCommandRunner <EOL> ... |
<s> """<STR_LIT>""" <EOL> import six <EOL> from six . moves import builtins <EOL> from six . moves import reduce <EOL> def import_object ( import_name ) : <EOL> module_name , expr = import_name . split ( '<STR_LIT::>' , <NUM_LIT:1> ) <EOL> mod = __import__ ( module_name ) <EOL> mod = reduce ( getattr , module_name . sp... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> from fabric . api import env <EOL> __version__ = '<STR_LIT>' <EOL> main_dir = os . path . dirname ( os . path . abspath ( os . path . dirname ( __file__ ) ) ) <EOL> import fabric_patches <EOL> import mode <EOL> from prestoadmin . mode import get_mode , for_mode... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> from optparse import OptionParser <EOL> import sys <EOL> _LOGGER = logging . getLogger ( __name__ ) <EOL> class LoggingOptionParser ( OptionParser ) : <EOL> """<STR_LIT>""" <EOL> def exit ( self , status = <NUM_LIT:0> , msg = None ) : <EOL> _LOGGER . debug ( "<STR_LIT>" ) ... |
<s> """<STR_LIT>""" <EOL> import os <EOL> from nose . plugins . attrib import attr <EOL> from prestoadmin . standalone . config import PRESTO_STANDALONE_USER <EOL> from prestoadmin . util import constants <EOL> from tests . no_hadoop_bare_image_provider import NoHadoopBareImageProvider <EOL> from tests . product . base... |
<s> """<STR_LIT>""" <EOL> import fabric . api <EOL> from fabric . operations import _AttributeString <EOL> from mock import patch <EOL> from prestoadmin import connector <EOL> from prestoadmin . util import constants <EOL> from prestoadmin . util . exception import ConfigurationError , ConfigFileNotFoundError <EOL> fro... |
<s> import sqlalchemy as db <EOL> from sqlalchemy import func <EOL> from sqlalchemy . ext . declarative import declarative_base <EOL> from sqlalchemy . orm import relationship <EOL> import sqlalchemy . dialects . postgresql as psql_db <EOL> connection_string = '<STR_LIT>' <EOL> Base = declarative_base ( ) <EOL> class B... |
<s> IO_EVENTS = [ ] <EOL> def MONGODB_PRE_HOOK ( event ) : <EOL> event [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> IO_EVENTS . append ( event ) <EOL> def MONGODB_POST_HOOK ( event ) : <EOL> event [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> IO_EVENTS . append ( event ) <EOL> def REDIS_PRE_HOOK ( event ) : <EOL> event [ "<STR_LIT>" ] = ... |
<s> from mrq . job import Job <EOL> from mrq . queue import Queue <EOL> import time <EOL> import pytest <EOL> OPTS = [ ] <EOL> for p_query in [ <EOL> ( { "<STR_LIT:path>" : "<STR_LIT>" } , <NUM_LIT:3> ) , <EOL> ( { "<STR_LIT>" : "<STR_LIT>" } , <NUM_LIT:2> ) , <EOL> ( { "<STR_LIT>" : "<STR_LIT>" } , <NUM_LIT:1> ) <EOL>... |
<s> import sys <EOL> import socket <EOL> import string <EOL> import os <EOL> import traceback <EOL> try : <EOL> import irc . bot <EOL> except ImportError : <EOL> raise ImportError ( "<STR_LIT>" ) <EOL> from giotto . controllers import GiottoController <EOL> from giotto . exceptions import ProgramNotFound <EOL> from gio... |
<s> from __future__ import print_function <EOL> import datetime <EOL> import requests <EOL> import arrow <EOL> import pytz <EOL> from . core import Service , NoData <EOL> from . crypto_data import crypto_data <EOL> quandl_exchange_btc_to_fiat = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL>... |
<s> from distutils . core import setup <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> scripts = [ '<STR_LIT>' ] , <EOL> packages = [ '<STR_LIT>' ] , <EOL> package_data = { '<STR_LIT>' : [ '<STR_LIT>' ] } , <EOL> classifiers = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LI... |
<s> from weakprng import * </s>
|
<s> """<STR_LIT>""" <EOL> import apsw <EOL> import itertools <EOL> import json <EOL> import math <EOL> import struct <EOL> import time <EOL> import bayeslite . core as core <EOL> import bayeslite . guess as guess <EOL> import bayeslite . metamodel as metamodel <EOL> import bayeslite . weakprng as weakprng <EOL> import ... |
<s> import math <EOL> import pytest <EOL> from bayeslite . math_util import * <EOL> def pi_cf ( ) : <EOL> """<STR_LIT>""" <EOL> def contfrac ( ) : <EOL> i = <NUM_LIT:0> <EOL> while True : <EOL> i += <NUM_LIT:1> <EOL> yield i * i , <NUM_LIT:2> * i + <NUM_LIT:1> <EOL> return <NUM_LIT:4> / ( <NUM_LIT:1> + limit ( converge... |
<s> import random <EOL> import argparse <EOL> import sys <EOL> from collections import Counter <EOL> import numpy <EOL> import pylab <EOL> import crosscat . tests . enumerate_utils as eu <EOL> import crosscat . tests . plot_utils as pu <EOL> import crosscat . utils . sample_utils as su <EOL> import crosscat . utils . d... |
<s> import crosscat . tests . synthetic_data_generator as sdg <EOL> import crosscat . cython_code . State as State <EOL> import crosscat . utils . data_utils as du <EOL> import unittest <EOL> import random <EOL> import numpy <EOL> def main ( ) : <EOL> unittest . main ( ) <EOL> class TestPredictiveColumns ( unittest . T... |
<s> import sys , os , shutil <EOL> import pexpect <EOL> sys . path . append ( os . path . dirname ( os . path . dirname ( __file__ ) ) ) <EOL> from AppImageKit import AppDir <EOL> from AppImageKit import timesavers <EOL> class Profiler ( object ) : <EOL> def __init__ ( self ) : <EOL> f = open ( os . path . dirname ( __... |
<s> import sys <EOL> import os <EOL> import shlex <EOL> extensions = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> templates_path = [ '<STR_LIT>' ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EOL> project = '<STR_LIT>' <EO... |
<s> from django . http import Http404 , HttpResponse <EOL> from django . shortcuts import render_to_response , get_object_or_404 <EOL> from django . template import RequestContext <EOL> from django . contrib . auth . decorators import login_required <EOL> from django . db . models import Q <EOL> from models import * <E... |
<s> """<STR_LIT>""" <EOL> import copy <EOL> import logging <EOL> import os <EOL> from pyparsing import alphanums <EOL> from pyparsing import alphas <EOL> from pyparsing import Combine <EOL> from pyparsing import Forward <EOL> from pyparsing import Literal <EOL> from pyparsing import nums <EOL> from pyparsing import Opt... |
<s> import os <EOL> import sys <EOL> from barf . barf import BARF <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> try : <EOL> filename = os . path . abspath ( "<STR_LIT>" ) <EOL> barf = BARF ( filename ) <EOL> except Exception as err : <EOL> print err <EOL> print "<STR_LIT>" % filename <EOL> sys . exit ( <NUM_LIT:1> ... |
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ] <EOL> operations = [ <EOL> migrations . CreateModel ( <EOL> name = '<STR_LIT>' , <EOL> fields = [ <EOL> ( '<STR_LIT:id>' , models . AutoField ( ... |
<s> """<STR_LIT>""" <EOL> import collections <EOL> import os . path <EOL> import re <EOL> import runpy <EOL> import util <EOL> class Config ( util . GlobalContext ) : <EOL> """<STR_LIT>""" <EOL> _settings = { } <EOL> _descriptors = [ ] <EOL> _forced_settings = set ( ) <EOL> _last_file = None <EOL> def _normalize_path (... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> import codecs <EOL> import ellySession <EOL> import ellyConfiguration <EOL> import ellyDefinition <EOL> import ellyPickle <EOL> import ellyToken <EOL> import ellyChar <EOL> import ellyException <EOL> import substitutionBuffer <EOL> import parseTree <EOL> import parseTreeWithDi... |
<s> """<STR_LIT>""" <EOL> import sys <EOL> import conceptualWeighting <EOL> deletion = '<STR_LIT>' <EOL> class InterpretiveContext ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , syms , procs , glbls , hiery ) : <EOL> """<STR_LIT>""" <EOL> self . syms = syms <EOL> self . procs = procs <EOL> self . glbls ... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import ellyChar <EOL> import ellyException <EOL> import vocabularyElement <EOL> import syntaxSpecification <EOL> import featureSpecification <EOL> import conceptualHierarchy <EOL> import sqlite3 as dbs <EOL> import unicodedata <EOL> SSpec = syntaxSpecification ... |
<s> GEOMETRY_TYPES = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ) <EOL> class Types : <EOL> def Feature ( self , feature ) : <EOL> if '<STR_LIT>' in feature : <EOL> self . geometry ( feature [ '<STR_LIT>' ] ) <EOL> de... |
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> from collections import namedtuple <EOL> import json <EOL> import os <EOL> import random <EOL> from string import ascii_letters <EOL> import subprocess <EOL> from tempfile import NamedTemporaryFile <EOL> import time <EOL> import koji <EOL> from ato... |
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> from atomic_reactor . plugin import PreBuildPlugin <EOL> class PullBaseImagePlugin ( PreBuildPlugin ) : <EOL> key = "<STR_LIT>" <EOL> is_allowed_to_fail = False <EOL> def __init__ ( self , tasker , workflow , parent_registry = None , parent_registr... |
<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> import json <EOL> import os <EOL> try : <EOL> import koji <EOL> except ImportError : <EOL> import inspect <EOL> import sys <EOL> import tests . koji as koji <EOL> mock_koji_path = os . path . dirname ( inspect . getfile ( koji . ClientSession ) ) <... |
<s> """<STR_LIT>""" <EOL> from __future__ import print_function , absolute_import , unicode_literals <EOL> import json <EOL> import logging <EOL> from osbs . utils import graceful_chain_get , get_time_from_rfc3339 <EOL> from osbs . constants import BUILD_FINISHED_STATES , BUILD_RUNNING_STATES , BUILD_SUCCEEDED_STATES ,... |
<s> """<STR_LIT>""" <EOL> from collections import namedtuple <EOL> from contextlib import contextmanager <EOL> import os <EOL> from osbs . conf import Configuration <EOL> import pytest <EOL> from tempfile import NamedTemporaryFile <EOL> class TestConfiguration ( object ) : <EOL> def tmpfile_with_content ( self , value ... |
<s> from WolfSheep import Wolf , Sheep , GrassPatch , WolfSheepPredation <EOL> from mesa . visualization . ModularVisualization import ModularServer <EOL> from mesa . visualization . modules import CanvasGrid , ChartModule <EOL> def wolf_sheep_portrayal ( agent ) : <EOL> if agent is None : <EOL> return <EOL> portrayal ... |
<s> EMAIL_IN_USE = ( { '<STR_LIT:message>' : '<STR_LIT>' } , <NUM_LIT> ) <EOL> UNAUTHORIZED = ( { '<STR_LIT:message>' : '<STR_LIT>' } , <NUM_LIT> ) <EOL> BAD_CREDENTIALS = ( { '<STR_LIT:message>' : '<STR_LIT>' } , <NUM_LIT> ) <EOL> FORBIDDEN = ( { '<STR_LIT:message>' : '<STR_LIT>' } , <NUM_LIT> ) <EOL> CODE_NOT_VALID =... |
<s> from __future__ import unicode_literals <EOL> import os <EOL> import socket <EOL> import time <EOL> import threading <EOL> from contextlib import closing <EOL> from wsgiref . simple_server import make_server <EOL> from . import core <EOL> try : <EOL> from BaseHTTPServer import BaseHTTPRequestHandler <EOL> from Base... |
<s> import sys <EOL> import psd_tools . cli <EOL> sys . exit ( psd_tools . cli . main ( ) ) </s>
|
<s> from __future__ import absolute_import , unicode_literals , division <EOL> import warnings <EOL> from psd_tools . utils import be_array_from_bytes <EOL> from psd_tools . constants import Compression , ChannelID , ColorMode , ImageResourceID <EOL> from psd_tools import icc_profiles <EOL> try : <EOL> from PIL import ... |
<s> '''<STR_LIT>''' <EOL> import os <EOL> import codecs <EOL> import getopt <EOL> import sys <EOL> import json <EOL> from treemodel import traverse , Visitor , FOLDER , CONTEXT , PROJECT , TASK <EOL> from omnifocus import build_model , find_database <EOL> from datetime import date , datetime <EOL> from plugin_json impo... |
<s> import io <EOL> class COW : <EOL> def basepages ( self , offset , length ) : <EOL> basepages = [ ] <EOL> basepages . append ( ( offset - ( offset % <NUM_LIT> ) , offset % <NUM_LIT> , <NUM_LIT> - ( offset % <NUM_LIT> ) ) ) <EOL> length -= <NUM_LIT> - ( offset % <NUM_LIT> ) <EOL> offset += <NUM_LIT> <EOL> while lengt... |
<s> import numpy as N <EOL> from traits . api import HasTraits , Bool , Instance <EOL> from CameraImage import CameraImage <EOL> class DisplayPlugin ( HasTraits ) : <EOL> active = Bool ( False ) <EOL> screen = Instance ( CameraImage ) <EOL> def process_frame ( self , frame ) : <EOL> if not self . active : <EOL> return ... |
<s> class Suite ( ) : <EOL> def __init__ ( self , pubnub , expected ) : <EOL> self . pubnub = pubnub <EOL> self . total = expected <EOL> self . passed = <NUM_LIT:0> <EOL> self . failed = <NUM_LIT:0> <EOL> self . started = False <EOL> def test ( self , condition , name , message = None , response = None ) : <EOL> if con... |
<s> import time <EOL> from pubnub import PubnubTwisted as Pubnub <EOL> subkey = "<STR_LIT>" <EOL> pubkey = "<STR_LIT>" <EOL> secretkey = "<STR_LIT>" <EOL> pubnub = Pubnub ( pubkey , subkey ) <EOL> pubnub_pam = Pubnub ( pubkey , subkey , secretkey ) <EOL> def test_1 ( ) : <EOL> def _callback ( resp , ch = None ) : <EOL>... |
<s> import RPi . GPIO as GPIO <EOL> import time <EOL> GPIO . setmode ( GPIO . BCM ) <EOL> LIGHT = <NUM_LIT:4> <EOL> GPIO . setup ( LIGHT , GPIO . OUT ) <EOL> try : <EOL> while True : <EOL> GPIO . output ( LIGHT , True ) <EOL> time . sleep ( <NUM_LIT:0.5> ) <EOL> GPIO . output ( LIGHT , False ) <EOL> time . sleep ( <NUM... |
<s> import logging <EOL> from tempfile import NamedTemporaryFile <EOL> from aleph import process <EOL> from aleph . core import db <EOL> from aleph . model import Metadata , Source , Document <EOL> from aleph . ext import get_crawlers <EOL> from aleph . ingest import ingest_url , ingest_file <EOL> from aleph . analyze ... |
<s> """<STR_LIT>""" <EOL> from alembic import op <EOL> import sqlalchemy as sa <EOL> from sqlalchemy . dialects import postgresql <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> def upgrade ( ) : <EOL> op . drop_constraint ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> op . drop_constraint ( '<STR_LIT>' , '<S... |
<s> import logging <EOL> from flask_mail import Message <EOL> from aleph . core import get_config , mail <EOL> log = logging . getLogger ( __name__ ) <EOL> def notify_role ( role , subject , html ) : <EOL> if role . email is None : <EOL> log . error ( "<STR_LIT>" , role ) <EOL> return <EOL> sender = '<STR_LIT>' % ( get... |
<s> from flask import Blueprint , request <EOL> from apikit import obj_or_404 , request_data , jsonify <EOL> from aleph import authz <EOL> from aleph . core import db <EOL> from aleph . model import Alert <EOL> from aleph . views . cache import enable_cache <EOL> blueprint = Blueprint ( '<STR_LIT>' , __name__ ) <EOL> @... |
<s> from setuptools import setup , find_packages <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = "<STR_LIT>" , <EOL> long_description = "<STR_LIT>" , <EOL> classifiers = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] , <EOL> keywords ... |
<s> import sys , os <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( '<STR_LIT>' ) ) <EOL> extensions = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> templates_path = [ '<STR_LIT>' ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EOL> project = u'<STR_LIT>' <EOL> copyright = u'<STR_LIT>' <... |
<s> import json <EOL> import logging <EOL> from datetime import datetime <EOL> from dateutil . parser import parse as dateutil_parse <EOL> from pepparser . util import make_id <EOL> from pepparser . text import combine_name <EOL> from pepparser . country import normalize_country <EOL> log = logging . getLogger ( __name... |
<s> import re <EOL> def collapse_whitespace ( text ) : <EOL> """<STR_LIT>""" <EOL> if text is None : <EOL> return None <EOL> if hasattr ( text , '<STR_LIT>' ) : <EOL> text = text . xpath ( '<STR_LIT>' ) <EOL> text = re . sub ( '<STR_LIT>' , '<STR_LIT:U+0020>' , text ) <EOL> return text . strip ( ) </s>
|
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function <EOL> from os . path import abspath , exists <EOL> from . . _types import ( <EOL> BuiltinFunction , BuiltinMethod , MethodDescriptor , Module , Type <EOL> ) <EOL> from . serialize import get_index_path , read_index <EOL> class Reader ( ob... |
<s> from __future__ import ( print_function , unicode_literals , absolute_import , <EOL> division ) <EOL> from pusher . errors import * <EOL> from pusher . signature import sign <EOL> import copy <EOL> import hashlib <EOL> import json <EOL> import six <EOL> import time <EOL> GET , POST , PUT , DELETE = "<STR_LIT:GET>" ... |
<s> """<STR_LIT>""" <EOL> import errno <EOL> import os <EOL> import re <EOL> import subprocess <EOL> import sys <EOL> def get_keywords ( ) : <EOL> """<STR_LIT>""" <EOL> git_refnames = "<STR_LIT>" <EOL> git_full = "<STR_LIT>" <EOL> keywords = { "<STR_LIT>" : git_refnames , "<STR_LIT>" : git_full } <EOL> return keywords ... |
<s> my_name = '<STR_LIT>' <EOL> my_age = <NUM_LIT> <EOL> my_height = <NUM_LIT> <EOL> my_weight = <NUM_LIT> <EOL> my_eyes = '<STR_LIT>' <EOL> my_teeth = '<STR_LIT>' <EOL> my_hair = '<STR_LIT>' <EOL> print "<STR_LIT>" % my_name <EOL> print "<STR_LIT>" % my_height <EOL> print "<STR_LIT>" % my_weight <EOL> print "<STR_LIT>... |
<s> the_count = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> ] <EOL> fruits = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> change = [ <NUM_LIT:1> , '<STR_LIT>' , <NUM_LIT:2> , '<STR_LIT>' , <NUM_LIT:3> , '<STR_LIT>' ] <EOL> for number in the_count : <EOL> print "<STR_LIT>" % ... |
<s> import web <EOL> urls = ( <EOL> '<STR_LIT>' , '<STR_LIT>' <EOL> ) <EOL> app = web . application ( urls , globals ( ) ) <EOL> render = web . template . render ( '<STR_LIT>' , base = "<STR_LIT>" ) <EOL> class Index : <EOL> def GET ( self ) : <EOL> return render . hello_form ( ) <EOL> def POST ( self ) : <EOL> form = ... |
<s> from __future__ import print_function <EOL> from bottle import route , run , debug , template , request , redirect , static_file <EOL> from pwman . util . crypto_engine import CryptoEngine <EOL> import pwman . data . factory <EOL> from pwman . data . nodes import Node <EOL> from pwman import parser_options , get_co... |
<s> import enum <EOL> class HTTPMethod ( enum . IntEnum ) : <EOL> ALL = <NUM_LIT> <EOL> GET = <NUM_LIT> <EOL> POST = <NUM_LIT> <EOL> DELETE = <NUM_LIT> <EOL> PUT = <NUM_LIT> <EOL> HEAD = <NUM_LIT> <EOL> string_to_method = { <EOL> "<STR_LIT:GET>" : HTTPMethod . GET , <EOL> "<STR_LIT:POST>" : HTTPMethod . POST , <EOL> "<... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> logging . basicConfig ( level = logging . DEBUG ) <EOL> import sys <EOL> from pyqode . qt import QtWidgets <EOL> from pyqode . core . api import CodeEdit <EOL> from pyqode . core . modes import CheckerMode , CheckerMessages <EOL> import server <EOL> def check ( request ) :... |
<s> """<STR_LIT>""" <EOL> import logging <EOL> logging . basicConfig ( level = logging . DEBUG ) <EOL> import sys <EOL> from pyqode . core import api <EOL> from pyqode . core import modes <EOL> from pyqode . core import panels <EOL> from pyqode . qt import QtWidgets <EOL> def main ( ) : <EOL> app = QtWidgets . QApplica... |
<s> """<STR_LIT>""" <EOL> import locale <EOL> import json <EOL> import logging <EOL> import socket <EOL> import struct <EOL> import sys <EOL> import uuid <EOL> from weakref import ref <EOL> from pyqode . qt import QtCore , QtNetwork <EOL> def _logger ( ) : <EOL> return logging . getLogger ( __name__ ) <EOL> COMM = <NUM... |
<s> """<STR_LIT>""" <EOL> from pyqode . qt import QtCore , QtGui <EOL> from pyqode . core . api import Mode <EOL> class SmartBackSpaceMode ( Mode ) : <EOL> """<STR_LIT>""" <EOL> def on_state_changed ( self , state ) : <EOL> if state : <EOL> self . editor . key_pressed . connect ( self . _on_key_pressed ) <EOL> else : <... |
<s> """<STR_LIT>""" <EOL> from pygments . style import Style <EOL> from pygments . token import Comment , Error , Generic , Keyword , Literal , Name , Operator , Text , Punctuation <EOL> class DarculaStyle ( Style ) : <EOL> """<STR_LIT>""" <EOL> background_color = '<STR_LIT>' <EOL> highlight_color = '<STR_LIT>' <EOL> s... |
<s> """<STR_LIT>""" <EOL> import mimetypes <EOL> import os <EOL> import platform <EOL> import pytest <EOL> from pyqode . core . api import CodeEdit <EOL> from pyqode . core . api . panel import Panel <EOL> from pyqode . core . api . utils import TextHelper <EOL> from pyqode . core import panels , modes <EOL> from pyqod... |
<s> import os <EOL> from pyqode . qt import QtCore <EOL> from pyqode . qt import QtGui <EOL> from pyqode . qt . QtTest import QTest <EOL> from pyqode . core import modes <EOL> def test_enabled ( editor ) : <EOL> mode = editor . modes . get ( modes . ZoomMode ) <EOL> assert mode . enabled <EOL> mode . enabled = False <E... |
<s> from . . utils import TranspileTestCase , BuiltinFunctionTestCase <EOL> class ChrTests ( TranspileTestCase ) : <EOL> pass <EOL> class BuiltinChrFunctionTests ( BuiltinFunctionTestCase , TranspileTestCase ) : <EOL> functions = [ "<STR_LIT>" ] <EOL> not_implemented = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<... |
<s> from . . utils import TranspileTestCase , BuiltinFunctionTestCase <EOL> class IterTests ( TranspileTestCase ) : <EOL> pass <EOL> class BuiltinIterFunctionTests ( BuiltinFunctionTestCase , TranspileTestCase ) : <EOL> functions = [ "<STR_LIT>" ] <EOL> not_implemented = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ... |
<s> from . . utils import TranspileTestCase , BuiltinFunctionTestCase <EOL> class TupleTests ( TranspileTestCase ) : <EOL> pass <EOL> class BuiltinTupleFunctionTests ( BuiltinFunctionTestCase , TranspileTestCase ) : <EOL> functions = [ "<STR_LIT>" ] <EOL> not_implemented = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL... |
<s> from . . utils import TranspileTestCase <EOL> import unittest <EOL> class InterfaceTests ( TranspileTestCase ) : <EOL> @ unittest . expectedFailure <EOL> def test_implement_interface ( self ) : <EOL> "<STR_LIT>" <EOL> self . assertJavaScriptExecution ( <EOL> """<STR_LIT>""" , <EOL> """<STR_LIT>""" , run_in_function... |
<s> from __future__ import print_function , unicode_literals <EOL> try : <EOL> from ttk import Treeview <EOL> except ImportError : <EOL> from tkinter . ttk import Treeview <EOL> from tkreadonly import ReadOnlyCode <EOL> from pygments . lexers import PythonLexer <EOL> from bugjar . connection import ConnectionNotBootstr... |
<s> import os . path <EOL> from ttk import * <EOL> from tkreadonly import ReadOnlyCode <EOL> def nodify ( node ) : <EOL> "<STR_LIT>" <EOL> return node . replace ( '<STR_LIT:\\>' , '<STR_LIT:/>' ) <EOL> class CodeView ( ReadOnlyCode ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> ReadOnlyCode . __init__ ( s... |
<s> from . . utils import TranspileTestCase , BuiltinFunctionTestCase <EOL> class HexTests ( TranspileTestCase ) : <EOL> pass <EOL> class BuiltinHexFunctionTests ( BuiltinFunctionTestCase , TranspileTestCase ) : <EOL> functions = [ "<STR_LIT>" ] <EOL> not_implemented = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<... |
<s> from unittest import expectedFailure <EOL> from . . utils import TranspileTestCase <EOL> class SysModuleTests ( TranspileTestCase ) : <EOL> @ expectedFailure <EOL> def test___displayhook__ ( self ) : <EOL> self . assertCodeExecution ( """<STR_LIT>""" ) <EOL> @ expectedFailure <EOL> def test___doc__ ( self ) : <EOL>... |
<s> from collections import namedtuple <EOL> import re <EOL> MethodDescriptor = namedtuple ( '<STR_LIT>' , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> FIELD_DESCRIPTOR_RE = re . compile ( "<STR_LIT>" ) <EOL> def method_descriptor ( descriptor ) : <EOL> matches = FIELD_DESCRIPTOR_RE . findall ( descriptor ) <EOL> return Metho... |
<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> __email__ = "<STR_LIT>" <EOL> __version__ = "<STR_LIT>" <EOL> __url__ = "<STR_LIT>" <EOL> __description__ = "<STR_LIT>" <EOL> __category__ = "<STR_LIT>" <EOL> __license__ = "<STR_LIT>" <EOL> __registrytags__ = "<STR_LIT>" <EOL> from Pyblosxom import tools <EOL> d... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> from Pyblosxom import tools <EOL> from Pyblosxom . renderers . base import RendererBase <EOL> class NoSuchFlavourException ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def get_included_flavour ( taste ) : <EOL> """<STR_LIT>""" <EOL> path = __file__ [ ... |
<s> """<STR_LIT>""" <EOL> import os <EOL> import ast <EOL> import sys <EOL> SKIP = ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> HELP = """<STR_LIT>""" <EOL> TEMPLATE = """<STR_LIT>""" <EOL> def get_info ( node , info_name ) : <EOL> for mem in ast . walk ( node ) : <EOL> if not isinstance ( mem , ast . Assign ) : <EOL> continue ... |
<s> from __future__ import print_function <EOL> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> from scipy import asarray <EOL> from numpy import sin , cos , tan , sqrt , arcsin , arctan , sign , clip , argwhere <EOL> from matplotlib import pyplot as plt <EOL> import pybrain . rl . environments <EOL> from pybrain ... |
<s> from __future__ import print_function <EOL> from pybrain . structure import FeedForwardNetwork <EOL> from pybrain . tools . validation import ModuleValidator , Validator <EOL> from pybrain . utilities import percentError <EOL> from pybrain . tools . customxml import NetworkReader <EOL> from pybrain . datasets impor... |
<s> from __future__ import print_function <EOL> __author__ = '<STR_LIT>' <EOL> from pybrain . optimization . distributionbased . distributionbased import DistributionBasedOptimizer <EOL> from scipy import dot , exp , log , sqrt , floor , ones , randn <EOL> from pybrain . tools . rankingfunctions import HansenRanking <E... |
<s> from pybrain . rl . agents . learning import LearningAgent <EOL> from pybrain . rl . agents . optimization import OptimizationAgent </s>
|
<s> __author__ = '<STR_LIT>' <EOL> from pybrain . rl . environments import EpisodicTask <EOL> from scipy import array , r_ , clip <EOL> from . import sensors <EOL> class NoRewardTask ( EpisodicTask ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , env ) : <EOL> EpisodicTask . __init__ ( self , env ) <EOL> self . st... |
<s> from __future__ import print_function <EOL> __author__ = '<STR_LIT>' <EOL> import sys , time <EOL> from scipy import random , asarray <EOL> import xode . parser , xode . body , xode . geom <EOL> import ode <EOL> from pybrain . rl . environments . environment import Environment <EOL> from . tools . configgrab import... |
<s> __author__ = '<STR_LIT>' <EOL> from pybrain . rl . environments import EpisodicTask <EOL> from . simpleracetcp import SimpleraceEnvironment <EOL> class SimpleraceTask ( EpisodicTask ) : <EOL> def getTotalReward ( self ) : <EOL> return self . environment . firstCarScore <EOL> def getReward ( self ) : <EOL> return <N... |
<s> __author__ = '<STR_LIT>' <EOL> from pybrain . rl . experiments . experiment import Experiment <EOL> from pybrain . rl . agents . optimization import OptimizationAgent <EOL> class EpisodicExperiment ( Experiment ) : <EOL> """<STR_LIT>""" <EOL> doOptimization = False <EOL> def __init__ ( self , task , agent ) : <EOL>... |
<s> from pybrain . rl . learners . valuebased . interface import ActionValueTable , ActionValueNetwork <EOL> from pybrain . rl . learners . valuebased . nfq import NFQ <EOL> from pybrain . rl . learners . valuebased . q import Q <EOL> from pybrain . rl . learners . valuebased . qlambda import QLambda <EOL> from pybrain... |
<s> __author__ = '<STR_LIT>' <EOL> from scipy import random <EOL> from pybrain . structure . modules . neuronlayer import NeuronLayer <EOL> from pybrain . tools . functions import expln , explnPrime <EOL> from pybrain . structure . parametercontainer import ParameterContainer <EOL> class GaussianLayer ( NeuronLayer , P... |
<s> __author__ = '<STR_LIT>' <EOL> from pybrain . structure . networks . swiping import SwipingNetwork <EOL> from pybrain import MDLSTMLayer , IdentityConnection <EOL> from pybrain import ModuleMesh , LinearLayer , TanhLayer , SigmoidLayer <EOL> from scipy import product <EOL> class MultiDimensionalRNN ( SwipingNetwork... |
<s> from __future__ import print_function <EOL> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> from inspect import isclass <EOL> from scipy import sum , array , ndarray , log10 <EOL> from random import random , choice <EOL> import pybrain . optimization . optimizer as bbo <EOL> import pybrain . optimization . pop... |
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> from pybrain . tests import runModuleTestSuite <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> runModuleTestSuite ( __import__ ( '<STR_LIT:__main__>' ) ) </s>
|
<s> __author__ = '<STR_LIT>' <EOL> from pybrain . utilities import blockCombine <EOL> from scipy import mat , dot , outer <EOL> from scipy . linalg import inv , cholesky <EOL> def calcFisherInformation ( sigma , invSigma = None , factorSigma = None ) : <EOL> """<STR_LIT>""" <EOL> if invSigma == None : <EOL> invSigma = ... |
<s> import sys <EOL> import os <EOL> import shlex <EOL> import alabaster <EOL> extensions = [ ] <EOL> templates_path = [ '<STR_LIT>' ] <EOL> source_suffix = '<STR_LIT>' <EOL> master_doc = '<STR_LIT:index>' <EOL> project = u'<STR_LIT>' <EOL> copyright = u'<STR_LIT>' <EOL> author = u'<STR_LIT>' <EOL> version = '<STR_LIT>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.