content stringlengths 5 1.05M |
|---|
import numpy as np
import cv2
mpii_edges = [[0, 1], [1, 2], [2, 6], [6, 3], [3, 4], [4, 5],
[10, 11], [11, 12], [12, 8], [8, 13], [13, 14], [14, 15],
[6, 8], [8, 9]]
def show_2d(img, points, c, edges):
num_joints = points.shape[0]
points = ((points.reshape(num_joints, -1))).astype(np... |
import re
from django.shortcuts import render
# Create your views here.
from django_redis import get_redis_connection
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.viewsets import GenericViewSet
from goods.models import SKU
from users.models import User, Ad... |
"""
for test purpose
usage: python3 -m Arknights.ocr [language=zh-hans-cn] filename
"""
import importlib
import sys
import os
from pprint import pprint
ocr = importlib.import_module(__package__)
from PIL import Image
if __name__ == '__main__':
if 'OCR_ENGINE' in os.environ:
engine = ocr.get_engine(os.en... |
#! /usr/bin/env python
# Standard libraries
import yaml
import rospy
import math
import pygame
# My libraries
import scripts.colors as colors # Import all colors
import scripts.widgets as widgets # Import all my widgets
import scripts.pages as pages # Import all pages
from scripts.fonts impor... |
import logging
from ..main_node import advertise
from ..gazebo.gz_msgs.float64_pb2 import Float64
logger = logging.getLogger(__name__)
class SimSolenoid:
def __init__(self, channel, solenoid_dict):
self.publisher = advertise(
'simulator/pneumatic/%s/%s' % (0, channel),
... |
import app
import cv2
from datetime import timedelta
from flask import render_template
from flask import request,redirect,flash,url_for
from flask import send_from_directory
import matlab.engine
import numpy as np
import scipy.io as sio
import os
import time
from werkzeug.utils import secure_filename
from . import main... |
n = int(input())
ans = 0
for i in range(n):
a, b, c, d = [int(e) for e in input().split()]
sum = 0
if a + b + c + d < 100:
sum += a + b + c + d
else:
sum += a - b - c - d
ans += sum
print(ans, "anos de vida")
|
from __future__ import annotations
from typing import TYPE_CHECKING
from telnetlib3 import TelnetReader, TelnetWriter
from .base import AbstractClient
if TYPE_CHECKING:
from ..servers.telnet import TelnetServer
class TelnetClient(AbstractClient[str]):
reader: TelnetReader
writer: TelnetWriter
_st... |
from django.urls import path
from team_app.views import TeamView
app_name = "team_app"
urlpatterns = [
path('', TeamView.as_view(), name="index")
]
|
import json
import random
from django.shortcuts import render, redirect
from django.http import Http404
from django.views import View
from hypernews.settings import NEWS_JSON_PATH, MAX_NEWS_ID
from collections import defaultdict
from datetime import datetime
def read_json(path: str) -> list[dict]:
with open(path... |
import os
from io import BytesIO
import pytest
import numpy as np
from stable_baselines import A2C, ACER, ACKTR, DQN, PPO1, PPO2, TRPO
from stable_baselines.common.identity_env import IdentityEnv
from stable_baselines.common.vec_env import DummyVecEnv
MODEL_LIST = [
A2C,
ACER,
ACKTR,
DQN,
PPO1,
... |
from collections import defaultdict
from generativemagic.spelling import Language
class IsSpelled:
"""returns a card spelled from top"""
def __init__(self, language: Language, deltas: list):
self._language = language
self._deltas = deltas
self._cached_lengths = defaultdict(set)
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-10 21:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('greenhouse', '0002_auto_20171009_2345'),
]
operations = [
mig... |
from abc import ABC
from typing import List, Type
import libcst as cst
from libcst.codemod import ContextAwareTransformer, VisitorBasedCodemodCommand
class BaseCodemodCommand(VisitorBasedCodemodCommand, ABC):
"""Base class for our commands."""
transformers: List[Type[ContextAwareTransformer]]
def trans... |
from dataclasses import dataclass
from ray.util.sgd.v2.backends.backend import BackendExecutor, BackendConfig
@dataclass
class TorchConfig(BackendConfig):
def backend_name(self):
return "torch"
def setup_torch_process_group():
pass
def shutdown_torch():
pass
class TorchExecutor(BackendExecu... |
# Generated by Django 3.1.4 on 2021-01-07 22:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('products', '0002_auto_20210106_1155'),
('orders', '0002_auto_20210107_1042'),
]
operations = [
migr... |
# Copyright 2020-2021 Hewlett Packard Enterprise Development LP
#
# 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 appl... |
from app_version import get_versions
__version__, VERSION = get_versions('django-permission', allow_ambiguous=True)
# load shortcut functions
from permission.utils.logics import add_permission_logic
from permission.utils.logics import remove_permission_logic
# autodiscover
from permission.utils.autodiscover import au... |
# file openemory/publication/views.py
#
# Copyright 2010 Emory University General Library
#
# 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/LICE... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-12-16 21:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Coach'... |
# Manipulate sys.path to allow tests be run inside the build environment.
import os, sys, glob
scriptdir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.dirname(glob.glob(scriptdir+'/../../../build-root/install*/vpp-api/lib64/vpp_api.so')[0]))
sys.path.append(os.path.dirname(glob.glob(scriptdir+'/... |
# Rest Framework
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
# Client models
from apps.clients.models import ClientModel
# Client serializers
from apps.clients.serializers import ClientSerializer
class ClientViewSet(viewsets.... |
#!/usr/bin/env python3
# coding: utf-8
# Copyright 2022 Natasha Osmani
# Copyright 2016 Abram Hindle, https://github.com/tywtyw2002, and https://github.com/treedust
#
# 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 ... |
import sys
def send_commands(commands):
"""
Sends a list of commands to the engine.
:param commands: The list of commands to send.
:return: nothing.
"""
print(" ".join(commands))
sys.stdout.flush() |
import ipaddress
import click
from tabulate import tabulate # pylint: disable=import-error
from helpers.config import config # pylint: disable=import-error,no-name-in-module
from helpers.api import APIv2 # pylint: disable=import-error,no-name-in-module
from helpers.logger import Logger # pylint: disable=import-error,... |
import os
import argparse
import time
import _thread
import _init_paths # pylint: disable=unused-import
from urllib import request
import cv2
import numpy as np
import base64
import urllib3
import uuid
import torch
from rcnn.core.config import cfg, merge_cfg_from_file, merge_cfg_from_list, assert_and_infer_cfg
fro... |
# Generated by Django 2.0.2 on 2019-01-10 19:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ClasseFiltro',
fields=[
... |
import silence_tensorflow.auto
from tensorflow.python.keras.models import load_model
from tensorflow.compat.v1 import InteractiveSession
from tensorflow.compat.v1 import ConfigProto
import numpy as np
import cv2
__author__ = "Arthur Fortes da Costas"
__copyright__ = "Copyright 2021"
__credits__ = ["Arthur Fortes"]
__... |
#!/usr/bin/env python
from os.path import join as j
import pandas as pd
#from bokeh.charts import output_file, show, Line
from bokeh.plotting import figure, output_file, show, ColumnDataSource
from bokeh.models import HoverTool, CrosshairTool
from bokeh.models import DataRange1d as bmdr
from numpy import arange
#todo:... |
# coding: utf-8
"""数据转换插件抽象
"""
from abc import (
ABCMeta,
abstractmethod
)
class AbstractDataHandler(object):
__metaclass__ = ABCMeta
@abstractmethod
def __call__(self, context):
pass
def _handle_record(self, record, collector=None):
"""处理记录
:param record 记录
... |
from bokeh.io import output_notebook, show
from bokeh.layouts import column, row, Spacer
from bokeh.models import Div
from bokeh.models.widgets import Select
from bokeh import palettes
from bokeh.io import curdoc
#from bokeh.resources import INLINE#
from lume_model.utils import load_variables
from lume_epics.client.w... |
# Running Time of Algorithms
# Developer: Murillo Grubler
# https://www.hackerrank.com/challenges/runningtime/problem
n = int(input().strip())
arr = [int(ar) for ar in input().strip().split(' ')]
count = 0
for i in range(len(arr)):
k = i
key = arr[i]
while k > 0 and key < arr[k - 1]:
arr[k] = arr[... |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
import sklearn
from sklearn.linear_model import LogisticRegression
def get_clouds():
Nclass = 500
D = 2
X1 = np.random.randn(Nclass, D) + np.array([0, -2])
X2 = np.random.randn(Ncla... |
import itertools
from collections import defaultdict
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from celluloid import Camera
from matplotlib import cm, pyplot
from mpl_toolkits.mplot3d import Axes3D
from scipy.constants import constants
from scipy.ndimage import gaussia... |
import os
import csv
import click
from ..model.card import Card
@click.command()
@click.argument('path')
@click.option('--frontalcol', '-fc', type=click.INT, default=0, help='Column index of Frontal Face')
@click.option('--hiddencol', '-hfc', type=click.INT, default=1, help='Column index of Hidden Face')
@click.option... |
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
async def foo():
async for a in b:
c
|
import ability
# import stats
# import stats.buffs as buffs
import ability.talents as talents
import ability.glyphs as glyphs
class CharacterError(BaseException):
pass
class BaseCharacter:
def __init__(self,abilities,stats,talents,buffs,glyphs):
print(abilities,stats,talents,buffs,glyphs)
# fo... |
import pymc3 as pm
import numpy as np
import matplotlib.pylab as plt
data = np.ma.masked_values([42] * 100 + [-1] * 100 + [42] * 100, value=-1)
with pm.Model() as model:
s = pm.GaussianRandomWalk('s', sd=1e-2, shape=len(data))
n = pm.Normal('n', mu=pm.math.exp(s), observed=data)
trace = pm.sample()
plt.... |
import math
import os
import torch
import torch.distributions.constraints as constraints
import pyro
from pyro.optim import Adam, SGD
from pyro.infer import SVI, Trace_ELBO, config_enumerate
import pyro.distributions as dist
from pyro.infer.autoguide import AutoDelta
from pyro import poutine
from pyro.poutine impor... |
from django.conf.urls import include, url
urlpatterns = [
url('accounts/',
include('rest_registration.contrib.verification_redirects.urls')),
]
|
cd cloudapi
mkdir output
python -m grpc_tools.protoc -I . -I third_party/googleapis --python_out=output --grpc_python_out=output google/api/http.proto google/api/annotations.proto yandex/cloud/api/operation.proto google/rpc/status.proto yandex/cloud/operation/operation.proto yandex/cloud/ai/stt/v2/stt_service.proto
|
from pylab import *
import postgkyl as pg
style.use('../code/postgkyl.mplstyle')
E0 = 1.0
w = 0.5
def wNR(t):
wx = E0/(1-w**2)*(sin(t)-w*sin(w*t))
wy = E0/(1-w**2)*(cos(t)-cos(w*t))
return wx, wy
T = linspace(0, 100, 5000)
wx, wy = wNR(T)
def plotFig(i,fr):
print("Working on %d ..." % i)
figure... |
# Copyright IBM All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Source of truth for the dse_do_utils version.
The versions in `setup.py` and `/docs/source/conf.py` are automatically populated from here.
Best practice to keep version here, in a separate file.
See https://stackoverflow.com/questions/4585... |
# Leetcode 617. Merge Two Binary Trees
#
# Link: https://leetcode.com/problems/merge-two-binary-trees/
# Difficulty: Easy
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
# So... |
import json
import os
import shutil
import glob
import re
import warnings
import pandas as pd
import numpy as np
def reduce_df(path, output, nrows=None, chunksize=20000):
""" Load Google analytics data from JSON into a Pandas.DataFrame. """
if nrows and chunksize:
msg = "Reading {} rows in chunks of ... |
#!/usr/bin/env python3
import sys
ENTRY = "@"
WALL = "#"
DIRECTIONS = [(-1, 0), (1, 0), (0, -1), (0, 1)]
# check if input arg is provided
if len(sys.argv) < 2:
print("Santa is not happy, some of the arguments are missing")
sys.exit(1)
# read input
with open(sys.argv[1]) as file:
grid = [e.rstrip("\n") ... |
# -*- coding: utf-8 -*-
"""Gaussian input plugin."""
from __future__ import absolute_import
import os
from shutil import copyfile, copytree
import six
from six.moves import map, range
from aiida.orm import Dict, FolderData, List, RemoteData, SinglefileData
from aiida.common import CalcInfo, CodeInfo, InputValidationEr... |
class Solution:
def longestOnes(self, arr: List[int], k: int) -> int:
left = 0
longest = 0
n = len(arr)
for right in range(n):
if arr[right] == 0:
k-=1
if k < 0:
while left < n and arr[left] != 0:
... |
import sys
import os
import pdb
import torch
import matplotlib.pyplot as plt
sys.path.append("..")
import stats.kernels
import stats.gaussianProcesses.eval
def test_GaussianProcess_eval():
nSamples = 2000
samplesLow = 0
samplesHigh = 20
k0Scale, k0LengthScale, k0Period = 1, 1, 1/2.5
k1Scale, k1Len... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from spaceone.api.power_scheduler.plugin import controller_pb2 as spaceone_dot_api_do... |
#!/usr/bin/env python
#
# normalize_tags.py <norm. factor, default= 1000000> <shifted_sgr_files...>
#
# count total tags in (shifted) sgr file, normalize tags at each position by factor (norm. factor) / total
import sys
def _main(args):
if len(args) < 2:
print "usage:\n\nnormalize_shifted_tags.py <norm. ... |
from .settings_class import Settings
from .env import env_bool, env_int, env_list, env_str
from .exceptions import ImproperConfigurationException
settings = Settings()
|
#__BEGIN_LICENSE__
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The GeoRef platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in complianc... |
cont = soma = 0
while True:
numero = int(input('Digite um valor [999p/parar]: '))
if numero == 999:
break
cont += 1
soma += numero
print(f'Foram digitados {cont} números e a soma de todos foi: {soma}')
|
from Control import Control
import numpy as np
class UpdateGraph:
def update_plot_data(self):
# update ate o graph range
if self.y.size < (self.graphRange / self.sampleTimeSec):
#valor multiplicado pela tensão do arduino
self.mv_value = 5 * self.board.analog[self.analogPor... |
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copy... |
# -*- coding: utf-8 -*-
import os
import torch
import librosa
import numpy as np
def str2bool(value):
return str(value).lower() in ('yes', 'true', 't', '1')
def get_from_registry(key, registry):
if hasattr(key, 'lower'):
key = key.lower()
if key in registry:
return registry[key]
els... |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_tmy3page(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(900, 620)
MainWindow.setMinimumSize(QtCore.QSize(900, 620))
MainWindow.setMaximumSize(QtCore.QSize(900, 620))
MainWi... |
"""Run scheduled jobs."""
from django.core.management.base import BaseCommand, CommandError
from django_future.jobs import run_jobs
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'-d', '--delete-completed',
action='store_true',
dest... |
#!/usr/bin/python
import socket
import sys
# A UDP server
# Set up a UDP server
UDPSock = socket.socket(socket.AF_INET6,socket.SOCK_DGRAM)
# Listen on port 21567
# (to all IP addresses on this system)
listen_addr = ("",5000)
UDPSock.bind(listen_addr)
# Report on all data packets received and
# where they came from... |
import unittest
import os
from programytest.aiml_tests.client import TestClient
from programy.config.sections.brain.file import BrainFileConfiguration
class BasicTestClient(TestClient):
def __init__(self):
TestClient.__init__(self)
def load_configuration(self, arguments):
super(BasicTestClien... |
"""
@author: Jun Wang
@date: 20201012
@contact: jun21wangustc@gmail.com
"""
import os
import sys
import math
import multiprocessing
import cv2
sys.path.append('/export/home/wangjun492/wj_armory/faceX-Zoo/face_sdk')
from core.image_cropper.arcface_face_recognition.FaceRecImageCropper import FaceRecImageCropper
def cr... |
from rkg.restricted.aurora_etl.projects.roam.rhd_100k.organize import Roam100kRHDCanonicalDataClient
from nltk.tokenize import sent_tokenize
from clean_rhd import normalize, tokenize
import csv
import os
import boto3
print('Loading Data...')
client = Roam100kRHDCanonicalDataClient()
s3 = boto3.client('s3')
folder = '... |
class PalindromizationDiv2:
def getMinimumCost(self, X):
def p(n):
s = str(n)
return s == s[::-1]
return next(i for i in xrange(X+1) if p(X+i) or p(X-i))
|
# Functional Redundancy Resolution
from math import pi, ceil
from typing import List
import numpy as np
from src.kinematics.forward_kinematics import axang2tform
from src.kinematics.forward_kinematics import geometric_jacobian, right_generalized_inverse_jacobian, forward_kinematics
from src.kinematics.joints import B... |
# (c) [Muhammed] @PR0FESS0R-99
# (s) @Mo_Tech_YT , @Mo_Tech_Group, @MT_Botz
# Copyright permission under MIT License
# All rights reserved by PR0FESS0R-99
# License -> https://github.com/PR0FESS0R-99/DonLee-Robot-V2/blob/Professor-99/LICENSE
from pyrogram import Client, __version__
from DonLee_Robot_V2 import LOGGER, ... |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2013 Contributor
#
# 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 Li... |
#!/usr/bin/env python
# coding: utf-8
# systems tools
import os
import shutil
import sys
import time
import sys
import signal
import random
# multiprocess
import threading
import psutil
#format
import string
import json
#sqlite
import sqlite3
#args
import argparse
#maths
import numpy as np
#FIFO
from collections... |
# -*- coding: utf-8 -*-
import json
import boto3
import requests
import csv
MR_ENDPOINT = 'http://files.export.gov/ng_mr.txt'
CCG_ENDPOINT = 'http://files.export.gov/ng_cgg.txt'
REPORT_TYPE_HASH = {'bmr11': 'Best Market Research', 'ccg1': 'Country Commercial Guide'}
s3 = boto3.resource('s3')
def handler(event, cont... |
from django.apps import AppConfig
class PastebinConfig(AppConfig):
name = 'pastebin'
|
"""
.. _ex-array-classes:
=====================================
Creating MNE objects from data arrays
=====================================
In this simple example, the creation of MNE objects from
numpy arrays is demonstrated. In the last example case, a
NEO file format is used as a source for the data.
"""
# Author:... |
# (C) Copyright 2005-2021 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
import hashlib
import logging
import os
import re
import time
from multiprocessing.dummy import Pool as ThreadPool
import pandas as pd
import psycopg2
import psycopg2.extras
import sqlalchemy
from app import cache
from app.book import Book
def cache_key_create(*args):
args = [element for element in args]
k... |
from datapackage_pipelines.wrapper import ingest, spew
import logging
from datapackage_pipelines.utilities.resources import PROP_STREAMING
from datetime import datetime
def get_source_data(resource, source_data):
for row in resource:
yield row
source_data.append(row)
def get_parsed_data(source_d... |
import pandas as pd
from .functions import sort_strings
class FeatureNotSupported(Exception):
"""Not supported Feature type."""
pass
class BaseFeature(object):
"""Base Feature class that every other Feature Class should inherit from.
"""
feature_type = None
"""
feature_type: should be o... |
import cv2
import numpy as np
def increment_blinker(blink_counter, blink_flag, blink_duration=8):
blink_counter += 1
if blink_counter >= blink_duration * 2:
blink_flag = True
blink_counter = 0
elif blink_counter >= blink_duration:
blink_flag = False
return blink_counter, blink... |
# -*- coding: utf-8 -*-
import chainer
from chainer import cuda, serializers
import csv
import sys
import time
import random
import copy
import math
import os
import numpy as np
import configparser
from argparse import ArgumentParser
from os import path as pt
import skimage.io as io
from skimage import morphology
fro... |
"""A grid in the Runner Chaser Problem """
from queue import Queue
from typing import Tuple, List, Set, Optional, Union, Dict, Iterable
Loc = int
Dir = int
Coord = Tuple[int, int]
# Direction ENUMS
NORTH = 0
SOUTH = 1
EAST = 2
WEST = 3
DIRS = [NORTH, SOUTH, EAST, WEST]
DIR_STRS = ["N", "S", "E", "W"]
FOV_EXPANSION_... |
from client.TemplateManager.TemplateManager import template_manager
def member_client_routes(app):
@app.route("/members", methods=['GET'])
def get_members():
return template_manager.get_template('members.html')
@app.route("/member", methods=['GET'])
def get_member_null_id():
return te... |
# Generated by Django 3.2.8 on 2021-10-10 17:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auth0login', '0003_auto_20211011_0202'),
]
operations = [
migrations.AddField(
model_name='media',
name='enabled',
... |
# Copyright 2020 The TensorFlow 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 i... |
# coding=utf-8
"""Module to set up workflow variables for demo 3."""
import json
import logging
import time
from os.path import join
from subprocess import call
from tango import DeviceProxy
from sip_logging import init_logger
init_logger()
log = logging.getLogger('sip.itango_utils.load_sbi_config')
call(["skasip_c... |
from PyQt5 import QtWidgets
from UI import wEdgeEns
class EdgeEns(QtWidgets.QDialog, wEdgeEns.Ui_edge_ens):
"""Dialog to allow users to change temperature source.
Parameters
----------
wEdgeEns.Ui_edge_ens : QDialog
Dialog window to allow users to change the number of ensembles in a... |
from setuptools import setup
setup(name='treqs',
version='0.1',
description='Tool Support for Managing Requirements in Large-Scale Agile System Development',
url='https://github.com/regot-chalmers/treqs',
author='Eric Knauss',
author_email='eric.knauss@cse.gu.se',
license='MIT',
... |
import torch
import math
from configuration import Config
class IoU:
def __init__(self, box_1, box_2):
"""
The last dimension of box_1 and box_2 are 4(center_x, center_y, w, h)
:param box_1:
:param box_2:
"""
self.box_1 = box_1
self.box_2 = box_2
@stat... |
# -*- coding: utf-8 -*-
def hamming_weight(n: int) -> int:
count = 0
while n:
count += 1
n = (n - 1) & n
return count
if __name__ == '__main__':
print(hamming_weight())
|
'''
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "... |
'''
Adapted other ds for base_dataset_dp depth proxy method
all to compatible data format, interface function:
get_img_cb,, RGB aligned, stacked, normalized.
get_depthRaw, RGB aligned, depth raw
mainly to cope with the SLP which needs alignment. Otherwise, can simply save all aligned one to share common interface
'''... |
from setuptools import setup
setup(
name='trace_feature',
version='0.1',
description='A lib to trace bdd features.',
url='https://github.com/BDD-OperationalProfile/trace_feature',
author='Rafael Fazzolino',
author_email='fazzolino29@gmail.com',
license='MIT',
packages=[... |
from collections import Counter
N,*DMT=[int(x) for x in open(0).read().split()]
M=DMT[N]
D=DMT[:N]
T=DMT[N+1:]
t=Counter(T)
d=Counter(D)
if not t-d:
print('YES')
else:
print('NO')
|
import cv2
o = cv2.imread("cc.bmp")
cv2.imshow("original", o)
gray = cv2.cvtColor(o, cv2.COLOR_BGR2GRAY)
ret, binary = cv2.threshold(gray, 127, 255, cv2.THRESH_BINARY)
contours, hierarchy = cv2.findContours(binary, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
x, y, w, h = cv2.boundingRect(contours[0])
cv2.drawContours(o, ... |
"""
Django settings for lsql project. Loads settings_shared and settings_dev or settings_deploy
depending on the value of DJANGO_DEVELOPMENT
Generated by 'django-admin startproject' using Django 3.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of ... |
from typing import Dict
from unittest import mock
from unittest.mock import Mock
import json
import pytest
from sqlalchemy.orm import Session
from starlette.testclient import TestClient
from fastapi_pagination import Params
from fidesops.api.v1.scope_registry import (
STORAGE_CREATE_OR_UPDATE,
STORAGE_READ,
... |
#!/usr/bin/env python3
import numpy as np
import matplotlib
# Force matplotlib to not use any X Windows backend (must be called befor importing pyplot)
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import scipy.optimize as optimize
from sigmoid import sigmoid
from plotData import plotData
from costFunction im... |
# -*- coding: utf-8 -*-
from django.urls import reverse
from constance.test import override_config
from conf_site.accounts.tests import AccountsTestCase
from conf_site.reviews.tests import ReviewingTestCase
from conf_site.proposals.tests.factories import ProposalFactory
from conf_site.reviews.tests.factories import ... |
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Defines main bulk of public API of auth component.
Functions defined here can be safely called often (multiple times per request),
since they ... |
import configargparse
def config_opts():
parser = configargparse.ArgumentParser(
description='func_vcf_filter.py',
config_file_parser_class=configargparse.YAMLConfigFileParser,
formatter_class=configargparse.ArgumentDefaultsHelpFormatter)
parser.add('-v', '--vcf', required=True,
... |
"""
recursion1_simple.py
Call Stack
There are limitations of recursion on a call stack.
Python limits the depth on recursion if you create a condition wherein a
very large call stack is used.
It will raise the error RecursionError: maximum recursion depth exceeded in comparison.
Some compiliers may turn them into... |
import os
import binascii
# debug config for CodeFeed
class DebugConfig(object):
DEBUG=True
TESTING=False
SECRET_KEY=binascii.hexlify(os.urandom(24))
USERNAME='debug'
PASSWORD='debug'
SQLALCHEMY_TRACK_MODIFICATIONS=False
SQLALCHEMY_DATABASE_URI='sqlite:///codefeed_debug.db'
# default conf... |
import os
def here():
return os.path.abspath(os.curdir)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.