src stringlengths 721 1.04M |
|---|
#
# (C) Copyright 2003-2010 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... |
from django.contrib import admin
from django.contrib.contenttypes.generic import GenericTabularInline
from django.forms import ModelForm
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from suit.widgets import *
from pagedown.widgets import AdminPag... |
# -*- coding: utf-8 -*-
"""This is not part of the test suite.
"""
try:
import ketama
except Exception:
ketama = None
from tempfile import NamedTemporaryFile
from time import time
from uhashring import HashRing
num = 1000000
print("running {} key generation comparison".format(num))
# ketama C binding
if ket... |
import datetime
import itertools
from collections import namedtuple
from aioxmpp import JID
from spade.message import Message
from spade.trace import TraceStore, _agent_in_msg
def test_agent_in_msg_sender():
msg = Message(sender="agent@server")
assert _agent_in_msg(JID.fromstr("agent@server"), msg)
def te... |
import setuptools
import pydiff
NAME = 'PyReadableDiff'
DESCRIPTION = 'Intuitive human-readable diff for text'
# Use .rst markup for the long description in order to provide
# the link to the repository, since PyPI doesn't support .md markup,
# so we can't use the content of README.md for this purpose.
LONG_DESCRI... |
# -*- coding: utf-8 -*-
# Copyright (c) 2008--2012 Peter Dinges <pdinges@acm.org>
#
# 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 l... |
""" rewrite of lambdify - This stuff is not stable at all.
It is for internal use in the new plotting module.
It may (will! see the Q'n'A in the source) be rewritten.
It's completely self contained. Especially it does not use lambdarepr.
It does not aim to replace the current lambdify. Most importantly it will never... |
#
# Copyright (C) 2013, 2014, 2015, 2016
# Smithsonian Astrophysical Observatory
#
#
#
# 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 op... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.misc import toimage
from keras.datasets import cifar10
def draw(X):
"""Xは4次元テンソルの画像集合、最初の16枚の画像を描画する"""
assert X.shape[0] >= 16
plt.figure()
pos = 1
for i in range(16):
plt.subplot(4, 4, pos)
img = toimage(X[i])
... |
from stream import plugin
from stream.scrapers import scraper
from stream.ga import tracked
from stream.caching import cached_route
from stream.utils import ensure_fanart
from stream.library import library_context
from stream.utils import url_get
from bs4 import BeautifulSoup
import re
import requests
import json
BASE... |
"""
Copyright 2015 Ricky LeDew
This file is part of Death 87.
Death 87 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 versi... |
from src.freezing import inception
from src.freezing.inception import NodeLookup
import tensorflow as tf
import bson
from tqdm import tqdm
import numpy as np
if __name__ == '__main__':
input_bson_filename = "/data/data/train_example.bson"
node_lookup = NodeLookup()
inception_graph = tf.Graph()
incep... |
from unittest import TextTestResult
class HumanReadableTextTestResult(TextTestResult):
def __init__(self, *args, **kwargs):
super(HumanReadableTextTestResult, self).__init__(*args, **kwargs)
self.last_module = None
self.last_class = None
def human_readable_test_name(self, test):
... |
from datetime import timedelta
from django_nose.tools import assert_equal
from pontoon.base.templatetags.helpers import format_datetime, format_timedelta
from pontoon.base.tests import TestCase
from pontoon.base.utils import aware_datetime
class FormatDatetimeTests(TestCase):
def test_format_datetime_none(self)... |
# Copyright 2021 The TensorFlow Authors. 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/LICENSE-2.0
#
# Unless required by applica... |
# Dots - A braille translation program.
#
# Copyright (C) 2010 Consorcio Fernando de los Rios
# Author: Fernando Herrera <fherrera@onirica.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,... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from collections import OrderedDict
from datetime import datetime
from ddt import ddt
import json
from mock import patch
impor... |
from django.contrib.gis.db import models
from monitor.models import MonitoringTeam
from projects.models import Monitorable
from customforms.models import Form as CustomForm, FormFieldOption
from customforms.models import FormField
import json
class Report(models.Model):
author = models.ForeignKey(MonitoringTeam, re... |
#! /usr/bin/env python
# Copyright (C) 2014 ZhiQiang Fan <aji.zqfan@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 3 of the License, or
# (at your option) any later ... |
import csv
import itertools
import numpy as np
import getopt
from os import path
from os import system
from sys import argv
try:
opts, args = getopt.getopt(argv[1:], 'f:')
except getopt.GetoptError:
print 'GopBitRate.py -f <frame rate> <stats csv>'
print opts
print args
frameRate = 30
for opt, arg in opts:
... |
from .rule_001 import rule_001
from .rule_002 import rule_002
from .rule_003 import rule_003
from .rule_004 import rule_004
from .rule_005 import rule_005
from .rule_006 import rule_006
from .rule_007 import rule_007
from .rule_008 import rule_008
from .rule_009 import rule_009
from .rule_010 import rule_010
from .rul... |
# Copyright 2020 Red Hat, Inc.
#
# 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 agreed to in writing... |
"""
Plugin to read and write FlySpec data.
"""
import calendar
import datetime
import os
import numpy as np
from spectroscopy.dataset import Dataset, Spectra, ResourceIdentifier, Retrievals
from spectroscopy.plugins import DatasetPluginBase
class FlySpecPluginException(Exception):
pass
class FlySpecPlugin(Dat... |
from fun_views.patterns.redirect import redirect_view_pattern
from tests.utils.defaults_for_tests import (default_query_string,
default_response, default_url)
def this_get_url():
return default_url
def this_get_query_string():
return default_query_string
def tes... |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
EventAdmin shell commands
Provides commands to the Pelix shell to work with the EventAdmin service
:author: Thomas Calmant
:copyright: Copyright 2020, Thomas Calmant
:license: Apache License 2.0
:version: 1.0.1
..
Copyright 2020 Thomas Calmant
Licen... |
from tictactoe import game, player
import unittest
from unittest import mock
class GameTest(unittest.TestCase):
def setUp(self):
self.num_of_players = 2
self.width = 3
self.height = 3
self.game = game.Game(2, 3, 3)
def test_init(self):
self.assertEqual(self.game.board,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Testing tools.
from amtk.utils import testcase as unittest
from mock import patch, MagicMock
import StringIO
import datetime
import pytz
import argparse
# To be tested.
from amtk.utils import options, messages, time, misc
class Options(unittest.TestCase):
'''
... |
"""run nose tests on <package-name> with coverage"""
from __future__ import print_function, division
import os
import nose
import importlib
def main():
"""run nose tests with coverage on "<package-name>" where <package-name is ".." dir"""
path = os.path.abspath(os.path.join('..'))
package_name = os.pa... |
# Django
from pom.pages.basePage import BasePage
# local Django
from pom.locators.jobSearchPageLocators import JobSearchPageLocators
from pom.pages.authenticationPage import AuthenticationPage
from pom.pageUrls import PageUrls
class JobSearchPage(BasePage):
job_search_page = PageUrls.job_list_page
def __in... |
import os
import sys
import random
import numpy as np
import tensorflow as tf
import pandas as pd
import itertools
import copy
import math
import scipy.optimize
import matplotlib
matplotlib.use("Agg") # to work without X-window
import matplotlib.pyplot as plt
from DNN_model import *
from Prep_data import *
tf.loggi... |
"""
Geckoboard decorators.
"""
from __future__ import absolute_import
from collections import OrderedDict
from functools import wraps
from hashlib import md5
from xml.dom.minidom import Document
import base64
import json
from Crypto import Random
from Crypto.Cipher import AES
from django.conf import settings
from dja... |
# -*- coding: utf-8 -*-
"""
Cleanup related operations for resetting the Salt environment and removing
a Ceph cluster
"""
from __future__ import absolute_import
import logging
import os
import shutil
import pwd
import grp
import yaml
log = logging.getLogger(__name__)
def configuration():
"""
Purge all the n... |
# libavg - Media Playback Engine.
# Copyright (C) 2003-2011 Ulrich von Zadow
#
# This library 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
# version 2 of the License, or (at your option) any l... |
"""A quick DOM implementation.
Python's xml.dom is very slow. The xml.sax module is also slow (as it imports urllib2).
This is our light-weight version.
"""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from xml.parsers import expat
import zeroinstall
from zer... |
#!/usr/bin/env python
class Solution(object):
def inorder(self, root):
"""
Returns the inorder traversal of nodes in the tree.
"""
current = root
stack = []
inorder = []
while current is not None or len(stack) > 0:
# Traverse to the left most (f... |
# Copyright (c) 2014-2016 Genome Research Ltd.
#
# This file is part of IVA.
#
# IVA 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.
# ... |
import os
import pytest
from tral.repeat import repeat
TEST_MSA_O = ['OCC', 'OOO']
TEST_MSA_K = ['KCC', 'KKK']
TEST_SCORE = "phylo_gap01"
# defaultdict(<class 'int'>, {'pSim': 0.66666666669999997, 'parsimony': 0.66666666669999997,
# 'entropy': 0.66666666666666663, 'phylo': 0.113686756055... |
from Foundation import NSTimer, NSRunLoop
from AppKit import NSApplication, NSStatusBar, NSMenu, NSMenuItem, \
NSEventTrackingRunLoopMode
from .stats import cpu_usage, ram_usage, available_memory, disk_read, \
disk_written, network_recv, network_sent
class Simon(NSApplication):
def finishLaunching(self)... |
#
# === F R O S T B Y T E === ====Decryption Alpha Module====
# By Keith Meifert (2017)
# Licensed under the Creative Commons Attribution 4.0
# If you make a fair amount of money using my code commercially, please consider donating.
#
import random
def frostbyteDec(key,... |
#=========================================#
# IMPORTS #
#=========================================#
from beautiful import *
from random import randint
#=========================================#
# CONFIG #
#=========================================#
#... |
import unittest
import os
if __name__ == '__main__' and __package__ is None:
from os import sys, path
sys.path.append(path.abspath(path.join(__file__, "..", "..")))
from src.LiveUnitTesting import LiveUnitTesting
from src.mocking.MockFileSystem import MockFileSystem
from src.mocking.sublime import MockSublimeV... |
"""
:synopsis: the Django Q&A forum application
Functions in the askbot module perform various
basic actions on behalf of the forum application
"""
import os
import platform
VERSION = (0, 7, 51)
#keys are module names used by python imports,
#values - the package qualifier to use for pip
REQUIREMENTS = {
'akisme... |
#!/usr/bin/python
# Copyright (C) 2012-2018 Reece H. Dunn
#
# This file is part of ucd-tools.
#
# ucd-tools 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 optio... |
#!/bin/python
from __future__ import print_function
from binascii import hexlify
import hashlib
import base64
from getpass import getpass
import sys
import argparse
charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
chameleon_charset = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz123456... |
import alog
import pytest
from mock import PropertyMock, MagicMock, mock
from bitmex_websocket import Instrument
from bitmex_websocket._instrument import SubscribeToAtLeastOneChannelException, \
SubscribeToSecureChannelException
from bitmex_websocket.constants import Channels, SecureChannels, \
SecureInstrumen... |
# -*- 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):
# Changing field 'Subscription.name'
db.alter_column(u'core_subscription... |
import threading
from werkzeug.exceptions import HTTPException
from werkzeug.routing import Map, MapAdapter
from werkzeug.wrappers import Request
from wiring import (
Factory,
Graph,
IScope,
Module,
implements,
inject,
provides,
scope
)
from guestbook.response import LazyResponse
cla... |
from sqlalchemy import *
from migrate import *
import datetime
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
job_ad = Table('job_ad', pre_meta,
Column('hash', VARCHAR, primary_key=True, nullable=False),
Column('date', TIMESTAMP),
Column('jobAdText', TEXT),
Column('m... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009-2010 CloudSizzle Team
#
# 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 limitation the rights to use,
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import glob
import os
import sys
from . import Command
from .server import main
from openerp.modules.module import get_module_root, MANIFEST
from openerp.service.db import _create_empty_database, DatabaseExists
class Start(Command):
"""Quick start the... |
# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
from openerp.tools.translate import _
import logging
from datetime import datetime
from openerp.osv.fields import datetime as datetime_field
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT
from unidecode import unidecode
i... |
"""
Installs and configures an OpenStack Client
"""
import logging
from packstack.installer import validators
from packstack.installer import basedefs, output_messages
from packstack.installer import utils
from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile
# Controller object will b... |
'''
Small Example application of GPTwoSample
========================================
Please run script "generateToyExampleFiles.py" to generate Toy Data.
This Example shows how to apply GPTwoSample to toy data, generated above.
Created on Feb 25, 2011
@author: Max Zwiessele, Oliver Stegle
'''
from gptwosample.data... |
# -*- coding: utf-8 -*-
# Mathmaker Lib offers lualatex-printable mathematical objects.
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker Lib.
# Mathmaker Lib is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... |
# Copyright (c) 2010-2011,2013 Turbulenz Limited
import logging
import time
import os.path
from pylons import response
from pylons.controllers.util import abort
from turbulenz_local.decorators import jsonify
from turbulenz_local.controllers import BaseController
from turbulenz_local.models.metrics import MetricsSess... |
from pyramid.security import remember, forget, unauthenticated_userid
from pyramid.httpexceptions import HTTPMethodNotAllowed, HTTPFound
from .utils import get_upwork_client
class BaseHandler(object):
"""Base handler with ACL management.
Inherit and define the desired methods,
then register views and se... |
#!/usr/bin/env python3
# This sample demonstrates how to use various POST /custom_actions/ endpoints
# available REST API.
#
# WARNING: This sample makes changes to the QRadar system and it is
# recommended that it is not run against a production system.
#
# This script can be run once as custom actions require their n... |
from collections import namedtuple
import taxcalc
import dropq
import os
import requests
from requests.exceptions import Timeout, RequestException
import json
import pandas as pd
import time
#
# Prepare user params to send to DropQ/Taxcalc
#
NUM_BUDGET_YEARS = int(os.environ.get('NUM_BUDGET_YEARS', 10))
START_YEAR =... |
#code to mining the urls from google and save it to local .txt files
# using patter. to search from Google
# I integrated all files in one single file after the feedback
# Using functions and readable documents
from pattern.web import Google
import indicoio
indicoio.config.api_key = '8d05933c4c2ca769d1e064dfbea1fe8a'
... |
r"""
monica is a command line chef that brings you tasty food
Usage:
monica surprise
monica restaurant <restaurant-id>
monica search [QUERY ...]
monica reviews <restaurant-id>
monica budget <budget>
monica cuisine (<cuisine-id>| list)
monica configure
monica (-h |--help)
monica
Options:
-h --help ... |
#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 19.03.2019 15:39
:Licence MIT
Part of grammpy
"""
from grammpy import *
from grammpy.transforms import ContextFree, InverseContextFree, InverseCommon
from grammpy.parsers import cyk
# Terminals
class PlusOperator(Terminal): pass
class MinusOperator(Terminal)... |
import os.path
import pytest
from pre_commit.languages import r
from testing.fixtures import make_config_from_repo
from testing.fixtures import make_repo
from tests.repository_test import _get_hook_no_install
def _test_r_parsing(
tempdir_factory,
store,
hook_id,
expected_hook_expr={},
expected_a... |
from django import forms
from django.contrib import admin
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/]+$',
help_text = _("Exam... |
from cloudaux.aws.sqs import get_queue_url, get_queue_attributes, list_queue_tags, list_dead_letter_source_queues
from cloudaux.decorators import modify_output
from flagpole import FlagRegistry, Flags
import logging
from cloudaux.orchestration.aws import ARN
logger = logging.getLogger('cloudaux')
registry = FlagReg... |
import unittest
from helpers.sit_helper import SITHelper
class SitHelperTest(unittest.TestCase):
def setUp(self):
self.sit_helper = SITHelper('tests/helpers/configs')
self.sit_helper_empty = SITHelper('tests/helpers/empty_configs')
def test_get_custom_user_data(self):
self.assertEqu... |
from __future__ import division, print_function
import numpy as np
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
mod = SourceModule("""
#include <stdio.h>
/*
Cumpute the enery coming from one blob potentials,
e.g. gravity or interactions with the wall.
In this ex... |
from yowsup.config.v1.config import Config
from yowsup.config.transforms.dict_keyval import DictKeyValTransform
from yowsup.config.transforms.dict_json import DictJsonTransform
from yowsup.config.v1.serialize import ConfigSerialize
from yowsup.common.tools import StorageTools
import logging
import os
logger = logging.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import os.path
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
def read(fname):
with open(fname... |
# -*- coding: utf-8 -*-
# Copyright 2015 Florenz A. P. Hollebrandse
#
# 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 a... |
#!/usr/bin/env python
# Copyright 2013-2017 DataStax, Inc.
#
# 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 la... |
#!/usr/bin/env python
"""
Copyright (C) 2013 Digium, Inc.
Erin Spiceland <espiceland@digium.com>
See http://www.asterisk.org for more information about
the Asterisk project. Please do not directly contact
any of the maintainers of this project for assistance;
the project provides a web site, mailing lists and IRC
cha... |
# (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 version 3 of the License, or
# (at your option) any l... |
""" General purpose util classes and functions """
__author__ = 'Adam R. Smith, Michael Meisinger'
import collections
import datetime
import importlib
import string
import time
import simplejson
import base64
import uuid
import os
import re
from types import NoneType
from copy import deepcopy
DICT_LOCKING_ATTR = "__... |
from django import forms
from django.contrib.comments.forms import CommentSecurityForm, CommentForm
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.forms import Html5Mixin
from mezzanine.generic.models import... |
# -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio 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 versio... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
# Copyright 2020 Google LLC
#
# 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 agreed to in writing, s... |
from otto.lib.compute import average, standard_dev
from otto.lib.otypes import ReturnCode
from otto.lib.solaris import release_parse
from otto.utils import timefmt
def cmp_aoestat_devices(a, d):
# if a.device != d.device or a.size != d.size:
if a.size != d.size:
return ReturnCode(False, 'aoestat %s do... |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
PFLog: OpenBSD PF packet filter logging.
"""
from scapy.packet import *
from scapy.fields import *
from scapy.layers... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... |
# Copyright 2010 the Melange 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 agreed to in wr... |
import datetime
from pandaserver.taskbuffer.TaskBuffer import taskBuffer
from pandacommon.pandalogger.PandaLogger import PandaLogger
from pandacommon.pandalogger.LogWrapper import LogWrapper
from pandaserver.brokerage.SiteMapper import SiteMapper
from pandaserver.taskbuffer import ErrorCode
# password
from pandaserver... |
import codecs;
import re;
import sys;
import Data;
import Parser;
import Service;
import Station;
# fix Python2's bad range() function
try:
range = xrange;
except NameError:
pass;
def tryint(s):
try:
return int(s)
except:
return s
def alphanum_key(s):
""" Turn a string into a list of... |
# "Copyright (c) 2000-2003 The Regents of the University of California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written agreement
# is hereby granted, provided that the above copyright notice, the follow... |
import json
from ..compatpatch import ClientCompatPatch
class CollectionsEndpointsMixin(object):
"""For endpoints in related to collections functionality."""
def list_collections(self):
return self._call_api('collections/list/')
def collection_feed(self, collection_id, **kwargs):
"""
... |
import numpy as np
from metric import metric_decorated
from statistical_metric import StatisticalMetric
from pymetrics.unit.timeunit import now
time_key = 'time'
value_key = 'value'
class Histogram(StatisticalMetric):
time_series_dtype = np.dtype([
(time_key, float),
(value_key, float),
])
... |
import unittest
from mock import Mock
import os
from katello.tests.core.action_test_utils import CLIOptionTestCase,\
CLIActionTestCase
from katello.tests.core.content_view_definition import content_view_definition_data
from katello.tests.core.organization import organization_data
from katello.tests.core.repo i... |
# Copyright 2019 Google LLC
#
# 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 agreed to in writing, ... |
# -*- coding: utf-8 -*-
from osv import osv,fields
from room import room
class room_operate(osv.osv):
'''
包厢操作类:
以下操作都属于包厢操作:
1 预定
2 正常开房
3 买钟
4 买断
5 续钟
6 退钟
7 换房
8 并房
包厢通过cur_room_operate_id与room_operate相关联,用于标示当前包厢所对应的操作
room_operate与以上各个操作是one2many的关系,这样通过一个room_o... |
# coding=utf-8
__author__ = "Arnaud KOPP"
__copyright__ = "© 2015-2016 KOPP Arnaud All Rights Reserved"
__credits__ = ["KOPP Arnaud"]
__license__ = "GNU GPL V3.0"
__maintainer__ = "Arnaud KOPP"
__email__ = "kopp.arnaud@gmail.com"
__status__ = "Production"
from collections import OrderedDict
import logging
import panda... |
# Copyright 2021 Google LLC
#
# 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 agreed to in writing, ... |
#!/usr/bin/env python3
"""Integration test for onprem DC/OS upgraded from latest stable.
The following environment variables control test procedure:
MASTERS: integer (default=3)
The number of masters to create from a newly created VPC.
AGENTS: integer (default=2)
The number of agents to create from a newly c... |
# -*- encoding: utf8 -*-
import json
from twisted.internet import defer
from cyclone import web
from oonib.bouncer.api import bouncerAPI
from oonib.test.handler_helpers import HandlerTestCase
fake_bouncer_file = """
collector:
fake_address:
policy:
input:
- {id: fake_id}
nettest:
- {na... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import domoticz as d
import sys
import time
sys.path.insert(0, '/opt/python-verisure/')
import verisure
import pickle
import pytz
import urllib3
import certifi
from datetime import datetime
from tzlocal import get_localzone
debug = False
try:
execfile("/etc/domoticz/scrip... |
"""
Test SAMS analysis code.
"""
__author__ = 'John D. Chodera'
################################################################################
# IMPORTS
################################################################################
from simtk import openmm, unit
from simtk.openmm import app
import os, os.path
i... |
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... |
from __future__ import absolute_import, division, unicode_literals
from future.builtins import int, open, str
from hashlib import md5
import os
try:
from urllib.parse import quote, unquote
except ImportError:
from urllib import quote, unquote
from django.contrib import admin
from django.contrib.auth import RE... |
from __future__ import print_function, division
from sympy import Symbol, S
from sympy.assumptions.ask_generated import get_all_known_facts
from sympy.assumptions.assume import global_assumptions, AppliedPredicate
from sympy.assumptions.sathandlers import fact_registry
from sympy.core import oo
from sympy.logic.infere... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.