content
stringlengths
4
20k
import urllib,urllib2,re,xbmcplugin,xbmcgui,sys,xbmc,xbmcaddon,xbmcvfs,socket,HTMLParser import json h = HTMLParser.HTMLParser() addon_id = 'plugin.video.replaypt' selfAddon = xbmcaddon.Addon(id=addon_id) addonfolder = selfAddon.getAddonInfo('path') artfolder = '/resources/img/' docverdade_url = 'http://docverdade.bl...
import os from django.core.management import BaseCommand from django.contrib.gis.utils import LayerMapping from mfl_gis.models import WorldBorder WORLD_SHAPEFILE = os.path.join( os.path.dirname( os.path.dirname( os.path.dirname(__file__) # Folder with this file i.e 'commands' ) # Pa...
from random import randint import numpy as n import matplotlib.pyplot as graph import os.path import sys is_spec = True default = "tooth" # Function to read the features from file def read_features(par_filename): vl = [] with open(par_filename, "r") as file_lines: #features = [[float(i) for i in line.split()...
### ndio membrane segmentation imports import ndio print ndio.version # Prints version import ndio.remote.OCP as OCP oo = OCP() import ndio.remote.OCPMeta as NDLIMS nn = NDLIMS() ### ### Watershed segmentation imports import numpy as np import matplotlib.pyplot as plt from scipy import ndimage as ndi from skimage....
from mercurial import util from mercurial.i18n import _ from common import commit, converter_source, checktool, NoRepo import marshal import re def loaditer(f): "Yield the dictionary objects generated by p4" try: while True: d = marshal.load(f) if not d: break ...
from . import data-structures # 1. Stack application def balanced_parentheses_checker(symbol_string): """Verify that a set of parentheses is balanced.""" opening_symbols = '{[(' closing_symbols = '}])' opening_symbols_stack = data_structures.Stack() symbol_count = len(symbol_string) counter ...
import sys import json import matplotlib.pyplot as plt from matplotlib.ticker import FormatStrFormatter from matplotlib.font_manager import FontProperties from numpy import arange _GRAPH_DEFAULTS = {"xlabel":"$x$", "ylabel":"$y$", "num_ticks":5, "axis_label_fontsize":"large", "tick_formatstr":"%.2f", "legend_...
from openstack.tests.unit import base from openstack.block_storage.v2 import type FAKE_ID = "6685584b-1eac-4da6-b5c3-555430cf68ff" TYPE = { "extra_specs": { "capabilities": "gpu" }, "id": FAKE_ID, "name": "SSD" } class TestType(base.TestCase): def test_basic(self): sot = type.Ty...
from gi.repository import Gst import xl.providers from xl.player.gst.gst_utils import ElementBin class Mono(ElementBin): index = 90 name = 'mono' def __init__(self): ElementBin.__init__(self, name=self.name) # self.elements[50] = Gst.ElementFactory.make('audioconvert', None) self...
#!/usr/bin/python import memlib keySizes = range(1,28) valueSizes = keySizes[:] keyChars = map(chr, range(97, 126)) valueChars1 = map(chr, range(65, 94)) valueChars2 = valueChars1[1:] + valueChars1[:1] valueChars3 = valueChars1[2:] + valueChars1[:2] valueChars4 = valueChars1[3:] + valueChars1[:3] valueChars5 = value...
__author__ = 'max' __all__ = ['Sentence', 'DependencyInstance', 'NERInstance'] class Sentence(object): def __init__(self, words, word_ids, char_seqs, char_id_seqs): self.words = words self.word_ids = word_ids self.char_seqs = char_seqs self.char_id_seqs = char_id_seqs def len...
from email.Message import Message import errno import smtplib import socket from bzrlib import ( config, email_message, errors, smtp_connection, tests, ui, ) def connection_refuser(): def connect(server): raise socket.error(errno.ECONNREFUSED, 'Connection Refused') smtp = ...
""" Handles all requests to Nova. """ from novaclient import exceptions as nova_exceptions from novaclient import extension from novaclient import service_catalog from novaclient.v1_1 import client as nova_client from novaclient.v1_1.contrib import assisted_volume_snapshots from novaclient.v1_1.contrib import list_ex...
from datetime import datetime, timedelta from optparse import make_option from django.core.management.base import BaseCommand from django.core.urlresolvers import reverse from django.test import Client from findingaids.fa.models import FindingAid, title_letters from findingaids.fa.views import fa_listfields class Co...
import os from subprocess import Popen, PIPE, STDOUT from math import radians, sin, cos from ase import Atom, Atoms from ase.neb import NEB from ase.constraints import FixAtoms from ase.optimize import QuasiNewton, BFGS from ase.visualize import view from ase.calculators.turbomole import Turbomole # Delete old coor...
import re from streamlink.exceptions import PluginError from streamlink.plugin import Plugin from streamlink.plugin.api import useragents from streamlink.stream import HLSStream from streamlink.stream import HTTPStream class TVP(Plugin): '''Telewizja Polska S.A. http://tvpstream.vod.tvp.pl ''' pl...
#!/usr/bin/python """ Looks through network state files to find the ports that both the most and fewest exits allow. If SCANALLPORTS, then every possible port is scanned for each relay, but only for the first consensus of each day. Otherwise, a common subset is scanned for all relays for every consensus. Status for ea...
###################################################################### # Cloud Routes Web Application # ------------------------------------------------------------------- # HTTP Get Status Code Health Check - Forms Class ###################################################################### from wtforms import TextFi...
import os import sys import gtk import gtk.glade class AboutDialog: """Creates the dialog that shows the program information.""" def __init__(self): """Creates the dialog and shows it.""" # Set the correct path to the glade file gladefile = os.path.join(os.path.dirname(sys.argv[0]), 'Ab...
""" Created on Thu Nov 18 15:34:38 2014 @author: bercherj Remove TeX's file headers and footers """ import glob import os import sys import time from stat import * def texheaders_filtering(input_file): import re st = os.stat(input_file) atime = st[ST_ATIME] #access time mtime = st[ST_MTIME] ...
import logging import types import socket from xml.etree.cElementTree import ParseError as cParseError from Products.DataCollector.plugins.CollectorPlugin import PythonPlugin from twisted.internet import defer from twisted.internet.error import ( ConnectError, ConnectionRefusedError, TimeoutError, Co...
from rest_framework.test import APIRequestFactory from ...utils.tests import BaseTestCase from ...accounts.models import AccountCollaborator from ..views import BoardViewSet, BoardCollaboratorViewSet from ..serializers import (BoardSerializer, BoardCollaboratorSerializer, BoardCollaboratorRe...
from characteristic import attributes from eliot import Message, MessageType, Field from effect import TypeDispatcher, ComposedDispatcher from effect.twisted import ( make_twisted_dispatcher, ) from effect.twisted import ( perform, deferred_performer) from twisted.conch.endpoints import ( SSHCommandClien...
# -*- coding: utf-8 -*- from notifintime.backends.base import NotificationBackendBase from notifintime.conf import NOTIFINTIME_GREEN if NOTIFINTIME_GREEN: import zmq.green as zmq else: import zmq class ZeroMQBackend(NotificationBackendBase): name = 'zeromq' def __init__(self, *args, **kwargs): ...
#!/usr/bin/env python from google.appengine.api import app_identity from google.appengine.api import mail """ main.py -- Udacity conference server-side Python App Engine HTTP controller handlers for memcache & task queue access $Id$ created by wesc on 2014 may 24 """ __author__ = '<EMAIL> (Wesley Chun)' impo...
# -*- coding: utf8 -*- """ Pylatest test case document module. This module contains information about expected structure of pylatest document types (eg. list of section titles) and other general functions. """ # Copyright (C) 2016 <EMAIL> # # This program is free software: you can redistribute it and/or modify # it ...
# -*- coding: utf-8 -*- """ Created on Mon Nov 16 10:33:52 2015 @author: anderson """ import numpy as np import time from pyhfo.core import EventList def find_max(data, thr=None): ''' return the index of the local maximum ''' value = (np.diff(np.sign(np.diff(data))) < 0).nonzero()[0] + 1 if thr is...
# -*- coding: utf-8 -*- import requests import werkzeug import datetime import simplejson import openerp from openerp.addons.saas_utils import connector, database from openerp.addons.web.http import request from openerp.tools import config from openerp import models, fields, api, SUPERUSER_ID from openerp import http ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from rest_framework.mixins import ListModelMixin from rest_framework.renderers import BrowsableAPIRenderer from rest_framework.settings import api_settings from drf_haystack.generics import HaystackGenericAPIView from shop.c...
#!/usr/bin/python import urllib2 import json def create_envelope(doc, url): envelope = { "doc_type": "resource_data", "doc_version": "0.11.0", "active": True, "resource_data_type": "metadata", "submitter_type": "anonymous", ...
import numpy as np import math def np_skew_symmetric(v): """ From: https://github.com/vcg-uvic/learned-correspondence-release Create cross product matrix for v in R^3 """ if len(v.shape) == 1: v = np.expand_dims(v, axis=0) zero = np.zeros_like(v[:, 0]) M = np.stack([ zero...
# -*- coding: utf-8 -*- # Import python from __future__ import absolute_import import os import time import subprocess # Import Salt Testing libs from salttesting import skipIf from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') # Import salt libs import integration import salt.utils from s...
from sys import argv from BitTorrent.bencode import bencode, bdecode if len(argv) < 3: print '%s http://new.uri:port/announce file1.torrent file2.torrent' % argv[0] print exit(2) # common exit code for syntax error for f in argv[2:]: h = open(f, 'rb') metainfo = bdecode(h.read()) h.close() ...
import uuid from django.db import models from django.contrib.auth.models import BaseUserManager, AbstractBaseUser class LesspassUserManager(BaseUserManager): def create_user(self, email, password=None): if not email: raise ValueError("Users must have an email address") user = self.mod...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'StundenAufzeichnung.arbeitnehmer' db.add_column('stunden_stundenaufzeichnung', 'arbeitnehmer...
""" Example of use of the soledad api. """ from __future__ import print_function import datetime import os from leap.soledad.client import sqlcipher from leap.soledad.client.sqlcipher import SQLCipherOptions folder = os.environ.get("TMPDIR", "tmp") times = int(os.environ.get("TIMES", "1000")) silent = os.environ.get...
from .entity_health_state_chunk import EntityHealthStateChunk class NodeHealthStateChunk(EntityHealthStateChunk): """Represents the health state chunk of a node, which contains the node name and its aggregated health state. . :param health_state: Possible values include: 'Invalid', 'Ok', 'Warning', ...
"""Test helpers for boot-image parameters.""" from maastesting.factory import factory def make_boot_image_params(): """Create an arbitrary dict of boot-image parameters. These are the parameters that together describe a kind of boot for which we may need a kernel and initrd: operating system, architect...
import PIL from PIL import ImageFont from PIL import Image from PIL import ImageDraw def credit_figure ( member_name, text_color, px_from_left, px_from_top, image_to_open, save_image_as) : ''' Labels plots and figures with creator's name. All plots and figures should be in .png, .gif, or .jpg format. ...
from macropy.core.macros import * from macropy.core.quotes import macros, q, ast, u from ast import * import common import copy # Returns a list of the vars assigned to in an arguments node def get_params_in_arguments(node): @Walker def get_params(tree, collect, **kw): if isinstance(tree, Name): collect...
"""Saving things to disk periodically.""" import os.path import collections from PyQt5.QtCore import pyqtSlot, QObject, QTimer from qutebrowser.config import config from qutebrowser.commands import cmdutils from qutebrowser.utils import utils, log, message, objreg, usertypes class Saveable: """A single thing ...
# -*- coding: utf-8 -*- """ requests_toolbelt.multipart.decoder =================================== This holds all the implementation details of the MultipartDecoder """ import sys import email.parser from .encoder import encode_with from requests.structures import CaseInsensitiveDict def _split_on_find(content, ...
import elasticsearch import pendulum from elasticsearch_dsl import Search from airflow.utils import timezone from airflow.utils.helpers import parse_template_string from airflow.utils.log.file_task_handler import FileTaskHandler from airflow.utils.log.logging_mixin import LoggingMixin class ElasticsearchTaskHandler(...
#!/bin/python import active import unittest import numpy as np; import common from Matrix_Utils import *; class ActiveTester(unittest.TestCase): def test_active(self): a = np.array([[1.0,2],[0,0],[-1,-2]]); # test sgmoid standard = np.array([[0.7310585786300049,0.8807970...
# -*- coding: utf-8 -*- from api import Api from contextlib import closing from datetime import datetime from functools import reduce from json import loads, dumps from operator import add from os.path import isdir, expanduser from util import abort, send_mail, paste, obtain_latest_emos_content import codecs import os...
""" Stat disengagements and auto/manual driving mileage. Usage: ./stat_mileage.py bag1 bag2 ... """ import collections import math import sys from cyber.python.cyber_py3 import cyber from cyber.python.cyber_py3.record import RecordReader from modules.canbus.proto import chassis_pb2 from modules.canbus.proto.chass...
from openerp.osv import orm, fields class purchase(orm.Model): def _work_done(self, cr, uid, ids, name, arg=None, context=None): res = {} for purchase_order_id in ids: purchase_order = self.pool.get('purchase.order').browse(cr, uid, purchase_order_id, context) res[purchase_...
"""ipdevpoll type detection plugin. Collects sysObjectId and compares with the registered type of the netbox. """ from nav.ipdevpoll import Plugin, storage, shadows, signals, db from nav.oids import OID from nav.mibs.snmpv2_mib import Snmpv2Mib from nav.models import manage class InvalidResponseError(Exception): ...
#!/usr/bin/env python2 # ############################################################################## ### NZBGET POST-PROCESSING SCRIPT ### # Post-Process to Mylar. # # This script sends the download to your automated media management servers. # # NOTE: This script requires P...
from docutils import nodes from sphinx import addnodes from sphinx.domains import Domain from sphinx.domains import Index from sphinx.domains import ObjType from sphinx.roles import XRefRole from sphinx.util import ws_re from sphinx.util.compat import Directive from sphinx.util.nodes import make_refnode class BBRefTa...
''' Image ===== The :class:`Image` widget is used to display an image:: wimg = Image(source='mylogo.png') Asynchronous Loading -------------------- To load an image asynchronously (for example from an external webserver), use the :class:`AsyncImage` subclass:: aimg = AsyncImage(source='http://mywebsite.com...
# -*- coding: utf-8 -*- """This is a generated class and is not intended for modification! """ from datetime import datetime from infobip.util.models import DefaultObject, serializable class BulkResponse(DefaultObject): @property @serializable(name="bulkId", type=unicode) def bulk_id(self): """ ...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # streamondemand - XBMC Plugin # Conector para nowvideo # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ # Credits: # Unwise and main algorithm taken from Eldorado ...
class String(object): def __init__(self, choices=None): if choices: choices = [str(c) for c in choices] self.choices = choices def __call__(self, value): value = str(value) if self.choices and value not in self.choices: raise ValueError("provided value ...
"""Interface to the compiler's internal symbol tables""" import _symtable from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, OPT_EXEC, OPT_BARE_EXEC, SCOPE_OFF, SCOPE_MASK, FREE, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL, LOCAL) import weakref __all_...
"""The expression functor of Relay.""" from tvm.ir import Op from .function import Function from .expr import Call, Let, Var, GlobalVar from .expr import If, Tuple, TupleGetItem, Constant from .expr import RefCreate, RefRead, RefWrite from .adt import Constructor, Match, Clause class ExprFunctor: """ An abst...
import sys import pytz from django.http import HttpResponse from django.utils import simplejson from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from datetime import datetime, timedelta import dateutil.parser from datebook.models import Event, Datebook from datebook.forms import ...
#! /usr/bin/env python from openturns import * TESTPREAMBLE() try: # First, build two functions from R^3->R inVar = Description(3) inVar[0] = "x1" inVar[1] = "x2" inVar[2] = "x3" outVar = Description(1) outVar[0] = "y" formula = Description(1) formula[0] = "x1^3 * sin(x2 + 2.5 * x...
from __future__ import unicode_literals, absolute_import import json import unittest import responses from linebot import ( LineBotApi ) from linebot.models import ( ImagemapSendMessage, BaseSize, URIImagemapAction, ImagemapArea, MessageImagemapAction ) class TestLineBotApi(unittest.TestCase): def s...
from __future__ import print_function import sys import unittest import mock from mock import Mock, patch, sentinel import nose.tools import glacier EX_TEMPFAIL = 75 PY2 = (sys.version_info[0] == 2) def patch_builtin(name, *args, **kwargs): """Helper to patch builtins easily for py2 and py3""" target = ...
import sys import os import re import pkg_resources from ConfigParser import ConfigParser from urlparse import urljoin from logger import log, error, DEBUG from cmdrunner import add_checkpoint, run, cd, cp, rm, mkdir def install_libs(required_libs): for lib_spec in required_libs: if isinstance(lib_spec, s...
import numpy as np from numpy.testing import (assert_almost_equal, assert_equal, assert_allclose, assert_array_almost_equal, assert_) from scipy.special import logsumexp, softmax def test_logsumexp(): # Test whether logsumexp() function correctly handles large inputs. a = np.arange...
#!/usr/bin/env python """ Example from pybedtools documentation (:ref:`third example`) to count \ reads in introns and exons using multiple CPUs. """ from __future__ import print_function import pybedtools import argparse import os import sys import multiprocessing def featuretype_filter(feature, featuretype): ...
"""Tests for basic_rnn_graph.""" # internal imports import tensorflow as tf from magenta.models.basic_rnn import basic_rnn_graph from magenta.music import melodies_lib class BasicRNNGraphTest(tf.test.TestCase): def setUp(self): self.encoder_decoder = melodies_lib.OneHotMelodyEncoderDecoder(0, 12, 0) def t...
# load the pypes framework from pkg_resources import require require('pypes') import stackless from pypes.pype import Pype from pypes.component import Component from pypes.filters import ConsoleOutputWriter # sample component class HelloWorld(Component): def __init__(self): Component.__init__(self) ...
import os import unittest from vsg.rules import library 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_002_test_input.vhd')) lExpected = [] lExpected.append('') utils.read_file(os.path.join(sTestDir, '...
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
from django.core.exceptions import ValidationError import string import ipaddr def do_zone_validation(domain): """Preform validation on domain. This function calls the following functions:: check_for_soa_partition check_for_master_delegation validate_zone_soa .. note:: T...
# coding=utf-8 # Python 2/3 compatibility # pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-order,wrong-import-position,import-error,no-name-in-module from __future__ import (absolute_import, division, print_function, unicode_literals) from future.builtins.disabled import * from future.builtins imp...
""" Contains ======= * Tree * CycleHist * CycleHistValue """ from __future__ import print_function from sys import stdout from BinPy.gates.gates import * from BinPy.connectors.connector import * class Tree: ''' This class is a tree representation of a digital element, such as a gate, and its inputs. T...
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from gasistafelice.gas.models import GAS, GASMember from gasistafelice.lib.djangolib import get_qs_filter_dict_from_str, get_instance_dict_from_attrs from gasistafelice.lib import get_params_from_template class Command...
""" P1 tests for Dedicating Public IP addresses """ #Import Local Modules import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * from marvin.lib.base import * from marvin.lib.common import * import datetime from socket...
from math import ceil, log class Node(object): def __init__(self, x, y, w, h): self.x = x self.y = y self.w = w self.h = h self.right = None self.down = None def insert(self, w, h): if self.right: result = self.right.insert(w, h) i...
import os import json import datetime import base64 import itertools from hashlib import sha256 from flanker import mime from collections import defaultdict from sqlalchemy import (Column, Integer, BigInteger, String, DateTime, Boolean, Enum, ForeignKey, Text, Index) from sqlalchemy.orm import ...
import base64 import json import os from .util import kms, enc_to_clear_filename def decrypt_secret(secret): resp = kms.decrypt(CiphertextBlob=base64.b64decode(secret)) return base64.b64decode(resp['Plaintext']) def decrypt_file(filename, set_env=True, override_env=False): """ Decrypts a JSON file ...
# myapp.py from random import random from bokeh.layouts import column from bokeh.models import Button from bokeh.palettes import RdYlBu3 from bokeh.plotting import figure, curdoc # create a plot and style its properties p = figure(x_range=(0, 100), y_range=(0, 100), toolbar_location=None) p.border_fill_color = 'blac...
""" MAP Client, a program to generate detailed musculoskeletal models for OpenSim. Copyright (C) 2012 University of Auckland This file is part of MAP Client. (http://launchpad.net/mapclient) MAP Client is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Li...
#!/usr/bin/env python import unittest import mutagen.id3 from chirp.library import audio_file from chirp.library import checker from chirp.library import constants from chirp.library import ufid TEST_VOL = 17 TEST_TS = 1228080954 TEST_FP = "1" * 40 TEST_DURATION = 12345 TEST_ALBUM_ID = 33333 TEST_FRAME_COUNT = 444 ...
import os import re import time import datetime from Parser import Parser from Repository import Commit, Action, Person from utils import printout, printdbg class GitParser (Parser): class GitCommit: def __init__ (self, commit, parents): self.commit = commit self.parents = parent...
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) from google.appengine.ext import webapp from google.appengine.ext.webapp import util import handlers.intro import handlers.oauth import handlers.play import handlers.leaderboard import handlers.poll def main(): application...
"""Neural Shuffle-Exchange Network. Implementation of "Neural Shuffle-Exchange Networks - Sequence Processing in O(n log n) Time" paper by K.Freivalds, E.Ozolins, A.Sostaks. Paper: https://papers.nips.cc/paper/ 8889-neural-shuffle-exchange-networks-sequence-processing-in-on-log-n-time.pdf Original code: https://gith...
oitrials_analysis = ( 'conditions',SetType( 'Trials+conditions list' ), # Conditions file : contains informations about datas 'exp{experience_number}', # The experience directory SetContent( 'trial{trial_number}', # The trial directory SetContent( 'raw', # Directory containing ra...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Jonas Wacker' import keyword_extract_w2v import wiki_search_es import os import codecs import nltk import time num_test_transcripts = 30 def data_directory(): return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') if __name__ == "__mai...
""" Goal: test search event Authors: Andrei Sura <<EMAIL>> """ from .base_test_with_data import BaseTestCaseWithData from redidropper.models.event_entity import EventEntity from sqlalchemy.orm.exc import MultipleResultsFound class TestEvent(BaseTestCaseWithData): def test_default_events(self): """...
#!/usr/bin/env python3 """ this script will take any playlist that uploaded videos using the uploader and link the matches to TBA""" import json from .youtube import * from . import consts from .utils import quarters_match_code, semis_match_code, finals_match_code, tiebreak_mnum, get_match_results def update_descrip...
import datetime import logging from typing import Any, Dict, List, Optional, Union from django.core.exceptions import ValidationError from django.core.validators import URLValidator, validate_email from django.db import IntegrityError, transaction from django.http import HttpRequest, HttpResponse from django.utils imp...
import unittest import shutil import tarfile import tempfile from cerbero.packages.disttarball import DistTarball from test.test_packages_common import create_store from test.test_common import DummyConfig from test.test_build_common import add_files class DistTarballTest(unittest.TestCase): def setUp(self): ...
""" This module contains functions to filter injections with only useful templates. This module implements a set of checks to test for each segment and template combination whether injections contained within the segment are sufficiently "similar" to the template to require a matched-filter. There are a few ways of te...
# pylint: disable=bad-indentation,missing-class-docstring,missing-function-docstring from typing import Sequence, Tuple import sonnet as snt import tensorflow as tf from acme.tf import utils as tf2_utils from acme.tf import networks from acme.specs import EnvironmentSpec from src.utils.tf_linear_reg_utils import outer...
"""Tracking for bluetooth low energy devices.""" import logging from datetime import timedelta import voluptuous as vol from homeassistant.helpers.event import track_point_in_utc_time from homeassistant.components.device_tracker import ( YAML_DEVICES, CONF_TRACK_NEW, CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL, ...
from GladeWindow import GladeWindow from amara import binderytools as bt import gtk import os import pdb #---------------------------------------------------------------------- ## Implements the preferences window class Preferences( GladeWindow ): """ This class shows the preferences, and handles the signals. Is...
#!/usr/bin/env python import platform import threading import time class ScreenState: ON = 1 OFF = 2 if platform.system() == 'Darwin': import Quartz def init(): pass def screen_state(context): # thanks to http://stackoverflow.com/a/11511419/683436 d = Quartz.CGSessionCop...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging from flexget import plugin from flexget.config_schema import one_or_more from flexget.event import event from flexget.plugin import PluginWarning from flexg...
#!/usr/bin/env python ''' b2.py - translate decimal and binary Author: mrpaws Project Repo: https://github.com/mrpaws/b2 ''' import sys import argparse from types import IntType class B2Exception(Exception): '''pass generic b2 module exceptions ''' pass class Translator: '''b2 trans...
import pygame from pygame.locals import * if not pygame.font: print 'Warning, fonts disabled' if not pygame.mixer: print 'Warning, sound disabled' import engine import objects import webbrowser from scene import Scene from loader import load_image UPDATESCENE = USEREVENT+1 class MainMenu(engine.State): def ini...
from pathlib import Path from src.DigitalFactoryFileModel import DigitalFactoryFileModel from src.DigitalFactoryFileResponse import DigitalFactoryFileResponse file_1 = DigitalFactoryFileResponse(client_id = "client_id_1", content_type = "zomg", ...
""" .. module:: controller :platform: Linux :synopsis: Controllers for web projects that encapsulates twisted low-level resources using custom routing system. .. moduleauthor:: Adam Drakeford <<EMAIL>> """ from collections import defaultdict from txrest.app import txREST from twisted.web impo...
"""pstree example file""" from volatility import renderers from volatility.renderers.basic import Address import volatility.win32.tasks as tasks import volatility.utils as utils import volatility.plugins.common as common import volatility.cache as cache import volatility.obj as obj import volatility.debug as debug #p...
# -*- coding: utf-8 -*- """The SleuthKit (TSK) file system implementation.""" import pytsk3 # This is necessary to prevent a circular import. import dfvfs.vfs.tsk_file_entry from dfvfs.lib import definitions from dfvfs.lib import errors from dfvfs.lib import tsk_image from dfvfs.path import tsk_path_spec from dfvfs....
"""The tests for Home Assistant frontend.""" import asyncio import re from unittest.mock import patch import pytest from homeassistant.setup import async_setup_component from homeassistant.components.frontend import ( DOMAIN, CONF_JS_VERSION, CONF_THEMES, CONF_EXTRA_HTML_URL, CONF_EXTRA_HTML_URL_ES5) from hom...