content stringlengths 5 1.05M |
|---|
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/modules/face_geometry/protos/mesh_3d.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 goog... |
# '669': {'mean': 0.028571428571428574,
# 'raw': [0.0, 0.04, 0.0, 0.02, 0.04, 0.1, 0.0],
# 'stdev': 0.033563828927059232},
# 'sum': 764.7600000000009},
# 'total frames': 299},
def rho_v_r(data, feed):
key = [i for i in data.... |
import math
import random
inside = 1
outside = 1
count = 0
def inCircle(x, y):
#function that sees if the coordinates are contained within the circle, either returning false or true
return math.sqrt( (x**2) + (y**2) ) <= 1
while True:
count = count + 1
#random.uniform generates a 'random' number betw... |
from unittest import TestCase
from mock import MagicMock
import probe.helpers.celerytasks as module
class TestCelerytasks(TestCase):
def test_async_call_raise(self):
app = MagicMock()
app.send_task.side_effect = TimeoutError("whatever")
path, name = "p_test", "n_test"
expected = ... |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 12 12:31:44 2017
@author: Wayne
"""
from importlib import reload
import pandas as pd
import xgboost as xgb
import numpy as np
from sklearn.model_selection import train_test_split
import AuxFun
reload(AuxFun)
import logging
import time
import pickle
#%% Kic... |
import cv2
import numpy
url = 'http://192.XXX.XX.X:8080/video'
cap = cv2.VideoCapture(url)
face = cv2.CascadeClassifier('cascade.xml')
while(True):
ret, frame = cap.read()
if frame is not None:
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
faces = face.detectMultiScale(
gray... |
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from pants.backend.explorer.browser import Browser, BrowserRequest
from pants.backend.explorer.graphql.setup import graphql_uvicorn_setup
from pants.bac... |
import tests.perf.test_cycles_full_long_long as gen
gen.test_nbrows_cycle(31000 , 380)
|
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch_ros.actions import Node
from scripts import GazeboRosPaths
from launch.actions import IncludeLaunchDescription
from launch.launch_description_so... |
import pytest
import difflib
from chalicelib.checks.wrangler_checks import (
get_tokens_to_string,
string_label_similarity
)
@pytest.fixture
def in_out_cmp_score():
return [
("one", "one", "one", 1),
("one two", "onetwo", "onetwo", 1),
("One Two", "onetwo", "one two", 1),
(... |
from setuptools import find_packages, setup
setup(
name='thetaexif',
version='0.2',
author='Regen',
author_email='git@exadge.com',
description='THETA EXIF Library',
long_description=(open('README.rst').read() + '\n\n' +
open('CHANGES.rst').read()),
url='https://github.... |
import warnings
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import RandomizedSearchCV
from scipy.stats import loguniform
import pandas as pd
warnings.filterwarnings("ignore")
class Matcher:
"""
Creates matched dataset based on propensity score.
Class to create a mat... |
# python3
class Solution:
def knightProbability(self, N, K, r, c):
p = {(r, c): 1}
for _ in range(K):
p = {(r, c): sum(p.get((r + i, c + j), 0) + p.get((r + j, c + i), 0) for i in (1, -1) for j in (2, -2)) / 8
for r in range(N) for c in range(N)}
return sum(p.va... |
from django.contrib.auth import get_user_model
from django.test import RequestFactory
from ralph.assets.models.components import Ethernet, EthernetSpeed
from ralph.networks.models import IPAddress
from ralph.networks.tests.factories import IPAddressFactory
from ralph.tests import RalphTestCase
from ralph.tests.models ... |
from django.urls import path
from AT.dialogue import views
urlpatterns = [
path('command', views.ATCommand.as_view(), name='command'),
path('clear-history', views.ATClearHistory.as_view(), name='clear-history'),
]
|
# coding: utf-8
# Remove a specific judge entry from database
# Created by James Raphael Tiovalen (2021)
import slack
import ast
import settings
import config
from slackers.hooks import commands
conv_db = config.conv_handler
@commands.on("deletejudge")
def deletejudge(payload):
return
|
import torch
import numpy as np
from Discriminator import Discriminator
from Generator import Generator
from viz import *
import torch.nn.functional as F
import pickle as pkl
def test(FLAGS):
sample_size = FLAGS.eval_size
z_size = FLAGS.zsize
cuda = FLAGS.cuda
g_path = FLAGS.gpath
d_path = FLAGS.d... |
import sys
# help string for the built-in len() function; note that it's "len" not "len()",
# which is a call to the function, which we don't want
help(len)
help(sys)
# dir() is like help() but just gives a quick list of its defined symbols, or "attributes"
dir(sys)
# help string for the exit() function in the sys mo... |
# Copyright 2021 Waseda Geophysics Laboratory
#
# 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... |
"""Test parsing imports from a Python file."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
from pazel.parse_imports import get_imports
class TestParseImports(unittest.TestCase):
"""Test helper functions."""
def test_get_impor... |
#####
# This script creates the data for the facet grid to be created in R
#####
import numpy as np
import sys
import os
p1 = sys.argv[1] # phage environment
p2 = sys.argv[2] # bacterial environment
base_folder = 'alt_run/'
file_name = 'facet_plot/facet_data.txt'
if not os.path.exists(file_name):
wi... |
"""
Functional Principal Component Analysis
=======================================
Explores the two possible ways to do functional principal component analysis.
"""
# Author: Yujian Hong
# License: MIT
import skfda
from skfda.datasets import fetch_growth
from skfda.exploratory.visualization import plot_fpca_perturb... |
token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
respect_admin = False
logchannel = 000000000000000000
reportchannel = 000000000000000000 |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core.platform.profiler import iprofiler_profiler
from telemetry.core.platform.profiler import java_heap_profiler
from telemetry.core.platf... |
#-*-encoding:utf8-*-
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.template import loader
from django.http import HttpResponse
from .forms import Permiso
import datetime
import locale
# Create your views here.
formato_local = "%x "
locale.setlocale(locale.LC_ALL, "es_GT.ut... |
import numpy as np
import xarray as xr
#########################
# Density layer version #
#########################
# for later: handle the intervals just like groupby. For now workaround
# Does not handle decreasing values, this is probably related to the above
def _groupby_vert(data, group_data, bins):
# Repl... |
import click
from ..utils import Spotify
from ..utils.exceptions import AuthScopeError
@click.command(options_metavar='[<options>]')
@click.option(
'--track', 'browse_type', flag_value='track', default=True,
help='(default) Open the current track in your browser.'
)
@click.option(
'--album', 'browse_type... |
"""
Check SFP status using sfpshow.
This script covers test case 'Check SFP status and configure SFP' in the SONiC platform test plan:
https://github.com/Azure/SONiC/blob/master/doc/pmon/sonic_platform_test_plan.md
"""
import logging
import pytest
from util import parse_eeprom
from util import parse_output
from util... |
#!/usr/bin/env python
"""x"""
if __name__ == "__main__":
from spin import spin
from bottle import run, default_app
run(host="localhost", port=8080, debug=True)
|
# Copyright 2011-2014 Splunk, 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 or agreed to in wri... |
from redis import Redis
from rq import Queue
import tasks
import time
c = Redis(host=tasks.REDIS_HOST)
q = Queue(connection=c)
t0 = time.time()
jobs = []
for i in range(32):
jobs.append(q.enqueue(tasks.newkeys, 1024))
while any(not job.is_finished for job in jobs):
time.sleep(0.1)
t1 = time.time()
print(t1 -... |
from string import ascii_uppercase
from string import digits
import random
class Robot:
previous_names = []
def __init__(self):
self.name = None
self.reset()
def reset(self):
robot_name = self.__make_name()
while robot_name in Robot.previous_names:
robot_name ... |
from typing import List
from libs.configuration import Configuration
from libs.device import Device
from libs.group import Group
from libs.script import Script
class ScriptMenu:
def __init__(
self,
config: Configuration,
devices: List[Device],
groups: List[Group],
scripts:... |
# Copyright 2019 Zuru Tech HK Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
# File: generators.py
# Description: Examples on how to create and use generators in Python
# Environment: PyCharm and Anaconda environment
#
# MIT License
# Copyright (c) 2018 Valentyn N Sichkar
# github.com/sichkar-valentyn
#
# Reference to:
# [1] Valentyn N Sichkar. Examples on how to create and use generators in Py... |
#Задачи на циклы и оператор условия------
#----------------------------------------
'''
Задача 1
Вывести на экран циклом пять строк из нулей, причем каждая строка должна быть пронумерована.
'''
for i in range(1,6):
print(i,' 0')
'''
Задача 2
Пользователь в цикле вводит 10 цифр. Найти количество введеных пользовате... |
#Python学习的基本功能库
EXERCISE_VERSION=1.0
print('-'*50)
print('初始化Excrcise模块 ver:',EXERCISE_VERSION)
print('-'*50) |
import socket
def getMAC(interface='eth0'):
try:
str = open('/sys/class/net/%s/address' % interface).read()
except:
str = "00:00:00:00:00:00"
return str[0:17]
def getserial():
# Extract serial from cpuinfo file
cpu_serial = "0000000000000000"
try:
f = open('/proc/cpui... |
"""Tests for marker sizing."""
from pathlib import Path
from typing import Dict, Tuple
from unittest import mock
from pytest import approx
from sb_vision import FileCamera, Vision
from sb_vision.camera_base import CameraBase
TEST_DATA = Path(__file__).parent / 'test_data'
# The expected error for the distances of ... |
import getDataAA
import numpy as np
import os
def run():
print('Scanner de millas AA iniciado...')
data = getDataAA.get()
pMiles = np.array(data.millas[0]) # clase promocional
tMiles = np.array(data.millas[0]) # clase turista
bMiles = np.array(data.millas[0]) # clase busines
pMi... |
'''Thread-safe version of Tkinter.
Copyright (c) 2009, Allen B. Taylor
This module is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This pro... |
class CheckError(AssertionError):
pass
|
import hashlib
import os
import pickle
import random
import yaml
import torch
import logging
import git
import numpy as np
def set_seed(seed, cudnn=True):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.random.manual_seed(seed)
torch.cuda.manual_seed(seed)
if (seed is not ... |
import os
import shutil
import tempfile
from itertools import chain
from typing import Text, List, Dict
import uuid
import requests
from fastapi import File
from fastapi.background import BackgroundTasks
from fastapi.security import OAuth2PasswordBearer
from loguru import logger
from mongoengine.errors import Validatio... |
from django.urls import path
from . import views
urlpatterns = [
path('restaurant/', views.my_restaurant, name='my_restaurant'),
path('restaurant/new/', views.new_restaurant, name='new_restaurant'),
path('restaurant/detail/<pk>/', views.restaurant_detail, name='restaurant_detail'),
path('<slug>/', vie... |
from rest_framework import serializers
from apps.ticket.models import Ticket
from apps.ticket.ticket_utils import ACCESIBILITY_DICT
CONTACT_PHONES = {"PKP Intercity (Grupa PKP)": "703 200 200", "PKP TLK": "703 200 200", "PKP IC": "703 200 200",
"PKP Szybka Kolej Miejska w Trójmieście (Grupa PKP)": "... |
#!/usr/bin/env python
from .models import Tweet, VerificationTask, FirstresponderTask
|
from json import decoder
import sys
import json
sys.dont_write_bytecode = True
import atexit
from models.Connection import Connection
from models.Log import LogFile
from models.Database import DataBase
from controllers.utils import do_at_exit
def main():
try:
cfg_file = open("config.json","r")
config = jso... |
import time
import unittest
from pysmartcache.clients import CacheClient, DjangoClient, MemcachedClient, RedisClient
from pysmartcache.constants import CACHE_MISS
from pysmartcache.exceptions import ImproperlyConfigured
from tests.base import override_env
class CacheClientTestCase(unittest.TestCase):
def test_i... |
# Create the areas list
areas = ["hallway", 11.25, "kitchen", 18.0, "living room", 20.0, "bedroom", 10.75, "bathroom", 9.50]
# Print out second element from areas
print(areas[1])
# Print out last element from areas
print(areas[-1])
# Print out the area of the living room
print(areas[5])
# Create the a... |
import os
import re
import sys
import json
import time
import argparse
import requests
import logging
from typing import List
import demisto_sdk.commands.common.tools as tools
from Tests.scripts.utils.log_util import install_logging
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
PRIVATE_BUIL... |
import pandas as pd
import numpy as np
import allennlp
import io
import scispacy
import spacy
from allennlp.predictors.predictor import Predictor
import io
import pandas as pd
def identify_cancer(title, abstract):
'''Returns the answer to a query string after running through 2 APIs (Scispacy and AllenNLP)'''
... |
import os
EXAMPLES_DIR = "./examples/"
EXAMPLE_NAME_TEMPLATE = "example-policy{}.yml"
VALID_BEGINNGINGS = ["scenarios", "config"]
cwd = os.path.dirname(os.path.realpath(__file__)) + "/../docs/"
files = []
for (dirpath, dirnames, filenames) in os.walk(cwd):
for filename in filenames:
if filename.endswith(".md"... |
# fichier pour les divers tests
"""
import WordProcessing as wp
import meteo
#wp.CentreTxt(wp.gotheng, "test", wp.st7789.GREEN, wp.st7789.BLACK)
print("-start test-")
wp.tft.fill(wp.st7789.BLACK)
txt="test"
wp.tft.draw(meteo, txt, 0, 16, 0x00d3, 0x7030)
#wp.tft.rect(0, 0, 240, 135, wp.st7789.BLUE)
#wp.draw_circle(120,... |
# Generated by Django 2.2.6 on 2019-12-25 07:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('study', '0003_auto_20191225_1429'),
]
operations = [
migrations.RemoveField(
model_name='blogcontent',
name='content... |
'''
8/01 22:35 - 23:30
input: []
output: [[..],[..]]
assumption: all int, may be duplicate
DFS + de-dup
idx 0 1 2
1, 2, 2
/ \
0 1 []
/ \ ... |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""This example zeros the joystick, and prints when the joystick moves
or the buttons are pressed."""
import time
from adafruit_featherwing import joy_featherwing
wing = joy_featherwing.JoyFeatherWing()
last_x = ... |
"""
Commands for the 'Character' app that handles the roster,
stories, the timeline, etc.
"""
from datetime import datetime
from django.db.models import Q
from evennia.utils.evtable import EvTable
from server.utils.arx_utils import inform_staff, check_break, list_to_string
from commands.base import ArxComma... |
import packaging_scripts.pacman as pacman
import re
import unittest
from hypothesis import given
from hypothesis.strategies import iterables, text
from pathlib import Path
from types import GeneratorType
from unittest.mock import MagicMock, patch
# ========== Constants ==========
TESTING_MODULE = f"packaging_scripts... |
# -*- coding: utf-8 -*-
"""
Script for adding categories. These categories are intended for use when working with front-end tasks.
This script is still WIP.
How to run: python generate_test_categories.py <db_username> <db_password>
"""
import sys
import ckan.model as model
from sqlalchemy import create_engine
def ... |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
DESCRIPTION = "A SlugField for MongoEngine."
try:
LONG_DESCRIPTION = open('README.md').read()
except:
LONG_DESCRIPTION = DESCRIPTION
setup(name='mongoengine-slugfield',
version='0.0.1',
packages=find_packages(),
author='Ma... |
import json
import requests
from apmserver import ElasticTest, ServerBaseTest, integration_test
@integration_test
class LoggingIntegrationTest(ElasticTest):
config_overrides = {
"logging_json": "true",
}
def test_log_valid_event(self):
with open(self.get_transaction_payload_path()) as f:... |
# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from time import time
from scale.network.interface import Interface
# Node is considered to be active if it was seen in the last 5 seconds
NETWORK_ALIVE_TIMEOUT = 5
class Node:
def __init__(self, hostname: str) -> None:
self.hostname = hostname
self.public_key: str = None
self.interfaces... |
#!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2009-2011 by the RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of thi... |
# Copyright (C) 2010 Apple Inc. All rights reserved.
# Copyright (C) 2011 Patrick Gansterer <paroga@paroga.com>
#
# 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 abov... |
"""
This file defines minimal Tree/Node class for the PartGraph Shapes dataset
for part tree usage
"""
import os
import sys
import json
import torch
import numpy as np
from torch.utils import data
from collections import namedtuple
import utils
import kornia
import torch.nn.functional as F
impor... |
# GPU performance tests extracted from py-videocorevi Python library.
# Testing for Raspberry Pi 4 Benchmarking and device identification.
# TREASURE PROJECT 2021
import time
from time import clock_gettime,CLOCK_MONOTONIC
from time import monotonic
import fcntl
import socket
import struct
import numpy as np
from vid... |
import praw
if __name__ == "__main__":
posts = open('posts.txt', 'r')
lines = posts.readlines()
for line in lines:
line = line.decode('utf-8').rstrip('\n')
route_syntax = ['5.', ' V', '(V', ' v', '(v']
is_route = False
for syntax in route_syntax:
index = line.find(syntax)
if index != -1:
if route_... |
# Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Hypothesis strategies useful for testing ``pykube``.
"""
from string import ascii_lowercase, digits
from hypothesis.strategies import (
none, builds, fixed_dictionaries, lists, sampled_from, one_of, text,
dictionaries, tuples, integers, ... |
# -*- coding: utf-8 -*-
"""Maximum flow algorithms test suite.
"""
from functools import partial
from nose.tools import *
import networkx as nx
from networkx.algorithms.flow.utils import *
from networkx.algorithms.flow.edmonds_karp import *
from networkx.algorithms.flow.ford_fulkerson import *
from networkx.algorithm... |
from typing import List
class SortingAlgorithm:
def __init__(self, data: List[List[str]]):
self.data = data
self.high = []
self.middle = []
self.low = []
"""
Example data structure:
Name | Ability | Gender
---|---|---
John Lim | High | M
... |
"""Helpers for AIOGitHubAPI."""
from __future__ import annotations
from typing import Optional
import aiohttp
from .const import HttpMethod, Repository, RepositoryType
from .legacy.helpers import (
async_call_api as legacy_async_call_api,
short_message,
short_sha,
)
from .objects.base import AIOGitHubAPI... |
"""Sqlite database wrapper."""
from hashlib import sha256
from pathlib import Path
import typing as t
from . import generator
from .batch import group_by_file_extension
from .initializer import DotSlipbox
from .processor import process_batch
class Slipbox:
"""Slipbox main functions."""
def __init__(self, do... |
import arpy
from gzip import GzipFile
from lzma import LZMAFile
from tarfile import TarFile
# see https://github.com/viraptor/arpy/pull/5
class Deb():
def __init__( self, filename ):
super().__init__()
self.filename = filename
def _readControl( self ):
ar = arpy.Archive( self.filename )
ar.read_... |
import mock
import unittest
from pastry.exceptions import HttpError
def raise_error():
raise HttpError('message', 'statuscode')
class PastryClientTestCase(unittest.TestCase):
def test_init(self):
self.assertRaises(HttpError, raise_error)
def test_str(self):
error = HttpError('message'... |
import dbutils
import config
import log
import sys
log = log.Log()
FILEDS = ['username', 'age', 'tel', 'email']
FILENAME = "51reboot.ini"
cfg = config.CONFIG()
msg, ok = cfg.readconfig(FILENAME, 'db')
if ok:
db = dbutils.DB(msg['host'], msg['user'], msg['password'], int(msg['port']))
class User(object):
de... |
"""Settings for live deployed environments: stating, qa, production, etc."""
from .base import * # noqa
DEBUG = False
SECRET_KEY = os.environ['SECRET_KEY']
ALLOWED_HOSTS = os.environ['ALLOWED_HOSTS'].split(';')
STATIC_ROOT = os.path.join(BASE_DIR, 'public', 'static')
MEDIA_ROOT = os.path.join(BASE_DIR, 'public', ... |
#!/usr/bin/env python3
'''
Computing exponentials using recursion
'''
__project__ = "Calculate exponents using recursion"
__author__ = "michael ketiku"
def compute_exponent(a, n):
'''Computes the exponent of 'a' given 'n' '''
if n <= 1:
return a
else:
return (a * compute_exponent(a, n - ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-06-25 17:50
from __future__ import unicode_literals
from decimal import Decimal
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import djangosige.apps.cadastro.models.empresa
class Migration(migration... |
import json
import re
from threading import Thread
from typing import List, Callable, Any, TypeVar, Generic, Union
from .constants import requestMaxRetries, cacheFolder
globalCache = {}
T = TypeVar("T")
TOptList = Union[T, List[T]]
class Cache(Generic[T]):
def __init__(self, filename: str, writeToDisk=True):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Routines to get synthetic photometry from Dan Kasen's Kilonova model
- Gautham Narayan (gnarayan@stsci.edu), 20180325
"""
import sys
import os
import numpy as np
import astropy
import astropy.constants
import astropy.coordinates as c
import astropy.units as u
import ast... |
from collections import defaultdict
import aoc_helper
from aoc_helper import (
decode_text,
extract_ints,
frange,
irange,
iter,
list,
map,
range,
tail_call,
)
def rotate(facing, up, point):
new_point = list([0, 0, 0])
match facing:
case "+x":
new_point[0... |
# Faça um Programa que peça o raio de um círculo, calcule e mostre sua área.
ray = float(input('Informe o raio do curculo: '))
area = 3.14 * (ray ** 2)
print(f'A area do curculo é {area}')
|
from .coco import CocoDataset
from .builder import DATASETS
@DATASETS.register_module()
class SKUCocoDataset(CocoDataset):
CLASSES = ('item', )
|
from distutils.core import setup
setup(
name='GsFileLock',
version='0.1.0',
author='Evan Fosmark',
author_email='me@evanfosmark.com',
packages=['gsfilelock','gsfilelock.test'],
url='https://github.com/JEdward7777/GsFileLock',
license='LICENSE.txt',
description='Google Storage File locki... |
import luz
import torch
import unittest.mock as mock
class IntegerDataset(luz.Dataset):
def __init__(self, n):
x = torch.arange(start=0, end=n, step=1, dtype=torch.float)
y = x ** 2
data = [luz.Data(x=_x, y=_y) for _x, _y in zip(x, y)]
super().__init__(data)
class DummyModel(luz.... |
from nhps.distance.consensus.consensus_decoder import ConsensusDecoder
|
# -*- coding: utf-8 -*-
"""
wirexfers.utils
~~~~~~~~~~~~~~~
This module provides utility functions that are used within
WireXfers, but might be also useful externally.
:copyright: (c) 2012-2014 Priit Laes
:license: ISC, see LICENSE for more details.
"""
from Crypto.PublicKey import RSA
def lo... |
# author Serj Sintsov <ssivikt@gmail.com>, 2009, Public Domain
import sys
import time
import math
"""Output example: [######....] 75%
"""
def progress(start=0, bar_width=30):
if start > 100:
start = 100
if start < 0:
start = 0
for percent in range(start, 101):
marks = math.floor(... |
_base_ = [
'../_base_/models/mask_rcnn_r50_fpn_anchor.py',
'../_base_/datasets/coco_instance_multi_scale2.py',
'../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py'
]
work_dir = '/data2/nsathish/results/work_dirs/mrcnn_r50_multi_scale_anchor_modified/'
|
from dataclasses import dataclass, asdict, field, fields
from uncertainties import ufloat
from Helper.numbers import print_unc
SI_unit_dict = {
-2: 'c',
-3: 'm',
-6: '\u03BC',
-9: 'n',
0: ' ',
3: 'k',
6: 'M',
9: 'G',
12: 'T'
}
inv_SI_unit_dict = {k: i
for i, k... |
"""
Выполнить представление через множества и ленточное представления бинарного дерева, представленного на рис. 1
"""
from tree_module import BinaryTree
def main():
# Элемент на 1 уровне
r = BinaryTree("8")
# Элементы на 2 уровне
r_1 = r.insert_left("4")
r_2 = r.insert_right("12")
# Элемен... |
# AUTONA - UI automation server (Python 3)
# Copyright (C) 2021 Marco Alvarado
# Visit http://qaware.org
class Automator():
def MovePointer(
self,
x, y, # pixels
smooth = True):
return
def ClickButton(
self,
button,
toggle = False, down = True):
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import pytest
from flexget.api.app import base_message
from flexget.api.plugins.trakt_lookup import ObjectsContainer as oc
from flexget.utils impor... |
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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... |
import sys
n,m=map(int,input().split())
b=list(map(int,input().split()))
a=s=j=0
for i in b:
if a+i<m:a+=i
elif a+i==m:
a+=i
s=a
break
else:
temp=a
while temp+i>m:
a-=b[j]
temp=a
if a+i<m:a+=i
elif temp+i... |
from django.contrib import admin
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth.models import Permission
from django.contrib import admin
from .forms import UserCreationForm, UserChangeForm
from .models import User
# Register your models here.
@admin.reg... |
import os
import sqlite3
import csv
from flask import Flask, flash, redirect, render_template, request, session, url_for
from application import app, db, bcrypt
from application.models import Users
from application.forms import RegistrationForm, LoginForm, UpdateAccountForm, RequestResetForm, ResetPasswordForm, License... |
# -*- coding: utf-8 -*-
u"""Cliches are cliché."""
from proselint.tools import memoize, existence_check
@memoize
def check_cliches_garner(text):
"""Check the text.
source: Garner's Modern American Usage
source_url: http://bit.ly/1T4alrY
"""
err = "cliches.garner"
msg = u"'{}' is cliché.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.