content stringlengths 5 1.05M |
|---|
from ApiObject import *
class connect(ApiObject):
def __init__(self):
super(connect, self).__init__()
self.uri = self.uri + "/<username>/<password>"
def get(self, **url_params):
return super(connect, self).get()
def on_get(self, **url_params):
content = self.db_servic... |
import unittest
import json
from bitmovin import Bitmovin, Response, S3Input
from bitmovin.errors import BitmovinApiError
from tests.bitmovin import BitmovinTestCase
class S3InputTests(BitmovinTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
@classmethod
def tearDownClass(cl... |
from ipaserver.plugins.user import user
from ipalib import Bytes, _
user.takes_params += (
Bytes(
'jpegphoto?',
cli_name='avatar',
label=_("Avatar"),
doc=_("Base-64 encoded user picture (jpegphoto)"),
maxlength=100 * 1024, # max 100 kB
),
)
|
from Constant import PARAM_MAX_DELTAS, STATUS_CODES
def is_there_a_spike(sensor_reading, next_sensor_reading, max_delta):
if next_sensor_reading - sensor_reading > max_delta:
return True
return False
def detect_spike_in_sensor_stream(param_name, sensor_stream):
max_delta = PARAM_MAX_DELTAS[param... |
"""qp is a library for manaing and converting between different representations of distributions"""
import os
from .version import __version__
from .spline_pdf import *
from .hist_pdf import *
from .interp_pdf import *
from .quant_pdf import *
from .mixmod_pdf import *
from .sparse_pdf import *
from .scipy_pdfs impor... |
__all__ = ['OnnxTranspose']
from typing import List
from typing import Optional
import torch
from torch import nn
from onnx2torch.node_converters.registry import add_converter
from onnx2torch.onnx_graph import OnnxGraph
from onnx2torch.onnx_node import OnnxNode
from onnx2torch.utils.common import OnnxMapping
from on... |
import collections
from typing import List
from test_framework import generic_test
PairedTasks = collections.namedtuple('PairedTasks', ('task_1', 'task_2'))
def optimum_task_assignment(task_durations: List[int]) -> List[PairedTasks]:
# TODO - you fill in here.
return []
if __name__ == '__main__':
exit... |
"""Cadence bin.
Author: Jose Vines
"""
import numpy as np
def cadence_bin(times, data, dt):
"""Bins timeseries data with cadence dt.
Parameters:
-----------
times : array_like
The times to bin in cadence dt.
data : array_like
Data corresponding to time times.
dt : float
... |
from ...core.utils.py3 import textstring
from ...core.devio import SCPI, backend #@UnresolvedImport
_depends_local=["...core.devio.SCPI"]
class LM500(SCPI.SCPIDevice):
"""
Cryomagnetics LM500/510 level monitor.
Channels are enumerated from 1.
To abort filling or reset a timeout, call :meth:`.SCPIDe... |
import functools
import logging
import numbers
import sys
import weakref
import warnings
from typing import List, Tuple, Set, Callable, Optional, Any, cast, Union, Dict, Mapping, NamedTuple, Iterable,\
Collection, Sequence
from collections import OrderedDict
import numpy as np
from qupulse import ChannelID
from q... |
from plustutocenter.controller.concretecontroller import ConcreteController
from plustutocenter.qt.view_qt import ViewQt
controller = ConcreteController()
controller.setView(ViewQt(controller))
controller.startApp()
|
ls = []
for i in range(10_000_000):
ls.append(i)
|
import pkg_resources
try:
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
__version__ = 'unknown'
import logging
logging.addLevelName(5, "TRACE")
logging.TRACE = 5
logging.Logger.trace = lambda self, msg, *args, **kwargs: \
self.log(logging.TRACE,... |
from __future__ import absolute_import
import argparse
from datetime import datetime
import logging
import Queue
import sys
import time
import threading
import uuid
import boto3
import msgpack
import strongfellowbtc.constants as constants
import strongfellowbtc.hex
from strongfellowbtc.protocol import ds256
import ... |
# -*- coding: utf-8
from django.apps import AppConfig
class PublishableModelConfig(AppConfig):
name = 'publishable_model'
|
"""
Funtion Generates the mutiplication tables
"""
def multiplication_tables_generator(times: int, min: int, max: int) -> list:
"""
>>> multiplication_tables_generator(2, 1, 10)
['1 x 2 = 2', '2 x 2 = 4', '3 x 2 = 6', '4 x 2 = 8', '5 x 2 = 10', '6 x 2 = 12', '7 x 2 = 14', '8 x 2 = 16', '9 x 2 = 18', '10 x... |
from datetime import date
from django.contrib.auth.models import User, AbstractUser, UserManager
from django.db import models
from django.utils.translation import gettext_lazy as _
from .validators import validate_born_date
class CustomUserManager(UserManager):
def create_superuser(self, username, email, passwo... |
def from_h5(item, trajectory_item=None, atom_indices='all', frame_indices='all'):
from molsysmt.forms.api_h5 import to_mdtraj_Topology as h5_to_mdtraj_Topology
from molsysmt.native.io.topology import from_mdtraj_Topology as mdtraj_Topology_to_molsysmt_Topology
tmp_item = h5_to_mdtraj_Topology(item)
... |
"""
动态信息
"""
import json
import os
import re
from functools import partial
from shutil import rmtree
import numpy as np
import pandas as pd
from logbook import Logger
from odo import odo
from cswd.common.utils import data_root, ensure_list
from cswd.sql.constants import MARGIN_MAPS
from .base import STOCK_DB, bcolz_... |
version_info = (2, 8, 0)
__version__ = ".".join([str(v) for v in version_info])
|
from sys import maxsize
class User:
def __init__(self, firstname=None, lastname=None, address1=None, postcode=None, city=None, email=None, phone=None, password=None, id=None):
self.firstname = firstname
self.lastname = lastname
self.address1 = address1
self.postcode = postcode
... |
#!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtkcenterlinemerge.py,v $
## Language: Python
## Date: $Date: 2005/09/14 09:49:59 $
## Version: $Revision: 1.4 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is d... |
import math
import wave
import struct
# https://stackoverflow.com/questions/33879523/python-how-can-i-generate-a-wav-file-with-beeps
import librosa
import matplotlib.pyplot as plt
import librosa.display
'''
# sr == sampling rate
x, sr = librosa.load("tensorsong.wav", sr=44100)
# stft is short time fourier transform... |
from __future__ import absolute_import
from __future__ import unicode_literals
from identify import identify
UNKNOWN = 'unknown'
IGNORED_TAGS = frozenset((
identify.DIRECTORY, identify.SYMLINK, identify.FILE,
identify.EXECUTABLE, identify.NON_EXECUTABLE,
identify.TEXT, identify.BINARY,
))
ALL_TAGS = froze... |
import logging.config
import sys
from .base import * # NOQA
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATES[0]['OPTIONS'].update({'debug': True})
TIME_ZONE = 'UTC'
STATIC_ROOT = str(ROOT_DIR.path('staticfiles'))
STATIC_URL = '/staticfiles/'
FAVICON_PATH = STATIC_URL + 'dist... |
import itertools as it
import datetime as dt
from dateutil import relativedelta as rd
from trading_calendars import trading_calendar as tc
from trading_calendars.errors import (
CalendarNameCollision,
CyclicCalendarAlias,
InvalidCalendarName
)
from trading_calendars.always_open import AlwaysOpenCalendar
... |
"""A package for already-implemented machine learning Siamese architectures.
"""
from dualing.models.contrastive import ContrastiveSiamese
from dualing.models.cross_entropy import CrossEntropySiamese
from dualing.models.triplet import TripletSiamese
|
from random import randrange
#
from UnionFind_QuickFind import UnionFind
test_size = 12
uf = UnionFind( test_size )
uf.enumerate()
while 1 < uf.g :
uf.union( randrange( test_size ), randrange( test_size ) )
uf.enumerate()
|
from keras.utils.np_utils import to_categorical
import os
import cv2
import numpy as np
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers.convolutional import Conv2D
from keras.l... |
from __future__ import absolute_import
from .suites import NAMED_SUITES
from .loggers import NAMED_LOGGERS
|
from functools import cache
from itertools import product
def parse_data():
with open('2021/21/input.txt') as f:
data = f.read()
return [int(line.rsplit(maxsplit=1)[1]) for line in data.splitlines()]
def part_one(data):
data = data.copy()
scores = [0, 0]
pi = 1
rolls = 0
def ro... |
class Moon:
def __init__(self, x, y, z):
self.position = [x, y, z]
self.velocity = [0, 0, 0]
def update_velocity(self, other):
for i in range(3):
self.update_velocity_for_axe(other, i)
def update_velocity_for_axe(self, other, axe):
if self.position[axe] < other.... |
#!/bin/env python
import fitsio, numpy as np, json
import esutil as eu
from shear_stacking import *
from sys import argv
from multiprocessing import Pool, current_process, cpu_count
from glob import glob
import pylab as plt
def getValues(s, key, functions):
# what values are used for the slices: functions are di... |
from simit_services.celery import app
from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
@app.task
def asinc_mail(list_emails=[], subject='NO SUBJECT', template=None, content_data=None):
sender = "SIMIT SERVICES <infomercadigital@gmail.com>"
merge_data = ... |
import numpy
import matplotlib.pyplot as plt
from decimal import Decimal
from scipy import integrate
from scipy.interpolate import InterpolatedUnivariateSpline
# одномерная кусочно-линейная интерполяция функции, которая задана точками (xp, fp).
# Table1
masI = [0.5, 1, 5, 10, 50, 200, 400, 800, 1200]
m... |
class DataRow(dict):
"""object for holding row of data"""
def __init__(self, *args, **kwargs):
"""creates instance of DataRow"""
super(DataRow, self).__init__(*args, **kwargs)
self.target_table = None
def row_values(self, field_names, default_value=None):
"""returns row v... |
import unittest
from daps.utils.video import count_frames, duration, frame_rate
class test_video(unittest.TestCase):
def setUp(self):
self.video = 'data/videos/example.mp4'
self.video_dir = 'data/videos/example'
def test_count_frames(self):
filename = 'not_existent_video.avi'
... |
import numpy
print("Hello World 4") |
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adam
from torch_geometric.nn import GCNConv
from datasets import get_planetoid_dataset
class GCN(nn.Module):
def __init__(self, dataset, nhid, dropout):
super(GCN, self).__init__()
self.gc1 = GCNConv(dataset.num_feature... |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from traitlets import Bool, Tuple, List
from .utils import setup, teardown
from ..widget import Widget
# A widget with simple traits
class SimpleWidget(Widget):
a = Bool().tag(sync=True)
b = Tuple(Bool(), Bo... |
"""
probabilistic bit flip noise
"""
from qulacs import Observable
from qulacs import QuantumState, QuantumCircuit
from qulacs.gate import Probabilistic, X
import matplotlib.pyplot as plt
obs = Observable(1)
obs.add_operator(1, "Z 0")
state = QuantumState(1)
circuit = QuantumCircuit(1)
p = 0.1 # probab... |
import unittest
from BaseTest import BaseTest
class Test_goService(BaseTest):
GO_SERVICE_URL = "http://localhost:3000/health"
def test_goService(self):
self.isBackendAlive(self.GO_SERVICE_URL, "go service")
if __name__ == '__main__':
unittest.main()
|
import math
import numpy
from dexp.utils import xpArray
from dexp.utils.backends import Backend, NumpyBackend
def yang_deskew(
image: xpArray,
depth_axis: int,
lateral_axis: int,
flip_depth_axis: bool,
dx: float,
dz: float,
angle: float,
camera_orientation: int = 0,
num_split: in... |
import os
import argparse
import cv
import sys
global inputParser # just a reminder, it's used as a global variable
global inputArgs # just a reminder, it's used as a global variable
def parseInput() :
global inputParser
global inputArgs
inputParser = argparse.ArgumentParser(description='Render telemetry (atti... |
#!/usr/bin/env python3
# Author : Gobel
# Github : Gobel-coder
# Facebook : fb.me/fadlykaes
import os
import json
import requests
from concurrent.futures import ThreadPoolExecutor
global result,check,die
life = []
chek = []
result = 0
check = 0
die = 0
def sorting(users,cek=False):
with ThreadPoolExecutor(max_wor... |
import codecs
import os
import string
import numpy
from keras import regularizers
from keras.layers import Dense, Embedding, LSTM, CuDNNLSTM, SpatialDropout1D, Input, Bidirectional, Dropout, \
BatchNormalization, Lambda, concatenate, Flatten
from keras.models import Model
from keras.models import load_model
from k... |
# py3.8
###########################################################
# #
# 运输 #
# #
###########################################################
class Transp... |
##########################################################
### Import Necessary Modules
import argparse #provides options at the command line
import sys #take command line arguments and uses it in the script
import gzip #allows gzipped files... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
image = mpimg.imread('bridge_shadow.jpg')
# Edit this function to create your own pipeline.
def pipeline(img, s_thresh=(170, 255), sx_thresh=(20, 100)):
img = np.copy(img)
# Convert to HLS color space and separate ... |
from typing import NamedTuple
import numpy as np
from kneed import KneeLocator
FeaturesSelection = NamedTuple(
"FeaturesSelection",
[
("score", np.ndarray),
("index", np.ndarray),
("selection", np.ndarray),
("threshold", float),
],
)
def _gradient(values: np.ndarray, orde... |
import unittest
import numpy as np
import pandas as pd
from disarm_gears.frames import Timeframe
# Inputs
start_date = '2000-06-15'
end_date = '2010-06-20'
class TimeframeTests(unittest.TestCase):
def test_inputs(self):
# Check bad inputs
self.assertRaises(AssertionError, Timeframe, start=start... |
# Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... |
import numpy as np
import pandas as pd
import argparse
from numpy.random import RandomState
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from sklearn.utils import resample
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', type=str, default = 'elsa')
args = parser.parse_args()
"""
C... |
from typing import Awaitable, Generic, List, Optional, TypeVar, Union
from .data import RpcMethod as RpcMethodDecl
from .data import Subscription as SubscriptionDecl
from .data import Deserializer, Serializer, ServiceMethod
EventPayload = TypeVar('EventPayload')
RpcReqPayload = TypeVar('RpcReqPayload')
RpcRespPayload... |
import os
from dotenv import load_dotenv
load_dotenv(override=True)
API_TOKEN = os.getenv("API_TOKEN")
ACCESS_ID = os.getenv("ACCESS_ID")
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__title__ = 'DataViewer'
__author__ = 'Tanner S Eastmond'
__contact__ = 'https://github.com/tseastmond'
__license__ = 'MIT'
import pandas as pd
import wx
import wx.lib.mixins.listctrl as listmix
from _data import _data
from _pagetwo import _pagetwo
from _pagethree im... |
# encoding: utf-8
from typing import List, Dict
import math
from collections import OrderedDict
import json
ATTRS_IN_ORDER = [
"name",
# display
"top",
"left",
"height",
"width",
"color",
"textColor",
"showImage",
"text",
"text_ja",
"textAlign",
"image",
"faceup... |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django.core.mail import send_mail
class ContactForm(forms.Form):
name = forms.CharField(required=True)
email = forms.EmailField(required=True)
content = forms.CharField(
required=True,
... |
# uncompyle6 version 3.3.2
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: toontown.toonbase.ToontownGlobals
import TTLocalizer
from otp.otpbase.OTPGlobals import *
from direct.showbase.PythonUtil import Enum, i... |
import random
names = ['Ethan', 'Kurt', 'Eric']
random.shuffle(names)
print(names)
|
#!/usr/bin/env python
from ledgerblue.comm import getDongle
import argparse
from binascii import unhexlify
import base58
parser = argparse.ArgumentParser()
parser.add_argument('--account_number', help="BIP32 account to retrieve. e.g. \"12345\".")
args = parser.parse_args()
if args.account_number == None:
args.ac... |
from copy import deepcopy
import tarotbot.cards as cards
import pytest
new_deck = lambda: deepcopy(cards.Deck(cards.tarot_deck))
#def test_deck_draw_returns_card():
# assert type(deepcopy(cards.Deck(cards.tarot_deck)).draw()) == cards.Card
def test_deck_draw_exhausts_deck():
deck = deepcopy(cards.Deck(cards... |
'''
We will assume that fertility is a linear function of the female illiteracy rate. That is, f=ai+b, where a is the slope and b
is the intercept. We can think of the intercept as the minimal fertility rate, probably somewhere between one and two. The slope tells us how the fertility rate varies with illiteracy. We c... |
"""Commands: "!kstart", "!kstop"."""
import random
from bot.commands.command import Command
from bot.utilities.permission import Permission
from bot.utilities.startgame import startGame
class KappaGame(Command):
"""Play the Kappa game.
This game consists of guessing a random amount of Kappas.
"""
p... |
import click
from diana.apis import DcmDir
from diana.dixel import DixelView
from diana.plus import measure_scout # monkey patches Dixel
epilog = """
Basic algorithm is to use a 2-element Guassian mixture model to find a threshold
that separates air from tissue across breadth of the image. Known to fail when
patien... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
In this file/module, YOU, the user can specify some default resource values for
queues of different computers
This might be really useful for high-throughput calculation.
You can modefy, adjudst this file to your needs
"""
# TODO: move computers dict somewhere else?
# ... |
#__author__ = 'Tom Schaul, tom@idsia.ch'
import random
import copy
import numpy as np
from scipy import zeros
from pprint import pformat, pprint
#from pybrain.utilities import Named
#from pybrain.rl.environments.environment import Environment
# TODO: mazes can have any number of dimensions?
BOARDWIDTH = 8
BOARDHEIG... |
__all__ = ['HashCol']
import sqlobject.col
class DbHash:
""" Presents a comparison object for hashes, allowing plain text to be
automagically compared with the base content. """
def __init__( self, hash, hashMethod ):
self.hash = hash
self.hashMethod = hashMethod
def __cmp__( self, o... |
from numpy import *
from matplotlib import pyplot as plt
from math import sqrt
import matplotlib
import time
def drawDat(Dat):
fig=plt.figure(figsize=(20,10))
ax=fig.add_subplot(111)
ax.scatter(Dat[:,0].flatten().A[0],Dat[:,1].flatten().A[0],s=20,c='red')
plt.xlim(0,len(Dat))
plt.ylim(0,35)
pl... |
class Solution:
def computeArea(self, A, B, C, D, E, F, G, H):
if A < E:
width = C - E if G >= C >= E else G - E if C >= G >= E else 0
else:
width = G - A if C >= G >= A else C - A if G >= C >= A else 0
if B > F:
height = H - B if D >= H >= B else D - B if... |
from django.contrib import admin
from src.recipes.models import Recipe
admin.site.register(Recipe)
|
#!/usr/bin/env python3
"""
File: test_clause_managed_keys.py
Description: Performs unit test on the isc_managed_keys.py source file.
"""
import unittest
from bind9_parser.isc_utils import assertParserResultDictTrue, assertParserResultDictFalse
from bind9_parser.isc_clause_managed_keys import clause_stmt_managed_keys... |
__author__ = "Max Bachmann"
__license__ = "MIT"
__version__ = "1.0.2"
from ._initialize import *
|
import json
import numpy as np
import cv2
def generate():
"""Generate legend image from materials configuration."""
# load material file
with open("materials.json", "r") as f:
materials = json.load(f)
# font setup
fontFace = cv2.FONT_HERSHEY_SIMPLEX
fontScale = 0.8 #0.4375 # as seen ... |
from .fyve import Fyve |
#!/usr/bin/env python3
#
# corporation.py
# SWN Corporation Generator
#
# Copyright (c) 2014 Steve Simenic <orffen@orffenspace.com>
#
# This file is part of the SWN Toolbox.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softw... |
"""
This file includes a number of helper functions for the main loop of the carla simulator.
This includes printing measurements and steering.0
"""
from carla import VehicleControl
try:
from pygame.locals import K_DOWN
from pygame.locals import K_LEFT
from pygame.locals import K_RIGHT
from pygame.loc... |
if __name__ == "__main__":
inventorydict = {}
inventoryprice = {}
itemgroup = {}
while True:
print('press 1 to create inventory items', '\npress 2 to delete items from inventory', '\npress 3 to view items in inventory', '\npress 4 to edit items in inventory', '\npress 5 to assign items to a gr... |
from shutil import copyfile
import json
import datetime
import argparse
import sys
import os
sys.path.append(os.path.abspath('../'))
# SEEDS
from numpy.random import seed
seed(1234)
from tensorflow import set_random_seed
set_random_seed(1234)
# CONFIG
import config
from config import path_output, path_logs, path_chec... |
import helpers
def combine_mask(mask, i):
p = 35
o = 0
m = 1
while p >= 0:
v = i % 2
i = int(i/2)
if (v == 1 and mask[p] == 'X') or mask[p] == '1':
o += m
m = m*2
p -= 1
return o
def calc_sum(input):
mem = {}
for i in input:
if ... |
#!/usr/bin/env python
__author__="Thomas Evangelidis"
__email__="tevang3@gmail.com"
import os
from argparse import ArgumentParser, RawDescriptionHelpFormatter
## Parse command line arguments
def cmdlineparse():
parser = ArgumentParser(formatter_class=RawDescriptionHelpFormatter, description="""
DESCRIPTION:
... |
import torch
import torch.nn as nn
import re
class TaskCompositionBlockV1(nn.Module):
"""
This block takes the input features and conditions them with respect to
the Task Palette embedding computed with the task representation block.
"""
def __init__(self, cfg_txt, in_channels, out_channels, dim_... |
search_engine = {
'나무위키': 'https://namu.wiki/w/',
'리브레위키': 'https://librewiki.net/wiki/',
'백괴사전': 'https://uncyclopedia.kr/wiki/',
'위키백과': 'https://ko.wikipedia.org/wiki/',
'진보위키': 'https://jinbowiki.org/wiki/index.php/',
'구스위키': 'http://goos.wiki/index.php?title=',
'구글': 'https://www.google.co.kr/search?... |
from datetime import datetime
from distutils.util import strtobool
import numpy as np
import pandas as pd
# Converts the contents in a .tsf file into a dataframe and returns
# it along with other meta-data of the dataset:
# frequency, horizon, whether the dataset contains missing values and whether the series have e... |
from .baseserializer import BaseSerializer
class ObjectSerializer(BaseSerializer):
def __init__(self, obj_types, class_identifiers_in_params=False):
super().__init__(obj_types, '^!Class\((([a-zA-Z_][0-9a-zA-Z_]*)\.([a-zA-Z_][0-9a-zA-Z_]*))?\)$')
self.class_identifiers_in_params = class_identifiers_in_params... |
from pypy.module.thread.test.support import GenericTestThread
class AppTestLocal(GenericTestThread):
def test_local_1(self):
import thread
from thread import _local as tlsobject
freed = []
class X:
def __del__(self):
freed.append(1)
ok = []
... |
# -*- coding: utf-8 -*-
from flask import Flask
from flask_socketio import SocketIO
from services import facial_recognition, brightness_detector, face_detector, object_detector, pose_estimation
import configparser
config = configparser.ConfigParser()
config.read("secret.ini")
app = Flask(__name__)
PORT = config.get... |
# -*- coding: utf-8 -*-
"""Convenience visual methods"""
import numpy as np
import matplotlib.pyplot as plt
def imshow(data, title=None, show=1, cmap=None, norm=None, complex=None, abs=0,
w=None, h=None, ridge=0, ticks=1, yticks=None, aspect='auto', **kw):
kw['interpolation'] = kw.get('interpolation', ... |
import sys
import json
sys.path.insert(0, '../osspeak')
from recognition.rules import astree, _lark
from recognition import lark_parser
from recognition.lark_parser import utterance_grammar
def utterance_from_text(text):
lark_ir = utterance_grammar.parse(text)
utterance_from_lark_ir = astree.utterance_from_lar... |
from . import PresenterBase
# import releases
# from entities import InvalidEntity
products = {
"Recommendation Services": "REPERIO",
"Virtual/Mixed Reality": "KIWANO",
"Content Similarity": "Search & Discovery"
}
class CockpitPresenter(PresenterBase):
def __init__(self, columns, nice = lambda item: item, so... |
import jvcr
from route_machine import Scene
class TitleScene(Scene):
def __init__(self) -> None:
self.timer = 0
def on_activate(self):
self.timer = 0
def update(self, dt) -> str:
self.timer += dt
jvcr.spr(0, 0, 0, 48*16, 256, 144, 0, 0, 0)
if self.timer > 10:
... |
# -*- coding: utf-8 -*-
from werkzeug.datastructures import Headers
from flask import (
current_app, jsonify, request,
Blueprint, Response
)
from flask_jwt_extended import (
create_access_token, create_refresh_token, current_user,
get_csrf_token, jwt_refresh_token_required, jwt_required,
set_refres... |
#!/usr/bin/env python3
import analyse
import sys
scores = analyse.load_scores()
scores[0].to_csv(sys.argv[1])
scores[1].to_csv(sys.argv[2])
|
import os
import pytest
from ebonite.build.builder.base import use_local_installation
from ebonite.client import Ebonite
from tests.client.conftest import create_client_hooks
# these imports are needed to ensure that these fixtures are available for use
from tests.conftest import has_docker
from tests.ext.test_s3.con... |
# Generated by Django 2.0.9 on 2019-07-19 21:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movement', '0011_auto_20190521_1454'),
]
operations = [
migrations.AlterModelOptions(
name='movementbetweenofficerequest',
... |
class Solution:
def arrayPairSum(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
# nums.sort()
# max_sum = 0
# i = 0
# while (i<= len(nums)-1):
# max_sum += nums[i]
# i += 2
# return max_sum
res ... |
#!/usr/bin/env python
'''
------------------------------------------------------------------------------------------
Copyright 2020 Romeo Dabok
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 ... |
#!/usr/bin/env python3
# Contours, shape detection
__author__ = "Cristian Chitiva"
__date__ = "September 12, 2021"
__email__ = "cychitivav@unal.edu.co"
import cv2
import numpy as np
def getContours(image):
contours, Hierarchy = cv2.findContours(image, mode=cv2.RETR_EXTERNAL, method=cv2.CHAIN_APPROX_NONE)
... |
#Escreva um programa que faça o computador
# "pensar" em um número inteiro entre 0
# e 5 e peça para o usuário tentar descobrir
# qual foi o número escolhido pelo computador.
# O programa deverá escrever na tela se o
# usuário venceu ou perdeu.
from random import randint
from emoji import emojize
from time import sle... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.