text stringlengths 2 999k |
|---|
"""
Experiment config to evaluate a PointNav RGB policy
trained with Nav. Loss + Rotation Prediction
Supports "Clean" and the following visual corruptions
- Defocus Blur
- Motion Blur
- Spatter
- Low Lighting
- Speckle
"""
# Required imports
import glob
import os
from abc import ABC
from math import ceil
from typing ... |
import cv2
import numpy as np
import re
def read_list(f):
l = []
for line in open(f, 'r'):
l.append(line.strip())
return l
def get_identity(img_name, names):
indices = [i.start() for i in re.finditer('_', img_name)]
name = img_name[:indices[len(indices)-5]]
if name in names:
... |
class Estimator:
"""Abstract class of an estimator."""
def __init__(self, train, predict):
self.train = train
self.predict = predict
class EstimatorModel:
"""Abstract class of the model of an estimator."""
def __init__(self, weights):
self.weights = weights
|
#from Instrucciones.instruccion import Instruccion
from Compi2RepoAux.team21.Analisis_Ascendente.Instrucciones.instruccion import Instruccion
#from storageManager.jsonMode import *
from Compi2RepoAux.team21.Analisis_Ascendente.storageManager.jsonMode import *
#import Tabla_simbolos.TablaSimbolos as ts
import Compi2Repo... |
# # ⚠ Warning
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA... |
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a com... |
# Copyright (c) 2014, Palo Alto Networks
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS... |
# 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 -*-
"""
mslib.mscolab.app
~~~~~~~~~~~~~~~~~
app module of mscolab
This file is part of mss.
:copyright: Copyright 2016-2022 by the mss team, see AUTHORS.
:license: APACHE-2.0, see LICENSE for details.
Licensed under the Apache License, Version 2.0 (the "License");
... |
#!/usr/bin/env python
import os
import numpy as np
from argparse import ArgumentParser
from colorsys import hsv_to_rgb
from math import log10
from StringIO import StringIO
from re import compile
from hclust2.hclust2 import DataMatrix
__author__ = 'Francesco Asnicar'
__email__ = 'f.asnicar@unitn.it'
__version__ = '0... |
# Copyright 2020 Google, LLC.
#
# 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, ... |
from rpython.translator.translator import TranslationContext
from rpython.annotator import unaryop, binaryop
from rpython.rtyper.test import snippet
from rpython.rtyper.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin
class TestSnippet(object):
def _test(self, func, types):
t = TranslationCont... |
# Hello World
print("Hello World")
print()
# Hello @FirstName
first_name = input("Please insert your first name 🥺")
print("Your first name is: " + first_name.upper())
# Hello @LastName
last_name = input("Please insert your last name 🥺")
print("Your last name is: " + last_name.lower())
# Hello @FullName
print("Your... |
from django.contrib import admin
from .models import Sim
from .models import Whisper
@admin.register(Sim)
class SimAdmin(admin.ModelAdmin):
pass
@admin.register(Whisper)
class WhisperAdmin(admin.ModelAdmin):
pass
|
from gensim.models.fasttext import FastText
import argparse
import numpy as np
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('model')
args = parser.parse_args()
model = FastText.load(args.model)
print('vocab size:', len(model.wv.vocab))
word = input('check si... |
# Copyright 2014 Google LLC
#
# 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, s... |
def main():
# pyPrint()
# pyDataType() #TODO: crud on data type - https://www.programiz.com/python-programming/list
pyIterator()
# pyFunction()
# pyClass()
# pyModule()
# pyPackage()
# PRINT
def pyPrint():
a = 10
print('hi', a, "hello")
print('hi', a, "hello", sep='#', end='@\n')
print('hi {} hello'.form... |
#!/usr/bin/python3
template = """
Actor "ACSUtils_CF_{flag}_0" : CustomInventory
{{
states
{{
Pickup:
TNT1 A 0 A_ChangeFlag("{flag}", false)
stop
}}
}}
Actor "ACSUtils_CF_{flag}_1" : CustomInventory
{{
states
{{
Pickup:
TNT1 A 0 A_ChangeFlag("{flag}", true)
stop
}}
}}
"""
def main():
flags = open('... |
import logging
import sys
TRACE_LEVEL = 5
logger = logging.getLogger("hashi")
logger.setLevel(logging.INFO)
default_handler = logging.StreamHandler(sys.stdout)
default_handler.setFormatter(
logging.Formatter("[%(asctime)s %(name)s] %(levelname)s: %(message)s")
)
logger.addHandler(default_handler)
def trace(self... |
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from numpy.core.defchararray import add, replace
# Separate the data set into test and train data
# Read filenames from a text file listing all the images
filenames = np.genfromtxt('../data/train_list.txt', dtype=str)
# Read i... |
import collections
import unittest
import hypothesis
from hypothesis.strategies import integers, lists
from traitlite import weakref_utilities
class TestOrderedSet(unittest.TestCase):
def test_inheritance(self):
"""Test that we inherit from collections Set and implement the required methods"""
#... |
from __future__ import annotations
import numpy as np
import logging
from typing import Any, Optional, Text, List, Dict, Tuple
from rasa.engine.graph import ExecutionContext, GraphComponent
from rasa.engine.storage.resource import Resource
from rasa.engine.storage.storage import ModelStorage
from rasa.nlu.config impo... |
num = 0
soma = 0
qtdn = 0
print("Para parar digite 999")
while True:
num = int(input("Informe um numero: "))
if num == 999:
break
soma += num
qtdn += 1
print(f"Você digitou {qtdn} numeros, e a soma entre eles é de {soma}!") |
import numpy as np
import scipy
from scipy.stats import norm
from .BaseBootstrap import BaseBootstrap
from ..utils import nested_getattr
class BC(BaseBootstrap):
""" Returns bootstrap confidence intervals using the bias-corrected boostrap interval.
Parameters
----------
model : object
This ob... |
total_bill = 124.56
procent_10 = 0.10
procent_12 = 0.12
procent_15 = 0.15
split_people = 7
tip = total_bill * procent_12 + total_bill
print(tip)
print(tip)
total = tip / float(split_people)
print(round(total, 2))
|
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... |
from datetime import datetime, timedelta
import warnings
import weakref
import numpy as np
from pandas._libs import index as libindex
from pandas._libs.tslibs import NaT, frequencies as libfrequencies, iNaT, resolution
from pandas._libs.tslibs.period import DIFFERENT_FREQ, IncompatibleFrequency, Period
from pandas.ut... |
from datetime import datetime
import subprocess
import random
import math
import json
import traceback
import numpy as np
import face_recognition as fr
import glob
import datetime
import os
from stat import *
import time
import sys
import re
import dlib
from multiprocessing import Pool
NUM_WORKERS = 8
FORMAT = '%-20s... |
#!/usr/bin/python3
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that... |
from pyneuroml.neuron import export_to_neuroml2
import sys
import os
os.chdir("../NEURON/test")
sys.path.append(".")
export_to_neuroml2("load_l23.hoc",
"../NeuroML2/L23_morph.cell.nml",
includeBiophysicalProperties=False,
known_rev_potentials={"na":60,"k":-9... |
# This script allows you to quickly tweak values for
#------------------------------------------
# Coefficient of lift calculator for
# helicopters in a C-130J cargobay
# Inputs: Stall speed in kts,
# chord in feet,
# and gross weight of A/C in lbs
# Output the Stall C_L
#-----------------------... |
'''Test for ratio of Poisson intensities in two independent samples
Author: Josef Perktold
License: BSD-3
'''
import numpy as np
from scipy import stats
from statsmodels.stats.base import HolderTuple
from statsmodels.stats.weightstats import _zstat_generic2
def test_poisson_2indep(count1, exposure1, count2, expo... |
from lib.config import cfg
class DatasetCatalog(object):
dataset_attrs = {
'LinemodTest': {
'id': 'linemod',
'data_root': 'data/linemod/{}/JPEGImages'.format(cfg.cls_type),
'ann_file': 'data/linemod/{}/test.json'.format(cfg.cls_type),
'split': 'test'
... |
#Embedded file name: ACEStream\Core\Statistics\DatabaseCrawler.pyo
import sys
import cPickle
from time import strftime
from ACEStream.Core.Overlay.SecureOverlay import OLPROTO_VER_SEVENTH, OLPROTO_VER_EIGHTH, OLPROTO_VER_ELEVENTH
from ACEStream.Core.BitTornado.BT1.MessageID import CRAWLER_DATABASE_QUERY
from ACEStream.... |
from .finder import DSLFinder
from .resolver import DSLResolver
|
import collections
class Solution:
def minWindow(self, s: str, t: str) -> str:
table = collections.Counter(t)
count = len(table)
start = 0
minSize = len(s) + 1
result = ''
for i in range(len(s)):
table[s[i]] -= 1
if table[s[i]] == 0:
... |
#!/usr/bin/pyton3
def create_m_window(size, index, measurements):
window = 0
for i in range(size):
if index + i >= len(measurements):
break
window = window + measurements[i + index]
return window
f = open("input.txt", "r")
measurements = []
combined_measurements = []
for l in f:... |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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:
#
# * Redistributions of source code... |
class Template(object):
def __init__(self, _px):
self.px = _px
def Core(self):
raise NotImplementedError()
|
from __future__ import annotations
from typing import NoReturn
from IMLearn.base import BaseEstimator
import numpy as np
from numpy.linalg import pinv
from IMLearn.metrics.loss_functions import mean_square_error
class LinearRegression(BaseEstimator):
"""
Linear Regression Estimator
Solving Ordinary Lea... |
# Define some basic colors
black = (0, 0, 0)
yellow = (255, 255, 0)
white = (255, 255, 255)
#planet colors
#mercury
mercuryColor = (222,184,135) #rgb(60, 56, 55) is the true color, lightened to enhance visibility
#venus
venusColor = (215, 212, 207)
#earth
earthColor = (165, 190, 231)
#mars
marsColor = (232, 193, 135)
#... |
"""Support for getting statistical data from a city-waste system."""
import datetime
from datetime import timedelta
import json
import logging
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_MONITORED_CONDITIONS, CONF_NAME, MASS... |
import requests
import json
import traceback
import time
def handle_argument():
'''handle the argument. '''
import argparse
description = 'This script is used to import data from db into hdfs using spark sql.'
epilog = """ """
parser = argparse.ArgumentParser(prog="livysessions",
... |
#!/usr/bin/env python3
"""
The Cluster class provides the core utilities interaction with HPC systems
which must be overloaded by subclasses for specific workload managers, or
specific clusters.
"""
import sys
import logging
import subprocess
from seisflows3.tools import msg
from seisflows3.config import custom_import... |
import os
import os.path as path
import pytest
import cocotb as ctb
import cocotb_test.simulator as tester
class TB(object):
pass
class MicroBlaze():
pass
@ctb.test()
def controller_test(dut):
pass
tests_dir = path.dirname(__file__)
hdl_dir = path.abspath(path.join(tests_dir, '..', 'hdl'))
... |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
db = SQLAlchemy()
migrate = Migrate()
loginmanager = LoginManager()
def create_app():
app = Flask(__name__)
if app.config["ENV"] == 'production':
app.config.from_obj... |
import json
import os
import platform
import shutil
from logging import DEBUG, Handler, LogRecord
from typing import TYPE_CHECKING, List
from opta.constants import VERSION
from opta.utils import LogFormatMultiplexer, ansi_scrub, logger
# from opta.core.terraform import Terraform
if TYPE_CHECKING:
from opta.layer ... |
class Activity:
def __init__(self, start, end):
""" Activity Class
Arguments:
start {int} -- Starting time of the Activity
end {int} -- Ending Time of the Activity
"""
self.start = start
self.end = end
def print(self):
""" Method to Print... |
from setuptools import find_packages, setup
setup(
name="ipython_blocking",
version="0.3.1",
author="Matt Kafonek",
author_email="kafonek@gmail.com",
url="https://github.com/kafonek/ipython_blocking",
description="Context manager for blocking cell execution within a Jupyter notebook",
long_... |
# encoding: utf-8
"""
Tests for IPython.config.configurable
Authors:
* Brian Granger
* Fernando Perez (design help)
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The ful... |
[fob for fob in oar]
[fob for fob in oar if baz]
[fob for fob in oar for baz in quox] |
import pytest
from validate import check_query_f, check_query, get_conf_f
from conftest import use_inherited_roles_fixtures
from context import PytestConf
# Mark that all tests in this module can be run as server upgrade tests
pytestmark = pytest.mark.allow_server_upgrade_test
usefixtures = pytest.mark.usefixtures
@... |
import numpy as np
import cv2
from scipy.optimize import least_squares
from scipy.sparse import lil_matrix
def bundle_adjustment_sparsity(n_cameras, n_points, camera_indices, point_indices):
"""
:param n_cameras Integer. Number of cameras/images currently resected
:param n_points: number of distinct 3D po... |
import builtins
import logging
import os
from jinja2 import FileSystemLoader, Environment
logger = logging.getLogger('lona.templating')
BUILTINS = {}
for name in dir(builtins):
if name.startswith('_'):
continue
BUILTINS[name] = getattr(builtins, name)
class Namespace:
def __init__(self, serve... |
# code scris urat in cazul in care ne mai trebuie conversia
import os
from os import listdir
import SimpleITK as sitk
import matplotlib.pylab as plt
def to_images(file, path):
print("Processing file: " + file)
input_path = path + file
output_path = path
file_name = os.path.splitext(file)[0]
if ... |
# Copyright 2018 The TensorFlow Probability 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# coding=utf-8
# Copyright 2021 The Google Research 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
import os
import pytest
from dotenv import load_dotenv
from tmdb.three import TMDb
load_dotenv()
@pytest.fixture(scope="module")
def tmdb():
api_key = os.getenv("api_key", None)
return TMDb(api_key) if api_key else None
@pytest.fixture(scope="module")
def session_id(tmdb):
username = os.getenv("usern... |
# Copyright 2015 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
#
# Unless required by applica... |
#!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.Results.SimulationParameters
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
MCXRay simulation parameters results file.
"""
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__... |
from ARIAPacketIntelligence import *
import pytest
import random
import requests_mock
class TestARIA:
sdso = 'sdso_mock_server'
sdso_url = f'http://{sdso}:7443/Aria/SS/1.0.0/PacketIntelligence/server'
aria = ARIA(sdso_url)
rcs = "PIdevice@all"
# write a ip generate function to skip ... |
# Code for testing on real SAR images
# Author: Malsha Perera
import argparse
import torch
import torchvision
from torch import nn
from torchvision.transforms import functional as F
import os
import numpy as np
import torch
from transform_main import TransSAR, TransSARV2, TransSARV3
import cv2
parser = argparse.Arg... |
from .core import (Chart, Scatter) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=20
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
def make_circuit(n: int, input_qubit):
c = cirq.Ci... |
import logging
import pytest
import time
from tests.integration.host import (
get_host_in_state,
wait_for_host_state,
is_host_in_state,
draining_period_sec,
)
from peloton_client.pbgen.peloton.api.v0.host import host_pb2 as hpb
from peloton_client.pbgen.peloton.api.v0.task import task_pb2 as task
pyt... |
# Generated by Django 3.1.4 on 2020-12-03 06:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0026_auto_20201203_0628'),
]
operations = [
migrations.AddField(
model_name='post',
name='postIsVisible',
... |
import pathlib
from pyschism.forcing.source_sink.nwm import NationalWaterModel, logger as nwm_logger, NWMElementPairings
from pyschism.forcing.source_sink.base import logger as source_sink_base_logger
from pyschism.mesh import Hgrid
for each file:
my_idxs.append()
pool.starmap (
func,
[(nc, my_idxs[i]) ... |
#!/usr/bin/env python3
from ..common.parser import set_parser
import tensorflow as tf
def load_data(data_dir, img_height=180, img_width=180, batch_size=32):
train_ds = tf.keras.preprocessing.image_dataset_from_directory(
data_dir,
validation_split=0.2,
subset="training",
seed=123,
... |
from django.urls import path
from comments.views import (add_comment,
reply_comment,
delete_comment,
delete_reply)
urlpatterns = [
path("post/<int:pk>/comment/add", add_comment, name="add_comment"),
path("post/<int:ppk>/commen... |
from __future__ import annotations
from abc import ABC
from abc import abstractmethod
class FileState(ABC):
_context: File = None
@property
def context(self) -> File:
return self._context
@context.setter
def context(self, value: File) -> None:
self._context = value
@abstract... |
import theano
from early.cnn.hidden_layer import HiddenLayer
from early.cnn.conv_layer import ConvPoolLayer
from global_pooling_layer import GlobalPoolLayer
class FeatureExtractor(object):
def __init__(self, rng, input, nkerns, recept_width, pool_width, stride, training_mode, dropout_prob, activation,
... |
#
# 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... |
# Copyright 2020 The SQLFlow 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
#
# Unless required by applicable law o... |
"""
Support to check for available updates.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/updater/
"""
# pylint: disable=no-name-in-module, import-error
import asyncio
from datetime import timedelta
from distutils.version import StrictVersion
import js... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('premises', '0007_auto_20141020_2215'),
... |
"""
##################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : test.py
# Abstract : The common testing api for davarocr, used in online/offline valida... |
import os
import re
import string
import numpy as np
from ml.clean_tables import tag_actions
from utils.environ import cleaned_tags_dir, generated_data_dir
from utils.file import remove_files, get_json_from_file, \
write_json_to_file
tokenize_attr_names = ['rowspan', 'colspan', 'style', 'align', 'width']
tokenize_... |
# Copyright 2019 Google LLC
#
# 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, ... |
from datadog import initialize, api
options = {
'api_key': '9fcece82deb81b6846ad9d9b85893fda',
'app_key': 'f06fdf0ac3ab382b8e33ecc2d4462b6588a00bca'
}
initialize(**options)
title = "Something big happened!"
text = 'And let me tell you all about it here!'
tags = ['version:1', 'application:web']
api.Event.crea... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test spending coinbase transactions.
The coinbase transaction in block N can appear in block
N+100... ... |
#! /usr/bin/env python3
#
# Copyright 2019 Garmin Ltd. or its subsidiaries
#
# 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 requir... |
from __future__ import unicode_literals
from sqlakeyset import get_page
from sqlbag import S
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, desc
SINGLES = """Tim McGraw 2006 40
Teardrops on My Guitar 2007 13
Our Song 2007 16
Picture to Burn 2008 28
Should've S... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and Contributors
# See license.txt
# import frappe
import unittest
class TestWebsiteSettings(unittest.TestCase):
pass
|
"""Hermes MQTT server for Rhasspy TTS using external program"""
import asyncio
import audioop
import io
import logging
import os
import shlex
import subprocess
import tempfile
import typing
import wave
from uuid import uuid4
from rhasspyhermes.audioserver import AudioPlayBytes, AudioPlayError, AudioPlayFinished
from r... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, os
docs_italia_theme = __import__("docs-italia-theme")
from recommonmark.transform import AutoStructify
from recommonmark.parser import CommonMarkParser
# -- PROJECT Variables ----------------------------------------------------
settings_project_name = 'PagoP... |
# Python program for implementation of heap Sort
# To heapify subtree rooted at index i.
# n is size of heap
def heapify(arr, n, i):
largest = i # Initialize largest as root
l = 2 * i + 1 # left = 2*i + 1
r = 2 * i + 2 # right = 2*i + 2
# See if left child of root exists and is
# greater than root
if l < n ... |
from flask import url_for
from flask_testing import TestCase
from app import app
from unittest.mock import patch
class TestBase(TestCase):
def create_app(self):
return app
class TestResponse(TestBase):
def test_BMW1(self):
response = self.client.get(url_for('get_mot'), json={'make':'BMW', 'mo... |
def leiaint(n):
while True:
try:
n = int(input(n))
except(ValueError, TypeError):
print('ERRO: Informe um valor inteiro valido!')
continue
else:
return n
def leiafloat(n):
while True:
try:
n = float(input(n))
e... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... |
"""
This is the module that acts as an interface for the src code mapping modules.
The module provides the below function to run the mapping of src code at a given path:
"""
import os
import typing
from .parse import parse
from .pumlify import pumlify
# todo: change to extendible File class
class CodeFile(typing.... |
import tkinter
from .config import Config
class WelcomeFrame(tkinter.Frame):
""" First frame to start """
def __init__(self, parent):
super().__init__(parent, bg=Config.BG)
self.parent = parent
self.label = tkinter.Label(self, text=Config.INTRO_TEXT)
self.label.pack(expand=T... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
# Copyright (c) 2012-2018 The Cruro Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashl... |
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Model classes representing a tensor comprehension.
These classes model the language more at an AST level as evaluat... |
# Defines functionality used by all types of log artifacts, these
# can be things like SOQL Queries, Code Units, Debug Statements, etc
class Token:
def __init__(self, text):
self.text = text
self.segments = text.split('|')
self.type = None if len(self.segments) < 2 else self.segments[1]
... |
"""
Copyright (c) 2017-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
from __future__ import abs... |
from pysci.editor import PySci
from pysci.settings import PySciSettings
from unittest import TestCase
from PyQt4 import QtGui
class PySciSettingsTest (TestCase):
"""Test the PySciSettings widget.
"""
def test_instantiation(self):
"""PySciSettings widget can be instantiated.
"""
self... |
import logging
from tqdm import tqdm
from typing import Optional, Union
from brainscore.metrics import Score
from brainscore.model_interface import BrainModel
from brainscore.utils import fullname
from model_tools.activations.pca import LayerPCA
from model_tools.brain_transformation import TemporalIgnore
from model_to... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) Camille Scott, 2019
# File : conftest.py
# License: MIT
# Author : Camille Scott <camille.scott.w@gmail.com>
# Date : 12.12.2019
import os
import shutil
import pytest
from .utils import hmmscan_cmd, run_shell_cmd
TEST_DIR = os.path.dirname(__file__)
DATA_DIR... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import scrapy
from ..items import DongmanItem
class DongmanSapider(scrapy.Spider):
name = 'dongman'
start_urls = ['http://1122ya.com/xiazaiqu/btdongman', 'http://1122ya.com/xiazaiqu/xunleichangpian',
'http://1122ya.com/xiazaiqu/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.