src
stringlengths
721
1.04M
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
from __future__ import print_function, division import decimal import fractions import math import warnings import re as regex from collections import defaultdict from .containers import Tuple from .sympify import converter, sympify, _sympify, SympifyError from .singleton import S, Singleton from .expr import Expr, A...
from setuptools import setup, find_packages setup(name='Appcelerator', version='0.0.0', description="Python version of the Appcelerator web application framework for building fast, dynamic, AJAX based web 2.0 applications.", long_description=""" """, classifiers=[ 'Development S...
from machine import Pin from machine import PWM from machine import ADC from machine import DAC from machine import I2C from machine import Timer from machine import RTC from machine import TouchPad import time from neopixel import NeoPixel def get_brightness(pin = 39): return ADCSensor(pin).read() def get_soundl...
from __future__ import print_function,division import numpy as np import six.moves.cPickle as pickle import theano import theano.tensor as T from theano.tensor.nnet import conv2d from ops import tmax,tmin,tbox from optimize import rmsprop,sgd from theano.tensor.shared_randomstreams import RandomStreams from lmlp import...
from south.db import db from django.db import models from django.db.models import F from mypage.pages.models import * import datetime class Migration: def forwards(self, orm): ''' if not db.dry_run: orm.UserPage.objects.update(site_copy=F('site')) orm.SessionPage.objec...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # heliopy documentation build configuration file, created by # sphinx-quickstart # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals from .base import Client from ..parameters import prepare_grant_uri from ..pa...
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2014 Big Switch Networks, 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/lice...
#---------------------------------------------------------------------- # Copyright (c) 2010-2015 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including ...
# -*- coding: utf-8 -*- # Photini - a simple photo metadata editor. # http://github.com/jim-easterbrook/Photini # Copyright (C) 2012-21 Jim Easterbrook jim@jim-easterbrook.me.uk # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as # p...
# -*- coding: utf-8 -*- { '!=': '!=', '!langcode!': 'es', '!langname!': 'Español', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un ...
############################################################################# ## ## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this f...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.db import models from django.core.validators import MinValueValidator, MaxValueValidator, FileExtensionValidator from imagekit.models import ImageSpecField from model_utils.models im...
# -*- coding: utf-8 -*- import codecs from DbAdapter import DbAdapter from display_dict import display_dict db = DbAdapter(None) # define db connection printable = [] # --------------------------------------------------------------------# # -------------------------- Open file -------------------------# # ----...
from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.utils.translation import ugettext_noop from casexml.apps.case.xml import V2 from corehq import toggles from corehq.apps.domain.decorators import login_or_digest_ex, domain_...
# -*- coding: utf-8 -*- ############################################################################# # # Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
# vim: set fenc=utf8 ts=4 sw=4 et : import json import dict2xml from .autovivification import AutoVivification from .conf import Conf from .utils import call_plugin from .logging import * class Flow(): # The overall frame time newest_overall_frame_time = 0 @staticmethod def get_flow_id(frame): ...
# This file is part of beets. # Copyright 2011, Adrian Sampson. # # 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, copy, ...
import json import os import pstats import shutil import sys import tempfile import unittest from io import StringIO from subprocess import Popen, PIPE from scrapy.utils.test import get_testenv class CmdlineTest(unittest.TestCase): def setUp(self): self.env = get_testenv() self.env['SCRAPY_SETTI...
# Copyright (C) 2014 Johannes Schlatow <johannes.schlatow@googlemail.com> # Copyright (C) 2012 W. Trevor King <wking@tremily.us> # # This file is part of pgp-mime. # # pgp-mime 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 Softwar...
#!/usr/bin/env python from pylab import figure, plot, xlabel, ylabel, title, show, axis, linspace, hold, subplot, grid, step import numpy as np import subprocess import shlex import sys from netCDF4 import Dataset as NC # Setup secpera = 3.15569259747e7 # seconds per year rho_sw = 1028.0 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ IRC servers... """ import src.irc.channelObject import src.utilities as util # NOTE: The logged in users dict loggedInUsers are in this format: # { # 'username': { # 'lastLogin': 'unixtimestamp', # The last time you were logged in # 'failedLoginA...
import os class PluginManager: """ Manages which plugins are loaded. It should be noted that plugins are not objects themselves. A plugin is not an object implemented in this program. The name plugin refers to any Map, Skill, etc. """ BASE_PATH = [""] # BASE_PATH is a list version of the b...
""" Slurp data from Pan-STARRS catalog using the MAST API. A lot of this code has been directly taken from http://ps1images.stsci.edu/ps1_dr2_api.html """ import numpy as np from astropy import units as u,utils as astroutils from astropy.io import fits from astropy.coordinates import SkyCoord, match_coordinates_sky ...
""" Telegram platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.telegram/ """ import io import logging import urllib import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from ho...
from django.test import TestCase from django.http import * from httpstatus import Http301, Http302, Http400, Http403, Http405, Http410 from httpstatus.decorators import postonly, getonly from httpstatus.middleware import HttpStatusErrorsMiddleware class MockRequest: POST = False GET = False class HTTPStatusT...
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
import operator from django.shortcuts import render from django.http import HttpResponse from .models import RecipeList, RecipeIngredient, RecipeContent2, IngredientList from django.db.models import Q import itertools # Create your views here. def search_recipes_form(request): ingredients_name_list = Ingredien...
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Purchasing"), "icon": "fa fa-star", "items": [ { "type": "doctype", "name": "Material Request", "description": _("Request for purchase."), }, { "type": "doctype", "name":...
# -*- coding: utf-8 -*- from south.v2 import DataMigration from core.models import Tenant from core.pdf.conf.fonts import mapping class Migration(DataMigration): def forwards(self, orm): supported_fonts = mapping.keys() for tenant in Tenant.objects(): if tenant.report_settings.font_n...
# tests.random # A visualizer that draws a random scatter plot for testing. # # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Wed Mar 21 17:51:15 2018 -0400 # # ID: random.py [] benjamin@bengfort.com $ """ A visualizer that draws a random scatter plot for testing. """ ########################...
import pygame, sys import pygame.font from pygame.locals import * import logging import fs_menu import helpers as helpers import plugins import os.path import race import hardware import defaults import logging from rainbow_logging_handler import RainbowLoggingHandler DISPLAY_RESOLUTION = (1024, 768) # platform-speci...
# Copyright 2016 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...
#!/usr/bin/env python ############################################################################### # Copyright 2017 The Apollo 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 ...
#!/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...
import numpy as np from scipy.stats import skew, kurtosis, shapiro, pearsonr, ansari, mood, levene, fligner, bartlett, mannwhitneyu from scipy.spatial.distance import braycurtis, canberra, chebyshev, cityblock, correlation, cosine, euclidean, hamming, jaccard, kulsinski, matching, russellrao, sqeuclidean from sklearn.p...
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsProject. .. 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 the License, or (at your option) any later version. """ from b...
### # Copyright (c) 2002-2005, Jeremiah Fincher # Copyright (c) 2009, James McCoy # 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 copyr...
import urllib from calcrepo import info from calcrepo import repo name = "ticalc" url = "http://www.ticalc.org/" enabled = True class TicalcRepository(repo.CalcRepository): def formatDownloadUrl(self, url): return "http://www.ticalc.org" + url def updateRepoIndexes(self, verbose=False): self.printd("Rea...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './Plugins/VcsPlugins/vcsSubversion/SvnUrlSelectionDialog.ui' # # Created: Tue Nov 18 17:53:57 2014 # by: PyQt5 UI code generator 5.3.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets ...
from django import http from django.contrib import auth from django.views.generic.simple import direct_to_template from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import force_unicod...
#------------------------------------------------------------------------------- # Name: Apriori.py # Purpose: Mining Frequent Itemsets # Author: Vasileios Kagklis # Created: 10/02/2014 # Copyright: (c) Vasileios Kagklis #----------------------------------------------------------------------------...
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
# encoding: utf-8 """ cache.py Created by David Farrar on 2012-12-27. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ import unittest import time from exabgp.util.cache import Cache class TestCache (unittest.TestCase): def test_speed (self): class klass1: def __init__ (self, data): pass ...
from pyparsing import * from omelette.compiler.lexer import Lexer from omelette.compiler.uml import * from omelette.compiler import logging def callback(handler): def wrapper(self, s, l, t): handler(self, t) return wrapper class Parser(object): """A class translating code to UMLObjects.""" d...
# Copyright (c) 2011 British Broadcasting Corporation # # 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 ...
import numpy as np import re import random def prepare_data(): """This method prepares input positive and negative datasets as bitvectors for the Rap1 binding problem. Output: three lists of bitvectors, one containing positive samples, negative samples that are similar to positive samples, and negative examples t...
import json import jwt import logging import os import uuid import signal import sys import traceback from tornado import ioloop, web, auth, httpserver, gen, escape, log from tornado.options import options, parse_command_line, define from problem import Problem from contest import Contest from judge import Judge from...
""" Tests of neo.io.neuralynxio.py """ import time import warnings import unittest import numpy as np import quantities as pq from neo.test.iotest.common_io_test import BaseTestIO from neo.core import * from neo.io.neuralynxio import NeuralynxIO from neo import AnalogSignal class CommonNeuralynxIOTest(BaseTestIO...
""" Tests for :attr:`.BaseDefinition.full_name`. There are three kinds of test: #. Test classes derived from :class:`MixinTestFullName`. Child class defines :attr:`.operation` to alter how the api definition instance is created. #. :class:`TestFullDefinedName` is to test combination of ``obj.full_name`` and...
/*Owner & Copyrights: Vance King Saxbe. A.*/""" Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @vsaxb...
""" This module updates the qiprofile database Subject demographics information from the demographics Excel workbook file. """ import re from qirest_client.model.subject import Subject from .xls import Worksheet from . import parse SHEET = 'Demographics' """The input XLS sheet name.""" COL_ATTRS = {'Race': 'races'} ...
#!/usr/bin/env python # pylint: disable=E1101 """ Tests for the modules in the MATLAB package. Each module has doctests for its functions and all we need to do is run all of them. """ import doctest import unittest import numpy as np from pyphysim.extra.MATLAB import python2MATLAB # noinspection PyMethodMayBeSta...
"""Config flow for FAA Delays integration.""" import logging from aiohttp import ClientConnectionError import faadelays import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_ID from homeassistant.helpers import aiohttp_client from .const import DOMAIN # pylint:disabl...
#!/usr/bin/env python # coding: utf-8 """ Copyright 2015 SmartBear Software 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 Unle...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016-2017, Cabral, Juan; Sanchez, Bruno & Berois, Martín # 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 sourc...
#!/usr/bin/env python import argparse import atexit import copy import os import shutil import socket import subprocess import sys import tempfile import warnings try: import django except ImportError as e: raise RuntimeError( 'Django module not found, reference tests/README.rst for instructions.' ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """truck_driver.py A fuzzy driver for a virtual truck. Run `java -jar fuzzy_truck_contest.jar` and click "Iniciar/Reiniciar" to start the socket. Then, run this program and it will try its best to park the truck. * `skfuzzy.defuzz` is the defuzzification function, ...
# Author: Harold Clark # Copyright Harold Clark 2017 # try: import lib.uasyncio as asyncio except ImportError: import uasyncio as asyncio from utime import time import machine from WaterPumps.events import Event class led(object): def __init__(self,ledPin=0, name='Not Defined'): """Init a single co...
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # # URL: https://sickrage.github.io # # 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 ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import six import sys import lupa from ipykernel.kernelapp import IPKernelApp from ipykernel.eventloops import loop_qt5 from jupyter_client.kernelspec import install_kernel_spec from twisted.internet import defer import splash from splash.lua im...
from __future__ import unicode_literals import boto import boto3 from boto.route53.healthcheck import HealthCheck from boto.route53.record import ResourceRecordSets import sure # noqa import uuid import botocore from nose.tools import assert_raises from moto import mock_route53, mock_route53_deprecated @mock_ro...
import pyaudio import wave import time class AudioRecorder(object): '''A recorder class for recording audio to a WAV file. Records in mono by default. ''' def __init__(self, channels=1, rate=44100, frames_per_buffer=1024): self.channels = channels self.rate = rate self.frames_p...
# -*- coding: utf-8 -*- """ scheduler.report ~~~~~~~~~~~~~~~~ Implements automation report Cobra data :author: Feei <feei@feei.cn> :homepage: https://github.com/wufeifei/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2017 Feei. All rights reserved """ i...
from pycp2k.inputsection import InputSection class _each134(InputSection): def __init__(self): InputSection.__init__(self) self.Just_energy = None self.Powell_opt = None self.Qs_scf = None self.Xas_scf = None self.Md = None self.Pint = None self.Meta...
from __future__ import absolute_import from __future__ import unicode_literals import json import logging from math import ceil from requests.exceptions import HTTPError, ConnectionError from pypuppetdb.errors import EmptyResponseError from flask import abort # Python 3 compatibility try: xrange except NameErr...
# TODO: create Exporter class(es) # TODO: break export loops into single item calls with wrapping loop # TODO: allow export to normal file, PK3 being an option (like with open(file_object|path)) import argparse import collections import io import logging import os import sys import zipfile from PIL import Image impo...
# -*- coding: utf-8 -*- # # SonyAPI # External control of Sony Bravia Generation 3 TV's # Copyright (C) 2017 Kevin G. Schlosser # # 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCU...
import xml.etree.cElementTree as ET # that 'c' in "...etree.cElement..." # means the package is a C implementation; it runs 15-20 times faster # than equivalent python implementation import xml.dom.minidom as DOM import shutil import lxml.etree as le import re import itertools from optparse import ...
# -- coding: utf-8 -- # 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 # "Li...
from typing import List, Optional, Tuple from sqlalchemy import func from sqlalchemy.orm import load_only, joinedload from uchan.lib import validation from uchan.lib.cache import cache, cache_key, LocalCache from uchan.lib.database import session from uchan.lib.exceptions import ArgumentError from uchan.lib.model imp...
from datetime import datetime from datetime import timedelta from todoman.cli import cli from todoman.model import Database from todoman.model import Todo def test_priority(tmpdir, runner, create): result = runner.invoke(cli, ["list"], catch_exceptions=False) assert not result.exception assert not result...
# -*- coding: utf-8 -*- from __future__ import absolute_import import diaper import fauxfactory import hashlib import iso8601 import random import re import command import yaml from contextlib import closing from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist from django.core.mail...
#!/usr/bin/env python from __future__ import print_function from platform import system import os, shutil, argparse def input(): try: return raw_input() except NameError: return __builtins__.input() __version__ = '0.2' def main(args): path = os.getcwd() while not args.file: de...
import sys, os sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils def checkpoint_new_category_in_response(): from h2o.estimators.deeplearning import H2ODeepLearningEstimator sv = h2o.upload_file(pyunit_utils.locate("smalldata/iris/setosa_versicolor.csv")) iris = h2o.uplo...
from datetime import datetime from typing import Union from .models.e2b import AttributeValue, Enrollment, Event, EventDataValue, TrackedEntity def date_format_102(dt: datetime) -> str: return dt.strftime("%Y%m%d") def date_format_204(dt: datetime) -> str: return dt.strftime("%Y%m%d%H%M%S") def get_attri...
# yellowbrick.classifier.rocauc # Implements visual ROC/AUC curves for classification evaluation. # # Author: Rebecca Bilbro # Author: Benjamin Bengfort # Author: Neal Humphrey # Created: Tue May 03 18:15:42 2017 -0400 # # Copyright (C) 2016 The scikit-yb developers # For license information, see LICENSE.txt # #...
from mock import call, patch from jirafs.utils import run_command_method_with_kwargs from .base import BaseCommandTestCase class TestPushCommand(BaseCommandTestCase): def setUp(self): super(TestPushCommand, self).setUp() def test_push_no_changes(self): with patch.object(self.ticketfolder.is...
import numpy as np from numpy.random import rand import matplotlib.pyplot as plt def walk_on_lines(r, n, bounds, bound_temp, tol): s = 0 for z in range(n): x = r found = False while not found: L, R = abs(bounds[0] - x), abs(bounds[1] - x) if L < R: ...
import re import bleach import htmllib import htmlentitydefs import formatter from itertools import chain from xmlconst import * DEFAULT_ALLOWED_TAGS = ['i', 'b', 'u'] MULTIPLE_SPACES = re.compile('\s{2,}') BLANK_CHARS = re.compile('[\n\t\r]*') # We support unsyced subs, meaning there is not timing data for them # in...
from __future__ import print_function import pyhuffman.pyhuffman as pyhuffman import os """ A test case, that can also be used as example, about how to generate tree, and encode and decode some text. """ path_to_here = os.path.dirname(os.path.realpath(__file__)) + '/' # path_to_here = '' # functions for generating t...
# Copyright (c) 2017 One Convergence 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 l...
#!/usr/bin/env python3 def offset_string(string, offset): rows=[ "qwertyuiop", "QWERTYUIOP", "asdfghjkl", "ASDFGHJKL", "zxcvbnm", "ZXCVBNM" ] new_string="" for char in string: alphabet=False for row in rows: ...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, _dict from frappe.utils import (flt, getdate, get_first_day, get_last_day, add_months, add_days, formatdate) de...
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import sys import warnings from collections import OrderedDict, deque from django.conf import settings from django.core import exceptions from django.db import ( DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ...
# -*- encoding: utf-8 -*- # A very simple implementation of graphs in python, including graphs # embedded in the plane. class Graph(): """A graph stored as an adjacency dictionary.""" def __init__(self, data=None, vertices=None, edges=None, vertex_labels=None, edge_labels=None): """C...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import json from odoo import models from odoo.http import request import odoo class Http(models.AbstractModel): _inherit = 'ir.http' def webclient_rendering_context(self): return { 'menu_...
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # @package make_ldhatfiles.py # @author Lea Picard, Sebastien RAVEL """ The make_ldhatfiles script ========================== :author: Sebastien Ravel, Lea Picard :contact: sebastien.ravel@cirad.fr :date: 08/07/2016 :version: 0.1 Script description ----------------...
#!/usr/bin python # -*- coding: utf-8 -*- from pyqtgraph import BusyCursor from pyqtgraph.Qt import QtGui import numpy as np from lib.flowchart.nodes.generalNode import NodeWithCtrlWidget, NodeCtrlWidget from lib.functions.general import isNumpyDatetime, isNumpyNumeric from lib.functions.detectpeaks import full_peak_d...
import cardBasics import random class Palace: debug = True playerHand = {} player_6 = {} AIHand = {} AI_6 = {} deckExceptions = { 'Jack' : 11 , 'Queen': 12 , 'King' : 13 , 'Ace' : 14 } deckFunc = cardBasics.Deck(False) discard = [] win = 0 def __init__(self): self.deckFunc.sh...
# # Copyright 2008,2009 Free Software Foundation, Inc. # # This application 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, or (at your option) # any later version. # # This application is di...
import json import re # Regular expression for comments comment_re = re.compile( '(^)?[^\S\n]*/(?:\*(.*?)\*/[^\S\n]*|/[^\n]*)($)?', re.DOTALL | re.MULTILINE ) def parse_json(filename): """ Parse a JSON file First remove comments and then use the json module package Comments look like : ...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon, Christophe Benz # # This file is part of weboob. # # weboob 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 Licen...
""" 2nd-order accurate finite-volume implementation of linear advection with piecewise linear slope reconstruction. We are solving a_t + u a_x = 0 This script defines two classes: -- the Grid1d class that manages a cell-centered grid and holds the data that lives on that grid -- the Simulation class that is...
# encoding: utf-8 from __future__ import unicode_literals import pytest from pymongo.errors import WriteError from marrow.mongo import Field, Index from marrow.mongo.trait import Collection @pytest.fixture def db(request, connection): return connection.test @pytest.fixture def coll(request, db): return db.coll...