text stringlengths 2 999k |
|---|
import hashlib
import logging
import os
import shutil
import socket
import tempfile
import urllib
from Queue import Queue, Full, Empty
from stat import S_IFDIR, S_IFLNK, S_IFREG
from StringIO import StringIO
from threading import Lock, Thread, Event
from time import time
from urlparse import urlparse
# Set download t... |
#
# Copyright (c) 2021 Citrix Systems, 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... |
"""Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2021 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... |
from data_process.ppd_process.ppd_data_creation_config import ppd_data_creation
feature_extractor_architecture_list = [
[15, 20, 15, 6],
[85, 100, 60, 8],
[30, 50, 30, 6],
[18, 30, 18, 6],
[55, 70, 30, 8]]
no_fg_feature_extractor_architecture = [203, 210, 70, 20]
pre_train_hyperparameters = {
... |
#!/usr/bin/env python3
import i3ipc
import subprocess
import os
import signal
CZ_LAYOUT = 1
US_LAYOUT = 0
KEYBOARD_ID = "65261:38924:TMK._FC980C_Alt_Controller"
us_window_ids = [
"org.kde.krdc",
"Alacritty",
"foot",
"assistant", # Qt Assistant
]
in_game = False
ipc = i3ipc.Connection()
def altmeta... |
#!/usr/bin/env python
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
README = readme_file.read()
install_requires = [
'click==6.6',
'botocore>=1.5.40,<2.0.0',
'typing==3.5.3.0',
'six>=1.10.0,<2.0.0',
'pip>=9,<11',
'attrs==17.4.0',
'enum34==1.1.6',... |
#! /usr/bin/env python
# Copyright (c) 2021 Uber Technologies, 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 a... |
# Generated by Django 3.2 on 2021-12-22 04:11
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max... |
import logging
import os
import stat
from funcy import cached_property
from shortuuid import uuid
from dvc.hash_info import HashInfo
from dvc.objects.db import ObjectDB
from dvc.objects.errors import ObjectFormatError
from dvc.progress import Tqdm
from dvc.utils import relpath
from dvc.utils.fs import copyfile, remov... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from main import views
handler404 = 'main.views.my_custom_page_not_found_view'
handler500 = 'mysite.views.my_custom_error_view'
handler403 = 'mysite.views.my_custom_permission_denied_view'
handler400 = 'mysite.views.my_custom_bad_requ... |
# -*- coding: utf-8 -*-
import VIPRO
from VIPRO.lib.curve.ttypes import *
from datetime import datetime
import io,os,re,ast,six,sys,glob,json,time,timeit,codecs,random,shutil,urllib,urllib2,urllib3,goslate,html5lib,requests,threading,wikipedia,subprocess,googletrans ,pytz
from gtts import gTTS
from random import ran... |
from flask import g
from flask_restful import fields, marshal_with, abort
from mongoengine import Q
from repository.db_engine import get_db
from repository.factory import Factory
class DB:
inventory_resource_fields = {
"name": fields.String,
"sell_in": fields.Integer,
"quality": fields.In... |
#
# Copyright (c) 2019 MagicStack Inc.
# All rights reserved.
#
# See LICENSE for details.
##
import psycopg2
INSERT_PREFIX = 'insert_test__'
def get_port(ctx):
return 8080
def get_queries(ctx):
conn = connect(ctx)
try:
qargs = load_ids(ctx, conn)
finally:
close(ctx, conn)
r... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
# Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch05_datastructures.solutions.ex11_list_add import list_add_improved, list_add_with_iter, list_add, \
list_add_inverse
@pytest.mark.parametrize("values1, values2, expected",
[([1, 2... |
# Copyright European Organization for Nuclear Research (CERN)
#
# 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
#
# Authors:
# - Vincent Garonne, <v... |
import boto3
from typing import List
from botocore.exceptions import ClientError
from shelvery.aws_helper import AwsHelper
from shelvery.engine import SHELVERY_DO_BACKUP_TAGS
from shelvery.ec2_backup import ShelveryEC2Backup
from shelvery.entity_resource import EntityResource
from shelvery.backup_resource import Back... |
# Copyright 2019-2021 Canaan 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 writ... |
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# 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 u... |
import zipfile
import json
from datetime import datetime
import base64
import time
import os
import sys
import queue
import threading
import psutil
from persistqueue import Queue
import queue
import os
import time
import pygame.camera
import pygame.image
from PIL import Image
import cv2
import guid
import pika
import s... |
"""
Django settings for yatinder project.
Generated by 'django-admin startproject' using Django 2.2.19.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
from __fut... |
# -*- coding: utf-8 -*-
"""This module defines functions for calculating physical properties from normal
modes."""
import time
import numpy as np
from prody import LOGGER
from prody.atomic import Atomic
from prody.ensemble import Ensemble, Conformation
from prody.trajectory import TrajBase
from prody.utilities impor... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from io import StringIO
from typing import AsyncIterator, Dict, List, Optional, Set
from idb.grpc.types import CompanionClient
from idb.common.constants import TESTS_POLL_INTERVAL
from idb.common.types import TestActivity,... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import pickle
def abs_sobel_thresh(img, orient='x', sobel_kernel=3, thresh=(0, 255)):
# Apply the following steps to img
# 1) Convert to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
# 2) Take the de... |
from flask_restx import fields
from .common import ns
from .playlist_library import playlist_library
associated_wallets = ns.model(
"associated_wallets",
{
"wallets": fields.List(fields.String, required=True),
"sol_wallets": fields.List(fields.String, required=True),
},
)
encoded_user_id ... |
# -*- coding: utf-8 -*-
#import midiate
import tkinter
from tkinter import font
def choose_input(midiate):
inputs = midiate.enum_input()
def f(x):
if x in inputs: return x
return (f('UM-1') or f('MPKmini2') or f('CASIO USB-MIDI') or f('USB Oxygen 8 v2') or f('A-500S') or f('loopMIDI port') or
... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Binux <roy@binux.me>
import config
from db.task import TaskDB as _TaskDB
from .basedb import BaseDB
class TaskDB(_TaskDB, BaseDB):
def __init__(self, path=config.sqlite3.path):
self.path = path
self._execute('''C... |
# Generated by Django 3.1.7 on 2021-03-05 01:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0007_remove_postcomponent_title'),
]
operations = [
migrations.AlterField(
model_name='tag',
name='name',
... |
# Generated by Django 2.2.12 on 2020-05-13 12:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blocklist', '0013_kintoimport_timestamp'),
]
operations = [
migrations.AlterField(
model_name='block',
name='kinto_... |
import numpy as np
import tensorflow as tf
from garage.tf.core.mlp import mlp
from tests.fixtures import TfGraphTestCase
class TestMLP(TfGraphTestCase):
def setup_method(self):
super(TestMLP, self).setup_method()
self.obs_input = np.array([[1, 2, 3, 4]])
input_shape = self.obs_input.shape... |
# Generated by Django 2.2 on 2019-05-17 11:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0022_remove_chatmessage")]
operations = [
migrations.AddField(
model_name="projector",
name="chyron_background_color",
... |
import re
import itertools
try:
import queue
except:
import Queue as queue
def solve(inp, go_back=False):
ids = []
needed_positions = []
for i, line in enumerate(inp):
for j, char in enumerate(line):
if char not in ("#", "."):
needed_positions.append((i, j))
... |
# update: 16/07/2018
from abc import ABC
from dataclasses import dataclass
import AST
class Kind(ABC):
pass
class Function(Kind):
def __str__(self):
return "Function"
class Parameter(Kind):
def __str__(self):
return "Parameter"
class Variable(Kind):
def __str__(self)... |
import argparse
import asyncio
import logging
import os
import random
import numpy as np
import cv2
from av import VideoFrame
import traceback
from aiortc import (
RTCIceCandidate,
RTCPeerConnection,
RTCSessionDescription,
RTCConfiguration,
RTCIceCandidate,
RTCIceServer,
VideoStreamTrack,
... |
import asyncio
import discord
import typing
from discord.ext import commands
async def wf_msg_or_reaction(
ctx: commands.Context,
*,
timeout: float = 120.0,
checks: typing.List[callable] = None,
message: discord.Message = None,
**pairs
):
"""
Waits for a message and/or a reaction, whi... |
from .test_ipuz import IPUZBaseTestCase
class IPUZSampleCrosswordTestCase(IPUZBaseTestCase):
def setUp(self):
self.puzzle = {
"version": "http://ipuz.org/v1",
"kind": ["http://ipuz.org/crossword"],
"dimensions": {"width": 3, "height": 3},
"puzzle": [],
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
#!/usr/bin/env python
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2017 ZAP Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 License, or
# (at your option) any later version.
#
# Ansible is distribut... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import patterns, url
from . import views
# load admin modules
from django.contrib import admin
admin.autodiscover()
urls = (
url(r'^sectors/(?P<code>\w+)/$', views.SectorView.as_view(), name='sector-detail'),
url(r'^recipi... |
# Copyright (c) 2015-2017 Cisco Systems, Inc.
# 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,... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... |
# import shortcuts
from .core.fritzconnection import FritzConnection
__version__ = '1.3.0-dev'
package_version = __version__
|
"""host_a_skier URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... |
from abc import ABC
from typing import List
import attr
from treeno.base import PrintOptions, SetQuantifier, Sql
from treeno.expression import Value
from treeno.printer import join_stmts
class Group(Sql, ABC):
"""Base class to describe all grouping entities.
"""
@attr.s
class GroupBy(Sql):
"""GroupBys... |
import os
import torch
from torchvision import datasets
from boxlist import BoxList
def has_only_empty_bbox(annot):
return all(any(o <= 1 for o in obj['bbox'][2:]) for obj in annot)
def has_valid_annotation(annot):
if len(annot) == 0:
return False
if has_only_empty_bbox(annot):
return... |
#!/usr/bin/env python
# To use a consistent encoding
from codecs import open
from os import path
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.md"), e... |
from app import models
from app.config import sqla
from app.lib.duplication_check.reply_database import ReplyDatabase
from sqlalchemy import func
from app.lib.duplication_check.reply_model import Reply
def pull_data_from_database(db: ReplyDatabase, start_time):
start_rpid = get_min_start_rpid(start_time)
ses... |
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(ArticleExample)
admin.site.register(DictEntry)
|
import json
import requests
from . import exceptions
URL = 'https://ws.apicep.com/cep/{}.json'
def fetch_address(cep):
try:
response = requests.get(URL.format(cep))
if response.status_code == 200:
# Transforma o objeto requests em um dict
address = json.loads(response... |
import sys
import os
import marshal
import imp
import struct
import time
import unittest
from test import support
from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
import zipimport
import linecache
import doctest
import inspect... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from os import sys
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip instal... |
#!/usr/bin/env python3
# Copyright (C) 2014 The python-bitcoinlib developers
#
# This file is part of python-bitcoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied, modified,
# ... |
#!/usr/bin/env python
# Raspberry Pi Zero Cookbook
# Chapter 6
# New Email and Tweet LED Notifier
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import time
import imaplib
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
#Set up GPIO 22,23,24 as our LED outputs
GPIO.... |
import os
import re
from spec2vec import __version__ as expected_version
def test_version_string_consistency():
"""Check whether version in conda/meta.yaml is consistent with that in spec2vec.__version__"""
repository_root = os.path.join(os.path.dirname(__file__), "..")
fixture = os.path.join(repository_... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-04-29 15:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0014_auto_20170429_1444'),
]
operations = [
migrations.AlterField(... |
from models.locationsManager import LocationsManager
try:
locations = LocationsManager()
# Download and create config files for locations
# locations.create()
# Gets list of countries
#countries = locations.get_countries()
#print(countries)
# Gets list of cities based on country code
... |
# TODO: implement logging
import os
import json
from flask import Flask
from flask import request, render_template, flash, redirect, url_for, \
send_file, Markup, session
from flask_mail import Mail, Message
import asyncio
from time import time
from werkzeug.utils import secure_filename
# Custom pac... |
from __future__ import print_function
from itertools import chain
import os
import sys
import random
import Piano1
import Strings1
import Strings2
import Constants
import Pentatonic
import collections
import RhythmChords
import PeruvianRhythmChords
class AccompanyingLayers :
def __init__ ( sel... |
from dataclasses import dataclass
from typing import Optional, TYPE_CHECKING
if TYPE_CHECKING:
from .ident import Ident
from .data_type import DataType
@dataclass
class ExternalTableColumn:
name: "Ident"
type: "DataType"
expr: str
not_null: bool
comment: Optional[str]
@dataclass
class T... |
from containers import SDContainer
from .api import _FastAPI
from dependency_injector.wiring import Provide, inject
from fastapi import Request
from pydantic import BaseModel
from models import Milestone, OnPathway
from fastapi.responses import Response
from config import config
class TestResultUpdate(BaseModel):
... |
"""A modified image folder class
We modify the official PyTorch image folder (https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py)
so that this class can load images from both current directory and its subdirectories.
"""
import torch.utils.data as data
from PIL import Image
import os
IMG_E... |
import tkinter as tk
from tkinter import filedialog, StringVar, messagebox, ttk
from generate_tags import Tagger
from constants import TAGS, KEY
from utils import Checkbar, checkTextboxInput, processCheckboxes
def selectSourceFolder(event=None):
"""
Selects the source folder where audio tracks are contained
... |
import argparse
import torch
import torch.nn as nn
multiply_adds = 1
def count_convNd(m, x, y):
x = x[0]
cin = m.in_channels
batch_size = x.size(0)
kernel_ops = m.weight.size()[2:].numel()
bias_ops = 1 if m.bias is not None else 0
ops_per_element = kernel_ops + bias_ops
output_elements ... |
_base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/deepfashion_full.py'
]
evaluation = dict(interval=10, metric='PCK', save_best='PCK')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
... |
"""
This file offers the methods to automatically retrieve the graph Borrelia bissettii.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-02-... |
import numpy as np
import pytest
class Var():
'''
This class defines a multivariate dual number
'''
def __init__(self, val, dual_paras):
""" constructor for Var class
INPUT
=======
val: value of the input variable
dual_paras: partial derivatives with respect to e... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... |
#!/usr/bin/env python
# coding=utf-8
import socket
import requests
requests.packages.urllib3.disable_warnings()
from lib.common import save_user_script_result
def do_check(self, url):
if url != '/':
return
ip = self.host.split(':')[0]
ports_open = is_port_open(ip)
headers = {
"User-Ag... |
# Copyright (C) 2012-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# 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, ... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os
import unittest
from functional_tests.data.atlas.skulls.run import AtlasSkulls
from functional_tests.data.atlas.brain_structures.run import AtlasBrainStructures
from functional_tests.data.atlas.digits.run import AtlasDigits
from functional_tests.data.regressio... |
# Copyright 2014 PerfKitBenchmarker 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 appli... |
class InstructionNotFound(Exception):
def __init__(self):
print("Sorry your instruction does not exist yet in this system") |
from Crawler.crawler_sina import WebCrawlFromSina
if __name__ == '__main__':
web_crawl_obj = WebCrawlFromSina(5000, 100, ThreadsNum=4, IP="localhost", PORT=27017, \
dbName="Sina_Stock", user="user", passwd="Fan@1234567890",
collectionNa... |
from highcliff.actions.actions import AIaction
class MonitorTemperature(AIaction):
effects = {"problem_with_temperature": False}
preconditions = {}
def behavior(self):
# decide if medication is needed and update the world accordingly
raise NotImplementedError
def __adjustment_needed(... |
"""Example code to do convolution."""
import os
import numpy as np
import scipy.signal
import tvm
from tvm.contrib import nvcc
import topi
from topi.nn.util import get_const_tuple
TASK = "conv2d_hwcn_map"
USE_MANUAL_CODE = False
@tvm.register_func
def tvm_callback_cuda_compile(code):
ptx = nvcc.compile_cuda(code,... |
# coding: utf-8
"""
Talend Management Console Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import abs... |
import numpy as np
import os
import sys
import ntpath
import time
from . import util, html
from subprocess import Popen, PIPE
# try:
#from func_timeout import func_timeout, FunctionTimedOut
# except ImportError:
# print("module func_timeout was not installed. Please install func_timeout using pip install func-timeou... |
# Copyright 2021 The Private Cardinality Estimation Framework Authors
#
# 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 b... |
'''
FPM Wrapper
Copyright (c) 2015 - 2021 Rob "N3X15" Nelson <nexisentertainment@gmail.com>
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 r... |
import os
import time
import subprocess
from flask import Flask, request
from flask import request, jsonify, json
from flask_cors import CORS
import wget
import uuid
from typing import List
import requests
app = Flask(__name__)
cors = CORS(app)
uuids_to_paths = {}
current_port_number = 5001
@app.route('/')
def star... |
#!/usr/bin/env python3
"""
Example File for gpxpy waypoints
@author: Marcel verpaalen
"""
import gpxpy
import gpxpy.gpx
from typing import *
gpx = gpxpy.gpx.GPX()
gpx.name = 'Aanlegplaatsen'
gpx.description = 'Marrekrite aanlegplaatsen'
# adding 2 waypoints
gpx_wps = gpxpy.gpx.GPXWaypoint()
gpx_wps.latitude = 52.... |
import Domoticz
import json
from adapters.base_adapter import Adapter
from devices.switch.on_off_switch import OnOffSwitch
class GDKES02TZXD(Adapter):
def __init__(self, devices):
super().__init__(devices)
self.devices.append(OnOffSwitch(devices, 'left', 'state_left'))
self.devices.append... |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/usr/bin/python3.6
# -*- coding: utf-8 -*-
import sys
import os
import time
import ntpath
import json
from helper.mongod import Mongodb
from datetime import datetime
from datetime import date
from pprint import pprint
from bson import ObjectId
from helper.common import Common
from helper.jaccs import C... |
#!/usr/bin/env python3
# Copyright 2014 Jason Heeris, jason.heeris@gmail.com
#
# This file is part of the gammatone toolkit, and is licensed under the 3-clause
# BSD license: https://github.com/detly/gammatone/blob/master/COPYING
from mock import patch
import nose
import numpy as np
import scipy.io
from pkg_resources i... |
import numpy as np
import time
import cv2
import mss
def shot(height, width):
with mss.mss() as sct:
img = np.array(
sct.grab(
{'top': 0,
'left': 0,
'width': width,
'height': height}
)
)[:, :, :3]
... |
#! /usr/bin/env python
import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node('move_group_python_interface_tutorial', anonymous=True)
robot = moveit_commander.RobotCommander()
scene = moveit_commander.Pl... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © Her Majesty the Queen in Right of Canada, as represented
# by the Minister of Statistics Canada, 2019.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... |
'''
Created on Sep 10, 2015
@author: David Zwicker <dzwicker@seas.harvard.edu>
'''
from __future__ import division
import logging
import numpy as np
from utils.math.distributions import lognorm_mean, DeterministicDistribution
__all__ = ['LibraryLogNormal']
class LibraryLogNormal(object):
""" represents a s... |
""" Setup file """
from setuptools import setup, find_packages
import os
import re
HERE = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(HERE, 'README.rst')).read()
CHANGES = open(os.path.join(HERE, 'CHANGES.rst')).read()
# Remove custom RST extensions for pypi
CHANGES = re.sub(r'\(\s*:(issue|... |
"""
centers
Module contains functions for evaluating TCRs as center(oids) of meta-clonotypes.
find_center
"""
import warnings
import numpy as np
from tcrdist.ecdf import distance_ecdf
def calc_radii(tr, tr_bkgd, chain = 'beta', ctrl_bkgd = 10**-5, use_sparse = True, max_radius=50, chunk_size=100, **kwargs):
"""
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 17 14:12:06 2021
@author: robertclay
This file is for parsing the understanding societies data over all waves into
a persistent data frame containing immutable person attributes for all
agents over all times and variable frames containing values t... |
# -*- coding: utf-8 -*-
# daemon/daemon.py
# Part of ‘python-daemon’, an implementation of PEP 3143.
#
# This is free software, and you are welcome to redistribute it under
# certain conditions; see the end of this file for copyright
# information, grant of license, and disclaimer of warranty.
""" Daemon process beha... |
#!/usr/bin/env python3
#
# Task:
# Run your copy of the boot code. Immediately before any instruction
# is executed a second time, what value is in the accumulator?
# - acc increases or decreases a single global value called the accumulator
# by the value given in the argument. For example, acc +7 would increase
# ... |
import logging
import re
from fuzzywuzzy import fuzz
logging.getLogger().setLevel(logging.INFO)
def _add_start_end_fuzzy_search(element_to_add, text, sub_text, start_index, move_text_left=0):
sub_text_start = re.sub(r'(?<!AM|PM)( \.)', '.', sub_text[move_text_left:30 + move_text_left])
sub_text_end = re.sub(... |
# Copyright 2018 Uber Technologies, Inc. All Rights Reserved.
# Modifications copyright (C) 2019 Intel Corporation
# Modifications copyright (C) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... |
from __future__ import unicode_literals
import os
import dvc.logger as logger
from dvc.utils.compat import urlparse
from dvc.istextfile import istextfile
from dvc.exceptions import DvcException
from dvc.remote.local import RemoteLOCAL
from dvc.output.base import OutputBase, OutputAlreadyTrackedError
class OutputLOC... |
"""
Wrappers for the MATLAB compatibility module
"""
import numpy as np
from ..statesp import ss
from ..xferfcn import tf
from ..ctrlutil import issys
from ..exception import ControlArgument
from scipy.signal import zpk2tf
from warnings import warn
__all__ = ['bode', 'nyquist', 'ngrid', 'dcgain']
def bode(*args, **k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.