text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-08 00:16
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
import localflavor.us.models
import phonenumber_field.modelfields
class Migration(migratio... |
from . import units
from . import tools
import math
from .basedata import BaseData
class Swell(BaseData):
def __init__(self, unit, wave_height=float('nan'), period=float('nan'), direction=float('nan'), compass_direction=None, max_energy = 0, frequency_index = 0):
super(Swell, self).__init__(unit)
... |
"""
Jordi explained that a recursive search may not work as you might
first follow an extremely long path.
Thus, the process should be done by levels
"""
import os
from collections import defaultdict
class Computer:
def __init__(self):
self.operations = {'cpy': self.copy, 'inc': self.add, 'de... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
import os
import pickle
import PVGeo
import pyvista as pv
import pandas as pd
from ela.classification import GridInterpolation
from ela.spatial import create_meshgrid_cartesian
from ela.visual import *
'''
@author: Guanjie Huang
@date: Aug 16th,2019
This class is used to process data before generating the 3D images
'... |
import django_filters
from django.conf import settings
from django.db import models
from django.test import TestCase
from mptt.fields import TreeForeignKey
from taggit.managers import TaggableManager
from dcim.choices import *
from dcim.fields import MACAddressField
from dcim.filters import DeviceFilterSet, SiteFilter... |
'''
Copyright (c) 2013, Battelle Memorial Institute
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions ... |
#!C:\Users\WEMERSON\Documents\kivy\kivy_venv\Scripts\python.exe
# $Id: rst2html4.py 7994 2016-12-10 17:41:45Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing (X)HTML.
The output conforms t... |
#!/usr/bin/env python
# encoding: utf-8
"""A Snippet instance is an instance of a Snippet Definition.
That is, when the user expands a snippet, a SnippetInstance is created
to keep track of the corresponding TextObjects. The Snippet itself is
also a TextObject.
"""
from UltiSnips import _vim
from UltiSnips.position... |
"""Docstring
"""
import cv2
#import numpy as np
def find_in_face(haarcascade, rec=False):
"""Press 'k' for quit
"""
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
smile_cascade = cv2.CascadeClassifier(haarcascade)
cap = cv2.VideoCapture(0)
if rec:
fourc... |
import torch.nn as nn
import torch
class ProtoNetBig(nn.Module):
def __init__(self, x_dim=23433, hid_dim=[2000, 1000, 500, 250], z_dim=100):
super(ProtoNetBig, self).__init__()
self.linear0 = nn.Linear(x_dim, hid_dim[0])
self.bn1 = nn.BatchNorm1d(hid_dim[0])
self.linear1 = nn.Linear... |
from gym.envs.registration import register
register(
id='scaled-riverswim-v0',
entry_point='riverswim_variants.envs:ScaledRiverSwimEnv',
max_episode_steps=20,
)
register(
id='stochastic-riverswim-v0',
entry_point='riverswim_variants.envs:StochasticRiverSwimEnv',
max_episode_steps=20,
)
regist... |
import torch
import torch.nn as nn
import torch.nn.init as init
from .nets.backbone import HourglassBackbone, SuperpointBackbone
from .nets.junction_decoder import SuperpointDecoder
from .nets.heatmap_decoder import PixelShuffleDecoder
from .nets.descriptor_decoder import SuperpointDescriptor
def get_model(model_cfg... |
import numpy as np
import numpy.testing as npt
from dipy.reconst.peaks import default_sphere, peaks_from_model
def test_PeaksAndMetricsDirectionGetter():
class SillyModel(object):
def fit(self, data, mask=None):
return SillyFit(self)
class SillyFit(object):
def __init__(self, m... |
import tensorflow as tf
import tensorflow.contrib.layers as layers
from utils.general import get_logger
from utils.test_env import EnvTest
from q1_schedule import LinearExploration, LinearSchedule
from q2_linear import Linear
from configs.q3_nature import config
class NatureQN(Linear):
"""
Im... |
"""Complex Step derivative approximations."""
from __future__ import division, print_function
from itertools import groupby
from six.moves import range
import numpy as np
from openmdao.approximation_schemes.approximation_scheme import ApproximationScheme
from openmdao.utils.name_maps import abs_key2rel_key
DEFAULT... |
from iconic_matcher import IconicMatcher
#from realign4d import TimeSeries, realign4d, resample4d
import transform
from numpy.testing import Tester
test = Tester().test
bench = Tester().bench
|
#!/bin/python
# argument processing
import sys, getopt
# date and time
import datetime
import pytz
# weather
from weather import weatherFormat, twoColumn
from ansi import ansi_escape
# graphics/image
import PIL # requires python-pillow
from PIL import Image
# webcams
import webcam
# for organ
import requests
from ... |
import datetime as dt
import pytest
from note_clerk import planning
@pytest.mark.parametrize(
"date, quarter",
[
(dt.datetime(2020, 1, 1), dt.datetime(2020, 1, 1)),
(dt.datetime(2020, 1, 2), dt.datetime(2020, 1, 1)),
(dt.datetime(2020, 4, 1), dt.datetime(2020, 4, 1)),
(dt.dat... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('release', '0002_auto_20150512_07... |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... |
# encoding: latin2
"""Data generator module
"""
__author__ = "Juan C. Duque, Alejandro Betancourt"
__credits__ = "Copyright (c) 2009-10 Juan C. Duque"
__license__ = "New BSD License"
__version__ = "1.0.0"
__maintainer__ = "RiSE Group"
__email__ = "contacto@rise-group.org"
from weightsFromAreas import weightsFromAreas
... |
"""
WSGI config for derrida project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... |
from contextlib import contextmanager
import json
import os
import logging
import sys
import subprocess
from typing import Optional, Tuple
import pytest
logger = logging.getLogger(__name__)
@contextmanager
def set_env_var(key: str, val: Optional[str] = None):
old_val = os.environ.get(key, None)
if val is no... |
#!/usr/bin/python
'''
(C) Copyright 2017-2019 Intel Corporation.
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 applic... |
import pytest
from thefuck.rules.git_rebase_no_changes import match, get_new_command
from thefuck.types import Command
@pytest.fixture
def output():
return '''Applying: Test commit
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced t... |
# TODO
import sys
from sys import argv
import sqlite3
if len(argv) != 2:
print("Usage: python roster.py Gryffindor")
sys.exit(1)
#setting house choice
house_choice = argv[1].lower()
#working on database
db_file = 'students.db'
conn = sqlite3.connect(db_file)
c = conn.cursor()
#connect to db and retrieve hou... |
"""
base16vlq.py
base16 unsigned variable length quantity (VLQ)
based on
https://gist.github.com/mjpieters/86b0d152bb51d5f5979346d11005588b
https://github.com/Rich-Harris/vlq
to encode *signed* integers, we would need _abc_len == 17
python -c $'from base16vlq import encode\nfor n in range(0, 64):\n print(f"{n:3d}... |
'''
Utility functions.
'''
import argparse
import functools
import itertools
import os
import sqlite3 as sql
from contextlib import closing
from copy import deepcopy
from itertools import repeat
import numpy as np
import pandas as pd
import scipy as sp
import scipy.fftpack
import scipy.signal
from cnld import abstract... |
# Copyright 2018 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... |
# main.py
# python 2.7
# Handy Employee Management System (HEMS)
# Basic CLI Employee Management System that interfaces with
# a database.
# Chris Bugg
# Created: 5/10/17
# Imports
import os
import re
import sys
from handler import Handler
from employee import Employee
# Main Class
class HEMS:
... |
from .PyrezException import PyrezException
class SessionLimit(PyrezException):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
|
#
# PySNMP MIB module BIANCA-BRICK-SIF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BIANCA-BRICK-SIF-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:38:43 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... |
# 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 ... |
"""
Model Checkpointing
===================
Automatically save model checkpoints during training.
"""
import os
import re
import numpy as np
from typing import Optional
import torch
from pytorch_lightning import _logger as log
from pytorch_lightning.callbacks.base import Callback
from pytorch_lightning.utilities i... |
'''
After creating tractography streamlines with dipy_csd.py,
this workflow takes an atlas file and finds connections
between each region in the atlas
KRS 2018.05.04
'''
from nipype import config
config.set('execution', 'remove_unnecessary_outputs', 'false')
config.set('execution', 'crashfile_format', 'txt')
from nipy... |
from .contrib import * # noqa
from .models import * # noqa
from .utils import * # noqa
from .checkpoint import load_ckpt, save_ckpt, remove_ckpt, clean_ckpt
from .cmd_args import parse_args
from .config import (cfg, set_cfg, load_cfg, dump_cfg, set_run_dir,
set_out_dir, get_fname)
from .init imp... |
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
from pylint.reporters.base_reporter import BaseReporter
class CollectingReporter(BaseReporter):
"""collects messages"""
name = "collector"
def __init__(sel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import requests
import sys
import tarfile
from lxml import etree
from tqdm import tqdm
INFOLEG_URL = 'https://cs.famaf.unc.edu.ar/~ccardellino/resources/mirel/law_text_cleaned.tar.bz2'
IN... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="SymCircuit",
version="0.2.0",
author="Martok",
author_email="martok@martoks-place.de",
description="Symbolic electronic circuit analysis",
long_description=open("README.md","rt").read(),
long_description_content... |
from ...plugin import hookimpl
from ..custom import CustomBuilder
from ..sdist import SdistBuilder
from ..wheel import WheelBuilder
@hookimpl
def hatch_register_builder():
return [CustomBuilder, SdistBuilder, WheelBuilder]
|
import os
import signal
import sys
import time
import pytest
import ray
import ray.ray_constants as ray_constants
from ray._private.cluster_utils import Cluster
from ray.test_utils import RayTestTimeoutException, get_other_nodes
SIGKILL = signal.SIGKILL if sys.platform != "win32" else signal.SIGTERM
@pytest.fixtur... |
"""
This module defines a data structure for manipulating HTTP headers.
"""
from typing import (
Any,
Dict,
Iterable,
Iterator,
List,
Mapping,
MutableMapping,
Tuple,
Union,
)
__all__ = ["Headers", "MultipleValuesError"]
class MultipleValuesError(LookupError):
"""
Except... |
# -*- coding: utf-8 -*-
"""
Inverse Logistic Regression Recommender
Created on 2019
@author: Alex Xu <ayx2@case.edu>
"""
from .predict_feature_values import InverseLogisticRegressionRecommender
from .evaluate import validate
from .evaluate import _error_metrics_
__all__ = [
'validate',
'_error_metrics_'
]
|
import enum
from queue import Queue
class Animal(enum.Enum):
cat = 'cat'
dog = 'dog'
class AnimalShelter:
def __init__(self):
self.cats = Queue()
self.dogs = Queue()
self.pos = 0
# Time complexity: O(1)
# Space complexity: O(1)
def enqueue(self, animal: Animal):
... |
"""The Fast Gradient Method attack."""
import numpy as np
import tensorflow as tf
def fast_gradient_method(model_fn, x, eps, ord, clip_min=None, clip_max=None, y=None,
targeted=False, sanity_checks=False):
"""
Tensorflow 2.0 implementation of the Fast Gradient Method.
:param model_fn: ... |
# Copyright 2016 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import os
import logging
TAG = 'version_2'
HASH = '317b22ad9b6b2f7b4... |
from . import transforms |
import inspect
import sys
from pathlib import Path
from types import TracebackType
from typing import NoReturn, Optional, Union
import rich.console
import typer
from . import Severity, Verbosity
from .config import config
__all__ = ["error", "warning", "info", "debug"]
COLOR_MAP = {
Severity.ERROR: "red",
... |
import pandas as pd
import numpy as np
def load_and_process_data(path):
rawData = pd.read_csv(path, sep=";")
rawData = rawData[rawData.columns[:-2]].dropna().rename(columns={"RH": "Relative Humidity", "AH": "Absolute Humdity", "T": "Temp"})
for col in rawData.columns:
#covert strings into floa... |
"""
Woopra template tags and filters.
"""
from __future__ import absolute_import
import json
import re
from django.conf import settings
from django.template import Library, Node, TemplateSyntaxError
from analytical.utils import (
disable_html,
get_identity,
get_required_setting,
get_user_from_contex... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys
from os import path
clear = lambda: os.system('clear')
green = "\033[1;32;2m"
greenblink = "\033[1;32;5m"
yellow = "\033[1;33;2m"
yellowblink = "\033[1;33;5m"
redblink = "\033[1;31;5m"
red = "\033[1;31;2m"
white = "\033[1;37;0m"
normal = "\033[0m"
# ========... |
#
# Copyright 2014 OpenStack Foundation. 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 req... |
from clothmanip.utils.utils import get_variant, argsparser, get_randomized_env, dump_commit_hashes, get_keys_and_dims, dump_goal
from clothmanip.envs.cloth import ClothEnvPickled as ClothEnv
import numpy as np
from rlkit.torch.sac.policies import TanhGaussianPolicy, MakeDeterministic, TanhScriptPolicy, CustomScriptPoli... |
from spacy.lang.en import English
from spacy.tokens import Token
nlp = English()
# Register the Token extension attribute "is_country" with the default value False
Token.set_extension("is_country", default=False)
# Process the text and set the is_country attribute to True for the token "Spain"
doc = nlp("I live in S... |
load("@rules_maven_third_party//:import_external.bzl", import_external = "import_external")
def dependencies():
import_external(
name = "org_eclipse_jgit_org_eclipse_jgit",
artifact = "org.eclipse.jgit:org.eclipse.jgit:5.11.0.202103091610-r",
artifact_sha256 = "b0f012105d67729a67c7fde546b6e... |
from tensorize import *
class InceptionResnetV1(Model):
def inference(self, inputs, output):
stem(inputs, outputs)
for x in xrange(4):
inceptionA()
reductionA()
for x in xrange(7):
inceptionB()
reductionB()
for x in xrange(3):
... |
"""
The temp module provides a NamedTemporaryFile that can be reopened in the same
process on any platform. Most platforms use the standard Python
tempfile.NamedTemporaryFile class, but Windows users are given a custom class.
This is needed because the Python implementation of NamedTemporaryFile uses the
O_TEMPORARY f... |
# -*- coding: utf-8 -*-
__author__ = 'xu'
import os
from functools import wraps
from flask import Flask, Blueprint, jsonify
from flask_peewee.db import Database
from flask_peewee.auth import Auth
from flask_debugtoolbar import DebugToolbarExtension
from flask_mail import Mail
from flask_login import LoginManager
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from openpyxl.worksheet.worksheet import Worksheet
COLUMNS = {"A": 20,
"B": 10,
"C": 10,
"D": 10,
"E": 10,
"F": 10,
"G": 10,
"H": 10,
"I": 10}
class RankingReportWriter(object):
... |
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
def selenium_initializer():
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument('--ignore-ssl-errors')
driver = webdriver.Chrome('../chromedriver', chrom... |
import argparse
def install(*args):
from .installer import Installer # noqa: autoimport
Installer.install(*args)
def clone(*args):
from .installer import Installer # noqa: autoimport
Installer.clone(*args)
def refresh(do_pull=False):
from .repomanager import RepoManager # noqa: autoimport... |
from datetime import date
from typing import List, Tuple, Optional
from linum.exceptions import IntersectionException
from linum.layer import Layer
from linum.task_part import TaskPart
class LayerList:
def __init__(self, layers: Optional[List[Layer]] = None):
"""
Массив слоев.
:param la... |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# 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... |
from flask import Flask
def create_app(flask_config):
app = Flask(__name__)
app.config.from_object('app.config.{}'.format(flask_config))
from app.api import api_bp
from app.client import client_bp
app.register_blueprint(api_bp)
app.register_blueprint(client_bp)
app.logger.info('>>> {}'.f... |
from vkbottle.rule import FromMe
from vkbottle.user import Blueprint, Message
from idm_lp.logger import logger_decorator
from idm_lp.database import Database
from idm_lp.utils import edit_message
user = Blueprint(
name='disable_notifications_blueprint'
)
@user.on.message_handler(FromMe(), text="<prefix:service... |
"""
Copyright (c) 2020, creatable
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
dis... |
#!/usr/bin/env python3
import argparse
import json
import jsonschema
import os
import sys
r"""
Validates the phosphor-regulators configuration file. Checks it against a JSON
schema as well as doing some extra checks that can't be encoded in the schema.
"""
def handle_validation_error():
sys.exit("Validation fail... |
import requests
from bs4 import BeautifulSoup
class API:
def __init__(self, auth):
self.auth = auth
self.api = 'https://api.playr.gg/api/enter'
self.headers = {
'Accept': "application/json, text/plain, */*",
'Accept-Encoding': "gzip, deflate, br",
'Accept... |
from django.urls import reverse
from rest_framework import status
from main.tests.api import helpers
class TestPermissions(helpers.BaseUserTestCase):
"""
Test Permissions
Get: authenticated
Update: admin
Create: admin
Delete: admin
"""
def test_get(self):
urls = [
... |
from rest_framework import serializers
from .models import Movies
class MoviesSerializer(serializers.ModelSerializer):
class Meta:
model = Movies
fields = [
'id' , 'user_main', 'title', 'director', 'acts', 'created_at'
] |
import os
INSTALLED_APPS = [
'django.contrib.staticfiles',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages', 'django.contrib.sessions',
'django.contrib.admin',
'octopus',
'test_app',
'django.contrib.sites'
]
SECRET_KEY = '1'
DEBUG = True
STATIC_URL = '/... |
# Copyright (c) 2017 Sony 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 License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: flatbuf
import flatbuffers
class Interval(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsInterval(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Interval... |
import re
from django import forms
from django.utils.safestring import mark_safe
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, UserChangeForm, ReadOnlyPasswordHashField
from .models import Profile
class UserRegisterForm(UserCreationForm):
email = forms.EmailFi... |
import sys
import os
import yaml #PyYAML must be installed
import languageSwitcher
import CPlusPlusLanguageSwitcher
import CLanguageSwitcher
import JavaLanguageSwitcher
import PythonLanguageSwitcher
from UnsupportedLanguageException import *
sys.path.append("../util")
from Util import supportedLanguages
class Langua... |
from typing import Union, Dict, List
from src.contexts.shared.domain.errors.DomainError import DomainError
class CryptoKeyInvalidValueError(DomainError):
ERROR_ID = '8fd818c5-10dc-4639-82ac-d4b37394517d'
def __init__(self, msg: str = None):
if msg is None:
msg = 'Invalid value for Crypto... |
# -*- coding: utf-8 -*-
__author__ = 'Ed Patrick Tan'
__email__ = 'pat.keeps.looking.up@gmail.com'
__version__ = '0.1.0'
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
__version__ = '1.0.1'
setup(
name='google_music_manager_auth',
python_requires=">=3",
version=__version__,
packages=find_packages(),
author="Jay MOULIN",
author_email="jaymoulin@gmail.com",
descripti... |
#
# Copyright (c) 2018 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... |
# -*- coding: utf-8 -*-
import pandas as pd
class Model():
"""Abstract model class.
This is the top-level class and should not be used directly.
Instead this class is inherited by other more specialised model classes.
"""
def __init__(self):
""
self._inputs=Inputs()
... |
"""
Component to interface with an alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel/
"""
import logging
import os
from homeassistant.components import verisure
from homeassistant.const import (
ATTR_CODE, ATTR_... |
"""
sample code for LLOCK, SLOCK, LSLOCK
application the method to advection model (periodic boundary condition)
"""
import os, sys
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sys.path.append("..")
from pyassim import KalmanFilter, LocalLOCK, SpatiallyUniformLOCK, LSLOCK,\
... |
#!/usr/bin/env python
# Copyright 2014 Boundary, 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 o... |
#! /usr/bin/env python
from Tkinter import *
from types import *
import math, random, time, sys, os
from optparse import OptionParser
# states that a request/disk go through
STATE_NULL = 0
STATE_SEEK = 1
STATE_XFER = 2
STATE_DONE = 3
# request states
REQ_NOT_STARTED = 0
REQ_DO_READ = 1
REQ_DO_WRITE = 2
# use... |
# Copyright 2018 The TensorFlow Probability 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 by applicable law o... |
import dash
import dash.testing.wait as wait
from dash_table import DataTable
import pandas as pd
import pytest
from selenium.webdriver.common.keys import Keys
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/solar.csv")
base_props = dict(
id="table",
columns=[{"name": i, "id": i} f... |
QUERY_PROCESSORS_PYPATHS = [
'addok.helpers.text.check_query_length',
"addok_france.extract_address",
"addok_france.clean_query",
"addok_france.remove_leading_zeros",
]
SEARCH_RESULT_PROCESSORS_PYPATHS = [
"addok.helpers.results.match_housenumber",
"addok_france.make_labels",
"addok.helpers.... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from .task_module_ids import TaskModuleIds
from .task_module_response_factory import TaskModuleResponseFactory
from .task_module_ui_constants import TaskModuleUIConstants
from .ui_settings import UISettings
__all__ = [
"... |
# 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 ... |
# -*- coding: iso-8859-1 -*-
""" Test script for the Unicode implementation.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import unittest, sys, string, codecs, new
from test import test_support, string_tests
# Error handling (bad decoder return)
def se... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: benchmark-dataflow.py
import argparse
import cv2
from tensorpack import *
from tensorpack.dataflow.imgaug import *
from tensorpack.dataflow.parallel import PlasmaGetData, PlasmaPutData # noqa
from tensorpack.utils.serialize import loads
import augmentors
def t... |
#!/usr/bin/env python
from hummingbot.connector.exchange_base import ExchangeBase
from hummingbot.strategy.dev_1_get_order_book import GetOrderBookStrategy
from hummingbot.strategy.dev_1_get_order_book.dev_1_get_order_book_config_map import dev_1_get_order_book_config_map
def start(self):
try:
exchange: ... |
import logging
import sys
import time
import datetime
import unittest
import spot_db
from spot_msk import SpotMsk
import json, requests
import logging, logging.config, yaml
logging.config.dictConfig(yaml.load(open('logging.conf')))
logfl = logging.getLogger('file')
logconsole = logging.getLogger('console')
logfl.de... |
import robin_stocks as r
import pandas as pd
import numpy as np
import ta as ta
from pandas.plotting import register_matplotlib_converters
from ta import *
from misc import *
from tradingstats import *
#Log in to Robinhood
login = r.login('YOUR_EMAIL','YOUR_PASSWORD')
#Safe divide by zero division function
def safe_d... |
#!/usr/bin/env python3
'''
diffinfo.py
Copyright 2012-2017 Codinuum Software Lab <http://codinuum.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/licen... |
import pandas as pd
import numpy as np
import math
import matplotlib.pyplot as plt
data = pd.read_csv("../results/master.csv")
data = pd.read_csv("../data/FoldX_predictions.csv")
x = list(data["ddG"])
y = list(data["FoldX_dGG"])
#clean # XXX:
import itertools
#lists = sorted(zip(*[x, y]))
#x, y = list(zip(*li... |
# -*- coding: utf-8 -*-
"""
Main training file for the CRF.
This file trains a CRF model and saves it under the filename provided via an 'identifier' command
line argument.
Usage example:
python train.py --identifier="my_experiment"
"""
from __future__ import absolute_import, division, print_function, unicode_lite... |
class ServiceCentre(object):
"""
An information store for each service centre in the queueing network.
Contains all information that is independent of customer class:
- number of servers
- queueing capacity
- server schedules + preemtion status
- class change matrix
"""
def _... |
"" "Este módulo implementa o objeto jogador (sprite) para o Progmind" ""
from src.animation import Animation
from src.animated_sprite import AnimatedSprite
from src.time_bonus import TimeBonus
import src.game_functions as gf
import pygame
import time
class Player(AnimatedSprite):
"""Objeto de jogador"""
def ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.