src
stringlengths
721
1.04M
from datetime import timedelta from carrot.utils import partition from celery import conf from celery.backends.base import KeyValueStoreBackend from celery.exceptions import ImproperlyConfigured from celery.utils import timeutils from celery.datastructures import LocalCache def get_best_memcache(*args, **kwargs): ...
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
import time from collections import OrderedDict from conans.client.graph.graph import DepsGraph, Node, RECIPE_EDITABLE from conans.errors import (ConanException, ConanExceptionInUserConanfileMethod, conanfile_exception_formatter) from conans.model.conan_file import get_env_context_manager fr...
# Copyright 2015 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 scriptcore.testing.testcase import TestCase from scriptcore.console.option import Option class TestOption(TestCase): def test_constructor(self): """ Test constructor :return: void """ prop_short = 's' prop_description = 'this is a description' pro...
# 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 ...
import json import logging import logging.config import sys import os import pytumblr from boxmover import delete_queue, reblog_everything, confirm, like_everything, new_oauth, unlike_everything, \ get_follow_list LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': {'simple': {'...
######################################################################## # $HeadURL$ ######################################################################## """ DIRAC Basic MySQL Class It provides access to the basic MySQL methods in a multithread-safe mode keeping used connections in a python Queue for furthe...
from pydeck import Deck, Layer, ViewState features = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [-...
import posix import ctypes from fcntl import ioctl from .linux_spi_spidev import spi_ioc_transfer, SPI_IOC_MESSAGE SPIDEV = '/dev/spidev' class SPIInitError(Exception): pass class SPIDevice(object): """An SPI Device at /dev/spi<bus>.<chip_select>.""" def __init__(self, bus=0, chip_select=0, spi_callbac...
# # # Copyright 2012-2018 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (...
import pexpect, numpy import threading, Queue, time SLEEP_SEC = 0.001 def grange(start, stop, step): r = start while r < stop: yield r r += step def npindex(alist, target): i = 0 for x in alist: if numpy.array_equal(x, target): return i i += 1 return None class Co...
#!/usr/bin/env python # # Copyright 2015 Google 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 # # Unless requir...
#!@PYTHON@ # name isn't really appropriate now ... name = 'ls-latex' version = '0.1' import sys import os import string import __main__ import glob import re format_names = {'ps.gz': 'Compressed PostScript', 'html' : 'HTML' } def gulp_file(f): try: i = open(f) i.seek (0, 2) n = i.tell () i.seek...
# Copyright (C) 2010 Canonical # # Authors: # Didier Roche <didrocks@ubuntu.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; version 3. # # This program is distributed in the hope that it...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Smewt - A smart collection manager # Copyright (c) 2013 Nicolas Wack <wackou@smewt.com> # # Smewt is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either versio...
import urllib from django.core.exceptions import ImproperlyConfigured from django.core.mail import send_mail from django.db import models from django.db.models.manager import EmptyManager from django.utils.crypto import get_random_string from django.utils.encoding import smart_str from django.utils.translation import ...
import numpy as np from scipy import linalg from scipy import spatial # Covariance functions def approx_quantile(coverage_prob, d, n, exp=1): ''' Compute approximate coverage_prob quantile of maximal distance between n spherically-distributed points with identity covariance and the origin. Arguments...
# Temporary tests. #In this test #1. Create Scene #2. Create kernel vector #3. Apply kernels to the scene #4. Display results as disks #import bvpl_octree_batch; #bvpl_octree_batch.register_processes(); #bvpl_octree_batch.register_datatypes(); # #class dbvalue: # def __init__(self, index, type): # self.id = ind...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016 Jonathan Schultz # # 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 lat...
# export_2d.py # functions to help to generate 2D dxf and svg plan. # created by charlyoleg on 2013/05/31 # # (C) Copyright 2013 charlyoleg # # This file is part of the Cnc25D Python package. # # Cnc25D is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
from abc import ABCMeta, abstractmethod import os import glob import subprocess import shutil import multiprocessing import re import collections import bb import tempfile import oe.utils import oe.path import string from oe.gpg_sign import get_signer # this can be used by all PM backends to create the index files in ...
from __future__ import print_function import copy import warnings import graphviz import matplotlib.pyplot as plt import numpy as np def plot_stats(statistics, ylog=False, view=False, filename='avg_fitness.svg'): """ Plots the population's average and best fitness. """ if plt is None: warnings.warn(...
"""Provides functionality for calculating sums from statistics data.""" from sqlalchemy.sql import func, and_ from sqlalchemy.orm.query import Query from .db import sesh from .record import Record, RA, RB from .difference import Diff from .filter import filter_ from .constants import EARTH_EQUAT_CIRC class Sum: ...
from flask import Flask,render_template,request from flask.ext.script import Manager #déclare le serveur flask app = Flask(__name__) #déclare le plug-in flask-script manager = Manager(app) #crée la route web de la racine du site #et la lie à la fonction index @app.route("/") def index(): return render_templa...
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: train-atari.py # Original Author (we/jemdwood@gmail.com editted): Yuxin Wu <ppwwyyxxc@gmail.com> import numpy as np import os import sys import time import random import uuid import argparse import multiprocessing import threading import cv2 import tensorflow as t...
#!/usr/bin/env python # -*- coding: utf-8 -*- # This software is under a BSD license. See LICENSE.txt for details. from datatank_py.DTRegion2D import DTRegion2D import numpy as np class DTTriangularGrid2D(object): """2D triangular grid object. This is a collection of points interconnected to form triangles....
from django.db import models # Create your models here. class General(models.Model): class Meta: db_table = "general" permissions = (('admins', "admins manage all settings openvpn"),) general_vpn_name = models.TextField(max_length=200) general_project_name = models.TextField(max_length=20...
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.exterior_equipment import ExteriorLights log = logging.getLogger(__name__) class TestExteriorLights(unittest.TestCase): def setUp(self): self.fd, self.path = tempfi...
# Localisation files can be found at: # https://github.com/unicode-org/cldr/tree/master/common/annotations import argparse import xml.etree.ElementTree as ET import os, json def getFile(path): dir = os.path.dirname(__file__) return os.path.join(dir, path) parser = argparse.ArgumentParser() parser.add_argument("sr...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # LICENSE # # Copyright (C) 2010-2021 GEM Foundation, G. Weatherill, M. Pagani, # D. Monelli. # # The Hazard Modeller's Toolkit is free software: you can redistribute # it and/or modify it under the terms of the GNU Affero General Public # License a...
# This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, q" tags = "menu items, ToggleMenuItem, MultipleMenuItem, MenuItem, EntryMenuItem, ImageMenuItem, ColorMenuItem" from pyglet import i...
# @Author # Chloe-Agathe Azencott # chloe-agathe.azencott@mines-paristech.fr # April 2016 import argparse import h5py import numpy as np import os import sys import CoExpressionNetwork def main(): """ Create sample-specific co-expression networks for one fold and one repeat of a cross-validation for which f...
from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller import dpset from ryu.controller.handler import CONFIG_DISPATCHER , MAIN_DISPATCHER, DEAD_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.ofproto import ofproto_v1_3 from ryu.lib import mac import time ...
# coding: utf-8 # This Python module is part of the PyRate software package. # # Copyright 2020 Geoscience Australia # # 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:/...
''' @author: davandev ''' import os import logging import imp import time import re import davan.config.config_creator as app_config import davan.util.application_logger as app_logger import davan.util.constants as constants class ServiceInvoker(object): ''' Service Handler module, scanning fo...
# Copyright 2015 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...
# Copyright 2017 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...
#!/usr/bin/env python # 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 # d...
#!/opt/anaconda2/bin/python # -*- coding: utf-8 -*- """ ################################################################################ # # Copyright (c) 2016 Wojciech Migda # All rights reserved # Distributed under the terms of the MIT license # ####################################################################...
# -*- coding: utf-8 -*- """ Created on Mon Feb 29 2016 Author: Cedric Vallee """ import os import re from bs4 import BeautifulSoup import pandas as pd import numpy as np import nltk from nltk.corpus import stopwords from sklearn.cross_validation import train_test_split from sklearn.feature_extraction.text import Count...
from common import * from solution import * import copy import sys import datetime num_test = 303 true, false = True, False in_0 = [] in_org_0 = [] in_1 = [] in_org_1 = [] out = [] def load_test(): f = open('judge/tests/coin-change-2.txt', 'r') global in_0, in_org_0 in_0 = read_int_matrix(f) in_org_0...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Main entry for SRT drive control. Author: Ronnie Frith Contact: frith.ronnie@gmail.com """ from . import CONFIGURATION as config from . import CATALOGUE from .drive import Drive #from acreroad_1420 import CONFIGURATION as config import numpy as np import sys, argparse, t...
#!/usr/bin/env python import pygame.event import pygame.key import pygame.display import pygame.image import pygame.mixer import pygame import sys import time import os pygame.display.init() #this library should contain any functions and data needed by dezutezeoid #that don't need to be in the actual engine executable...
import numpy as np from ...element import HLine, VLine from .element import ElementPlot, text_properties, line_properties class TextPlot(ElementPlot): style_opts = text_properties _plot_method = 'text' def get_data(self, element, ranges=None): mapping = dict(x='x', y='y', text='text') r...
""" Provides a class called DLE to convert and solve dynamic linear economics (as set out in Hansen & Sargent (2013)) as LQ problems. """ import numpy as np from .lqcontrol import LQ from .matrix_eqn import solve_discrete_lyapunov from .rank_nullspace import nullspace class DLE(object): r""" This class is fo...
# -*- coding: utf-8 -*- # Functions for Poisson-Reconstruction import numpy as np from ImgLib.MyFilter import myfilter as filter # Some explanations: http://eric-yuan.me/poisson-blending/ def jacobi(A, b, N=25, x=None, progressFunc = None, stopFunc=None): """ Solving A*x =b for x by using the Jacobi-method....
"""Perform traininig of a multi-study model using the fetchers provided by cogspaces. Hyperparameters can be edited in the file.""" import argparse import json import os from os.path import join import numpy as np from joblib import Memory, dump from sklearn.metrics import accuracy_score from cogspaces.classificati...
# Copyright 2013 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 req...
""" comm.py module manages Robot communication using sockets. It contains functions for sending and listening to the robot """ import socket from struct import unpack PORT_DASH = 29999 PORT = 30002 PORT_RT = 30003 def send_script(ur_program, robot_ip) : """Send a script to robot via a socket Arg...
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 distributed in the hope that it will b...
""" Checks if a Twitch streamer is online. Checks if a streamer is online using the Twitch Kraken API to see if a channel is currently streaming or not. Configuration parameters cache_timeout: how often we refresh this module in seconds (default 10) format: Display format when online (default ...
# 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...
import time import os import catsup.parser from catsup.logger import logger from catsup.generator.renderer import Renderer from catsup.reader import get_reader from catsup.options import g from catsup.utils import smart_copy from catsup.models import * class Generator(object): def __init__(self, config_path, loc...
from flask import Blueprint, render_template, jsonify, request, send_from_directory, redirect, url_for import os festivals = Blueprint('festivals', __name__, template_folder='templates') @festivals.route('/') def index(): return render_template('index.html') @festivals.route('/search-results') def featured(): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you c...
#pylint: disable=W0703,W0511,W0402,R0911,R0915,R0912,W0331,W0612,R0904,W0105 """ Thread to download a package """ from agent.lib import utils, contextutils, configutil from agent.lib.agent_thread.agent_thread import AgentThread from agent.lib.errors import Errors, FileNotFoundError, AgentException from agent.lib.packa...
""" (c) 2013 LinkedIn Corp. 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 applicable law or agreed to in writing...
#!/usr/bin/env python """ Do the Single Photoelectron anaylsis Usage: digicam-spe [options] [--] <INPUT>... Options: -h --help Show this screen. --max_events=N Maximum number of events to analyse. --max_histo_filename=FILE File path of the max histogram. ...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # 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 ...
#!/usr/bin/env python #coding=utf-8 from twisted.python import log from pyrad import packet from store import store from settings import * import logging import decimal import datetime import utils decimal.getcontext().prec = 11 decimal.getcontext().rounding = decimal.ROUND_UP def process(req=None,user=None,runstat=N...
import numpy class DecisionNode(object): def __init__(self, trainInds, value): #All nodes self.value = value self.trainInds = trainInds #Internal nodes self.featureInd = None self.threshold = None self.error = None #Used for making prediction...
r""" Display NumLock, CapsLock, and ScrLock keys. Configuration parameters: cache_timeout: refresh interval for this module (default 1) format: display format for this module *(default '[\?if=num_lock&color=good NUM|\?color=bad NUM] ' '[\?if=caps_lock&color=good CAPS|\?color=bad CAPS] ' ...
import logging class GitlabIssuesHandler(logging.Handler): """ Handles logs as issues with GitLab API """ def __init__(self): logging.Handler.__init__(self) def __open_issue(self, title, content, trace_raw): """ Open an issue on GitLab with given content """ ...
#!/usr/bin/env python import datetime import subprocess import pymongo import config # Database config client = pymongo.MongoClient(config.db_connection_string) db = client.dmon def update_ping(host): ping_command = 'ping -c 5 -i 6 %s' % host # Run the ping command in a shell proc = subprocess.Popen(ping...
from bs4 import BeautifulSoup import nltk.data from nltk.tokenize import word_tokenize import glob import gzip import sys tokenizer = nltk.data.load('tokenizers/punkt/dutch.pickle') def good_sentence(s): if len(s) < 4 or s.count(',') > 4: return False else: digits = filter(lambda x:x.isdigit()...
# -*- coding: utf-8 -*- from setuptools import setup setup( name='txmongo2', description='another mongodb driver for twisted.', long_description=''' mongodb driver for twisted, forked from `https://github.com/oubiwann/txmongo.git`. still need for testing. ''', author='Spike^ekipS', author...
import logging from ._base import Service from ..domain import Template log = logging.getLogger(__name__) class TemplateService(Service): def __init__(self, template_store, **kwargs): super().__init__(**kwargs) self.template_store = template_store def all(self): """Get all templat...
from conans import ConanFile, CMake, tools class eobjectConan(ConanFile): name = "eobject" version = "0.1.2" license = "MIT" url = "https://github.com/elite-lang/eobject" settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False]} default_options = "shared=False", ...
class VirtualServerType: RESOURCE_TYPE_POOL = 0 RESOURCE_TYPE_IP_FORWARDING = 1 RESOURCE_TYPE_L2_FORWARDING = 2 RESOURCE_TYPE_REJECT = 3 RESOURCE_TYPE_FAST_L4 = 4 RESOURCE_TYPE_FAST_HTTP = 5 RESOURCE_TYPE_STATELESS = 6 RESOURCE_TYPES = ( 'Standard', 'Forwarding (IP)', 'Forwarding (Layer 2)', 'Reject',...
""" Tests for Advent of Code """ import unittest import pytest from . import day1, day2, day3, day4, day5, day6, day7, day8, day9 from . import day10, day11, day12, day13, day14, day15, day16, day17 from . import day18, day19, day20, day21, day22 @pytest.mark.parametrize('seq,sum,halfway', [ ('1122', 3, False), ...
import pandas import pandasql def max_temp_aggregate_by_fog(filename): ''' This function should run a SQL query on a dataframe of weather data. The SQL query should return two columns and two rows - whether it was foggy or not (0 or 1) and the max maxtempi for that fog value (i.e., the maximum ma...
import json from caladbolg.agents import formulas from caladbolg.agents.stats import Stats, EquipmentStats class Character: """ Represents a player character. Characters have stats, equipment, and leveling information. """ def __init__(self, character_file): self.level = 1 ...
# This file is part of DQXServer - (C) Copyright 2014, Paul Vauterin, Ben Jeffery, Alistair Miles <info@cggh.org> # This program is free software licensed under the GNU Affero General Public License. # You can find a copy of this license in LICENSE in the top directory of the source code or at <http://opensource.org/li...
import base64 import datetime import decimal import sys import time import unittest from unittest import mock import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import http, http.server import socket import threading import re import io import contextlib from test import support try: import ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './Graphics/UMLSceneSizeDialog.ui' # # Created: Tue Nov 18 17:53:58 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 class Ui_UMLSceneSizeDialo...
from dronekit import connect, VehicleMode, LocationGlobal, LocationGlobalRelative from pymavlink import mavutil # Needed for command message definitions import logging import time import math logging.basicConfig(filename='Roll_log.log', format = '%(levelname)s:%(asctime)s: %(message)s', level=logging.INFO) im...
# 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 'Contact' db.create_table('storybase_user_contact', ( ('id', self.gf('django.db...
""" Author: Junhong Chen """ from Bio.Alphabet import IUPAC from Bio.Seq import Seq from Bio import SeqIO from sys import argv import os path = argv[1] class CDS: def __init__(self,gff): self.data = dict() self.fname = gff def parse(self): file = open(sel...
# Copyright (c) 2015 Intel Research and Development Ireland Ltd. # # 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 app...
######## # Copyright (c) 2019 Cloudify Platform 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 ...
# -*- coding: utf-8 -*- from io import BytesIO from translate.convert import po2ts, test_convert from translate.storage import po class TestPO2TS: def po2ts(self, posource): """helper that converts po source to ts source without requiring files""" inputfile = BytesIO(posource.encode()) i...
#!/usr/bin/env python from distutils.core import setup setup(name='Runtime_visualizer', version='0.1', description='Visualize the time complexity of functions', author='Thunder Shiviah', author_email='thunder.shiviah+rtviz@gmail.com', license='MIT', classifiers=[ # How mature is this project? ...
from setuptools import setup, find_packages import os base_dir = os.path.dirname(__file__) about = {} with open(os.path.join(base_dir, "magum", "__about__.py")) as f: exec(f.read(), about) """readme = os.path.join(base_dir, 'README.rst') with open(readme) as f: long_description = f.read() """ CFFI_VERSI...
import numpy as np from abc import ABCMeta, abstractmethod class BaseStorageTree(object, metaclass=ABCMeta): """Abstract storage class for the EZ-Climate model. Parameters ---------- decision_times : ndarray or list array of years from start where decisions about mitigation levels are done ...
import logging from django.test.utils import override_settings from rest_framework import status from rest_framework.test import APITestCase, APIRequestFactory from drf_authentication import utils from tests.test_views import login_check_view logger = logging.getLogger('logging_handler') __author__ = 'cenk' cla...
import pygame, functools, itertools from typing import Set, Tuple from random import randint from time import sleep def main(state: Set[Tuple[int, int]], width: int = 500, height: int = 500, max_x: int = 100, max_y: int = 100): pygame.init() screen = pygame.display.set_mode((width, height)) size_x, size_y...
import urllib import urllib2 import pprint from utils import transform_datetime from utils import flatten from warnings import warn import json as simplejson _debug = 1 class ChimpyException(Exception): pass class ChimpyWarning(Warning): pass class Connection(object): """mailchimp api connection""" ...
## # Copyright (c) 2011-2015 Apple 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 # # Unless required by applicab...
from quex.blackboard import setup as Setup, E_StateIndices from quex.engine.analyzer.mega_state.template.state import TemplateState from quex.engine.analyzer.mega_state.path_walker.state import PathWalkerState from quex.engine.analyzer.mega_state.core import MegaStat...
from os import path import codecs from setuptools import setup, find_packages here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, 'requirements.txt'), encoding='utf-8') as reqs: requirements = reqs.read() setup( name='calm', version='0.1.4', description='It...
import sys from datetime import datetime import logging from logging.handlers import RotatingFileHandler from flask import Flask from os import popen app = Flask(__name__) @app.route('/') def main_form(): # app.logger.warning('A warning occurred (%d apples)', 42) # app.logger.error('An error occurred') # ...
import random import pygame import gfxobject class Gimmick: "Class for the funny gimmicks. Note that it doesn't use any of the gfxobject classes" def __init__(self, screen, level): self.screen = screen self.level = level self.tux = gfxobject.GFXObject(screen, level, level.playerGfx, 0, ...
import sys import time import logging if sys.version_info[:2] >= (3, 0): # pylint: disable=E0611,F0401,I0011 uni = str else: uni = unicode import youtube_dl from . import g from .backend_shared import BasePafy, BaseStream, remux dbg = logging.debug early_py_version = sys.version_info[:2] < (2, 7) cl...
"""API for working with a Nvim Buffer.""" from .common import Remote from ..compat import IS_PYTHON3 __all__ = ('Buffer') if IS_PYTHON3: basestring = str def adjust_index(idx, default=None): """Convert from python indexing convention to nvim indexing convention.""" if idx is None: return defau...
# Credits to CF2009 for the original favourites script. import os, sys import xbmc, xbmcgui, xbmcaddon, xbmcvfs from xml.dom.minidom import parse __addon__ = xbmcaddon.Addon() __addonid__ = __addon__.getAddonInfo('id') __addonversion__ = __addon__.getAddonInfo('version') __cwd__ = __addon__.getAd...
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. # # 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 th...
# Copyright 2012 by the Micromagnum authors. # # This file is part of MicroMagnum. # # MicroMagnum 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 la...
# -*- coding: utf-8 -*- """ femagtools.forcedens ~~~~~~~~~~~~~~~~~~~~ Read Force Density Plot Files """ import os import re import glob import numpy as np import logging logger = logging.getLogger('femagtools.forcedens') filename_pat = re.compile(r'^(\w+)_(\d{3}).PLT(\d+)') num_pat = re.compile(r'([+-]...
# -*- coding: utf-8 -*- """ /*************************************************************************** DsgTools A QGIS plugin Brazilian Army Cartographic Production Tools ------------------- begin : 2016-07-31 git sha ...