text
stringlengths
2
999k
class ArgumentOutOfRangeException(ArgumentException,ISerializable,_Exception): """ The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. ArgumentOutOfRangeException() ArgumentOutOfRangeException(paramName: str) ArgumentOutO...
from haystack.utils.preprocessing import convert_files_to_dicts, tika_convert_files_to_dicts from haystack.utils.import_utils import fetch_archive_from_http from haystack.utils.cleaning import clean_wiki_text from haystack.utils.doc_store import ( launch_es, launch_milvus, launch_opensearch, launch_weav...
import time import typing import json import jsonpickle import logging import uuid from dateutil import parser from typing import List, Dict, Text, Any, Type, Optional from rasa_core import utils if typing.TYPE_CHECKING: from rasa_core.trackers import DialogueStateTracker logger = logging.getLogger(__name__) ...
"""Interface with Sphinx.""" import datetime import logging import multiprocessing import os import sys from sphinx import application, locale from sphinx.cmd.build import build_main from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.config import Config as SphinxConfig from sphinx.errors import Sphin...
from django.core.exceptions import FieldError from django.core.validators import ValidationError from django.db.models import Q from powerlibs.django.restless.http import Http400, HttpError class PaginatedEndpointMixin: def get(self, request, *args, **kwargs): limit = request.GET.get('_limit', None) ...
from __future__ import print_function # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- import numpy as n...
#! /usr/bin/env python3 import os import sys import errno import argparse import re from pprint import pprint import json #from nltk.tokenize import sent_tokenize # Logging import logging from logging import handlers LOGGER = logging.getLogger(__name__) SH = logging.StreamHandler() FH = logging.handlers.RotatingF...
# Generated by Django 3.1.4 on 2021-01-02 06:07 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): dependencies = [ ('backend', '0018_adapt_json_field_to_django_3_1'), ] operations = [ ...
import asyncio import pytest import time from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward from flax.protocols.full_node_protocol import RespondBlock from flax.server.server import FlaxServer from flax.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol fro...
import settings import pygame as pg class Wall: def __init__(self, position, kind): if type(position) == pg.Vector2: self.pos = position * 1 else: self.pos = pg.Vector2(position) if kind == "vertical": self.vec = pg.Vector2(0, settings.ROOM_SIZE) ...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pickle import matplotlib #%% SF Map # Supplied map bounding box: # ll.lon ll.lat ur.lon ur.lat # -122.52469 37.69862 -122.33663 37.82986 PATH_MAP = "/home/batman/git/hack_sfpd/INPUT/sf_map_copyright_ope...
import pyb import framebuf fbuf = bytearray(160*128*2) fb = framebuf.FrameBuffer(fbuf, 160, 128, framebuf.RGB565) tft = pyb.SCREEN() fb.fill(0) fb.text("hello world", 0, 0, 0x001F) tft.show(fb)
import re import os import logging from datetime import datetime from __builtin__ import None, True import xml.etree.ElementTree as xml class Processor: """The Processor class performs all steps required for registering datasets from the assigned dropbox folder.""" # Constructor def __init__(self, tr...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Run Regression Test Suite This module calls down into individual test cases via subprocess. It will ...
# -*- coding: utf-8 -*- """Custom exceptions for the framework.""" import copy import httplib as http from flask import request from website import language class FrameworkError(Exception): """Base class from which framework-related errors inherit.""" pass class HTTPError(FrameworkError): error_msgs = {...
"""Storage for observation parameter.""" __all__ = ["ObsParamData"] from typing import Any, Dict, Hashable from astropy.coordinates import Angle from astropy.units import Quantity from tomlkit.toml_file import TOMLFile from ...utils import ParameterMapping from ...typing import PathLike class ObsParamData(Paramet...
from datetime import datetime from flask import render_template, flash, redirect, url_for, request, g, \ jsonify, current_app from flask_login import current_user, login_required from flask_babel import _, get_locale from guess_language import guess_language from app import db from app.main.forms import EditProfile...
from microbit import * import neopixel import random class Colors(): def __init__(self): self.i = -1 self.colors = ( (255, 255, 255), (255, 0, 0), (255, 255, 0), (0, 255, 0), (0, 255, 255), (0, 0, 255), (255, 0, 255) ) ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import json import os from enum impo...
import sys from abc import abstractmethod if sys.version_info < (3, 4): import abc ABC = abc.ABCMeta('ABC', (object,), {}) else: from abc import ABC from collections import namedtuple from itertools import product from .simulator import CircuitSimulator, ExecutionState from ..transforms import flatten, setu...
#!/usr/bin/env python3 from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np from sklearn.svm import LinearSVC,SVC import sys, os from model1 import Net class proj_trainer_end_end: def __init__(self,...
import cv2 import numpy as np import math import sys from random import randint from calc_ops import * import time import os def main(argv): #Accepting the 2 images from the GUI image1 = cv2.imread(sys.argv[1],0) image2 = cv2.imread(sys.argv[2],0) cols,rows = image1.shape image3 = np.zeros((cols,rows,...
# Copyright 2016 Google Inc. 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 law or a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 1 22:46:20 2020 @author: zinan """ import numpy as np from numpy import linalg as LA from BFSVM_class import Kernel from BFSVM_class import precision from imblearn.over_sampling import SVMSMOTE import math from sklearn.model_selection import train_...
# coding: utf-8 """ FlashArray REST API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 2.5 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # pyth...
import numpy as np from .output import TablePrinter from .tests import find_p_value from .inference import norm_post_sim class Results(object): def __init__(self): pass class MLEResults(Results): def __init__(self,data_name,X_names,model_name,model_type,latent_variables, results,data,inde...
import pygame from jumper.entities.bullet import Bullet from math import pi, sin, cos class BBWaveBullet(Bullet): def __init__(self, environment, position, angle, speed=1000): super().__init__(environment, position) self.speed = speed self.angle = angle self.wave_acc = 0.0 ...
from apscheduler.job import Job from cypherpunkpay.common import * class JobReport(object): #jobs_by_type: Dict[str, Job] = {} jobs_by_next_run: List[Job] = [] # Only the first occurence total: int = 0 def jobs_scheduled_until(self, dt: datetime.datetime): counter = 0 for job i...
import os from flask import Flask app = Flask(__name__) @app.route("/") def home(): return """ <h1>Hello user</h1> <img src="http://loremflickr.com/600/400"> <p><a href="/sida2"title ="Síða 2">Síða 2</a> | <a href="/sida3"title ="Síða 3">Síða 3</a></p> """ @app.route("/sida2") def sida2(): retu...
# 1. data dataset_type = "Thumos14Dataset" data_root = "data/thumos14/" img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True ) num_frames = 480 chunk_size = 32 img_shape = (224, 224) overlap_ratio = 0.25 keep_ratio = 0.4 feat_downsample = 2 expid = "3.b.i" data = dict( ...
#!/usr/bin/env python import sys from os import path import nose def run_all(argv=None): sys.exitfunc = lambda: sys.stderr.write('Shutting down....\n') # always insert coverage when running tests if argv is None: argv = [ 'nosetests', '--with-xunit', '--with-xcoverage', '--...
# coding: utf-8 import random from decimal import Decimal from django_webtest import WebTest from django.core.urlresolvers import reverse from market.core import models from tests.factories import core class DraftTestPositive(WebTest): """Test positive workflows.""" def draft_test_add_product(self): ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
"""empty message Revision ID: 87daec43f7f5 Revises: 53299b87b12d Create Date: 2017-05-14 21:12:33.971017 """ # revision identifiers, used by Alembic. revision = '87daec43f7f5' down_revision = '53299b87b12d' from alembic import op import sqlalchemy as sa def upgrade(): # ### commands auto generated by Alembic ...
import logging from PyMaSC.core.mappability import BWFeederWithMappableRegionSum from PyMaSC.core.ncc import NaiveCCCalculator, ReadUnsortedError from PyMaSC.core.mscc import MSCCCalculator from PyMaSC.utils.progress import ProgressBar logger = logging.getLogger(__name__) class SingleProcessCalculator(object): ...
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as torch_models import numpy as np from .backbones import Conv_4,ResNet def pdist(x,y): ''' Input: x is a Nxd matrix y is an optional Mxd matirx Output: dist is a NxM matrix where dist[i,j] is the square...
import time import random import cv2 import os import math import numpy as np from skimage.util import random_noise from skimage import exposure import copy def _changeLight(img, name): # random.seed(int(time.time())) flag = random.uniform(0.5, 1) #flag>1为调暗,小于1为调亮 exposure.adjust_gamma(img, ...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
from __future__ import absolute_import, print_function, division import os.path import re import codecs import unicodedata from abc import ABCMeta, abstractmethod import importlib import inspect import six from six.moves import urllib import hyperframe @six.add_metaclass(ABCMeta) class Serializable(object): """...
import unittest from programy.storage.factory import StorageFactory from programy.config.file.yaml_file import YamlConfigurationFile from programy.storage.config import StorageConfiguration from programy.clients.events.console.config import ConsoleConfiguration from programy.storage.stores.sql.engine import SQLStor...
import chess import sys # Stockfish values can be found here: https://github.com/official-stockfish/Stockfish/blob/master/src/types.h#L189 PIECE2VALUE = { None: 0, 'None': 0, 'p': -126, 'n': -781, 'b': -825, 'r': -1276, 'q': -2538, 'k': -32000, 'P': 126, 'N': 781, 'B': 825, ...
from collections import namedtuple TransitionRule = namedtuple('TransitionRule', ['start_state', 'next_state', 'is_terminal', 'requirement']) def get_best_transition(rules, config, start_state): for i, rule in enumerate(rules): if start_state == rule.start_state: candidate_index = i ...
# Copyright 2020 Google # # 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 writing, sof...
from django.urls import re_path, include from . import views app_name = 'board' urlpatterns = [ re_path(r'^$', views.post_list, name='post_list'), re_path(r'^post_new/$', views.post_new, name="post_new"), re_path(r'^post_detail/(?P<pk>\d+)/', views.post_detail, name='post_detail'), re_path(r'^post_d...
description = 'Motor bus 10' group = 'lowlevel' tango_base = 'tango://pumadma.puma.frm2.tum.de:10000/puma/' devices = dict( motorbus10 = device('nicos.devices.vendor.ipc.IPCModBusTango', tangodevice = tango_base + 'motorbus10/bio', visibility = (), ), )
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf tf.disable_eager_execution() from tensorflow.python.framework import ops as tf_ops from tensorflow.python.training import moving_averages from tensorflow.python.ops import tens...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # BME280 driver for Linux (e.g. Raspberry PI, Orange PI and every host # that supports the i2c-dev module. # # This library is inspired and heavily based on the library of the # same name by Richard Hull: https://github.com/rm-hull/bme280 # # Copyright (c) 2017 Andreas Sc...
import unittest import warnings from dataclasses import dataclass from transformers.convert_slow_tokenizer import SpmConverter from transformers.testing_utils import get_tests_dir @dataclass class FakeOriginalTokenizer: vocab_file: str class ConvertSlowTokenizerTest(unittest.TestCase): def test_spm_convert...
# coding=utf-8 # Copyright 2020-present the HuggingFace Inc. team. # # 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 ap...
author = "wklchris" copyright = "wklchris" exclude_patterns = ['_build', '**.ipynb_checkpoints'] extensions = ['nbsphinx', 'sphinx_copybutton', 'sphinx.ext.mathjax'] html_css_files = ['style.css'] html_static_path = ['../_static'] html_theme = "sphinx_rtd_theme" html_theme_options = {'canonical_url': "https://wklchris....
def main() -> None: N, K, M = map(int, input().split()) assert 1 <= N <= 10**18 assert 1 <= K <= 10**18 assert 1 <= M <= 10**18 if __name__ == '__main__': main()
from unimodals.common_models import LeNet, MLP, Constant import torch from torch import nn from datasets.avmnist.get_data_robust import get_dataloader from training_structures.unimodal import train, test import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.getcwd()))) filename_encoder = 'avmnist_uni...
"""Test cases for Zinnia's Entry""" from datetime import timedelta from django.contrib.sites.models import Site from django.test import TestCase from django.test.utils import override_settings from django.urls import reverse from django.utils import timezone from django.utils.translation import activate from django.ut...
# Copyright (c) Meta Platforms, Inc. and affiliates. import math import unittest import numpy.testing import torcharrow as ta import torcharrow.dtypes as dt # TODO: add/migrate more numeric tests class _TestNumericOpsBase(unittest.TestCase): @classmethod def setUpClass(cls): # Prepare input data as C...
class Solution: def findNumberOfLIS(self, nums: List[int]) -> int: n = len(nums) dp = [0] * n count = [0] * n dp[0], count[0] = 1, 1 for i in range(1, n): maxLen = 0 c = 1 for j in range(i): if nums[j] < nums[i]: ...
import nonebot.adapters.cqhttp.exception as exception from nonebot import require from nonebot.adapters import Bot, Event from nonebot.log import logger async def is_owner(bot: Bot, event: Event) -> bool: self_id = event.self_id group_id = event.group_id parser = require('nonebot_plugin_styledstr').parse...
import face_recognition import cv2 def test(): print("True") # path = "static/pics/" # os.chdir(path) # files = sorted(os.listdir(os.getcwd()), key=os.path.getmtime) # oldest = files[-1] # print(oldest) # detections = detector.detectObjectsFromImage(input_image = os.path.join(execution_pa...
# coding: utf-8 # Copyright (c) 2016, 2022, 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...
import pytest from celery.result import EagerResult from sndg.users.tasks import get_users_count from sndg.users.tests.factories import UserFactory @pytest.mark.django_db def test_user_count(settings): """A basic test to execute the get_users_count Celery task.""" UserFactory.create_batch(3) settings.CEL...
# Copyright 2013 IBM Corp. # # 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 writing, so...
import urllib2 from bs4 import BeautifulSoup import pickle years = range(1875, 1980) horse_list = [] def horse_pair(td, year): name = str(td.string) a = td.find("a") if a is not None and "redlink" not in a.get("href"): url = str("https://en.wikipedia.org" + a.get("href")) else: url = ...
import glob, os import pandas as pd import numpy as np from sklearn.model_selection import train_test_split def get_initial_df(workload): filename = "workloads/" + workload #if workload == "SDSC": # filename = "workloads/SDSC.swf" #if workload == "CTC": # filename = "workloads/CTC.swf" ...
# coding: utf-8 """ FINBOURNE Workflows API FINBOURNE Technology # noqa: E501 The version of the OpenAPI document: 0.1.39 Contact: info@finbourne.com Generated by: https://openapi-generator.tech """ try: from inspect import getfullargspec except ImportError: from inspect import getargs...
# try: # from roadmap_models import MODELS # except ImportError: # print('Set theoretic models must be named roadmap_models.py in same directory and initialise list of dictionaries in variable `MODELS`') # exit(1) MODELS = [ # No 1 { "DOMAIN": {1, 2, 3, 4, 5, 6, 7}, "City": {1}, ...
from .project_serializer import ProjectSerializer from .project_time_event_serializer import ProjectTimeEventSerializer from .time_event_serializer import TimeEventSerializer __all__ = [ 'ProjectSerializer', 'ProjectTimeEventSerializer', 'TimeEventSerializer' ]
import os #required for python 2.7 & >=3.3 import json from jinja2 import Template from PIL import Image import operator directory_path = os.getcwd() DATA_DIR = 'data' RML_DIR = 'rml' class Chord(object): "Empty class to hold parsed chord attributes" pass def parse_chords(filename): chords = [] with ...
import torch import torch.nn as nn import torchvision.models as models import torchvision.transforms as transforms class ChannelPoolAdaptiveAvg1d(torch.nn.AdaptiveAvgPool1d): def forward(self, input): n, c = input.size() input = input.view(n,c,1).permute(0,2,1) pooled = torch.nn.f...
import pytest from pelita.layout import parse_layout, get_random_layout, initial_positions, layout_as_str from pelita.game import run_game, setup_game, play_turn from pelita.player.team import Team def stopping(bot, state): return bot.position def randomBot(bot, state): legal = bot.legal_positions[:] ret...
import numpy as np import numba as nb import matplotlib.pyplot as plt import seaborn as sns import importlib # from numba.typed import List # from numba.typed import List import mcmc.util as util import mcmc.fourier as fourier import mcmc.L as L import mcmc.layer as layer import mcmc.randomGenerator as randomGenerator ...
import requests import random ytapikey = [ "AIzaSyDKYsF__QLc1WVvFkHR-oXThiuLz3dmtZ8", "AIzaSyDKYsF__QLc1WVvFkHR-oXThiuLz3dmtZ8", "AIzaSyDzPcLPAjFUQwNkqscSKVnV56OS6eVHFwI", "AIzaSyCSVSuqDtRGL2ak-7zQkfeJiBU8qJhnoJM", "AIzaSyDgfH_OfNgkymD72IezkFPPyhMjXSKFG5g"] rankeynum = random.randint(1, len(ytapikey)) youtube_key = y...
import re from util import log_util logger = log_util.get_logger("HTK Question") def load_question_set_continous(qs_file_name): fid = open(qs_file_name) binary_qs_index = 0 continuous_qs_index = 0 binary_dict = {} continuous_dict = {} LL = re.compile(re.escape('LL-')) for line in fid.re...
#! /usr/bin/env python # -*- coding: utf-8 -*- import urllib2 import shutil import os import subprocess import commands import sys def http_download(url, target_path): """Download file to local Args: - url(string): url request path - target_path(string): download destination Raises: ...
import os import numpy as np import tensorflow as tf from collections import deque def sample(logits): noise = tf.random_uniform(tf.shape(logits)) return tf.argmax(logits - tf.log(-tf.log(noise)), 1) def cat_entropy(logits): a0 = logits - tf.reduce_max(logits, 1, keepdims=True) ea0 = tf.exp(a0) z0...
""" compat ====== Cross-compatible functions for different versions of Python. Other items: * platform checker """ import platform import struct import sys import warnings from pandas._typing import F PY37 = sys.version_info >= (3, 7) PY38 = sys.version_info >= (3, 8) PY39 = sys.version_info >= (3, 9) PYPY = platfo...
""" Find clusters of intervals within a set of intervals. A cluster is a group (of size minregions) of intervals within a specific distance (of mincols) of each other. Returns Cluster objects, which have a chrom, start, end, and lines (a list of linenumbers from the original file). The original can then be ran throu...
from pathlib import Path from setuptools import setup, find_packages def read_requirements(path): return list(Path(path).read_text().splitlines()) base_reqs = read_requirements('requirements/core.txt') pmdarima_reqs = read_requirements('requirements/pmdarima.txt') torch_reqs = read_requirements('requirements/to...
class B(object): c1 = 0 def f(self, x): self.i1 = x l1 = self.i1 self.i2 = l1 def __init__(self, x, y): self.i2 = x self.i3 = y @classmethod def g(cls, x): cls.c2 = cls.c1 g1 = "foo" class C(B): c2 = -1 def __init__(self, x, y): s...
""" These tests requires firing up a new ec2 instance and installing the datadog agent on it. Check isitfit/tests/cost/ec2/test_functional.sh for helper commands Maybe need to use pytest.mark.skip on these tests, or move them to separate folder with some special automatic ec2 instance provisioning """ # Update this i...
import numpy as np import matplotlib.pyplot as plt x = np.linspace(-5, 3, 30) y = 1 + np.exp(-x) plt.xlim(-5, 3) plt.plot(x, y) plt.show()
from .base import * # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'REPLACE-ME' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True # SECURITY WARNING: use your actual domain name in production! ALLOWED_HOSTS = ['*'] # Database # https://docs.djangoprojec...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Core IO, DSP and utility functions.""" import os import six import audioread import numpy as np import scipy.signal import scipy.fftpack as fft import resampy from .time_frequency import frames_to_samples, time_to_samples from .. import cache from .. import util from ...
#!/usr/bin/env python """Tests for grr.parsers.rekall_artifact_parser.""" import os from grr.lib import config_lib from grr.lib import flags from grr.lib import rdfvalue from grr.lib import test_lib from grr.parsers import rekall_artifact_parser class RekallVADParserTest(test_lib.GRRBaseTest): """Test parsing ...
#!/usr/local/bin/python3 import re, json, yaml from os import path, environ, pardir import sys, datetime from isodate import date_isoformat from pymongo import MongoClient import argparse import statistics from progress.bar import Bar # local dir_path = path.dirname( path.abspath(__file__) ) pkg_sub = path.dirname(__...
#----------------------------------------------------------------------------- # # Copyright (c) 2006 by Enthought, Inc. # All rights reserved. # # Author: Dave Peterson <dpeterson@enthought.com> # #----------------------------------------------------------------------------- """ A pickle framework that supports un...
#!/usr/bin/env python3 # This file is a part of toml++ and is subject to the the terms of the MIT license. # Copyright (c) 2019-2020 Mark Gillard <mark.gillard@outlook.com.au> # See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text. # SPDX-License-Identifier: MIT import sys import os...
import math from manipulation.motion.cspace import CSpace from manipulation.motion.trajectories import PathTrajectory from manipulation.primitives.look import get_scan_path from robotics.openrave.belief_utils import sample_trajectory, sample_base_trajectory, close_gripper_trajectory, \ open_gripper_trajectory, get...
########################################### # EXERCICIO 080 # ########################################### ''' Crie um programa que vai ler vários números e colocar em uma lista. Depois disso, mostre: A) Quantos números foram digitados. B) A lista de valores, ordenada de forma decrescente. C) S...
from typing import Optional, List, Dict from ..model import Model, Entity, Property from ..block import Block from ..extensible import Writer from ..utils import decamelize, to_identifier class InfoWriter(Writer, name="info"): """Writer that creates basic information about the model""" block_types = ["entity...
# -*- coding: utf-8 -*- from pkg_resources import get_distribution, DistributionNotFound try: # Change here if project is renamed and does not equal the package name dist_name = 'multitaskpinn' __version__ = get_distribution(dist_name).version except DistributionNotFound: __version__ = 'unknown' finall...
import argparse import json import os import ray from ray._private.ray_microbenchmark_helpers import timeit RESOURCES_VALUE = 0.01 def test_placement_group_perf(num_pgs, num_bundles, num_pending_pgs): # Run the placement group performance benchmark given arguments. assert ray.cluster_resources()["custom"] >...
#!/usr/bin/env python import logging import sys import ConfigParser import os import socket import time import subprocess from string import Template import textwrap import boto.ses def format_time(epoch_time): time_format = "%Y-%m-%dT%H:%M:%S" return time.strftime(time_format, time.gmtime(epoch_time)) cla...
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
# -*- coding: utf-8 -*- # Copyright 2015, 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 applica...
# # This file is part of Bucatini. # # Copyright (c) 2021 Great Scott Gadgets <info@greatscottgadgets.com> # Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr> # # Code based in part on ``usb3_pipe``. # SPDX-License-Identifier: BSD-3-Clause """ Clock Tolerance Compensation (CTC) gateware. """ from amarant...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-12-01 06:26 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('dictionary', '0021_auto_20161121_1310'), ] ...
from typing import Any, AnyStr, Dict, Optional import requests import json import logging from requests import Response from django.utils.translation import ugettext as _ from zerver.models import UserProfile, get_user_profile_by_id, get_client, \ GENERIC_INTERFACE, Service, SLACK_INTERFACE, email_to_domain from...
import os import sys OPMAP_TO_CMAKE_FLAGS = {'BlingFireSentenceBreaker': 'OCOS_ENABLE_BLINGFIRE', 'GPT2Tokenizer': 'OCOS_ENABLE_GPT2_TOKENIZER', 'WordpieceTokenizer': 'OCOS_ENABLE_WORDPIECE_TOKENIZER', 'StringConcat': 'OCOS_ENABLE_TF_STRING', ...
from lst08 import * UA = dict() for caseid in log: for i in range(0, len(log[caseid])): ai = log[caseid][i][0] ui = log[caseid][i][1] if ui not in UA: UA[ui] = set() UA[ui].add(ai)
# -*- coding: utf-8 -*- """ Love Letter Arena object """ import itertools from loveletter.game import Game class Arena(): """ Pairs agents and compares performance. Note that agents must be of a list of tuples of the form: `(agent_str, agent_lambda)` Where `agent_str` is the display name of the...