text
stringlengths
12
6.59M
import requests from workflow.models import Country, TolaUser, TolaSites, Organization, WorkflowLevel1, WorkflowLevel2 import json def get_headers(): """ Authentication for Tables Get the header information to send to tables in the request :return: headers """ tables = TolaSites.objects.get(si...
from django.contrib import admin from .models import Task admin.site.register(Task)
#!/usr/bin/env python # -*- coding: UTF-8 -*- # authors: # Tony Vattathil tonynv@amazon.com, avattathil@gmail.com # Shivansh Singh sshvans@amazon.com, # Santiago Cardenas sancard@amazon.com, # Jay McConnell jmmccon@amazon.com, # # repo: https://github.com/aws-quickstart/taskcat # docs: https://aws-quickstart.github.io/...
import discord from discord.ext import commands # import asyncio import json # import io # import random import datetime # import random import aiohttp from collections import namedtuple class Watashi(commands.Bot): def __init__(self, config_path: str, *args, **kwargs): self.config_path = config_path ...
import logging from datetime import datetime, timedelta from celery import shared_task from django.conf import settings from django.core.management import call_command from bluebottle.utils.utils import get_class from .exception import AnalyticsException logger = logging.getLogger(__name__) @shared_task def queue_...
#!/usr/bin/python __version__ = "0.0.1" __author__ = "david" __email__ = "db@d1b.org" import argparse import csv import json from multiprocessing import Process import os import socket import time import netaddr from netaddr import EUI from scapy.all import sniff, ARP def get_hostname(ip): try: ret = socket.geth...
import urlparse from django.contrib import admin from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.html import format_html, mark_safe from django.template.loader import render_to_string from polymorphic.admin import (PolymorphicParentModelAdmin, ...
from django.contrib.auth.models import User from django.conf.urls.defaults import url from django.core.urlresolvers import reverse from tastypie.bundle import Bundle from tastypie.resources import ModelResource from tastypie import fields from tastypie.authentication import BasicAuthentication from tastypie.authorizati...
from enum import IntEnum from pydantic import BaseModel, Schema class FooBar(BaseModel): count: int size: float = None class Gender(IntEnum): male = 1 female = 2 other = 3 not_given = 4 class MainModel(BaseModel): """ This is the description of the main model """ foo_bar: FooB...
''' ------------------------------------------ Red9 Studio Pack: Maya Pipeline Solutions Author: Mark Jackson email: rednineinfo@gmail.com Red9 blog : http://red9-consultancy.blogspot.co.uk/ MarkJ blog: http://markj3d.blogspot.co.uk ------------------------------------------ This is the heart of the Red9 StudioPack's...
''' ------------------------------------------ Red9 Studio Pack: Maya Pipeline Solutions Author: Mark Jackson email: rednineinfo@gmail.com Red9 blog : http://red9-consultancy.blogspot.co.uk/ MarkJ blog: http://markj3d.blogspot.co.uk ------------------------------------------ This is the heart of the Red9 StudioPack's...
'''versionizer.py Creates new version of a book ''' import os from bs4 import BeautifulSoup from bookhelper import Book, doi, utils from . import BookAction class VersionizeAction(BookAction): def validate(self): if not self.conf.no_doi: bookdoi = doi.BookDoi(self.conf) bookdoi.v...
# # range.py # # statbot - Store Discord records for later analysis # Copyright (c) 2017 Ammon Smith # # statbot is available free of charge under the terms of the MIT # License. You are free to redistribute and/or modify it under those # terms. It is distributed in the hopes that it will be useful, but # WITHOUT ANY W...
import datetime import json import math import os import cherrypy import azureutil import util class Image: @util.expose @util.protect @util.db @util.auth def get(self, entity=None, entity_id=None, **kwargs): if not entity or not entity_id: raise cherrypy.HTTPError(404) ...
from abc import ABC, abstractmethod from slm_lab.agent.net import net_util import pydash as ps import torch import torch.nn as nn class Net(ABC): '''Abstract Net class to define the API methods''' def __init__(self, net_spec, in_dim, out_dim): ''' @param {dict} net_spec is the spec for the ne...
#!/usr/bin/python # weather(){ curl -s "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-<YOURZIPORLOCATION>}"| import urllib2 from urllib import quote import termcolor import argparse import json import asciiweather APIKEY = 'dc619f36b5360543' APIURL = "http://api.wunderground.com/api/" + ...
#!/usr/bin/env python # # Copyright (c) 2017, DjaoDjin inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this ...
import codecs import os import string import unicodedata path = os.path.dirname(__file__) class Normalizr: """ This class offers methods for text normalization. Attributes: language (string): Language used for normalization. """ __punctuation = set(string.punctuation) __stop_words = ...
############################TESTS ON POTENTIALS################################ from __future__ import print_function, division import os import sys import numpy import pynbody from galpy import potential _TRAVIS= bool(os.getenv('TRAVIS')) #Test whether the normalization of the potential works def test_normalize_poten...
"""The WaveBlocks Project This file contains code for computing the eigenstates of a given potential in terms of Hagedorn wavepackets. @author: R. Bourquin @copyright: Copyright (C) 2012, 2013, 2014 R. Bourquin @license: Modified BSD License """ import argparse from numpy import (argsort, atleast_1d, atleast_2d, com...
import nosqlite from fields import Field from exceptions import ValidationError try: import config as base_config except ImportError: base_config = None class Schema: @staticmethod def get_config(): config = dict() if base_config: config = vars(base_config) if 'D...
import json import os.path import time from urllib.request import urlopen import urllib.error from django.core.urlresolvers import reverse from django.shortcuts import render, redirect from django.http \ import HttpResponse, JsonResponse, HttpResponseNotFound, HttpResponseBadRequest from django.conf import setting...
import re import warnings from datetime import datetime from distutils.version import LooseVersion from functools import partial import numpy as np import pandas as pd from pandas.errors import OutOfBoundsDatetime from ..core import indexing from ..core.common import contains_cftime_datetimes from ..core.formatting i...
class Solution(object): def isMatch(self, s, p): """ :type s: str :type p: str :rtype: bool """ if s == p: return True elif s == '': return False p += '!' p = p.split('*') length = len(s) piece = len(p) ...
#!/usr/bin/python # # Copyright 2014 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...
#!/usr/bin/python # # Copyright 2014 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
#!/usr/bin/env python3 import sys import json from json import JSONDecodeError from base64 import b64decode from pathlib import Path from argparse import ArgumentParser from ipaddress import ip_address, IPv4Address, AddressValueError from subprocess import Popen, PIPE, TimeoutExpired from urllib.parse import urlparse, ...
import ast import ctypes import llvm import llvm.core as lc import llvm.passes as lp import llvm.ee as le #from ._ext import make_ufunc from .llvm_types import _int32, _intp, _LLVMCaster #from .multiarray_api import MultiarrayAPI # not used from .symtab import Variable from . import _numba_types as _types from ._n...
import os import sys import imp from glob import glob __all__ = ['PackageLoader'] class PackageLoader: def __init__(self, verbose=False): """ Manages loading NumPy packages. """ self.parent_frame = frame = sys._getframe(1) self.parent_name = eval('__name__',frame.f_globals,frame....
from flask import Flask, render_template, json, request,session,redirect,url_for from flask.ext.mysql import MySQL from werkzeug import generate_password_hash, check_password_hash from tools.MysqlBase import * import hashlib mysql = MysqlBase('python') app = Flask(__name__) app.secret_key = 'F12Zr47j\3yX R~X@H!jmM]L...
""" Functions in the ``as*array`` family that promote array-likes into arrays. `require` fits this category despite its name not matching this pattern. """ from __future__ import division, absolute_import, print_function from .overrides import set_module from .multiarray import array __all__ = [ "asarray", "asa...
import io import os import queue import re import socket import socketserver import ssl import sys import time import traceback import threading #Module details name = 'web.py' version = '0.1' #Server details server_version = name + '/' + version http_version = 'HTTP/1.1' http_encoding = 'iso-8859-1' default_encoding...
""" Machine limits for Float32 and Float64 and (long double) if available... """ __all__ = ['finfo'] from machar import MachAr import numpy.core.numeric as numeric import numpy.core.numerictypes as ntypes from numpy.core.numeric import array def _frz(a): """fix rank-0 --> rank-1""" if a.ndim == 0: a.shape =...
"""Test radix sorting algorithm sorts properly.""" def test_radix_sort_empty(): """Sort an empty list.""" from src.radix_sort import radix_sort assert radix_sort([]) == [] def test_radix_sort_one_number(): """Sort a list containing a single number.""" from src.radix_sort import radix_sort as...
"""Snappi Generator Generates a python package based on the Open Traffic Generator openapi.yaml file. Generation rules for this file are in GENERATORRULES.md TBD: - response class generation - DONE - Api return response instance - DONE - constants - DONE - parent, choice in child choice classes - packet slicing usi...
#!/usr/bin/python # -*- coding: utf-8 -*- import os import re from HTMLParser import HTMLParseError from time import time import requests from bs4 import BeautifulSoup from app import logger from http_cache import http_get from http_cache import is_response_too_large from oa_local import find_normalized_license from...
""" Utility function to facilitate testing. """ import os import sys import time import math __all__ = ['assert_equal', 'assert_almost_equal','assert_approx_equal', 'assert_array_equal', 'assert_array_less', 'assert_array_almost_equal', 'jiffies', 'memusage', 'rand', 'runstring'] def...
############################################################################ ## ## Copyright (C) 2006-2010 University of Utah. All rights reserved. ## ## This file is part of VisTrails. ## ## This file may be used under the terms of the GNU General Public ## License version 2.0 as published by the Free Software Foundat...
""" Docker Hub OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/docker.html """ from social.backends.oauth import BaseOAuth2 class DockerOAuth2(BaseOAuth2): name = 'docker' ID_KEY = 'user_id' AUTHORIZATION_URL = 'https://hub.docker.com/api/v1.1/o/authorize/' ACCESS_TOKEN_URL = '...
""" Back compatibility utils module. It will import the appropriate set of tools """ from __future__ import division, absolute_import, print_function import warnings # 2018-04-04, numpy 1.15.0 ImportWarning # 2019-09-18, numpy 1.18.0 DeprecatonWarning (changed) warnings.warn("Importing from numpy.testing.utils is de...
""" Pocket OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/pocket.html """ from social.backends.base import BaseAuth from social.utils import handle_http_errors class PocketAuth(BaseAuth): name = 'pocket' AUTHORIZATION_URL = 'https://getpocket.com/auth/authorize' ACCESS_TOKEN_URL =...
''' Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
# # Collective Knowledge (individual environment - setup) # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net # import os ############################################################################## # ...
__author__ = 'Jonas I Liechti' import random from numpy import vectorize, array, where, absolute, zeros, count_nonzero from numpy import random as nrand from numpy import copy as n_copy from numpy.ma import divide from numpy import append as n_append from numpy import sum as n_sum from numpy import max as n_max from Qu...
# Copyright 2015 IBM 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
# Copyright 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
from qtpy.QtWidgets import QMainWindow, QApplication from qtpy import QtCore import numpy as np import logging from .. import load_ui from .. import DataType from .fitting_handler import FittingHandler from .value_table_handler import ValueTableHandler from .selected_bin_handler import SelectedBinsHandler from ..tabl...
from __future__ import absolute_import import logging import os import pipes import subprocess import docker import base64 import time import requests from docker.errors import create_api_error_from_http_exception from docker.errors import ContainerError from docker.errors import ImageNotFound from docker.errors impor...
# Copyright 2008-2009 Nokia Siemens Networks Oyj # # 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...
#! /usr/bin/env python # Contributors: # Zach Rowinski <zach@eecs.berkeley.edu> (2015) from collections import defaultdict from math import ceil from time import sleep import argparse import getpass import glob import json import os import subprocess import sys import time import urllib2 network_if = 'eth0' DEFAULT...
#!/usr/bin/env python3 import argparse from datetime import timedelta, datetime from glob import glob from matplotlib import pyplot from time import strptime, mktime def OpenFile(InputFile): """Try to open the data file, raise an error if opening fails""" try: InputData = open(InputFile) except ...
# Copyright 2008-2011 Nokia Siemens Networks Oyj # # 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...
from kazoo.client import KazooClient from kazoo.recipe.watchers import DataWatch import json class ZConnection(object): """ Connection to a Zookeeper instance of a cluster of Solr servers """ def __init__(self,zookeper_address): self.zk = KazooClient(zookeper_address) self.zk.start(...
""" Widget wrapper code for the various elements that can be displayed. Widgets need to provide a render function, accepting a surface to render to, a time, and a function that generates the correct position to render at. Dynamically sized widgets (size == None) will be given an area to render ...
# -*- coding: utf-8 -*- ''' Created on 16 janv. 2016 @author: romain ''' import falcon import json from db import db class Address(object): ''' Patch maps information related to an address ''' def patch_json_is_valid(self, patch_json): is_valid = True if patch_json is None:...
from trace import equispaced_colormaping from matplotlib.colors import LinearSegmentedColormap from mpl_toolkits.axes_grid1 import make_axes_locatable import numpy as np class DragableCmap(object): def __init__(self, ax, line, source): self.created = False self.ax = ax self.line = line ...
#!/usr/bin/python # sfcdumper # a utility to extract information from Creatures 1/2 SFC (world save)/EXP (creature export) files # reverse-engineered by fuzzie and nornagon # TODO: a lot of reads probably need to be changed to signed reads # eg, room CA sources # TODO: lots of unknown values :) identifiers = {} try: ...
__author__ = 'Florian' import pygame from pygame import Rect from pygame.font import Font from config import * from constants import * import sys from collections import deque from copy import deepcopy from math import floor dirty_rects = [] widgets = {} pages = [] def getit(key, h): """Return h[key]. If key ha...
import server import flask import botinteract import pytz import datetime import login # FIXME(#35): pull this from the config file TIMEZONE = pytz.timezone("America/Vancouver") @server.app.route("/api/stats/<stat>") def api_stats(stat): game_id = botinteract.get_current_game() if game_id is None: return "-" sho...
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# Copyright Least Authority Enterprises. # See LICENSE for details. """ A Kubernetes client. """ __all__ = [ "version", "IObject", "IKubernetes", "IKubernetesClient", "KubernetesError", "UnrecognizedVersion", "UnrecognizedKind", "v1_5_model", "v1_6_model", "v1_7_model", "memory_kubernetes", ...
from ..node import OP_ADD, OP_MUL, OP_DIV, OP_POW, OP_NEG, OP_SIN, OP_COS, \ OP_TAN, OP_DER, OP_LOG, OP_INT, OP_INT_INDEF, OP_EQ, OP_ABS from .groups import match_combine_groups from .factors import match_expand from .powers import match_add_exponents, match_subtract_exponents, \ match_multiply_exponent...
# -*- coding: utf-8 -*- """ \file saml/schema/md.py \brief Defines the XML data types for SAML2 in the md namespace. \author Ryan Leckey (mehcode) leckey.ryan@gmail.com \copyright Copyright © 2012 Concordus Applications, Inc. \n \n Permission is hereby granted, free of charge, to any person ...
from AnkiHubLibs import webbrowser from urllib2 import Request, urlopen, URLError, HTTPError from pprint import pprint import json import urllib import threading import time # import the main window object (mw) from ankiqt from aqt import mw # import the "show info" tool from utils.py from aqt.utils import showInfo #...
from AnkiHubLibs import webbrowser from urllib2 import Request, urlopen, URLError, HTTPError from pprint import pprint import json import urllib import threading import time # import the main window object (mw) from ankiqt from aqt import mw # import the "show info" tool from utils.py from aqt.utils import showInfo #...
""" A consent module for the satosa proxy """ import hashlib import json import logging from base64 import urlsafe_b64encode import requests from requests.exceptions import ConnectionError from jwkest.jws import JWS from jwkest.jwk import rsa_load from jwkest.jwk import RSAKey from satosa.logging import satosa_logg...
from AnkiHubLibs import webbrowser from urllib2 import Request, urlopen, URLError, HTTPError from pprint import pprint import json import urllib # import the main window object (mw) from ankiqt from aqt import mw # import the "show info" tool from utils.py from aqt.utils import showInfo # import all of the Qt GUI lib...
import requests import weechat as wc import re wc.register('youtube.py', 'snowfag', '1.0', 'BSD-2c', 'Youtube video title announcer', '', '') def config(*args, **kwargs): if not wc.config_is_set_plugin('channels'): wc.config_set_plugin('channels', '.*') if not wc.config_is_set_plugin('api_key'): wc.c...
#!/usr/bin/python # # Copyright (c) 2012-2013 Sergio Arroutbi Braojos <sarroutbi@gmail.com> # # Permission to use, copy, modify, and/or distribute this software # for any purpose with or without fee is hereby granted, provided that # the above copyright notice and this permission notice appear in all copies. # # TH...
#!/usr/bin/env python2 import sys, os, json, errno, subprocess, yum class yumoter: def __init__(self, configFile, repobasepath): self.urlbasepath = "http://yumoter.gnmedia.net" self.repobasepath = repobasepath self.changedRepos = [] self.reloadConfig(configFile) self.yb = yu...
""" sentry.manager ~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement from collections import defaultdict import datetime import hashlib import itertools import logging import re import warn...
import tkinter as tk import os from GUI import * class Zacetno: def __init__(self, master): self.master = master # privzete vrednosti, ki jih uporabnik lahko poljubno spremeni self.tip_igralec1 = CLOVEK self.tip_igralec2 = CLOVEK self.dovoljene_barve = ['gold', 'blue'] ...
""" Step 0 Step by step codes of the ideal rankine cycle simulator to demonstrate: Data Structures+ Algorithms = Programs The ideal rankine cycle as ┌─── State 1 ── Turbine ── State 2 ──┐ | | Boiler Condenser | ...
#!/usr/bin/env python import sys import argparse import client_wrap def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("-t", "--type", help="type of the cached data", default="double") parser.add_argument("-c", "--connection", help="connection string", default="ipc:///var/run/zero-ca...
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Appier Framework # Copyright (C) 2008-2014 Hive Solutions Lda. # # This file is part of Hive Appier Framework. # # Hive Appier Framework is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
import string import omdb import socket import xml.etree.cElementTree as ElementTree import click import urllib2 import urllib import webbrowser from appdirs import * import time as timelib from clint.textui import colored, puts, indent __VERSION__ = '1.1.2' CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) ...
from osv import fields, osv class stock_picking_serial_from_so(osv.osv): _name="stock.picking" _inherit="stock.picking" ''' def do_partial(self, cr, uid, ids, partial_datas, context=None): print 'stock picking' print str(partial_datas) res = super(stock_picking_serial_from_...
# Copyright 2014-2016 PUNCH Cyber Analytics Group # # 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...
import re from dataclasses import dataclass from typing import Any, List, Optional, Sequence, Tuple, Union from flask import request from ._exceptions import ValidationFailedException def _parse_common_multi_arg(key: str) -> List[Tuple[str, Union[bool, Sequence[str]]]]: # support multiple request parameter with...
import wx from wx.lib.pubsub import Publisher from wx.lib.pubsub.core.datamsg import Message import wx.lib.layoutf as layoutf import numpy as np import threading import psutil import time import os import os.path import sys import pickle import glob import stomp from astropy.io import fits from astropy import wcs from...
""" Map is a generic Map class from which all other Map classes inherit from. """ from __future__ import absolute_import #pylint: disable=E1101,E1121,W0404,W0613 __authors__ = ["Keith Hughitt, Steven Christe"] __email__ = "keith.hughitt@nasa.gov" import os import pyfits import numpy as np import matplotlib.pyplot as ...
""" Map is a generic Map class from which all other Map classes inherit from. """ from __future__ import absolute_import #pylint: disable=E1101,E1121,W0404,W0613 __authors__ = ["Keith Hughitt, Steven Christe"] __email__ = "keith.hughitt@nasa.gov" import os import pyfits import numpy as np import matplotlib.pyplot as ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # tiapp parser # import os, types, uuid , fnmatch import codecs, time, sys from xml.dom.minidom import parseString from StringIO import StringIO def getText(nodelist): rc = "" for node in nodelist: if node.nodeType == node.TEXT_NODE: rc = rc + node.data return r...
#!/usr/bin/env python import os,sys import glob import numpy as np #import fitsio from astropy.io import fits from collections import OrderedDict data_dir = os.environ.get('BOKDATADIR', '/global/project/projectdirs/cosmo/staging/bok') def boklog(utdate,logdir='./'): files = glob.glob(os.path.jo...
from copy import deepcopy from django.contrib import admin from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.core.urlresolvers import NoReverseMatch from mezzanine.core.admin import DisplayableAdmin, DisplayableAdminForm from mezzanine.utils.urls import admin_url ...
import sys import os from workflow import Workflow def main(wf): user_input = wf.args[0] if user_input != '': try: if int(user_input) <= 100 and int(user_input) >= 0: wf.add_item('%s%%' % user_input, arg='%s' % (int(user_input) / 100.0), valid=True) else: ...
import sys import os from workflow import Workflow # GitHub repo for self-updating GITHUB_UPDATE_CONF = {'github_slug': 'fniephaus/alfred-brightness'} # GitHub Issues HELP_URL = 'https://github.com/fniephaus/alfred-brightness/issues' # Configuration values brightness_levels = [0, 20, 40, 60, 80, 100] brightness_level...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2010-2021, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyri...
import argparse import urwid import tempfile import subprocess import os import urllib.parse from wikicurses import formats, settings from wikicurses.wiki import Wiki, WikiError from wikicurses.htmlparse import parseDisambig, UrwidMarkupHandler def executeCommand(cmd): try: subprocess.call(cmd) except...
# -*- coding: utf-8 -*- """ License Copyright (C) 2013 YunoHost This program 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 l...
# Copyright (c) 2013 The SAYCBridge 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 z3b import enum from z3b.constraints import * from z3b.model import * from z3b.preconditions import * from z3b.rules import * # Cappelletti may ...
__version__ = "4.0pre-m2"
from base64 import b64decode from collections import OrderedDict import pytest from ssb.feed import Message from ssb.keys import KeyPair @pytest.fixture() def keypair(): secret = b64decode('Mz2qkNOP2K6upnqibWrR+z8pVUI1ReA1MLc7QMtF2qQ=') return KeyPair(secret) def test_keypair(): secret = b64decode('Mz...
import os import sys import re import socket import struct import subprocess as ssubprocess from fcntl import ioctl from ctypes import c_char, c_uint8, c_uint16, c_uint32, Union, Structure, \ sizeof, addressof, memmove from sshuttle.helpers import debug1, debug2, Fatal, family_to_string from sshuttle.methods import...
__author__ = 'Brandon C. Kelly' import numpy as np import samplers class CarSample(samplers.MCMCSample): """ Class for storing and analyzing the MCMC samples of a CAR(p) model. """ def __init__(self, time, y, ysig, filename=None): """ Constructor for the class. Right same as its superc...
#!/usr/bin/python # -*- coding: utf-8 -*- from .parsers import oneToOneParser, chapterParagraphParser import standards.text as stds import re class standards: wlcRegex = r"\[\s*(?:W|Westminster)\s*(?:L|Larger)\s*(?:C|Catechism)\s*([\d\-,\s]+)\s*\]" wscRegex = r"\[\s*(?:W|Westminster)\s*(?:S|Shorter)\s*(?:C|C...
#!/usr/bin/python # # Copyright (C) Extensible Service Proxy Authors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # noti...