content
stringlengths
4
20k
import json import os import sys import requests from collections import Counter from wapy.api import Wapy import bottle from bottle import route, request, static_file, run bottle.BaseRequest.MEMFILE_MAX = 1024 * 1024 wapy = Wapy('frt6ajvkqm4aexwjksrukrey') def removes(yes): no = ["Walmart.com", ".", ","] for ...
from __future__ import division from collections import defaultdict import datetime import json import fnmatch import os import time import socket from tornado import gen from cocaine.decorators import coroutine from cocaine.tools.error import ToolsError from . import mql __author__ = 'Evgeny Safronov <<EMAIL>>' ...
import re def underline(text): combining_low_line = '\u0332' return combining_low_line.join(list(text)) + combining_low_line _superscript_map = ( ' ⁽⁾ \' ⁰¹²³⁴⁵⁶⁷⁸⁹ ᴬᴮ ᴰᴱ ᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾ ᴿ ᵀᵁⱽᵂ ' 'ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖ ʳˢᵗᵘᵛʷˣʸᶻ ') def superscript(value): supped = '' for d ...
# -*- coding: utf-8 -*- import json from watson_developer_cloud import ToneAnalyzerV3 # BEGIN of python-dotenv section from os.path import join, dirname from dotenv import load_dotenv import os dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path) # END of python-dotenv section tone_analyzer = Ton...
""" TESTS is a dict with all you tests. Keys for this will be categories' names. Each test is dict with "input" -- input data for user function "answer" -- your right answer "explanation" -- not necessary key, it's using for additional info in animation. """ TESTS = { "Basics": [ { ...
from mock import patch, Mock from thefuck.rules.no_command import match, get_new_command, _get_all_callables @patch('thefuck.rules.no_command._safe', return_value=[]) @patch('thefuck.rules.no_command.get_aliases', return_value=['vim', 'apt-get', 'fsck', 'fuck']) def test_get_all_callables(*args): all_calla...
"""This script tries to run the test case multiple times with different number of nodes and dump the performance. It shuffles the runs with increasing number of processes in an attempt to avoid systematic error based on process sequence. """ from __future__ import print_function import getopt import subprocess import...
######################################################################## # # File Name: HTMLElement.py # # Documentation: http://docs.4suite.com/4DOM/HTMLElement.py.html # """ WWW: http://4suite.com/4DOM e-mail: <EMAIL> Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved. ...
from __future__ import absolute_import import os import pytest from datetime import datetime from subprocess import check_call from changes.testutils import TestCase from changes.vcs.base import CommandError, UnknownRevision from changes.vcs.hg import MercurialVcs from tests.changes.vcs.asserts import VcsAsserts ...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import mimeo import argparse import os def mainArgs(): parser = argparse.ArgumentParser(description='Filter SSR containing sequences from fasta library of repeats.', prog='mimeo-filter') # Input options parser.add_argument...
#!/usr/bin/env python """ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import random from lib.core.enums import PRIORITY __priority__ = PRIORITY.LOW def dependencies(): pass def tamper(payload, **kwargs): """ Replaces space charac...
#!/bin/python3 # # Example on how to load a Spark DataFrame from KairosDB data. # Maybe need some adjustments. # # Written by @paladini on 09/2015. # <EMAIL> # from pyspark import SparkContext from pyspark.sql import SQLContext from pyspark.sql.functions import * from connection import Connection import json class Da...
""" Logging and debugging messages from the device. These are in the implementation-defined range (0x0000-0x00FF). """ from construct import * import json from sbp import SBP from sbp.utils import fmt_repr, exclude_fields, walk_json_dict, containerize import six # Automatically generated from piksi/yaml/swiftnav/sbp...
"""Simple zlib utility.""" import sys import zlib def _Read(filename): """Reads a file in binary mode.""" with open(filename, 'rb') as f: return f.read() def _Write(buf, filename): """Writes a buffer to a file in binary mode.""" with open(filename, 'wb') as f: f.write(buf) def Compress(input_file...
from unittest import mock import ddt from cinder.objects import base from cinder import rpc from cinder.tests.unit import test class FakeAPI(rpc.RPCAPI): RPC_API_VERSION = '1.5' TOPIC = 'cinder-scheduler-topic' BINARY = 'cinder-scheduler' @ddt.ddt class RPCAPITestCase(test.TestCase): """Tests RPCA...
from __future__ import with_statement from __future__ import division from __future__ import unicode_literals from __future__ import print_function import os, sys, re from io import open # This script parses the output of `make TIMED=1` into a dictionary # mapping names of compiled files to the number of minutes and s...
import os import time import pandas as pd import numpy as np from bifac import BiFac from sklearn.metrics import normalized_mutual_info_score from sklearn.metrics import f1_score #preparation logdir = "log/logdaisharin" os.system("rm -rf log/logdaisharin") df = pd.read_csv("data/edge_list.csv", header=None) edge_list ...
#!/usr/bin/python # -*- coding: utf-8 -*- import MySQLdb import numpy as np from datetime import datetime import matplotlib.pyplot as plt class statistics_info: def __init__(self): self.num = 0 self.sum = 0.0 self.weeks = [] self.user_sum = [0 for i in range(7)] class week_info: ...
"""Moran's I global spatial autocorrelation.""" from typing import Union, Optional from functools import singledispatch from anndata import AnnData import numpy as np from scipy import sparse from numba import njit, prange from scanpy.get import _get_obs_rep from scanpy.metrics._gearys_c import _resolve_vals, _check_...
"""Support for monitoring juicenet/juicepoint/juicebox based EVSE sensors.""" import logging from homeassistant.const import ENERGY_WATT_HOUR, POWER_WATT, TEMP_CELSIUS from homeassistant.helpers.entity import Entity from . import DOMAIN, JuicenetDevice _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['juicenet...
# Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'], kineticsEstimator = 'rate rules', ) # List of species species( label='et...
import sys import csv import httplib import json from collections import Counter from taringa import Taringa import traceback taringa = Taringa() def main(inputfile,R,L): actions_rs = [] actions_like = [] with open(inputfile,'rb') as csvfile: reader = csv.reader(csvfile) for row in reader:...
######################################################################## # File : JobCleaningAgent.py ######################################################################## """ The Job Cleaning Agent controls removing jobs from the WMS in the end of their life cycle. This agent will take care of removing user...
__all__ = ['ADAuthenticate', 'ADException'] import types, os from pyasm.common import SecurityException, Config from pyasm.security import Authenticate, LoginInGroup from pyasm.search import Search from pyasm.common import Environment try: #from ad import ADConnect, ADLookup, ADException from ad_connect imp...
# Coding 207 - Putting it all together example # Asks the user to choose router or switch # Retrieves list of devices using APIC-EM # Writes list of devices of selected type to a file # <EMAIL> # twitter: @mandywhaley # http://developer.cisco.com # http://learninglabs.cisco.com # Jan 15, 2015 # * THIS SAMPLE APPLICAT...
#!/usr/bin/python import logging import logging.config import sys import importlib from ansible.module_utils.basic import AnsibleModule from StringIO import StringIO import datetime from ibmsecurity.appliance.isamappliance import ISAMAppliance from ibmsecurity.appliance.isamappliance_adminproxy import ISAMApplianceAd...
# -*- coding: utf-8 -*- from app.forms import * from app.models import * from app.parameter import * from app.Info import * from app.deco import * from app.project import * from django.shortcuts import * from django.contrib.auth.models import User from DjangoWebProject import settings from django.http import HttpReques...
""" sentry.web.frontend.admin ~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import logging import pkg_resources import six import sys import uuid from django...
helvetica = { 'font' : {'helvetica': 'sans serif'}, 'weights': [ "bold", "italic", "bold-italic", "light", "light oblique", "light-italic"], 'characters': [{ 'capitals': [{ 'F': [{ 'bendpoints':{ 'point 1':[44.82, 11.61], 'point 2':[46.92, 12.62], ...
{ 'name': 'Partner Merger CLEARCORP', 'version': '1.0', 'category': 'Generic Modules/Base', 'description': """ Originally developed by Tiny SPRL. Fixed, improved and adapted to V6 by Guewen Baconnier - Camptocamp 2011 This module has been adopted by CLEARCORP from the extra-trunk repository To merge 2 p...
''' Created on Apr 28, 2014 @author: LuisGustavo ''' from game.cards.common import * from game.cards.base import * from game.cards.intrigue import * from client.aiclient.Strategy import canBuy samePile = lambda self,other: all([selfCard == otherCard for (selfCard,otherCard) in zip(*[sorted(self.cards,key=lambda card...
#!/usr/bin/env python #-*- coding: utf-8 -*- import sys; sys.path.append('/home/user/Home/쉘스크립트/python_module') import mkcbz import ufp import re from gi.repository import Notify def main(argv): reload(sys); sys.setdefaultencoding('utf-8'); #타겟 준비 targets = map(lambda x: x.decode('utf8'), argv[1:]) Notify.i...
#!/usr/bin/env python """ BullyBot - A simple strategy: ... It also has a parameter: with probability 'nomove' it chooses not to make a move. """ # Import the API objects import api.util as u from api import State import random, sys class Bot: def __init__(self): pass def get_move(self, state): ...
import os.path import shutil """ Benchmark that compares the storing of objects in both Blaze and PyTables """ from time import time import blaze import tables N = 500 if os.path.exists('c'): shutil.rmtree('c') t0 = time() c = blaze.Array([], 'x, object', params=blaze.params(storage='c', clevel=5)) for i in xr...
""" Factories for course mode models. """ import random from factory import lazy_attribute from factory.django import DjangoModelFactory from opaque_keys.edx.keys import CourseKey from common.djangoapps.course_modes.models import CourseMode from openedx.core.djangoapps.content.course_overviews.models import CourseO...
from logger import result_logger from utils import add_description @add_description(" - TEMPLATE RULE: Error condition shouldn't happened.") def rule_error_example(**kwargs): ERROR_MESSAGE = "[ERROR] Error occurred." if True: result_logger.info(ERROR_MESSAGE) @add_description(" - TEMPLATE RULE: Warn...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaegraph.business_base import NodeSearch, DeleteNode from destaque_app.commands import ListDestaquesCommand, SaveDestaquesCommand, UpdateDestaquesCommand, \ DestaquesPublicForm, DestaquesDetailForm, DestaquesShortForm def save_d...
from yaiep.search.AStarSearch import AStarSearch from yaiep.search.DepthSearch import DepthSearch def _make_depth(factory_data): return DepthSearch(factory_data[0], factory_data[1], factory_data[2], factory_data[3]) def _make_astar(factory_data): return AStarSearch(factory_data[0], factory_data[1], factory_...
import struct import numpy as np from numba import cuda from numba.core import types from numba.cuda.testing import CUDATestCase import unittest def float_to_int(x): return np.int32(x) def int_to_float(x): return np.float64(x) / 2 def float_to_unsigned(x): return types.uint32(x) def float_to_comple...
from exception import * from composedentity import ComposedEntity from Command.basecommand import * from GeoComposedEntity.chamfer import Chamfer from GeoEntity.segment import Segment from GeoUtil.util import getIdPoint class ChamferCommand(BaseCommand): """ this class rappresent the champfer command "...
__author__ = 'Jernej' import socket from piflyer.commander import commander import piflyer.commands as c TCP_PORT = 13000 BUFFER_SIZE = 20 # Normally 1024, but we want fast response class mainserver: def __init__(self): self.conn="" self.addr="" def run(self): #create an INET, STREA...
from setuptools import setup, find_packages import os, sys version = '0.2.1' here = os.path.abspath(os.path.dirname(__file__)) try: README = open(os.path.join(here, 'README.rst')).read() except IOError: README = '' TEST_DEPENDENCIES = ['mock', 'pymongo >= 2.7', 'sqla...
# Django settings for wrpi project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( (('Dennis Conley', '<EMAIL>'), ('Andrew Thompson', '<EMAIL>'), ('Max Vernikivskiy', '<EMAIL>')) ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycop...
import os import os.path import pipes import shutil import tempfile from ansible import utils from ansible.runner.return_data import ReturnData class ActionModule(object): TRANSFERS_FILES = True def __init__(self, runner): self.runner = runner def _assemble_from_fragments(self, src_path, delimit...
import unittest from csrv.model import errors from csrv.model import test_base from csrv.model import timing_phases from csrv.model.cards.corp import card01058 class Card01058Test(test_base.TestBase): def setUp(self): test_base.TestBase.setUp(self) self.card = card01058.Card01058(self.game, self.corp) ...
import pytest from django.db import IntegrityError from pootle.core.delegate import formats from pootle_format.default import POOTLE_FORMATS from pootle_format.models import FileExtension, Format from pootle_format.registry import FormatRegistry def _test_formats(registry, keys): formats = registry.formats ...
#!/usr/bin/python3 ''' A command queue daemon. This prevents system outages. When the daemon starts, it must accept the following JSON text from file "ga-data/ga-grader_queue.cfg": { "delegate_callback": "http://127.0.0.1:8099", "temp_path": "/tmp/ag" } Main thread monitors a file-based event queue. An event file...
""" This tutorial introduces logistic regression using Theano and stochastic gradient descent. Logistic regression is a probabilistic, linear classifier. It is parametrized by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is done by projecting data points onto a set of hyperplanes, the distance...
import re from conda.resolve import normalized_version from .. import env from ..exceptions import EnvironmentFileNotDownloaded, CondaEnvException try: from binstar_client import errors from binstar_client.utils import get_binstar except ImportError: get_binstar = None ENVIRONMENT_TYPE = 'env' # TODO: isol...
#!/usr/bin/python # l.basicConfig? # l.Formatter? # man date or time.strftime() # subprocess:https://docs.python.org/2/library/subprocess.html # crontab or scheduler # shelx import logging as l from subprocess import Popen,PIPE l.basicConfig(filename='myapp.log',filemode='a',level=l.DEBUG, format='%(asctime)s - %...
# -*- coding: utf-8 -*- """ Bubbles Addon Copyright (C) 2016 Exodus 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 l...
#!/usr/bin/python # -*- coding: utf-8 -*- """ mediasort.py is a utility which can be used to sort directories and files into normalized and group subfolders. Its primary purpose was to originally sort downloaded media like TV shoes and movies. The naming conventions and packing methods used for this often were varying....
"""Hourly temp ranges""" import calendar import pytz import numpy as np from pandas.io.sql import read_sql from pyiem.plot import figure_axes from pyiem.util import get_autoplot_context, get_dbconn, utc from pyiem.exceptions import NoDataFound def get_description(): """Return a dict describing how to call this p...
import abc import typing import pkg_resources import google.auth # type: ignore from google.api_core import gapic_v1 # type: ignore from google.api_core import retry as retries # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.ads.googleads.v8.resources.types import...
import codecs import itertools import os import re from collections import Counter import numpy as np import word2vec # from gensim.models import word2vec def clean_str(string): """ Tokenization/string cleaning for all datasets except for SST. Original taken from https://github.com/yoonkim/CNN_sentence/...
import os import unittest import random import requests from hubstorage import HubstorageClient from hubstorage.utils import urlpathjoin class HSTestCase(unittest.TestCase): projectid = str(random.randint(2222000, 2223000)) spidername = 'hs-test-spider' endpoint = os.getenv('HS_ENDPOINT', 'http://storage...
""" Test number of threads. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class ExitDuringBreakpointTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): ...
from openstack.baremetal.v1 import _common from openstack import resource class VolumeConnector(_common.ListMixin, resource.Resource): resources_key = 'connectors' base_path = '/volume/connectors' # capabilities allow_create = True allow_fetch = True allow_commit = True allow_delete = Tr...
import os import types import classutil import logger from UserDict import DictMixin class NLMSASeqList(list): def __init__(self, nlmsaSeqDict): list.__init__(self) self.nlmsaSeqDict = nlmsaSeqDict def __getitem__(self, nlmsaID): 'return NLMSASequence for a given nlmsa_id' tr...
import os from avocado import Test from avocado import main from avocado.utils import process, build, git from avocado.utils.software_manager import SoftwareManager class Perfmon(Test): """ performance monitoring on Linux : test perf_events on Linux """ def setUp(self): # Check for basic ...
import sys import os import os.path import pprint import re UPCASE_CHECK = True ARGS = [] for i in range(len(sys.argv)): if not sys.argv[i].startswith('--'): ARGS.append(sys.argv[i]) elif sys.argv[i].lower() == '--no-upcase-check': UPCASE_CHECK = False if len(ARGS) < 2 or len(ARGS) % 2 != 0: ...
#!/usr/bin/python # USAGE: pair2bmgraph.py [-ew 3] [-rc resource] < txt-file > bmg-file # Outputs a bmg-file from a raw input : # std input gives a list of weighted edges : # nodeA nodeB (list of attributes values) # (1 edge per line) # default : takes 3rd field of each line as weight value # -ew n : takes...
from supriya import EnvelopeShape, utils from supriya.system.SupriyaValueObject import SupriyaValueObject class Envelope(SupriyaValueObject): """ An envelope. :: >>> envelope = supriya.synthdefs.Envelope() >>> envelope Envelope() :: >>> envelope.serialize() ...
"""B2SHARE bundles.""" from invenio.ext.assets import Bundle ############### common # hack: lodash exports _, which is later hijacked by invenio # we run lodash before anything else and save the exported _ b2s_pre_almond_init_js = Bundle( "vendors/lodash/dist/lodash.js", "js/lodash-fix.js", output="b2s_p...
import string from module_info import * from module_scene_props import * from process_common import * from process_operations import * def save_scene_props(variable_list,variable_uses,tag_uses,quick_strings): ofile = open(export_dir + "scene_props.txt","w") ofile.write("scene_propsfile version 1\n") ...
import os from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin class Lvm2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """lvm2 related information """ plugin_name = 'lvm2' option_list = [("lvmdump", 'collect an lvmdump tarball', 'fast', False), ("lvmdump-a...
from django.db import models from wagtail.wagtailsearch.backends.base import BaseSearch, BaseSearchQuery, BaseSearchResults class DBSearchQuery(BaseSearchQuery): DEFAULT_OPERATOR = 'and' def _process_lookup(self, field, lookup, value): return models.Q(**{field.get_attname(self.queryset.model) + '__'...
""" Commonly useful queryset mixins. """ class SelectRelatedMixin(object): """ Uses ``select_related()`` by default. It is more often that we encounter performance problems when we forget to select related models than when we selected too many related models. """ def mixin_default(self, *args, *...
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
# -*- coding: utf-8 -*- GARBAGE = 0 KEY = 1 EQUAL = 2 IVALUE = 3 QVALUE = 4 def parse_line(line): output = {} key, value = (), () escaped = False state = GARBAGE for i, c in enumerate(line): i += 1 if state == GARBAGE: if c > ' ' and c != '"' and c != '=': ...
from __future__ import absolute_import, division, print_function, unicode_literals from amaasutils.random_utils import random_string, random_decimal from datetime import datetime, date, timedelta import pytz import random from amaascore.market_data.eod_price import EODPrice from amaascore.market_data.fx_rate import F...
from oslo.config import cfg from six.moves.urllib import parse as urlparse from sahara import context CONF = cfg.CONF SWIFT_INTERNAL_PREFIX = "swift://" # TODO(mattf): remove support for OLD_SWIFT_INTERNAL_PREFIX OLD_SWIFT_INTERNAL_PREFIX = "swift-internal://" SWIFT_URL_SUFFIX_START = '.' SWIFT_URL_SUFFIX = SWIFT_U...
#!/usr/bin/python """ Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/) 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 copyr...
# -*- coding: utf-8 -*- import time import gevent.pool import gevent.queue import gevent.event import gevent.local import gevent.coros from .exceptions import * from .context import Context from .events import Events class SocketOnChannel(object): def __init__(self, channel, heartbeat=5, inqueue_size=100, ...
import eg eg.RegisterPlugin( name = "Directory Watcher", author = "Bitmonster", version = "1.0", guid = "{003FABA6-AA6A-4395-9DB6-DC88EB07F5FE}", canMultiLoad = True, description = ( "Monitors a directory and generates events if files are created, " "deleted or changed in it." ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import logging import sys import math import tensorflow as tf import utils # Logging configuration. logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', ...
import dataclasses import typing @dataclasses.dataclass class A: x: int y: str z: float = 0.0 A(<arg1>) @dataclasses.dataclass(init=True) class A2: x: int y: str z: float = 0.0 A2(<arg2>) @dataclasses.dataclass(init=False) class B1: x: int = 1 y: str = "2" z: float = 0.0 B1(<...
import numpy as np from nml.nml import parse as nmlparse from neuroml import arraymorph import neuroml from jsonpickle import decode as json_decode import neuroml class NeuroMLLoader(object): @classmethod def load(cls,src): doc = cls.__nml2_doc(src) return doc @classmethod def __n...
# -*- coding: iso-8859-1 -*- """ Plota curva de ZigZag ____________________ Variáveis de entrada: save (True/False) -- Opção para salvar as figuras ou somente mostrar os gráficos, utilizar somente True até o momento; formato ('png'/'pdf'/'ps'/'eps'/'svg') -- formatos de saída da figura; passo (float) -- Paso de tempo ...
import ledcube import ledcube.audio as audio import numpy.fft import os import time import math FIFO_FILE = '%s/.mpd/mpd.fifo' % os.getenv('HOME') FIFO_SAMPLE_RATE = 22000 FIFO_SAMPLE_BITS = 16 cube = ledcube.Cube() source = audio.PCMSource(FIFO_FILE, FIFO_SAMPLE_RATE, FIFO_SAMPLE_BITS) # https://graphics.s...
from p2pool.bitcoin import networks # CHAIN_LENGTH = number of shares back client keeps # REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout # REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH # REAL_CHAIN_LENGTH must be changed in sync with all other clients # changes can be done by changi...
""" This script contains unit tests of the :mod:`rmgpy.statmech.schrodinger` module. """ import unittest import numpy from rmgpy.statmech.schrodinger import getPartitionFunction, getHeatCapacity, getEnthalpy, getEntropy, getDensityOfStates import rmgpy.constants as constants ########################################...
from msrest.service_client import ServiceClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from .operations.vnet_operations import VNetOperations from . import models class ResourceManagementClientConfiguration(AzureConfiguration): """Config...
import random def jitter_position(bbox, size, step=(0, 0)): while True: x_min_step = random.randint(-step[0], step[0]) x_max_step = random.randint(-step[0], step[0]) new_x_min = bbox[0] - x_min_step new_x_max = bbox[2] - x_max_step new_bbox = (new_x_min, bbox[1], new_x_max...
""" MensaUniurb - Telegram Bot Authors: Radeox (<EMAIL>) Fast0n (<EMAIL>) """ import json import locale import os import re import sys from datetime import datetime, timedelta from random import randint from time import sleep import requests import telepot from telepot.namedtuple import (InlineKeyboardButto...
import base64 import functools import json as simplejson import mimetypes import os import random import re import ssl import six from six.moves import http_cookiejar from six.moves import urllib __version__ = '0.7' _user_agent = 'notrequests/' + __version__ LATIN1 = 'latin-1' JSON_TYPE = 'application/json' BINARY_T...
import sys if sys.version_info[0] >= 3: # Python 3 import tkinter as tk from tkinter import ttk from tkinter import messagebox as msgbox else: import Tkinter as tk import tkMessageBox as msgbox import ttk import pjsua2 as pj import application class LogWindow(tk.Toplevel): """ Log window ""...
import wx from cairis.core.armid import * import WidgetFactory from cairis.core.Borg import Borg from cairis.core.DependencyParameters import DependencyParameters __author__ = 'Shamal Faily' class DependencyDialog(wx.Dialog): def __init__(self,parent,parameters): wx.Dialog.__init__(self,parent,DEPENDENCY_ID,'De...
import logging from django.core.urlresolvers import reverse from django.utils import safestring from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ from horizon import tables from openstack_dashboard import api from openstack_dashboard.api import cinder from ...volumes imp...
import datetime import subprocess import shlex import re import sys import os def termination_string(): """ Gets the current system time and appends it to a termination notice. """ now = datetime.datetime.now() time = now.strftime("%Y-%m-%d %H:%M:%S") end_time = "Script exiting at %s\n" % time ...
# -*- coding: utf-8 -*- """OpenDocument renderers.""" # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- from ..core.prompt import create_prompt from ..lib.markdown import InlineLexer, BlockLexer, ...
# Python imports import datetime # 3rd party imports from django.test import TestCase from django.utils.timezone import now from vr_dashboard.views.views import last_seven_dates, parse_phone_number_fields class TestVrDashboardUtils(TestCase): def test_last_seven(self): today = now() for number_...
import re import os import sys from subprocess import Popen, PIPE, call # config TRAC_ENV = '/var/lib/trac/MyTrac' GIT_PATH = '/usr/bin/git' TRAC_ADMIN = '/usr/local/bin/trac-admin' # I have other that doesn't work in /usr/bin/trac-admin REPO_NAME = '"(default)"' # The original one have no "", I change it and wo...
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
from app.config.cplog import CPLog from app.config.db import Session as Db, Movie, QualityTemplate, MovieQueue from app.controllers import BaseController, url, redirect from app.lib.xbmc import XBMC from sqlalchemy.sql.expression import or_, desc import cherrypy import os import sqlite3 as MySqlite log = CPLog(__name_...
import sys import sdl2.ext def run(): resources = sdl2.ext.Resources(__file__, "platformer") sdl2.ext.init() window = sdl2.ext.Window("SRG", size=(200, 200)) window.show() factory = sdl2.ext.SpriteFactory(sdl2.ext.SOFTWARE) sprite = factory.from_image(resources.get_path("sky0.png")) s2 = sp...
from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tabs from openstack_dashboard import api from openstack_dashboard.dashboards.project.vpn import tables class IPSecSiteConnectionsTab(tabs.TableTab): table_classes = (tables.IPSecSiteConnectionsTable,) ...
from __future__ import absolute_import, unicode_literals from django.conf import settings as django_settings from django.core.exceptions import ImproperlyConfigured from wiki.conf import settings as wiki_settings # Deprecated APP_LABEL = None SLUG = "attachments" # Please see this note about support for UTF-8 files...
__all__ = ['Attr', 'CDATASection', 'CharacterData', 'Comment', 'DOMException', 'DOMImplementation', 'Document', 'DocumentFragment', 'DocumentType', 'Element', 'Entity', 'EntityReference', ...
''' InfLibrarySectionParser ''' ## # Import Modules # import Logger.Log as Logger from Logger import StringTable as ST from Logger.ToolError import FORMAT_INVALID from Parser.InfParserMisc import InfExpandMacro from Library import DataType as DT from Library.Parsing import MacroParser from Library.Misc im...