code
stringlengths
1
199k
import argparse, calc_delta from lib.cli import CLI from lib.utils import Logger def main(args): args.matrix_type = "BC" calc_delta.main(args) log = Logger() if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--reference", help="The reference BC matrix (.dat)") parser...
from os import getloadavg MAX_IDLE_LOAD = .09 def check_load(time_span, load): if load > MAX_IDLE_LOAD: print( " Won't sleep because %i minute load average" % time_span, "of %.2f is above threshold of %.2f." % (load, MAX_IDLE_LOAD) ) exit(1) loads = getloadavg() check_load(1, loads[0]) check_l...
import pygame from const import * class MultiSprite(object): def __init__(self, path, res_x, res_y=None, offX=0, offY=0, gX=0, gY=0): """path = file path of the Multi sprite. res_x and res_y are the X, Y size of each sub sprite. offX and offY can specify an internal offset which are applied inside of a fie...
""" Provider bootstrapping """ import logging import socket import os import sys import requests from leap.bitmask import provider from leap.bitmask import util from leap.bitmask.config import flags from leap.bitmask.config.providerconfig import ProviderConfig, MissingCACert from leap.bitmask.provider import get_provid...
from lxml import etree import requests import re def getResource(word): r = requests.get("http://www.dictionaryapi.com/api/v1/references/learners/xml/"+word+"?key=508b6e11-3920-41fe-a57a-d379deacf188") return r.text[39:] def isWord(entry,word): g=re.compile(entry) return re.fullmatch(word+"\[*\d*\]*",en...
from qit.base.type import Type class File(Type): pass_by_value = True def build(self, builder): return "FILE*"
import sigtools from scipy import linalg from scipy.fftpack import fft, ifft, ifftshift, fft2, ifft2, fftn, \ ifftn, fftfreq from numpy import polyadd, polymul, polydiv, polysub, roots, \ poly, polyval, polyder, cast, asarray, isscalar, atleast_1d, \ ones, real_if_close, zeros, array, arange, wh...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: dellemc_idrac_nic short_description: Configure iDRAC Network settings version_added: "2.3" description: - Configure iDRAC Network settings option...
import os import sys sys.path.append(os.path.join(os.getcwd(), os.path.pardir)) import unittest from digraph import digraph from graph import graph from graph_algorithms import * class test_graph(unittest.TestCase): def setUp(self): self.gr = graph() self.gr.add_nodes(["s", "a", "b", "c", "d", "e", ...
import random import math import collections import tree_decomposition as td import create_production_rules as pr import graph_sampler as gs import stochastic_growth import probabilistic_growth import net_metrics import matplotlib.pyplot as plt import product import networkx as nx import numpy as np import snap G = nx....
print " __ " print " |__|____ ___ __ " print " | \__ \\\\ \/ / " print " | |/ __ \\\\ / " print " /\__| (____ /\_/ " print " \______| \/ " print " ...
from django.test import TestCase, tag from member.tests.test_mixins import MemberMixin from django.contrib.auth.models import User from django.test.client import RequestFactory from django.urls.base import reverse from enumeration.views import DashboardView, ListBoardView class TestEnumeration(MemberMixin, TestCase): ...
""" Eric6 Documentation Generator. This is the main Python script of the documentation generator. It is this script that gets called via the source documentation interface. This script can be used via the commandline as well. """ from __future__ import unicode_literals import Toolbox.PyQt4ImportHook # __IGNORE_WARNING...
from .circumcision_model_mixin import CircumcisionModelMixin from .crf_model_mixin import CrfModelManager, CrfModelMixin from .detailed_sexual_history_mixin import DetailedSexualHistoryMixin from .hiv_testing_supplemental_mixin import HivTestingSupplementalMixin from .mobile_test_model_mixin import MobileTestModelMixin...
import urllib import urllib2 import xml.dom.minidom import re import socket from util import hook chatbot_re = (r'(^.*\b(taiga|taigabot)\b.*$)', re.I) @hook.regex(*chatbot_re) @hook.command def chatbot(inp, reply=None, nick=None, conn=None): inp = inp.group(1).lower().replace('taigabot', '').replace('taiga', '').re...
"""Smoke tests to check installation health :Requirement: Installer :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: Installer :Assignee: desingh :TestType: Functional :CaseImportance: High :Upstream: No """ import re import pytest from robottelo import ssh from robottelo.config import settings from ro...
from operator import itemgetter __author__ = 'davide' def pairwise(l): for t in zip(l, l[1:]): yield t def pijavskij(f, L, a, b, eps=1E-5): l = [(a, f(a)), (b, f(b))] while True: imin, Rmin, xmin = -1, float("inf"), -1 for i, t in enumerate(pairwise(l)): (xi, fi), (xj, fj...
DEBUG = False CYCLADES_BASE_URL = "https://compute.example.synnefo.org/compute/" POLL_LIMIT = 3600 ADMIN_STATS_PERMITTED_GROUPS = ["admin-stats"] CYCLADES_SNAPSHOTS_ENABLED = True CYCLADES_SHARED_RESOURCES_ENABLED = False RESCUE_ENABLED = False CYCLADES_DEFAULT_SERVER_NETWORKS = [] CYCLADES_FORCED_SERVER_NETWORKS = [] ...
digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} found = True while found: input_string = input('Please give me some digits... \n') found = False for character in input_string: if character not in digits: # we have a non digit! print('Error, you gave me non digits'...
"""File format specific behavior.""" from weblate.formats.convert import ( HTMLFormat, IDMLFormat, OpenDocumentFormat, PlainTextFormat, WindowsRCFormat, ) from weblate.formats.helpers import BytesIOMode from weblate.formats.tests.test_formats import AutoFormatTest from weblate.trans.tests.utils impo...
from hipart.gint.gint_ext import gaux import numpy from scipy.special import erf def test_gaux(): for t in 0.1, 0.5, 0.7, 1.0, 2.0, 4.0: u1 = gaux(t, 0) u2 = numpy.sqrt(numpy.pi/t)/2*erf(numpy.sqrt(t))
import numpy as np def tran_op(op, tmat): """ transform quantum operator from representation A to another representation B Args: op: the matrix form of operator in representation A tmat: the unitary transform matrix """ return np.dot(np.dot(np.conj(np.transpose(tmat)), op), tma...
import textacy.texts as ttx import textacy.preprocess as pre import feedparser as fp class FeedCorpus(ttx.TextCorpus): """ Extends textacy TextCorpus with methods for feeds """ def from_feed(self, url): fdict = fp.parse(url) for entry in fdict.entries: # Each entry may have m...
AGO_TELLSTICK_VERSION = '0.0.9' """ __author__ = "Joakim Lindbom" __copyright__ = "Copyright 2014, Joakim Lindbom" __credits__ = ["Joakim Lindbom", "The ago control team"] __license__ = "GPL Public License Version 3" __maintainer__ = "Joakim Lindbom" __email__ = 'Joakim.Lindbom@gmail.com' __status__ ...
from emu import * import sys import json import msgpack from xbos import get_client from bw2python.bwtypes import PayloadObject import time with open("params.json") as f: try: params = json.loads(f.read()) except ValueError as e: print "Invalid parameter file" sys.exit(1) emu_instance = ...
__author__ = 'Piratf' from pygame.locals import * import pygame class Div(object): """small panel in the frame""" def __init__(self, (width, height), (x, y) = (0, 0)): # super(Div, self).__init__() self.width = width self.height = height self.x = x; self.y = y; se...
import ConfigParser, sys, os, urllib2, json, time, shutil, filecmp import Levenshtein config = ConfigParser.ConfigParser() config.read("config.ini") def clean(chaine): #print chaine return chaine.lower().strip() def decode(chaine): chaine = chaine.replace(u"\u2018", "'").replace(u"\u2019", "'") try: ...
from api.callers.api_caller import ApiCaller class ApiSystemStats(ApiCaller): endpoint_url = '/system/stats' endpoint_auth_level = ApiCaller.CONST_API_AUTH_LEVEL_DEFAULT request_method_name = ApiCaller.CONST_REQUEST_METHOD_GET
import sys, os, json, time from shapely.geometry import Polygon contains = {} intersects = {} dPoly = {} unmatched = [] TRACTCOL = 'BoroCT2010' # rename this for 2000 census def addPoly(coords): polys = [] if (isinstance(coords[0][0], float)): polys.append(Polygon(coords)) else: for (c) in c...
from .config import ConfigAggregator from .dialplan import DialplanAggregator from .file import FileReader from .func_odbc import FuncOdbcAggregator class FileConfigParser(ConfigAggregator, FileReader): pass class FileDialplanParser(DialplanAggregator, FileReader): pass class FileFuncOdbcParser(FuncOdbcAggregat...
from __future__ import print_function from __future__ import division import numpy as np np.set_printoptions(threshold=np.inf) import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.colors import LogNorm import math import gym as gym from PIL import Image from PIL import ImageOps from collections imp...
import re from utilRegex import database class regex: def __init__(self, botCfg): """class initialization function """ #intitialize database variables self.db = database() #initialize regex variables self.phrase = '' self.url = '' #initialize stat...
from django.core.management.base import BaseCommand from django.db.models import Q from ajapaik.ajapaik.models import Album class Command(BaseCommand): help = 'Connects to TartuNLP API and retrieves neuro machine translations for empty name fields' def handle(self, *args, **options): albums = Album.obje...
from xlrd import open_workbook import random import math filename = 'Wheat-price-data.xlsx' def importExcel(filename): #this function is a very ugly, and not that effecient. but it should work... excel = open_workbook(filename) #extract data from excel sheet for sheet in excel.sheets(): number_o...
""" A SpriteSheet is the overall collection of individual frames (which may be spread across files) that define one layer of the final sprite. """ from models.sprite_action import SpriteAction class SpriteSheet(): def __init__( self, data, group_name ): if "file_path" not in data: raise "file_pa...
from pupa.scrape import Jurisdiction, Organization from .people import IDPersonScraper from .committees import IDCommitteeScraper from .bills import IDBillScraper class Idaho(Jurisdiction): """ IDAHO Scraper """ division_id = "ocd-division/country:us/state:id" classification = "government" name ...
'''This script would guide the seafile admin to setup seafile with MySQL''' import sys import os import time import re import shutil import glob import subprocess import hashlib import getpass import uuid import warnings import MySQLdb from ConfigParser import ConfigParser try: import readline # pylint: disable=W06...
from __future__ import unicode_literals from django.db import migrations import django.db.models.deletion import mptt.fields class Migration(migrations.Migration): dependencies = [ ('laboratory', '0034_group_perms'), ] operations = [ migrations.RemoveField( model_name='laboratory...
import re import time import pycurl from module.network.HTTPRequest import BadHeader from ..internal.Account import Account class OneFichierCom(Account): __name__ = "OneFichierCom" __type__ = "account" __version__ = "0.23" __status__ = "testing" __description__ = """1fichier.com account plugin""" ...
import os from cloudinit import util def handle(name, cfg, cloud, log, _args): # If there isn't a salt key in the configuration don't do anything if 'salt_minion' not in cfg: log.debug(("Skipping module named %s," " no 'salt_minion' key in configuration"), name) return sal...
__author__ = """Kevin Wierman""" __email__ = 'kevin.wierman@pnnl.gov' __version__ = '0.1.0'
from ..provider.g5k import G5K from constants import SYMLINK_NAME from functools import wraps import os import yaml import logging def load_env(): env = { 'config' : {}, # The config 'resultdir': '', # Path to the result directory 'config_file' : '', # The initial config file ...
'''Enhanced Thread with support for return values and exception propagation.''' import threading, sys class REThread(threading.Thread): '''Thread with return values and exception propagation.''' def __init__(self, group=None, target=None, name=None, args=(), kwargs={}, verbose=None): '''Init...
import json from django.template.loader import render_to_string def format_reading(probe_name, json_payload): item = json.loads(json_payload) status = item['DEVICE_ACTIVE'] if item['DEVICE_ACTIVE'] is True: status = "Active" elif item['DEVICE_ACTIVE'] is False: status = "Inactive" re...
import numpy as np import os import pandas as pa import scipy.stats as stats import unittest from pbsea import PandasBasedEnrichmentAnalysis, EnrichmentAnalysisExperimental, preprocessing_files from unittest.mock import patch test_data_directory = 'test_data/' test_data_directory_cdf = test_data_directory + 'test_cdf/'...
try: from setuptools import setup except ImportError: from distutils.core import setup setup(name='agarnet', packages=['agarnet'], py_modules=['agarnet'], version='0.2.4', description='agar.io client and connection toolkit', install_requires=['websocket-client>=0.32.0'], auth...
# Copyright (C) 2016 Zhang Chang-kai # # Contact via: phy.zhangck@gmail.com # # General Public License version 3.0 # '''Initialization of All Modules''' from Foundation import * from Elementary import * from Structure import *
import os import string username="username" password="password" com="wget -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate" temp=os.popen(com) msg=temp.read() index=string.find(msg,"<fullcount>") index2=string.find(msg,"</fullcount>") fc=int(msg[index+11:index2]) if fc==0: ...
"""todolist URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
from ..base import E_APP_ARG_BADOPT, App, AppArg class AppOrExten(AppArg): def validate(self, arg, where): if arg not in ('app', 'exten'): E_APP_ARG_BADOPT( where, argno=self.argno, app=self.app, opts=arg) class Originate(App): def __init__(self): super().__init__( ...
import arff import numpy as np import sys from sklearn import preprocessing from sklearn.ensemble import ExtraTreesClassifier from sklearn.feature_selection import RFE from sklearn.pipeline import Pipeline from sklearn.grid_search import GridSearchCV from sklearn.cross_validation import StratifiedKFold from sklearn imp...
from LMS7002_base import * class LMS7002_DCCAL(LMS7002_base): __slots__ = [] # Used to generate error on typos def __init__(self, chip): self.chip = chip self.channel = None self.prefix = "DCCAL_" # # DCCAL_CFG (0x05C0) # # DCMODE @property def DCMODE(self): ...
from __future__ import unicode_literals import frappe from frappe import _, throw from frappe.utils import flt, cint, add_days, cstr, add_months import json from erpnext.accounts.doctype.pricing_rule.pricing_rule import get_pricing_rule_for_item, set_transaction_type from erpnext.setup.utils import get_exchange_rate fr...
import logging class DelayedGcode: def __init__(self, config): self.printer = config.get_printer() self.reactor = self.printer.get_reactor() self.name = config.get_name().split()[1] self.gcode = self.printer.lookup_object('gcode') gcode_macro = self.printer.load_object(config...
import os import math import logging import numpy as np import scipy as sp from hyperspy.defaults_parser import preferences from hyperspy.misc.physical_constants import R, a0 from hyperspy.misc.eels.base_gos import GOSBase from hyperspy.misc.elements import elements from hyperspy.misc.export_dictionary import ( exp...
import facedetect import cv2 def test_fd(): image = cv2.imread('abba.jpg') print image.shape FD = facedetect.FeatureDetect(image) FD.detectEyes() FD.detectFace() print FD.features if __name__ == '__main__': test_fd()
import unittest """754. Reach a Number https://leetcode.com/problems/reach-a-number/description/ You are standing at position `0` on an infinite number line. There is a goal at position `target`. On each move, you can either go left or right. During the _n_ -th move (starting from 1), you take _n_ steps. Return the min...
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import from horton.meanfield.test.common import helper_compute def test_project_msg_identical(): mol = IOData.from_file(context.get_fn('test/water_sto3g_hf_g03.fchk')) exp = mol.lf.create_expansion() project_orbitals_mgs(mol.obasis, mol...
from Tkinter import * from ttk import * from ScrolledText import ScrolledText as Text from PIL import Image, ImageTk import tkFileDialog,os,cairo,tempfile,time,shutil,tkFont from laveqed import laveqed from rsvg_windows import rsvg_windows try: import rsvg except ImportError: rsvg=rsvg_windows() # Untested TITL...
from collections import deque class Text: #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # def __init__(self, text_first_object, text_other_object, time_getter, interval): self._text_first = text_first_obje...
""" EVE Swagger Interface An OpenAPI for EVE Online OpenAPI spec version: 0.4.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class GetKillmailsKillmailIdKillmailHashInternalServerError(object): """ NOTE: This ...
from __future__ import absolute_import, division, print_function __metaclass__ = type class ModuleDocFragment(object): # Foreman documentation fragment DOCUMENTATION = ''' requirements: - requests options: server_url: description: - URL of the Foreman server. - If the value is not specified ...
'''Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} DOCUMENTATION = ''' --- module: fortios_firewall_vip6 short_description: Configure virtual IP...
from .wizard import Wizard, StateView, StateTransition, StateAction, Button __all__ = ['Wizard', 'StateView', 'StateTransition', 'StateAction', 'Button']
from django import forms from django.contrib.admin.widgets import AdminDateWidget from django.forms import ModelForm from basic.models import * from battles.models import * from itertools import chain def getMemberAsOptions(): members = Member.objects.all() return [(member.id, member.get_username()) for member in mem...
from scap.Model import Model import logging logger = logging.getLogger(__name__) class ChoiceGroupType(Model): MODEL_MAP = { 'elements': [ {'tag_name': 'choice', 'list': 'choices', 'class': 'ChoiceType', 'min': 1}, ], 'attributes': { 'id': {'type': 'ChoiceGroupIDPatte...
from south.db import db from django.db import models from albums.models import * class Migration: def forwards(self, orm): # Deleting field 'AlbumItem.slug' db.delete_column('albums_albumitem', 'slug') def backwards(self, orm): # Adding field 'AlbumItem.slug' db.add_column('album...
import gobject from kupfer import pretty from kupfer.core import settings from kupfer.core.settings import UserNamePassword __all__ = [ "UserNamePassword", "PluginSettings", "check_dbus_connection", ] def _is_core_setting(key): return key.startswith("kupfer_") class PluginSettings (gobject.GObject, pretty.OutputMix...
""" Loading a configuration ~~~~~~~~~~~~~~~~~~~~~~~ Various aspects of PyPhi's behavior can be configured. When PyPhi is imported, it checks for a YAML file named ``pyphi_config.yml`` in the current directory and automatically loads it if it exists; otherwise the default configuration is used. .. only:: never This ...
from __future__ import (absolute_import, unicode_literals) from mantidqt.utils.qt import import_qtlib ManageUserDirectories = import_qtlib('_widgetscore', 'mantidqt.widgets', 'ManageUserDirectories')
from django.conf import settings from django.contrib.auth.models import User from django.db import models class QuestionSet(models.Model): ''' Тест. Состоит из нескольких вопросов ''' author = models.ForeignKey(User, on_delete=models.CASCADE) title = models.CharField(max_length=255) created ...
from .synonym import *
import os import pwd import grp import argparse import shutil from twisted.web import server, resource, static, script from twisted.internet import reactor from zope.interface import Interface, Attribute, implements from twisted.python.components import registerAdapter from twisted.web.server import Session import glob...
import random import re from io import BytesIO from typing import Awaitable, List import matplotlib.pyplot as plt import seaborn as sns from curio.thread import async_thread from curious.commands import Context, Plugin from curious.commands.decorators import autoplugin, ratelimit from yapf.yapflib.style import CreatePE...
from django.utils.translation import ugettext_lazy as _ from oioioi.base.menu import MenuRegistry from oioioi.base.permissions import not_anonymous from oioioi.contests.utils import contest_exists top_links_registry = MenuRegistry(_("Top Links Menu"), contest_exists & not_anonymous)
""" Copyright (C) 2012 mountainpenguin (pinguino.de.montana@googlemail.com) <http://github.com/mountainpenguin/pyrt> This file is part of pyRT. pyRT 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 Foundati...
""" Created on Feb 15, 2014 @author: alex """ from sqlalchemy import Column from sqlalchemy.types import SmallInteger from sqlalchemy.types import Unicode from .meta import Base class ParameterType(Base): """ classdocs """ __tablename__ = 'ParameterTypes' _id = Column(SmallInteger, primary_key=True,...
import glob from os import path import shutil import textwrap from unittest import TestCase from run_pipeline import maincli from tests import helpers from tests.helpers import ( FILES, PIPELINES_DIR, TMPDIR, ) class PipelineRunTestcase(TestCase): """Tests all example pipeline YAMLs under ./pipelines wi...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "arsoft.web.crashupload.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import copy import re import sys from ansible import constants as C from ansible.plugins.action.network import ActionModule as ActionNetworkModule from ansible.module_utils.network.common.utils import load_provider from ansible.modu...
import os import unittest from vsg.rules import ieee from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_500_test_input.vhd')) lExpected_lower = [] lExpected_lower.append('') utils.read_file(os.path.join(sTestD...
import numpy as np from math import floor from ..weight import RankingBasedSelection class PBILSelection(RankingBasedSelection): """ This selection scheme is used by PBIL and compact GA. Also, PBIL selection scheme also used in natural gradient update with Bernoulli distribution. See also, [Shirakaw...
import optunity import numpy as np import hpolib_generator as hpo import cloudpickle as pickle import sklearn.datasets import random positive_digit = 2 name='covtype-%d' % positive_digit num_folds=5 budget = 150 npos = 500 nneg = 1000 search={'logC': [-8, 1], 'logGamma': [-8, 1]} covtype = sklearn.datasets.fetch_covtyp...
from glob import glob import re import matplotlib.pyplot as plt import numpy as np from sys import argv def get_a1(pattern): a1 = {} for fit_file in glob(pattern): with open(fit_file) as f: line = f.readline() coeffs = line.split(' ') fit_params = fit_file.split('-') ...
from odoo import models, fields, api from ./eqpt_equipment import EQPT_TYPES class Paddler(models.Model): _name = 'eqpt.paddler' _description = "Paddler Cycle Equipment" _description = "Cycle paddler equipment" eqpt_type = fields.Selection(selection=EQPT_TYPES, string="") eqpt_id = fields.Reference(...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: vmware_local_role_manager short_description: Manage local roles on an ESXi host descripti...
import f311.filetypes as ft def test_DataFile(): _ = ft.DataFile() print(_) def test_FileFits(): _ = ft.FileFits() print(_) def test_FilePy(): _ = ft.FilePy() def test_FileSQLiteDB(): _ = ft.FileSQLiteDB() def test_FileSpectrum(): _ = ft.FileSpectrum() print(_) def test_FileSpectrumFits(...
import time import Adafruit_CharLCD as LCD lcd_rs = 27 # Change this to pin 21 on older revision Raspberry Pi's lcd_en = 22 lcd_d4 = 25 lcd_d5 = 24 lcd_d6 = 23 lcd_d7 = 18 lcd_red = 4 lcd_green = 17 lcd_blue = 7 # Pin 7 is CE1 lcd_columns = 16 lcd_rows = 2 lcd = LCD.Adafruit_RGBCharLCD(lcd_rs, lcd_en, lcd_d4, l...
import sys, os extensions = [] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'SRL 5' copyright = u'2010, SRL Developers' version = '5' release = '1' exclude_trees = ['_build'] pygments_style = 'sphinx' html_theme = 'nature' html_static_path = ['_static'] htmlhelp_basename = 'SRL...
""" A simple example of how to get or set environment variables from python """ import os print(os.environ['USER']) if 'HOSTNAME' in os.environ: print(os.environ['HOSTNAME']) else: print( 'you dont have a HOSTNAME in your environment, it is probably just a shell variable') del os.environ['USER'] assert ...
from glob import glob from distutils.core import setup setup( name="mythutils_recfail_alarm", version="1.0", description="Autoamtically notify on Recorder Failed via Prowl service", author="Wylie Swanson", author_email="wylie@pingzero.net", url="http://www.pingzero.net", scripts=glob("bin/*"), data_files=[ ( ...
import copy, time, StringIO import unittest from datetime import datetime from datetime import date from nive.utils.dataPool2.structure import * from nive.tests import __local from nive.utils.dataPool2.tests import test_Base ftypes = {} ftypes[u"data2"] = {u"fstr":"string", u"ftext":"text", ...
""" Copyright (C) 2017, California Institute of Technology This file is part of addm_toolbox. addm_toolbox 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 l...
from rest_framework import viewsets, mixins from .models import Member from .serializers import MemberSerializer, MemberDetailSerializer class MembersViewSet (viewsets.ReadOnlyModelViewSet): serializer_class = MemberSerializer queryset = Member.objects def list(self, request, **kwargs): response = s...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import posgradmin.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('posgradmin'...
import web import time import timeit from collections import deque from sys import exit, exc_info, argv import math import os localport = os.environ.get('PORT', 8080) from cStringIO import StringIO clock = timeit.default_timer; web.config.debug = False; urls = ( '/u','controller', '/u2','controller2', '/err...
natural_language = [ 'Natural Language :: Portuguese (Brazilian)', ]
""" This file is part of XBMC Mega Pack Addon. Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License...
import sys from gossip import Node if __name__ == '__main__': server_port = sys.argv[1] peers = sys.argv[2:] n = Node(server_port, peers) while True: pass