src
stringlengths
721
1.04M
from parsimonious import NodeVisitor, Grammar, VisitationError from . import grammars from . import nodes from .exceptions import OutOfContextNodeError class TextOnlySymlParser(NodeVisitor): grammar = Grammar(grammars.text_only_syml_grammar) def reduce_children(self, children): children = [c for c i...
import unittest import os from res.test import ErtTestContext from tests import ResTest from res.enkf import RunpathList, RunpathNode, ErtRunContext from res.enkf.enums import EnkfInitModeEnum,EnkfRunType from ecl.util.util import BoolVector from res.util.substitution_list import SubstitutionList class RunpathList...
#!/usr/bin/env python # # This program shows how to write data to mplay by writing data to the # imdisplay program using a pipe. # # This program uses the -k option on imdisplay to perform progressive # refinement when rendering an image. The image is quite simple. # # Notes: # This uses the simple format (...
"""Context parser that returns a dictionary from a local json file.""" from collections.abc import Mapping import logging import json # use pypyr logger to ensure loglevel is set correctly logger = logging.getLogger(__name__) def get_parsed_context(args): """Parse args as path to a json file and returns context ...
import sys from setuptools import setup classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Win32 (MS Windows)', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: Apache Software License', 'Operating System :: Microsoft :: Windows'...
from src.ecSystem.ECSystem import ECSystem from src.ecSystem.ECSystemParameters import ECSystemParameters # Where we actually run our EC System params = ECSystemParameters() # Governs the number of expressions in each generation params.generation_size = 200 # Governs the length of the expressions in the initial pop...
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'src')) import unittest try: from unittest import mock except ImportError: import mock from easyaspect.utils import (get_module, get_classes, get_methods, get_properties) class DummyClass(object)...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os.path from PyQt5.QtWidgets import QWidget, QLabel, QVBoxLayout from libs.python.NoteFunctions import NoteFunctions class NoteViewer(QWidget): def __init__(self, param): QWidget.__init__(self) # Function for several oprations if 'NoteF...
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # (C) British Crown Copyright 2012-5 Met Office. # # This file is part of Rose, a framework for meteorological suites. # # Rose is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
#!/usr/bin/env python ### # (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP # # 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 limita...
import timeit import os import copy import io import re import itertools as IT from PIL import Image, ImageDraw, ImageColor, ImageFont import heatmap o = re.compile(r'CreateObject\(([0-9]+),\s*([\-\+]?[0-9]*\.[0-9]+),\s*([\-\+]?[0-9]*\.[0-9]+),\s*([\-\+]?[0-9]*\.[0-9]+),\s*([\-\+]?[0-9]*\.[0-9]+),\s*([\-\+]?[0-9]*\.[...
___author__ = 'acmASCIS' ''' by ahani at {9/22/2016} ''' import random from dev.server.datasets_generator._sort import Sort from dev.server.datasets_generator._matmul import Matmul from dev.server.datasets_processing.validator import Validator class Manager(object): def __init__(self): super(Manage...
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- # # Copyright (C) 2006 Jonathan Matthew # Copyright (C) 2007 James Livingston # Copyright (C) 2007 Sirio Bolaños Puchet # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
from __future__ import division from math import log, ceil, floor import os import re from subprocess import Popen, PIPE import sys from tempfile import TemporaryFile from warnings import warn try: import audioop except ImportError: import pyaudioop as audioop if sys.version_info >= (3, 0): basestring =...
# Copyright 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
import os.path import hashlib from django.shortcuts import render_to_response from django.template.context import RequestContext from django.http import HttpResponseRedirect def get_image_path(instance, filename): """ Converts an image filename to a hash. """ name = hashlib.md5("%s" % instance.id).he...
""" This module contains the logic representing the grid on which a game is played. A grid, in this sense, is simply a collection cells set into rows and columns. The cells can, for the purposes of the project, only be square. """ from game.data_structures.cell import Cell def create_empty_grid(): """ This fu...
from abc import ABCMeta from collections import OrderedDict from collections.abc import Iterable import hashlib from itertools import product from numbers import Real, Integral from xml.etree import ElementTree as ET import numpy as np import pandas as pd import openmc import openmc.checkvalue as cv from .cell import...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 Timothy Dozat # # 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 ...
#!/usr/bin/python3 # # Copyright (c) 2013, Arnaud Loonstra, All rights reserved. # Copyright (c) 2013, Stichting z25.org, All rights reserved. # # This library 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;...
# -*- coding: utf-8 -*- # # Copyright (©) 2010-2013 Estêvão Samuel Procópio # Copyright (©) 2010-2013 Gustavo Noronha Silva # Copyright (©) 2013 Marcelo Jorge Vieira # Copyright (©) 2014 Wilson Pinto Júnior # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero...
#!/usr/bin/env python3 import unittest from unittest.mock import Mock from unittest.mock import patch from pico8.music import music VALID_MUSIC_LINES = [b'00 41424344\n'] * 64 class TestMusic(unittest.TestCase): def testFromLines(self): m = music.Music.from_lines(VALID_MUSIC_LINES, 4) self.ass...
# Copyright 2012 NTT Data. All Rights Reserved. # Copyright 2012 Yahoo! 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/li...
from django.db import models from django.utils import timezone class Costume(models.Model): owner=models.ForeignKey('auth.User', on_delete=models.CASCADE, related_name ="costumes") name=models.CharField(max_length=55) description=models.CharField(max_length=1000, blank=True) public=models.BooleanField...
# -*- coding: utf-8 -*- # 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...
''' Copyright (C) 2011 Mihnea Dobrescu-Balaur 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. This program is distributed in ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Written in place of AboutBlocks in the Ruby Koans # # Note: Both blocks and generators use a yield keyword, but they behave # a lot differently # from runner.koan import * class AboutGenerators(Koan): def test_generating_values_on_the_fly(self): result =...
def max_difference(a: list[int]) -> tuple[int, int]: """ We are given an array A[1..n] of integers, n >= 1. We want to find a pair of indices (i, j) such that 1 <= i <= j <= n and A[j] - A[i] is as large as possible. Explanation: https://www.geeksforgeeks.org/maximum-difference-between-two-elem...
import re from django.db.models import Q from rest_framework import generics from rest_framework.exceptions import NotFound, PermissionDenied, NotAuthenticated from rest_framework import permissions as drf_permissions from website.models import PreprintService from framework.auth.oauth_scopes import CoreScopes from...
#!/usr/bin/env python #BEGIN_LEGAL # #Copyright (c) 2019 Intel 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 r...
from __future__ import print_function from essentia.standard import MusicExtractor, YamlOutput from essentia import Pool from argparse import ArgumentParser import numpy import os import json import fnmatch import sys def isMatch(name, patterns): if not patterns: return False for pattern in patterns: ...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
""" Expose most of the built-in functions and classes but suffixed with '_λ' and to be only used in λ-abstractions. See module `lambdax.builtins_overridden` to keep built-in names and have a mixed behavior, working as expected both inside and outside λ-abstractions. """ import builtins from lambdax.lambda_calculus im...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#! /usr/bin/env python # # mutagen aims to be an all purpose media tagging library # Copyright (C) 2005 Michael Urman # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # $Id: __i...
# Copyright 2014 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. from telemetry.core import wpr_modes from telemetry import decorators from telemetry.unittest_util import options_for_unittests from telemetry.unittest_util ...
# -*- coding=utf8 -*- from urllib import urlencode from requests import Session from extension import mongo_collection import json session = Session() LOGIN_HEADERS = { 'Host': 'reg.163.com', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Accept': 'text/html,applicat...
#!/usr/bin/env python # Copyright 2015 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. """Unit tests for common module""" import unittest import test_env # pylint: disable=W0611 from master.buildbucket import common ...
import termcolor def ask_yes_no(question, default=True, spacing=True): """ Ask a yes/no question via raw_input() and return their answer. "question" is a string that is presented to the user. "default" is the presumed answer if the user just hits <Enter>. It must be "yes" (the default), "no" ...
#!/usr/bin/env python import logging import math from wiiremote import WiiRemote from robot import Robot try: import cwiid except ImportError: cwiid = None class RobotWiiController(object): def __init__(self, robot): self.log = logging.getLogger('romi') self.robot = robot self.r...
#!/usr/bin/env python import urllib import json import os from flask import Flask from flask import request from flask import make_response # Flask app should start in global layout app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): req = request.get_json(silent=True, force=True) ...
''' graph = { "a" : ["c"], "b" : ["c", "e"], "c" : ["a", "b", "d", "e"], "d" : ["c"], "e" : ["c", "b"], "f" : [] } ''' import copy def is_connected(graph): if graph=={}: return True seen = set([next(graph.iterkeys())]) tocheck = seen.copy() ...
# DMRX codec # Summary: This module implements serialization and deserialization of the # XML encoding of Distributed Minimal Recusion Semantics (DMRS). It # provides standard Pickle API calls of load, loads, dump, and dumps # for serializing and deserializing DMRX corpora. Further, # ...
# encoding: utf-8 # module PyQt4.QtGui # from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyQt4.QtCore as __PyQt4_QtCore # functions def qAlpha(p_int): # real signature unknown; restored from __doc__ """ qAlpha(int) -> int """ ret...
# 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...
import numpy as np import numpy.linalg as la import sys def detrending(t,data,pol_degree): """ detrending returns the least-squares polynomial trend of a time series. Inputs: - t [1-dim numpy array of floats]: the times of the time series. - data [1-dim numpy array of floats - size=t.size]: the data values of...
import socket class TcpClient(object): def __init__(self, port, host): """ Constructor for TCP Client :param port: the port that the client is going to try and access on the server :param host: the host of the sever """ self.port = port self.host = host ...
# GUI object/properties browser. # Copyright (C) 2011 Matiychuk D. # # 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 License, or (at your option) any la...
# Copyright 2013, 2014, 2015, 2016, 2017 Kevin Reid <kpreid@switchb.org> # # This file is part of ShinySDR. # # ShinySDR 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 # (...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # This modules provides functionality for dealing with code completion. from __future__ import absolute_import, print_f...
""" kombu.transport.virtual ======================= Virtual transport implementation. Emulates the AMQ API for non-AMQ transports. """ from __future__ import absolute_import, unicode_literals import base64 import socket import sys import warnings from array import array from itertools import count from multiproces...
import numpy as np from parsers import load_hdf5, dim from parsers import savemtx, make_header # import matplotlib.pyplot as plt # from changeaxis import interp_y # from scipy.constants import Boltzmann as Kb # from scipy.constants import h , e, pi filein = "S1_511_shot_100mV_4924_5217MHz" folder = "hdf5s//09//Data_0...
from procgame import * class Mode(game.Mode): def __init__(self, game): super(Mode, self).__init__(game, 1) highscore_categories = [] cat = highscore.HighScoreCategory() cat.game_data_key = "HighScores" cat.titles = [ "Grand Champion", "High Score 1"...
import numpy as np from credalset import CredalSet class IntervalsProbability(CredalSet): """Class of probability intervals: probabilistic bounds on singletons :param lproba: a 2xn array containing upper (1st row) and lower bounds :type lproba: :class:`~numpy.array` :param nbDecision: number of el...
# -*- coding: utf-8 -*- # # Web API module of Dashboard. # # (C) 2013 Internet Initiative Japan Inc. # All rights reserved. # # Created on 2013/05/28 # @author: yosinobu@iij.ad.jp try: import json except ImportError: import simplejson as json from trac.core import Component, implements, ExtensionPoint from tr...
#!/usr/bin/python ##### CheckMyIP Server ##### ##### Written by John W Kerns ##### ##### http://blog.packetsar.com ##### ##### https://github.com/packetsar/checkmyip ##### ##### Inform version here ##### version = "v1.3.0" ##### Import python2 native modules #####...
import numpy from orangecontrib.xoppy.util.xoppy_undulators import xoppy_calc_undulator_power_density, xoppy_calc_undulator_spectrum from orangecontrib.xoppy.util.xoppy_xraylib_util import xpower_calc from orangecontrib.xoppy.util.fit_gaussian2d import fit_gaussian2d, info_params, twoD_Gaussian from srxraylib.plot.go...
# # Copyright (c) 2008-2015 Citrix Systems, 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...
from io import StringIO TEMPLATES = {} TEMPLATES['long'] = """ {{- start.plan_type }} ['{{ start.uid[:6] }}'] (scan num: {{ start.scan_id }}) Scan Plan --------- {{ start.plan_type }} {%- for k, v in start.plan_args | dictsort %} {{ k }}: {{ v }} {%- endfor %} {% if 'signature' in start -%} Call: {{ start.si...
from heltour.tournament.models import * from heltour.tournament import lichessapi, slackapi, pairinggen, \ alternates_manager, signals, uptime from heltour.celery import app from celery.utils.log import get_task_logger from datetime import datetime from django.core.cache import cache from heltour import settings im...
#TFLearn bug regarding image loading: https://github.com/tflearn/tflearn/issues/180 #Monochromes img-magick: https://poizan.dk/blog/2014/02/28/monochrome-images-in-imagemagick/ #How to persist a model: https://github.com/tflearn/tflearn/blob/master/examples/basics/weights_persistence.py from __future__ import division,...
import json from algorithm.sentimental import sentiment from algorithm.textProcessing import text_tag import traceback from websocket_server import WebsocketServer # Called for every client connecting (after handshake) def new_client(client, server): print("New client connected and was given id %d" % client['id'...
from builtins import map from builtins import range import imp import logging # Raise an ImportError if z3 is not available WITHOUT actually importing it imp.find_module("z3") from miasm.ir.translators.translator import Translator log = logging.getLogger("translator_z3") console_handler = logging.StreamHandler() con...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse from collections import defaultdict import cProfile from decimal import Decimal import gc import random import sys import timeit try: import guppy except ImportError: heapy = None else: heapy = guppy.hpy()...
#! /usr/bin/env python3 import os import argparse import json import decimal import sys import logging import unicodedata import time import dateutil.parser import calendar import configparser import traceback import threading from threading import Thread import binascii from fractions import Fraction import requests ...
"""Setup script for image_inspector package. """ DISTNAME = 'iminspector' DESCRIPTION = 'Image Interaction widgets and viewer.' LONG_DESCRIPTION = open('README.rst', 'rb').read().decode('utf-8') MAINTAINER = 'Steven Silvester' MAINTAINER_EMAIL = 'steven.silvester@ieee.org' URL = 'http://github.com/blink1073/imag...
# 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 ...
#from django.contrib.auth.models import User, Group from rest_framework import viewsets from .serializers import * from journals.models import Journals from reports.models import Reports from property.models import Stock, Land, Building, Car, Cash, Deposit, Aircraft, Boat, Bonds, Fund, OtherBonds, Antique, Insurance, ...
from flask_wtf import FlaskForm from wtforms import StringField, DateField, IntegerField, SelectField, DecimalField from wtforms.validators import DataRequired, Optional from wtforms.widgets import TextArea class StockForm(FlaskForm): stock_id = IntegerField() item_name = StringField("Item name", validators...
import tkinter as tk import constants.gui_constants as const from controllers.data_set_controller import DataSetController from controllers.session_controller import SessionController from file_experts.data_set.data_set_validator import DataSetValidator from graphics.output.test_sess.test_sess_output_f import TestSess...
import sys sys.path.append("Structures/") sys.path.append("Algorithms/") from sys import argv from bfs import Bfs from bf import Bf from fw import Fw from scc import Scc from dk import Dk from graph import Graph def main(): G = Graph() G.buildGraph(argv[2]) if argv[1] == 'bfs': s = G.getInitVe...
""" Sphinxdoc configuration. Defines how documentation is built on readthedocs.org or manually """ import os import sys import django import sphinx_rtd_theme sys.path.append(os.path.abspath('..')) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tardis.test_settings") django.setup() # General configuration # -----...
import script from script import * class Info(script.Script): def run(self, args): self.console.log("{0} nodes, {1} edges.".format(og.count_nodes(), og.count_edges())) class Load(script.Script): def run(self, args): if len(args) < 2: self.console.log("Usage: {0} <filename>".format(args[0])) return std...
import sys import os from os.path import exists from mutils.system.scheduler import get_scheduler, PlatformError, FrequencyError from redcmd import subcmd, CommandLine, CommandLineError, CommandError from . import globals from .fb import FB from .action import Action @subcmd def job(): '''Run fbstats as a job.''' ...
import behavior import robocup import constants import single_robot_composite_behavior import main import enum import skills import random import time class Celebration( single_robot_composite_behavior.SingleRobotCompositeBehavior): MaxSpinAngle = 360 SpinPerTick = 1 class State(enum.Enum): ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # simsoexp documentation build configuration file, created by # sphinx-quickstart on Tue Jul 28 16:53:27 2015. # # 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 # a...
from __future__ import absolute_import, division, print_function from collections import Iterator from contextlib import contextmanager from errno import ENOENT from functools import partial import os import sys import shutil import struct import gzip import tempfile import inspect from .compatibility import unicode,...
# encoding:utf-8 # # gPrime - A web-based genealogy program - Records plugin # # Copyright (C) 2008-2011 Reinhard Müller # Copyright (C) 2010 Jakim Friant # Copyright (C) 2013-2016 Paul Franklin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public ...
import sys import imp import yaml import csv import pandas as pd import re from rf import * from svm import * modl = imp.load_source('read_model_yaml', 'read_model_yaml.py') # Parse the YAML file location as the first parameter inp_yaml = sys.argv[1] def write_results_txt(filename, result): """ Write results ...
import logging from marshmallow import ValidationError from airy.models import Project, TaskStatus from airy.exceptions import ProjectError from airy.database import db from airy.serializers import ProjectSerializer logger = logging.getLogger(__name__) def get(project_id, task_status): project = db.session.que...
import numpy as np import pandas as pd import utils as ut class FractionCollector: """ A high-level wrapper around an XY stage. """ def __init__(self, xy): self.frames = pd.DataFrame(index=['trans', 'position_table']) self.add_frame('hardware') self.XY = xy def add_f...
#!/usr/bin/env python """ Slim, flexible, yet full-featured e-mailing library """ from setuptools import setup, find_packages setup( # http://pythonhosted.org/setuptools/setuptools.html name='mailem', version='0.0.5', author='Mark Vartanyan', author_email='kolypto@gmail.com', url='https://git...
'''Test suite for the responses module.''' import json import unittest import unittest.mock as mock from werkzeug.exceptions import InternalServerError, BadRequest from ..responses import AsyncResponse, BadResponse, GoodResponse, HEADERS from .. import responses class TestAsync(unittest.TestCase): '''Test the...
#! /usr/bin/env python ## Support for byteswapping audio streams (needed for AIFF format). _typecode = {2:'h'} def _init_typecode(): import array for t in ('i', 'l'): a = array.array(t) if a.itemsize==4: _typecode[4] = t return import sys print "Can't find array typecode ...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
# Copyright (C) 2009-2013 Roman Zimbelmann <hut@hut.pm> # This software is distributed under the terms of the GNU GPL version 3. """The TaskView allows you to modify what the loader is doing.""" from . import Widget from ranger.ext.accumulator import Accumulator class TaskView(Widget, Accumulator): old_lst = No...
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
#!/bin/env python # # 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...
from surface import Surface def borders(surface): width, height = surface.size y0 = 0 y1 = 0 x0 = 0 x1 = 0 i = 0 while i < height: r,g,b,a = surface.at((0,i)) if a > 0: y0 = i break i += 1 while i < height: r,g,b,a = surface.at((0,...
# -*- coding: utf-8 -*- from ddbmock.errors import ConditionalCheckFailedException, ValidationException from ddbmock import config from decimal import Decimal from math import ceil from . import comparison def _decode_field(field): return field.items()[0] class ItemSize(int): def __add__(self, value): ...
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2016 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission ...
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2004-2005 Trolltech AS. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## This file may be used under the terms of the GNU General Public ## License version...
#!/usr/bin/env python # Copyright 2015 The PDFium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import os import re import subprocess import sys # Nomenclature: # x_root - "x" # x_filename - "x.ext" # x_path - ...
# # Copyright (C) 2017 UNINETT AS # # This file is part of Network Administration Visualized (NAV). # # NAV 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...
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2011,2012,2013,2014,2015,2016 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. #...
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import time from...
# issue/models.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.db import models from exception.models import handle_exception, handle_record_found_more_than_one_exception, \ handle_record_not_found_exception, handle_record_not_saved_exception from wevote_settings.models import fetch_ne...
''' Created on Mar 17, 2014 @author: mschilonka ''' import argparse, sys from remote import server as Server from remote import worker as Worker if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("-w", "--worker", help="Starts a weimar worker instance.", action="store_true") ...
# This file is part of rinohtype, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. # from Apple's TrueType Reference Manual (December 18, 2...
# SCBdo : DISC Track Racing Management Software # Copyright (C) 2010 Nathan Fraser # # This program is free software: you can redistribute it and/or modify ...