content
stringlengths
5
1.05M
from torch.utils.data import Sampler class HardNegativeSampler(Sampler): def __init__(self, data_source): super().__init__(data_source) def __len__(self): pass def __iter__(self): pass
import requests def initdb(): groot = "http://localhost:8081/db" # Create container resp = requests.post( groot, auth=("root", "root"), json={"@type": "Container", "id": "web", "title": "Guillotina CMS Site"}, ) assert resp.status_code in (200, 409) # Install CMS pack...
# plugin by @deleteduser420 # ported to telethon by @mrconfused (@sandy1709) import os from usercodex import codex from usercodex.core.logger import logging from ..Config import Config from ..core.managers import edit_or_reply from ..helpers import humanbytes, post_to_telegraph from ..helpers.utils import _codutils, ...
class node: def __init__(self,key): self.left=self.right=None self.val=key def preorder(root): if root: print(root.val) preorder(root.left) preorder(root.right) root=node(1) root.left=node(2) root.right=node(3) preorder(root)
# Implementation of Proxy-based deep Graph Metric Learning (ProxyGML) approach import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn import init import numpy as np class ProxyGML(nn.Module): def __init__(self, opt, dim=512): su...
from getpass import getpass from owl import app from flask_bcrypt import Bcrypt bcrypt = Bcrypt(app) def generate_pw_hash(password, file): pw_hash = bcrypt.generate_password_hash(password).decode('utf-8') with open(file, 'w') as pwfile: pwfile.write(pw_hash) if __name__ == '__main__': ...
import numpy as np from collections import OrderedDict from gym.spaces import Space class DiscreteBox(Space): """ A discrete action space, but each dicrete action is parameterized by a [a, b]^d vector, where d is a non-negative integer that can be different for each discrete action. Each discrete a...
#import RPi.GPIO as GPIO import time import numpy import keyboard # import servo # import UltraSonic # import gps import sys from PyQt5.QtWidgets import * from PyQt5 import uic from PyQt5 import uic,QtGui,QtCore from PyQt5.QtCore import * import get_phone_number as phone import error import example #for gui app = QA...
from ...Model.SQLModelAbstract import SQLModelAbstract class Model(SQLModelAbstract): def __init__( self, table_name: str, ) -> None: super(Model, self).__init__( table_name=table_name, ) def get_item(self, condition: dict) -> 'SQLModelAbstract': ...
from dcf_test_app.models import Brand, Product from django.contrib.auth.models import User from django.test import TestCase from rest_framework.test import APIClient from django_client_framework import permissions as p class TestPatchPerms(TestCase): def setUp(self) -> None: self.user = User.objects.crea...
#!/usr/bin/env python from pathlib import Path from argparse import ArgumentParser, Namespace, ArgumentDefaultsHelpFormatter from chris_plugin import chris_plugin import subprocess as sp Gstr_title = r""" _ _ _____ _ _ | | | | / __ \ (_|_) _ __ ...
import pandas as pd def load_stream(mongo, activity_id, stream_type): index_stream = mongo.db.streams.find_one({'activity_id': activity_id, 'type': 'time'}) data_stream = mongo.db.streams.find_one({'activity_id': activity_id, 'type': stream_type}) return pd.DataFrame({stream_type: data_stream['data']}, ...
#!/bin/usr/python3 import pandas as pd import sys arguments = sys.argv if len(arguments) == 1: sys.exit('no excel file given') elif len(arguments) > 2: sys.exit(f'too many files give:{arguments[1:]}') file = pd.read_excel(sys.argv[1]) file.to_csv(sys.stdout, sep = '\t')
# Copyright (c) 2019 Adam Dodd # # 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, publish, distribut...
from twilio.rest import TwilioRestClient TWILIO_ACCOUNT_SID = '' TWILIO_AUTH_TOKEN = '' TO_NUMBER = '' # Your verified phone number FROM_NUMBER = '' # Your Twilio phone number TWIML_URL = 'http://twimlets.com/message?Message=Hello+World' client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN) clie...
# Copyright (c) 2018, Toby Slight. All rights reserved. # ISC License (ISCL) - see LICENSE file for details. import curses from .actions import Actions from os import environ environ.setdefault('ESCDELAY', '12') # otherwise it takes an age! class Keys(Actions): def getpadkeys(self): self.screen.refresh...
""" This module handles loading data from csv files and set data to objects. """ import csv import ast from django.db import models from django.db.models.loading import get_model from django.conf import settings from evennia.utils import create, utils, search, logger DATA_INFO_CATEGORY = "data_info" def import_csv...
from telegram.ext import Updater updater = Updater(token='1435594962:AAE3UHSB2I7XxpQKEGkzcvHzUnTrkYKpclY', use_context=True) : dispatcher = updater.dispatcher import logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) def start(update, co...
#! /usr/bin/env python """ Scan a list of genome files and create individual "info file" CSVs for genome-grist to use for private genomes. """ import sys import argparse import screed import csv import os import shutil def main(): p = argparse.ArgumentParser() p.add_argument('info_csv') args = p.parse_arg...
def summation_of_primes_below_two_million(): def sieve(scope): prime = [True] * scope p = 2 while p * p <= scope: if prime[p]: for i in range(p * 2, scope, p): prime[i] = False p += 1 return prime[2:] sum_of_primes = ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """IPython -- An enhanced Interactive Python The actual ipython script to be installed with 'python setup.py install' is in './scripts' directory. This file is here (ipython source root directory) to facilitate non-root 'zero-installation' (just copy the source tree somewh...
import dateutil.parser from botocore.vendored import requests def lambda_handler(request, context): insert_nps_responses, last_nps_response_date = api_response(request['state'], request['secrets']) insert = dict() insert['nps_responses'] = insert_nps_responses delete = dict() delete['nps_respon...
""" This benchmark was adapted from https://bitbucket.org/pypy/benchmarks/src/34f06618ef7f29d72d9c19f1e3894607587edc76/unladen_swallow/performance/bm_django.py?at=default """ __author__ = "collinwinter@google.com (Collin Winter)" import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "../test/in...
import tarfile import os class TARFile: def __init__(self, path, tarfilename): self.path = path self.tarfilename = tarfilename def extract_all(self): print "Extracting files from (" + self.path + "/" + self.tarfilename + ") ..." tfile = tarfile.open(self.path + "/" + self.tar...
class HCF4094Capture(object): """ This class is used to emulate the data that is shifted to the HCF4094. A callback method is registered and will be called with a list of tuples (index, bit_state) for each output that has changed since last strobe. This allows you to simulate hardware that occurs when...
import os TOKEN = os.environ.get("BOT_TOKEN") START_MESSAGE = os.environ.get("START_MESSAGE", "*Hi ! I am a simple torrent searcher using @sjprojects's Torrent Searcher api.\n\n\nMade with 🐍 by @KeralasBots*") FOOTER_TEXT = os.environ.get("FOOTER_TEXT", "*Made with ❤️ by @KeralasBots*")
# generated from catkin/cmake/template/cfg-extras.context.py.in DEVELSPACE = 'FALSE' == 'TRUE' INSTALLSPACE = 'TRUE' == 'TRUE' CATKIN_DEVEL_PREFIX = '/root/ros_catkin_ws/devel_isolated/genmsg' CATKIN_GLOBAL_BIN_DESTINATION = 'bin' CATKIN_GLOBAL_ETC_DESTINATION = 'etc' CATKIN_GLOBAL_INCLUDE_DESTINATION = 'include' CAT...
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2018-04-27 15:45 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('users', '0009_card_is_activ...
from __future__ import print_function, unicode_literals import os import warnings import tensorflow as tf from dragnn.protos import spec_pb2 from dragnn.python import graph_builder, spec_builder from google.protobuf import text_format from syntaxnet import sentence_pb2 from syntaxnet.ops import gen_parser_ops os.env...
import random import time class Goalkeeper(): """A definition that produces the attributes for a goalkeeper on the basis of the players overall rating""" def __init__(self, name, reflexes, jumping, bravery, kicking): self.name = name self.reflexes = reflexes ...
#!/usr/bin/env python from distutils.core import setup setup(name='dae_RelayBoard', version='1.5.2', description='Denkovi Relay Board Controller', author='Peter Bingham', author_email='petersbingham@hotmail.co.uk', url='https://code.google.com/p/dae-py-relay-controller/', packages=...
""" A slack client with much better async support """ from slackclient import SlackClient import websockets import asyncio import ssl import json ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) # os x is dumb so this fixes the openssl cert import try: ssl_context.load_verify_locations('/usr/local/etc/openssl/c...
import struct import json import os import sys import time import shutil import re import json import logging class PatchAsar: asar_file_path = os.getenv("LocalAppData") + \ "\\Programs\\Termius\\resources\\app.asar" backup_filename_base = "app.asar.bak" def __init__(self, logge...
import torch import numpy as np from path import Path import matplotlib.pyplot as plt from sampler import Sampler from random import random import matplotlib.pyplot as plt import torch def main1(): file = Path('./0000002.png') img = plt.imread(file) img = torch.tensor(img) mask1 = torch.ones(img.shape,...
from drqa import retriever from tqdm import tqdm from transformers import BertTokenizer from multiprocessing import Pool import argparse import logging import json import random import nltk.data import drqa.drqa_tokenizers import math import os from multiprocessing.util import Finalize from collections import Counter ...
""" Define the API versions. """ class APIVersion: V1 = "/v1"
# cosine similarity and duplicate detection implementation import numpy from pathlib import Path from collections import defaultdict from copy import deepcopy similarityThreshold = 0.99 # customizable similarity threshold debug = True # for debug print def cosineSimilarity(dictX: dict, dictY: dict): """ Source code...
from typing import Optional from fastapi import FastAPI import hashlib import random import base64 from pydantic import HttpUrl, BaseModel from fastapi import FastAPI, Depends, Body, HTTPException from fastapi.responses import RedirectResponse, HTMLResponse, JSONResponse app = FastAPI() posts = [] class Post(BaseMode...
# ------------------------------------------------------------------------------------------------ from astrodbkit2.astrodb import create_database from astrodbkit2.astrodb import Database from simple.schema import * from astropy.table import Table import numpy as np import re import os from utils import convert_spt_st...
# -*- coding: utf-8 -*- """ A number of generic default fixtures to use with tests. All model-related fixtures defined here require the database, and should imply as much by including ``db`` fixture in the function resolution scope. """ from __future__ import absolute_import, print_function, unicode_literals import o...
try: from pydicom.filewriter import * except ImportError: from dicom.filewriter import *
import numpy import six.moves import cellprofiler_core.image import cellprofiler_core.measurement import cellprofiler_core.measurement import cellprofiler_core.modules from cellprofiler_core.constants.measurement import FF_COUNT, COLTYPE_INTEGER, M_LOCATION_CENTER_X, COLTYPE_FLOAT, \ M_LOCATION_CENTER_Y, M_NUMBER_...
import cv2 import numpy as np import pandas as pd import imutils ''' #data load train_img_path = 'bone_data/train/' train_csv_path = 'bone_data/training_dataset.csv' # dataset setting train_data = pd.read_csv(train_csv_path) train_data.iloc[:, 1:3] = train_data.iloc[:, 1:3].astype(np.float) def rotation(img, angle): ...
import numpy as np import matplotlib as mpl from matplotlib import pyplot as plt from matplotlib_venn import venn3, venn3_circles # 35 trucks went out carrying early​ peaches; # 69 carried late​ peaches; # 54 carried extra late​ peaches; # 26 carried early and​ late; # 31 carried late and extra​ late; # 7 carried ear...
from rich.table import Table from rich.console import Console console = Console() table = Table(title='Filmes favoritos') table.add_column("none", justify='left', style='red') table.add_column('data de lançamento', style='green') table.add_column('faturamento', style='purple') table.add_row('Piratas do caribe', '200...
import uvicorn if __name__ == '__main__': uvicorn.run('app:app', host="127.0.0.1", port=8080, reload=True)
# -*- test-case-name: foolscap.test -*- """foolscap tests"""
# -*- coding: utf-8 -*- from django.db import models from django.test import TestCase from cms.api import add_plugin, create_page from cms.models import CMSPlugin from cms.models.placeholdermodel import Placeholder from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from ..helpers import ...
import csv import os from datetime import datetime from flask.views import MethodView from flask import make_response, current_app, abort, jsonify, json import eligibility_eval import requests def error(code, message): current_app.logger.error("code %i %s" % (code, message), stack_info=True) return abort(mak...
# Django Core Modules from django.db import models from django.conf import settings # Apps specific class CoreConfig(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, default=1, on_delete=models.CASCADE) hostname = models.CharField(max_length = 128, default = 'hostname', blank=False) fqdn = mode...
import subprocess,os,glob import numpy as np import netCDF4 from bunch import Bunch import gc,sys g=9.8 atmvarlist=["T","Q","U","V","Z3"] icar_atm_var=["t","qv","u","v","z"] # from mygis, modified to work with netCDF4 def read_nc(filename,var="data",proj=None,returnNCvar=False): '''read a netCDF file and return t...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # 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 b...
from django.urls import path from . import views urlpatterns = [ path("admin/", views.admin, name="admin"), path("admin/Create_User", views.user, name="admin_create_user"), path("admin/Create_Course", views.course_add, name="admin_create_course"), path("admin/Create_Section", views.section_add, name="...
#!/usr/bin/python3 import requests from discord.ext import commands TOKEN = "Your Discord token here" OWNER_ID = 0 # Your user ID here RTT_USERNAME = "Realtime Trains API username" RTT_PASSWORD = "Realtime Trains API password" ## BOT SETUP bot = commands.Bot(command_prefix = ">") # Comment to respond to messages from...
import copy import numpy as np import pytest from sklearn.gaussian_process.kernels import WhiteKernel from sklearn.model_selection import GridSearchCV from sklearn.pipeline import Pipeline from uncoverml.krige import krige_methods, Krige, krig_dict from uncoverml.optimise.models import kernels from uncoverml.optimise....
#!/usr/bin/python3 # number of output figures = 2 from helper.figure import Figure import helper.plot lineNames = ["B-spl. surrogate", "Linear surrogate", "Objective function"] markerStyles = [".", "^", "v"] lineStyles = ["-", "--", ":"] fig = Figure.create(figsize=(5, 2)) ax = fig.gca() functionNames = ["Br...
import alpaca_trade_api as tradeapi import api_credentials from alpaca_trade_api.rest import TimeFrame import pandas as pd import time unique_minutes = [] def alpaca_trader(ticker, polarity): ''' Approximate price of the stock, then calculates a value equivalent to 1% of the current portfolio value divided ...
from operator import add import unittest from jsonbender import Context, K, S, bend from jsonbender.control_flow import If, Alternation, Switch from jsonbender.test import BenderTestMixin class TestIf(BenderTestMixin, unittest.TestCase): def setUp(self): self.na_li = {'country': 'China', ...
import six from maya.api import OpenMaya from mango.fields import base __all__ = [ "IntegerField", "EnumField", "FloatField", "DegreeField", "BooleanField", "StringField", "MatrixField", ] class IntegerField(base.Field): """ The IntegerField can be used to set and retrieve integ...
# Copyright (c) 2020-20201, LE GOFF Vincent # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions...
#Um programa que lê o peso de 5 pessoas e informa qual o maior e menor peso pesos = [] peso = 0 for pessoa in range(1,6): peso = (float(input(f'Qual o peso da {pessoa}ª pessoa? '))) if pessoa == 1: maior = peso menor = peso else: if peso > maior: maior = peso ...
# 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 warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import frappe from frappe import msgprint import re def validate(doc,method): child_asset = frappe.db.sql("""SELECT ass.name FROM `tabAsset` ass WHERE ass.docstatus = 1 AND ass.asset_category = '%s'"""%(doc.name), as_list=1) if child_as...
import inspect import mmcv # model: # from .registry import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS, ROI_EXTRACTORS, SHARED_HEADS) # build_from_cfg(cfg.model, registry=DETECTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg)) # ... # dataset: # from .registry import DATASETS # dataset = build_from_cfg(cfg.data.tra...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.conf import settings LDAP_ENABLED = settings.LDAP_ENABLED
from ipaddress import ip_network from zeph.selectors.epsilon import ( EpsilonDFGSelector, EpsilonGreedySelector, EpsilonNaiveSelector, EpsilonRewardSelector, ) def test_epsilon_dfg_selector_first_cycle(bgp_prefixes): selector = EpsilonDFGSelector("clickhouse://localhost:8123", 0.1, bgp_prefixes) ...
import torch import torchvision import numpy as np def get_loaders(dataset='cifar10', data_path='data', train_batch_size=128, test_batch_size=1, num_workers=4): if dataset == 'cifar10': num_classes = 10 mean = (0.4914, 0.4822, 0.4465) std = (0.2471, 0.2435, 0.2616) train_transfor...
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
# -*- coding: utf-8 -*- """ Test helpers to create and manage fixtures for our Superset app """ import json import uuid import superset from superset.connectors.sqla.models import SqlaTable from superset.models.core import Dashboard from superset.models.slice import Slice # Inspired by: # https://github.com/apache/...
""" A simple python package for scraping and downloading images from Google Usage: $ noicesoup.py [-h] -k KEYWORD [-cd CHROMEDRIVER] NOTE: Default webdriver is Chrome in relative path "chromedriver" Images will be saved in "downloads/<keyword>" This package is currently under development... """ import threading...
import os from feedhq.settings import parse_email_url, parse_redis_url from . import TestCase class SettingsTests(TestCase): def test_redis_url(self): os.environ['REDIS_URL'] = 'redis://:password@domain:12/44' self.assertEqual(parse_redis_url(), ({ 'host': 'domain', 'port...
from django_filters.rest_framework import DjangoFilterBackend from django.shortcuts import get_object_or_404 from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework import viewsets from rest_framework.filters import SearchFilter from rest_framework.decorat...
def eval_base( jct ): jct['base'] = 1 if jct['base'] != 1: raise Exception(' base is not == 1 :', jct['base']) jct['base2']['sub'] = 1 if jct['base2']['sub'] != 1: raise Exception(' base2.sub is not == 1 :', jct['base2']['sub']) jct.init('base', 5 ) if jct['base'] != 1: ...
#!/usr/bin/env python # ------------------------------------------------------------------------------ # File: sum.py # Author: Chase Ruskin # Abstract: # Compute the checksum for a list of files found from glob matching a pattern. # The output will resemble the following: # ''' # 8852e7f180e9bc0821b0136a859617...
from __future__ import unicode_literals import uuid from allauth.socialaccount import providers from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from helusers.models import AbstractUser from oauth2_provider.models import...
# import packages import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier from sklearn.preprocessing import MinMaxScaler, LabelEncoder from sklearn.metrics import confusion_matrix, a...
from pymongo import MongoClient import pandas as pd import csv import json MONGO_HOST= 'mongodb://localhost/mhaf_iot' dbs=MongoClient().database_names() dbs print(dbs) connection = MongoClient('localhost',27017) #Generate Devices CSV collectionname ='devices' collection=connection['mhaf_iot'][collectionname] ma3loume...
import numpy import rospy import time import tf from openai_ros import robot_gazebo_env from sensor_msgs.msg import Imu from sensor_msgs.msg import JointState from moveit_msgs.msg import PlanningScene from openai_ros.openai_ros_common import ROSLauncher class ShadowTcEnv(robot_gazebo_env.RobotGazeboEnv): """Superc...
# generated by datamodel-codegen: # filename: openapi.yaml # timestamp: 2021-12-31T02:57:52+00:00 from __future__ import annotations from typing import Annotated, List, Optional from pydantic import BaseModel class String(BaseModel): __root__: str class Boolean(BaseModel): __root__: bool class Rep...
""" <Program Name> conflict/__init__.py <Purpose> Module that is used with ut_seash_moduleconflicterror.py. It should not be enabled successfully, as it will conflict with the default 'show' command. Other fields are simply defined so that the module importer can import the module without problems. """ mo...
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from extensions.ops.spatial_transformer import SpatialTransformOp from mo.front.caffe.collect_attributes import merge_attrs from mo.front.extractor import FrontExtractorOp class SpatialTransformFrontExtractor(FrontExtractorOp): op ...
from pathlib import Path import numpy as np import pytest from espnet2.text.token_id_converter import TokenIDConverter def test_tokens2ids(): converter = TokenIDConverter(["a", "b", "c", "<unk>"]) assert converter.tokens2ids("abc") == [0, 1, 2] def test_idstokens(): converter = TokenIDConverter(["a", ...
from __future__ import unicode_literals, absolute_import import os import sys import unittest try: from StringIO import StringIO except Exception as e: from io import StringIO from greb import meaning as greb from . import data class TestGreb(unittest.TestCase): def test_read_page(self): for ea...
'''Implementation for journal file reading and writing to serialize glycopeptide spectrum match information to disk during processing. ''' import csv import json import io import gzip from collections import defaultdict from operator import attrgetter from six import PY2 import numpy as np from glycopeptidepy.util...
# coding: utf-8 # import models into model package
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options from utils.checks import FileCheck from cookies import Cookies import json import sys import os import time import random opts = Options() def load_settings(): fchk = FileCheck()...
from setuptools import setup, find_packages setup( name='phasorpy', version='0.1.0', packages=['phasorpy'], package_dir={'phasorpy': 'phasor'}, package_data={'phasorpy': ['data/*.m']}, author='Avinash Madavan', author_email='avinash.madavan@gmail.com', description='A python library for ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Author: Shuailong # @Email: liangshuailong@gmail.com # @Date: 2019-08-14 15:26:18 # @Last Modified by: Shuailong # @Last Modified time: 2019-08-14 15:54:54 # Modified from https://github.com/tensorflow/nmt/blob/master/nmt/scripts/bleu.py from typing import List, Dict i...
"""timeout_req_ImageSender.py -- show use of ZMQ timeout options for restarts A Raspberry Pi test program that uses imagezmq to send image frames from the PiCamera continuously to a receiving program on a Mac that will display the images as a video stream. Images are jpg compressed before sending. One of the issues w...
# Generated by Django 3.0.2 on 2020-02-04 12:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('budget', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='budget', options={'get_latest_by': 'y...
import asyncio from mesoor_recommendation_sdk import models, MesoorRecommendation service = MesoorRecommendation('localhost:50051') # 保存 Job async def save_demo_job(): job_detail = models.JobDetail( name='foo name', description='foo jd', employer='foo company', degree=models.Degre...
# Generated by Django 2.1.2 on 2018-12-06 17:49 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('team', '0001_initial'), ] operations = [ migrations.CreateModel( name='Cont...
import unittest import os import numpy as np from shutil import rmtree from six import add_metaclass from abc import ABCMeta import sys try: import z5py except ImportError: sys.path.append('..') import z5py @add_metaclass(ABCMeta) class GroupTestMixin(object): def setUp(self): self.shape = (...
from abc import ABC, abstractmethod _registered = [] class AbstractScene(ABC): @classmethod def __init_subclass__(cls, is_abstract=False, runtime_scene=False, **kwargs): super().__init_subclass__(**kwargs) if not is_abstract: _registered.append(cls) @abstractmethod def dr...
from .retinaface import RetinaFace
from xdg.IconTheme import getIconPath from PySide.QtGui import QListWidget, QListWidgetItem, QIcon from plustutocenter.qt.widgets.base_custom_entries_widget import \ BaseCustomEntriesWidget class SoftwareEntry: def __init__(self, name, iconPath, tutorials, desktopFilePath): """ :type: str ...
#Jenny Steffens from Analysis import * import random, time def main(): # This list and dictionary are now the default in the Analyzer. They # do not need to be entered in a driver. However, if the dictionary is updated, # either do so in Analysis.py or when initializing, set kD= name of new dicitonary # dic...
import jwt from fastapi import Request from fastapi.security import HTTPBearer from . import const ALGORITHMS = ["RS256"] token_auth_scheme = HTTPBearer() class AuthError(Exception): def __init__(self, error, status_code): self.error = error self.status_code = status_code class JWTBearer(HTTP...
import config import apiai, json from telegram.ext import Updater, CommandHandler, MessageHandler, Filters updater = Updater(token=config.TOKEN) dispatcher = updater.dispatcher def startCommand(bot, update): bot.send_message(chat_id=update.message.chat_id, text='Hello, let\'s talk?') def textMessage(bot, update)...
$NetBSD: patch-setup.py,v 1.1 2020/05/18 15:19:01 wiz Exp $ Don't hardcode version numbers. --- setup.py.orig 2020-03-01 07:51:19.388557700 +0000 +++ setup.py @@ -11,7 +11,7 @@ package_data = \ {'': ['*']} install_requires = \ -['pygls>=0.8.1,<0.9.0', 'pyparsing>=2.4,<3.0'] +['pygls', 'pyparsing'] entry_points...