code
stringlengths
1
199k
import mips.registers as mr SPILL_MEM_LABEL = 'SPILL_MEMORY' SPILL_MEM_SIZE = 64 # bytes TEMPROARY_REGISTER_SET = mr.T_REGISTERS NOT_TESTING_FUNCTIONS = False
"""Caliopen mail message privacy features extraction methods.""" from __future__ import absolute_import, print_function, unicode_literals import logging import pgpy from caliopen_main.pi.parameters import PIParameter from .helpers.spam import SpamScorer from .helpers.ingress_path import get_ingress_features from .helpe...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('posgradmin', '0039_auto_20191120_2249'), ] operations = [ migrations.AlterModelOptions( name='profesor', options={'ordering': ['user__fir...
""" Interacts with sqlite3 db """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six import sqlite3 import os import hashlib import random import time import DIRAC from DIRAC import gLogger, S_OK, S_ERROR from DIRAC.FrameworkSystem.private.monitoring....
import os import subprocess from os.path import dirname, abspath, join, curdir from nose.tools import assert_equals, with_setup from tests.asserts import prepare_stdout def test_imports_terrain_under_path_that_is_run(): old_path = abspath(curdir) os.chdir(join(abspath(dirname(__file__)), 'simple_features', '1st...
""" Test notifiers """ import unittest from sickchill.oldbeard import db from sickchill.oldbeard.notifiers.emailnotify import Notifier as EmailNotifier from sickchill.oldbeard.notifiers.prowl import Notifier as ProwlNotifier from sickchill.tv import TVEpisode, TVShow from sickchill.views.home import Home from tests imp...
import os, random rfilename=random.choice(os.listdir("/storage/pictures")) rextension=os.path.splitext(rfilename)[1] picturespath='/storage/pictures/' for filename in os.listdir(picturespath): if filename.startswith("random"): extension=os.path.splitext(filename)[1] newname=picturespath + str(random.random()).rspli...
import os from abjad.tools import documentationtools from abjad.tools import systemtools from abjad.tools.developerscripttools.DeveloperScript import DeveloperScript from abjad.tools.developerscripttools.ReplaceInFilesScript \ import ReplaceInFilesScript class RenameModulesScript(DeveloperScript): r'''Renames c...
""" Module defining the Event class which is used to manage collissions and check their validity """ from itertools import combinations from copy import copy from particle import Particle class EventParticle(object): def __init__(self, particle1, particle2): self.particle1 = particle1 self.particle2...
""" Projy template for PythonPackage. """ from datetime import date from os import mkdir, rmdir from shutil import move from subprocess import call from projy.templates.ProjyTemplate import ProjyTemplate from projy.collectors.AuthorCollector import AuthorCollector from projy.collectors.AuthorMailCollector import Author...
import os import sys import random import dns.resolver numTestDomains = 100 numTopTLDs = 100 ignoreDomains = ['com', 'net', 'jobs', 'cat', 'mil', 'edu', 'gov', 'int', 'arpa'] serverZone = '.ws.sp.am' # DNS Zone containing CNAME records pointing to whois FQDNs def dbg(s): pass random.seed() zFiles = os.listdir('zonefi...
from PyInstaller.utils.hooks import exec_statement exec_statement("import wx.lib.activex")
from PySide import QtCore from GCodeAnalyzer import GCodeAnalyzer import sys import pycnc_config class GCodeLoader(QtCore.QThread): load_finished = QtCore.Signal() load_error = QtCore.Signal(object) def __init__(self): QtCore.QThread.__init__(self) self.file = None self.gcode = None ...
from __future__ import absolute_import from optparse import ( Option, Values, OptionParser, IndentedHelpFormatter, OptionValueError) from copy import copy from configparser import SafeConfigParser from urllib.parse import urlsplit import socket import functools from dns.exception import DNSException import dns.name...
"""Define and instantiate the configuration class for Robottelo.""" import logging import os import sys from logging import config from nailgun import entities, entity_mixins from nailgun.config import ServerConfig from robottelo.config import casts from six.moves.urllib.parse import urlunsplit, urljoin from six.moves....
# This file is part of PlexPy. from plexpy import logger, notifiers, plextv, pmsconnect, common, log_reader, datafactory, graphs, users from plexpy.helpers import checked, radio from mako.lookup import TemplateLookup from mako import exceptions import plexpy import threading import cherrypy import hashlib import rando...
"""treetools: Tools for transforming treebank trees. transformations: constants and utilities Author: Wolfgang Maier <maierw@hhu.de> """ from . import trees HEAD_RULES_PTB = { 'adjp' : [('left-to-right', 'nns qp nn $ advp jj vbn vbg adjp jjr np jjs dt fw rbr rbs sbar rb')], 'advp' : [('right-to-left', 'rb rbr r...
import optparse import keyring from rhev_functions import * description = """ RHEV-keyring is a script for mantaining the keyring used by rhev script for storing password """ p = optparse.OptionParser("rhev-clone.py [arguments]", description=description) p.add_option("-u", "--user", dest="username", help="Username to c...
import os,sys,re RELEASE_FILE = "/etc/redhat-release" RWM_FILE = "/etc/httpd/conf.modules.d/00-base.conf" if os.path.isfile(RELEASE_FILE): f=open(RELEASE_FILE,"r") rel_list = f.read().split() if rel_list[2] == "release" and tuple(rel_list[3].split(".")) < ('8','5'): print("so far good") else: raise("Unable ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalogue', '0014_auto_20170414_0845'), ] operations = [ migrations.AlterField( model_name='jeux', name='image', fiel...
import os import random __author__ = 'duceppemo' class SnpTableMaker(object): """ Everything is ran inside the class because data structures have to be shared across parent and child process during multi threading """ def __init__(self, args): import os import sys import glob...
import sys, pygame, frametime, properties, random from enemy import Enemy class Enemies: enemies = [] blackSurface = pygame.Surface([Enemy.enemy.get_width(), Enemy.enemy.get_height()]) blackSurface.fill([0,0,0]) screen = None def set_screen(self, screen): self.screen = screen def create(...
import logging from pyramid.view import view_config, view_defaults from pyramid.httpexceptions import HTTPFound from . import BaseView from ..models import DBSession from ..models.account_item import AccountItem from ..lib.bl.subscriptions import subscribe_resource from ..lib.utils.common_utils import translate as _ fr...
import classes.level_controller as lc import classes.game_driver as gd import classes.extras as ex import classes.board import random import pygame class Board(gd.BoardGame): def __init__(self, mainloop, speaker, config, screen_w, screen_h): self.level = lc.Level(self,mainloop,5,10) gd.BoardGame.__...
'''A script to control the applet from the command line.''' import sys, os import argparse import re import gi gi.require_version('Gdk', '3.0') # noqa: E402 gi.require_version('Gtk', '3.0') # noqa: E402 from gi.repository import GLib as glib from gi.repository import Gdk as gdk from gi.repository import Gtk as gtk fr...
from gi.repository import Gtk from .i18n import _ class AboutDialog(Gtk.AboutDialog): def __init__(self, parent): super(AboutDialog, self).__init__(title=_('About'), parent=parent) self.set_modal(True) self.set_program_name('Ydict') self.set_authors(['Wiky L<wiiiky@outlook.com>']) ...
from ._costs import *
import argparse import logging import pytest import SMSShell import SMSShell.commands def test_abstract_init(): """Test abstract init methods """ abs = SMSShell.commands.AbstractCommand(logging.getLogger(), object(), obj...
from __future__ import (absolute_import, division, print_function) try: from mantidplot import * except ImportError: canMantidPlot = False # import csv import os import re from operator import itemgetter import itertools from PyQt4 import QtCore, QtGui from mantid.simpleapi import * from isis_reflectometry.qui...
from discord.ext import commands import discord.utils def is_owner_check(ctx): author = str(ctx.message.author) owner = ctx.bot.config['master'] return author == owner def is_owner(): return commands.check(is_owner_check) def check_permissions(ctx, perms): #if is_owner_check(ctx): # return Tr...
""" nwdiag.sphinx_ext ~~~~~~~~~~~~~~~~~~~~ Allow nwdiag-formatted diagrams to be included in Sphinx-generated documents inline. :copyright: Copyright 2010 by Takeshi Komiya. :license: BSDL. """ from __future__ import absolute_import import os import re import traceback from collections import na...
import sys def fib(n): if(n<=2): return (n-1) else: return fib(n-1)+fib(n-2) if ( len(sys.argv) == 2 ): print fib(int(sys.argv[1])) else: print "Usage : "+sys.argv[0]+" <term required>"
import consts import urlparse import urllib import os.path from errors import PatternException def expand_file(pattern, metadata): """ Expands the pattern to a file name according to the infomation of a music The following are supported place holder in the pattern: - %t: Title of the track. 'title' in m...
import os import sys import time import base64 import urllib import hashlib import subprocess from datetime import date from datetime import datetime from Crypto.Cipher import DES from Crypto import Random date=date.today() now=datetime.now() if os.name in ['nt','win32']: os.system('cls') else: os.system('clear') pri...
import wxversion wxversion.select( '2.8' ) import glob, os, time import wx, alsaaudio import wx.lib.buttons as bt from pymouse import PyMouse from string import maketrans from pygame import mixer import subprocess as sp import shlex import numpy as np from random import shuffle class speller( wx.Frame ): def __init__(...
import json import argparse import numpy import sys import copy from astropy.coordinates import SkyCoord from astropy import units import operator class Program(object): def __init__(self, runid="16BP06", pi_login="gladman"): self.config = {"runid": runid, "pi_login": pi_login, ...
from django.conf.urls import url from . import views app_name = "perso" urlpatterns = [ url(r'^$', views.main, name='main'), url(r'^(?P<pageId>[0-9]+)/?$', views.main, name='main'), url(r'^about/?$', ...
""" Get the list of all the user files. """ __RCSID__ = "$Id$" from DIRAC.Core.Base import Script days = 0 months = 0 years = 0 wildcard = None baseDir = '' emptyDirsFlag = False Script.registerSwitch( "D:", "Days=", "Match files older than number of days [%s]" % days ) Script.registerSwitch( "M:", "Months=", "Match fi...
""" @file costFunctionChecker.py @author Michael Behrisch @author Daniel Krajzewicz @author Jakob Erdmann @date 2009-08-31 @version $Id: costFunctionChecker.py 13811 2013-05-01 20:31:43Z behrisch $ Run duarouter repeatedly and simulate weight changes via a cost function. SUMO, Simulation of Urban MObility; see...
"""Git implementation of _version.py.""" import errno import os import re import subprocess import sys def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable names, ...
""" Common structures and functions used by other scripts. """ from xml.etree import cElementTree as ET str_to_entailment = {'none': 0, 'entailment': 1, 'paraphrase': 2} entailment_to_str = {v: k for k, v in str_to_entailment.items()} class Pair(object): ''' Class repre...
from edges import EdgeExtractor from extractor import Extractor from parambfs import ParamExtractor
""" .. module: FSRStools.rraman :platform: Windows .. moduleauthor:: Daniel Dietze <daniel.dietze@berkeley.edu> Resonance Raman excitation profile calculation based on the time-domain picture of resonance Raman. See Myers and Mathies in *Biological Applications of Raman Spectroscopy*, Vol. 2, pp. 1-58 (John Wiley an...
"""Test results and related things.""" __metaclass__ = type __all__ = [ 'ExtendedToOriginalDecorator', 'MultiTestResult', 'TestResult', 'ThreadsafeForwardingResult', ] import datetime import sys import unittest from testtools.compat import all, _format_exc_info, str_is_unicode, _u _ZERO = datetime.t...
import abc import subprocess import logging from observables import BLOperator, MCObservable from data import BLDataChannel, GIDataChannel import util class Channel(metaclass=abc.ABCMeta): ISOSPIN_MAP = { 'singlet': "0", 'doublet': "1h", 'triplet': "1", 'quartet': "3h", 'quintet': "2", ...
from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils.data import flt, nowdate, getdate, cint class MoneyTransfere(Document): def on_submit(self): self.validate_transfere() def validate(self): self.get_dummy_accounts() def get_dummy_accounts(self): d...
import numpy as np def min_max_model(power, use, battery_capacity): """ Minimal maximum battery model, obsoleted :param power: Pandas TimeSeries, total power from renewable system :param use: float, unit W fixed load of the power system :param battery_capacity: float, unit Wh battery capacity :r...
import re class HeadingsParser(): """ The HeadingParser parses the document for headings. NOT YET: converts headings to raw latex headings in the correct way, so that they can be referrenced to later see https://www.sharelatex.com/learn/Sections_and_chapters for info about the levels""" def __init__...
''' Provides schema and insert queries for the practitioner table information about the practitioners (dentists hygienists etc..) ''' from lib_openmolar.common.db_orm import InsertableRecord TABLENAME = "practitioners" class DemoGenerator(object): def __init__(self, database=None): self.length = 4 s...
import os import traceback from pysollib.mygettext import _ from pysollib.settings import TITLE from pysollib.settings import VERSION from pysollib.settings import TOOLKIT, USE_TILE from pysollib.settings import DEBUG from pysollib.mfxutil import print_err if TOOLKIT == 'tk': if USE_TILE: from pysollib.tile...
import sys g = {} n = {} for line in sys.stdin: (n1, n2, p, q, t, tg, x) = line.strip().split(' ') t = int(t) x = float(x) key = ' '.join((n1,n2,p,q)) if not key in n: n[key] = 0 g[key] = 0 n[key] += t g[key] += x*t for key in n: print key, n[key], g[key]/n[key]
from __future__ import absolute_import, print_function, unicode_literals from django.contrib.auth import REDIRECT_FIELD_NAME from django.shortcuts import redirect from django.contrib.auth.views import logout as original_logout from loginas import settings as la_settings from loginas.utils import restore_original_login ...
import traceback import tempfile import weka.core.jvm as jvm from weka.flow.control import Flow from weka.flow.source import ListFiles from weka.flow.sink import Console def main(): """ Just runs some example code. """ # setup the flow flow = Flow(name="list files") # flow.print_help() listf...
""" Copyright 2015 SmartBear Software 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...
import os import sys import subprocess sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from lutris.util.wineregistry import WineRegistry PREFIXES_PATH = os.path.expanduser("~/Games/wine/prefixes") def get_registries(): registries = [] directories = os.listdir(PREFIXES_PATH) d...
# -*- coding: utf-8 -*- import re from channels import renumbertools from channelselector import get_thumb from core import httptools from core import scrapertools from core import servertools from core import tmdb from core.item import Item from platformcode import config, logger from channels import autoplay IDIOMAS...
import argparse import logging import string logging.getLogger("scapy.runtime").setLevel(logging.ERROR) from scapy import volatile # noqa: E402 from scapy import sendrecv # noqa: E402 from scapy import config # noqa: E402 from scapy.layers import l2 # noqa: E402 from scapy.layers import inet # noqa: E402 from scap...
import os import pickle import random import time import urllib try: import xbmc, xbmcgui except: pass from platformcode import config, logger LIBTORRENT_PATH = config.get_setting("libtorrent_path", server="torrent", default='') from servers import torrent as torr lt, e, e1, e2 = torr.import_libtorrent(LIBTORRE...
from django.views.generic.simple import direct_to_template from django.contrib.auth import views as auth_views from django.conf.urls import patterns, url from django.core.urlresolvers import reverse_lazy from registration.views import register urlpatterns = patterns('', # urls for simple one-step registration u...
name = "*PEAK only" Cs={} maxS=2 maxW=2 splitheavies=0 Cs['strength.w=>-p']=1 Cs['footmin-w-resolution']=1 Cs['footmin-f-resolution']=1 Cs['skip_initial_foot']=1
from gnuradio import gr, gr_unittest from gnuradio import blocks import grdab class qa_measure_processing_rate(gr_unittest.TestCase): """ @brief QA for measure processing rate sink. This class implements a test bench to verify the corresponding C++ class. """ def setUp(self): self.tb = gr.top_block() def tearDo...
import numpy as np import unittest as ut import espressomd import espressomd.electrostatics import espressomd.interactions from espressomd import drude_helpers class Drude(ut.TestCase): @ut.skipIf(not espressomd.has_features("P3M", "THOLE", "LANGEVIN_PER_PARTICLE"), "Test needs P3M, THOLE and LANGEVIN_PER_PARTICLE"...
from GangaCore.GPIDev.Lib.Tasks import ITask from GangaCore.GPIDev.Schema import Schema, Version class CoreTask(ITask): """General non-experimentally specific Task""" _schema = Schema(Version(1, 0), dict(ITask._schema.datadict.items())) _category = 'tasks' _name = 'CoreTask' _exportmethods = ITask._...
from enemies import * from hero import * def annoying_input_int(message =''): answer = None while answer == None: try: answer = int(input(message)) except ValueError: print('Вы ввели недопустимые символы') return answer def game_tournament(hero, dragon_list): for ...
__all__ = [ "test_config_db", "test_grid", "test_shell", "test_svn", ] if __name__ == "__main__" : import doctest for i in __all__ : print ("%%-%ds: %%s" % (max(map(len, __all__)) + 1)) % ( i, doctest.testmod(__import__(i, None, None, [i, ], ), ), )
import socket import json import sys import subprocess import time import os path = "/home/ltcminer/mining/cgminer/cgminer" log_file = "/home/ltcminer/mining/minerlite.log" def linesplit(socket): buffer = socket.recv(4096) done = False while not done: more = socket.recv(4096) ...
import re import sys import os import getopt import vcf def main(): params = parseArgs() vfh = vcf.Reader(open(params.vcf, 'r')) #grab contig sizes contigs = dict() for c,s in vfh.contigs.items(): contigs[s.id] = s.length regions = list() this_chrom = None start = int() stop = int() count = 0 for rec in vf...
from aospy import Run am2_control = Run( name='am2_control', description=( 'Preindustrial control simulation.' ), data_in_direc=('/archive/Yi.Ming/sm2.1_fixed/' 'SM2.1U_Control-1860_lm2_aie_rerun6.YIM/pp'), data_in_dur=5, data_in_start_date='0001-01-01', data_in_en...
import unittest from dumpformat import dumpManager #try to save .test.xml does not work, why ? class mltriesTest(unittest.TestCase): def setUp(self): self.d = dumpManager() def test_init(self): self.d.save("./test.xml") def test_ def test_load(self): pass #TODO ...
from PySide import QtGui, QtCore from tool import Tool, EventData, MouseButtons, KeyModifiers, Face from plugin_api import register_plugin class ExtrudeTool(Tool): def __init__(self, api): super(ExtrudeTool, self).__init__(api) # Create our action / icon self.action = QtGui.QAction(QtGui.QPi...
import matplotlib.pyplot as plt import scipy as sp arq = 'CurvaGiro/pos.dat' v = [-10,1000, 0, 1000] xl = r'y metros' yl = r'x metros' x = sp.genfromtxt('CurvaGiro/pos.dat') a = plt.plot(x[:,2], x[:,1], 'k-') plt.grid(True, 'both', color = '0.8', linestyle = '--', linewidth = 1) plt.axis(v) plt.xlabel(xl) plt.ylabel(yl...
from quicktions import Fraction from . import ( _update, deprecated, enumerate, format, get, illustrators, io, iterate, iterpitches, lyconst, lyenv, makers, mutate, persist, string, wf, ) from ._version import __version__, __version_info__ from .bind impor...
"""Address model tests.""" from core.models import Address from core.factory import AddressFactory from tests.utils import ModelTestCase class AddressTest(ModelTestCase): """Test the Address model.""" model = Address field_tests = { 'line1': { 'verbose_name': 'ligne 1', 'blan...
""" Yarrharr production server via Twisted Web """ import io import json import logging import os import re import sys from base64 import b64encode import attr from django.conf import settings from django.dispatch import receiver from twisted.internet import defer from twisted.internet.endpoints import serverFromString...
import logging from functools import reduce import nanoget.utils as ut import pandas as pd import sys import pysam import re from Bio import SeqIO import concurrent.futures as cfutures from itertools import repeat def process_summary(summaryfile, **kwargs): """Extracting information from an albacore summary file. ...
import numpy from Plot.PlotLibrary import * from Catalog.ReadFermiCatalog import * from environ import FERMI_CATALOG_DIR source = "2FGL J1015.1+4925" Cat = FermiCatalogReader(source,FERMI_CATALOG_DIR,"e2dnde","TeV") print "2FGL association ",Cat.Association('3FGL') print "3FGL Name ",Cat.Association('2FHL','3FGL_name')...
""" author: Alex Apostoli based on https://github.com/hkm95/python-multiwii which is under GPLv3 """ import struct import time import sys import re class MSPItem: def __init__(self, name, fmt, fields): self.name = name self.format = fmt self.fields = fields if not isinstance(self....
""" This file is part of Commix Project (http://commixproject.com). Copyright (c) 2014-2017 Anastasios Stasinopoulos (@ancst). 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 L...
from boto.glacier.layer1 import Layer1 from boto.glacier.concurrent import ConcurrentUploader import sys import os.path from time import gmtime, strftime access_key_id = "xxx" secret_key = "xxx" target_vault_name = "xxx" inventory = "xxx" fname = sys.argv[1] fdes = os.path.basename(sys.argv[1]) if not os.path.isfile(fn...
from shutil import copyfile from datetime import datetime from ExcelMapper.mapper import * import xlrd import xlsxwriter row_rules_sheet1_t1 = { 'found "risk"': lambda data: 'risk' in data['type'], 'found "Risk"': lambda data: 'Risk' in data['type'], 'found "reward"(ignore letter casing)': lambda data: 'reward' in ...
import pandas as pd df = pd.read_csv('data/Reviews.csv') print(df.head(3)) print(df['Text'].head(2)) from sklearn.feature_extraction.text import TfidfVectorizer tfidf = TfidfVectorizer() print(tfidf) print(tfidf.fit(df['Text'])) X = tfidf.transform(df['Text']) print(X) print([X[1, tfidf.vocabulary_['peanuts']]]) print(...
from __future__ import print_function import gettext import gi gi.require_version('Peas', '1.0') from gi.repository import GObject from gi.repository import Peas from gi.repository import Peasy from gi.repository import Geany gettext.bindtextdomain("peasy", "/home/kugel/dev/geany.git/build-linux/dest/share/locale") get...
from kivy.uix.widget import Widget class HorizontalSpacer(Widget): def __init__(self, **kwargs): super(HorizontalSpacer, self).__init__( **kwargs) self.size_hint_y = None self.height=0 class VerticalSpacer(Widget): def __init__(self, **kwargs): super(VerticalSpacer, self).__init_...
import os from pypers.core.step import CmdLineStep class ReorderSam(CmdLineStep): spec = { "version": "0.0.1", "descr": [ "Runs ReorderSam to reorder chromosomes into GATK order" ], "args": { "inputs": [ { "name" ...
# -*- coding: utf-8 -*- """ ORCA Open Remote Control Application Copyright (C) 2013-2020 Carsten Thielepape Please contact me by : http://www.orca-remote.org/ 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 ...
import sys import math from PyQt5 import QtWidgets from PyQt5 import QtGui from PyQt5 import QtCore from mainwindow import Ui_MainWindow from scapy.all import * """ dump any string, ascii or encoded, to formatted hex output """ def dumpString(src, length=16): FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or...
""" Pegasus utility functions for pasing a kickstart output file and return wanted information """ from xml.parsers import expat import re import sys import logging import traceback import os re_parse_props = re.compile(r'(\S+)\s*=\s*([^",]+)') re_parse_quoted_props = re.compile(r'(\S+)\s*=\s*"([^"]+)"') logger = loggi...
import sys,os from PyQt5 import QtCore, QtGui, QtWidgets, uic from model import MainModel from view import MainView class App(QtWidgets.QApplication): def __init__(self, scriptpath, sys_argv): super(App, self).__init__(sys_argv) self.model = MainModel() self.main_view = MainView(self.model, scr...
from channels.auth import channel_session_user_from_http from .models import Stream, Notification import redis import ast from .task import sendNotifications, send_notifications from channels import Group import json redis_con = redis.Redis('demo.scorebeyond.com', 8007) subs = redis_con.pubsub() subs.subscribe('test') ...
"""effcalculator URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/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') Cla...
from base import Display, Screen, ScreenMode, Canvas from pyglet.libs.win32 import _kernel32, _user32, types, constants from pyglet.libs.win32.constants import * from pyglet.libs.win32.types import * class Win32Display(Display): def get_screens(self): screens = [] def enum_proc(hMonitor, hdcMonitor,...
import re from dadict import DADict from error import log_loading ETHER_ANY = "\x00"*6 ETHER_BROADCAST = "\xff"*6 ETH_P_ALL = 3 ETH_P_IP = 0x800 ETH_P_ARP = 0x806 ETH_P_IPV6 = 0x86dd ARPHDR_ETHER = 1 ARPHDR_METRICOM = 23 ARPHDR_PPP = 512 ARPHDR_LOOPBACK = 772 ARPHDR_TUN = 65534 IPV6_ADDR_UNICAST = 0x01 IPV6_ADDR_MU...
r"""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 Licens...
from flask import Blueprint from flask import flash from flask import make_response, render_template from flask_login import current_user from markupsafe import Markup from app.helpers.data_getter import DataGetter from app.helpers.auth import AuthManager from app.helpers.exporters.ical import ICalExporter from app.hel...
__author__ = 'Mayur M' import ImgIO def add(image1, image2): # add two images together if image1.width == image2.width and image1.height == image2.height: return_red = [] return_green = [] return_blue = [] for i in range(0, len(image1.red)): tmp_r = image1.red[i] + image...
""" Decode all-call reply messages, with downlink format 11 """ from pyModeS import common def _checkdf(func): """Ensure downlink format is 11.""" def wrapper(msg): df = common.df(msg) if df != 11: raise RuntimeError( "Incorrect downlink format, expect 11, got {}".for...
from typing import List class Message(object): class Origin(object): servername: str nickname: str username: str hostname: str command: str origin: Origin params: List[str]
"""pybackup - Backup Plugin for MySQL Database """ import os from pybackup import errors from pybackup import utils from pybackup.logmgr import logger from pybackup.plugins import BackupPluginBase from pysysinfo.mysql import MySQLinfo __author__ = "Ali Onur Uyar" __copyright__ = "Copyright 2011, Ali Onur Uyar" __credit...
import os import glob import cgi import PrintPages_test as pt address = cgi.escape(os.environ["REMOTE_ADDR"]) script = "Main Model Form" pt.write_log_entry(script, address) pt.print_header('GrowChinook', 'Std') pt.print_full_form(None, None, 'in', 'RunModel.py') extension = 'csv' os.chdir('uploads') result = [i for i i...
class Solution(object): @staticmethod def dfs(candidates, target, vis, res, cur_idx, sum): if sum > target: return if sum == target: ans = [candidates[i] for i in cur_idx if i >= 0] res.append(ans) return if sum < target: for i,...