content string |
|---|
#!/usr/bin/env python
import unittest
from pymodbus.datastore import *
from pymodbus.exceptions import *
class ModbusServerSingleContextTest(unittest.TestCase):
''' This is the unittest for the pymodbus.datastore.ModbusServerContext
using a single slave context.
'''
def setUp(self):
''' Sets u... |
import tornado.web
from common import ParameterFormat, util
class PGBadgerConfigurationHandler(util.GeneratorRequestHandler):
"""
Implements a PGBadger Configuration Generator
"""
def initialize(self, format_name=None):
super(PGBadgerConfigurationHandler, self).initialize()
self.log_... |
import json
import os
from itertools import chain
from pprint import pformat
from urllib.parse import unquote, urlencode
from docutils.parsers.rst import Directive
from jinja2 import Template
from .parse_mixin import ParseMixin
TMPL = Template(
'''
.. sourcecode:: http
{{method|upper}} {{path}}{% if query %}... |
# -*- coding: utf-8 -*-
'''
This file is part of Habitam.
Habitam is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
Habitam is distr... |
from __future__ import absolute_import
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.html import format_html, format_html_join
from wagtail.wagtailcore import hooks
from wagtail.wagtailcore.whitelist import attribute_rule
@hooks.register('construct_whitelister_elemen... |
from pykickstart.version import FC3
from pykickstart.base import KickstartCommand
from pykickstart.options import KSOptionParser
class FC3_Method(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
removedAttrs = KickstartCommand.removedAttrs
# These are all set up as part of the base Ki... |
from django.http.response import HttpResponse, HttpResponseBadRequest
from django.shortcuts import get_object_or_404, render, redirect
from django.template import RequestContext
from django.template.loader import render_to_string
from django.views.generic import ListView
from django.views.generic.base import View
from ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
import mock
import postdoc
# Just a reminder to myself that if I set DATABASE_URL, it will mess up the
# test suite
if 'DATABASE_URL' in os.environ:
exit('Re-run tests in an environment without DATABASE_URL')
class Conne... |
import random
random.seed(8675309)
StartTag = '//=====BEGIN HASH SALT====='
EndTag = '//=====END HASH SALT====='
def NextRand():
s = hex(random.getrandbits(32))[2:-1]
while len(s) < 8:
s = '0' + s
return '0x' + s
def NextTuple():
return '[' + NextRand() + ',' + NextRand() + ',' + NextRand(... |
from __future__ import print_function
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.glyphs import Circle
from bokeh.objects import (
Plot, DataRange1d, LinearAxis, ColumnDataSource, Glyph, PanTool, WheelZoomTool
)
from bokeh.resources import INLI... |
import argparse
import logging
import sys
import json
from typing import TextIO, List, Optional
from master.api_client import MasterApiClient
from common.models.graph import GraphStruct, ExtendedTaskStruct
from plugins.executors.shell import ShellExecutorConfig
SUPPORTED_FORMATS = {
'script', 'makefile', 'raw'
}
... |
import argparse
import logging
import os
import pwd
from multiprocessing import Pool
from arctic.decorators import _get_host
from arctic.store.audit import ArcticTransaction
from .utils import setup_logging
from ..date import DateRange, to_pandas_closed_closed, CLOSED_OPEN, OPEN_CLOSED
from ..hosts import get_arctic_l... |
__author__ = 'Guorong Xu<<EMAIL>>'
import paramiko
from scp import SCPClient
## connecting the master instance of a CFNCluster by the hostname, username and private key file
## return a ssh client
def connect_master(hostname, username, private_key_file):
private_key = paramiko.RSAKey.from_private_key_file(private... |
# -*- coding: utf-8 -*-
"""
5-5-2016 by: Swerty
This is a open source python script to generate the 99 Problems Game as an excel spreadsheet
The end result should be able to (1) generate a spreadsheet of all the problems and
solutions as a printable excel file. It should also be able to (2) add and remove problems
or s... |
from ogitm import gitdb
import pytest
class TestGitDB:
@pytest.fixture
def gdb(self, tmpdir):
return gitdb.GitDB(str(tmpdir))
def test_instantiation(self, tmpdir):
gdb = gitdb.GitDB(str(tmpdir))
assert gdb
def test_insertion(self, gdb):
doc_id = gdb.insert({'one': 't... |
import time, logging
from awsutils.exceptions.aws import UserInputException
from awsutils.sqs.message import SQSMessage
class SQSQueue:
COOLDOWN_BETWEEN_RECEIVEMESSAGES = 1
def __init__(self, qName, sqsclient, loadAttributes=True):
"""
@param qName: the SQS queue name
@type qName: str... |
from PyQt5.QtCore import QAbstractTableModel, Qt
from PyQt5.QtWidgets import (
QDialog,
)
from plover.gui_qt.conversion_failure_dialog_ui import Ui_ConversionFailure
from plover.gui_qt.utils import WindowState
class FailureModel(QAbstractTableModel):
def __init__(self, failures=[()]):
super(QAbstract... |
"""
This module contains collection of classes which implement
collate functionalities for various tasks.
Collaters should know what data to expect for each sample
and they should pack / collate them into batches
"""
from __future__ import absolute_import, division, print_function, unicode_literals
... |
import yaml
import os
from django.db.models import Count
from django.core.management.base import BaseCommand
from django.conf import settings
from ...models import Operator, Region
DIR = os.path.dirname(__file__)
class Command(BaseCommand):
@staticmethod
def maybe_move_operator(operator, regions):
i... |
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
import jsonfield
from . import flatten_nodes, copy_prefetch
from .base import BaseModel
from .data_channels import DataChannel
from .data_nodes import DataNode
from api import get_setting
from api.model... |
import pretend
import pytest
from webob.multidict import MultiDict
from warehouse.utils import paginate
class FakeSuggestion:
def __init__(self, options):
self.options = options
class FakeSuggest:
def __init__(self, name_suggestion):
self.name_suggestion = name_suggestion
class FakeResul... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# The normalizeUnicode() function, inspired by Plone's
from unicodedata import normalize, decomposition, combining
import string
# Hand-made table from PloneTool.py
mapping_custom_1 = {
138: 's', 142: 'z', 154: 's', 158: 'z', 159: 'Y'}
# UnicodeData.txt does not c... |
"""
Chunk the MOS text data into easier to search values.
"""
# stdlib
import re
# 3rd Party
from twisted.internet import reactor
from pyiem.nws import product
# Local
from pywwa import common
from pywwa.ldm import bridge
from pywwa.database import get_database
def real_process(txn, data):
"""Go!"""
prod = ... |
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers_async # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import... |
from __future__ import print_function
import sys
import unittest
import SimpleITK as sitk
import numpy as np
sizeX = 4
sizeY = 5
sizeZ = 3
class TestNumpySimpleITKInterface(unittest.TestCase):
""" This tests numpy array <-> SimpleITK Image conversion. """
def setUp(self):
pass
def _helper_c... |
from msrest.serialization import Model
class Application(Model):
"""Active Directory application information.
:param object_id: The object ID.
:type object_id: str
:param object_type: The object type.
:type object_type: str
:param app_id: The application ID.
:type app_id: str
:param a... |
from modules.localization.proto import localization_pb2
from modules.perception.proto import perception_obstacle_pb2
from modules.perception.proto import traffic_light_detection_pb2
from modules.planning.proto import planning_internal_pb2
from modules.planning.proto import planning_pb2
from modules.prediction.proto imp... |
import logging
import traceback
from yapsy.IPlugin import IPlugin
from activitystreams.models.activity import Activity
from dino import utils
from dino.config import ErrorCodes
from dino.config import ConfigKeys
from dino.config import SessionKeys
from dino.environ import GNEnvironment
logger = logging.getLogger(__na... |
# coding: utf-8
"""
Este processamento gera uma tabulação com contagens, soma, mediana de alguns
elementos do artigo: total de autores, total de citações, total de páginas
"""
import argparse
import logging
import codecs
import datetime
import utils
import choices
logger = logging.getLogger(__name__)
def _config_l... |
"""Django Endless Pagination Angular documentation build configuration file."""
from __future__ import unicode_literals
AUTHOR = 'Francesco Banconi and Martin Peveri'
APP = 'Django Endless Pagination Angular'
TITLE = APP + ' Documentation'
VERSION = '1.0'
# Add any Sphinx extension module names here, as strings. T... |
#!/usr/bin/python
from html.parser import HTMLParser
import urllib.request
import os
import smtplib
import time
# Handy section structure
class Section:
justOpened = False
def __init__(self, newClassName, newClassReason, newClassStatus):
self.className = newClassName
self.classReason = newClas... |
import datetime
from decimal import Decimal
from unittest import mock
from django.test import TestCase, modify_settings, override_settings
from django.urls import reverse
from django.utils import timezone
from django_webtest import WebTest
from mymoney.apps.bankaccounts.factories import BankAccountFactory
from mymon... |
"""
SpaceHub
Copyright (C) 2013 Ryan Brown <<EMAIL>>, Sam Lucidi <<EMAIL>>,
Ross Delinger <<EMAIL>>, Greg Jurman <<EMAIL>>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, eit... |
"""Tests for models supporting Credentials-related functionality."""
from __future__ import absolute_import
from django.test import TestCase, override_settings
from openedx.core.djangoapps.credentials.models import API_VERSION
from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfigMixin
fro... |
# be sure to have run ' python setup.py ' from chimp directory
# # Training DeepMind's Atari DQN with Chimp
# First, we load all the Chimp modules.
from chimp.memories import ReplayMemoryHDF5
from chimp.learners.dqn_learner import DQNLearner
from chimp.learners.chainer_backend import ChainerBackend
from chimp.sim... |
"""
Provide Qtmacs specific exception classes.
It is safe to use::
from exceptions import *
"""
import re
class QtmacsArgumentError(Exception):
"""
A variable has incorrect type (eg. 'int' when a 'str' was
expected).
|Args|
* ``varName`` (**str**): name of variable.
* ``methodName`` (... |
from odoo import api, fields, models, _
from odoo.exceptions import AccessError, UserError
from odoo.tools import float_compare
class MrpUnbuild(models.Model):
_name = "mrp.unbuild"
_description = "Unbuild Order"
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'id desc'
def _get_defaul... |
#Create a movie of the frames
import numpy as np
from utils_simple import TIME, FLUX, QUALITY
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
#Limit ourselves 10-40 for more detail
FLUX = FLUX[:, 15:35, 15:35]
time = TIME - 1860
diffs = np.diff(FLUX, axis=0)
base = "frames/{:0>3d}.png"
bin = ge... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... |
#
# Max Points On A Line
#
# Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
import collections
# Definition for a point
class Point:
def __init__(self, a=0, b=0):
self.x = a
self.y = b
def __repr__(self):
return repr((self.x, self.... |
#!/usr/bin/env python
#
# spearmanCorrelation.py
# Date Created: 1/23/15
# Last Modified: 1/25/15
#
# EG: Invoke the script using: ./spearmanCorrelation.py Classification1 Classification2
from sys import argv
from sys import exit
from scipy import stats
classyFile1 = argv[1]
classyFile2 = argv[2]
lvl = 'Species'
min... |
"A caching proxy for package downloads"
import codecs as _codecs
from distutils.core import setup
import os.path as _os_path
from package_cache import __version__
_this_dir = _os_path.dirname(__file__)
setup(
name='package-cache',
version=__version__,
maintainer='W. Trevor King',
maintainer_email=... |
#!/usr/bin/env python
import datetime
import MySQLdb
import re
import urllib
import time
import datetime
import os
import random
import subprocess
from threading import Timer
from buttons_pyxmpp_bot_stub import BasicBot
from pyxmpp.all import JID,Iq,Presence,Message,StreamError
# required to talk to mythtv
import te... |
#!/usr/bin/python
import logging, re, urllib, csv, sys, gzip
from types import StringType
class KeggParsingError(Exception):
pass
class EntryDictWrapper(dict):
def GetStringField(self, field_name, default_value=None):
if field_name not in self:
if default_value is not None:
... |
#!/usr/bin/env python
"""
midi.py -- MIDI classes and parser in Python
Placed into the public domain in December 2001 by Will Ware
Python MIDI classes: meaningful data structures that represent MIDI events
and other objects. You can read MIDI files to create such objects, or
generate a collection of objects and use t... |
#!/usr/bin/env python
"""ctypeslib contains these packages:
- ``ctypeslib.codegen`` - a code generator
- ``ctypeslib.contrib`` - various contributed modules
- ``ctypeslib.util`` - assorted small helper functions
- ``ctypeslib.test`` - unittests
There is not yet an official release... |
"""
Django settings for prjtmpl project.
Generated by 'django-admin startproject' using Django 1.9.5.
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
#... |
from django.conf import settings
from django.core.files import storage
import django_sites as sites
import os
class FileSystemStorage(storage.FileSystemStorage):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if settings.MEDIA_URL.startswith("/"):
site = sites.... |
# Forked from django.core.management.commands.startapp
import os
from django.core.management.base import copy_helper, CommandError, LabelCommand
from django.utils.importlib import import_module
class Command(LabelCommand):
help = ("Creates a Django app directory structure for the given app name in the current di... |
# -*-*- encoding: utf-8 -*-*-
from __future__ import absolute_import
import sys
import traceback
from celery import shared_task
import logging
from time import time, sleep
import gevent
from gevent import monkey, queue, event, pool, Timeout
from django.db.models import get_app, get_models
from django.conf import settin... |
'''
Created on Feb 6, 2017
@author: julien
'''
from copy import deepcopy
import json
import logging
from os import path, makedirs
from os.path import join
import pickle
from minos.experiment.training import AccuracyDecreaseStoppingCondition
from minos.model.parameter import Parameter, str_param_name, expand_param_pat... |
########################################################
# run_rt.py: response-time prediction
# Last updated: 2016/04/26
# Approaches: UPCC, IPCC, UIPCC [Zheng et al., TSC'11]
########################################################
import __init__
import os, sys, time
import numpy as np
from com... |
"""Elasticsearch aggregations."""
from __future__ import unicode_literals
# TODO: Port to new aggregation framework.
# Max number of search hits to chart
# TODO: Move to config
MAX_RESULT_LIMIT = 300000
def heatmap(es_client, sketch_id, query_string, query_filter, query_dsl,
indices):
"""Aggregate ... |
<<<<<<< HEAD
<<<<<<< HEAD
"""Test the errno module
Roger E. Masse
"""
import errno
from test import support
import unittest
std_c_errors = frozenset(['EDOM', 'ERANGE'])
class ErrnoAttributeTests(unittest.TestCase):
def test_for_improper_attributes(self):
# No unexpected attributes should be on the mo... |
# -*- 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):
# Changing field 'Source.reference'
db.alter_column('payment_source', 'reference', self.gf('django.db.model... |
"""Handle the auth of a connection."""
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant.const import __version__
from homeassistant.components.http.auth import validate_password
from homeassistant.components.http.ban import process_wrong_login, \
process_success_login
fro... |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
from datetime import datetime, timedelta
from django.template import Template, Context
from django.template.loader import render_to_string
from domain.models import Domain
from hq.models import *
from receiver.models import Submission, Attachment
from reports.custom.all.domain_summary import DomainSummary
from x... |
if __name__ == '__main__':
from sys import argv, maxint
from it.unimi.dsi.webgraph import ImmutableGraph
from it.unimi.dsi.logging import ProgressLogger
graph = ImmutableGraph.load( argv[ 1 ] )
queue = []
dist = [ maxint for i in range( graph.numNodes() ) ]
ecc = 0
lo = 0
hi = graph.numNodes()
pl =... |
# creates: fcc100.png fcc110.png bcc100.png fcc111.png bcc110.png bcc111.png hcp0001.png fcc111o.png bcc110o.png bcc111o.png hcp0001o.png ontop-site.png hollow-site.png fcc-site.png hcp-site.png bridge-site.png
import os
from ase import Atoms
from ase.io import write
from ase.lattice.surface import (fcc100, fcc110, bc... |
from PySide.QtGui import QWidget
from PySide.QtGui import QPainter
from PySide.QtGui import QPixmap
from PySide.QtGui import QBrush
from PySide.QtCore import Qt
class PaintArea(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.pixReady = False
def setPixmapReady(self, ready):
sel... |
# -*- coding: utf-8 -*-
# File: __init__.py
# https://github.com/celery/kombu/blob/7d13f9b95d0b50c94393b962e6def928511bfda6/kombu/__init__.py#L34-L36
STATICA_HACK = True
globals()['kcah_acitats'[::-1].upper()] = False
if STATICA_HACK:
from .model_desc import *
from .training import *
from .distributed im... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... |
from __future__ import unicode_literals
from django.contrib.auth.models import User , Group
from django.db import models
from django.forms import ModelForm
from django_jalali.db import models as jmodels
import datetime
import jdatetime
import uuid
def CreateToken():
newToken = str(uuid.uuid4())[:23].replace('-',''... |
from datetime import datetime
from django.conf import settings
from django.db import models
from aesfield.field import AESField
from solitude.base import Model
from .field import HashField
class Buyer(Model):
uuid = models.CharField(max_length=255, db_index=True, unique=True)
pin = HashField(blank=True, nu... |
from baselines.common.input import observation_input
from baselines.common.tf_util import adjust_shape
# ================================================================
# Placeholders
# ================================================================
class TfInput(object):
def __init__(self, name="(unnamed)"):
... |
from .models import Place, Location, Activity
from django.core import serializers
from django.http import HttpResponse
from collections import Counter
from json import dumps
# Create your views here.
def get_locations(request):
location = request.GET.get('id')
locations = Location.objects.filter(activites_id=... |
import tensorflow as tf
from config import parse_args, FLAGS
from tfsolver import TFSolver
from network_factory import seg_network
from dataset import DatasetFactory
from ocnn import loss_functions_seg, build_solver, get_seg_label
from libs import points_property, octree_property, octree_decode_key
# Add config
FLAGS... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
BENEFITS = [
{
'name': 'Web logo',
'field_name': 'web_logo_benefit',
'column_title': 'Web logo',
}, {
'name': 'Print logo',
'field_name': 'pri... |
from msrest.serialization import Model
class VaultSecretGroup(Model):
"""Describes a set of certificates which are all in the same Key Vault.
:param source_vault: The relative URL of the Key Vault containing all of
the certificates in VaultCertificates.
:type source_vault:
~azure.mgmt.compute.v... |
#! /usr/bin/env python
#
# Display all records with specified citekey(s).
#
# Cite key can come from command line switches or from a .aux file. Useful if you
# want to make a reduced .bib file to match a paper, without all the other junk.
import Bibliography
import BibEntry
import BibTeX
import string
import sys
impo... |
# -*- 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):
# Deleting field 'ArtistMedia.is_default_image'
db.delete_column(u'artist_artistmedia', 'is_default_image')
... |
from packagestatus import get_packageoverview
from statusweb import _get_packageoverview, db, Package
from statusweb import Tag
from dbtest import equalbs
from datetime import datetime
import random
import logging
import time
import sys
def testcoherence(pkgs=None):
ch = None
if not pkgs:
package... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import blanc_basic_podcast.validators
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='PodcastF... |
import pytest
from django.core.mail import EmailMultiAlternatives
from postmarker.django import PostmarkEmailMixin
pytestmark = pytest.mark.usefixtures("outbox")
class TaggedEmail(PostmarkEmailMixin, EmailMultiAlternatives):
pass
def test_tags(postmark_request):
TaggedEmail(
"Subject",
"Bo... |
import pyrite
from pyrite.utils.help import HelpError
options = [
('a', 'all', _('push all heads'), 0),
('t', 'all-tags', _('push all tags'), 0),
('f', 'force', _('allows remote brach to be overwritten'), 0),
('v', 'verbose', _('show extra output'), 0)
]
help_str =_("""
pyt push [-a] [-t] [-f] [-v] [targetrepo] [local... |
import argparse
import os
import logging
import importlib
from collections import defaultdict
import matplotlib.pyplot as plt
import numpy
import seaborn as sns
import sympy
from utilities import learning_data, lib
from gp.experiments import symbreg
from ndvi import gp_processing_tools
parser = argparse.ArgumentPar... |
"""The migration module."""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
"""A migration class."""
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_M... |
# -*- encoding: utf-8 -*-
# coding: latin1
# General HTML
from django.shortcuts import render_to_response, redirect, get_object_or_404, render
from django.http import HttpResponse, HttpResponseRedirect
# Manejo de Informacion de esta aplicacion
from django.utils.timezone import utc
from datetime import datetime, date... |
import unittest
import parser
from test_util import TestDecoder
class ParserTest(unittest.TestCase):
def _assert_text_token(self, token, expected_text):
self.assertEqual(parser.Token.TEXT, token.type)
self.assertEqual(expected_text, token.value)
def _assert_url_token(self, token, expected_url):
self... |
# -*- coding: utf-8 -*-
"""
pint.context
~~~~~~~~~~~~
Functions and classes related to context definitions and application.
:copyright: 2016 by Pint Authors, see AUTHORS for more details..
:license: BSD, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_fu... |
"""
Test Program Creator role
"""
from integration.ggrc import TestCase
from ggrc.models import get_model
from ggrc.models import all_models
from integration.ggrc.api_helper import Api
from integration.ggrc.generator import Generator
from integration.ggrc.generator import ObjectGenerator
from integration.ggrc.models i... |
import datetime
import re
import time
import urllib
from xml.dom.minidom import parseString
import sickbeard
import generic
from sickbeard import classes, show_name_helpers, helpers
from sickbeard import exceptions, logger
from sickbeard import tvcache
from sickbeard.exceptions import ex
class NZBsProvider(generic... |
__author__ = "Felix Brezo, Yaiza Rubio <<EMAIL>>"
__version__ = "2.0"
from osrframework.utils.platforms import Platform
class Typepad(Platform):
"""A <Platform> object for Typepad"""
def __init__(self):
self.platformName = "Typepad"
self.tags = ["education"]
#######################... |
#!/usr/bin/env python
from distutils.core import setup, Command
import setuptools
import sys
if (float(sys.version[:3]) < 2.5):
print('Require python 2.5 or later')
sys.exit(-1)
setup(name='Legume',
version='0.5',
description='Reliable UDP library',
author='Dale Reidy',
url='http://c... |
from bs4 import BeautifulSoup
import re
from datetime import date
def process(source_cd, base_url, data):
try:
record= []
movie_coll = data.find_all('div', {'class' : 'itemListing'})
if movie_coll != None:
for movie in movie_coll:
row = {}
if mo... |
from a10sdk.common.A10BaseClass import A10BaseClass
class CostCfg(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param cost: {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}
:param instance_id: {"description": ... |
######################
# CARTRIDGE SETTINGS #
######################
# The following settings are already defined in cartridge.shop.defaults
# with default values, but are common enough to be put here, commented
# out, for convenient overriding.
# Sequence of available credit card types for payment.
# SHOP_CARD_TYPES... |
"""Timing of stacked auto-encoders."""
import time
import tensorflow as tf
import numpy as np
parameters = []
affine_counter = 1
class Config(object):
"""params"""
image_width = 28
ydim = 10 # number of classes
batch_size = 64
num_timing_iters = 200
num_warmup_iters = 200
CPU_only = Fal... |
"""
Created on 13 Jul 2016
@author: Bruno Beloff (<EMAIL>)
"""
import optparse
# --------------------------------------------------------------------------------------------------------------------
class CmdSocketSender(object):
"""unix command line handler"""
def __init__(self):
"""
Const... |
from __future__ import unicode_literals, print_function
from six.moves import input
import frappe, os, re
from frappe.utils import touch_file, encode, cstr
def make_boilerplate(dest, app_name):
if not os.path.exists(dest):
print("Destination directory does not exist")
return
# app_name should be in snake_case... |
import json
import os
from flask import Flask, request, Response, jsonify, render_template
from datetime import datetime
# Import the database
import db
# Import API functions
import api
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST', 'PUT'])
def home():
# Handle GET
if request.method == 'GET'... |
import argparse
from os import path
import glob
# from Bio.Phylo.PAML import codeml
# Model A (alternative): model = 2, NSsites = 2, fix_omega = 0
# Model A1 (null): model = 2, NSsites = 2, fix_omega = 1, omega = 1
from Bio import AlignIO
from Bio import SeqIO
# from Bio.PAML import codeml
import ete2
import util... |
from ConfigParser import ConfigParser
import os
import platform
import posixpath
import shutil
import subprocess
import sys
import tempfile
import traceback
class B2GInstance(object):
@classmethod
def check_b2g_dir(cls, dir):
if os.path.isfile(os.path.join(dir, 'load-config.sh')):
return di... |
import remoto
import json
import ceph_medic
from ceph_medic import terminal
def get_mon_report(conn):
command = [
'ceph',
'--cluster=%s' % ceph_medic.metadata['cluster_name'],
'report'
]
out, err, code = remoto.process.check(
conn,
command
)
if code > 0:
... |
"""Helper for aiohttp webclient stuff."""
import sys
import asyncio
import aiohttp
from aiohttp.hdrs import USER_AGENT
from homeassistant.core import callback
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.const import __version__
DATA_CONNECTOR = 'aiohttp_connector'
DATA_CONNECTOR_NOTVER... |
from Classification import classification_by_name
from Node import error
from kinds import lowercase_first_word
class Token(object):
"""
Represents the specification for a Token in the TokenSyntax file.
"""
def __init__(self, name, kind, serialization_code, unprefixed_kind=None,
tex... |
#!/usr/bin/python
# #########################################################
# Unit Test: Test System Queue
# Purpose: Tests whether the system queue works
# #########################################################
import unittest
import main
import config
import threading
import time
# Extra stuff for mqtt
impor... |
"""Allow lazy loading of `cylc.flow.cfgspec.globalcfg`."""
def glbl_cfg(cached=True):
"""Load and return the global configuration singleton instance."""
from cylc.flow.cfgspec.globalcfg import GlobalConfig
return GlobalConfig.get_inst(cached=cached) |
"""
This Bot uses the Updater class to handle the bot.
First, a few callback functions are defined. Then, those functions are passed to
the Dispatcher and registered at their respective places.
Then, the bot is started and runs until we press Ctrl-C on the command line.
Usage:
Example of a bot-user conversation using C... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.