text stringlengths 1 927k |
|---|
from ArduinoHandler import ArduinoHandler
import logging
import time
from datetime import datetime
from Queue import Queue
import os
import sys
import multiprocessing
from PCHandler import PCHandler
from BTHandler import BTHandler
from CameraHandler import CameraHandler
from PacketsHandler import *
jobList = []
m ... |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import unittest
from openvino.tools.mo.middle.InterpolateSequenceToInterpolate import InterpolateSequenceToInterpolate
from openvino.tools.mo.front.common.partial_infer.utils import int64_array
from openvino.tools.mo.... |
import heapq
import rx
class PriorityQueue(object):
"""Priority queue for scheduling"""
def __init__(self, capacity=None):
self.items = []
self.count = 0 # Monotonic increasing for sort stability
self.lock = rx.config.get("Lock")()
def __len__(self):
"""Returns length ... |
# Generated by Django 3.1.1 on 2021-01-30 17:49
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('entry', '0018_auto_20210121_1805'),
]
operations = [
migrations.CreateModel(
... |
import logging
from google.protobuf.json_format import MessageToDict
from spaceone.core import cache
from spaceone.core.manager import BaseManager
from spaceone.inventory.manager.collector_manager.collecting_manager import RESOURCE_MAP
_LOGGER = logging.getLogger(__name__)
class FilterManager(BaseManager):
"""... |
while True:
enemy = hero.findNearestEnemy()
if hero.isReady("cleave"):
hero.cleave(enemy)
else:
hero.attack(enemy) |
# Import standard library packages
# Import installed packages
from marshmallow import fields
# Import app code
from .base import BaseSchema
class RoleSchema(BaseSchema):
# Own properties
id = fields.Int()
created_at = fields.DateTime()
name = fields.Str()
users = fields.Nested(
"UserSch... |
#
# Copyright (c) 2020, Neptune Labs Sp. z o.o.
#
# 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 agr... |
from urlparse import urlparse
from django.db.models import Q
from django.conf import settings
from mc2.controllers.docker.models import DockerController
def get_app_id_from_domain(domain):
index = domain.find(settings.HUB_DOMAIN)
if not index == -1:
return domain[:index - 1]
return None
def or... |
#!/usr/bin/python
import sys
import socket
import struct
import time
import logging
import sys,getopt
import os
import random
import numpy
from matplotlib import pyplot as plt
IPADDR = os.environ.get('IP_ADDR')
if IPADDR is None: IPADDR = 'rflab1.lbl.gov' # 128.3.128.122
PORTNUM = 3000
global plot_ena, slow_ena
pl... |
import numpy as np
from .base import OdeSolver, DenseOutput
from .common import (validate_max_step, validate_tol, select_initial_step,
norm, warn_extraneous, validate_first_step)
from . import dop853_coefficients
# Multiply steps computed from asymptotic behaviour of errors by this.
SAFETY = 0.9
... |
# Copyright 2019 The Feast 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
import abc
import json
import hail as hl
from .utils import make_filter_and_replace
from ..expr.types import tfloat32, tfloat64, hail_type, tint32, tint64, tstr
from ..genetics.reference_genome import reference_genome_type
from ..typecheck import *
from ..utils import wrap_to_list
from ..utils.misc import escape_str
... |
'''
def warper(img, src, dst):
# Compute and apply perpective transform
img_size = (img.shape[1], img.shape[0])
M = cv2.getPerspectiveTransform(src, dst)
warped = cv2.warpPerspective(img, M, img_size, flags=cv2.INTER_NEAREST) # keep same size as input image
return warped
'''
import numpy as np
i... |
'''
date: 200429
objective: check out configparser module, which allows one to read from an ini file
src1: https://docs.python.org/3/library/configparser.html
src2: https://docs.python.org/3/library/configparser.html#mapping-protocol-access
KJG200430: ini files aren't really that appealing to use. in fact, it might be... |
# -*- coding: utf-8 -*-
"""
NLP From Scratch: Translation with a Sequence to Sequence Network and Attention
*******************************************************************************
**Author**: `Sean Robertson <https://github.com/spro/practical-pytorch>`_
This is the third and final tutorial on doing "NLP From S... |
""""""
import os
import logging
# Simple logging configuration, an example output might be:
# 2013-06-03 15:07:55.740 p7470 {start_here.py:31} INFO - This is an example log message
LOG_FILE_NAME = "log.log"
# The date format is ISO 8601, format includes a decimal separator for
# milliseconds (not the default comma) as... |
from copy import deepcopy
from collections import deque
import time
import numpy as np
class Node:
def __init__(self, parent, grid):
self.parent = parent
self.grid = grid
def print_answer(p1, p2):
initial_to_middle = []
while p1:
initial_to_middle.insert(0, p1.grid)
p1 = p1... |
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 w... |
# Generated by Django 3.0.7 on 2020-06-16 13:37
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('learning', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('accounts', '0001_initial'),... |
#!/usr/bin/python
#
# bpflist Display processes currently using BPF programs and maps,
# pinned BPF programs and maps, and enabled probes.
#
# USAGE: bpflist [-v]
#
# Idea by Brendan Gregg.
#
# Copyright 2017, Sasha Goldshtein
# Licensed under the Apache License, Version 2.0
#
# 09-Mar-2017 Sasha Goldshte... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'beech_finance_holdi_30302.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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 applicab... |
__all__ = ["auth", "validators"] |
# Manticore Search Client
# Copyright (c) 2020-2021, Manticore Software LTD (https://manticoresearch.com)
#
# All rights reserved
import unittest
class ParametrizedTestCase(unittest.TestCase):
def __init__(self, methodName='runTest', settings=None):
super(ParametrizedTestCase, self).__init__(methodName)
... |
import re
class RemoteJmxQueue(object):
def __init__(self, jolokia_session, broker_name, queue_name):
self.name = queue_name
self.jolokia_session = jolokia_session
self.queue_bean = (
"org.apache.activemq:type=Broker,brokerName={},"
"destinationType=Queue,destination... |
numero = input('Digite um numero inteiro: ')
if numero.isdigit():
numero = int(numero)
if numero % 2 == 0:
print('O numero e par!')
else:
print('O numero e impar!')
else:
print('Nao e um numero inteiro') |
#!/usr/bin/python3
import sys
import sqlite3
import logging
from collections import Counter
from random import shuffle
from getSimilarFromContentBased import getSimilarFromContentBased
from getRecommendationFromSVD import getRecommendationFromSVD
from getInfoFromMovieIDs import getInfoFromMovieIDs
logger = logging.ge... |
import matplotlib.pyplot as plt
import numpy as np
from influxdb import InfluxDBClient
import time
import datetime
import collections
time_min = '2017-04-03 16:35:00'
time_max = '2017-04-03 22:35:00'
time_min_2 = '2017-04-06 09:30:00'
time_max_2 = '2017-04-06 14:30:00'
# time_min = '2017-03-25 00:00:00'
# time_max = ... |
#!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from . forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
def register(request):
if request.method == 'POST':
form = UserRegisterForm(request.POST)
... |
import os
import sys
import logging
import requests
import time
import traceback
import html.parser
import urllib.parse
import pytest
import ray
from ray.new_dashboard.tests.conftest import * # noqa
from ray.test_utils import (
format_web_url,
wait_until_server_available,
)
os.environ["RAY_USE_NEW_DASHBOARD"... |
from collections import namedtuple
import numpy as np
import talib
from jesse.helpers import get_candle_source, np_shift
from jesse.helpers import slice_candles
GATOR = namedtuple('GATOR', ['upper', 'lower', 'upper_change', 'lower_change'])
def gatorosc(candles: np.ndarray, source_type: str = "close", sequential: ... |
import os
from PyQt4 import QtCore, QtGui
from epubcreator.epubbase.ebook import Ebook
from epubcreator.converters.converter_factory import ConverterFactory
class SettingsStore(QtCore.QSettings):
"""
Permite guardar y recuperar las diversas opciones de configuración. Expone además
todos los atributos re... |
"""
Implements network utils like sending and receiving message over socket
"""
import pickle
def send_message(message, client_socket, HEADER_LENGTH, FORMAT):
"""
sends message on the client_socket
"""
message = pickle.dumps(message)
send_length = "{:<{}}".format(len(message), HEADER_LENGTH)
c... |
import sys
import time
from functools import partial # pip install functools
import copy
import random
import numpy as np
from gym import spaces
from luxai2021.env.agent import Agent, AgentWithModel
from luxai2021.game.actions import *
from luxai2021.game.game_constants import GAME_CONSTANTS
from luxai2021.game.posi... |
from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from .player import Player
from django.core.urlresolvers import reverse
Q = models.Q
class Game(models.Model):
name = models.CharField(max_length=128, db_index=True)
product_key = models.CharField(max_length... |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from jsngram.users import models as user_models
from jsngram.images import models as image_models
class Notification(image_models.TimeStampedModel):
TYPE_CHOICES = (
('like', 'Like'), # 첫 번째는 데이터베이스를 위해, 두 번째는 어드민 ... |
# -*- coding: utf-8 -*-
__author__ = 'Александр Гречко'
from quik import quik_dde_server_history
qds=quik_dde_server_history('rts')
qds.start() |
from datetime import datetime
from celery.signals import task_postrun, task_prerun
from arcusd.contracts import Contract
from arcusd.data_access.tasks import save_task_info, update_task_info
@task_prerun.connect
def task_before_run(task_id, task, *args, **kwargs):
request_id = task.request.kwargs.get('request_i... |
from .tem import load_file, pretty_plot, convert_tiffolder |
#!/usr/bin/env python
"""
@author: pritesh-mehta
"""
import numpy as np
from scipy.optimize import curve_fit
from pathlib import Path
from argparse import ArgumentParser
from dwi_utilities.monoexponential_decay import log_func, func
import dwi_utilities.nifti_utilities as nutil
def comp_high_b_case(case_dir, target... |
#!/usr/bin/env python
"""
The HAL testing module, basically this just sends messages
to HAL and verifies that response / behavior is correct.
Testing is done by sub-classing this module and providing
it with a series of test actions, a little bit like what
Dave does when controlling HAL.
Hazen 04/17
"""
import storm... |
import os,sys
import numpy as np
# tensorboardX
from tensorboardX import SummaryWriter
from .visualizer import Visualizer
class Logger(object):
def __init__(self, log_path='', log_opt=[1,1,0], batch_size=1):
self.n = batch_size
self.reset()
# tensorboardX
self.log_tb = None
... |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2020 Elliot Jordan
# Based on original processor by Nick Gamewell
#
# 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/lice... |
class GeneticAlgorithm:
def __init__(popSize=10, maxGens=100000, crossoverRate=0.7, mutateRate=0.05):
self.pop = []
self.popSize = popSize
self.maxGens = maxGens
self.crossoverRate = crossoverRate
self.mutateRate = mutateRate
# Replace funcs
def searialize(self):
... |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
#!/usr/bin/env python
"""Program that takes a CSV file of CDRs and produces a list of one-second intervals
with call counts, again as a CSV file. Optionally, the program will display the
spread of CPS values.
usage: countcps.py [-h] [-s START] [-e END] [--tz TZ]
[-t {auto,header,positional... |
# pylint: disable=W0611
'''
Android Joystick Input Provider
===============================
This module is based on the PyGame JoyStick Input Provider. For more
information, please refer to
`<http://www.pygame.org/docs/ref/joystick.html>`_
'''
__all__ = ('AndroidMotionEventProvider', )
import os
try:
import an... |
from ctypes import *
class Node(Structure): pass
Node._fields_ = [
("leaf", c_int),
("g", c_float),
("min_samples", c_int),
("split_ind", c_int),
("split", c_float),
("left", POINTER(Node)),
("right", POINTER(Node))]
trees = CDLL("./trees.so")
trees.get_root.argtypes = (c_int, )
trees.get... |
# Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... |
from __future__ import absolute_import
import unittest
from blingalytics.sources import static
from mock import Mock
from test import reports
class TestStaticSource(unittest.TestCase):
def setUp(self):
self.report = reports.SuperBasicReport(Mock())
def test_static_source(self):
source = sta... |
import cv2 as cv
import numpy as np
import math
import time
capture = cv.VideoCapture(0)
# video = "http://admin:admin@10.242.200.134:8081/" # admin是账号:admin是密码 后面是局域网
# capture = cv.VideoCapture(video)
# 获得欧几里距离
def _get_eucledian_distance(vect1, vect2):
distant = vect1[0] - vect2[0]
dist = np.sqrt(np.su... |
"""The tests for the geojson platform."""
from homeassistant.components import geo_location
from homeassistant.components.geo_json_events.geo_location import (
ATTR_EXTERNAL_ID,
SCAN_INTERVAL,
)
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.const import (
ATTR_FRIENDLY_NAM... |
# -*- coding: utf-8 -*-
import pymysql
MYSQL_HOST = 'localhost'
MYSQL_DB = 'telegram'
MYSQL_USER = 'root'
MYSQL_PASS = '123456'
connection = pymysql.connect(host=MYSQL_HOST, user=MYSQL_USER,
password=MYSQL_PASS, db=MYSQL_DB,
charset='utf8mb4',
... |
from base64 import b64encode
from datetime import datetime,timedelta
import json
import re
import unittest
from app import create_app,db
from app.models import User,Post
from tests import TestConfig
class APITestCase(unittest.TestCase):
'''测试API'''
def setUp(self):
self.app = create_app(TestConfig) # ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utils
~~~~~
Utility methods.
I'm including this file in the skeleton because it contains methods I've
found useful.
The goal is to keep this file as lean as possible.
:author: Jeff Kereakoglow
:date: 2014-11-05
:copyright: (c) 201... |
# -*- coding: utf-8 -*-
import asyncio
import aiofiles
import aiohttp
import orjson
from pathlib import Path
from cmyui import log, Ansi
from constants.gamemodes import GameMode
from constants.mods import Mods
__all__ = 'PPCalculator',
BEATMAPS_PATH = Path.cwd() / '.data/osu'
class PPCalculator:
"""Asynchronou... |
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth import get_user_model
from django.core.paginator import Paginator
from django.db.models import Q
from django.utils import timezone
from .models import Post, Comme... |
def score(x, y):
distance = x ** 2 + y ** 2
return 10 if distance <= 1 ** 2 else 5 if distance <= 5 ** 2 else 1 if distance <= 10 ** 2 else 0 |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... |
_base_ = [
'../../_base_/default_runtime.py',
'../../_base_/schedules/schedule_adam_step_20e.py',
'../../_base_/recog_pipelines/abinet_pipeline.py',
'../../_base_/recog_datasets/ST_MJ_alphanumeric_train.py',
'../../_base_/recog_datasets/academic_test.py'
]
train_list = {{_base_.train_list}}
test_li... |
#!/usr/bin/env python3
import cmath
import math
import sys
SQUARED = "\N{SUPERSCRIPT TWO}"
ARROW = "\N{RIGHTWARDS ARROW}"
if not sys.platform.startswith("linux"):
SQUARED = "^2"
ARROW = "->"
def get_float(msg, allow_zero):
x = None
while x is None:
try:
x = float(input(msg))
... |
#!/usr/bin/env python3
# -*-coding: utf-8-*-
# Author : Christopher L
# Blog : http://blog.chriscabin.com
# GitHub : https://www.github.com/chrisleegit
# File : asort.py
# Date : 2016/08/22 11:12
# Version: 0.1
# Description: A very simple python script that can sort items alphabetically.
from __future__ import ... |
# vim: set ts=4 sw=4 et: coding=UTF-8
from .rpmsection import Section
class RpmCheck(Section):
"""
A class providing methods for %check section cleaning.
Replace various troublemakers in check phase.
"""
def add(self, line: str) -> None:
line = self._complete_cleanup(line)
# s... |
"""drf_cloudstorage URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cl... |
# -*- coding: utf-8 -*-
"""
Test suite for PEP 380 implementation
adapted from original tests written by Greg Ewing
see <http://www.cosc.canterbury.ac.nz/greg.ewing/python/yield-from/YieldFrom-Python3.1.2-rev5.zip>
"""
import unittest
import inspect
from test.support import captured_stderr, disable_gc, gc_collect
f... |
# menu driven program to draw a circle using
# A) Mid point circle drawing algorithm
# B) Polar circle generation algorithm
# C) Non-Polar circle generation algorithm
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import sys
from math import pi, sin, cos, sqrt
xc = 0
yc = 0
r = 0
def i... |
import unittest
from unittest.mock import (
patch,
)
from minos.common import (
Config,
ConfigV1,
MinosConfigException,
)
from tests.utils import (
BASE_PATH,
FakeBrokerClientPool,
FakeBrokerPort,
FakeBrokerPublisher,
FakeBrokerSubscriberBuilder,
FakeCustomInjection,
FakeDat... |
import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='templateitemname',
parent_name='layout.polar.radialaxis.tickformatstop',
**kwargs
):
super(TemplateitemnameValidator, sel... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from nose.tools import raises
from construct import actionparams
from construct.errors import ArgumentError
params_0 = dict()
params_1 = dict(
str_arg={
'label': 'String Argument',
'help': 'A String Argument',... |
"""
This library comes with a comprehensive testing suite that checks for API compliance, input type
handling, change map handling, and more. Not all tests are run for every learner; tests specific
to certain estimators like [supervised learners](../core/index.md#supervised) or [transformers](
../transformers/index.md)... |
'''
Functionality for handling citations
'''
from __future__ import absolute_import, division, print_function
import importlib
import os
import string
from operator import attrgetter
import libtbx.load_env
import libtbx.phil
from libtbx import str_utils
from libtbx.utils import to_unicode
# ========================... |
# Copyright (c) Facebook, Inc. and its affiliates.
import collections
import gc
import os
from bisect import bisect
import requests
import torch
import tqdm
import yaml
from torch import nn
def lr_lambda_update(i_iter, cfg):
if (
cfg["training_parameters"]["use_warmup"] is True
and i_iter <= cfg[... |
#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
class Solution(object):
def test65(self):
'''
题目:一个最优美的图案。
'''
return ""
if __name__ == "__main__":
solution = Solution()
solution.test65() |
import torch
import torch.nn as nn
import numpy as np
# from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler
from ..builder import DETECTORS, build_backbone, build_head, build_neck
from .base import BaseDetector
from tqdm import tqdm
from mmdet.datasets import build_dataloader, build_dataset
fro... |
import io
import os
import sys
import tempfile
from unittest import skipIf
from django.core.files.base import ContentFile
from django.http import FileResponse
from django.test import SimpleTestCase
class FileResponseTests(SimpleTestCase):
def test_file_from_disk_response(self):
response = FileResponse(op... |
# coding: utf-8
from sqlalchemy import and_
from sqlalchemy import bindparam
from sqlalchemy import Computed
from sqlalchemy import exc
from sqlalchemy import except_
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import Index
from sqlalchemy import Integer
from sqlalchemy import literal
... |
from solutions.SUM import sum_solution
class TestSum:
def test_sum(self):
assert sum_solution.compute(1, 2) == 3 |
# -*- coding: utf8 -*-
__all__ = ('Channel',)
import datetime
from sqlalchemy import func
from notifico import db
from notifico.models.bot import BotEvent
class Channel(db.Model):
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.TIMESTAMP(), default=datetime.datetime.utcnow)
channel ... |
"""sphinx config."""
from datetime import datetime
project = "haxo"
author = "rahul"
master_doc = 'index'
copyright = f"2020, {author}"
copyright = f"{datetime.now().year}, {author}"
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinx_autodoc_typehints"]
html_static_path = ["_static"] |
"""Tool for displaying a selection of colours."""
import math
import pathlib
from PIL import Image, ImageDraw, ImageFont
_font_path = str(pathlib.Path(__file__).parent.absolute() / 'res' / 'font.ttf')
FONT = ImageFont.truetype(_font_path, size=20)
class ColourDisplayer:
"""Tool for displaying a selection of co... |
# !/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Time : 2022/04/14 08:36
# @Author : clear
# @FileName: ms_gpu.py
import os
os.environ['TL_BACKEND'] = 'mindspore'
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
import sys
sys.path.insert(0, os.path.abspath('../../'))
import time
import numpy as np
import tensorlayerx ... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
#!/usr/bin/env python3
# Copyright 2021 EMBL - European Bioinformatics Institute
#
# 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 requi... |
class Queue:
def __init__(self):
self.data = []
def __str__(self):
values = map(str, self.data)
return ' <- '.join(values)
def enque(self, val):
self.data.append(val)
def deque(self):
return self.data.pop(0)
def peek(self):
return s... |
import torch
import numpy as np
from autograd.numpy import sqrt
def gen_image_resgld(label, FLAGS, model, im_neg, num_steps, sample=False):
im_noise = torch.randn_like(im_neg).detach()
T_multiply=0.9
T = 0.9
var=0.1
resgld_beta_high = im_neg
resgld_beta_low = im_neg
swaps = 0
noise_s... |
from app import userfiles as user_files
import workers.dockerfilebuild
import requests
w = workers.dockerfilebuild.DockerfileBuildWorker(100, None)
resource_key = "5c0a985c-405d-4161-b0ac-603c3757b5f9"
resource_url = user_files.get_file_url(resource_key, "127.0.0.1", requires_cors=False)
print(resource_url)
docker_... |
"""
@Time :1:08 下午
@Author :li
@decs :demo
"""
import time
import interface
from interface.interface_enum import InterfacePath
# 1.清除本地缓存
interface.clean_local()
# 2.运行mitmproxy:默认运行InterfaceMonitor类,默认端口为8080,也可以自己设定
interface.run()
# interface.run(scipt='ResponseMock, InterfaceMonitor', port='8888')
# 3.调用接口,... |
#!/usr/bin/env python
import curses
import logging
import npyscreen
from worden.src.api import api_man
from worden.src.api.trackable_object import TrackableObject
from worden.src.ui.list_and_details_form import ListAndDetailsForm
from worden.src.ui.map_form import MapForm
import worden.const as const
class WordenApp... |
"""
Evaluating index's fluence on performance to achieve certain recall.
Note: if using perf to profile the program, use sudo to run the commands (already
hardcoded in this script), make sure the user have sudo access
Example Usage:
python experiment_2_algorithm_settings.py --dbname SIFT1000M --topK 100 --rec... |
import sys
from time import sleep
import getpass
from trezorlib.client import ProtocolMixin, BaseClient
from trezorlib.transport import enumerate_devices, get_transport, TransportException
from trezorlib import tools
from trezorlib import messages as proto
import binascii
from shadowlands.credstick import Credstic... |
from django.db import models
from django.utils import timezone
import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.auth.models import User
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', User)
class Visitor(mode... |
##########################################################################
#
# Copyright (c) 2011-2012, Image Engine Design 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:
#
# ... |
# Generated by Django 3.1.6 on 2021-02-08 18:36
import django.db.models.deletion
from django.apps.registry import Apps
from django.conf import settings
from django.db import migrations, models
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
import authentik.lib.models
def migrate_from_groupmembe... |
from alluvian.commands.mud_command import MudCommand
import alluvian.globals as glob
from util.colors import Colors
from util.asciimap import show_map
class Look(MudCommand):
key = 'look'
aliases = ['l', 'loo']
def execute(self):
user = glob.sessions[self.actor]
msg = f'{Colors.fg.BCYAN... |
# Create alias
from nodenet.interface.console.commons import *
from nodenet.interface.console.neuralneteditor import * |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Helio de Jesus and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestVehicle_lastmile(unittest.TestCase):
pass |
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... |
#!/usr/bin/env python
import rospy
import time
from std_msgs.msg import Float64
import random
# 90 degrees = 1.57, 45 = 0.785
# global
# ================================================================
# RIGHT
def right_gripper_open_half():
print("-----> right_gripper_open")
pub_right_arm_gripper.publish(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.