src stringlengths 721 1.04M |
|---|
from setuptools import setup
import os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
HISTORY = open(os.path.join(here, 'HISTORY.rst')).read()
version = "1.2.1.dev0"
setup(
version=version,
description="Plugin for ploy to provision virtual machines... |
#!/usr/bin/env python
# dbg-msgHub.py -s "radio" "power/battery"
import argparse
import sys
import pprint
import time
import StringIO
import tHome.util as util
import paho.mqtt.client as mqtt
p = argparse.ArgumentParser( prog=sys.argv[0],
description="Msg Hub debug output" )
p.add_argum... |
"""
Template for Objects
Copy this module up one level and name it as you like, then
use it as a template to create your own Objects.
To make the default commands default to creating objects of your new
type (and also change the "fallback" object used when typeclass
creation fails), change settings.BASE_OBJECT_TYPEC... |
# -*- coding: utf-8 -*-
"""
pyClanSphere.plugins.bulletin_board.database
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Our needed tables are declared here (now)
:copyright: (c) 2009 - 2010 by the pyClanSphere Team,
see AUTHORS for more details.
:license: BSD, see LICENSE for more de... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # Django settings for OMERO.web project. # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#
# Copyright (c) 2008-2014 University of ... |
# Copyright 2016 rpaas authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import json
import os
import datetime
import ipaddress
import base64
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cr... |
"""
Entry point for both the admin and consumer clients. The config file location
is passed in and its contents are used to drive the rest of the client execution.
"""
import errno
from gettext import gettext as _
import logging
import logging.handlers
from optparse import OptionParser
import os
import stat
import sys... |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# 2009 Benny Malengier
#
# 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; ei... |
################################################################################
# #
# Copyright (C) 2010,2011,2012,2013,2014,2015,2016 The ESPResSo project #
# ... |
#!/usr/bin/env python
from basetest import BaseTest
import sys, tempfile
from StringIO import StringIO
import unittest
sys.path.insert(0, '..')
from zeroinstall import alias
expected_script = """#!/bin/sh
exec 0launch 'http://example.com/foo.xml' "$@"
"""
old_script = """#!/bin/sh
if [ "$*" = "--versions" ]; then
... |
#!/usr/bin/env python
###############################################################################
# Copyright (C) 1994 - 2013, Performance Dynamics Company #
# #
# This software is licensed as described in the file COPY... |
from flask import Flask
from flask_restful import Resource, Api
# import json
from facebook import facebook_json
from instagram import instagram_json
from twitter import twitter_json
import requests_cache
import os
# from youtube import youtube_json
# import pdb
app = Flask(__name__)
api = Api(app)
requests_cache.i... |
"""
Django settings for server project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
"""
An Item is a serializable thing that can appear in a Collection
Copyright 2006-2009, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
along with this prog... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 28 13:09:50 2016
MIT License
Copyright (c) 2016 Zeke Barge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without li... |
# -*- coding: utf-8 -*-
#
# Common Logging Parameters and Defaults
#
# Copyright (C) 2015-2017 Chris Caron <lead2gold@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either v... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
#in this file, we mostly add the tag translate=True on existing fields that we now want to be translated
class AccountAccountTag(models.Model):
_inherit = 'account.account.tag'
... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt4 (Qt v4.8.7)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x04\x0a\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x17\x00... |
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
"""pies/overrides.py.
Overrides Python syntax to conform to the Python3 version as much as possible using a '*' import
Copyright (C) 2013 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal ... |
"""
Django settings for cockroach_example project.
Generated by 'django-admin startproject' using Django 2.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
im... |
# Django settings for mysite project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/Users/... |
import functools
from tornado.web import urlparse, urlencode, HTTPError
def permission_required(f):
"""
Returns a decoration that check the current user with given function.
If the user is not logged in, they will be redirected to the configured
`login url <RequestHandler.get_login_url>`.
If th... |
# -*- coding: utf-8 -*-
import re
from openerp import models, api
class Planner(models.Model):
_inherit = 'web.planner'
@api.model
def render(self, template_id, planner_app):
res = super(Planner, self).render(template_id, planner_app)
params = self.env['ir.config_parameter'].get_debrandi... |
import signal
dictionary = {
"HI": "Hello? ?:)",
"GOODMORNING":"It is a great morning.",
"LOVE":"Ok...",
"HATE":"Please don't be negitive.",
"HAPPY":"Maybe",
"?":"Well I dont understand your question",
"HAHA":"What's so funny?",
"YOUR FACE":"Thats not nice.",
"FOOD":"Whats That?",
... |
#!/usr/bin/python
import ctypes as ct
class edf_param_struct(ct.Structure): # this structure contains all the relevant EDF-signal parameters of one signal
_fields_ = [("label_b", ct.c_char*17), # label (name) of the signal, null-terminated string
("smp_in_file", ct.c_longlong), ... |
#
# Copyright (c) 2008--2017 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
# portfolio.py This class represents a portfolio of stocks. It supports optimization
# of assets via a quadratic program.
#
# The following is an example of how the portfolio class may be used to represent a
# portfolio of assets representing major technology companies:
# portfolio = Portfolio(["MSFT","GOOG... |
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Alan W. Irwin
# Polar plot demo.
#
# This file is part of PLplot.
#
# PLplot is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug import urls
from odoo import api, fields, models
from odoo.tools.translate import html_translate
class RecruitmentSource(models.Model):
_inherit = 'hr.recruitment.source'
url = fields.Char(compu... |
# -*- coding: utf-8 -*-
import datetime,xbmc,xbmcplugin,xbmcgui,xbmcaddon,os,re,subprocess,time
from resources.lib.lib import librtmp
librtmp = librtmp()
addon_id = 'plugin.video.migstools'
selfAddon = xbmcaddon.Addon(id=addon_id)
addonfolder = selfAddon.getAddonInfo('path')
if selfAddon.getSetting('auto_update_librt... |
###########################################################################
## PyBot ##
## Copyright (C) 2015, Kyle Repinski ##
## Copyright (C) 2015, Andres Preciado (Glitch) ##
## ... |
import logging
import settings
from tornado.httpclient import AsyncHTTPClient
import cosmos
from cosmos.service.auth import BasicLoginHandler
__author__ = 'Maruf Maniruzzaman'
import tornado
from tornado import gen
import json
from cosmos.service.requesthandler import RequestHandler
class IndexHandler(RequestHan... |
import os
import dateutil.parser
import random
import requests
import logging
import shutil
import subprocess
import ujson
from django.conf import settings
from django.forms.models import model_to_dict
from django.utils.timezone import now as timezone_now
from typing import Any, Dict, List, Set, Tuple
from zerver.mod... |
import unittest
import cunumpy as cn
import numpy as np
import math
import test
class TestTranspose(unittest.TestCase):
def setUp(self):
self.real_veca = [3,4,0,11.,12,15.1,-2.,9.,14.,16.7]
self.real_vecb = [7.0003,4.1,9.7,1.03,1.1210008,1.1500013,-2.9876,9.0002,3005.01,22.000007]
self... |
# -*- coding: utf-8 -*-
"""
HTCAP - beta 1
Author: filippo.cavallarin@wearesegment.com
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 2 of the License, or (at your option) any lat... |
"""Support for HomematicIP Cloud lights."""
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_NAME, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR, Light)
from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice
DEPENDENCIES = ['homematicip_cloud']
... |
'''
Created on 2013-3-20
@author: moon
'''
import Ice, sys, traceback, time, json
Ice.loadSlice('../slice/KafkaProducerClient.ice')
from bfd.kafkaproducerclient import KafkaProducerClientManagerPrx
if __name__ == '__main__':
if len(sys.argv) < 3:
print "wrong args!\nUSAGE: python producer_test.py topic_n... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 EMC Corporation.
# Copyright (c) 2012 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the Lic... |
from __future__ import unicode_literals
from django.db import models
# Create your models here.
# copy nano lib/python2.7/site-packages/pinax_theme_bootstrap folder
class Category(models.Model):
category_name = models.CharField(max_length=100)
category_description = models.TextField()
def __str__(self):
return... |
from django.contrib import admin
#from django.contrib.auth.admin import UserAdmin
from gt.models import *
#from gt.forms import *
# Register your models here.
class KindAdmin(admin.ModelAdmin):
model = Kind
list_display = ['group', 'description']
admin.site.register(Kind, KindAdmin)
class DevAdmin(admin.Mode... |
# flake8: noqa
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'DynamicContentTranslation'
db.create_table... |
# This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import bpy
from sverchok.utils.sv... |
#!/usr/bin/env python
import numpy as np
import cv2
import cv2.cv as cv
from multiprocessing.pool import ThreadPool
from video import create_capture
from common import clock, draw_str
from pyfirmata import Arduino, util
ArduinoPresent = False
if ArduinoPresent :
board = Arduino('/dev/ttyACM0')
#board.digital[2... |
import numpy as np
from scipy.sparse import issparse
from metal.label_model import LabelModel
from metal.label_model.lm_defaults import lm_default_config
from metal.multitask import MTClassifier
from metal.multitask.task_graph import TaskGraph
from metal.utils import recursive_merge_dicts
class MTLabelModel(MTClassi... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 23 13:37:20 2016
@author: jprawiharjo
"""
from cassandra.cluster import Cluster
import cassandra
from collections import namedtuple
from pyleus.storm import SimpleBolt
from Streaming.Doc_Processor import DataFrame
import logging
log = logging.getLogger('cassandra_bolt')
... |
__author__ = 'maru'
__copyright__ = "Copyright 2013, ML Lab"
__version__ = "0.1"
__status__ = "Development"
import sys
import os
sys.path.append(os.path.abspath("."))
from experiment_utils import *
import argparse
from sklearn.datasets.base import Bunch
from sklearn import linear_model
import time
from sklearn imp... |
# Copyright (c) 2015, Matt Layman
from __future__ import print_function
from collections import namedtuple
import os
TAPLine = namedtuple('TAPLine', ['status', 'description', 'directive'])
class Tracker(object):
def __init__(self, outdir=None):
self._test_cases = {}
self.outdir = outdir
... |
"""
Contains the APIs for course credit requirements.
"""
import logging
import uuid
import datetime
import pytz
from django.db import transaction
from util.date_utils import to_timestamp
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from student.models import User
from .except... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# GHeimdall - A small web application for Google Apps SSO service.
# Copyright (C) 2007 SIOS Technology, Inc.
#
# 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 S... |
# -*- coding: utf-8 -*-
"""Parser for Windows NT Registry (REGF) files."""
import logging
from plaso.lib import errors
from plaso.lib import specification
from plaso.parsers import interface
from plaso.parsers import manager
from plaso.winregistry import cache
from plaso.winregistry import registry as winregistry
#... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 28 14:06:45 2014
@author: a1655681
"""
import mtpy.modeling.occam2d as o2d
import mtpy.modeling.pek1dclasses as p1dc
import numpy as np
import os
import os.path as op
import pek2dforward as p2d
import string
import scipy.interpolate as si
import mtpy.utils.filehandling as... |
# This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2018-2019 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
from pony.orm import rollback
from pony.orm import ObjectNotFound
from werkzeug.exceptions import BadRequestKeyErro... |
from requests import get as get_page
from bs4 import BeautifulSoup
import csv
import codecs
import cStringIO
TOPIC = 'chocolate'
def _get_study_url(url):
# Receives the url of a cochrane search result and returns the url for the
# study
result_page = get_page(url)
result_soup = BeautifulSoup(result_... |
#! /usr/bin/env python3
import glob
import os.path
import copy
import sys
def human_size(size):
unit = ''
units = ['KB', 'MB', 'GB', 'TB']
while size > 1024 and len(units) > 0:
size /= 1024
unit = units.pop(0)
return "%.2f %s" % (size, unit)
def write(fname, args):
args_ = args
... |
import gensim
import logging
import os
W2V = gensim.models.Word2Vec
SHAKY_MODEL = '../Models_Shakespeare/'
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
categories = ['comedies', 'histories', 'poetry', 'tragedies']
for category in categories:
model = W2V.load_word2... |
#!/usr/bin/python3
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
path = "/lib/modules/4.4.20-6.gd2e08c5-default/kernel/fs/btrfs/btrfs.ko"
from crash.types.list import list_for_each_entry
import gdb
import uuid
from crash.commands import CrashCommand
class LSBtrfs(CrashCommand):
"""
doc
"""... |
from __future__ import print_function
import mxnet as mx
import sys
sys.path.insert(0, "../../python")
import bisect
import random
import numpy as np
BATCH_SIZE = 1
SEQ_LENGTH = 0
NUM_GPU = 1
def get_label(buf, num_lable):
ret = np.zeros(num_lable)
for i in range(len(buf)):
ret[i] = int(buf[i])
... |
#########################################################################
# Generic database libary using pickle to store values in files.
# Copyright (C) 2016 Carl J Smith
#
# 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
# ... |
#!/usr/bin/env python
# O-QPSK modulation and demodulation.
#
#
# Copyright 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 Foundat... |
"""
Utilities for opening files or URLs in the registered default application
and for sending e-mail using the user's preferred composer.
Taken from the following recipe:
http://code.activestate.com/recipes/511443-cross-platform-startfile-and-mailto-functions/
"""
__version__ = '1.1'
__all__ = ['open', 'mailto']
imp... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Pytest configuration."""
from __future__ import absolute_import, print_function
... |
#!/usr/bin/env python3
#
# Copyright (c) 2015, Nicola Coretti
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# ... |
# coding: utf-8
# import pandas as pd
"""Malloovia interface to LP solver"""
from typing import Sequence, List, Any
from itertools import product as cartesian_product
from inspect import ismethod
from collections import namedtuple
from uuid import uuid4
import os
import pulp # type: ignore
from pulp import (
L... |
"""
Qxf2 Services: Utility script to compare two excel files using openxl module
"""
import openpyxl
import os
class Excel_Compare():
def is_equal(self,xl_actual,xl_expected):
"Method to compare the Actual and Expected xl file"
result_flag = True
if not os.path.exists(xl_actual):
... |
# -*- coding: utf-8 -*-
from mod_base import *
class Status(Command):
"""Get status information of the host running the bot."""
def run(self, win, user, data, caller=None):
items = self.get_items()
strs = []
for item in items:
strs.append( item[0]+":"+str(item[1]) )
... |
from django.conf import settings
from deals.models import Category, Advertiser, NIGERIAN_LOCATIONS, KENYAN_LOCATIONS, ALL_LOCATIONS
class SharedContextMiddleware(object):
"""
Middleware class that injects common data that's needed
when rendering most of view responses into the context
of the templat... |
"""This file is intended to be used as a playground to analyze data pulled
from the database. The code below was used to analyze data from the Tweet200
database, but this is a good place for any sort of extra analysis."""
def count_unique_users(data, n=10000):
u""" Uses blocks of tweets from single users per city.... |
##
#
# Copyright 2012-2013 Ghent University
#
# This file is part of vsc-utils,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (h... |
#!/usr/bin/env python
"""In a OS shell::
python cma_multiplt.py data_file_name
or in a python shell::
import cma_multiplt as lcmaplt
lcmaplt.plot(data_file_name)
"""
# CMA-ES, Covariance Matrix Adaptation Evolution Strategy
# Copyright (c) 2014 Inria
# Author: Emmanuel Benazera <emmanuel.benazer... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... |
#!/usr/bin/env python3
from test_framework.test_framework import ElysiumTestFramework
from test_framework.util import assert_equal
class ElysiumSigmaReorgTest(ElysiumTestFramework):
def run_test(self):
super().run_test()
sigma_start_block = 150
self.nodes[0].generate(sigma_start_block - se... |
# coding: utf-8
from __future__ import absolute_import
from .base_model_ import Model
from datetime import date, datetime
from typing import List, Dict
from ..util import deserialize_model
class PartOfferData(Model):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edi... |
# Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... |
import os
import pytest
from ulauncher.search.shortcuts.ShortcutsDb import ShortcutsDb
class TestShortcutsDb:
@pytest.fixture(autouse=True)
def get_default_shortcuts(self, mocker):
default = mocker.patch('ulauncher.search.shortcuts.ShortcutsDb.get_default_shortcuts')
default.return_value = []... |
# Lazygal, a lazy static web gallery generator.
# Copyright (C) 2007-2012 Alexandre Rossi <alexandre.rossi@gmail.com>
#
# 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 2 of the Li... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""
This module is the main module of the client, and contains
almost all the necessery classes needed to run it.
"""
import Queue
import logging
import optparse
import json
import os
import sys
sys.dont_write_bytecode = True
import network
import logic
def main():
"""The main function of th... |
# -*- coding: utf-8 -*-
import StringIO
import json
import pytest
import voluptuous
from opkg.templates import Template
DUMMY_MANIFEST = {
'name': 'Dummy',
'version': '0.1'
}
def test_template_empty():
"""
We check there is an exception when we do not provide an empty manifest
without a valid json... |
# -*- coding: utf-8 -*-
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 model 'Blog'
db.create_table(u'blog_blog', (
('Id', self.gf('django.db.models.fields.Au... |
# -*- coding: utf-8 -*-
from osv import fields, osv
import ktv_helper
import decimal_precision as dp
class fee_type(osv.osv):
#计费方式定义
#只收包厢费
FEE_TYPE_ONLY_ROOM_FEE = "only_room_fee"
#只收钟点费
FEE_TYPE_ONLY_HOURLY_FEE = "only_hourly_fee"
#包厢费+钟点费
FEE_TYPE_ROOM_FEE_PLUS_HOURLY_FEE = "room_fee_pl... |
# -*- coding: utf-8 -*-
#_____________________________________________________________________________
#
# Copyright (c) 2012 Berlin Institute of Technology
# All rights reserved.
#
# Developed by: Philipp Meier <pmeier82@gmail.com>
# Neural Information Processing Group (NI)
# School for Ele... |
from __future__ import unicode_literals
from .abc import ABCIE
from .abc7news import Abc7NewsIE
from .academicearth import AcademicEarthCourseIE
from .addanime import AddAnimeIE
from .adobetv import AdobeTVIE
from .adultswim import AdultSwimIE
from .aftenposten import AftenpostenIE
from .aftonbladet import Aftonbladet... |
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import collections
import collections.abc
from typing import Any, Callable, DefaultDict, Iterable, List, MutableMapping, Type, TypeVar, Union
_K = TypeVar("_K")
_V = TypeVar("_V")
def f... |
"""
Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... |
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import NotFound
from django.db.models import Q, Count, Subquery, OuterRef, Case, When, Value, CharField, F, IntegerField
from django.db.models.functions import Length, Substr, Coalesce
from django.contrib.contenttypes.mo... |
import unittest2
from .random_samples import \
ReservoirSampler, Reservoir, MultiplexedReservoir
from zounds.timeseries import TimeDimension, Seconds
from zounds.spectral import FrequencyDimension, FrequencyBand, LinearScale
from zounds.core import ArrayWithUnits, IdentityDimension
import numpy as np
class TestRe... |
# This file is part of formunculous.
#
# formunculous 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.
#
# formu... |
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ms2ldaviz.settings_simon")
import django
django.setup()
from basicviz.models import *
if __name__ == '__main__':
other_experiment_name = sys.argv[1]
fs,status = BVFeatureSet.objects.get_or_create(name = 'binned_005')
if status:
print("Crea... |
#!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import pyauto_functional
import pyauto
class ChromeosSecurity(pyauto.PyUITest):
"""Security tests for chrome on ChromeOS... |
#!/usr/bin/env python
# coding=utf8
import logging
from random import randint
from flask import url_for
from wheel.core.db import db
from wheel.core.models.custom_values import HasCustomValue
from wheel.utils.text import abbreviate, slugify
from flask.ext.security import UserMixin, RoleMixin
from flask.ext.security.u... |
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... |
# coding=utf-8
# Copyright 2021 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# Copyright 2017 Panagiotis Ktistakis <panktist@gmail.com>
#
# This file is part of passata.
#
# passata 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) a... |
#! /usr/bin/env python3
"""
This module allows the console to use SSHM's functionality.
This module should only be run by the console!
"""
from __future__ import print_function
import sys
try: # pragma: no cover version specific
from lib import sshm
except ImportError: # pragma: no cover version specific
from... |
# encoding: utf-8
#The information in this module was gleaned from DataLinkHandlers.cs
#https://github.com/richardbunt/Telemachus/blob/master/Telemachus/src/DataLinkHandlers.cs
#Actions are sent to server, result in one action per message
mj_actions = ['mj.smartassoff', # Smart ASS Off
'mj.node', ... |
"""Generic runner functions."""
# from lutris.util.log import logger
__all__ = (
# Native
"linux",
"steam",
"browser",
"web",
# Microsoft based
"wine",
"winesteam",
"dosbox",
# Multi-system
"mame",
"mess",
"mednafen",
"scummvm",
"residualvm",
"libretro",
... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
unified_strdate,
)
class PornotubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?pornotube\.com(/c/(?P<channel>[0-9]+))?(/m/(?P<videoid>[0-9]+))(/(?P<title>.+))$'
_TE... |
#!/usr/bin/env python
#encoding: utf8
import sys, rospy
from pimouse_ros.msg import LightSensorValues
def get_freq():
f = rospy.get_param('lightsensors_freq',10)
try:
if f <= 0.0:
raise Exception()
except:
rospy.logerr("value error: lightsensors_freq")
sys.exit(1)
return f
if __name__ == '__main__':
... |
from .base import BaseStorage, KeyError
import time
import sqlalchemy as sa
from sqlalchemy import types
class Storage(BaseStorage):
def __init__(self, cache_manager, options):
BaseStorage.__init__(self, cache_manager, options)
self.url = options.get('url', 'sqlite:///')
self.tablename = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.