text stringlengths 12 6.59M |
|---|
# -*- coding: utf-8 -*-
"""
Updates the WikiProject Directory
Copyright (C) 2015 Betacommand, James Hare
Licensed under MIT License: http://mitlicense.org
"""
import re
import time
import pywikibot
import json
from collections import Counter
from project_index import WikiProjectTools
def main():
# Initializing.... |
# -*- coding: utf-8 -*-
# Copyright 2019 Extreme Networks, 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 appli... |
# 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, software
# distributed under t... |
# coding=utf-8
# Copyright 2015 Trung Ngo Trong
# 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 t... |
#!/usr/bin/python
import json
from flask import jsonify
import requests
import flask
app = flask.Flask(__name__)
#app.config['DEBUG'] = True
@app.route("/")
###############################################################################
def hello():
return "Webhooks Options:\n \n\\yo \n\\github"
##################... |
# Copyright (c) 2002-2016 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# 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
... |
# ==============================================================================
# Copyright [2013] [Kevin Carter]
#
# 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/l... |
import os.path
import logging
import socket
from base64 import b64encode
from urllib3 import PoolManager, proxy_from_url
from urllib3.exceptions import NewConnectionError
from botocore.vendored import six
from botocore.vendored.six.moves.urllib_parse import unquote
from botocore.awsrequest import AWSResponse
from bot... |
import random
import functools
import logging
from binascii import crc32
from botocore.exceptions import ChecksumError
log = logging.getLogger(__name__)
def delay_exponential(base, growth_factor, attempts):
"""Calculate time to sleep based on exponential function.
The format is::
base * growth_fa... |
from pathlib import Path
from os.path import isfile
class ERRORBOT:
def __init__(self, bot):
self.bot = bot
self.bot.error = self.error
async def error(self, channel, message):
if isfile(Path(
self.bot.DATA_FOLDER,
f'{self.bot.name}.error.png')):
... |
"""
bottle-builder.routes
---------------------
This module handles the copying of static resources and views, and the
generations of routes and the app.py file.
:copyright: (c) 2017 by Nick Balboni.
:license: MIT.
"""
__all__ = [ 'RouteGenerator' ]
import os
import os.path
from os.path impo... |
import discord
from discord.ext import commands
from random import choice
class Bottlespin:
"""Spins a bottle and lands on a random user."""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, no_pm=True, alias=["bottlespin"])
async def spin(self, ctx, role):
... |
# type_conversion_test.py - test type conversions
# RMM, 3 Jan 2021
#
# This set of tests looks at how various classes are converted when using
# algebraic operations. See GitHub issue #459 for some discussion on what the
# desired combinations should be.
import control as ct
import numpy as np
import operator
import... |
#!/usr/bin/python
#
# aamporter.py
# Tim Sutton
#
# Utility to download AAM 2.0 and higher (read: CS5 and up) updates from Adobe's updater feed.
# Optionally import them into a Munki repo, assuming munkiimport is already configured.
#
# See README.md for more information.
import logging
import optparse
import os
impor... |
import json
import logging
from functools import wraps
from django.contrib import messages
from django.core.cache import cache
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.utils.translation import ugettext as _
from django.views.decorators.http import require_P... |
import copy
import json
import os
import tempfile
import zipfile
from collections import defaultdict
from StringIO import StringIO
from wsgiref.util import FileWrapper
from django.utils.text import slugify
from django.utils.translation import ugettext as _
from django.utils.http import urlencode as django_urlencode
fr... |
import re
from collections import defaultdict
from datetime import date, datetime, time, timedelta
from django.conf import settings
from django.contrib.postgres.fields import ArrayField, JSONField
from django.db import models, transaction
from django.db.models import Q
import jsonfield
import pytz
from dateutil.parse... |
from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.test.client import Client
from corehq.util.test_utils import flag_enabled
from corehq.apps.users.models import CouchUser
from corehq.apps.domain.shor... |
import logging
from collections import defaultdict, namedtuple
from datetime import datetime
from django.db import DEFAULT_DB_ALIAS
from django.utils.translation import ugettext as _
from couchdbkit.exceptions import (
BulkSaveError,
MultipleResultsFound,
ResourceNotFound,
)
from dimagi.utils.parsing imp... |
from course_discovery.settings.production import *
DEBUG = True
# Docker does not support the syslog socket at /dev/log. Rely on the console.
LOGGING['handlers']['local'] = {
'class': 'logging.NullHandler',
}
# Determine which requests should render Django Debug Toolbar
INTERNAL_IPS = ('127.0.0.1',)
HAYSTACK_... |
#!/usr/bin/env python
import tutils
import ROOT as r
import IPython
import argparse
import os
import fnmatch
import sys
from configobj import ConfigObj
import eval_string
from tqdm import tqdm
from tabulate import tabulate
from string import atoi
from string import atof
def dump_example():
sexample = '''
[option... |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#define class
class Employee:
empCount = 0
def __init__(self, name, salary):
self.name = name
self.salary = salary
Employee.empCount += 1
def displayCount(self):
print "Total employee %d" % Employee.empCount
def disp... |
'''
Class to hold the options for ample
'''
# python imports
import copy
import os
# Our imports
import printTable
class AmpleOptions(object):
def __init__(self):
# The dictionary with all the options
self.d = {}
# dictionary with the default arguments - if... |
'''
Class to hold the options for ample
'''
# python imports
import copy
import os
# Our imports
import printTable
class AmpleOptions(object):
def __init__(self):
# The dictionary with all the options
self.d = {}
# dictionary with the default arguments - if... |
from zeit.cms.interfaces import ICMSContent
from zeit.cms.workflow.interfaces import IPublishInfo
from zeit.content.article.edit.interfaces import IEditableBody
import zeit.cms.testing
import zeit.content.article.interfaces
import zeit.content.article.testing
import zope.i18n.translationdomain
class TestAdding(zeit.c... |
# Coin Toss v0.1 by DaVinci789
# Help this project on GitHub
# DaVinci789 / shortsimplescripts / python / cointosssuite.py
# Written in Python 3
import random
import os
import sys
# define lists for the coin side and events + outcomes
coin = ["heads", "tails"]
randevents = ["normal","rolling", "disappeared"]
randoutco... |
import re
from definitions import properties, statements, full_properties
from utils import fuzzify
# Also see http://www.w3.org/TR/css3-values/
semicolon_expr = re.compile(r';\s*$')
value_expr = re.compile(r'^([^\.\d-]*)(-?\d*\.?\d+)(x|p[tcx]?|e[mx]?|s|m[ms]?|rem|ch|v[wh]|vmin|max|%|)$')
line_expr = re.compile(r'^(\s... |
from config import Config
from util import ok
import ujson
import logging
logger = logging.getLogger(__name__)
class Model(Config):
def __init__(self):
Config.__init__(self, '/ddns.json')
def factory(self):
self.save({
'url': 'https://dynupdate.no-ip.com/nic/update',
'interval': 300,
'ho... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.lines
import matplotlib.pyplot as plt
import seaborn as sns
import filter as ff
import util
def plot_fft(rec, k_largest=None, max_freq=None):
util.check_valid_record(rec)
colors = sns.color_palette('Paired', 6)
base_color ... |
#
# 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 us... |
# -*- coding: utf8 -*-
#
# Copyright (C) 2014 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# 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, either version 3 of the
# License,... |
""" Re-implementation of CTest in Python.
Necessary to by-pass some small ctest shortcomings.
"""
import os
import sys
import re
import shlex
import logging
import subprocess
import time
import threading
import qibuild
LOGGER = logging.getLogger(__name__)
class ProcessThread(threading.Thread):
def __init__(sel... |
from PE import *
from util import *
from Gadget import *
import struct
import sys
import platform
import os
from pydbg import *
from pydbg.defines import *
import cPickle
import random
PICKLE_GADGET = "fsws.pkl"
exe_path = "D:\\testPoc\\Easy File Sharing Web Server\\fsws.exe"
import threading
... |
from qisys import ui
import qisys.parsers
import qidoc.builder
from qidoc.worktree import DocWorkTree, new_doc_project
def build_doc_parser(parser):
""" Add options used during the building of the documentation """
group = parser.add_argument_group("doc build options")
group.add_argument("--version")
... |
from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [
NotifierEvent.TASK_QUEUED,
NotifierEvent.TASK_STARTED,
NotifierEvent.TASK... |
import tensorflow as tf
tf.set_random_seed(777) # reproducibility
def sub_pixel_conv2d(x, f, s=2):
"""
# ref : https://github.com/tensorlayer/SRGAN/blob/master/tensorlayer/layers.py
"""
if f is None:
f = int(int(x.get_shape()[-1]) / (s ** 2))
bsize, a, b, c = x.get_shape().as_list()
... |
#
# Copyright (C) 2007-2013 by frePPLe bvba
#
# This library 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.
#
# This library is... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import re
import subprocess
from telemetry.core import util
from telemetry.internal.platform import cros_device
from telemetry.inter... |
from framework.enums.enums import APIMappings
from androguard.core.analysis import analysis
from datetime import datetime
from blessings import Terminal
t = Terminal()
class APIPermissionMappings(object):
def __init__(self, apk, apks):
super(APIPermissionMappings, self).__init__()
self.apk = apk... |
# -*- encoding: utf-8 -*-
import functools
import json
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from django.db import models
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.utils.encoding import python_2_unicode_compatibl... |
"""
In our python interface to the backbone system, we separate the local collection
which stores models, from the http client which interacts with a remote store
In applications, we would use a class that combines both
"""
import requests
import shelve
import uuid
import contextlib
import logging
from collections imp... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and contributors
# License: MIT. See LICENSE
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder import DocType, Interval
from frappe.query_builder.functions import Now
class LogSettings(Document):
... |
# -*- coding: utf-8 -*-
from django.core.exceptions import ObjectDoesNotExist
from requests import post, delete
from dbaas_credentials.models import CredentialType
from physical.models import Host, Instance
from util import check_ssh, get_credentials_for
from base import BaseInstanceStep
CHANGE_MASTER_ATTEMPS = 4
CHA... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# 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... |
import os, sys, pprint
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django.conf import settings
PROJECT_NAME = settings.SETTINGS_MODULE.split('.')[0]
class Command(BaseCommand):
requires_model_validation = False
option_list = BaseCommand.option_list ... |
class NotSupportedError(NotImplementedError):
""" We intentionally do not support this feature
we may support it in the future, but it requires
pretty big thinking """
def __init__(self, operation, message):
super(NotSupportedError, self).__init__()
self.operation = operation
... |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... |
import json
from django.core.urlresolvers import reverse
from django.http import HttpResponseNotFound
from django.test import TestCase
from mock import Mock
from utils import use_GET_in
from api.views import msa, msas, tables
class ConversionTest(TestCase):
def test_use_GET_in(self):
fn, request = Mock(... |
import json
from django.http import HttpResponse, HttpResponseNotFound
from geo.views import geo_as_json, get_geos_by_bounds_and_type, get_censustract_geos
from geo.models import Geo
from censusdata.views import race_summary_as_json, minority_aggregation_as_json
from hmda.views import loan_originations_as_json
from re... |
from celery.exceptions import SoftTimeLimitExceeded
from django.conf import settings
from requests.exceptions import RequestException
from temba_client.exceptions import TembaHttpError
from ndoh_hub.celery import app
rapidpro = None
@app.task(
autoretry_for=(RequestException, SoftTimeLimitExceeded, TembaHttpErr... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from devilry.project.develop.testhelpers.corebuilder import UserBuilder
from devilry.project.develop.testhelpers.login import LoginTestCaseMixin
class TestChangeLanguage(TestCase, LoginTestCaseMixin):
def setUp(self):
self.url ... |
import rsa
import hashlib
from struct import *
#There is another copy of this function in Bitmessagemain.py
def convertIntToString(n):
a = __builtins__.hex(n)
if a[-1:] == 'L':
a = a[:-1]
if (len(a) % 2) == 0:
return a[2:].decode('hex')
else:
return ('0'+a[2:]).decode('hex')
AL... |
from __future__ import print_function
import pandas as pd
from bs4 import BeautifulSoup as BSoup
from CanslimParams import CanslimParams
import numpy as np
from datetime import date, timedelta, datetime
#from datetime import datetime.now as now
from myAssert import areEqual
## "current date" = 2019 Q1
currentDate = da... |
# -*- coding:utf-8 -*-
__version__ = "0.1.3"
from httpwatcher.cmdline import *
from httpwatcher.server import *
from httpwatcher.filesystem import *
|
# -*- encoding: utf-8 -*-
'''
A simple Nova plugin
:maintainer: HubbleStack
:maturity: 20160325
:platform: All
:requires: SaltStack
This audit module requires yaml data to execute. It will search the local
directory for any .yaml files, and if it finds a top-level 'pkg' key, it will
use that data.
Sample YAML data, ... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ['CUDA_VISIBLE_DEVICES']='0'
import numpy as np
from math import log
from collections import Counter
from scipy.misc import imresize
im... |
"""
The MIT License (MIT)
Copyright (c) 2018 SML
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 limitation
the rights to use, copy, modify, merge, publish,... |
#! /bin/env python
# -*- coding: utf-8 -*-
import sys
import logbook
from rq import Queue
from redis import Redis
from harvester.config import parse_env
from harvester.collection_registry_client import Collection
from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo
JOB_TIMEOUT = 345600 # 96 hrs
def queue_deep_... |
# Copyright (c) 2008-2009 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permane... |
import logging
from logging.config import fileConfig
import os
import re
import sys
import click
import bripipetools
config_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config'
)
fileConfig(os.path.join(config_path, 'logging_config.ini'),
disable_existing_loggers=False)
logg... |
###############################################################################
# actionAngle: a Python module to calculate actions, angles, and frequencies
#
# class: actionAngleStaeckelGrid
#
# build grid in integrals of motion to quickly evaluate
# actionAngleStaeckel
#
# method... |
# Copyright (c) 2005-2006 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permane... |
import os, subprocess, time
import pickle, json, base64
import numpy as np
from ..models.parameters import functions_to_names, plist_to_pdict
try:
import h5py
except:
pass
__all__ = ["run_command", "githash", "write_pickles", "write_hdf5"]
def run_command(cmd):
"""Open a child process, and return its exit... |
#
# 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 us... |
#!/usr/bin/env python
# Test Harness to test the Game Controller Functionality
#
import requests # https://github.com/kennethreitz/requests/
import time
import random
import os
# Global Variables
controller_endpoint = os.environ['GC_ENDPOINT']
#Replace this variables as appropriate
server_url = 'http://' + contr... |
import copy
import decimal
import subprocess
import time
import os
import re
import json
import signal
from datetime import datetime
from datetime import timedelta
from core_symbol import CORE_SYMBOL
from testUtils import Utils
from testUtils import Account
from testUtils import EnumType
from testUtils import addEnum
... |
# (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
import argparse
import sys
from colle... |
from django.http import HttpResponse, HttpResponseRedirect
import urllib2
from .models import *
from django.contrib.auth.decorators import login_required
import json
from django.shortcuts import redirect
import base64
from xml.dom.minidom import parse, parseString
from utils import platform_config, SECURE_platform_con... |
import os
LOGIN_URL = '/'
LOGIN_REDIRECT_URL = '/profile/'
# URL_PATH = ''
# SOCIAL_AUTH_STRATEGY = 'social.strategies.django_strategy.DjangoStrategy'
# SOCIAL_AUTH_STORAGE = 'social.apps.django_app.default.models.DjangoStorage'
# SOCIAL_AUTH_EMAIL_FORM_URL = '/signup-email'
# SOCIAL_AUTH_EMAIL_FORM_HTML = 'email_sign... |
"""
Connect to an EC2 instance via SSH, by name or instance ID.
Security groups, network ACLs, interfaces, VPC routing tables, VPC
Internet Gateways, and internal firewalls for the instance must be
configured to allow SSH connections.
To facilitate SSH connections, ``aegea ssh`` resolves instance names
to public DNS ... |
# coding=utf-8
class Problem(object):
'''Abstract base class to represent and manipulate the search space of a
problem.
In this class, the search space is meant to be represented implicitly as
a graph.
Each state corresponds with a problem state (ie, a valid configuration)
and e... |
import json
import aiml
# The Kernel object is the public interface to
# the AIML interpreter.
k = aiml.Kernel()
# Use the 'learn' method to load the contents
# of an AIML file into the Kernel.
k.learn("test.aiml")
# Use the 'respond' method to compute the response
# to a user's input string. respond() returns
# t... |
"""Support for the Google Cloud TTS service."""
import asyncio
import logging
import os
import async_timeout
from google.cloud import texttospeech
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
import homeassistant.helpers.config_validation as cv
_LOGGER = logg... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Representation of a recording of on-line handwritten data. On-line means
that the pen trajectory is given (and not online as in 'Internet').
"""
import logging
import json
class HandwrittenData(object):
"""Represents a handwritten symbol."""
def __init__(s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Representation of a recording of on-line handwritten data. On-line means
that the pen trajectory is given (and not online as in 'Internet').
"""
import logging
import json
class HandwrittenData(object):
"""Represents a handwritten symbol."""
def __init__(s... |
'''
LICENSING
-------------------------------------------------
hypergolix: A python Golix client.
Copyright (C) 2016 Muterra, Inc.
Contributors
------------
Nick Badger
badg@muterra.io | badg@nickbadger.com | nickbadger.com
This library is free software; you can redistribute it and/o... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import datetime
import gobject
import gtk
import hashlib
import imp
import json
import os
import platform
import Queue
import socket
import subprocess
import sys
import threading
import time
import urllib
import urllib2
import warnings
import webbrowser
import xml.etree.Elemen... |
#!/usr/bin/python
# Generate .js files defining Blockly core and language messages.
#
# Copyright 2013 Google Inc.
# http://blockly.googlecode.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 Licen... |
import unittest
import json
from app import create_app, db
from app.models import User
class Base(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.client = self.app.test_client()
self.user = json.dumps({
"username": "brian",
"password": "pa... |
# 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 agre... |
import i3
class Action(object):
''' Define an i3-msg action. '''
def __init__(self):
self._actions = []
def add(self, action, args=None):
if args:
action = action.__call__(self, *args)
else:
action = action.__call__(self)
self._actions.append(actio... |
from should_dsl import should, should_not
from fake_webapp import EXAMPLE_APP
from splinter.element_list import ElementDoesNotExist
from nose.tools import raises
class BaseBrowserTests(object):
def setUp(self):
self.fail("You should set up your browser in the setUp() method")
def test_can_open_page(s... |
from .._private import PubSub, MessageType, EventType
from ..replies import (BarConfigReply, CommandReply, ConfigReply, OutputReply, TickReply,
VersionReply, WorkspaceReply, SeatReply, InputReply)
from ..events import (BarconfigUpdateEvent, BindingEvent, OutputEvent, ShutdownEvent, WindowEvent,
... |
"""
Sensor for the CityBikes data.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.citybikes/
"""
import logging
from datetime import timedelta
import asyncio
import aiohttp
import async_timeout
import voluptuous as vol
from homeassistant.compone... |
from dota2py import api
from i3pystatus import IntervalModule
class Dota2wins(IntervalModule):
"""
Displays the win/loss ratio of a given Dota account.
Requires: dota2py
"""
settings = (
("matches", "Number of recent matches to calculate"),
("steamid", "Steam ID or username to tra... |
# -*- coding: utf-8 -*-
#
# 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, software
... |
"""
Support for Speedtest.net based on speedtest-cli.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.speedtest/
"""
import logging
import re
import sys
from subprocess import check_output, CalledProcessError
import homeassistant.util.dt as dt_uti... |
from __future__ import absolute_import
import inspect
from sklearn import linear_model as _orig
from sklearn import base
import ibex
for name in dir(_orig):
if name.startswith('_'):
continue
est = getattr(_orig, name)
try:
if inspect.isclass(est) and issubclass(est, base.BaseEstimator)... |
from __future__ import print_function
import doctest
import json
import logging
import os
import re
import unittest
import mock
import tempfile
from datetime import datetime, time, timedelta
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
import errno
from time import ... |
"""Support for Xiaomi Yeelight WiFi color bulb."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Callable, ValuesView
import contextlib
from datetime import datetime
from ipaddress import IPv4Address
import logging
from urllib.parse import urlparse
import async_timeout
from ... |
"""Support for zestimate data from zillow.com."""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (CONF_API_KEY,
CONF_NAME, ATTR_ATTRIBUTION)
import homea... |
# -*- coding: utf-8 -*-
from __future__ import division
from itertools import izip
from string import uppercase, lowercase
from django.db import models, connection
from django.db.models import Max, F
from django.core.urlresolvers import reverse
# from django.core.cache import cache
# from django.db import connection ##... |
# -*- coding: utf-8 -*-
__author__ = 'Pierre Dulac'
__email__ = 'pierre@dulaccc.me'
__version__ = '1.0.1'
|
"""
ikDisplay Live Stream service.
"""
from twisted.application import strports, service
from twisted.python import usage
from twisted.words.protocols.jabber.jid import internJID as JID
from anymeta import manhole
from ikdisplay import xmpp
from ikdisplay.client import notifier
STYLES = ('beamer', 'beamer_all', 'sc... |
from iliasCorrector import app, db
from iliasCorrector.models import Exercise, Submission, File
from flask import g
from sqlalchemy import func
import os
import statistics
def import_grades(exercise, points):
if os.path.isfile(points):
with open(points) as f:
for line in f:
da... |
#!/usr/bin/env python
import unittest
from array import array
import pyipmi.msgs.bmc
import pyipmi.msgs.fru
import pyipmi.msgs.sel
import pyipmi.msgs.event
import pyipmi.msgs.hpm
import pyipmi.msgs.sdr
from pyipmi.errors import DecodingError, EncodingError
from pyipmi.msgs import encode_message
from pyipmi.msgs impo... |
from django.db import models
from django.contrib.auth.models import User
# from django.contrib import admin
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Photo(models.Model):
picture = models.ImageField(upload_to='photos')
user = models.ForeignKey(User, relat... |
# -*- coding: utf-8 -*-
"""
Django settings for Common Repository project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, u... |
# -*- coding: utf-8 -*-
from configurations import Configuration
import os
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (/a/b/myfile.py - 3 = /)
APPS_DIR = ROOT_DIR.path('stoqs')
env = environ.Env()
class Common(Configuration):
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.