content string |
|---|
import pynes
from pynes.game import Game
from pynes.bitbag import *
from pynes.nes_types import *
game = Game()
palette = game.assign('palette',
NesArray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,15,
0x0F, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61,
... |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from glob import glob
import os
from atomic_reactor.buildimage import BuildImageBuilder
from atomic... |
import sys
import boto
from boto.utils import find_class
from boto import config
from boto.pyami.scriptbase import ScriptBase
class Startup(ScriptBase):
def run_scripts(self):
scripts = config.get('Pyami', 'scripts')
if scripts:
for script in scripts.split(','):
script... |
"""
Integration with systemd.
Currently only the minimum APIs necessary for using systemd's socket activation
feature are supported.
"""
__all__ = ['ListenFDs']
from os import getpid
class ListenFDs(object):
"""
L{ListenFDs} provides access to file descriptors inherited from systemd.
Typically L{Liste... |
VERSION = (0, 15, 0)
# LIST OF POSSIBLE ITEMS
ITEM_UNKNOWN = 0
ITEM_IMAGE = 1
ITEM_STYLE = 2
ITEM_SCRIPT = 3
ITEM_NAVIGATION = 4
ITEM_VECTOR = 5
ITEM_FONT = 6
ITEM_VIDEO = 7
ITEM_AUDIO = 8
ITEM_DOCUMENT = 9
# EXTENSION MAPPER
EXTENSIONS = {ITEM_IMAGE: ['.jpg', '.jpeg', '.gif', '.tiff', '.tif', '.png'],
... |
"""
Tests useful in assertion checking, prints out nicely formated messages too.
"""
from humanreadable import hr
def _assert(___cond=False, *___args, **___kwargs):
if ___cond:
return True
msgbuf=[]
if ___args:
msgbuf.append("%s %s" % tuple(map(hr, (___args[0], type(___args[0]),))))
... |
"""Generate a CL to roll a DEPS entry to the specified revision number and post
it to Rietveld so that the CL will land automatically if it passes the
commit-queue's checks.
"""
import logging
import optparse
import os
import re
import sys
import find_depot_tools
import scm
import subprocess2
def die_with_error(msg... |
"""
.. module:: experiment_collection
:platform: Unix
:synopsis: Contains the Experiment class and all possible experiment
collections from which Experiment can inherit at run time.
.. moduleauthor:: Nicola Wadeson <<EMAIL>>
"""
import os
import time
import logging
from mpi4py import MPI
from savu.data.pl... |
# -*- coding: utf-8 -*-
from server.render.vi.default import DefaultRender as default
from server.render.vi.user import UserRender as user
from server.render.json.file import FileRender as file
from server.skeleton import Skeleton
from google.appengine.api import app_identity
from server import conf
from server import... |
""" Lockfile behaviour implemented via Unix PID files.
"""
from __future__ import absolute_import
import os
import sys
import errno
import time
from . import (LockBase, AlreadyLocked, LockFailed, NotLocked, NotMyLock,
LockTimeout)
class PIDLockFile(LockBase):
""" Lockfile implemented as a U... |
import copy
import win32
import appdirs
from config import config
from misc import *
from convert import *
from translate import *
from graph import graph
from image import *
from amount_to_text import *
from amount_to_text_en import *
from pdf_utils import *
from yaml_import import *
from sql import *
from float_utils... |
"""
Fill-a-Pix problem in Google CP Solver.
From
http://www.conceptispuzzles.com/index.aspx?uri=puzzle/fill-a-pix/basiclogic
'''
Each puzzle consists of a grid containing clues in various places. The
object is to reveal a hidden picture by painting the squares around each
clue so that the number of pain... |
"""Tests for Softplus and SoftplusGrad."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.ops import gradient_checker
from tensorflow.python.ops import gradients... |
"""build.py: Build an executable for BFLIM Extractor."""
import os
import shutil
import sys
from cx_Freeze import setup, Executable
version = '2.3'
# Pick a build directory
dir_ = 'bflim_extract v' + version
# Add the "build" parameter to the system argument list
if 'build' not in sys.argv:
sys.argv.append('bu... |
import unittest
from rdflib.Graph import Graph
from rdflib import URIRef
import gc
import itertools
from time import time
from random import random
from tempfile import mkdtemp
def random_uri():
return URIRef("%s" % random())
class StoreTestCase(unittest.TestCase):
"""
Test case for testing store perfo... |
import time
from openerp.osv import fields
from openerp.osv import osv
from openerp.tools.translate import _
class hr_employee(osv.osv):
_name = "hr.employee"
_inherit = "hr.employee"
_columns = {
'product_id': fields.many2one('product.product', 'Product', help="If you want to reinvoice working ti... |
import sys
import smbus
import math
from Adafruit_I2C import Adafruit_I2C
_hmc5883l_address = 0x1e
_mode_register = 0x02
_mode_map = { 'continuous' : 0x00,
'single' : 0x01,
'idle' : 0x03}
_configuration_reg_a = 0x00
_configuration_reg_b = 0x01
_read_register = 0x03
class HMC5883L(o... |
""" Analyze per-tile and viewport bench data, and output visualized results.
"""
__author__ = '<EMAIL> (Ben Chen)'
import bench_util
import boto
import math
import optparse
import os
import re
import shutil
from oauth2_plugin import oauth2_plugin
# The default platform to analyze. Used when OPTION_PLATFORM flag is ... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from froide.helper.auth_migration_util import USER_DB_NAME
APP_MODEL, APP_MODEL_NAME = 'account.User', 'account.user'
class Migration(SchemaMigration):
def forwards(self, orm):
... |
"""
Test the parallel module.
"""
# Copyright (c) 2010-2011 Gael Varoquaux
# License: BSD Style, 3 clauses.
import time
import sys
import io
import os
try:
import cPickle as pickle
PickleError = TypeError
except:
import pickle
PickleError = pickle.PicklingError
if sys.version_info[0] == 3:
Pickl... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
CalculatorModelerAlgorithm.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
************... |
from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, Category
class M2MMultipleTests(TestCase):
def test_multiple(self):
c1, c2, c3, c4 = [
Category.objects.create(name=name)
for name in ["Sports", "N... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wms', '0006_auto_20150424_1058'),
]
operations = [
migrations.RemoveField(
model_name='style',
name=... |
'''
Integration Test for creating KVM VM in HA mode with mysql stop on one node.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res... |
"""
General utility functions for internal use.
"""
from .gis import maybe_swap_spatial_dims
import progressbar as pgb
from pathlib import Path
import pandas as pd
import xarray as xr
import textwrap
import re
import warnings
from .datasets import modules as datamodules
import logging
logger = logging.getLogger(__na... |
from . import account_analytic_project_id
from .post_install import set_account_analytic_account_project_id |
"""
Common routines for entering and classifiying opcodes. Inspired by,
limited by, and somewhat compatible with the corresponding
Python opcode.py structures
"""
from copy import deepcopy
from xdis.cross_dis import (
findlinestarts,
findlabels,
get_jump_target_maps,
get_jump_targets,
)
from xdis impor... |
from __future__ import print_function
import logging
from optparse import OptionParser
import os
import re
import subprocess
import sys
import tempfile
from threading import Thread, Lock
import time
if sys.version < '3':
import Queue
else:
import queue as Queue
# Append `SPARK_HOME/dev` to the Python path so ... |
"""Interface for preferences."""
from __future__ import absolute_import, unicode_literals
__metaclass__ = type
__all__ = [
'IPreferences',
]
from zope.interface import Interface, Attribute
class IPreferences(Interface):
"""Delivery related information."""
acknowledge_posts = Attribute(
... |
"""this module contains a set of functions to handle inference on astroid trees
"""
from __future__ import print_function
from astroid import bases
from astroid import context as contextmod
from astroid import exceptions
from astroid import manager
from astroid import nodes
from astroid import protocols
from astroid ... |
# -*- coding: utf-8 -*-
'''
TDnetLoader is a plug-in to both GUI menu and command line/web service
that loads a TDnet html index file. TDnet is Tokyo Stock Exchange's
Timely Disclosure Network.
(c) Copyright 2014 Mark V Systems Limited, All rights reserved.
'''
from lxml import html
import datetime, re, os
from arel... |
"""
some unit tests to make sure sftp works well with large files.
a real actual sftp server is contacted, and a new folder is created there to
do test file operations in (so no existing files will be harmed).
"""
import os
import random
import struct
import sys
import time
import unittest
from paramiko.common impor... |
# flake8: noqa
from __future__ import absolute_import, division, print_function, with_statement
from tornado.test.util import unittest
class ImportTest(unittest.TestCase):
def test_import_everything(self):
# Some of our modules are not otherwise tested. Import them
# all (unless they have externa... |
from nbody_graph_search import Ugraph
# To find 4-body "improper" interactions,
# (by default, most of the time), we would use this subgraph:
# 0
# * 1st bond connects atoms 1 and 0
# | => 2nd bond connects atoms 1 and 2
# _.*._ ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, 7):
pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7")
from ansible.module_utils.basic import AnsibleModule
try:
from librar... |
from setuptools import setup, Extension
x13_hash_module = Extension('x13_hash',
sources = ['x13module.c',
'x13.c',
'../../sph/blake.c',
'../../sph/bmw.c',
... |
'''Night Bus: Simple SSH-based build automation'''
import gevent
import yaml
import collections
import itertools
import logging
import os
import time
import nightbus
from nightbus.utils import ensure_list
DEFAULT_SHELL = '/bin/bash -c'
class Task():
'''A single task that we can run on one or more hosts.'''
... |
#!/usr/bin/env python
'''
rotate APMs on bench to test magnetometers
'''
import sys, os, time
from math import radians
from pymavlink import mavutil
from optparse import OptionParser
parser = OptionParser("rotate.py [options]")
parser.add_option("--device1", dest="device1", default=None, help="mavlink device1")
p... |
"""
LambdaRank is a listwise rank model.
https://papers.nips.cc/paper/2971-learning-to-rank-with-nonsmooth-cost-functions.pdf
"""
import paddle.v2 as paddle
def lambda_rank(input_dim, is_infer=False):
"""
The input data and label for LambdaRank must be sequences.
parameters :
input_dim, one documen... |
{
'name': 'Certified People',
'category': 'Website',
'website': 'https://www.odoo.com/page/website-builder',
'summary': 'Display your network of certified people on your website',
'version': '1.0',
'author': 'OpenERP S.A.',
'depends': ['marketing', 'website'],
'description': """
Disp... |
from setuptools import setup, find_packages
import os, sys
# The repository root directory
project_root = os.path.abspath(os.path.dirname(__file__))
# The projects which this project depends upon
dependancies = [
'pyramid',
'buildbot',
'repoze.tm2>=1.0b1',
'WebError',
'pyramid_jinja2',
'zope.i... |
'''
TODO:
- All!!!
'''
__version__ = "$Id: ErrTestComponent.py,v 1.2 2004/09/24 21:15:46 dfugate Exp $"
#--REGULAR IMPORTS-------------------------------------------------------------
#--CORBA STUBS-----------------------------------------------------------------
import perftest__POA
#--ACS Imports-------------------... |
import shutil
from subprocess import CalledProcessError
from django.core.management.base import CommandError
from django.conf import settings
from fluent.syntax.parser import FluentParser, ParseError
from lib.l10n_utils.fluent import fluent_l10n, get_metadata, write_metadata
from ._ftl_repo_base import FTLRepoComman... |
from math import pi, cos
from gnuradio import gr, gr_unittest, fft, blocks
class test_goertzel(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
def tearDown(self):
self.tb = None
def make_tone_data(self, rate, freq):
return [cos(2*pi*x*freq/rate) for x in range(r... |
"""Module for testing string variables."""
class TestStringVar(BaseTestCase):
def setUp(self):
BaseTestCase.setUp(self)
self.rawData = []
self.dataByKey = {}
for i in range(1, 11):
stringCol = u"String %d" % i
fixedCharCol = (u"Fixed Char %d" % i).ljust(40)
... |
import pytest
from plenum.test.checkpoints.helper import checkRequestCounts
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from plenum.test.test_node import ensureElectionsDone
from plenum.test.view_change.helper import ensure_view_change
from stp_core.loop.eventually import eventually
fro... |
import mock
from django.core.urlresolvers import reverse
from django import http
from mox3.mox import IsA # noqa
from openstack_dashboard import api
from openstack_dashboard.dashboards.admin.aggregates import constants
from openstack_dashboard.dashboards.admin.aggregates import workflows
from openstack_dashboard.tes... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import codecs
import re
import pkg_resources
from nltk.classify import NaiveBayesClassifier
space = re.compile('[\'".,!?\\s\\(\\)]+')
cats = ('positiivne', 'negatiivne', 'neutraalne', 'vastuoluline')
classifier = None
corpus_name = pkg_resources.... |
from urllib.parse import urljoin
from normality import stringify, collapse_spaces, slugify
from lxml import html
from opensanctions.util import date_formats, DAY
def parse_date(text):
return date_formats(text, [("%d/%m/%Y", DAY)])
def crawl_person(context, name, url):
context.log.debug("Crawling member", na... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import difflib
import json
import os
import sys
import warnings
from copy import deepcopy
from ansible import constants as C
from ansible.module_utils.common._collections_compat import MutableMapping
from ansible.module_utils.six... |
from cherrypy.test import test
test.prefer_parent_path()
import md5, sha
import cherrypy
from cherrypy.lib import httpauth
def setup_server():
class Root:
def index(self):
return "This is public."
index.exposed = True
class DigestProtected:
def index(self):
re... |
# -*- coding: utf-8 -*-
'''
Insert minion return data into a sqlite3 database
:maintainer: Mickey Malone <<EMAIL>>
:maturity: New
:depends: None
:platform: All
Sqlite3 is a serverless database that lives in a single file.
In order to use this returner the database file must exist,
have the appropri... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_padsd_ascii.py
-------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************... |
import argparse
import glob
import importlib
import libmyriad
import logging
import myriad
import os
import requests
import shutil
import subprocess
import sys
import time
class Bootstrap:
def __init__(self):
self.server = 'https://raw.githubusercontent.com/russellthackston/comp-chem-util/master/myriad'
self.ver... |
'''Functions for generating random numbers.'''
# Source inspired by code by Yesudeep Mangalapilly <<EMAIL>>
import os
from rsa import common, transform
from rsa._compat import byte
def read_random_bits(nbits):
'''Reads 'nbits' random bits.
If nbits isn't a whole number of bytes, an extra byte will be appen... |
"""Common utility functions and classes used by multiple Python scripts."""
import os
def ensure_directory_exists(d):
"""Creates the given directory if it does not already exist."""
if not os.path.exists(d):
os.makedirs(d)
def require_cwd_to_be_oppia():
"""Ensures that the current working direc... |
import time
from typing import Any, Dict, List, Optional
from django.db import models
from . import logging
from .autoupdate import AutoupdateElement, inform_changed_data, inform_elements
from .rest_api import model_serializer_classes
from .utils import convert_camel_case_to_pseudo_snake_case, get_element_id
logger... |
"""Support for zestimate data from zillow.com."""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
import xmltodict
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME
import homeassistant.helpers.c... |
"""
This module defines standard interpreted text role functions, a registry for
interpreted text roles, and an API for adding to and retrieving from the
registry.
The interface for interpreted role functions is as follows::
def role_fn(name, rawtext, text, lineno, inliner,
options={}, content=[])... |
import hmac
from django.conf import settings
from django.contrib.messages import constants
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import CompatCookie
from django.utils import simplejson as json
from django.utils.hashcompat import sha_hmac
class MessageEncoder(json.JSON... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import inspect
import re
import textwrap
from collections import OrderedDict, namedtuple
from pants.base.exceptions import TaskError
from pants.build_graph.target imp... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ProcessingResults.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************... |
#! /usr/bin/env python3
# linktree
#
# Make a copy of a directory tree with symbolic links to all files in the
# original tree.
# All symbolic links go to a special symbolic link at the top, so you
# can easily fix things if the original source tree moves.
# See also "mkreal".
#
# usage: mklinks oldtree newtree
impor... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urllib_parse_urlencode,
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
qualities,
)
class AddAnimeIE(InfoExtractor):
_VAL... |
# -*- coding: utf-8 -*-
r'''
werkzeug.script
~~~~~~~~~~~~~~~
.. admonition:: Deprecated Functionality
``werkzeug.script`` is deprecated without replacement functionality.
Python's command line support improved greatly with :mod:`argparse`
and a bunch of alternative modules.
Most ... |
"""
Functions for communicating with Pageant, the basic windows ssh agent program.
"""
import os
import struct
import tempfile
import mmap
import array
# if you're on windows, you should have these, i guess?
try:
import win32ui
_has_win32all = True
except ImportError:
_has_win32all = False
_AGENT_COPYDA... |
import os
from importlib import import_module
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils._os import upath
from django.utils.module_loading import module_has_submodule
MODELS_MODULE_NAME = 'models'
class AppConfig(object):
"""
Class representing a Django ap... |
# -*- coding: utf-8 -*-
import uuid
import requests
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth import Auth
from framework.auth.core import get_user
from website import util
from website import security
from website import settings
from website.project import n... |
# Die Umsatzsteuern (voller Steuersatz, reduzierte Steuer und steuerfrei)
# sollten bei den Produktstammdaten hinterlegt werden (in Abhängigkeit der
# Steuervorschriften). Die Zuordnung erfolgt auf dem Aktenreiter Finanzbuchhaltung
# (Kategorie: Umsatzsteuer).
# Die Vorsteuern (voller Steuersatz, reduzierte Steuer und ... |
from openerp import models, api, _
from openerp.exceptions import except_orm
class HrAnalyticTimesheet(models.Model):
_inherit = "hr.analytic.timesheet"
@api.multi
def _get_sale_lines(self):
task_works = self.env['project.task.work'].search(
[('hr_analytic_timesheet_id', '=', self.id)... |
from rest_framework.exceptions import ValidationError
from django.test import TestCase
from coredb.factories.projects import ProjectFactory
from coredb.factories.runs import RunFactory
from coredb.factories.users import UserFactory
from coredb.managers.deleted import ArchivedManager, LiveManager
from coredb.managers.... |
from openerp import fields, models, api
class account_voucher_populate_statement(models.TransientModel):
_name = "account.voucher.populate.statement"
_description = "Account Voucher Populate Statement"
journal_id = fields.Many2one(
'account.journal',
'Journal',
required=True
)... |
import struct
class TruncatedStreamError(EOFError):
pass
class Reader(object):
__slots__ = ['d', 'off']
def __init__(self, data, off=0):
self.d = data
self.off = off
def done(self): return self.off >= len(self.d)
def copy(self): return Reader(self.d, self.off)
def u8(self):... |
import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from webdriver import exceptions
class CookieTest(base_test.WebDriverBaseTest):
def setUp(self):
self.driver.get(self.webserver.where_is("cookie/res/cookie_container.html"))
def... |
# Common tests for test_tkinter/test_widgets.py and test_ttk/test_widgets.py
import unittest
import sys
import Tkinter as tkinter
from ttk import Scale
from test_ttk.support import (AbstractTkTest, tcl_version, requires_tcl,
get_tk_patchlevel, pixels_conv, tcl_obj_eq)
import test.test_sup... |
'''original example for checking how far GAM works
Note: uncomment plt.show() to display graphs
'''
example = 2 # 1,2 or 3
import numpy as np
import numpy.random as R
import matplotlib.pyplot as plt
from statsmodels.sandbox.gam import AdditiveModel
from statsmodels.sandbox.gam import Model as GAM #?
from statsmode... |
import wx
class InstructionPopup(wx.PopupWindow):
def __init__(self, parent):
self.parent = parent
wx.PopupWindow.__init__(self, parent, wx.SIMPLE_BORDER)
self._create_gui()
self.Show(True)
wx.CallAfter(self.Refresh)
def SetText(self, text):
self.st.SetLabel(t... |
import sys
if sys.version_info[0] < 3:
from ConfigParser import SafeConfigParser, NoOptionError
else:
from configparser import SafeConfigParser, NoOptionError
import re
import os
import shlex
__all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet',
'read_config', 'parse_flags']
_VAR = re... |
from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
import re
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrap... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
================================================================================
Music theory Python package
Copyright (C) 2008, 2009, Bart Spaans
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General P... |
from collections import namedtuple
from pathlib import Path
import csv
DATA_DIR_PATH = Path(
'/Users/harold/Desktop/NFC/Data/MPG Ranch/'
'2016 MPG Ranch Recording Files Comparison')
DEBBIE_FILE_PATH = DATA_DIR_PATH / 'Recording Files Debbie.csv'
HAROLD_FILE_PATH = DATA_DIR_PATH / 'Recording Files Harold.csv'... |
from collections import namedtuple
from unification.more import (unify_object, reify_object,
unifiable)
from unification import var, variables
from unification.core import unify, reify, _unify, _reify
class Foo(object):
def __init__(self, a, b):
self.a = a
self.b = b
de... |
import BoostBuild
import string
t = BoostBuild.Tester(pass_toolset=0)
t.write("a.cpp", """
""")
t.write("yfc1.jam", """
import feature ;
import generators ;
feature.extend toolset : yfc1 ;
rule init ( ) { }
generators.register-standard yfc1.compile : CPP : OBJ : <toolset>yfc1 ;
generators.register-standard yfc1.li... |
from gge.GameObject import GameObject
from gge.InputAttribute import InputAttribute
from gge.Attribute import SingletonAttribute
import gge.Types as T
import gge.DisplayTypes as DT
class MouseWithin(SingletonAttribute): pass
class MouseDown(SingletonAttribute): pass
class ShapeButton(GameObject):
def __... |
from django.core.exceptions import ValidationError
from django.db import models
from django.test import TestCase
from .models import GenericIPAddress
class GenericIPAddressFieldTests(TestCase):
def test_genericipaddressfield_formfield_protocol(self):
"""
GenericIPAddressField with a specified pr... |
import numpy
from numpy.testing import assert_raises
from fuel.schemes import (ConstantScheme, SequentialExampleScheme,
SequentialScheme, ShuffledExampleScheme,
ShuffledScheme, ConcatenatedScheme,
cross_validation)
def iterator_requester(s... |
from pyasn1 import error
class TagMap:
def __init__(self, posMap={}, negMap={}, defType=None):
self.__posMap = posMap.copy()
self.__negMap = negMap.copy()
self.__defType = defType
def __contains__(self, tagSet):
return tagSet in self.__posMap or \
self.__... |
from functools import wraps
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-langu... |
from __future__ import (absolute_import, division, print_function)
import json
from units.compat.mock import patch
from ansible.modules.network.nso import nso_action
from . import nso_module
from .nso_module import MockResponse
from units.modules.utils import set_module_args
class TestNsoAction(nso_module.TestNsoM... |
"""WebKit Efl implementation of the Port interface."""
import os
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
from webkitpy.port.base import Port
from webkitpy.port.pulseaudio_sanitizer import PulseAudioSanitizer
from webkitpy.port.xvfbdriver import XvfbDriver
class EflPort(Port):
... |
import os, pwd, grp, platform, sys
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.output:colorize',
'portage.util:writemsg',
'portage.util.path:first_existing',
'subprocess'
)
from portage.localization import _
ostype = platform.system()
userland = None
if ostype == "DragonFly" or ostype.e... |
import os
from tkinter import *
import tkinter.messagebox as tkMessageBox
class FileList:
# N.B. this import overridden in PyShellFileList.
from idlelib.EditorWindow import EditorWindow
def __init__(self, root):
self.root = root
self.dict = {}
self.inversedict = {}
self.v... |
from openerp.osv import orm, fields
from openerp import netsvc
import base64
import tempfile
import tarfile
import httplib
import os
class RstDoc(object):
def __init__(self, module, objects):
self.dico = {
'name': module.name,
'shortdesc': module.shortdesc,
'latest_ver... |
import os
import sys
from pbr import find_package
from pbr.hooks import base
def get_manpath():
manpath = 'share/man'
if os.path.exists(os.path.join(sys.prefix, 'man')):
# This works around a bug with install where it expects every node
# in the relative data directory to be an actual directo... |
"""
=======================
MNIST dataset benchmark
=======================
Benchmark on the MNIST dataset. The dataset comprises 70,000 samples
and 784 features. Here, we consider the task of predicting
10 classes - digits from 0 to 9 from their raw images. By contrast to the
covertype dataset, the feature space is... |
# Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
# -*- coding: utf-8 -*-
import os
import sys
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import urllib
import urllib2
import urlparse
from xml.dom import minidom
# plugin constants
__plugin__ = "plugin.video.3bmeteo"
__author__ = "Nightflyer"
Addon = xbmcaddon.Addon(id=__plugin__)
# plugin handle
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import re
def _run_threaded(module):
control_binary = _get_ctl_binary(module)
re... |
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404, render_to_response
from django.utils.timezone import now
from datetime import timedelta
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.c... |
import types
from uuid import uuid4
from urllib import quote_plus, urlencode
from glob import glob
from os.path import basename
from mimetypes import guess_type
BOUNDARY = uuid4().hex
class file_part:
def __init__(self, file_item, headers):
self.file_item = file_item;
self.headers = headers;
d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.