src
stringlengths
721
1.04M
#!/usr/bin/env python # coding: utf-8 """ Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a player picks a number, that number will not be available for the next player. This continu...
# Author: Mr_Orange <mr_orange@hotmail.it> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 Lic...
from django.db import models class IntegerListField(models.Field): """ IntegerListField keeps a list of int as a comma-separated string. >>> g = IntegerListField() >>> g.get_db_prep_value([1,2,-1,20,30,40,-100]) '1,2,-1,20,30,40,-100' >>> g.to_python('1,2,-10,3,4,-100,7') [1,2,-10,3,4,-10...
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # 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 t...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Game', fields=[ ('id', models.AutoField(verbose...
import numpy from numpy import array, sin, cos __all__ = [ 'Equatorial2Cartesian', 'Rotation3D', 'rotation_matrix_3d' ] class Equatorial2Cartesian(): def __init__(self, RA_0, Dec_0, D_0): self.RA_0 = RA_0 self.Dec_0 = Dec_0 self.D_0 = D_0 def fit(self, X, y=None): ...
# -*- coding: utf-8 -*- """ *************************************************************************** OutputNumber.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************************...
# SyPy: A Python framework for evaluating graph-based Sybil detection # algorithms in social and information networks. # # Copyright (C) 2013 Yazan Boshmaf # # 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 # ...
""" setuptools installer for exim_ses_transport """ # Copyright 2011, Jayson Vantuyl <jvantuyl@gmail.com> # # This file is part of exim_ses_transport. # # exim_ses_transport 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 S...
#!/usr/bin/python3 import sys from pathlib import Path list_scope_path = Path("./list_scope_tokens.txt") keyword_bit = 13 list_scope_bit = 14 def main(): if len(sys.argv) < 2: print("Error: Must specify an argument of either 'tokens' or 'emitters'!", file=sys.stderr) return 1 list_scopes = set() with list_s...
# 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 ...
# Orca # # Copyright (C) 2010-2011 The Orca Team # # Author: Joanmarie Diggs <joanmarie.diggs@gmail.com> # # 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.1 of the Lice...
# Copyright 2012 OpenStack Foundation # # 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...
import numbers import numpy as np import pandas as pd import scprep from scipy import sparse try: import anndata except (ImportError, SyntaxError): # anndata not installed pass def check_positive(**params): """Check that parameters are positive as expected Raises ------ ValueError : unac...
import os, inspect, config from functools import wraps from flask import ( request, g, session, url_for, redirect ) from flask_oauthlib.client import OAuth from melete.models import * app = inspect.getmodule(inspect.stack()[1][0]).app oauth = OAuth(app) def login_required(f): @wraps(f) de...
#!/usr/bin/env python3 # Copyright 2018 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. """Tests for extract_sqlite_api.py. These tests should be getting picked up by the PRESUBMIT.py in this directory. """ from importli...
#!/usr/bin/env python # encoding: utf-8 from crew.worker import Listener, Context, NODE_UUID, UUID from pika import PlainCredentials from crew.worker import context import logging import docker import docker.tls import lumper.worker def run(args): log = logging.getLogger("main") if args.docker_tls: t...
# fileobjscan.py # Copyright 2009 Andreas Schuster <a.schuster@yendor.net> # Copyright (C) 2009-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 Softwa...
# The MIT License (MIT) # Copyright (c) 2014-2017 University of Bristol # # 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...
# # ovirt-setup-lib -- ovirt setup library # Copyright (C) 2015 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 req...
# Copyright 2018 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...
# encoding: 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 'NewsletterSettings' db.create_table('localtv_newslettersettings', ( ('id', se...
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2012 Douglas S. Blank <doug.blank@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 Lice...
# -*- coding: utf-8 -*- """ This module provides a DOLFINErrorControlGenerator for handling UFL forms defined over DOLFIN objects. """ # Copyright (C) 2011 Marie E. Rognes # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General ...
# -*- coding: utf-8 -*- # # IBM model 1 with alignment type implementation of HMM Aligner # Simon Fraser University # NLP Lab # # This is the implementation of IBM model 1 word aligner with alignment type. # from collections import defaultdict from loggers import logging from models.IBM1Base import AlignmentModelBase ...
# Copyright 2015 Brocade Communications Systems, Inc. # 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 # ...
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
import pygame from pygame.locals import * import math import random import magic class All(): DebugBool = False DebugV = [0,0] isHold = False isOccupied = False processable = True def Draw(self): playerrot = pygame.transform.rotate(self.image ,self.rot) playerpos1 = (self.pos...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-24 00:44 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migration...
# # 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, software # ...
#!/usr/bin/env python """ Copyright (C) 2016/2017 The University of Leeds and Rafael Papallas. 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...
# 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, software # distributed under the...
"""3.0 : Migrate task lines Revision ID: 2192101f133b Revises: 465776bbb019 Create Date: 2015-06-29 11:57:26.726124 """ # revision identifiers, used by Alembic. revision = '2192101f133b' down_revision = '36b1d9c38c43' from alembic import op import sqlalchemy as sa def upgrade(): from autonomie.models.task imp...
#!/usr/bin/env python # # Search for missing @xml:space import lxml.etree import faust ignored_tags = ( "app", "back", "body", "choice", "div", "docTitle", "fix", "front", "fw", "g", "group", "lg", "overw", "patch", "sp", "subst", "surface", "text", "titlePage", "titlePart", "used", "zone") ignored_empty_elem...
#!/usr/bin/env python import bleach from bs4 import BeautifulSoup from collections import OrderedDict from dateutil import parser import regex import requests import scraperwiki import urlparse class Page: def __init__(self, path, basename, encoding): self.path = path self.basename = basename ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Fungiform ~~~~~~~~~ A form handling system that previously was used for Pocoo's Zine and Plurk's Solace software. Unbundled into a separate library that is framework independent. This is still a preview release. Check the source for more info...
# Authors: # Nathaniel McCallum <npmccallum@redhat.com> # # Copyright (C) 2014 Red Hat # see file 'COPYING' for use and warranty information # # 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, ...
# UrbanFootprint v1.5 # Copyright (C) 2017 Calthorpe Analytics # # This file is part of UrbanFootprint version 1.5 # # UrbanFootprint is distributed under the terms of the GNU General # Public License version 3, as published by the Free Software Foundation. This # code is distributed WITHOUT ANY WARRANTY, without impl...
# 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...
# -*- test-case-name: axiom.test.test_attributes -*- import random from decimal import Decimal from epsilon.extime import Time from twisted.trial.unittest import TestCase from twisted.python.reflect import qual from axiom.store import Store from axiom.item import Item, normalize, Placeholder from axiom.attributes ...
#!/bin/env python import os, sys, traceback def _genAll(verbose=1): from reportlab.lib.testutils import setOutDir setOutDir(__name__) from reportlab.lib.testutils import testsFolder topDir=os.path.dirname(testsFolder) L = [os.path.join(topDir,f) for f in ( 'docs/reference/genrefe...
import json from django.contrib.auth import logout, login, authenticate from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.http import HttpResponse from django.db.models import Q, Count from django.views.generic import ( FormView, CreateView, RedirectView, DetailVie...
from pytest import fixture from pygiftgrab import Codec, ColourSpace def pytest_addoption(parser): parser.addoption('--colour-space', action='store', type=str, required=True, help='Colour space specification (BGRA or I420)') parser.addoption('--filepath', action='store', type=str, require...
''' urlresolver XBMC Addon Copyright (C) 2016 Gujal 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 program is di...
#!/usr/bin/python # Copyright (c) 2007 Randal Barlow <im.tehk at gmail.com> # 2008-2009 Michal Hruby <michal.mhr at gmail.com> # # 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 Foundat...
# -------------------------------------------------------- # TensorFlow @ Dragon # Copyright(c) 2017 SeetaTech # Written by Ting Pan # -------------------------------------------------------- __all__ = [ 'expand_dims', 'shape', 'zeros', 'ones', 'placeholder', 'concat', 'transpose', 'til...
# # Copyright (C) 2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be...
""" Copyright (c) 2015 Marshall Farrier license http://opensource.org/licenses/MIT """ import unittest import pynance as pn class TestData(unittest.TestCase): def setUp(self): # from McMillan, pp. 44f. self.args = (43, 3, 45, 500, 40, 15, 1) def test_get(self): df = pn.opt.covcall.g...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from io import open from os import makedirs, urandom from os.path import join, exists from shutil import rmtree from tempfile import mkdtemp from rst2html5slides import SlideWriter from docutils.core import publish_file, publish_string presen...
import time import servo_process as sp class Arm: def __init__(self): self.spoon_status = 'empty' self.leg_status = 'retracted' def init(self): self.sp = sp.ServoProcess() self.sp.start() def is_initialized(self): return self.sp.initialized.value def update(se...
# This file is part of Essential Editor Research Project (EERP) # # EERP 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. # # EERP is di...
# -*- coding: utf-8 -*- # pylint: disable-msg=C0103 """ Created on Thu Oct 17 13:15:52 2013 This module provides the functionality to obtain basic primitive structures, called "peaks", from a signal fragment and its corresponding simplification using the Douglas-Peucker algorithm. The process is based on the paper: "...
from typing import Callable, Optional, Union from django.core.exceptions import ImproperlyConfigured from django.db import connections from django.db.models import Model from django.db.models.base import ModelBase from django.db.models.query import QuerySet from psqlextra.type_assertions import is_query_set, is_sql, ...
# # Copyright 2015 Quantopian, 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 writin...
from abc import ABCMeta, abstractmethod import colorama import random import json from eventlet.greenthread import sleep from eventlet.timeout import Timeout from eventlet.queue import * import six import time from .. import LOG as _LOG from ..signal.signal import EventBase, ActionBase from .digestible import Digesti...
# vi: ts=4 expandtab # # Copyright (C) 2009-2011 Canonical Ltd. # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # # This program is free software: you can redistribute it and/or modify # ...
#!/usr/bin/python3 # Helper script to create and publish a new python-chess release. import os import chess import sys import zipfile import textwrap import configparser import requests import bs4 def system(command): if 0 != os.system(command): sys.exit(1) def check_git(): print("--- CHECK GIT ---...
# -*- coding: utf-8 -*- # Copyright 2014 Foxdog Studios # # 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 l...
from __future__ import with_statement import os import sys import six import numpy as np from pyresample import geometry, kd_tree, utils from pyresample.test.utils import catch_warnings if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest class Test(unittest.TestCase): @cl...
# -*- coding: utf-8 -*- """Public section, including homepage and signup.""" from flask import ( Blueprint, current_app, flash, redirect, render_template, request, url_for, ) from flask_login import login_required, login_user, logout_user from eoghanbkeegan.extensions import login_manager f...
# fbdata.fields # DJANGO from django.db import models from django.utils import six # SOUTH from south.modelsinspector import add_introspection_rules class IntegerListField(models.Field): description = "Integer List" __metaclass__ = models.SubfieldBase def __init__(self, *args, **kwargs): k...
<<<<<<< HEAD <<<<<<< HEAD import os import sys import unittest here = os.path.dirname(__file__) loader = unittest.defaultTestLoader def load_tests(*args): suite = unittest.TestSuite() for fn in os.listdir(here): if fn.startswith("test") and fn.endswith(".py"): modname = "unittest.test.tes...
# -*- encoding:utf-8 -*- import os import sys import logging from copy import deepcopy from matplotlib import pyplot as plt import numpy as np from sklearn.model_selection import train_test_split reload(sys) def drawModulation(dirpath, rownum=200): """信号文件绘图 :param filepath: 需要显示绘图的信号文件路径 :return: None ...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
# -*- coding:utf-8 -*- # ---------------------------------------------------------------------- # Copyright 2017 Juergen Probst # # This file is part of pyMPB. # # pyMPB 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 Fou...
# Note: model title and parameter table are inserted automatically r""" Calculates the interparticle structure factor for a hard sphere fluid with a narrow, attractive, square well potential. **The Mean Spherical Approximation (MSA) closure relationship is used, but it is not the most appropriate closure for an attract...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.conf import settings try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User def get_user_model(): return User cl...
# Copyright 2018 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...
from django.conf import settings from django.conf.urls import include, url from django.views.decorators.cache import never_cache from mozilla_django_oidc.views import OIDCAuthenticationCallbackView import kitsune.flagit.views from kitsune.sumo.views import redirect_to from kitsune.users import api, views from kitsune...
from pygoogle import pygoogle import subprocess import time import sys import os.path import unicodedata import glob import shutil from couchpotato.core.providers.trailer.base import VFTrailerProvider from couchpotato.core.helpers.variable import mergeDicts, getTitle from couchpotato.core.logger import CPLog log = CPLo...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: bigip_profile_fastl4 sh...
#!/usr/bin/env python3 """Generate amplicon report.""" import argparse import csv import re import subprocess DECIMALS = 2 # Decimal precision when presenting results: parser = argparse.ArgumentParser(description="Fill data into tex template file.") parser.add_argument("--sample", help="Sample name.") parser.add_arg...
# 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 may ...
""" Copyright 2012 Ali Ok (aliokATapacheDOTorg) 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...
# -*- coding: utf-8 -*- """Tests for cookiecutter's output directory customization feature.""" import pytest from cookiecutter import main @pytest.fixture def context(): """Fixture to return a valid context as known from a cookiecutter.json.""" return { u'cookiecutter': { u'email': u'ra...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011-2012 OpenStack Foundation # 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....
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function from bs4 import BeautifulSoup import frappe import frappe.share import frappe.defaults import frappe.permissions from frappe.model.document import Document from ...
# -*- coding: utf-8 -*- import threading import logging import time import select import socket import ssl import struct from .errors import * from .constants import * from . import users from . import channels from . import blobs from . import commands from . import callbacks from . import tools from . import soundou...
""" Django settings for fe_sm_00 project. Generated by 'django-admin startproject' using Django 1.8.1. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('core', '0009_delete_awsconfig'), ] operations = [ migrations.AddField(...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' CNB Matrix Module - chuckkukdo ''' from cnb.cnbMatrixModule import CNBMatrixModule class CNBMMChuckKukDo(CNBMatrixModule): """ """ name = 'chuckkukdo' usage = 'chuckkukdo' desc = 'Print the Chuck Kuk Do (http://en.wikipedia.org/wiki/Chun_Kuk_Do)' ...
# -*- coding: utf-8 -*- from Components.Task import Task, Job, job_manager, AbortedPostcondition, ReturncodePostcondition from Tools.Directories import fileExists, shellquote from Components.MovieList import MOVIE_EXTENSIONS from enigma import eTimer import os ALL_MOVIE_EXTENSIONS = MOVIE_EXTENSIONS.union((".ts",)) c...
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
__author__ = 'Greg' from protorpc import messages from protorpc import message_types from models import * """ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - """ """ Default values for a new conference. Used only if the user creating the conference doesn't supply values for a given field and only fie...
#!/usr/bin/env python # print info to check we link with witch version of blas # test the speed of the blas gemm fct: # C=a*C+dot(A,B)*b # A,B,C matrix # a,b scalar from __future__ import absolute_import, print_function, division import os import sys import time from optparse import OptionParser import subprocess im...
from effectgroup import EffectGroup from effectdescriptions import EffectDescriptions from myutils import Utils def generateFile(fileName,ledCount,effectGroups): f = open(fileName,'w') f.write("#ifndef H_SONG_INSTRUCTIONS\n#define H_SONG_INSTRUCTIONS\n#include \"avr/pgmspace.h\"\n#include \"song_instructions.h\"\nco...
# coding=UTF-8 #------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v3 # For more information, see the COPYING file in the top CxxTest directory. # Unde...
# -*- coding: utf-8 -*- ################################################################################# # EXTERNAL LAYMAN TESTS ################################################################################# # File: external.py # # Runs external (non-doctest) test cases. # # Copyright: # ...
#!/usr/bin/env python # coding: utf '''Dumb jumping balls''' import pygame import random import sys if sys.version_info[0]>2: xrange = range SIZE = 640, 480 def intn(*arg): '''Return list of ints from arg tuple''' return tuple(map(int,arg)) def Init(sz): '''Turn PyGame on''' global screen, scre...
from flask import jsonify, json from flask import render_template, session, redirect, url_for, current_app, request from .. import db from ..models import Doc, DataSrc from . import doc from pymongo import MongoClient #add a new doc without content @doc.route('/doc/add', methods=['POST']) def newDataSrc(): data = jso...
# Copyright (C) 2010-2012 Red Hat, Inc. # This work is licensed under the GNU GPLv2 or later. import libvirt import os from libvirt import libvirtError required_params = ('ifacename',) optional_params = {} def check_undefine_interface(ifacename): """Check undefining interface result, if undefine interface is su...
# -*- coding:utf-8 -*- from report import report_sxw from tools.translate import _ import rml_parse import time class rainsoft_saleout_report(rml_parse.rml_parse): def __init__(self,cr,uid,name,context): super(rainsoft_saleout_report, self).__init__(cr, uid, name, context) self.localcontext.update({ ...
""" Determine function execution time. >>> def f(): ... return sum(range(10)) ... >>> pytime(f) (Time to execute function f, including function call overhead). >>> 1.0/pytime(f) (Function calls/sec, including function call overhead). >>> 1.0/pytime_statement('sum(range(10))') (Statements/sec, does not include...
""" gepify.providers.songs ~~~~~~~~~~~~~~~~~~~~~~ Provides information about downloaded songs as well as functionality to download songs. """ import os from werkzeug.contrib.cache import RedisCache from gepify.celery import celery_app from celery.utils.log import get_task_logger from . import youtube...
# -*- coding: utf-8 -*- # Copyright (C) 2013 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from datetime import datetime from unicodedata import normalize from odoo.exceptions import Warning as UserError from odoo.tools.translate import _ from odoo.addons.l10n_br_account.sp...
import csv import gzip import hashlib import json import logging import os import tempfile import xlrd from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_exempt from settings import API_LOGIN_REQUIRED_URL from seqr.views.utils.json_utils import create_json_respons...
from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models from model_utils.managers import PassThroughManager from .managers import O2OTagQuerySet class O2OTag(models.Model): # The object that is tagging tagger_content_type = mode...
""" InaSAFE Disaster risk assessment tool developed by AusAid - **Row** Contact : ole.moller.nielsen@gmail.com .. note:: 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...
#! /usr/bin/env python """A Python debugger.""" # (See pdb.doc for documentation.) import sys import linecache import cmd import bdb from repr import Repr import os import re import pprint import traceback # jrh - begin from converters import file_to_texture from view import draw_source, set_scene # jrh - end class...
# wireproto.py - generic wire protocol support functions # # Copyright 2005-2010 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import hashlib import itertool...