src
stringlengths
721
1.04M
from werkzeug.utils import secure_filename from flask import Flask, request, render_template import cognitive_face as CF import pymysql.cursors from PIL import Image import requests import string import random import json import os import pyfcm from pyfcm import FCMNotification import kairos_face import constants app ...
# Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import copy import gc import os import sys import time from threading import Thread, Event try: from queue import Queue except ImportError: from Queue import Queue try: from unittest import mock except ImportError: ...
from django.test import TestCase from ocrDoacao.models import NotaFiscal import datetime class NotaFiscalTest(TestCase): def test_validacao_cnpj(self): validacao = NotaFiscal.validaCNPJ('11.111.111/1111-11') self.assertEqual(validacao, False) validacao = NotaFiscal.validaCNPJ('12.aaa11...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 14 05:54:11 2020 @author: mathieumoog """ import cpmd import filexyz import numpy as np import matplotlib.pyplot as plt # MSMbuilder ( lacks CK validation ) from msmbuilder.msm import MarkovStateModel from msmbuilder.msm import BayesianMarkovStateM...
# -*- coding: utf-8 -*- from urllib.parse import parse_qsl from xml.sax.saxutils import escape, quoteattr import re __version__ = "0.5" def wrap_file(environ, filelike, block_size=8192): # copied from # http://legacy.python.org/dev/peps/pep-3333/#optional-platform-specific-file-handling if 'wsgi.file_wr...
# -*- coding: utf-8 -*- import numpy as np import xgboost as xgb import testing as tm import pytest try: import pandas as pd except ImportError: pass pytestmark = pytest.mark.skipif(**tm.no_pandas()) dpath = 'demo/data/' rng = np.random.RandomState(1994) class TestPandas: def test_pandas(self): ...
#!/usr/bin/python # -*- coding: utf-8 -*- # -- stdlib -- import json import socket import re import telnetlib import time # -- third party -- # -- own -- # -- code -- QUEUE_METRIC = re.compile(r'^queue_(.*?)_(items|bytes|total_items|logsize|expired_items|mem_items|mem_bytes|age|discarded|waiters|open_transactions|tr...
import os import urwid import subprocess import ConfigParser from hnapi import HN from datetime import datetime _config = None class HNStory(object): def __init__(self, i, story): self.index = i + 1 self.story = story @property def story_number(self): index = str(self.index) ...
import NavigationInstance from time import localtime, mktime, gmtime, time from enigma import iServiceInformation, eServiceCenter, eServiceReference, getBestPlayableServiceReference from timer import TimerEntry import RecordTimer from Tools.CIHelper import cihelper from Components.config import config class TimerSani...
""" This module implements the base model class. All model things inherit from this class. """ from __future__ import print_function from builtins import zip from builtins import str from builtins import range from builtins import object import h2o import imp, traceback from ..utils.shared_utils import can_use_pandas...
import os import subprocess import sys import time import pytest import fsspec from fsspec import open_files from fsspec.implementations.ftp import FTPFileSystem here = os.path.dirname(os.path.abspath(__file__)) @pytest.fixture() def ftp(): pytest.importorskip("pyftpdlib") P = subprocess.Popen( [sy...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from scipy.linalg import norm from vaspy.iter import XdatCar, AniFile fixed_coord = [0.00000000, 1.92610195, 10.69285799] O_index = 1 max_x = 0.5 max_y = 0.5 def pdc_coord(coord): ''' Process the coordinate using PDC. ''' new_coord = [0.0]...
import urllib2 import json from datetime import datetime import pytz import logging class Openweathermap(object): def __init__(self, appid): self.appid = appid #the openweathermaps application id you got when signing up for the API #return codes according to this definition http://openweathermap.org/...
import socket from pymongo.errors import OperationFailure def _build_member_list(members): ret = [] members.append(socket.getfqdn()) members = list(enumerate(members)) for member in members: ret.append(dict(_id=member[0], host=member[1])) return ret def repl_managed(name, repls...
import string import re ###$ event <<expand-word>> ###$ win <Alt-slash> ###$ unix <Alt-slash> class AutoExpand: keydefs = { '<<expand-word>>': ['<Alt-slash>'], } unix_keydefs = { '<<expand-word>>': ['<Meta-slash>', '<Alt-slash>'], } menudefs = [ ('edit', [ ('...
# -*- coding: utf-8 -*- """verschemes.python module The Python verschemes module implements standard `Python <https://www.python.org/>`_ `versioning <https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work>`__. """ # Support Python 2 & 3. from __future__ import (absolute_import, ...
""" Django settings for tutorial project. Generated by 'django-admin startproject' using Django 1.9.2. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os ...
import unittest import unittest.mock as mock from ogn.parser import parse from ogn.client.client import create_aprs_login, AprsClient from ogn.client.settings import APRS_APP_NAME, APRS_APP_VER, APRS_KEEPALIVE_TIME class AprsClientTest(unittest.TestCase): def test_create_aprs_login(self): basic_login = c...
# 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 field 'DMUserProfile.location' db.add_column('accounts_dmuserprofile', 'location', sel...
''' Created on May 21, 2015 @author: Button ''' from src.bamm.common import config import re import traceback ascii_codes = None userlog = config.userlog modderslog = config.modderslog def _load_ascii_conversions(ascii_file): """Load ASCII conversions from file. The file is structured as a .property file...
""" Django settings for tomadasocial project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, .....
# author: Hasan Veldstra <hasan.veldstra@gmail.com> # license: MIT import os import fnmatch try: import simplejson as json except: import json def locate(pattern, root=os.getcwd()): """ Generate of all files in a directory that match the pattern. """ for path, dirs, files in os.walk(root): ...
#!/usr/bin/env python3 import json from two1.wallet import Wallet from two1.bitrequests import BitTransferRequests # set up bitrequest client for BitTransfer requests wallet = Wallet() requests = BitTransferRequests(wallet) # server address server_url = 'http://localhost:5000/' def buy_file(): # get the file l...
from __future__ import unicode_literals from __future__ import print_function from boto.s3.connection import S3Connection class S3Streamer(object): #def __init__(self, bucket_name, *key_names, s3_connection=None, key_is_prefix=False): def __init__(self, bucket_name, *key_names, **kwargs): """Create a...
from pycella.automaton.automaton import CA from pycella.GUI.console_display import display from pycella.automaton.rules import life_rules from pycella.automaton.rules import seeds_rules buff = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0,...
# 2020 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, api, fields from openerp.tools.safe_eval import safe_eval as eval class StockMoveAccountSource(models.Model): _name = "stock.move_account_source" _description = "Stock Move Account So...
# -*- coding: utf-8 -*- """ Barcodes for Python - Module for writing. Copyright 2009 Peter Gebauer Cairo backend for writing barcodes. "Barcodes for Python" 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, eithe...
## # Copyright 2013-2017 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://vscentrum.be/nl/en), # Flemish Research Foundation ...
# The MIT License (MIT) # # Copyright (c) 2015 WUSTL ZPLAB # # 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, modif...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# -*- encoding: utf-8 -*- # # 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, so...
## @file # process UI section generation # # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license...
from bs4 import BeautifulSoup as bs from urllib.request import urlopen from urllib.request import Request import threading import webbrowser from collections import OrderedDict class CKCrawler(object): def __init__(self, tid, keywod, p1, p2): homeData = self.getpageData(tid, 1) lastPage = int(home...
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
#!/usr/bin/env python # -*- 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...
# Copyright The ANGLE Project Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # Generates an Android.bp file from the json output of a 'gn desc' command. # Example usage: # gn desc out/Android --format=json "*" > desc.json # py...
# coding=utf-8 # Copyright 2021 The Edward2 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
''' Created on Jul 9, 2013 Updated on Aug 5, 2013 @author: Paul Reesman @param plan: A string copied from the output of the SapaReplan planner Finds the phrase 'getready' and 'EOP' and sends their indexes to low and high respectfully Copies only the text between 'getready' and 'EOP' into instruct_plan Loop...
import argparse import binascii from base64 import b64encode #parser = argparse.ArgumentParser(description='') #parser.add_argument('-c','--consensus', help='consensus filei of exit',required=True) #parser.add_argument('-p','--fingerprint', help='Input fingerprint file',required=True) #args = parser.parse_args() #fin...
import sys import numpy as np import os import os.path import argparse def parse_args(args=None): parser = argparse.ArgumentParser() parser.add_argument("--h1", default=None, type=float, help='RMSD threshold to helix 1' ) parser.add_argument("--h2", ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from .base import BaseDomainNameScanQuery class SubdomainEnumerationQuery(BaseDomainNameScanQuery): """ This is an Elasticsearch query class for querying SubdomainEnumerationModel objects. """ @classmethod def get_queried_class(cls):...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-22 04:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djstripe', '0024_auto_20170308_0757'), ] operations = [ migrations.AlterFie...
# This file is part of Checkbox. # # Copyright 2012, 2013 Canonical Ltd. # Written by: # Zygmunt Krynicki <zygmunt.krynicki@canonical.com> # # Checkbox 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 ...
# utils.py """Shared utility functions for the csvsee library. """ import csv import re import sys from datetime import datetime, timedelta from csvsee import dates class NoMatch (Exception): """Exception raised when no column name matches a given expression.""" pass def float_or_0(value): """Try to c...
from JumpScale9 import j import pssh.exceptions JSBASE = j.application.jsbase_get_class() class BaseJSException(Exception, JSBASE): def __init__(self, message="", level=1, source="", actionkey="", eco=None, tags="", msgpub=""): JSBASE.__init__(self) if j.data.types.string.check(level): ...
from Components.HTMLComponent import HTMLComponent from Components.GUIComponent import GUIComponent from Screen import Screen from Components.ActionMap import ActionMap from Components.Label import Label from ServiceReference import ServiceReference from enigma import eListboxPythonMultiContent, eListbox, gFont, iServi...
""" Test JSCuisine (core) """ import unittest from unittest import mock from JumpScale import j from JumpScale.tools.cuisine.JSCuisine import JSCuisine import JumpScale from JumpScale.tools.cuisine.ProcessManagerFactory import ProcessManagerFactory class TestJSCuisine(unittest.TestCase): def setUp(self): ...
""" Support for Rheem EcoNet water heaters. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.econet/ """ import datetime import logging import voluptuous as vol from homeassistant.components.climate import ( DOMAIN, PLATFORM_SCHEMA, STATE_ECO...
# echo-client.py # # Copyright (C) 2006-2017 wolfSSL Inc. # # This file is part of wolfSSL. (formerly known as CyaSSL) # # wolfSSL 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 Licens...
# Copyright 2008 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 required by applicable law or a...
#------------------------------------------------------------------------------ # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions describe...
# Module to receive MAVLink packets and forward telemetry via interoperability. # Packet details at http://mavlink.org/messages/common#GLOBAL_POSITION_INT. import logging import threading import time from auvsi_suas.proto.interop_api_pb2 import Telemetry from pymavlink import mavutil logger = logging.getLogger(__nam...
import datetime import numpy as np import pandas as pd from zipline.utils.pandas_utils import mask_between_time def is_sorted_ascending(a): """Check if a numpy array is sorted.""" return (np.fmax.accumulate(a) <= a).all() def validate_event_metadata(event_dates, event_timestamps...
# Test methods with long descriptive names can omit docstrings # pylint: disable=missing-docstring import unittest import numpy as np import scipy.sparse as sp from Orange.data import Table, Domain, ContinuousVariable from Orange.preprocess import Normalize from Orange.tests import test_filename class TestNormaliz...
# Copyright 2014 Technische Universitaet Berlin # 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 # # U...
#!/usr/bin/env python """ Script to check last update of core programstatus and service checks in Icinga ido2db Postgres database """ # # The latest version of this script lives at: # <https://github.com/jantman/nagios-scripts/blob/master/check_puppetdb_agent_run.py> # # Please file bug/feature requests and submit pat...
# # Copyright (c) 2015 Open-RnD Sp. z o.o. # # 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, # modify, merge, publ...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json from frappe import _dict import frappe.share from frappe import _ class UserPermissions: """ A user permission object can be accessed as `frappe.get_user()...
import time from animation import * from asteroidField import * from background import * from loader import * from physics import * from player import * from powerup import * import pygame from pygame.locals import * from rotatingMenu_img import * from spacemenu import * from starField import * # teclas dos jogadore...
# #windowShopping will take all of the Amazon HTMLs from a data structure and will retrieve all of the used/new prices import os import time from datetime import date from credentials import * from amazon.api import AmazonAPI from fileControls import loadFromFile, saveToFile #amazon credentials, from credentials file ...
# -*- coding: utf-8 -*- import os from string import Template, ascii_uppercase import itertools class CardMaker(object): def __init__(self, size): self.size = size self.elements = [] def make_card(self): raise NotImplemented() class MarkdownCardMaker(CardMaker): def make_card...
import Sofa import SofaPython import SofaPython.units import SofaPython.sml import SofaPython.SofaNumpy import Compliant.sml def createScene(node): node.dt=0.01 node.gravity=[0, -9.81, 0] node.createObject('RequiredPlugin', name = 'Compliant' ) node.createObject('CompliantAttachButtonSetting...
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
import os import sys import unittest import uuid rootDirectory = os.path.dirname(os.path.realpath('__file__')) if rootDirectory not in sys.path: sys.path.append(os.path.join(rootDirectory, '..')) from projectoxford.Client import Client class TestPersonGroup(unittest.TestCase): '''Tests the project oxford API...
""" These Flash commands allow more sophisticated operations, most of which may not be needed by most users. Some operations are specifically designed for testing and have little use in practice. """ import pyflag.pyflagsh as pyflagsh import pyflag.Registry as Registry import pyflag.DB as DB import fnmatch import pyfla...
''' The I{PICKS} class handles picked data. Created on 20.10.2010 @author: Karsten Mueller ''' class PICKS(): def __init__(self): self.trace = [] self.twt = [] self.x = [] self.y = [] self.elev = [] self.tell = 0 # counts the picks self.pltid = 0 # contr...
from keras import optimizers from keras.layers import Dense, Convolution3D, MaxPooling3D, ZeroPadding3D, Dropout, Flatten, BatchNormalization, LeakyReLU from keras.layers.wrappers import TimeDistributed from keras.models import Sequential, model_from_json class VideoToSpeechNet: def __init__(self, model): self._m...
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 Ircam # Copyright (c) 2016-2017 Guillaume Pellerin # Copyright (c) 2016-2017 Emilie Zawadzki # This file is part of mezzanine-organization. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
# -*- coding: utf-8 -*- # # into documentation build configuration file, created by # sphinx-quickstart on Sat Dec 6 16:03:44 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 # autogenerated file. # # All co...
import ha_engine.ha_infra as common LOG = common.ha_logging(__name__) class BaseRunner(object): def __init__(self, input_args): self.ha_report = [] self.input_args = {} if input_args: self.set_input_arguments(input_args) def set_input_arguments(self, input_args): ...
# -*- coding: utf-8 -*- """ ARIB外字 original: https://github.com/murakamiy/epgdump_py/blob/master/aribgaiji.py Copyright (C) 2011 Yasumasa Murakami. All Rights Reserved. """ GAIJI_MAP_TITLE = { 0x7A50: "[HV]", 0x7A51: "[SD]", 0x7A52: "[P]", 0x7A53: "[W]", 0x7A54: "[MV]", 0x7A55: "[手]", 0x7A...
#!/usr/bin/python -OO # This file is part of Archivematica. # # Copyright 2010-2012 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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, e...
""" Readables A readable plaque. """ from evennia import DefaultObject, Command, CmdSet from world import english_utils from evennia.utils import list_to_string from random import randint import time from typeclasses.objects import Object # the "read" command class CmdReadStatue(Command): """ ...
## # Copyright (c) 2005 Apple Computer, Inc. All rights reserved. # # 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...
# 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...
# -*- coding: utf-8 -*- # This file is part of wger Workout Manager. # # wger Workout Manager is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
from django.contrib.sitemaps import Sitemap, GenericSitemap from django.core.paginator import Paginator from .models import HealthFacility class HealthFacilitySitemap(Sitemap): changefreq = "monthly" priority = 0.6 def items(self): return HealthFacility.objects.all() def lastmod(self, obj):...
# # BitBake Process based server. # # Copyright (C) 2010 Bob Foerster <robert@erafx.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope t...
# -*- coding: utf-8 -*- # Copyright (c) 2016-present, CloudZero, Inc. All rights reserved. # Licensed under the BSD-style license. See LICENSE file in the project root for full license information. import pytest from reactor.aws.cloudtrail import traverse_map, CloudTrailEvent def test_traverse_map(): d = {'x': ...
#!/usr/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")...
# -*- coding: utf-8 -*- """ /*************************************************************************** InspectFeatures A QGIS plugin Builds a temp rubberband with a given size and shape. ------------------- begin : 2016-08-02 ...
from vsvlandb.models import Site, Subnet, Impact from flask.ext.wtf import Form from wtforms import TextField, SelectField, BooleanField, IntegerField from wtforms.validators import DataRequired, NumberRange, Optional, Length from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField, QuerySelectField def a...
# -*- coding: utf-8 -*- from numpy import zeros, ones, ix_ from pyfem.util.dataStructures import Properties from pyfem.util.dataStructures import elementData from scipy.sparse import lil_matrix import time ####################################### # General array assembly routine for: # # * assembleInternalForce ...
import controller.component from util import jsonmanager, debug, configuration from view.entity import Entity class Scene: def __init__(self, name, entities_data): self.name = name self.entities = [] self.started_entities = [] self.event_input = None self.cont_input = None ...
# =============================================================================== # Copyright 2011 Jake Ross # # 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/licens...
import random import numpy as np MIN = "[MIN" MAX = "[MAX" MED = "[MED" FIRST = "[FIRST" LAST = "[LAST" SUM_MOD = "[SM" END = "]" OPERATORS = [MIN, MAX, MED, SUM_MOD] # , FIRST, LAST] VALUES = range(10) VALUE_P = 0.25 MAX_ARGS = 5 MAX_DEPTH = 20 DATA_POINTS = 1000000 def generate_tree(depth): if depth < MAX_...
# -*- coding: utf-8 -*- # This file is part of pygal # # A python svg graph plotting library # Copyright © 2012-2016 Kozea # # 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...
# 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 field 'Expense.supplier' db.add_column('accounts_expense', 'supplier', self.gf('django.db.models....
# -*- coding: utf-8 -*- from functools import wraps from flask import session, request from common.utils import message from models.notebook import Notebook from models.page import Page from common import db def require_login(route_fn): """ Decorator for router functions that need user to login first. """ ...
import logging from pyroute2.netlink import NLM_F_REQUEST from pyroute2.netlink import NLM_F_DUMP from pyroute2.netlink.devlink import DevlinkSocket from pyroute2.netlink.devlink import devlinkcmd from pyroute2.netlink.devlink import DEVLINK_NAMES log = logging.getLogger(__name__) class DL(DevlinkSocket): def _...
############################################################################## # # Copyright (C) 2015 Comunitea Servicios Tecnológicos # $Carlos Lombardía Rodríguez <carlos@comunitea.com>$ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
# # CORE # Copyright (c)2012-2013 the Boeing Company. # See the LICENSE file included in this distribution. # # author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com> # ''' sdt.py: Scripted Display Tool (SDT3D) helper ''' from core.constants import * from core.api import coreapi from .coreobj import PyCoreNet, PyCore...
# -*- coding: utf-8 -*- # # 2016-04-08 Cornelius Kölbel <cornelius@privacyidea.org> # Avoid consecutive if statements # # privacyIDEA # May 11, 2014 Cornelius Kölbel, info@privacyidea.org # http://www.privacyidea.org # # This code is free software; you can redistribute it and/or # modify it under the te...
# coding: utf-8 """Configuration-related fuctionality and defaults.""" import codecs from datetime import datetime import os import yaml from publicstatic import const from publicstatic import errors from publicstatic.version import __version__ _params = {} # Configuration parameters _path = '' # Configuration fil...
# -*- coding: utf-8 -*- """ :copyright: Copyright 2013-2014 by Łukasz Mierzwa :contact: l.mierzwa@gmail.com """ from __future__ import unicode_literals import os import datetime import logging import tempfile import shutil import time import re from copy import deepcopy from mongoengine import (Document, Dat...
import os import sys from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker Base = declarative_base() class Person(Base): __tablename__ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # wsched.py -- a little script to extract my hours from the brutally hard-to-read # schedule spreadsheet at work. # # sample output: # # ner ~/dev/prj/scripts % python wsched.py ~/schedule.xls 1 # +-----------+-------+-----------+ # | Day | Date | Schedule | # +--...
from collections import OrderedDict import re import json import sublime import sublime_plugin from xml.etree import ElementTree as ET NS = 'http://telventdms.com/automatedtesting/repository/' # repo = etree.parse(r'D:\sources\AutoTests\3.4.1\Repos\builder.xml') # root = repo.getroot() # print(dir(root)) # print(roo...
#!/usr/bin/env python import cv2.cv import imutils import time import smach import smach_ros import rospy from std_msgs.msg import String from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError from approach_control_people.faces.Map import Map from approach_control_people.faces.ULBP import ULBP...
""" Main URL mapping configuration file. Include other URLConfs from external apps using method `include()`. It is also a good practice to keep a single URL to the root index page. This examples uses Django's default media files serving technique in development. """ from django.conf import settings from django.cont...