text stringlengths 2 999k |
|---|
import network
import urequests
from machine import Pin, I2C
import ssd1306
import time
i2c = I2C(sda=Pin(4), scl=Pin(5),freq=400000)
display = ssd1306.SSD1306_I2C(128, 32, i2c)
wifi = network.WLAN(network.STA_IF)
wifi.connect('***network-name***','***password***')
display.contrast(0)
while True:
air = ureque... |
print(" +",*"+"*6,sep="---")
print("",*"Python", sep=" | ",end=" |\n")
print(" +",*"+"*6,sep="---")
print(" 0",*"123456",sep=" ")
print("-6",*"54321",sep=" -") |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import os
import re
from ifmap_global import CamelCase
def getLinkInfoType(ident, link_info):
xlink = ident.getLink(link_info)
if xlink.getXsdType():
return xlink.getCType().getName()
return 'ApiPropertyBase'
class JavaApiG... |
"""
PASSENGERS
"""
numPassengers = 3146
passenger_arriving = (
(4, 9, 11, 4, 1, 0, 3, 15, 4, 4, 2, 0), # 0
(3, 8, 8, 4, 4, 0, 11, 10, 5, 4, 3, 0), # 1
(3, 9, 9, 1, 2, 0, 2, 10, 9, 4, 1, 0), # 2
(5, 10, 7, 3, 2, 0, 5, 14, 7, 2, 3, 0), # 3
(8, 7, 2, 4, 2, 0, 3, 10, 11, 6, 1, 0), # 4
(2, 10, 11, 6, 1, 0, 4, ... |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""The afni module provides classes for interfacing with the `AFNI
<http://afni.nimh.nih.gov/afni>`_ command line tools.
Top-level namespace for afni.
"""
from .base import Info
fr... |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... |
from .downloader import PunkType#, PunkMetadata, PunkType, Acccessory, get_all_metadata, get_punks
from .flow import generate_images
from .image_options import ImageOptions |
# coding=utf-8
# Copyright 2019 The Tensor2Tensor 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... |
from flask import render_template, url_for, redirect, request, flash
from ..models import User
from . import auth
from .. import db
from .forms import LoginForm, RegistrationForm, ChangePasswordForm, \
PasswordResetRequestForm, PasswordResetForm, ChangeEmailForm
from flask.ext.login import login_user, login_require... |
import torch
import torch.nn.functional as F
import torchvision
from torchvision import transforms
import os
import numpy as np
import time
from src import utils as ut
from sklearn.metrics import confusion_matrix
import skimage
from src import wrappers
from torchvision import transforms
from haven import haven_utils a... |
"""Tests for tapo api."""
import asyncio
import aiohttp
from custom_components.tapo.api import (
TapoApiClient,
)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
async def test_api(hass, aioclient_mock, caplog):
"""Test API calls."""
# To test the api submodule, we first create ... |
# 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 agreed to in... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from mutant.db.fields.generic import FieldDefinitionTypeField
class Migration(migrations.Migration):
dependencies = [
('mutant', '0001_initial'),
('contenttypes', '0001_initial'),
]
... |
# coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose Pty Ltd" file="EmailLoadOptions.py">
# Copyright (c) 2003-2019 Aspose Pty Ltd
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
... |
import piquant.statistics as statistics
import piquant.tpms as t
import numpy as np
import pandas as pd
import scipy.stats as scistats
import test_tpms
def _get_test_tpms():
tpms = pd.DataFrame.from_dict({
t.REAL_TPM: test_tpms.REAL_TPMS_VALS,
t.CALCULATED_TPM: test_tpms.CALC_TPMS_VALS,
te... |
import torch.optim as optim
from scipy.linalg import block_diag
# from stpredictions.models.DIOKR.cost import *
# from stpredictions.models.DIOKR.kernel import *
from stpredictions.models.DIOKR.IOKR import *
dtype = torch.float
class DIOKREstimator(object):
"DIOKR Class with fitting procedure using pytorch"
... |
from ..appear.schema import namespaces
print(namespaces.generate_schema())
|
# -*- coding: utf-8 -*-
"""
Module for functional test '02_settings' of gitcache.
Copyright:
2022 by Clemens Rabe <clemens.rabe@clemensrabe.de>
All rights reserved.
This file is part of gitcache (https://github.com/seeraven/gitcache)
and is released under the "BSD 3-Clause License". Please see the ``... |
words = []
word = str(input("Enter a word: "))
while len(word)!=0:
words.append(len(word))
word = str(input("Enter a word: "))
print(f"The average length is {sum(words)/len(words)}") |
"""
Presets for the ffmpeg manager
"""
# video
MP4_VIDEO = {'format':'mp4',
'vcodec':'mpeg4',
'qmin':'3',
'qmax':'5',
'g':'300',
'bitrate':'700k',
'vf':'"scale=-1:360"',
}
MP4_AUDIO =... |
from __future__ import unicode_literals
__version__ = '2020.12.31'
|
import logging
import os
import socket
import sys
import threading
from client_connection import PeerConnectionThread, TrackerConnectionThread
from pathlib import Path
from db_operations import DataBase
from models.peer_info import PeerInfo
from peer import Peer
from models.product import Product
from tracker import Tr... |
import os
from flake8.api import legacy as f8
import re
heredir = os.path.abspath(os.path.dirname(__file__))
unit_test_directory = os.path.join(heredir, '../unit')
code_directory = os.path.join(heredir, '../../eventslib')
def flake8_examine(file_location):
style_guide = f8.get_style_guide()
result = style_gu... |
import theano.tensor as tt
import numpy as np
from ..distributions import Normal, Flat
from . import families
from ..model import Model, Deterministic
from .utils import any_to_tensor_and_labels
__all__ = [
'LinearComponent',
'GLM'
]
class LinearComponent(Model):
"""Creates linear component, y_est is ac... |
CORRECT_LOGIN_USERNAME = "test_user"
CORRECT_LOGIN_PASSWORD = "test_password"
CORRECT_SECRET = "secret_password"
CORRECT_NETWORK_IP = "127.0.0.1"
CORRECT_CIDR = "32"
CORRECT_NETWORK_DEVICE_OS = "Test OS"
ADD_ACCESS_CONFIG = "Add"
FIELD_REQUIRED = "This field is required."
ENTER_VALID_IP = "Enter a valid IPv4 or IPv6 a... |
"""URLs for the UI to initiate TA2 calls"""
from django.conf.urls import url
from tworaven_apps.ta3_search import views
urlpatterns = (
# - This endpoint is for the flask app to register as a listener
#
url(r'^register-listener$',
views.view_register_listener,
name='view_register_listene... |
import os, re, decimal
from functools import partial
import matplotlib.pyplot as plt
# 1st: same
edge_tag = 'num of edges'
prune0_tag = 'prune0 definitely not reachable'
prune1_tag = 'prune1 definitely reachable'
# 2nd: different
intersect_tag = 'intersection times'
cmp0_tag = 'cmp0'
cmp1_tag = 'cmp1'
cmp_equ_tag = ... |
# -*- coding: utf-8 -*-
# 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 Apach... |
# MIT License
#
# Copyright (c) 2020 Jonathan Zernik
#
# 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, mer... |
import random
import string
import traceback
from tests.cephfs.cephfs_utilsV1 import FsUtils
from utility.log import Log
log = Log(__name__)
def run(ceph_cluster, **kw):
"""
pre-requisites:
1. Create cephfs subvolumegroup
2. Create cephfs subvolume in subvolume group with default permission
3. C... |
# Generated by Django 3.2.6 on 2021-08-30 16:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publish', '0004_news_click'),
]
operations = [
migrations.AlterField(
model_name='news',
name='click',
f... |
from magicclass import magicclass, magicmenu, MagicTemplate, field, vfield
from unittest.mock import MagicMock
import pytest
def test_simple_callback():
mock_x = MagicMock()
mock_y = MagicMock()
@magicclass
class A(MagicTemplate):
x = field(int)
y = vfield(str)
@x.... |
from kao_decorators import lazy_property
import re
class RegexHelper:
""" Helper class to cleanup usage of the regex string """
def __init__(self, originalRegEx, dependencyHelper):
""" Initialize the Helper with the string """
self.originalRegEx = originalRegEx
self.depend... |
# 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 ... |
import time
ens=[]
chargelist=[]
waitlist=[]
totaltime=totalnum=winddis=0
class en:
def __init__(self,occur,types,ps):
self.occur=occur
self.types=types
self.ps=ps
@staticmethod
def cmp(x):
return x.occur
@staticmethod
def find(insid):
for inde... |
#
# ElGamal.py : ElGamal encryption/decryption and signatures
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warrant... |
import torch
from torch import nn
from .base import Flow
from .affine_coupling import AffineCouplingBlock
from .mixing import Invertible1x1Conv
from .normalization import ActNorm
from .. import nets
class GlowBlock(Flow):
"""
Glow: Generative Flow with Invertible 1×1 Convolutions, arXiv: 1807.03039
One ... |
# 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 ... |
import random
from sanic import Sanic
from sanic.response import json
try:
from ujson import loads
except ImportError:
from json import loads
def test_storage():
app = Sanic('test_text')
@app.middleware('request')
def store(request):
request['user'] = 'sanic'
request['sidekick']... |
"""Tests suite for `qvpnstatus`."""
from pathlib import Path
TESTS_DIR = Path(__file__).parent
TMP_DIR = TESTS_DIR / "tmp"
FIXTURES_DIR = TESTS_DIR / "fixtures"
|
# 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 ... |
import requests
import json
from pathlib import Path
class _networkCalc():
apiAddress = "https://networkcalc.com/api"
def __init__(self, ca=None, requestTimeout=15):
self.requestTimeout = requestTimeout
if ca != None:
if type(ca) is str:
self.ca = str(Path(ca))
... |
import asyncio
import os
import sys
import asyncio
import json
from botocore.config import Config as BotoCoreConfig
from aiobotocore.session import get_session
from gzip_stream import AsyncGZIPDecompressedStream
import re
from .sentinel_connector_async import AzureSentinelConnectorAsync
import time
import aiohttp
impor... |
from scipy.signal import butter, lfilter
import numpy as np
import librosa
from scipy import signal
import warnings
import matplotlib.pyplot as plt
### General
def int16tofloat32(data):
return np.array(data / 32768).astype("float32")
def norm(x, _type="zero_one"):
return (x - np.min(x)) / (np.max(x) - np.min... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... |
from tkinter import *
from PIL import ImageTk, Image
import tkinter.messagebox
import random
import time
rt = 1
point = 0
loop = 0
def game(player1, mainwindow):
global point
timer = time.time()
window = Toplevel(mainwindow)
window.geometry("600x200")
p1 = PhotoImage(file='./turtl... |
"""
MIT License
Copyright (c) 2020-2021 cyrus01337, XuaTheGrate
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, ... |
'''
TFANN.py
This file contains classes implementing ANN using numpy
and tensorflow. Presently, multi-layer perceptron (MLP)
and convolutional neural networks (CNN) are supported.
'''
import tensorflow as tf
import numpy as np
def _Accuracy(Y, YH):
'''
Return the classification accuracy
given a vector of... |
# -*- coding: utf-8 -*-
from sqlalchemy import Column, String, DateTime, Enum, Float
from zvt.domain.common import Provider, enum_value, MacroBase
class GDP(MacroBase):
__tablename__ = 'gdp'
id = Column(String(length=128), primary_key=True)
provider = Column(String(length=32))
timestamp = Column(Dat... |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... |
# numpyとmatplotlibのpyplotというモジュールを使う
import numpy as np
import matplotlib.pyplot as plt
# データの作成
x = np.arange(0, 6, 0.1) # 0から6まで0.1刻みで生成
y1 = np.sin(x)
y2 = np.cos(x)
# グラフの描画
# plt.plot(x, y)
# plt.show()
# 複雑なグラフの描画
plt.plot(x, y1, label='sin')
plt.plot(x, y2, linestyle = '--', label='cos') # 破線
plt.xlabel('x')
... |
from setuptools import setup, find_packages
import codecs
import os
here = os.path.abspath(os.path.dirname(__file__))
#with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
# long_description = "\n" + fh.read()
VERSION = '0.0.2.1.4.3'
DESCRIPTION = 'Computes details of solution for modeling p... |
#! -*- coding: utf-8 -*-
# 自定义层
import numpy as np
import tensorflow as tf
from bert4keras.backend import keras, K
from bert4keras.backend import sequence_masking
from keras import initializers, activations
from keras.layers import *
def integerize_shape(func):
"""装饰器,保证input_shape一定是int或None
"""
def con... |
from flask import Flask,render_template,request,session,redirect,url_for,jsonify,json
from pymongo import MongoClient
from functools import wraps
import time
_app = Flask(__name__)
_client = MongoClient()
_db = _client["fact"]
_recipe = _db["recipe"]
_item = _db["item"]
_app.secret_key = "PLACEHOLDER"
#will be hidd... |
import pygame.font
from pygame.sprite import Group
from ship import Ship
class Scoreboard:
"""A class to report score information"""
# ai game access setting, screen and stats objects
def __init__(self, ai_game):
"""Initialize score keeping attributes"""
# access main game
... |
# Copyright (c) 2020-2021, NVIDIA 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 applicable law or agree... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class MemcachedLayer(pulumi.CustomRes... |
from enum import Enum
class PassportType(Enum):
USER = 1
PHONE = 2
EMAIL = 3
@staticmethod
def get_string(x):
return ['user', 'phone', 'email'][x.value - 1]
@staticmethod
def get_passport_type(x: str):
return {'user': PassportType.USER, 'phone': PassportType.PHONE, 'emai... |
import shelve
import librosa
import subprocess
d = shelve.open("data")
good_list=[]
def run(cmd, shell=True):
return subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=shell).communicate()[0]
files_in = run("ls tester/*.flac").split()[:-1]
files_out = run("ls tester/*.mp3").split()[:-1]
print files_in
print files_... |
import re
import os
import sys
from datetime import datetime, timedelta, timezone
from getpass import getpass
from pynus.utils import progress, webbrowser
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep, time
MYCLASS_INDEX = 'https://myclass.apps.... |
#!/usr/bin/python3
# -*- encoding: utf-8 -*-
'''
@File : 8-a.py
@Time : 2019/11/14
@Author : Iydon Liang
@Contact : liangiydon@gmail.com
@Docstring : <no docstring>
'''
from os import get_terminal_size
columns = get_terminal_size().columns
from sympy import symbols, integrate, diff, exp, sqrt, log
from... |
from __future__ import absolute_import
from __future__ import unicode_literals
from git_code_debt.metrics.base import SimpleLineCounterBase
class TODOCount(SimpleLineCounterBase):
def line_matches_metric(self, line, file_diff_stat):
return b'TODO' in line
|
from datetime import datetime
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
Int64Index,
Series,
bdate_range,
date_range,
to_datetime,
)
import pandas._testing as tm
from pandas.tser... |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
class IAMErrors(object):
"""
An enum class to manually handle errors in IAM integrations
:return: None
:rtype: ``None``
"""
BAD_REQUEST = 400, 'Bad request - failed to perform operation'
USE... |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from setuptools import setup
VERSION_TEMPLATE = """
# Note that we need to fall back to the hard-coded version if either
# setuptools_scm can't be imported or setuptools_scm can't determine the
# version, so we catch the... |
# This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2020 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
"""
User configuration.
"""
import os
from pathlib import Path
import configparser
from urllib.parse import unquote_plus, urlparse, parse_qsl
f... |
from typing import Counter
with open("day_14/input.txt") as file:
molecule = list(file.readline().strip())
file.readline() # Blank line
RULES = dict(line.strip().split(" -> ") for line in file.readlines())
STEPS = 10
for _ in range(STEPS):
new_molecule = []
prev_element = "-"
for element i... |
# tests for lab05, UCSB, CMPSC 8, Spring 2018
# Instructor: P. Conrad
# Student(s): (insert name here)
# @@@ This next function has an error. Can you fix it?
# @@@ Hint: you might need to use the "and" or "or" keywords of python
# @@@ and modify the if test.
def notStringContainingE(word):
"""
return True when... |
from app.constants import FAKE_GPIO
from statemachine import StateMachine, State, Transition
class Relay(StateMachine):
def __init__(self, pin_number):
super().__init__()
self.add(State('high'))
self.add(State('low', is_starting_state=True))
self.add(Transition('high', ['low'], aft... |
from os.path import basename as _basename
form_name=_basename(__file__).split('.')[0].split('_')[-1]
is_form = {
'gpickle': form_name,
'gpickle.gz': form_name
}
def to_native_Network(item):
from ..classes.api_networkx_Graph import to_native_Network as _networkx_Graph_to_native_Network
tmp_form_au... |
import sys
sys.path.insert(0, "/var/www/vhost/skillvet.nms.kcl.ac.uk/public")
from app import app as application
|
# Copyright 2016 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 json
import logging
import webapp2
from google.appengine.api import taskqueue
from appengine_module.test_results.handlers import util
from appengine... |
"""Commands part of Websocket API."""
import asyncio
import voluptuous as vol
from homeassistant.auth.permissions.const import CAT_ENTITIES, POLICY_READ
from homeassistant.bootstrap import SIGNAL_BOOTSTRAP_INTEGRATONS
from homeassistant.components.websocket_api.const import ERR_NOT_FOUND
from homeassistant.const impo... |
"""Wrapper class for DNS actions"""
class ZoneController(object):
def __init__(self, zone):
"""Initialize zone controller given a zone"""
self.zone = zone
def create_zone(self, **kwargs):
"""Create a zone under the specific cloud"""
return self.zone.cloud.ctl.dns.create_zone(... |
#!/usr/bin/env python
"""Downloads and parses various Entrez databases."""
import sys
import time
import argparse
from argparse import RawDescriptionHelpFormatter as Raw
from logging import INFO, DEBUG
from datetime import datetime
import pymongo
from mongoengine import connect
from sramongo import (
parsers_sra_... |
import ipywidgets as widgets
import xml.etree.ElementTree as ET # https://docs.python.org/2/library/xml.etree.elementtree.html
import os
import glob
import shutil
import math
import datetime
import tempfile
from about import AboutTab
from config import ConfigTab
from user_params import UserTab
from svg import SVGTab
f... |
"""
Augmenters that apply color space oriented changes.
Do not import directly from this file, as the categorization is not final.
Use instead
`from imgaug import augmenters as iaa`
and then e.g. ::
seq = iaa.Sequential([
iaa.Grayscale((0.0, 1.0)),
iaa.AddToHueAndSaturation((-10, 10))
])
... |
class Solution(object):
def largestAltitude(self, gain):
"""
:type gain: List[int]
:rtype: int
"""
# Runtime: 16 ms
# Memory: 13.3 MB
height = 0
highest = 0
for g in gain:
height += g
highest = max(height, highest)
... |
# Copyright (c) 2019 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for details.
# GENERATED FILE... |
# Copyright 2019 - 2020 DarkPrinc3
# 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 ... |
def indeterminados_posicion(*args):
# print(args)
for arg in args:
print(arg)
indeterminados_posicion(5,"hola a todos", [1,2,4])
def indeterminados_nombre(**kwargs):
# print(kwargs)
for kwarg in kwargs:
print("clave: {}, valor: {}".format(kwarg,kwargs[kwarg]))
indeterminados_nombre(n... |
# Generated by Django 2.0 on 2018-08-30 20:05
import apps.common.functions
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('objects', '0022_auto_20180830_1015'),
]
operations = [
migrations.AlterField(
... |
import requests
from config import *
import sched, time,datetime,requests
from pyrogram import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton
def Bot(method,data):
url = "https://api.telegram.org/bot{}/{}".format(TOKEN,method)
post = requests.post(url,data=data)
#print(post.json())
... |
from day03.script1 import parse
def solve(moves):
houses = [[0, 0]]
pos_santa = [0, 0]
pos_robot = [0, 0]
i = 0
while i < len(moves):
# move santa
pos_santa = [pos_santa[0] + moves[i][0], pos_santa[1] + moves[i][1]]
if pos_santa not in houses:
houses.append(pos_... |
from common.numpy_fast import clip, interp
from selfdrive.car.nissan import nissancan
from opendbc.can.packer import CANPacker
# Steer angle limits
ANGLE_MAX_BP = [1.3, 10., 30.]
ANGLE_MAX_V = [540., 120., 23.]
ANGLE_DELTA_BP = [0., 5., 15.]
ANGLE_DELTA_V = [5., .8, .15] # windup limit
ANGLE_DELTA_VU = [5., 3.5, 0... |
from django.apps import AppConfig
class PullupConfig(AppConfig):
name = 'pullup'
|
from .create_db import db
class CompoundETH(db.Model):
__tablename__ = 'compound'
id = db.Column('id', db.Integer, primary_key=True)
blocknumber = db.Column('blocknumber', db.Integer)
timestamp = db.Column('timestamp', db.Integer)
price = db.Column('price', db.Float)
def __repr__(self):
... |
from AbstractObject import *
class EOFObject(AbstractObject):
def __init__(self, value):
super(EOFObject, self).__init__(value)
def generate(self, out_code): pass
|
from keras.models import Model
from keras.layers import Dense, ZeroPadding2D, BatchNormalization, Conv2D, MaxPooling2D, Activation, Input, Concatenate
from keras.optimizers import RMSprop
from layers.SpatialPyramidPooling import SpatialPyramidPooling
from keras.applications.resnet50 import identity_block, conv_block
... |
# -*- coding: utf-8 -*-
'''
Functions used for CLI argument handling
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import fnmatch
import inspect
import logging
import re
import shlex
# Import salt libs
from salt.exceptions import SaltInvocationError
from... |
# coding=utf-8
# Copyright 2020 The Trax 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 or a... |
import numpy.testing as npt
import volpy
import unittest
class BBoxTestCase(unittest.TestCase):
def setUp(self):
self.bbox = volpy.BBox([[1, 1, 1, 1],
[5, 5, 5, 1]])
def test_transform1(self):
result = self.bbox.transform().dot(self.bbox.corners[0])
... |
import json
import time
import logging
from datetime import datetime
from dataclasses import dataclass
from src.config_loader import ConfigLoader
from src.ochoba_api_wrapper import OchobaApiWrapper
TJ_POSTS_DIR = "/home/cyrus/Personal/blog/osnova_social/data/tj_data/posts"
VC_POSTS_DIR = "/home/cyrus/Personal/blog/os... |
# Distributed with a free-will license.
# Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
# TSL2561
# This code is designed to work with the TSL2561_I2CS I2C Mini Module available from ControlEverything.com.
# https://www.controleverything.com/content/Light?sku=TSL... |
import bpy
from __future__ import print_function
DATA = bpy.data
outputFolder= "\\data\\OUTPUT.csv"
for clip in DATA.movieclips:
width=clip.size[0]
height=clip.size[1]
for object in clip.tracking.objects:
for track in object.tracks:
file_name = outputFolder
... |
import paddle.fluid as fluid
def bilstm_net(data, dict_dim, class_dim, emb_dim=128, hid_dim=128, hid_dim2=96, emb_lr=30.0):
# embedding layer
emb = fluid.layers.embedding(input=data,
size=[dict_dim, emb_dim],
param_attr=fluid.ParamAttr(learning... |
import datetime
import os
import random
import time
import requests
from lxml import etree
from selenium import webdriver
# import config
import threading
# import numpy as np
mUA_list = [
'Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_1 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Version/11.0 Mobile/15C153... |
"""
copied and modified from https://github.com/HobbitLong/CMC
"""
from __future__ import print_function
import os
import sys
import time
import torch
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
import argparse
import torch.multiprocessing as ... |
#!/usr/bin/env fuchsia-vendored-python
# Copyright 2019 The Fuchsia 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 argparse
import json
import platform
import os.path
import subprocess
import sys
HOST_PLATFORM = "%s-%s" % (
... |
from malcolm.modules.builtin.parts import StatefulChildPart
from malcolm.modules.scanning.controllers import RunnableController
from malcolm.modules.ADCore.infos import NDArrayDatasetInfo, UniqueIdInfo
class FemDriverPart(StatefulChildPart):
# Only need to report that we will make a dataset, top level will do all... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.