content stringlengths 4 20k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# description .tabelaSimples tr th
# value .tabelaSimples tr td
from BeautifulSoup import BeautifulSoup
from pprint import pprint
from zenlog import log
import json
HTML_DIR = "./"
OUTFILE = "banks-info.json"
def parse_file(f):
bank = {}
html = open(f, 'r').rea... |
#!/usr/bin/python
import pysam
import string
import argparse
# The MIT License (MIT)
# Copyright (c) [2014] [Peter Hickey (<EMAIL>)]
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without... |
STATUS_SUCCESS = 'urn:oasis:names:tc:SAML:2.0:status:Success'
STATUS_REQUESTER = 'urn:oasis:names:tc:SAML:2.0:status:Requester'
STATUS_RESPONDER = 'urn:oasis:names:tc:SAML:2.0:status:Responder'
STATUS_VERSION_MISMATCH = 'urn:oasis:names:tc:SAML:2.0:status:VersionMismatch'
STATUS_AUTHN_FAILED = 'urn:oasis:names:tc:SAML... |
"""model objects used by the configuration assistant steps"""
import random
from flumotion.common import log
from flumotion.common.errors import ComponentValidationError
from flumotion.common.fraction import fractionFromValue
__version__ = "$Rev$"
def _generateRandomString(numchars):
"""Generate a random US-AS... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option... |
from __future__ import print_function
from ethronsoft.gcspypi.exceptions import InvalidParameter, InvalidState
from ethronsoft.gcspypi.package.package_builder import Package, PackageBuilder
from ethronsoft.gcspypi.utilities.queries import get_package_type, items_to_package, pkg_range_query
from ethronsoft.gcspypi.utili... |
"""
Description: Simple tests for lists pages
Author: ltrilety
"""
import pytest
import usmqe.inventory
from usmqe.web.tendrl.mainpage.clusters.cluster_list.pages import ClustersMenu
from usmqe.web.tendrl.mainpage.hosts.pages import HostsMenu
def test_hosts_list(valid_credentials):
"""
very simple test wh... |
# import the pygame module, so you can use it
import pygame
from pygame.locals import *
# import the pygame module, so you can use it
from config import *
from game import *
# Current cursor position
CURSOR = None
def move_cursor(grid, dx, dy):
global CURSOR
x = CURSOR[0]
y = CURSOR[1]
grid.cells[x... |
import numpy as np
import paddle
from paddle import fluid, nn
import paddle.fluid.dygraph as dg
import paddle.nn.functional as F
import unittest
class GridSampleTestCase(unittest.TestCase):
def __init__(self,
methodName='runTest',
x_shape=[2, 2, 3, 3],
grid_shape... |
# -*- coding: utf-8 -*-
u"""Mapping of rt_params to srw_params.
:copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import argparse
from pykern import pkarray
from pyke... |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
SPDX-License-Identifier: Apache-2.0
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 ... |
from invenio.webdeposit_load_forms import forms
from invenio.webdeposit_workflow_utils import authorize_user, \
render_form, \
wait_for_submission, \
export_marc_from_json, \
... |
import pytest
from polite.paths import Directory
from dtocean_core.utils.config import (init_config,
init_config_parser,
init_config_interface)
def test_init_config(mocker, tmpdir):
# Make a source directory with some files
config... |
import re
email_re = re.compile(r'''
(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)* # dot-atom
|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*" # quoted string
)@(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?$ # domain.tld
''', re.IGNORECASE | re.... |
from operator import mul
from functools import partial
import time
import six
from twisted.internet import reactor, defer, task
from twisted.python import log, failure
def simpleBackoffIterator(maxResults=10, maxDelay=120.0, now=True,
initDelay=0.01, incFunc=None):
"""
Return a gene... |
import pinocchio as se3
from pinocchio import SE3, Quaternion
rleg_id = "RLEG_JOINT5"
lleg_id = "LLEG_JOINT5"
rhand_id = "RARM_JOINT5"
lhand_id = "LARM_JOINT5"
rleg_rom = 'hrp2_rleg_rom'
lleg_rom = 'hrp2_lleg_rom'
rhand_rom = 'hrp2_rarm_rom'
lhand_rom = 'hrp2_larm_rom'
limbs_names = [rleg_rom,lleg_rom,rhand_rom,lhand_... |
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from functools import partial
from six.moves import range
from threading import Thread, Event
from cassandra import ConsistencyLevel, OperationTimedOut
from cassandra.cluster import NoHostAvailable
from cassandra.io.asyncorereactor ... |
import json
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponse # noqa
from django.views.generic import TemplateView # noqa
from django.views.generic import View # noqa
from openstack_dashboard import a... |
import os, logging
from io import StringIO
from threading import Thread
from yapsy.PluginManager import PluginManager
from yapsy.IPlugin import IPlugin
from yapsy.PluginInfo import PluginInfo
import BasePlugin
from Logger import Logger
class DpxPluginManager(PluginManager, Logger):
def __init__(self, **kwargs):
... |
import lib
from pyblish_bumpybox import inventory
def test_plugins_use_inventory_order():
failed_plugins = []
for plugin in lib.get_all_plugins():
code_line = "order = inventory.get_order(__file__, \"{0}\")".format(
plugin.__name__
)
with open(plugin.__module__, "r") as t... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from transport import * # general transport class
from mhfem_acc import * # MHFEM acceleration solver
from directld import * # direct S2 LLDG solver
from scipy.integrate import quadrature as quad
''' Lumped Linear Discontinuous Galerkin ... |
import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
from phyllo.phyllo_logger import logger
# seems to work fine
def getBooks(soup):
siteURL = 'http://www.thelatinlibrary.com'
textsURL = []
# get links to books in the collection
for a in soup.find_a... |
from JumpScale import j
descr = """
Check on disk fullness
"""
organization = "jumpscale"
author = "<EMAIL>"
license = "bsd"
version = "1.0"
period = 60 # always in sec
startatboot = True
order = 1
enable = True
async = True
log = False
queue ='process'
roles = ['master']
def action():
try:
import Jump... |
# -*- coding: utf-8 -*-
# *****************************************************
# whatsapp scripting v1.0
# Parwinder <<EMAIL>>
# https://github.com/parwinders
# 3oth march 2017
# *****************************************************
from thread import *
# import pdb;pdb.pm()
import os
import wa
import sys
import time... |
from django.conf.urls import url
from lana_dashboard.lana_data import views
app_name = "lana_data"
urlpatterns = [
url(r'^institutions/$', views.list_institutions, name='institutions'),
url(r'^institutions/create$', views.edit_institution, name='institution-create'),
url(r'^institutions/(?P<code>.+)/autonomous_sy... |
import logging
from openerp import models, fields, api
_logger = logging.getLogger('base_report_to_printer')
class ReportXml(models.Model):
"""
Reports
"""
_inherit = 'ir.actions.report.xml'
property_printing_action = fields.Many2one(
comodel_name='printing.action',
string='Act... |
import time
from libcloud.monitor.base import MonitorDriver, AutoScaleAlarm
from libcloud.monitor.types import Provider, AutoScaleMetric, \
AutoScaleOperator
from libcloud.common.types import LibcloudError
from libcloud.common.openstack_heat import OpenStackHeatConnection, \
OpenStackHeatResponse
from libclou... |
"""
WSGI config for asylum project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... |
## \file
## \ingroup tutorial_roofit
## \notebook
##
## Special p.d.f.'s: histogram based p.d.f.s and functions
##
## \macro_code
##
## \date February 2018
## \author Clemens Lange, Wouter Verkerke (C++ version)
import ROOT
# Create pdf for sampling
# ---------------------------------------------
x = ROOT.RooRealVa... |
# -*- coding: utf8 -*-
__author__ = "A. Daouzli"
__copyright__ = "Copyright 2013, A. Daouzli"
__licence__ = "GPL3"
__version__ = "0.0.1"
__maintainer__ = "A. Daouzli"
# The application() function is the function that responses to the HTTP request.
# It is this function that you should link to your server.
import o... |
'''
Created on 2013-05-28
@author: brian
'''
from pygame.color import THECOLORS
from projectiles import Arrow
from random import randint
from src.util import Vector2
class BowShot(object):
range = 7
damage = 2, 5
heal = False
name = "Shoot"
icon = "arrow"
cooldown = 0
def __init__(self, caster, location,... |
from taiga.base import exceptions as exc
from taiga.base.api.utils import get_object_or_404
from django.apps import apps
from django.utils.translation import ugettext as _
import json
def get_user_for_application_token(token:str) -> object:
"""
Given an application token it tries to find an associated user
... |
from django.shortcuts import render_to_response
from django.http import HttpResponse
from django.conf import settings
from django.core.files.temp import NamedTemporaryFile
from cephclient import wrapper
from collections import defaultdict
import requests
import re
import math
import json
import subprocess
from humaniz... |
'''
Created on 8 Dec 2012
@author: bruno
'''
from riak import RiakClient
from django.conf import settings
import json
class MaternityService:
def __init__(self):
self.maternity_bucket = settings.RIAK_MATERNITY_BUCKET
self.riak = RiakClient(host = settings.RIAK_DATABASE['HOST'],
... |
import unittest
from PyQt5.QtCore import QCoreApplication, QSize
from .gui_test import GUITest
class TestPersistWindowState(GUITest):
"""The main window's size, position and state - maximized and full screen
"""
@classmethod
def setUpClass(cls):
super(TestPersistWindowState, cls).setUpClass(... |
# vim: set fileencoding=utf-8
import argparse, logging, logging.handlers, datetime, sys
# NOTES:
# rate:
# access type: Fixed term, Notice period
# wd w/o penalty period/access (months/days) (0 = forever)
# access period = Months, Days
# rate_type: fixed, variable
# access period (days, 0 = instant)
# tax status: ISA
... |
from __future__ import absolute_import, division, print_function, unicode_literals
from textwrap import dedent
from pants_test.pants_run_integration_test import PantsRunIntegrationTest, ensure_daemon
class ScalaReplIntegrationTest(PantsRunIntegrationTest):
def run_repl(self, target, program, repl_args=None):
... |
"""Script to plot example augmentations generated by the ImageAugmenter."""
from __future__ import print_function
# make sure that ImageAugmenter can be imported from parent directory
if __name__ == '__main__' and __package__ is None:
from os import sys, path
sys.path.append(path.dirname(path.dirname(path.absp... |
# from http://py-fun.googlecode.com/svn-history/r10/trunk/toolbox/graphics2d.py
'''graphics2d.py
Basic 2d graphics shapes to use with pyglet/opengl.
To make use of some of the advanced options (for example, line stippling),
one must be familiar with the opengl documentation.
'''
from pyglet.gl import *
__all__ = ["d... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Read and write JSON file.
"""
import os.path as op
import sys
import logging
import json
import pandas as pd
from maize.formats.base import must_open, ndigit, prettysize
def main():
import argparse
ps = argparse.ArgumentParser(
formatter_class = ... |
# -×- coding:utf-8 -*-
from com.android.monkeyrunner import MonkeyRunner as MR
from util import *
INTERNAL = 2
class Case(object):
def __init__(self, name, brand):
self.name = name
self.brand = brand
def __repr__(self):
return self.__class__+":"+self.name;
def getN... |
import operator
from collections import Counter, defaultdict
from CHILDES.pickled.load_pickled import unpickle_cds
# the most important CHILDES tags (according to the CHAT manual -- the actual tags used in some corpora may differ
# 1 Adjective -- ADJ
# 2 Adverb -- ADV
# 3 Commu... |
#!/usr/bin/env python
from generator.actions import Actions
import random
import string
import struct
def kaprica_mixin(self):
if hasattr(self, 'xlat_seed'):
return
def xlat_seed(seed):
def hash_string(seed):
H = 0x314abc86
for c in seed:
H = (H * 37) ... |
import logging
logging.disable(logging.CRITICAL)
import numpy as np
import copy
# Single core rollout to sample trajectories
def do_rollout(N_percpu,
actions_list,
actions_taken_so_far,
starting_fullenvstate,
which_cpu,
env=None,):
"""
... |
import logging
import subprocess
import tempfile
from telemetry import decorators
from telemetry.core import bitmap
from telemetry.core import exceptions
from telemetry.core import platform
from telemetry.core import util
from telemetry.core.platform import proc_supporting_platform_backend
from telemetry.core.platform... |
import re
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
def clean_ipv6_address(ip_str, unpack_ipv4=False,
error_message=_("This is not a valid IPv6 address.")):
"""
Cleans an IPv6 address string.
Validity is checked by c... |
"""A model representing a Grab n Go user."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from google.appengine.ext import ndb
from loaner.web_app.backend.api import permissions
_SUPERADMIN_RESERVED_ERROR = (
'Cannot create a role named "superadmin... |
"""
Tests for DOT Adapter
"""
import unittest
from datetime import timedelta
import pytest
import ddt
from django.conf import settings
from django.test import TestCase
from django.utils.timezone import now
from oauth2_provider import models
from common.djangoapps.student.tests.factories import UserFactory
# oauth_d... |
import contextlib
import json
import logging
import subprocess
from typing import Any, Dict, Iterator, Optional
from snapcraft.internal import repo
logger = logging.getLogger(__name__)
def _install_ua_tools() -> None:
"""Ensure UA tools are installed."""
repo.Repo.install_build_packages(package_names=["ubun... |
import unittest
import actions
class TestActions(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_load_config(self):
self.assertEqual(True, False)
def test_load_loader(self):
self.assertTrue(False)
def test_get_password(self):
... |
import os
import logging
logger = logging.getLogger('weblate')
def get_root_dir():
'''
Returns Weblate root dir.
'''
curdir = os.path.dirname(os.path.abspath(__file__))
return os.path.abspath(os.path.join(curdir, '..'))
def is_running_git():
'''
Checks whether we're running inside Git c... |
from . import database
class ChainState(object):
"""Register blockchain known state.
Stores which was the last block that was
synchronized into the database.
"""
def __init__(self, database_path):
"""Initialize the chain state.
Arguments:
database_path -- database connec... |
import json
from reversion import revisions as reversion
from reversion.admin import VersionAdmin
from django.contrib import admin, messages
from django.contrib.admin.widgets import AdminFileWidget
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django import forms
... |
import json
from wtforms.fields import BooleanField, RadioField
from wtforms.validators import Length, NumberRange
from wtforms.widgets.core import HiddenInput, Input, Select, TextArea
from indico.util.enum import RichEnum
from indico.web.forms.fields import (IndicoEnumRadioField, IndicoQuerySelectMultipleCheckboxFie... |
import httplib
import urllib
import time
import re
from tweepy.error import TweepError
from tweepy.utils import convert_to_utf8_str
re_path_template = re.compile('{\w+}')
def bind_api(**config):
class APIMethod(object):
path = config['path']
payload_type = config.get('payload_type', None)
... |
import tensorflow as tf
import unittest
from pymatgen.core import Structure, Lattice
from megnet.utils.descriptor import MEGNetDescriptor, DEFAULT_MODEL
from tensorflow.keras.models import Model
class TestGeneralUtils(unittest.TestCase):
def test_model_load(self):
model = MEGNetDescriptor(model_name=DEFA... |
import argparse
import bytefmt
import string
import sys
from dirtools.mediainfo import MediaInfo
from dirtools.expr import Parser, Context
def parse_args():
parser = argparse.ArgumentParser(description="Wrapper around MediaInfo")
parser.add_argument('PATH', action='store', nargs='+',
... |
"""External user authentication for CERN NICE/CRA Invenio."""
__revision__ = \
"$Id$"
import re
from invenio.legacy.external_authentication import ExternalAuth
# Tunable list of settings to be hidden
## e.g.: CFG_EXTERNAL_AUTH_HIDDEN_SETTINGS = ('auth', 'respccid', 'personid')
CFG_EXTERNAL_AUTH_HIDDEN_SETTINGS... |
"""
Methods for dealing with EDF+ files.
"""
from struct import unpack, calcsize
from collections import namedtuple
def _scale(v, s, d):
return ((v-s[0])/(s[1]-s[0])) * (d[1]-d[0]) + d[0]
class BadEdfException(Exception):
"""Raised if the file is not in the correct EDF+ format."""
pass
# Header contai... |
#!c:/Python27/python.exe
import cgi
import os
from db import DbChkPwd,DbGet
from config import maps_root
from cgiparser import FormParseStr
from users import CheckSession
from mapparser import ParseMap
from model import Track
from orchestrator import ProcessTrkSegWithProgress
from log import Log
from dem import GetEle... |
from seamstress.core import remote_file, user
from nose.tools import assert_equals
from tail import assert_abort
from fabric.api import *
@assert_abort
def test_remote_file_sha1_wrong():
remote_file("/tmp/nginx.tar.gz",
source="http://nginx.org/download/nginx-1.0.11.tar.gz",
checksum="c06144234144... |
# pylint: skip-file
# flake8: noqa
class OCServiceAccountSecret(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
kind = 'sa'
def __init__(self, config, verbose=False):
''' Constructor for OpenshiftOC '''
super(OCServiceAccountSecret, self).__init__(config.namespace, config.ku... |
import sys, json
from statistics import mean
from time import time
from datetime import datetime
from libDataLoaders import dataset_loader
from libFolding import Folding
from libSSHMM import SuperStateHMM
from libAccuracy import Accuracy
print()
print('-----------------------------------------------------------------... |
from PyQt4 import QtSql, QtCore
from tableDeBase import TableDeBase
import os
class TableMachines (TableDeBase):
def __init__(self):
TableDeBase.__init__(self,"Machines")
self.setField(("nomMachine","Os"))
self.setTypeField(('str','str'),('nomMachine'))
def createSqlTable(... |
CONF = {
'failure_refresh_timeout': 10,
'drivers': [
{
'name': 'selfsign',
'driver': 'cathead.drivers.selfsign.SelfSignDriver',
'ca_key_file': 'ca.p.key',
},
{
'name': 'eca',
'driver': 'cathead.drivers.eca.EcaDriver',
... |
"""
Simple blender para los valores de regresion deseados durante meses
"""
import numpy as np
from sklearn.ensemble import RandomForestRegressor, ExtraTreesRegressor, GradientBoostingRegressor
import load_data
from sklearn.cross_validation import KFold
from sklearn.linear_model import Ridge, RidgeCV, LinearRegressio... |
"""Some simple performance benchmarks for beets.
"""
from __future__ import print_function
from beets.plugins import BeetsPlugin
from beets import ui
from beets import vfs
from beets import library
from beets.util.functemplate import Template
from beets.autotag import match
from beets import plugins
from beets import ... |
import re
from oslo_log import log as oslo_logging
from cloudbaseinit import exception
from cloudbaseinit.metadata.services import base as service_base
from cloudbaseinit.osutils import factory as osutils_factory
from cloudbaseinit.plugins.common import base as plugin_base
from cloudbaseinit.utils import network
LO... |
from initialization import *
from matrixGen import *
from BEMsolver import *
from evolution import * |
from openerp.osv import fields, orm
class PaymentLine(orm.Model):
_inherit = 'payment.line'
_columns = {
'related_mode_id': fields.related(
'order_id', 'mode', type='many2one', relation='payment.mode',
string='Payment Mode', store=True, readonly=True),
}
class AccountMove... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals, print_function, absolute_import
import os
import shutil
import sys
import distutils
import subprocess
from setuptools import setup, find_packages
def read(*args):
return open(os.path.join(os.path.dirname(__file__), *args)).read()
... |
import six
import sys
import time
import socket
import struct
import logging
try:
import cPickle as pickle
except ImportError:
import pickle
import bucky2.client as client
import bucky2.names as names
if six.PY3:
xrange = range
log = logging.getLogger(__name__)
class DebugSocket(object):
def send... |
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
## @file texture_compress_hfb_mj2k.py
# Compress the HFB texture data, using Motion JPEG 2000.
# The two main steps performed are:
# - Create a header 'vix' for YUV file and concatenates both.
# - Encode components.
#
# @authors Vicente Gonzalez-Ruiz.
# @date Last... |
"""
Django settings for polyevent project.
Generated by 'django-admin startproject' using Django 1.9.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... |
"""
Summarize metrics/statistics from an Illumina flowcell sequencing run.
"""
# import os
# import re
#
# from bripipetools.io import parsers
#
# class FlowcellRun(object):
# def __init__(self, flowcell_dir):
# """
# Collects, formats, and reports information from metrics files for a
# flow... |
"""
Executing Exscript templates on a connection.
"""
from Exscript import stdlib
from Exscript.interpreter import Parser
def _compile(conn, filename, template, parser_kwargs, **kwargs):
if conn:
hostname = conn.get_host()
account = conn.last_account
username = account is not None and acco... |
"""
Test the base API classes
"""
import mock
import httmock
try:
import unittest2 as unittest
except ImportError:
import unittest
from hockeyapp import api
class APIErrorTestCase(unittest.TestCase):
def test_error_response_multi_repr(self):
value = api.APIError({'credentials': ['no api token']... |
from pybrain.rl.agents.linearfa import LinearFA_Agent
from pybrain.rl.experiments import EpisodicExperiment
from environment import Environment
from tasks import LinearFATileCoding3456BalanceTaskRewardPower4
from training import LinearFATraining
from learners import SARSALambda_LinFA_ReplacingTraces
task = LinearFATi... |
from marshmallow import fields
from common.schemas import SerializableSchema
from common.schemas.fields import validate_output
class KolibriFlagsSchema(SerializableSchema):
class Meta:
ordered = True
channel_id = fields.String(
metadata={
"label": "Channel ID",
"descr... |
"""The tests for the Input text component."""
# pylint: disable=protected-access
import asyncio
import unittest
from homeassistant.core import CoreState, State, Context
from homeassistant.setup import setup_component, async_setup_component
from homeassistant.components.input_text import (DOMAIN, set_value)
from tests... |
import inspect
import os
import pprint
import subprocess
import sys
import xml.etree.ElementTree as ET
import numpy as np
import yaml
this_file_path = os.path.abspath(inspect.getfile(inspect.currentframe()))
this_directory = os.path.dirname(this_file_path)
root_dir = os.path.join(os.path.dirname(this_file_path), '..'... |
"""Magicicada GTK UI."""
import gettext
import logging
import os
import sys
# pylint: disable=E0611
from gi.repository import GdkPixbuf, AppIndicator3, Gtk
# pylint: enable=E0611
# optional Launchpad integration, pylint: disable=F0401
# this shouldn't crash if not found as it is simply used for bug reporting
try:
... |
class ZiplineError(Exception):
msg = None
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
self.message = str(self)
def __str__(self):
msg = self.msg.format(**self.kwargs)
return msg
__unicode__ = __str__
__repr__ = __str__
class... |
from eos import EffectMode
from eos import ModuleHigh
from eos import Restriction
from eos import Ship
from eos.const.eve import AttrId
from eos.const.eve import EffectCategoryId
from eos.const.eve import EffectId
from tests.integration.restriction.testcase import RestrictionTestCase
class TestTurretSlot(RestrictionT... |
import unittest
import binascii
import common
import keepkeylib.ckd_public as bip32
import keepkeylib.types_pb2 as proto_types
class TestMsgGetaddress(common.KeepKeyTest):
def test_btc(self):
self.setup_mnemonic_nopin_nopassphrase()
self.assertEqual(self.client.get_address('Bitcoin', []), '1EfKbQu... |
from .sub_resource import SubResource
class Subnet(SubResource):
"""Subnet in a virtual network resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:param address_prefix: The address prefix for the subnet.
... |
import _clippy
from _clippy import parse, Graph, GraphNode
def graph_iterate(graph):
'''iterator yielding all nodes of a graph
nodes arrive in input/definition order, graph circles are avoided.
'''
queue = [(graph.first(), frozenset(), 0)]
while len(queue) > 0:
node, stop, depth = queue.p... |
"""
Testmodule for MPI-IO.
"""
import espressomd
import espressomd.io
from espressomd.interactions import AngleHarmonic
import numpy
import unittest as ut
import random
import os
from argparse import Namespace
# Number of particles
npart = 1023
# Number of different bond types
nbonds = 100
filename = "testdata.mpiio... |
from a10sdk.common.A10BaseClass import A10BaseClass
class DeviceId(A10BaseClass):
"""Class Description::
configure Scaleout devices.
Class device-id supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param action: {"descri... |
import unittest, time, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_util, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
global localhost
localhost = h2o.dec... |
#!/usr/bin/python
"""fit tuning curves to first level results
"""
import matplotlib as mpl
# we do this because sometimes we run this without an X-server, and this backend doesn't need
# one. We set warn=False because the notebook uses a different backend and will spout out a big
# warning to that effect; that's unnece... |
# -*- coding: utf-8 -*-
"""Helper utilities and decorators."""
import time, traceback
from sqlalchemy.exc import SQLAlchemyError
from flask import flash, render_template, current_app
def flash_errors(form, category="warning"):
"""Flash all errors for a form."""
for field, errors in form.errors.items():
... |
from __future__ import absolute_import
from __future__ import division
import logging
import os
import sqlite3
from guild import run_util
from guild import tfevent
from guild import util
from guild import var
log = logging.getLogger("guild")
VERSION = 1
DB_NAME = "index_v%i.db" % VERSION
class AttrReader(object):... |
# coding: utf-8
"""
MIT License
Copyright (c) 2019 Claude SIMON (https://q37.info/s/rmnmqd49)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limit... |
"""Customized QWebInspector for QtWebEngine."""
import os
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEngineView
from qutebrowser.browser import inspector
class WebEngineInspector(inspector.AbstractWebInspector):
"""A web inspector for QtWebEngine."""
def __init__(self, parent=... |
import mesonbuild.astinterpreter
from mesonbuild.mesonlib import MesonException
from mesonbuild import mlog
import sys, traceback
import argparse
def buildparser():
parser = argparse.ArgumentParser(prog='meson rewrite')
parser.add_argument('--sourcedir', default='.',
help='Path to sour... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
sys.path.append('..')
import geoip2.database
import maxminddb
try:
import maxminddb.extension
except ImportError:
maxminddb.extension = None
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
e... |
# -*- coding: utf-8 -*-
'''
Torrenter v2 plugin for XBMC/Kodi
Copyright (C) 2012-2015 Vadim Skorba v1 - DiMartino v2
https://forums.tvaddons.ag/addon-releases/29224-torrenter-v2.html
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Li... |
"""Script that generates the build.ninja for ninja itself.
Projects that use ninja themselves should either write a similar script
or use a meta-build system that supports Ninja output."""
from optparse import OptionParser
import os
import sys
sys.path.insert(0, 'misc')
import ninja_syntax
parser = OptionParser()
p... |
"""
Interfaces with SimpliSafe alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.simplisafe/
"""
import logging
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassista... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.