content stringlengths 5 1.05M |
|---|
import json
import json
import pandas as pd
from flask import Flask, render_template, request
app = Flask(__name__)
class Page():
def __init__(self, page_id, form_id, typetext_id, candidates, form_rect, tt_rect, v):
self.page_id = page_id
self.form_id = form_id
self.typetext_id = typetext_id
self.... |
import numpy as np
import pytest
from uddsketch import UDDSketch, _bucket_to_value, _value_to_bucket
@pytest.fixture(
params=[
[1, 2, 3, 4, 5],
[0, 0, 0, 0, 0],
[-1, -2, -3, -4, -5],
[0.01 * v for v in range(0, 1000)],
[v for v in range(0, 1000)],
[-v for v in rang... |
"""JavaScript install module provide functions to install/uninstall
a JavaScript Earth Enginemodule.
"""
import pathlib
import re
import urllib.request
import pkg_resources
def _convert_path_to_ee_sources(path: str) -> str:
"""Get the remote module path from the 'ee-sources' GCS bucket.
Args:
path:... |
# MIT License
#
# Copyright (c) 2020 Brett Graves
#
# 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,... |
# python3.5 eval.py <output_file_absolute_path> <reference_file_absolute_path>
# make no changes in this file
import os
import sys
if __name__ == "__main__":
out_file = sys.argv[1]
reader = open(out_file)
out_lines = reader.readlines()
reader.close()
ref_file = sys.argv[2]
reader = open(ref_... |
import numpy as np
from matplotlib import pyplot as plt
from scipy import signal,fft
import serial
N_FFT = 256
SAMPLE_RATE = 16e3
MEDFILT_WINDOW_SIZE = 5
def get_data(serial_obj):
line = serial_obj.readline().strip()
#print(line)
line = line.split(" ")
ts = float(line[0])
samples = np.array([floa... |
"""
Inspired from https://github.com/pytorch/pytorch/blob/master/torch/utils/data/_utils/collate.py
"""
import re
import numpy as np
import torch
from torch.utils.data._utils.collate import default_collate
from torch._six import container_abcs, string_classes
from meshreg.datasets.queries import BaseQueries, TransQuer... |
"""
This package contains modules specific to exploiting Linux kernel features or
drivers.
"""
__all__ = ['IOCTL', 'procfs', 'rtc', 'sysctl', 'Input']
|
class XORCipher:
_full_message = b""
_key_length = 0
def __init__(self, key_stream):
self.key_stream = key_stream
def apply(self, message):
message_length = len(message)
key = self.key_stream.read(message_length)
self._key_length += len(key)
self._full_message ... |
"""
Lambda handler for global giving
Author: Mindo, Aaron, Kavita, David
"""
# -*- coding: utf-8 -*-
import os
import logging
import json
from src.common.registration import Registration
from src.common.update import Update
from src.common.report import Report
from twilio.twiml.messaging_response import Body, Message... |
# Copyright 2015 OpenStack Foundation
#
# 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 ... |
"""
Inverts the images in a number of selected series and saves them in a new series, series by series and showing a progress bar.
"""
def main(weasel):
list_of_series = weasel.series() # get the list of series checked by the user
for i, series in enumerate(list_of_series): # Loop over Serie... |
from LinkedList import LinkedList
l = LinkedList(10)
print(str(l))
l.append(5)
print(str(l))
l.append(3)
print(str(l))
l.append(1)
print(str(l))
l.delete(idx=3)
print(str(l))
l.delete(idx=1)
print(str(l))
l.delete(idx=0)
print(str(l))
l.insert(idx=0, value=42)
print(str(l))
l.update(idx=0, value=21)
print(str(l))
l.up... |
import os
import requests
def download_image(url, image_name):
response = requests.get(url)
response.raise_for_status()
with open(os.path.join('images', f'{image_name}'), 'wb') as new_file:
new_file.write(response.content)
|
from ._reset_odometry import *
from ._reset_tracking import *
from ._set_led_status import *
from ._set_pose import *
from ._start_remote_stream import *
from ._start_svo_recording import *
from ._stop_remote_stream import *
from ._stop_svo_recording import *
from ._toggle_led import *
|
#! /usr/bin/env python
import os
import sys
from setuptools import setup
if sys.version_info[:2] < (2, 7):
sys.exit('mayalauncher requires Python 2.7 or higher.')
here = os.path.abspath(os.path.dirname(__file__))
# Get long description
try:
with open(os.path.join(here, 'README.rst'), 'r') as f:... |
from flask import Flask, render_template, request, flash
from flask_sqlalchemy import SQLAlchemy
from flask_bootstrap import Bootstrap
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import InputRequired
app = Flask(__name__)
app.config['SECRET_KEY'] = 'sushi'
#B... |
from functools import wraps
from ovos_workshop.skills.layers import IntentLayers
from ovos_plugin_common_play.ocp import *
from ovos_plugin_common_play.ocp.status import *
def ocp_search():
"""Decorator for adding a method as an common play search handler."""
def real_decorator(func):
# Store the flag... |
import numpy as np
class BitBuffer(object):
def __init__(self, bytesBuffer = None, size = 512, startbitnum = 3):
if bytesBuffer is None:
self.DefaultBufferSize = size
self.UnusedBitsInLastByteBitLength = startbitnum # 3个bit的起始符
self._capacity = size
self._... |
from __future__ import division
import os
import numpy as np
import pandas as pd
from time import time
import matplotlib.pyplot as plt
from astropy.io import fits
from sklearn import linear_model, preprocessing
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import train_test_split
from skl... |
#
# This file is a part of the normalize python library
#
# normalize is free software: you can redistribute it and/or modify
# it under the terms of the MIT License.
#
# normalize is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FI... |
import base64
import json
import googleapiclient.discovery
import string
import time
def process_log_entry(data, context):
data_buffer = base64.b64decode(data['data'])
log_entry = json.loads(data_buffer)
firewall_name = log_entry['jsonPayload']['resource']['name']
project_id = log_entry['resource']['l... |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... |
from datetime import datetime
from typing import Optional
from src.commands.i_stat.i_stat import ChatStatistician, ChatStat
from src.utils.cache import cache, USER_CACHE_EXPIRE
from src.utils.time_helpers import get_current_monday, get_date_monday
class RedisChatStatistician(object):
def __init__(self, chat_id: ... |
import os
from cloudmesh.common.console import Console
from cloudmesh.common.debug import VERBOSE
from cloudmesh.common.util import yn_choice
from cloudmesh.shell.command import PluginCommand
from cloudmesh.shell.command import command
from cloudmesh.shell.command import map_parameters
from cloudmesh.common.Shell impo... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.utils.module_loading import import_string
from rest_framework import serializers
from rest_framework.fields import empty
from shop.rest.serializers import (ProductSummarySerializerBase, ProductDetailSerializerB... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: update_comment.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.proto... |
from machine import CAN
import time
def sendAndCheck(dev, name, id, expectedLP=True):
dev.clear_tx_queue()
dev.clear_rx_queue()
dev.send([], id)
time.sleep_ms(100)
if dev.any() == expectedLP:
print("{}: OK".format(name))
if expectedLP:
dev.recv()
else:
print... |
# Copyright (c) Facebook, Inc. and its 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 typing import List
import pandas as pd
from llvm_autotuning.experiment import Experiment
fr... |
"""
Contains the element implement of the MAPDL database service.
This allows lower level the access to the elements in the MAPDL database.
"""
import weakref
from ansys.api.mapdl.v0 import mapdl_db_pb2
from . import DBDef, MapdlDb
class DbElems:
"""
Abstract mapdl database element class.
Examples
... |
import websocket
import threading
import json
import traceback
import time
import string
import random
class RosbridgeSetup():
def __init__(self, host, port):
self.callbacks = {}
self.service_callbacks = {}
self.resp = None
self.connection = RosbridgeWSConnection(host, port)
... |
"""Evaluate model on a holdout dataset."""
from cmlkit import load_dataset
from .evaluator import Evaluator
from .loss import get_loss
class EvaluatorHoldout(Evaluator):
"""Evaluate model on holdout set.
Trains the model on a training set, then computes the
loss for an unseen test set.
Parameters:... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Tomas Cassanelli
import pytest
import os
import numpy as np
from astropy.utils.data import get_pkg_data_filename
from numpy.testing import assert_allclose
import pyoof
# Initial fits file configuration
n = 7 # initial order
N_K... |
from mpi4py import MPI
from torch_rl.utils import to_tensor
import torch as tor
import numpy as np
class RunningMeanStd(object):
"""
https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
This is a parallel implementation in pytorch to the implementation in tensorflow... |
"""Common utilities."""
import numpy as np
def add_constant(array):
"""Add an array of ones to allow for intercept calculation by ols.fit."""
return np.c_[array, np.ones_like(array)]
|
# from Gomoku.GomokuGame import display
# print (type(display))
print (test) |
# Declaring the variables a and b
a,b = 10,5
print('Addition: ', a+b)
print('Subtraction: ', a-b)
print('Multiplication: ', a*b)
print('Division: ', a/b)
print('Modulus: ', a%b)
print('Power (Exponent): ', a**b)
print('Floor Division: ', a//b) |
#!/usr/bin/env python3
"""These scripts can be used to train and test various generative models of language."""
import os
import os.path as osp
import sys
import time
from warnings import warn
from collections import defaultdict
import numpy as np
import torch
from torch.optim import Adam, SparseAdam, RMSprop
from tor... |
#!/usr/bin/env python
# coding=utf-8
"""
Extract the IPA string from a <page> of the Svedish Wiktionary.
"""
from __future__ import absolute_import
from __future__ import print_function
import re
from baseparser import BaseParser
__author__ = "Alberto Pettarin"
__copyright__ = "Copyright 2016, Alberto Pettarin (ww... |
import numpy as np
import pandas as pd
# print('loading hard-coded data to a data frame')
# df = pd.DataFrame(
# [
# ['Jan', 58, 46, 77, 22, 2.2],
# ['Feb', 66, 48, 78, 21, 1.2],
# ['Mar', 98, 41, 97, 31, 1.5],
# ['Apr', 45, 56, 84, 27, 2.2],
# ['May', 54, 55, 79, 25, 0.0],
... |
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
from rest_framework.response import Response
from rest_framework.decorators import api_view,permission_classes
from rest_framework.permissions import IsAuthenticated
import ipfshttpclient
from .models import *
# Create your views here.
@permission_classes([IsAuthenticated])
@api_view(['POST'])
def store_file(reque... |
class Solution:
def threeSum(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
res = []
nums.sort()
for i in range(len(nums)-2):
if i > 0 and nums[i] == nums[i-1]:
continue
j = i + 1
k = len(... |
# -*- coding: utf-8 -*-
# @Time : 2020/11/23 9:40
# @Author : Zhongyi Hua
# @FileName: plugin_utils.py
# @Usage:
# @Note:
# @E-mail: njbxhzy@hotmail.com
import pandas as pd
import os
import xml.etree.ElementTree as ET
from tempfile import mktemp
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from Bio.Seq i... |
import unittest
from config.database import DATABASES
from src.masoniteorm.connections import SQLiteConnection
from src.masoniteorm.schema import Schema
from src.masoniteorm.schema.platforms import SQLitePlatform
class TestSQLiteSchemaBuilder(unittest.TestCase):
maxDiff = None
def setUp(self):
self.... |
from rest_framework import routers
from .api import BundleViewSet, TimelinesOnlyBundleViewSet
router = routers.DefaultRouter()
router.register('api/bundles', BundleViewSet, 'bundles')
router.register('api/tbundles', TimelinesOnlyBundleViewSet, 'tbundles')
urlpatterns = router.urls
|
import os
from pathlib import Path
import subprocess
from matplotlib import pyplot as plt
class SVG_WMF_Plot:
def __init__(self):
self.__folderNameGraph = 'Graphs'
self.__WMF_SVGSaving = True
self.__inkScapePath = "C://Program Files (x86)//Inkscape//bin//inkscape.exe"
self.__figur... |
# !/usr/bin/env python3
# -*-coding:utf-8-*-
# @file: tf_vs_pt_ResnetV2_50.py
# @brief:
# @author: Changjiang Cai, ccai1@stevens.edu, caicj5351@gmail.com
# @version: 0.0.1
# @creation date: 30-10-2019
# @last modified: Wed 30 Oct 2019 07:33:42 PM EDT
from __future__ import absolute_import
from __future__ import divisi... |
from .utils.loading import Loader
from .ratio import RatioEstimator
from .base import Estimator
|
# Modules
import discord, sys, asyncio, logging, traceback, time, os
from discord.ext.commands import Bot
from discord.ext import commands
from shutil import copyfile
from config.confmain import cwd, cwdmain, embedcolordark, embedcolorlight, errorcolor, superusers, check_channel, Client, initial_extensions, bot
# Che... |
from django.conf import settings
from django.conf.urls import url, include
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^multivers/', include('apps.multivers.urls', namespace='multivers')),
url(r'^grolsch/', include('app... |
from octopus.engine.engine import VMstate
class WasmVMstate(VMstate):
def __init__(self):
self.memory = []
self.stack = []
self.ssa_stack = []
self.symbolic_stack = []
self.last_returned = []
self.pc = 0
self.instr = None
self.instructions_visit... |
# coding=utf-8
"""
Missing batteries from Python
"""
from datetime import datetime
import inspect
import os
import random
from builtins import object
from past.builtins import basestring
from mock import Mock
from dateutil import parser
from pytz import utc
if hasattr(inspect, 'getfullargspec'): # pragma: nocover... |
# Copyright (C) 2021-2022, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
from typing import Tuple, Union
import numpy as np
__all__ = ["crop_boxes"]
def crop_boxes(
boxes: np.ndarray,
... |
"""pynamical core."""
import os
import matplotlib.cm as cm
import matplotlib.font_manager as fm
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from numba import jit
def get_title_font(family="Helvetica", style="normal", size=20, weight="normal", stretch="normal"):
"""
Define fonts to... |
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize
import sympy as sp
class UR5:
""" A class to calculate all the transforms and Jacobians
for the UR5 arm. Also stores the mass of each of the links."""
def __init__(self, dt=1e-5, singularity_threshold=0.005):
# ... |
import pandas as pd
from Model.CleaningData import *
from Model.blackScholes import *
data = []
labels = ['Strike', "Value Type", "Current Price", "BS Price"]
class NewDataFrame:
@staticmethod
def customDataFrame():
for x in range(len(K)):
row = (K[x], value_type[x], current_prices[x], bs... |
import unittest
from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe
class TestHarfbuzzRecipe(BaseTestForMakeRecipe, unittest.TestCase):
"""
An unittest for recipe :mod:`~pythonforandroid.recipes.harfbuzz`
"""
recipe_name = "harfbuzz"
sh_command_calls = ["./configure"]
|
from mood import Mood
import csv
from datetime import datetime
import itertools
import operator
import mood
def mood_from_row(row, mood_tags):
date_string = row[0]
try:
d = datetime.strptime(date_string, '%d %B %Y')
except ValueError as e:
return None
active_tags = [int(i) for i in row[... |
def add_path_if_main():
# if __name__ == '__main__':
import os, sys
file_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(file_path, '../'))
def output_formatter(f):
def decorated(*args, **kwargs):
# print('\n')
print('*' * 20, f, '*' * 20)
... |
# -*- coding:utf-8 -*-
# @project: BlockShuffleTest
# @filename: model
# @author: 刘聪NLP
# @zhihu: https://www.zhihu.com/people/LiuCongNLP
# @contact: logcongcong@gmail.com
# @time: 2021/9/27 10:52
"""
文件说明:
"""
from transformers import BertModel, BertPreTrainedModel
import torch
import torch.nn as nn
... |
x = "android1.mod1"
|
# Generated by Django 3.1.5 on 2021-01-09 16:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('classroom', '0001_initial'),
]
operations = [
migrations.CreateModel(
name=... |
import contextlib
from . import shader_parser
from .graphics_context import GraphicsContext
from .shader_function import ShaderFunction
class ShaderContext:
def __init__(self, shader_text):
self.function_data = {
name: data
for name, data in shader_parser.parse_functions(shader_te... |
import math
class Mars:
"""
# Mars - VSOP87 Series Version C
HELIOCENTRIC DYNAMICAL ECLIPTIC AND EQUINOX OF THE DATE
Rectangular (X,Y,Z) Coordinates in AU (Astronomical Units)
Series Validity Span: 2000 BC < Date < 6000 AD
Theoretical accuracy over span: +-1 arc sec
R*R ... |
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... |
iRecordStepsForThis = None
# sItemHitLog is just a starter, the file is ItemHitsLog.log
sItemHitLog = \
'''
tTimeEnd | iItemNumb | iHitStars
2018-03-07 20:59:24 | 132521748790 | 175
2018-03-23 21:29:45 | 401354589892 | 200
2018-03-10 11:46:09 | 372238175241 | 270
'''
#### categories for testing are in ... |
from time import sleep
def cls(): print("\n" * 100)
''' |
| +--+
A | C
F---|----E|--+
| | | D
+B-+ +--+
Starting at the only line touching the top of the diagram, it must go down,
pass through A, and continue onward to the first +.
Travel right, up,... |
"""
File containing utilities for NetworkTestCases
"""
from typing import List
import yaml
from illuminatio.host import Host
class NetworkTestCase:
"""
Class that describes a single network test case
"""
def __init__(self, from_host: Host, to_host: Host, on_port, should_connect):
if from_host... |
from yt.visualization.tests.test_mesh_slices import test_perfect_element_intersection
test_perfect_element_intersection()
|
# SIEVE OF ERATOSTHENES
# Given a number n, print all primes smaller than or equal to n.
# NOTE : Prime numbers are those which have 1 and itself has divisors.
# Algorithm:
# Create a list of all the integers up-to n that is up-to the number.
# Now mark all the elements which are divisible by 2,3,5,7.. and so on as ... |
import numpy as np
from safety_image import SafetyImage
import modules.extraction.information_field
# from modules.extraction.information_field import InformationFieldBuilder
def extract_information(image_path, fields_extraction_parameters):
extraction_results = dict()
# app_utils.clear_dir('ocr/images', '.o... |
# MF server details
mfhost = "mediaflux.vicnode.org.au"
mfport = 8443
transport = "https"
# User credentials
connect_domain = ""
connect_user = ""
connect_password = ""
|
# Camera processing unit. Based on the SOBE camera module: https://github.com/SouthEugeneRoboticsTeam/SOBE/blob/single-image/camera.py
# Made by Jackson Lewis
# Oh, did I mention this runs in a seperate thread?
import threading
import cv2
lock = threading.Lock()
camera_open = False # Check if camera is on
frames = 0
c... |
from django.contrib import admin
from .models import Post, Comment
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
"""
By using the decorator,
we still maintaining the functionality as before.
Other than that,
we're gonna customize the 'admin' (the spclass... |
from flask import request, jsonify
from flask_restplus import Resource, fields, reqparse
from api.api import api
from application.lesson.use_cases import (get_lessons_list, schedule_class,
get_available_instructors, get_lesson,
delete_l... |
import time
from peripherals import Peripherals
class State:
def routine(self) -> 'State':
pass
def enter(self) -> None:
pass
def leave(self) -> None:
pass
class StateMachine:
def __init__(self):
self.currentState = None
def set_initial_state(self, initialState:... |
from distutils.core import *
setup(
name = "BBearPythonModule", # Packed file name
version = "1.0",
ext_modules = [Extension("BBPythonModule", ["BBPythonModule.c"])] # module name and its code
) |
from twython import TwythonStreamer, TwythonStreamError
from .config import (
app_key, app_secret, oauth_token, oauth_token_secret, unittest
)
class TwythonStreamTestCase(unittest.TestCase):
def setUp(self):
class MyStreamer(TwythonStreamer):
def on_success(self, data):
se... |
#!/usr/bin/env python3
from common import *
from literals import *
import argparse
global inventory
global current_effects
####################
# not needed in FW #
# vv from here vv #
####################
parser = argparse.ArgumentParser(description='The Hacker Hotel 2020 badge adventure')
parser.add_argument("-d"... |
from ..compilation_error import CompilationError
# From Mindustry 126.2
COMPARATORS = {
"===": "strictEqual",
"==": "equal",
"!=": "notEqual",
"<": "lessThan",
"<=": "lessThanEq",
">": "greaterThan",
">=": "greaterThanEq",
"always": "always"
}
def jump_if(src_line: str) -> list:
""... |
# Copyright (c) 2016, Joseph deBlaquiere <jadeblaquiere@yahoo.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions... |
from django.urls import include, re_path
from rest_framework.routers import SimpleRouter
from .views import AddonAbuseViewSet, UserAbuseViewSet
reporting = SimpleRouter()
reporting.register(r'addon', AddonAbuseViewSet,
basename='abusereportaddon')
reporting.register(r'user', UserAbuseViewSet,
... |
"""
Remove item from a list
-----------------------
Input (int) index of removed element
default: -1
Output removed element
"""
# Remove the last element
print("Remove the last element:")
cars = ["Audi", "BMW", "Chrysler", "Dodge"]
print('Original list: {}'.for... |
""" test chemkin_io.mechparser.thermo
"""
from __future__ import unicode_literals
from builtins import open
import os
import numpy as np
import chemkin_io
def _read_file(file_name):
with open(file_name, encoding='utf8', errors='ignore') as file_obj:
file_str = file_obj.read()
return file_str
PATH =... |
import sqlite3
from sqlite3 import Error
from pathlib import Path
from Database import create_tables
def create_connection(db_file):
conn = None
try:
conn = sqlite3.connect(db_file)
print(sqlite3.version)
except Error as e:
print('DB Version' + e)
finally:
if conn:
... |
import collections
def part1():
values = [[1 if i.split(" ")[0] == "on" else 0, [[int(k) for k in j[2:].split("..")] for j in i.split(" ")[1].split(",")]] for i in open("input.txt","r").read().split("\n")][:20]
cubes = collections.Counter()
for i in values:
sign = i[0]
x0, x1 = i[1][0]
... |
from random import randint
min_num = int(input("Pick a minimum number! "))
max_num = int(input("Pick a maximum number! "))
secret_number = randint(min_num, max_num)
num_attempts = int(input("How many turns do you want? "))
while num_attempts != -1:
user_guess = int(input(
f"Try to guess the secret number,... |
# Generated by Django 3.1.5 on 2021-03-29 21:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('initiatives', '0016_auto_20210329_2117'),
]
operations = [
migrations.AlterField(
model_name='area',
name='name',
... |
import random
from donphan.utils import not_creatable
from tests.utils import async_test
from donphan import Column, Table, SQLType
from unittest import TestCase
class _TestAutomaticMigrationsTable(Table): # type: ignore
a: Column[SQLType.Text] = Column(primary_key=True)
c: Column[SQLType.Text]
class Auto... |
# Generated by Django 3.1.7 on 2021-03-22 13:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('leaderboard', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='leaderboard'... |
r,d,x=map(int,input().split())
for i in range(10):
x=X=r*x-d
print(X) |
# -*- coding: utf-8 -*-
""" Imaginary Coherence
Imaginary Coherence (*ICoh*)
Nolte, G., Bai, O., Wheaton, L., Mari, Z., Vorbach, S., & Hallett, M. (2004). Identifying true brain interaction from EEG data using the imaginary part of coherency. Clinical neurophysiology, 115(10), 2292-2307.
Chicago
"""
# Author: Avr... |
# -*- coding: utf-8 -*-
from .users import UserLogin, UserLogoutAccess, UserLogoutRefresh, UserRegistration, AllUsers, TokenRefresh
from .items import Items
__all__ = ['UserLogin', 'UserLogoutAccess', 'UserLogoutRefresh', 'UserRegistration', 'AllUsers', 'TokenRefresh',
'Items'
]
|
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
# This program accesses info from the Blue's onboard sensor, MPU9250
# It reads temp, accelerometer, gyro, and magnetometer data from the sensor.
# Uses RCPY library. See guitar.ucsd.edu/rcpy/rcpy.pdf for documentation
# Import external librarires
import time # for time.sleep funct... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
class MultiBoxLoss(nn.Module):
r"""The MultiBox Loss is used to calculate the classification loss in object detection task.
MultiBox Loss is introduce by [SSD: Single Shot MultiBox Detector](https://arxiv.org/abs/1512.02325v5) an... |
"""
The :mod:`surprise.prediction_algorithms.algo_base` module defines the base
class :class:`AlgoBase` from which every single prediction algorithm has to
inherit.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import warnings
from six import get_unbo... |
# coding=utf-8
# Created by OhBonsai at 2018/3/7
from app.app import (
create_app,
create_http_app,
create_api_app
)
|
# -*- coding: utf8 -*-
from setuptools import find_packages, setup
from pytaobao import __version__
setup(
name='pytaobao',
version=__version__,
license='PRIVATE',
author='fatelei',
author_email='fatelei@gmail.com',
url='https://github.com/fatelei/pytaobao',
description='voom backend',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.