text stringlengths 12 6.59M |
|---|
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import tempfile
import shutil
from nipype.testing import (assert_equal, assert_not_equal, assert_raises,
with_setup, TraitError, parametric, skipif)
from nipype.utils... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... |
# Make sure to set configuration, needs to be before any galpy imports
from galpy.util import config
config.__config__.set('astropy','astropy-units','True')
import numpy
from astropy import units
def test_orbit_setup_radec_basic():
from galpy.orbit import Orbit
o= Orbit([10.*units.deg,-20.*units.deg,3.*units.k... |
from __future__ import absolute_import
import copy
import datetime
import pytest
import numpy as np
from astropy.units.quantity import Quantity
from astropy.tests.helper import assert_quantity_allclose
from numpy.testing import assert_array_equal, assert_almost_equal
from pandas.util.testing import assert_frame_equal... |
#!/usr/bin/env python
'''
Launches copyit.py for subfolders that have md5 anifests.
'''
import sys
import os
import subprocess
import argparse
import time
from ififuncs import make_desktop_logs_dir
def analyze_log(logfile):
'''
Analyzes logfiles on the desktop and summarises the outcome.
'''
outcome =... |
# Copyright 2016 Raytheon BBN Technologies
#
# 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
__all__ = ['Agilent33220A', 'Agilent33500B', 'Agi... |
class BinMethod:
quantiles = 'quantiles'
jenks = 'jenks'
headtails = 'headtails'
equal = 'equal'
category = 'category'
def get_scheme_cartocss(column, scheme_info):
"""Get TurboCartoCSS based on input parameters"""
if 'colors' in scheme_info:
color_scheme = '({})'.format(','.join(s... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
"""
SlipStream Client
=====
Copyright (C) 2014 SixSq Sarl (sixsq.com)
=====
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 __future__ import absolute_import
from sunpy.time import TimeRange
from sunpy.instr import lyra
import tempfile
import os
import pytest
import datetime
@pytest.mark.online
def test_lytaf_utils():
'''test the downloading of the LYTAF file and subsequent queries'''
tmp_dir=tempfile.mkdtemp()
lyra.downl... |
#!/usr/bin/env python
# encoding: utf-8
"""A python bulk editor class to apply the same code to many files."""
# Copyright (c) 2012-19 Jérôme Lecomte
#
# 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 th... |
from os import environ
import sys
from six.moves import input #pylint: disable=redefined-builtin
from azure.storage.blob import PublicAccess
from azure.mgmt.storage import StorageManagementClient, StorageManagementClientConfiguration
from azure.mgmt.storage.models import AccountType
from azure.mgmt.storage.operations... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Export Layers.
#
# Copyright (C) 2013-2016 khalim19 <khalim19@gmail.com>
#
# Export Layers 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... |
import os.path
from tests.BaseTestClasses import NormalizeFilenameTestCase
class TestSubprocessArguments(NormalizeFilenameTestCase):
def setUp(self):
super(TestSubprocessArguments, self).setUp()
def test_no_basicdateprefix(self):
(rc, output, error) = self.invokeAsSubprocess([], extraParams=... |
'''
This module was created to get information available in the interpreter, such as libraries,
paths, etc.
what is what:
sys.builtin_module_names: contains the builtin modules embeeded in python (rigth now, we specify all manually).
sys.prefix: A string giving the site-specific directory prefix where the platform ind... |
# -*- coding: utf-8 -*-
from hashlib import sha1 as SHA
from django.db import models
from datetime import datetime
from django.utils import timezone
from django.core.urlresolvers import reverse
from client.conf.settings import DATETIME_FORMAT, settings
from django.utils.html import format_html
from clien... |
#!/usr/bin/env python
"""Packular reads lists of required JavaScript, CSS, and partial HTML files,
and downloads/combines/references them in index.html files for use in
development and production.
"""
from ConfigParser import ConfigParser, NoOptionError
from argparse import ArgumentParser
from pprint import pformat
f... |
# backend.py
# openeventdatabase
from datetime import datetime
import json
import os
import re
import subprocess
import falcon
import psycopg2
import psycopg2.extras
import geojson
from shapely.geometry import shape
def db_connect():
return psycopg2.connect(
dbname=os.getenv("DB_NAME", "oedb"),
h... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake 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 Lice... |
#!/usr/bin/env python
#
# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os.path
import shutil
import sys
import bot
import bot_utils
utils = bot_... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
from importlib import import_module
from functools import wraps
__all__ = ['InvalidResponseError', 'get_backend', 'proxy']
class InvalidResponseError(Exception):
pass
def get_backend(name):
module = "%s.%s" % (__package__, str(name).lower())
try:
module = import_module(module)
except KeyEr... |
# Copyright 2014 Red Hat, Inc
#
# 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 in writing, s... |
__version_info__ = {
'major': 0,
'minor': 7,
'micro': 0,
'releaselevel': 'final',
'serial': 1
}
def get_version():
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_info__['micro']:
vers.append(".%(micro)i" % __version_info__)
if __version_info__['releaselevel'] ... |
import re
from collections import OrderedDict
from importlib import import_module
from django.conf import settings
from django.contrib.admindocs.views import simplify_regex
from django.core.exceptions import PermissionDenied
from django.db import models
from django.http import Http404
from django.utils import six
from... |
#!/usr/bin/env python3
"""
backend.py - ffmap-backend runner
https://github.com/ffnord/ffmap-backend
"""
import argparse
import json
import os
import sys
from datetime import datetime
import networkx as nx
from networkx.readwrite import json_graph
from lib import graph, nodes
from lib.alfred import Alfred
from lib.ba... |
from __future__ import division
import numpy as np
from pyquil.gates import X, H, CPHASE
import pyquil.quil as pq
from grove.qft.fourier import qft, inverse_qft
def real_to_binary(number, precision=16):
""" Convert real number into a binary fraction
:param float number: Number to convert.
:param int preci... |
#!/usr/bin/python -u
#
# pagekite.py, Copyright 2010, 2011, the Beanstalks Project ehf.
# and Bjarni Runar Einarsson
#
# 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 Softwa... |
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuake is distributed in the hope that it will be useful,
# but WITHOUT AN... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake 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 Lice... |
#!/usr/bin/env python3
#
# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import os.path
import shutil
import sys
import subprocess
import bot_u... |
# -*- coding: utf-8 -*-
"""
Fake Weboob module with capability CapBank.
"""
from __future__ import unicode_literals
import datetime
import random
import time
from decimal import Decimal
from weboob.core.ouiboube import WebNip
from weboob.capabilities.bank import Currency
from weboob.capabilities.bank import CapBank, ... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from six.moves.urllib.parse import urlparse
from six.moves.urllib.parse import unquote
import datetime
import json
import os
import sys
import time
import six
try:
from collections import OrderedDict
except Impo... |
# Copyright 2014 Red Hat, Inc
#
# 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 in writing, s... |
from collections import OrderedDict
from importlib import import_module
import re
from django.conf import settings
from django.contrib.admindocs.views import simplify_regex
from django.core.exceptions import PermissionDenied
from django.db import models
from django.http import Http404
from django.utils import six
from... |
import os
import datetime
import logging
import calendar
import json
from functools import wraps
logging.getLogger().setLevel(logging.DEBUG)
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
from google.appengine.api import urlfetch
import auth_util
from l... |
import sys
import webbrowser
import pytest
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from PyQt5 import QtTest
from PyQt5 import QtCore
from unittest.mock import MagicMock
# Local
import sas.qtgui.Utilities.GuiUtils as GuiUtils
from sas.qtgui.Perspectives.Fitting.Constraint import Constraint
from sas.qtgui.... |
# -*- coding: utf-8 -*-
from datetime import datetime
import magento
import xmlrpclib
import socket
from trytond.pool import PoolMeta, Pool
from trytond.transaction import Transaction
from trytond.pyson import Eval
from trytond.model import ModelView, ModelSQL, fields
from .api import OrderConfig
__metaclass__ = Pool... |
import factory
from django.contrib.auth import get_user_model
BB_USER_MODEL = get_user_model()
class BlueBottleUserFactory(factory.DjangoModelFactory):
FACTORY_FOR = BB_USER_MODEL
username = factory.Sequence(lambda n: u'user_{0}'.format(n))
email = factory.Sequence(lambda o: u'user_{0}@onepercentclub.c... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from psycopg2 import sql, extras
from datetime import datetime, timedelta, date
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, tools, SUPERUSER_ID
from odoo.tools.t... |
#!/usr/bin/python -u
#
# pagekite.py, Copyright 2010, 2011, the Beanstalks Project ehf.
# and Bjarni Runar Einarsson
#
# 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 Softwa... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... |
#!/usr/bin/python
from lxml import etree
from StringIO import StringIO
from sfa.util.xrn import *
from sfa.rspecs.sfa_rspec import SfaRSpec
from sfa.rspecs.pg_rspec import PGRSpec
class SfaRSpecConverter:
@staticmethod
def to_pg_rspec(rspec):
if isinstance(rspec, SfaRSpec):
sfa_rspec = rs... |
#!/usr/bin/env python
#
# "Sophisticated DMRG," originally based on the simple-dmrg tutorial.
#
# Copyright 2013 James R. Garrison and Ryan V. Mishmash.
# Open source under the MIT license. Source code at
# <https://github.com/simple-dmrg/sophisticated-dmrg/>
# This code will run under any version of Python >= 2.6. ... |
__version__ = '1.0.1'
try:
from .halnav import Navigator # NOQA
except ImportError:
# for setup.py and docs
pass
|
import os
from flask import Flask
from flask import request, render_template, make_response, jsonify
from flask.ext import restful
from flask.ext.pymongo import PyMongo
from bson.json_util import dumps
from bson.objectid import ObjectId
from flask.ext.restful import reqparse
## Patch for Flask-Restful
## http://blog... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import copy
import httplib
import re
import socket
import time
from subprocess import Popen as execute
from extra.beep.beep import beep
from lib.core.agent import agent
from... |
import ctypes
from numpy import array, dot, zeros_like, mean, apply_along_axis, column_stack
import numpy
c_cross = ctypes.cdll.LoadLibrary('./lib_cross.so')
ERROR_TEXT = {
'VERTICES_SIZE': "Size of vertices array should be a multiple of three, "
"but {} provided",
'TRIANGLES_SHAPE': "Ne... |
'''create charts showing results of valgbr.py
INVOCATION
python chart06.py [--data] [--test]
where
VALAVM in {roy, anil}
INPUT FILES
WORKING/chart01/data.pickle
WORKING/samples-train.csv
WORKING/valavm/YYYYMM.pickle
WORKING/data.pickle or WORKING/data-test.pickle
INPUT AND OUTPUT FILES (build with --data)
W... |
from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
super, zip)
from ..._utils import send_session_request
from .._PortalEndpointBase import Porta... |
import argparse
import json
import time
import socket
import os
import yaml
import redis
def main():
parser = argparse.ArgumentParser(description='Process memcached commands from a channel')
parser.add_argument('--config-file', required=True, help='YAML configuration file')
args = parser.parse_args()
# Load the ... |
import logging, time, os, sys
import utils_c4
import config_c4 as config
from c4 import fileMetadata, dummy, main
from xceptions import *
from file_utils import installedSupportedNetcdf
#### set up log file ####
tstring2 = '%4.4i%2.2i%2.2i' % time.gmtime()[0:3]
testLogFile = '%s__qclog_%s.txt' % ('unitTestsS2',tstrin... |
import numpy as np
import copy
from climlab import constants as const
from climlab.process.process import Process
from climlab.utils.walk import walk_processes
class TimeDependentProcess(Process):
'''A generic parent class for all time-dependent processes.'''
def __init__(self, time_type='explicit', timestep=... |
# -*- coding: utf-8 -*-
import logging
import os
import sys
from itertools import izip
from time import time
from unittest import TestCase
from networkapiclient.ClientFactory import ClientFactory
log = logging.getLogger()
log.level = logging.DEBUG
stream_handler = logging.StreamHandler(sys.stdout)
log.addHandler(str... |
from __future__ import with_statement
import sys
if __name__ == '__main__':
sys.path.insert(0, '..')
sys.path.insert(0, '../..')
from hamcrest.library.text.stringcontains import contains_string
from hamcrest_unit_test.matcher_test import *
import unittest
import pytest
__author__ = "Jon Reid"
__copyright__ =... |
"""
Tests for django-watson.
Fun fact: The MySQL full text search engine does not support indexing of words
that are 3 letters or fewer. Thus, the standard metasyntactic variables in
these tests have been amended to 'fooo' and 'baar'. Ho hum.
"""
from unittest import skipIf, skipUnless
from django.db import models
f... |
#!/usr/bin/python -u
#
# pagekite.py, Copyright 2010, the Beanstalks Project ehf.
# and Bjarni Runar Einarsson
#
# 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 Found... |
__author__ = 'OpenSlides Team <support@openslides.org>'
__description__ = 'Presentation and assembly system'
__version__ = '2.1-dev'
|
"""
Richtemplates is a set of templates (surprise!),
template tags, media files providing presentation
layer for Django based projects, similar to what
Richfaces library offers for J2EE developers - not
outstanding but still nice looking and elegant.
"""
__version__ = '0.1.9.beta'
def get_version():
return __vers... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import copy
import httplib
import re
import socket
import time
from subprocess import Popen as execute
from extra.beep.beep import beep
from lib.core.agent import agent
from... |
from __future__ import print_function
from collections import namedtuple, defaultdict
import copy
from types import MethodType
import numpy
from llvmlite import ir as llvmir
import llvmlite.llvmpy.core as lc
from llvmlite.llvmpy.core import Type, Constant
import numba
from numba import types, utils, cgutils, typing,... |
#!/usr/bin/python3
import oursql
import www.secrets
import utils
import queue
import threading
import json
import re
import time
import irc.client
from jinja2.utils import Markup, escape, urlize
from config import config
__all__ = ["log_chat", "clear_chat_log", "exitthread"]
CACHE_EXPIRY = 7*24*60*60
PURGE_PERIOD = 1... |
# -*- coding: utf-8 -*-
from django.db import models
from django.core.exceptions import ValidationError
from choices_functional_trait import *
from choices_models import *
from choices_taxonomy import *
from django.core.exceptions import ObjectDoesNotExist
class reference(models.Model):
authorshortstring = models.... |
# Copyright 2015 Cedric RICARD
#
# This file is part of CloudMailing.
#
# CloudMailing 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 ve... |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 in wr... |
# -*- coding: utf-8 -*-
from collections import defaultdict
from flask import render_template, json, jsonify, request, Response
from coaster.views import load_model, load_models, requestargs, jsonp
from baseframe import _
from .helpers import localize_micro_timestamp, localize_date
from .. import app, lastuser
from ..... |
# -*- coding: utf-8 -*-
import os
from flask import Flask
application = Flask(__name__)
route = application.route
application.debug = True
@route('/qps/caiyun-backend-wrapper-new')
def index():
cmd = "source $HOME/.bashrc; cd $HOME/caiyun-backend-wrapper-new; source $HOME/bin/develop; $PRJ_HOME/bin/pref-test"
... |
from __future__ import print_function
import sys
import os
from ConfigParser import SafeConfigParser
# The following section determines which configuration file to load.
# It also deduces whether we are in a live environment (is_production,
# which forces DEBUG to False), or in a development environment (al-
# lowin... |
import click
from subprocess32 import call
from aeriscloud.ansible import ACHost
from aeriscloud.cli.helpers import Command, fatal
from aeriscloud.cli.cloud import summary
from aeriscloud.log import get_logger
from aeriscloud.utils import quote
logger = get_logger('cloud.rsync')
def _update_rsync_uri(inventory, ur... |
from tests.pykafka import test_simpleconsumer
from pykafka.rdkafka import RdKafkaSimpleConsumer
class TestRdKafkaSimpleConsumer(test_simpleconsumer.TestSimpleConsumer):
def _get_simple_consumer(self, **kwargs):
# This enables automatic reuse of all tests from test_simpleconsumer
topic = self.clien... |
# Derived class; makes a private race room
import discord
from necrobot.util import server
from necrobot.botbase.necrobot import Necrobot
from necrobot.race.privaterace import permissioninfo, cmd_privaterace
from necrobot.race.publicrace.raceroom import RaceRoom
from necrobot.race.raceutil import get_raceroom_name
fr... |
#The DF of a tidal stream
import numpy
import multiprocessing
from scipy import special, interpolate
from galpy.orbit import Orbit
from galpy.util import bovy_coords, fast_cholesky_invert, \
bovy_conversion, multi
_INTERPDURINGSETUP= True
_USEINTERP= True
class streamdf:
"""The DF of a tidal stream"""
def _... |
from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import NoArgsCommand, BaseCommand
from django.core.management import call_command
from herokuapp.management.commands.base import HerokuCommandMixin
class Command(HerokuCommandMixin, NoArgsCommand):
hel... |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from mptt.models import MPTTModel, TreeForeignKey
from opps.core.models import Publishable
from opps.channel.utils import generate_long_sl... |
#The DF of a tidal stream
import numpy
from galpy.orbit import Orbit
from galpy.util import bovy_coords, stable_cholesky
class streamdf:
"""The DF of a tidal stream"""
def __init__(self,sigv,progenitor=None,pot=None,aA=None,
deltaAngle=0.3):
"""
NAME:
__init__
... |
"""
Oracle 2.0 IRC Bot
help.py plugin module
http://toofifty.me/oracle
"""
import types, inspect
import traceback
import math
import time
from format import WHITE, CYAN, GREY, PURPLE
def _init(bot):
print '\t%s loaded' % __name__
# All commands are called with the arguments
# <module>.<command>(plugins.Loader(... |
import asyncio
import contextlib
import weakref
import aiopg
import peewee
import tasklocals
@contextlib.contextmanager
def patch(obj, attr, value, default=None):
original = getattr(obj, attr, default)
setattr(obj, attr, value)
yield
setattr(obj, attr, original)
class TaskConnectionLocal(peewee._Ba... |
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPFound
from pyramid.url import route_path
from pyramid.response import Response
from ..models import (
DBSession,
Project,
Area,
PriorityArea,
User,
Task,
TaskState,
TaskLock,
License,
)
from pyramid.security ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
################################################################################
#
# Copyright 2015-2017 Félix Brezo and Yaiza Rubio (i3visio, contacto@i3visio.com)
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the te... |
#!/usr/bin/python
from pyroute2.netlink.iproute import *
from pyroute2 import IPRoute
from pyroute2 import IPDB
import dns
from qmf.console import Session
import subprocess
import netaddr
import select
import sys
import dns.resolver
import os
import re
import radvd
import routerlink
import datapath
import time
import ... |
"""Support for Buienradar.nl weather service."""
import logging
from buienradar.constants import (
CONDCODE,
CONDITION,
DATETIME,
MAX_TEMP,
MIN_TEMP,
RAIN,
WINDAZIMUTH,
WINDSPEED,
)
import voluptuous as vol
from homeassistant.components.weather import (
ATTR_CONDITION_CLOUDY,
A... |
"""Alexa configuration for Home Assistant Cloud."""
import asyncio
from contextlib import suppress
from datetime import timedelta
from http import HTTPStatus
import logging
import aiohttp
import async_timeout
from hass_nabucasa import Cloud, cloud_api
from homeassistant.components import persistent_notification
from ... |
"""
homeassistant.components.light.limitlessled
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for LimitlessLED bulbs, also known as...
EasyBulb
AppLight
AppLamp
MiLight
LEDme
dekolight
iLight
light:
platform: limitlessled
host: 192.168.1.10
group_1_name: Living Room
group_2_name: Bedroom
group_3_name: Office... |
"""
Vizio SmartCast TV support.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.vizio/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant import util
from homeassistant.components.media_player impo... |
"""Webhook handlers for mobile_app."""
import asyncio
from contextlib import suppress
from functools import wraps
from http import HTTPStatus
import logging
import secrets
from aiohttp.web import HTTPBadRequest, Request, Response, json_response
from nacl.exceptions import CryptoError
from nacl.secret import SecretBox
... |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
# cap_support.py -- python support objects for CAPCollector (post_cap.py)
# version 0.9.2 - 2 December 2013
#
# Copyright (c) 2013, Carnegie Mellon University
# All rights reserved.
#
# See LICENSE.txt for license terms (Modified BSD)
#
# REQUIRES PYTHON MODULES pytz, iso8601, lxml, pyxmlsecuri... |
#!/mesonet/python/bin/python
import mx.DateTime
from pyIEM import iemAccess, iemdb
i = iemdb.iemdb()
climatedb = i["coop"]
ADJUSTMENT = 0
s = mx.DateTime.DateTime(2005,9,19)
e = mx.DateTime.DateTime(2005,10,18)
interval = mx.DateTime.RelativeDateTime(days=+1)
def averageTemp(db, hi="high", lo="low"):
highSum, lowS... |
from math import floor
from random import random, randint, seed, shuffle
from cgi import FieldStorage
from PIL import Image
from mad import MadFile
from datetime import datetime
from whoosh import index
from whoosh.fields import Schema, ID, TEXT
from whoosh.qparser import QueryParser
import os
from sys import stdin
imp... |
"""
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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 a... |
#
# Copyright (c) 2015, Open-RnD Sp. z o.o. All rights reserved.
#
from __future__ import absolute_import
import tornado.web
import tornado.template
import logging
import os.path
_log = logging.getLogger(__name__)
class SettingsHandler(tornado.web.RequestHandler):
def get(self):
_log.debug("SettingsHan... |
__all__ = ['record', 'recarray','format_parser']
import numeric as sb
from defchararray import chararray
import numerictypes as nt
import sys
import types
import stat, os
import _internal
_byteorderconv = {'b':'>',
'l':'<',
'n':'=',
'B':'>',
'L':... |
# is it a good idea to put it on a top-level here?.. maybe some singleton would be nicer or something...
from cffi import FFI
ffi = FFI()
ffi.cdef('''
//typedef ... Treal; // damn, stuff like this doesn't work with cffi yet... structs are fine, but not the basic types :(
// so, we stick to 'double' here:
void cffti(i... |
#*- encoding: utf-8 -*
import os
import re
pat = '<h1 class="title" id="page-title">(.*)</h1>'
meta = '''<dc:title>%s</dc:title>\n\
<dc:language>en-US</dc:language>\n\
<dc:creator opf:file-as="NYPL" opf:role="aut">NYPL</dc:creator>\n\
<dc:publisher>NYPL</dc:publisher>\n\
<dc:date opf:event="publication">2015-01-15</... |
# -*- coding: iso-8859-1 -*-
#
# Copyright (C) 2006-2011, Herbert Valerio Riedel <hvr@gnu.org>
#
# See COPYING for distribution information
from __future__ import with_statement
import os, re, sys, time, weakref
from collections import deque
from functools import partial
from threading import Lock
from subprocess imp... |
# -*- coding: utf-8 -*-
from lettuce import *
from splinter import Browser
from lettuce.django import django_url
@before.each_scenario
def open_browser(step):
world.browser = Browser()
@after.each_scenario
def close_browser(step):
world.browser.quit()
def visit(url):
world.browser.visit(django_url(url))
@... |
#!/usr/bin/env python
# vim: set sw=2 ts=2 softtabstop=2 expandtab:
import argparse
import os
import logging
import sys
import yaml
from br_util import FinalResultType, classifyResult, validateMappingFile, ValidateMappingFileException
try:
# Try to use libyaml which is faster
from yaml import CLoader as Loader, CD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.