code stringlengths 1 199k |
|---|
{
'name': 'Website Sale - Sale Management',
'version': '1.0',
'category': 'Website',
'description': """
Display orders to invoice in website dashboard.
""",
'depends': [
'sale_management',
'website_sale',
],
'installable': True,
'autoinstall': True,
'data': [
],
... |
'''
TODO:
- everything
'''
__revision__ = "$Id: ArchiveConsumer.py,v 1.6 2006/11/24 07:55:57 cparedes Exp $"
from traceback import print_exc
import acscommon
from Acspy.Nc.Consumer import Consumer
class ArchiveConsumer (Consumer):
#--------------------------------------------------------------------------
'''
... |
"""
Binds rez itself as a rez package.
"""
from __future__ import absolute_import
import rez
from rez.package_maker__ import make_package
from rez.bind._utils import check_version
from rez.system import system
from rez.utils.lint_helper import env
import shutil
import os.path
def commands():
env.PYTHONPATH.append('... |
from pygal._compat import u
from pygal.util import (
round_to_int, round_to_float, _swap_curly, template, humanize,
truncate, minify_css, majorize)
from pytest import raises
def test_round_to_int():
assert round_to_int(154231, 1000) == 154000
assert round_to_int(154231, 10) == 154230
assert round_to... |
"""The Huisbaasje integration."""
from datetime import timedelta
import logging
import async_timeout
from huisbaasje import Huisbaasje, HuisbaasjeException
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
from ... |
"""A simple wrapper around enum types to expose utility functions.
Instances are created as properties with the same name as the enum they wrap
on proto classes. For usage, see:
reflection_test.py
"""
__author__ = 'rabsatt@google.com (Kevin Rabsatt)'
import six
class EnumTypeWrapper(object):
"""A utility for findi... |
import uuid
from keystoneclient.tests.v3 import utils
from keystoneclient.v3 import policies
class PolicyTests(utils.TestCase, utils.CrudTests):
def setUp(self):
super(PolicyTests, self).setUp()
self.key = 'policy'
self.collection_key = 'policies'
self.model = policies.Policy
... |
"""
SDSS Segue Stellar Parameter Pipeline Data
------------------------------------------
Figure 1.5.
The surface gravity vs. effective temperature plot for the first 10,000 entries
from the catalog of stars with SDSS spectra. The rich substructure reflects
both stellar physics and the SDSS selection criteria for spect... |
from sympy.core import symbols, Symbol, Tuple, oo
from sympy.core.compatibility import iterable, range
from sympy.tensor.indexed import IndexException
from sympy.utilities.pytest import raises
from sympy import IndexedBase, Idx, Indexed, S, sin, cos, Sum, Piecewise, And
def test_Idx_construction():
i, a, b = symbol... |
import time
from urllib.parse import parse_qsl
import requests
from django.utils.http import urlencode
from paypal import exceptions
def post(url, params, encode=True):
"""
Make a POST request to the URL using the key-value pairs. Return
a set of key-value pairs.
:url: URL to post to
:params: Dict ... |
from random import SystemRandom
from string import ascii_letters, digits
from qiita_db.sql_connection import TRN
pool = ascii_letters + digits
client_id = ''.join([SystemRandom().choice(pool) for _ in range(50)])
client_secret = ''.join([SystemRandom().choice(pool) for _ in range(255)])
with TRN:
sql = """INSERT IN... |
"""
PNG formatter for various Image objects (PIL, OpenCV, numpy arrays that look like image data)
Usage: %load_ext pil_display
Now when displayhook gets an image, it will be drawn in the browser.
"""
from io import BytesIO
import os
import tempfile
def pil2imgdata(img, format='PNG'):
"""convert a PIL Image to png ... |
"""Smoke tests for gclient.py.
Shell out 'gclient' and run basic conformance tests.
This test assumes GClientSmokeBase.URL_BASE is valid.
"""
import logging
import os
import re
import subprocess
import sys
import unittest
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, ROOT_DIR... |
"""
Demonstration of plotting FSPS's un-normalized filter transmission tables
(i.e., contents of $SPS_HOME/data/all_filters.dat).
"""
import fsps
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import matplotlib.gridspec as gridspec
names = ['sdss_u', 'sd... |
from __future__ import absolute_import, division, print_function
import abc
from fractions import gcd
import six
from cryptography import utils
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
from cryptography.hazmat.backends.interfaces import RSABackend
@six.add_metaclass(abc.ABCMeta)
class RSAPriva... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Verify that the run -q and --quiet options suppress build output.
"""
import re
import TestSCons_time
python = TestSCons_time.python
test = TestSCons_time.TestSCons_time(match = TestSCons_time.match_re,
diff = TestSCo... |
def ButtonSave__JS_to_active():
return "$('#save-button').show().removeClass('saved');"
def ButtonSave__JS_to_deactive():
return "$('#save-button').addClass('saved');" |
import sys
from wb import config, choose_arch, home_fn
if 'SIGNTOOL' in config:
sys.path.append(home_fn(config['SIGNTOOL']))
def main(conf, arch):
from signtool import SignTool
st = SignTool(conf)
for x64 in choose_arch(arch):
st.sign_verify(x64=x64)
if __name__ == "__main__":
if len(sys.arg... |
if day <> None:
if day > 9:
return str(day)
else:
return str(0) + str(day) |
from codex.baseview import BaseView
from WeChatTicket import settings
from django.http import HttpResponse, Http404
import logging
import mimetypes
import os
__author__ = "Epsirom"
class StaticFileView(BaseView):
logger = logging.getLogger('Static')
def get_file(self, fpath):
if os.path.isfile(fpath):
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = """
module: pamd
author:
- "Kenneth D. Evensen (@kevensen)"
short_descrip... |
import os
import numpy
from nupic.bindings.math import GetNTAReal
from nupic.research.FDRCSpatial2 import FDRCSpatial2
from nupic.bindings.algorithms import SpatialPooler as CPPSpatialPooler
from nupic.research.spatial_pooler import SpatialPooler as PYSpatialPooler
import nupic.research.fdrutilities as fdru
from nupic.... |
from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordWidget
from Products.Archetypes.Registry import registerWidget
import datetime
class DurationWidget(RecordWidget):
security = ClassSecurityInfo()
_properties = RecordWidget._properties.copy()
_properties.update({
... |
from spack import *
class Mbedtls(CMakePackage):
"""mbed TLS (formerly known as PolarSSL) makes it trivially easy for
developers to include cryptographic and SSL/TLS capabilities in
their (embedded) products, facilitating this functionality with a
minimal coding footprint.
"""
homepage ... |
from typing import List
from gitlint.git import GitCommit
from gitlint.rules import CommitMessageTitle, LineRule, RuleViolation
TENSE_DATA = [
(["adds", "adding", "added"], "add"),
(["allows", "allowing", "allowed"], "allow"),
(["amends", "amending", "amended"], "amend"),
(["bumps", "bumping", "bumped"]... |
"""The Mikrotik router class."""
from datetime import timedelta
import logging
import socket
import ssl
import librouteros
from librouteros.login import plain as login_plain, token as login_token
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, CONF_VERIFY_SSL
from homeassistant.exceptions impor... |
import fcntl
import io
import os
from . import context
from . import popen_fork
from . import reduction
from . import spawn
from . import util
from . import current_process
__all__ = ['Popen']
class _DupFd(object):
def __init__(self, fd):
self.fd = fd
def detach(self):
return self.fd
class Popen... |
"""
Support for Google Play Music Desktop Player.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.gpmdp/
"""
import logging
import json
import os
import socket
import time
import voluptuous as vol
from homeassistant.components.media_player imp... |
from __future__ import division
from sympy import Symbol, sqrt, Derivative
from sympy.geometry import Point, Polygon, Segment, convex_hull, intersection, centroid
from sympy.geometry.util import idiff
from sympy.solvers.solvers import solve
from sympy.utilities.pytest import raises
def test_idiff():
x = Symbol('x',... |
import unittest
from telemetry.core import system_info
from telemetry.page import page as page_module
from telemetry.story import story_set
import gpu_test_expectations
class StubPlatform(object):
def __init__(self, os_name, os_version_name=None):
self.os_name = os_name
self.os_version_name = os_version_name
... |
"""Proxy middleware to support .onion addresses."""
from urlparse import urlparse
from scrapy.conf import settings
class ProxyMiddleware(object):
"""Middleware for .onion addresses."""
def process_request(self, request, spider):
parsed_uri = urlparse( request.url )
domain = '{uri.scheme}://{uri.... |
from toontown.parties.DistributedPartyJukeboxActivityBase import DistributedPartyJukeboxActivityBase
from toontown.parties import PartyGlobals
class DistributedPartyValentineJukeboxActivity(DistributedPartyJukeboxActivityBase):
notify = directNotify.newCategory('DistributedPartyJukeboxActivity')
def __init__(se... |
from django.conf.urls.defaults import patterns, include, url
urlpatterns = patterns('',
url(r'^get-adc-index/widget(?P<widget_id>[0-9]+)/nx/Index.html$', 'workflows.latino.views.get_adc_index', name='get adc index'),
url(r'^get-adc-index/widget(?P<widget_id>[0-9]+)/(?P<narrow_doc>n?)x/Index.html$', 'workflows.l... |
NAME='router_metrics'
CFLAGS = []
LDFLAGS = []
LIBS = []
GCC_LIST = ['plugin'] |
from __future__ import absolute_import
from __future__ import unicode_literals
import dnf.exceptions
import tests.support
JAY_ERR = """jay-3.x86_64: Can not download."""
class DownloadErrorTest(tests.support.TestCase):
def test_str(self):
exc = dnf.exceptions.DownloadError(errmap={
'jay-3.x86_64... |
"""
Classes and functions to handle block/disk images for libvirt.
This exports:
- two functions for get image/blkdebug filename
- class for image operates and basic parameters
"""
import storage
class QemuImg(storage.QemuImg):
"""
libvirt class for handling operations of disk/block images.
"""
def ... |
'''
Exodus Add-on
Copyright (C) 2016 Exodus
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This pro... |
from ..server_utils import SetUpPythonPath
SetUpPythonPath()
from .test_utils import ( Setup,
BuildRequest,
PathToTestFile,
StopOmniSharpServer,
WaitUntilOmniSharpServerReady,
ChangeSpecific... |
"""Unit tests for nupic.data.utils."""
from datetime import datetime
from nupic.data import utils
from nupic.support.unittesthelpers.testcasebase import (TestCaseBase,
unittest)
class UtilsTest(TestCaseBase):
"""Utility unit tests."""
def testParseTimestamp(se... |
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
from frappe import _
from erpnext.hr.doctype.staffing_plan.staffing_plan import get_designation_counts, get_active_staffing_plan_details
class JobOpening(WebsiteGenerator):
website = frappe._dict(
temp... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = r'''
---
module: wait_for
short_description: Waits for a condition before co... |
import os
import unittest
from doctest import DocFileSuite, ELLIPSIS
from glob import glob
from txjsonrpc.testing.suite import buildDoctestSuite
modules = [
]
files = glob("docs/specs/*.txt")
files.append("docs/USAGE.txt")
suites = []
for file in files:
file = os.path.join("..", file)
suites.append(DocFileSuite... |
from . import pddl_types
class Predicate(object):
def __init__(self, name, arguments):
self.name = name
self.arguments = arguments
def parse(alist):
name = alist[0]
arguments = pddl_types.parse_typed_list(alist[1:], only_variables=True)
return Predicate(name, arguments)
... |
"""
Template file used by the OPF Experiment Generator to generate the actual
description.py file by replacing $XXXXXXXX tokens with desired values.
This description.py file was generated by:
'~/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/ExpGenerator.py'
"""
from nupic.frameworks.opf.expdes... |
from spack import *
class PyGeneimpacts(PythonPackage):
"""Given multiple snpEff or VEP or BCFTools consequence annotations
for a single variant, get an orderable python object for each annotation.
"""
homepage = "https://github.com/brentp/geneimpacts"
url = "https://github.com/brentp/geneimpac... |
"""
Script to push the zone configuration to brocade SAN switches.
"""
import random
import re
from eventlet import greenthread
from cinder import exception
from cinder.i18n import _
from cinder.openstack.common import excutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import proce... |
from repo_modder.command import run
__all__ = ['run'] |
NONE = 0
ParentRelative = 1 # background pixmap in CreateWindow
# and ChangeWindowAttributes
CopyFromParent = 0 # border pixmap in CreateWindow
# and ChangeWindowAttributes
# special VisualID and special window
... |
from __future__ import absolute_import
import os
import shutil
from digits.task import Task
from digits.utils import subclass, override
@subclass
class UploadPretrainedModelTask(Task):
"""
A task for uploading pretrained models
"""
def __init__(self, **kwargs):
"""
Arguments:
wei... |
import warnings
from django.db import models
from django.test import TestCase, override_settings
from django.utils import six
class FieldDeconstructionTests(TestCase):
"""
Tests the deconstruct() method on all core fields.
"""
def test_name(self):
"""
Tests the outputting of the correct ... |
import posixpath
import re
from telemetry.timeline import event as timeline_event
class MmapCategory(object):
_DEFAULT_CATEGORY = None
def __init__(self, name, file_pattern, children=None):
"""A (sub)category for classifying memory maps.
Args:
name: A string to identify the category.
file_patter... |
from optparse import make_option
import os
from os.path import join, exists
import shutil
from django.core.management.base import BaseCommand
from addons.models import Persona
class Command(BaseCommand):
help = ('Copy static files for personas from getpersonas.com to the AMO '
'static files directory. T... |
"""
Class for outlier detection.
This class provides a framework for outlier detection. It consists in
several methods that can be added to a covariance estimator in order to
assess the outlying-ness of the observations of a data set.
Such a "outlier detector" object is proposed constructed from a robust
covariance est... |
import json
from django.contrib.postgres.forms import SimpleArrayField
from django.contrib.postgres.validators import ArrayMaxLengthValidator
from django.core import checks, exceptions
from django.db.models import Field, Lookup, Transform, IntegerField
from django.utils import six
from django.utils.translation import s... |
import logging
import zlib
import io
from .exceptions import DecodeError
from .packages.six import string_types as basestring, binary_type
log = logging.getLogger(__name__)
class DeflateDecoder(object):
def __init__(self):
self._first_try = True
self._data = binary_type()
self._obj = zlib.de... |
from util import manhattanDistance
from game import Grid
import os
import random
VISIBILITY_MATRIX_CACHE = {}
class Layout:
"""
A Layout manages the static information about the game board.
"""
def __init__(self, layoutText):
self.width = len(layoutText[0])
self.height= len(layoutText)
... |
from __future__ import print_function
import argparse
import copy
from datetime import datetime
from functools import partial
import json
import os
import posixpath
import re
import sys
from code import Code
import json_parse
HEADER_FILE_TEMPLATE = """
// Copyright %(year)s The Chromium Authors. All rights reserved.
//... |
from py_trace_event import trace_event
from telemetry import decorators
from telemetry.util import js_template
GESTURE_SOURCE_DEFAULT = 'DEFAULT'
GESTURE_SOURCE_MOUSE = 'MOUSE'
GESTURE_SOURCE_TOUCH = 'TOUCH'
SUPPORTED_GESTURE_SOURCES = (GESTURE_SOURCE_DEFAULT,
GESTURE_SOURCE_MOUSE,
... |
attrs = [('notamodule','')]
def hook(mod):
import os, sys, marshal
other = os.path.join(mod.__path__[0], '../pkg2/__init__.pyc')
if os.path.exists(other):
co = marshal.loads(open(other,'rb').read()[8:])
else:
co = compile(open(other[:-1],'rU').read()+'\n', other, 'exec')
mod.__init__... |
from __future__ import unicode_literals
import pytz
from django.utils import timezone
from reviewboard.accounts.models import Profile
class TimezoneMiddleware(object):
"""Middleware that activates the user's local timezone."""
def process_request(self, request):
"""Activate the user's selected timezone ... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'RafflePrize.round'
db.add_column('raffle_raffleprize', 'round', self.gf('django.db.models.fields.related.ForeignKey')(t... |
import pytest
@pytest.fixture("session")
def setup(request):
setup = CostlySetup()
yield setup
setup.finalize()
class CostlySetup:
def __init__(self):
import time
print ("performing costly setup")
time.sleep(5)
self.timecostly = 1
def finalize(self):
del self.... |
"""
Zen Chatbot talks in gems of Zen wisdom.
This is a sample conversation with Zen Chatbot:
ZC: Welcome, my child.
me: Good afternoon.
ZC: Ask the question you have come to ask.
me: How can I achieve enlightenment?
ZC: How do you suppose?
me: Through meditation.
ZC: Form is emptiness, and emptines... |
import re
from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent
regexps = dict({
"jQuery": list(['jquery']), # unlikely false positive
"YUI": list(['\/yui\/', 'yui\-', 'yui\.']),
"Prototype": list(['\/prototype\/', 'prototype\-', 'prototype\.js']),
"ZURB Foundation": list(['\/foundation\/', '... |
"""
Calendar is a dictionary like Python object that can render itself as VCAL
files according to rfc2445.
These are the defined components.
"""
from types import ListType, TupleType
SequenceTypes = (ListType, TupleType)
import re
from icalendar.caselessdict import CaselessDict
from icalendar.parser import Contentlines... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
from OpenGL.raw.GL import _types as _cs
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GL_ARB_shader_image_size'
def _f( fu... |
"""Support for control of ElkM1 lighting (X10, UPB, etc)."""
from homeassistant.components.light import ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light
from . import DOMAIN as ELK_DOMAIN, ElkEntity, create_elk_entities
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the E... |
from horizon.tabs.base import DetailTabsGroup
from horizon.tabs.base import Tab
from horizon.tabs.base import TabGroup
from horizon.tabs.base import TableTab
from horizon.tabs.views import TabbedTableView
from horizon.tabs.views import TabView
__all__ = [
'DetailTabsGroup',
'Tab',
'TabGroup',
'TableTab'... |
from pyflink.ml.api.param import WithParams, ParamInfo, TypeConverters
class HasSelectedCols(WithParams):
"""
An interface for classes with a parameter specifying the name of multiple table columns.
.. versionadded:: 1.11.0
"""
selected_cols = ParamInfo(
"selectedCols",
"Names of the... |
COMMANDS = {'APPEND': {'arity': 3L,
'flags': ['write', 'denyoom'],
'key_spec': (1, 1, 1)},
'AUTH': {'arity': 2L,
'flags': ['readonly', 'noscript', 'loading', 'stale', 'fast'],
'key_spec': (0, 0, 0)},
'BGREWRITEAOF': {'arity': 1L,
'flags': ['readonly', 'adm... |
import abc
from distutils.spawn import find_executable
import six
from st2actions.runners import ActionRunner
__all__ = [
'BaseWindowsRunner',
'WINEXE_EXISTS',
'SMBCLIENT_EXISTS'
]
WINEXE_EXISTS = find_executable('winexe') is not None
SMBCLIENT_EXISTS = find_executable('smbclient') is not None
ERROR_CODE_TO... |
"""
timedelta support tools
"""
import numpy as np
import pandas as pd
import pandas.tslib as tslib
from pandas.types.common import (_ensure_object,
is_integer_dtype,
is_timedelta64_dtype,
is_list_like)
from pandas.types.... |
import unittest, sys
from ctypes import *
import _ctypes_test
ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint,
c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float]
python_types = [int, int, int, int, int, int,
int, int, int, int, float, float]
class PointersTest... |
"""
sym_diff - Compare two symbol lists and output the differences.
"""
from argparse import ArgumentParser
import sys
from libcxx.sym_check import diff, util
def main():
parser = ArgumentParser(
description='Extract a list of symbols from a shared library.')
parser.add_argument(
'--names-only',... |
"""
subfig package
TO-DO
- Options handling
- Only works with figure environment
- Lists of floats
"""
import new
from plasTeX import Command, Environment
from plasTeX.Base.LaTeX.Floats import Float
def ProcessOptions(options, document):
context = document.context
context.newcounter('subfloat', resetby='figure'... |
"""
Collect [dropwizard](http://dropwizard.codahale.com/) stats for the local node
* urlib2
"""
import urllib2
try:
import json
json # workaround for pyflakes issue #13
except ImportError:
import simplejson as json
import diamond.collector
class DropwizardCollector(diamond.collector.Collector):
def ge... |
from .kernel_struct import *
@unix_name("qstr")
class Qstr(KernelStruct):
"""
String
"""
@classmethod
def initclass(cls):
cls.fields_classes = {"name": Pointer(str)}
def __repr__(self):
return str(self.name)
@unix_name("dentry")
class Dentry(KernelStruct):
"""
Name of a file
"""
@classmethod... |
"""Abstract Transport class."""
from asyncio import compat
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport:
"""Base class for transports."""
def __init__(self, extra=None):
if extra is Non... |
from openerp import models, fields, api
from openerp.addons import decimal_precision as dp
class ProductPricelistItem(models.Model):
_inherit = 'product.pricelist.item'
@api.depends('product_id', 'product_tmpl_id')
def _compute_uop_id(self):
for record in self:
if record.product_id:
... |
"""This module is deprecated. Please use `airflow.providers.amazon.aws.sensors.sqs`."""
import warnings
from airflow.providers.amazon.aws.sensors.sqs import SQSSensor # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.providers.amazon.aws.sensors.sqs`.",
DeprecationWarning,
stacklevel=2,... |
"""
Support for interacting with Linode nodes.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.linode/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.switch import (Swi... |
import eventlet
from oslo_log import log as logging
from oslo_serialization import jsonutils
from neutron.agent.linux import async_process
from neutron.agent.ovsdb import api as ovsdb
from neutron.i18n import _LE
LOG = logging.getLogger(__name__)
OVSDB_ACTION_INITIAL = 'initial'
OVSDB_ACTION_INSERT = 'insert'
OVSDB_ACT... |
import sys
import os
from subprocess import Popen
root_dir = os.path.dirname(os.path.realpath(__file__))
pd_dir = os.path.join(root_dir, 'of-tests/pd_thrift')
oft_path = os.path.join(root_dir, '..', '..', 'submodules', 'oft-infra', 'oft')
if __name__ == "__main__":
args = sys.argv[1:]
args += ["--pd-thrift-path... |
from django.conf.urls import url
from django.http import Http404
from django.template.response import TemplateResponse
from django.urls import URLResolver
from django.urls.resolvers import RegexPattern
from wagtail.core.models import Page
from wagtail.core.url_routing import RouteResult
_creation_counter = 0
def route(... |
from unicorn import *
from unicorn.mips_const import *
import regress
class MipsSyscall(regress.RegressTest):
def test(self):
addr = 0x80000000
code = '34213456'.decode('hex') # ori $at, $at, 0x3456
uc = Uc(UC_ARCH_MIPS, UC_MODE_MIPS32 + UC_MODE_BIG_ENDIAN)
uc.mem_map(addr, 0x1000)
... |
"""
Layer package.
""" |
import array
import mysql.connector
def migration_name():
return "Changing Char Unlock Table Columns"
def check_preconditions(cur):
return
def needs_to_run(cur):
# Ensure homepoint bitmasks exist in char_vars
cur.execute("SHOW COLUMNS FROM char_unlocks LIKE 'sandoria_supply'")
if not cur.fetchone():... |
'''
EM4305 is a 100-150kHz RFID protocol.
'''
from .pd import Decoder |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Campaign.agent_script'
db.add_column(u'dialer_campaign', 'agent_script',
self.gf('django.db.model... |
from osv import osv, fields
class backlog_create_task(osv.osv_memory):
_name = 'project.scrum.backlog.create.task'
_description = 'Create Tasks from Product Backlogs'
_columns = {
'user_id': fields.many2one('res.users', 'Assign To', help="Responsible user who can work on task")
}
def do_crea... |
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
from flask import request, jso... |
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from markupfield.fields import MarkupField
from cms.models import ContentManageable
from .managers import MinutesQuerySet
DEFAULT_MARKUP_TYPE = getattr(settings, 'DEFAULT_MARKUP_TYPE', 'restructuredtext')
class Mi... |
from neutron.api import extensions
MTU = 'mtu'
EXTENDED_ATTRIBUTES_2_0 = {
'networks': {
MTU: {'allow_post': False, 'allow_put': False,
'is_visible': True},
},
}
class Netmtu(extensions.ExtensionDescriptor):
"""Extension class supporting network MTU."""
@classmethod
def get_nam... |
from __future__ import print_function
import argparse
import json
import logging
import os
import urllib2
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)s] %(levelname)s: %(message)s')
class ViatorApi(object):
def __init__(self, apikey):
self.apikey = apikey
def get_locations(self):
... |
import collections
import json
import os
from core import perf_benchmark
from telemetry import page as page_module
from telemetry.page import legacy_page_test
from telemetry import story
from telemetry.value import list_of_scalar_values
from metrics import power
_URL = 'http://www.webkit.org/perf/sunspider-1.0.2/sunspi... |
import os
from shutil import rmtree
from tempfile import mkdtemp
from nipype.testing import (assert_equal,assert_raises,
assert_almost_equal,example_data )
import numpy as np
import nibabel as nb
import nipype.testing as nit
from nipype.algorithms.misc import normalize_tpms
def test_normaliz... |
{
'name': "Italian Localisation - CRM",
'version': '0.1',
'category': 'Localisation/Italy',
'description': """Italian Localization module - CRM version
Funcionalities:
- Campi provincia e regione su Lead/Opportunity
- Automatistmi su crm.lead
""",
'author': "Agile Business Group,Odoo Community Assoc... |
"""Quotas for instances, and floating ips."""
import datetime
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
from oslo_utils import timeutils
import six
from nova import db
from nova import exception
from nova.i18n import _LE
from nova import objects
LOG = logging.get... |
"""The Python implementation of the GRPC helloworld.Greeter server."""
from concurrent import futures
import logging
import grpc
protos, services = grpc.protos_and_services("helloworld.proto")
class Greeter(services.GreeterServicer):
def SayHello(self, request, context):
return protos.HelloReply(message='He... |
import importlib
utils = importlib.import_module("loading.early-hints.resources.utils")
def main(request, response):
utils.store_request_timing_and_headers(request)
headers = [
("Content-Type", "text/javascript"),
("Cache-Control", "max-age=600"),
]
body = "/*empty script*/"
return (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.