text stringlengths 1 927k |
|---|
import os
import pandas as pd
from demo import utils
URL = r'https://ti.arc.nasa.gov/c/6/'
PWD = os.path.dirname(__file__)
def _download_data():
output = os.path.join(PWD, 'download')
utils.download(URL, output)
def _data():
path = os.path.join(PWD, 'download', 'train_FD004.txt')
if not os.path.exi... |
import numpy as np
import jax
import jax.numpy as jnp
from ttax.base_class import TT
from ttax.base_class import TTMatrix
def tensor(rng, shape, tt_rank=2, batch_shape=None, dtype=jnp.float32):
"""Generate a random `TT-Tensor` of the given shape and `TT-rank`.
:param rng: JAX PRNG key
:type rng: random stat... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listtransactions API."""
from decimal import Decimal
from io import BytesIO
from test_framewo... |
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import mmcv
import os
import torch
import warnings
from mmcv import Config, DictAction
from mmcv.cnn import fuse_conv_bn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (get_dist_info, init_dist, load_checkpoint,... |
import sys
print(sys.argv)
print(sys.argv[0]) # program name
print(sys.argv[1]) # first arg |
## Bibliotecas
import RPi.GPIO as GPIO
import time
## Modo da GPIO
GPIO.setmode(GPIO.BCM)
## Definindo os pinos usados
GPIO_TRIGGER = 6
GPIO_ECHO = 5
## Definindo entrada e saida
GPIO.setup(GPIO_TRIGGER, GPIO.OUT)
GPIO.setup(GPIO_ECHO, GPIO.IN)
def med_distancia():
## Inicio de pulso sonoro
GPIO.output(GPIO... |
# -*- coding: utf-8 -*-
class Command(object):
__command__ = None
__parent__ = None
@classmethod
def register(cls, subparsers=None):
if hasattr(cls, 'parser'):
return
if cls.__parent__:
if not hasattr(cls.__parent__, 'parser'):
cls.__parent__.re... |
import os, sys, re, time
import numpy as np
import matplotlib.pyplot as plt
import caffe
import path_params
def mynet(pycaffe_path, model_path, image_files):
start = time.time()
sys.path.insert(0, pycaffe_path)
plt.rcParams['figure.figsize'] = (10, 10)
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcPara... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from bz2 import BZ2File
from glob import glob
from io import BytesIO
from time import sleep
import itertools
import logging
import os
import re
import shutil
impor... |
#!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
"""
Google Drive (Sheets and Docs) preprocessors allow you to store content in
Google Drive and bring it into Grow. Grow will authenticate to the Google
Drive API using OAuth2 and then download content as specified in
`podspec.yaml`.
Grow supports various ways to transform the content, e.g. Sheets ... |
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... |
# -*- coding: utf-8 -*-
#
# pycares documentation build configuration file, created by
# sphinx-quickstart on Sun Jul 8 23:23:25 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |
# -*- coding:utf-8 -*-
#!/usr/bin/env python
"""
Date: 2021/4/6 15:19
Desc: 东方财富网-数据中心-新股数据-注册制审核
http://data.eastmoney.com/kcb/?type=nsb
"""
import pandas as pd
import requests
def stock_register_kcb() -> pd.DataFrame:
"""
东方财富网-数据中心-新股数据-注册制审核-科创板
http://data.eastmoney.com/kcb/?type=nsb
:return: 科创板... |
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
#!/usr/bin/env python3
#
# Copyright (c) 2021 Roberto Riggio
#
# 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... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_0
from i... |
def flatten_dict(dictionary: dict, separator: str = '/',
parent_key: str = '') -> dict:
flattened = {}
for key, value in dictionary.items():
new_key = parent_key + separator + key if parent_key else key
if isinstance(value, dict):
flattened.update(
fl... |
n = input()
ans1 = max([int(x) for x in n])
ans2 = ['' for _ in range(ans1)]
for i in n:
cnt = int(i)
for j in range(ans1):
if cnt > 0:
ans2[j] += '1'
cnt -= 1
else:
ans2[j] += '0'
print(ans1)
print(' '.join([str(int(x)) for x in ans2])) |
"""
Retrain the YOLO model for your own dataset.
"""
import numpy as np
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from yolo3.model import p... |
from tornadmin.backends.tortoise.admin import ModelAdmin
__all__ = [
'ModelAdmin',
] |
from unittest import TestCase, mock
from home_automation_framework.iot_gateway.iot_message import IotMessage
class TestIotMessage(TestCase):
test_topic = 'iot/devices/dev_001/state'
test_payload = {'state': True}
def test_class_attributes(self):
attributes = ['event', 'device_id', 'payload']
... |
from flask import Blueprint
home = Blueprint("home", __name__)
from app.home import views |
import heapq
from collections import defaultdict
def dijkstra(start, N, branches):
"""
:param start:
:param N: The number of nodes
:param branches: dictionary, branches[src_node] = [(next_node, cost)]
:return:
"""
distance_heap = [(float('inf'), i) for i in range(N)]
distance_heap[star... |
# Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS CodeStar Connections"
prefix = "codestar-connections"
class Action(BaseAction):
def __init__(self, action: str = N... |
from json import loads as json_loads, dumps as json_dumps
from urllib.parse import urlparse
import os
import ssl
import pytest
from sanic import Sanic
from sanic.exceptions import ServerError
from sanic.response import json, text
from sanic.testing import HOST, PORT
# ----------------------------------------------... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-12 13:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0014_auto_20161202_1641'),
]
operations = [
migrations.CreateM... |
import requests
from bs4 import BeautifulSoup
import sys
from pymongo import MongoClient
from requests import RequestException
sys.setrecursionlimit(1000000)
class Coinmarketcap_Rankings_spider(object):
def __init__(self):
pass
def Market_Cap_Top100_spider(self):
def clean_market_cap_data(i):... |
#!/usr/bin/env python
#
# Copyright (c) 2019, The OpenThread Authors.
# 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
# notic... |
import bpy
def showTextPopup(text, title = "", icon = "NONE"):
bpy.context.window_manager.popup_menu(getPopupDrawer(text), title = title, icon = icon)
def getPopupDrawer(text):
def drawPopup(menu, context):
layout = menu.layout
layout.label(text = text)
return drawPopup |
# Auto generated from meta.yaml by pythongen.py version: 0.9.0
# Generation date: 2021-10-25 20:23
# Schema: meta
#
# id: https://w3id.org/linkml/meta
# description: A metamodel for defining linked open data schemas
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
import sys
import re
f... |
# CONFIGURATION ---------------------------------
# Paths to a files with all your html, css, and js
# Note: They must use ONLY single quotes (') to denote strings!
source_dir = "src"
files = {
"index.html": "index_html",
"style.css": "style_css",
"rsa-utils/jsbn_1.js": "jsbn_1_js",
"rsa-utils/jsbn_2.js": "j... |
"""Demo code shows how to estimate human head pose.
Currently, human face is detected by a detector from an OpenCV DNN module.
Then the face box is modified a little to suits the need of landmark
detection. The facial landmark detection is done by a custom Convolutional
Neural Network trained with TensorFlow. After tha... |
from tri import tri,minimum
def test_tri():
tableau=[10,1,7,9,8]
tableau_attendu=[1,7,8,9,10]
assert tableau_attendu == tri(tableau)
def test_min():
tableau=[10,1,7,9,8]
minimum_attendu=1
assert minimum_attendu==minimum(tableau) |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Grey-scale style
"""
from setuptools import setup
entry_points = """
[pygments.styles]
gs = gs:GS
"""
setup(name = 'pygments-gs',
version = '0.1',
description = __doc__,
author = "Vincent",
packages = ['gs'],
entry_points = entry_points) |
"""Helper functions for using BeautifulSoup to work with FoLiA XML files.
"""
from bs4 import BeautifulSoup, Tag, NavigableString
def tag_or_string(tag):
"""Depending on the type of the input, print the tag name (for Tags) or
string (for NavigableStrings). Is used to print parts of the xml file that
were... |
# Import libnacl libs
import libnacl.secret_easy
# Import python libs
import unittest
class TestSecretEasy(unittest.TestCase):
'''
'''
def test_secret(self):
msg = b'But then of course African swallows are not migratory.'
box = libnacl.secret_easy.SecretBoxEasy()
ctxt = box.encrypt(... |
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class LinkedList(object):
def __init__(self):
self.root = None
def insert(self, node, new_node):
if self.root is None:
self... |
from __future__ import print_function
import mxnet as mx
import mxnext as X
from symbol.builder import Backbone, BboxHead, Neck, RoiAlign
from models.FPN import assign_layer_fpn, get_top_proposal
from operator_py import bbox_target
class FPNBbox2fcHead(BboxHead):
def __init__(self, pBbox):
super(FPNBbox... |
import re
import sys
import tweepy
import yaml
import xlwt
from tweepy import OAuthHandler
from textblob import TextBlob
class TwitterClient(object):
def __init__(self):
"""
Class constructor: Authentication via twitter API keys
"""
with open(r'credentials.yaml') as file:
... |
# Copyright 2021 Tianmian Tech. 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 la... |
class Mail:
def __init__(self, to="", subject="", message=""):
self.to = to
self.subject = subject
self.message = message |
print('{:*^80}'.format(" WALKING IN "))
print("AUTHOR: BU5DR1V3R , INSPIRED BY ULTRA GUO.")
print("Version -0.03, 2020/12/14")
print("Make sure that your pic is in the same folder of this .exe")
try:
from PIL import Image, ImageDraw, ImageFont
except:
print("There is no PIL found in your environment.Please ins... |
"""
- TelegramAPIError
- ValidationError
- Throttled
- BadRequest
- MessageError
- MessageNotModified
- MessageToForwardNotFound
- MessageToDeleteNotFound
- MessageIdentifierNotSpecified
- MessageTextIsEmpty
- MessageCantBeEdite... |
from flask import Blueprint, render_template, url_for
register_bp = Blueprint('register', __name__, url_prefix='/register')
@register_bp.route('/', methods=['GET', 'POST'])
def register():
return render_template('register.html')
# end register |
# coding=utf-8
from __future__ import unicode_literals
from django import forms
from models import Result
# Create your forms here.
class QueryForm(forms.ModelForm):
class Meta:
model = Result
fields = ('doc_id', 'authorList',)
def clean(self):
form_doc_id = self.cleaned_data.get('d... |
import math
def vertical_to_horizontal_fov(
vertical_fov_in_degrees: float, height: float, width: float
):
assert 0 < vertical_fov_in_degrees < 180
aspect_ratio = width / height
vertical_fov_in_rads = (math.pi / 180) * vertical_fov_in_degrees
return (
(180 / math.pi)
* math.atan(ma... |
# @date 2019-12-23
# @author Frederic Scherma, All rights reserved without prejudices.
# @license Copyright (c) 2018 Dream Overflow
# Exporter tool.
import sys
import zipfile
from datetime import datetime, timedelta
from instrument.instrument import Instrument
from common.utils import UTC, TIMEFRAME_FROM_STR_MAP, ti... |
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from ...decorators import region_permission_required
from ...models import Document, Region
@login_required
@region_permission_required
# pylint: disable=unused-argument
def delete_file(request, document_id, region_slug):... |
"""Add dataset count table.
Revision ID: 37f902020273
Revises: e7c69542157f
Create Date: 2020-03-26 14:06:54.782026
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "37f902020273"
down_revision = "e7c69542157f"
branch_labels = None
depends_on = None
def upgrad... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# This generates a map (2D false-color plot or 3D height plot) for a set of
# experiments (that are presumptively defined in some (x,y) space). The code
# assumes you've already used SciAnalysis to process your data, such that you
# have XML files in your "results" sub-folde... |
# Copyright (c) 2018 PaddlePaddle 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 app... |
#
# ExpansionHunter Denovo
# Copyright 2016-2019 Illumina, Inc.
# All rights reserved.
#
# Author: Egor Dolzhenko <edolzhenko@illumina.com>,
# Michael Eberle <meberle@illumina.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... |
#!/usr/bin/env python3
from itertools import product
import miniapps as mp
import systems
run_name = "trsm2"
system = systems.cscs["eiger"]
dlaf_build_dir = "/scratch/e1000/rasolca/DLA-Future/build"
dp_build_dir = "/scratch/e1000/rasolca/dplasma/build"
sl_build_dir = "/scratch/e1000/rasolca/slate-2020.10.00/build/"
r... |
"""{{ cookiecutter.git_project_name }} URL Configuration.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.h... |
def convert_to_int(integer_string_with_commas):
comma_separated_parts = integer_string_with_commas.split(",")
for i in range(len(comma_separated_parts)):
if len(comma_separated_parts[i]) > 3:
return None
if i != 0 and len(comma_separated_parts[i]) != 3:
return None
in... |
# FizzBuzz Python
for number in range(100):
# Create i one above 1, as we count from 0.
i = number + 1
# Create an empty string
output = ""
# Divide
if (i % 3 == 0): output += "Fizz"
if (i % 5 == 0): output += "Buzz"
# Check if output is empty
if (output == ""): output = i
# Print th... |
# Copyright 2001 by Gavin E. Crooks. All rights reserved.
# Modifications Copyright 2004/2005 James Casbon. All rights Reserved.
# Modifications Copyright 2010 Jeffrey Finkelstein. All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui.
#
# Copyright (C) 2009-2010 HDE, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of t... |
from pip.req import parse_requirements
from setuptools import setup
install_requirements = parse_requirements('./requirements.txt', session=False)
requirements = [str(ir.req) for ir in install_requirements]
setup(
name='bdj_import',
version='0.1',
description='Import data into ARPHA Writing Tool (AWT) Bio... |
from manim import *
class SquareToCircle(Scene):
def construct(self):
square = Square()
circle = Circle()
self.play(Transform(square, circle))
class SceneWithMultipleCalls(Scene):
def construct(self):
number = Integer(0)
self.add(number)
for i in range(10):
... |
import os, os.path, shutil, json, sys
from tempfile import TemporaryDirectory
try:
import IPython
from IPython.terminal.ipapp import TerminalIPythonApp
from traitlets.config import Config
except:
print("Warning: Failed to load IPython/Jupyter. Some features disabled.")
import lamb
# note: can't impo... |
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.utils import six
class AccountActivationTokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self,user,timestamp):
return (
six.text_type(user.pk) + six.text_type(timestamp) +
six.text... |
from __future__ import print_function
import math
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.utils as vutils
import matplotlib.pyplot as plt
plt.switch_backend('agg')
class TwoCropTransform:
"""Create two crops of the same image"""
def __init__(self,... |
import math
import time
import uuid
from textwrap import dedent
from jumpscale.loader import j
from jumpscale.sals.chatflows.chatflows import GedisChatBot, StopChatFlow, chatflow_step
from jumpscale.sals.reservation_chatflow import deployer, solutions
from jumpscale.sals.reservation_chatflow.models import SolutionType... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals, print_function
import math
import re
import os
import textwrap
import warnings
from collections import OrderedDict, deque
import six
from six.moves import zi... |
# 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 u... |
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# class declaration
class Element:
"""
The base class for all HTML elements
"""
# public data
tag = None # the element tag, i.e. "div", "p", "table"
attributes = None # a dictionary that maps ... |
#!/usr/bin/env python3
# The MIT License
# Copyright (c) 2016 Estonian Information System Authority (RIA), Population Register Centre (VRK)
#
# 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 ... |
from datetime import timedelta
def add(moment):
return moment + timedelta(seconds=1000000000) |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from de... |
"""
The TCP CUBIC congestion control algorithm, used in the Linux kernel since 2.6.19.
Reference:
Sangtae Ha; Injong Rhee; Lisong Xu. "CUBIC: A New TCP-Friendly High-Speed TCP Variant,"
ACM SIGOPS Operating Systems Review. 42 (5): 64–74, July 2008.
"""
from ns.flow.cc import CongestionControl
class TCPCubic(Congest... |
# Copyright 2019 Uber Technologies, 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 applica... |
import socket
import uuid
import time
import numpy as np
import select
import random
import math
import serial
def GetRange():
r = random.randint(5, 300)
print(r)
return(r)
def Buzz(msec, tone):
print("buzzing at {} hz".format(tone))
time.sleep(msec / 1000)
return
def GenerateCommandSequence... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import sys
from pathlib import Path
from posix import chmod
import setuptools
import setuptools.command.bu... |
"""
WSGI config for scheduler 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/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... |
"""
CPAchecker is a tool for configurable software verification.
This file is part of CPAchecker.
Copyright (C) 2007-2014 Dirk Beyer
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 Licen... |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
# Create your models here.
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""... |
#!/usr/bin/env python3
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""
Use this script to create a wheel with Model Optimizer code:
$ python setup.py sdist bdist_wheel
"""
import sys
import os
import re
from setuptools import setup, find_packages
from setuptools.command.install... |
"""Ledger admin routes."""
from aiohttp import web
from aiohttp_apispec import docs, querystring_schema, request_schema, response_schema
from marshmallow import fields, validate
from ..admin.request_context import AdminRequestContext
from ..messaging.models.openapi import OpenAPISchema
from ..messaging.valid import ... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DairyApp.settings')
try:
from django.core.management import execute_from_command_line
except Imp... |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/areas.py
"""This module defines a Area mixin classes
"""
__version__=''' $Id: areas.py,v 1.1 2006/05/26 19:19:38 thomas Exp $ '''
from ... |
"""Support for Habitica sensors."""
from collections import namedtuple
from datetime import timedelta
from http import HTTPStatus
import logging
from aiohttp import ClientResponseError
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.cons... |
# encoding: utf-8
"""Utilities for working with data structures like lists, dicts and tuples.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the f... |
from pydantic import BaseModel
from fastapi import APIRouter
from fastapi.responses import JSONResponse
import pymongo
import jwt
from config import db, SECRET_KEY
router = APIRouter(prefix='/api')
account_collection = db.get_collection('accounts')
game_collection = db.get_collection('games')
class Games(BaseModel):... |
# -*- coding: utf-8 -*-
#
# Chipyard documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 8 11:46:38 2019.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen... |
# Copyright 2017 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... |
#!/usr/bin/env python
#
# Public Domain 2014-2018 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... |
import asyncio
from app import create_app
app = create_app |
# SPDX-FileCopyrightText: 2018 ktown for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_htu21d`
====================================================
This is a breakout for the Adafruit HTU21D-F humidity sensor breakout.
* Author(s): ktown
Implementation Notes
--------------------
**Hardware:**
... |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 22:22
from hanlp.components.tok_tf import TransformerTokenizerTF
from hanlp.datasets.cws.ctb import CTB6_CWS_TRAIN, CTB6_CWS_DEV, CTB6_CWS_TEST
from tests import cdroot
cdroot()
tokenizer = TransformerTokenizerTF()
save_dir = 'data/model/cws_bert_albert_ctb6'... |
import os
from ._config import ROOT_DIR
from invoke import task
@task
def copyright(ctx):
""" list usage of copyright notices
The use of copyright notices should be limited to files that are likely
to be used in other projects, or to make appropriate attributions for code
taken from other proje... |
"""
Copyright 2021 Nirlep_5252_
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
d... |
from measure_personality_adult import parents_merge
from bld.project_paths import project_paths_join as ppj
# Create father data.
father_merge = parents_merge.loc[:,
['pid_parents',
'mother_sex',
'birth_year_parents',... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from layers import ImplicitGraph
from torch.nn import Parameter
from utils import get_spectral_rad, SparseDropout
import torch.sparse as sparse
from torch_geometric.nn import global_add_pool
class IGNN(nn.Module):
def __init__(self, nfeat, nhid, n... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ImportCertificateAuthorityCertificateRequestBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
... |
def verifica(l, s):
if s in l:
return True
else:
return False
l = [1, 5, 10, 20, 25]
print(verifica(l, 26)) |
# Copyright 2019 Cisco 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 agreed to in ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from onmt.models.transformer_layers import PositionalEncoding, PrePostProcessing
from onmt.models.transformer_layers import EncoderLayer, DecoderLayer
from onmt.models.transformers import TransformerEncoder, TransformerDecoder, Transformer, Transformer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.