content stringlengths 5 1.05M |
|---|
import os
import json
from typing import Any, Dict, List
from versup.default_conf import default_conf
config_files = [
"~/.config/versup.json",
"./.versup.json",
]
def parse_config_file(config_file: str) -> dict:
d: Dict[str, str] = {}
try:
with open(os.path.expanduser(config_file), "r") as ... |
import time
def guess_we_are_bruteforcing_this(instructions):
all_the_inputs = create_all_possible_changed_inputs(instructions)
last_run = False
for changed_input in all_the_inputs:
if last_run:
break
last_run = run(changed_input, False)
def create_all_possible_... |
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Azure Query Handling for Reports."""
import copy
import logging
from django.db.models import Value
from django.db.models.functions import Coalesce
from django.db.models.functions import Concat
from tenant_schemas.utils import tenant_context
fr... |
from django.urls import include, path
from rest_framework.routers import DefaultRouter
from .views import TaskViewSet
router = DefaultRouter()
router.register('tasks', TaskViewSet, basename='tasks')
urlpatterns = [
path('', include(router.urls))
]
|
'''
/***************************************************************
* Name: Pandas Data Analysis
* Author: Reed James
* Created: 22 Sept 2021
* Course: CIS 289 - Python
* Version: Python 3.8.2
* OS: Windows 10
* Copyright: This is my own original work based on
* specifications issued by our instructor
* ... |
import unittest, os, sys
from unittest import TestCase
current_dir = os.path.dirname(__file__)
base_dir = os.path.join(current_dir, os.pardir, os.pardir)
sys.path.append(base_dir)
from rajaongkir import RajaOngkirApi
# Please don't use this api_key for your production, this key will be deleted or changed someday,
# ... |
'''
This is is FPEM module for PAN.
'''
import tensorflow as tf
__all__ = ['Conv_BN_ReLU','FPEM']
class Conv_BN_ReLU(tf.keras.Model):
def __init__(self, out_planes, kernel_size=1, stride=1, padding='valid'):
super(Conv_BN_ReLU, self).__init__()
self.conv = tf.keras.layers.Conv2D(out_planes, kernel... |
from __future__ import unicode_literals
from django.db import models
class DeviceGroup(models.Model):
F5_BIGIP = 'F5 BIG-IP'
DEVICE_TYPES = (
(F5_BIGIP, 'F5 BIG-IP'),
)
name = models.CharField(max_length=200)
classification = models.CharField(
max_length=200,
choices = DEVICE_TYPES,
default = F5_BIGIP
... |
import heapq
from typing import ItemsView, Iterable, Tuple
from data import pool, types
from data.graph import bloom_node
class _Cursor(pool.Pooled):
__slots__ = ('node', '_path')
def __init__(self, node: bloom_node.BloomNode, path: types.Path) -> None:
super(_Cursor, self).__init__()
self.node = node
... |
#!/usr/bin/env python3
"""Charm code for OpenSearch service."""
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
import logging
from pathlib import Path
from subprocess import CalledProcessError, check_call, check_output
from typing import Any, Dict, List, Optional
from jinja2 import Environm... |
# ---
# jupyter:
# jupytext:
# formats: notebooks//ipynb,rmd//Rmd,scripts//py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# -... |
from __future__ import absolute_import
from __future__ import print_function
from ..common.geometry import Point, Polygon, Envelope, SpatialReference
from .._abstract.abstract import BaseGeoEnrichment
from ..manageorg import Administration
import json
import csv
import os
import numpy as np
############################... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct
import numpy as np
def float_to_bytes( value, format_str="<d", dtype=np.float64 ):
return bytes( struct.pack( format_str, dtype( value ) ) )
|
__version__ = '2.5.1.dev0'
|
# Generated by Django 3.2.9 on 2021-11-03 13:41
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('researchdata', '0006_letter_sent_date_is_approximate'),
]
operations = [
migrations.AlterField(
mo... |
# -*- coding: utf-8 -*-
# * Copyright (c) 2009-2018. Authors: see NOTICE file.
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0... |
from base64 import b64encode, b64decode, b32encode, b32decode
from binascii import hexlify, unhexlify, Error as BinasciiError
import urllib.parse
from discord.ext import commands
from discord.ext.commands import Bot
from discord_slash import SlashContext, cog_ext
from discord_slash.utils.manage_commands import create... |
"""
This file is called by routine which creates mesh from nested dictionaries (convert.py).
"""
import numpy as np
from scipy import spatial as scipy3D
import mesh.orient as orient
def preparePlane(p0=(-1, -1, -1),
p1=(1, 1, 1),
p2=(0, 0, 1),
width=1,
... |
from math import sqrt
import stats_batch as sb
import numpy as np
from pytest import approx
from scipy.stats import ttest_ind_from_stats
from scipy.stats import ttest_ind
def test_batch_mean_var_t_test():
n = 10_000
a = np.random.normal(size=n)
b = np.random.normal(size=n)
# First batch
# a ------... |
from lsml import LevelSetMachineLearning
from lsml.visualize import interactive2d
# Load the model and grab an example from the testing set
model = LevelSetMachineLearning.load('./LSML-model.pkl')
example = model.testing_data[0]
# Segment the example image
us = model.segment(img=example.img)
# View the example inte... |
import pytest
from jax import numpy as jnp
from jax import random
from mcx.distributions import Normal
@pytest.fixture
def rng_key():
return random.PRNGKey(0)
#
# LOGPDF SHAPES
#
expected_logpdf_shapes = [
{"x": 1, "mu": 0, "sigma": 1, "expected_shape": ()},
{"x": 1, "mu": jnp.array([1, 2]), "sigma": ... |
# -*- coding: utf-8 -*-
from typing import Any, Dict
from chaoslib.types import Configuration, Secrets
from ibmcloud import create_ibmcloud_api_client
from ibm_cloud_sdk_core import ApiException
from logzero import logger
# import simplejson as json
__all__ = ["get_virtual_servers"]
def get_virtual_... |
import numpy as np
from vocab import male_names, female_names, cities_and_states, countries
from vocab_pt import male_names_pt, female_names_pt, cities_pt, countries_pt
from util import get_n_different_items
from util import vi, person, not_vi, create_csv
from util import vi_pt, person_pt, not_vi_pt
def contradicti... |
"""
A college baseball team history page implemented as a subclass of HydraHeadApp
Displays data from BoydsWorld.com using boydsworld_scraper
Nathan Blumenfeld
2022
"""
from collegebaseball import win_pct
import streamlit as st
import pandas as pd
import numpy as np
import plotly.express as px
from hydralit import H... |
from flask import make_response
from flask import request
from flask import abort
from flask import render_template
from flask import jsonify
import json
import os
import sys
import requests
import re
from software import Software
from step import step_configs
from app import app
def json_dumper(obj):
"""
if... |
import os
import BeeVeeH
import pytest
BVH_DIR = '%s/bvh_files' % os.path.dirname(__file__)
class TestCase():
def test_bvh_play(self):
file_path = '%s/0007_Cartwheel001.bvh' % BVH_DIR
if not BeeVeeH.start(file_path, test=True):
pytest.skip('Cannot launch the app due to SystemExit, reas... |
# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.... |
# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import time
import scrapy
from Global_function import get_localtime, print_new_number, save_messages
now_time = get_localtime(time.strftime("%Y-%m-%d", time.localtime()))
# now_time = 20170430
class SYSU001_Spider(scrapy.Spider):
name = ... |
#!/usr/bin/env python3
#
#
#
#
# Kim Brugger (03 Apr 2019), contact: kim@brugger.dk
import argparse
import datetime
import os
import re
import sys
import kbr.args_utils as args_utils
import kbr.config_utils as config_utils
import kbr.db_utils as db_utils
import kbr.string_utils as string_utils
DB = None
def get_ro... |
"""This package includes a miscellaneous collection of useful helper functions."""
import os |
class Stack:
def __init__(self):
self.tab = list()
def is_empty(self):
return len(self.tab) == 0
def top(self):
if self.is_empty:
raise KeyError("Empty stack")
else:
return self.tab[-1]
def push(self, item):
self.tab.append(item)
de... |
from .ptdf import make_PTDF
|
"""
Tests for Day 09
"""
from day09 import parse_input, part1, part2
def test_part1():
""" Test part one """
assert part1(parse_input("test_input.txt"), 5) == 127
def test_part2():
""" Test part two """
assert part2(parse_input("test_input.txt"), 5) == 62
|
# App Helpers
# Helpers depends on models
import logging
from ..camera_tasks.models import CameraTask
from ..cameras.models import Camera
logger = logging.getLogger()
def create_tasks_at_startup():
for cam in Camera.objects.all():
CameraTask.objects.update_or_create(camera=cam)
|
# -*- coding: utf-8 -*-
import sys
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import sklearn
from sklearn.decomposition import TruncatedSVD
print("Python", sys.version.split(" ")[0])
print("Numpy", np.__version__)
print("Sklearn", sklearn.__version__)
print("Matpl... |
from . import auth
from flask import render_template,redirect,url_for,flash,request
from flask_login import login_user,logout_user,login_required
from ..models import User
from .forms import LoginForm,RegistrationForm
from .. import db
from ..email import mail_message
@auth.route('/login',methods = ['GET','POST'])... |
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2019 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.vcenter.deployment.
#---------------------------------------------------------------... |
import cv2
import numpy as np
def MeanFilter(img, K_size=3):
Hol, Ber, Col = img. shape
## zero padding
result = np.zeros((Hol + 2, Ber + 2, Col), dtype=np.float)
result[1: 1 + Hol, 1: 1 + Ber] = img.copy().astype(np.float)
temp = result.copy()
for x in range(Hol):
for y in range(... |
import os,string,json,codecs
vocab=set()
sarcasmDict={}
nonSarcasmDict={}
content=[]
vocabB=set()
sarcasmDictB={}
nonSarcasmDictB={}
vocabT=set()
sarcasmDictT={}
nonSarcasmDictT={}
def fileRead(file):
filename=file
with open(filename) as f:
content = f.readlines()
retur... |
#!/usr/bin/python
import json
import glob
import os
from finally_file import FinallyFile
from finally_importer_spotify import *
class FinallyImporter:
subimporters = None
path = None
def __init__(self, path="imports"):
self.path = os.path.join(os.getcwd(), path)
self.subimporters = []
def checkDirectoryExist... |
from typing import List, Any, Tuple, Union
from .base import BoolElement, ElementBase, Pose, StringElement
from .plugin import Plugin
from ..exceptions import ParseError
from ... import fuel
from .. import sdformat
class Include(ElementBase):
"""Include a fragment (Model, World, or Light) from URI.
The vers... |
'''
Test file for the dce_models sub-module
'''
import pytest
import os
import sys
import numpy as np
from tempfile import TemporaryDirectory
sys.path.insert(0,
os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'src')))
#---------------------------------------------------------------------------... |
from setuptools import setup, find_namespace_packages
with open("requirements.txt") as f:
requirements = f.read().splitlines()
setup(
name="SyInterferoPy",
version="0.1.0",
# url='https://github.com/mypackage.git',
# description='Description of my package',
# packages=find_packages(where="pyge... |
def sunsetViews(buildings, direction):
if not buildings:
return []
if direction == "WEST":
dr = 1
curr_start = 0
curr_end = len(buildings)
else:
dr = -1
curr_start = len(buildings) - 1
curr_end = -1
sol = [curr_start]
max_h = buildings[curr_s... |
import db
import coleta_dados as cd
# Cria conexão no banco de dados
db.db_conection_eng() #Cria a conexão com o banco
db.db_conection_session() #Cria a session
# Coletar o dados
coletor = cd.Coletor() # Inicia a classe
df = coletor.get_db_id() #Pega o id da tabela dimensão
views = coletor.get_views(df)
# Escrever d... |
###
# Copyright 2018 IBM Corp. 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... |
__author__ = 'robertkohl125@gmail.com (Robert Kohl)'
import httplib
import endpoints
from protorpc import messages
from google.appengine.ext import ndb
from google.appengine.ext.ndb import msgprop
# Define the Profile Kind
class Profile(ndb.Model):
"""Profile -- User profile object"""
user_id = n... |
#!/usr/bin/env python3
"""
Create a snapshot which only contains certain, specified fields.
This is useful if you're only interested in a subset of fields -- it makes
a new snapshot file which can be substantially smaller, so you can page
through it much faster.
For a brief comparison, when I first wrote this script:... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Candlestick Pattern Recognition Indicators
https://discuss.tradewave.net/t/candlestick-pattern-recognition-indicators-ie-dragonfly-doji/167
Modified by lewk to use the talib abstract Function API.
[-1] included on each to convert array to "last" value
max() and [:-5... |
"""
lec 2
this is a regional comment
"""
#print("hello world") # this is a single line comment
#print(type(123))
#print(type(123.))
#print(type("123"))
#print("Tom's cat")
#print("Hello " + "world")
#print(2**3)
my_int = 123
my_float = 123.
my_str = 'hello world'
print(my_int + 1 )
print(my_float)
print(my_str) |
# Elaborar um programa que leia uma matriz A de duas dimensões com 15 linhas e 15 colunas. Apresentar o somatório dos elementos pares situados na diagonal principal da referida matriz.
A = [[], [], [], [] ,[], [], [], [], [] ,[], [], [], [], [] ,[]]
for i in range(len(A)):
for j in range(15):
A[i].appe... |
from ctypes import Structure, c_char_p, c_int, c_void_p, CDLL, POINTER, c_char
import ctypes.util
import os, sys
class error(Exception):
def __init__(self, msg):
self.msg = msg
def __str__(self):
return self.msg
class datum(Structure):
_fields_ = [
('dptr', POINTER(c_char)),
('d... |
from libai.config import LazyCall
from libai.evaluation import PPLEvaluator
from libai.config import LazyCall
from .common.models.gpt import pretrain_model as model
from .common.train import train
from .common.optim import optim
from .common.data.gpt_dataset import dataloader, tokenization
from .common.models.graph im... |
def test_imports():
"""
Please don't import sklearn or scipy.stats to solve any of the problems in this assignment.
If you fail this test, we will give you a zero for this assignment, regardless of how
sklearn or scipy.stats was used in your code.
the 'a' in the file name is so this test is ... |
import os
import argparse
from PIL import Image
Image.MAX_IMAGE_PIXELS = 1000000000 # Support gigapixel images
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-data_path", help="Path to your dataset", type=str, default='')
parser.add_argument("-max_size", type=int, default=500)
p... |
from sqlalchemy import MetaData, Column, String, Enum, Integer
from sqlalchemy.dialects.postgresql import UUID, JSONB
from sqlalchemy.ext.declarative import declarative_base
from erica.domain.Shared.EricaRequest import RequestType
from erica.domain.Shared.Status import Status
from erica.infrastructure.sqlalchemy.base_... |
from statistics import mean
from typing import Optional
from fuzzywuzzy import fuzz
import spotipy
class NotFound(Exception):
pass
class Track:
def __init__(
self, title: str, artist: Optional[str] = None, album: Optional[str] = None, fuzzy_threshold: int = 90):
self.title = title
... |
import keyword
import types
import unittest
from importlib.machinery import ModuleSpec
from unittest.mock import (
MagicMock,
call,
patch,
sentinel,
)
from flutils.moduleutils import cherry_pick
from .base import CherryPickingMixin
class TestOne(unittest.TestCase, CherryPickingMixin):
def setUp... |
"""removed unused page tables and fields
Revision ID: 6cb6a6a151b7
Revises: f15de2cc22c7
Create Date: 2017-02-23 17:25:48.059713
"""
# revision identifiers, used by Alembic.
revision = '6cb6a6a151b7'
down_revision = 'f15de2cc22c7'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa... |
class Producto:
def __init__(self, referencia, tipo, nombre,
pvp, descripcion, productor=None,
distribuidor=None, isbn=None, autor=None):
self.referencia = referencia
self.tipo = tipo
self.nombre = nombre
self.pvp = pvp
self.descripcion = des... |
# Generated by Django 3.1.2 on 2020-11-20 13:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend_app', '0027_edit_permission_choices'),
]
operations = [
migrations.RenameField(
model_name='dataset',
old_na... |
#!/usr/bin/env python
####################
# Required Modules #
####################
# Generic/Built-in
import base64
import os
import json
import pickle
import uuid
import re
from typing import Dict, List
# Libs
import numpy as np
import pandas as pd
import streamlit as st
import streamlit.components.v1 as componen... |
"""
@author axiner
@version v1.0.0
@created 2022/1/2 14:49
@abstract
@description
@history
"""
class Error(Exception):
"""Error基类"""
def __init__(self, msg='Raise error', code=1):
self.msg = msg
self.code = code
self.error = {'code': self.code, 'msg': self.msg}
def __str__(self):... |
from __future__ import absolute_import
from .additive_abelian_group import AdditiveAbelianGroup
from .additive_abelian_wrapper import *
|
from fython.unit import *
class InterpolationX(Unit):
unit = l.interpolationx |
import astropy
from astropy.io import fits
import glob
import os
import re
from matplotlib import pylab as plt
import numpy as np
import math
from scipy.signal import find_peaks_cwt
import ccdproc
from astropy.nddata import CCDData
from astropy import units as u
from astropy.table import QTable
import glob
import strin... |
from BrainFramework import BrainNode, ExecutionType
class Const(BrainNode):
"""
This node will set a constant value
"""
def __init__(self, logger):
return super().__init__("const", logger)
def Load(self):
super().Load()
def Run(self, nparray):
return nparray
de... |
"""A setuptools based setup module."""
from os import path
from setuptools import find_packages, setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='vmg30'... |
from abc import ABCMeta, abstractmethod,ABC
class KyokoWTCore(metaclass=ABCMeta):
@abstractmethod
def __init__(self,lang_kun="ja-JP"):
self.lang=lang_kun
@abstractmethod
def gettext(self,audio_path):
pass
|
"Test the API interface for blob creation."
import os
import os.path
import unittest
import requests
import utils
class Blob(utils.ApiMixin, unittest.TestCase):
"Test the API interface for blob creation."
def test_1_create_blob(self):
"Create a blob by HTTP PUT."
# How many blobs for the u... |
# Metode Newton-Raphson adalah metode pencarian akar suatu fungsi
# f(x) dengan pendekatan satu titik,
# dimana fungsi f(x) mempunyai turunan.
# Metode ini dianggap lebih mudah dari Metode Bagi-Dua (Bisection Method),
# karena metode ini menggunakan pendekatan satu titik sebagai titik awal.
from __future__ import anno... |
"""Unit tests for sr830 library connected to an instrument."""
import argparse
import math
import random
import time
import numpy as np
import pytest
import visa
import sr830
parser = argparse.ArgumentParser()
parser.add_argument(
"-r", "--resource-name", help="VISA resource name",
)
parser.add_argument(
"-o"... |
import os
import sys
import json
import random
import asyncio
import aiohttp
import discord
import jishaku
import requests
import randomstuff
from discord import *
from discord import message
from random import choice
from datetime import datetime
from discord.ext import commands
from asyncio import TimeoutError
from d... |
import os
DATASET_TXT_PATH = "D:\\mhmodels\\dataset_original.txt"
OUTPUT_TXT = "D:\\mhmodels\\dataset_objs.txt"
OUTPUT_DIR = "D:\\mhmodels\\models_obj"
TEMPLATE_OBJ = "end.obj"
list_data = [line.strip() for line in open(DATASET_TXT_PATH)]
template_lines = [line.strip() + "\n" for line in open(TEMPLATE_OBJ)]
print("te... |
import json
from .parser_def import parse_def
"""
A collection of parsing functions to parse Server-to-Client messages.
As a battle bot, user messages can be ignored. Of particular interest
are messages pertaining to starting battles and logins.
"""
def parse(roomid: str, message: str) -> dict:
tokens = message.s... |
"""
interploation search
# interploation and binary are both require a SORTED list
let said you have the follow phone number prefix array, and you are looking for 1144
0011, 0022, 0033, 1144, 1166, 1188, 3322, 3344, 3399
instead of using binary search in the middle, or linear search from the left... |
# This example demonstrates how to regrid between a Grid and a Mesh.
# The data files can be retrieved from the ESMF data repository by uncommenting the
# following block of code:
#
# import os
# DD = os.path.join(os.getcwd(), "examples/data")
# if not os.path.isdir(DD):
# os.makedirs(DD)
# from ESMF.util.cache_dat... |
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def test_nfs_utils_installed(host):
assert host.package("nfs-utils").is_installed
assert host.package("nfs-utils").version == "2.3.3"
... |
from adaptivefiltering.dataset import DataSet
from adaptivefiltering.filter import Filter
from adaptivefiltering.paths import (
get_temporary_filename,
load_schema,
within_temporary_workspace,
)
from adaptivefiltering.utils import stringify_parameters
import os
import platform
import shutil
import subproce... |
import logging
from django.conf import settings
DOCUMENT_BACKENDS = None
DOCUMENT_ROUTER = None
INDEX_BACKENDS = None
INDEX_ROUTER = None
class CompositeDocumentRouter(object):
def __init__(self, routers):
self.routers = routers
def get_logger(self):
return logging.getLogger(__name__)
... |
# Copyright (c) 2018, Matias Fontanini
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and ... |
# Scrapy settings for tinydeal project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middlewar... |
from torchvision import datasets, transforms
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from argparse import ArgumentParser
from tqdm import tqdm
import time
import numpy as np
###########
# file imports / path issues
import os
import sys
from pathlib i... |
# This code is part of Mthree.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
import streamlit as st
import tensorflow.keras
from PIL import Image, ImageOps
import numpy as np
import time
st.beta_set_page_config(
page_title="Auto Vaidya",
layout="centered",
initial_sidebar_state="collapsed",
)
# Just making sure we are not bothered by File Encoding warnings
st.set_option('deprecation.showfileU... |
tab = 0
while True:
tab = int(input('Digite um valor para saber sua tabuada: '))
if tab < 0:
break
for fator in range(1,11):
print(f'{tab} X {fator} = {tab * fator}')
print('-='*25)
|
# coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... |
import inspect
import copy
from datetime import datetime, date
# from dataclasses import dataclass
from typing import List
from collections import OrderedDict
from tests import utils
from oapispec.core import model_builder
def test_model_builder():
class Address:
road: str
unit: str
stat... |
from django.template.defaultfilters import title
from rest_framework import serializers, validators
from rest_framework.exceptions import ValidationError
from rest_framework_friendly_errors.mixins import FriendlyErrorMessagesMixin
from rest_framework_friendly_errors.settings import FRIENDLY_NON_FIELD_ERRORS
from tests... |
"""
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft Corporation ("Microsoft") grants you a nonexclusive, perpetual,
royalty-free right to use, copy, and modify the software code provided by us
("Software Code"). You may not sublicense the Software Code or any use of it
(except to your affiliates... |
from clib.training.updater.yolo import (darknet_converter,
yolo_converter)
from clib.training.updater.gan import (WGANUpdater, WeightClipping)
|
from .params import HelloParams
from .worker import HelloWorker
|
from charData import CharData as cd
from plData import PLData as pd
from datetime import datetime
import tkinter as tk
import sys
import logging
LOGGER = logging.getLogger(__name__)
FORMAT = "[%(filename)s:%(lineno)s][%(funcName)20s()] %(message)s"
logging.basicConfig(filename='main.log', format=FORMAT)
LOGGER.addHand... |
#!/usr/bin/env python3
'''
Licensed under MIT License, (c) B. Kerler 2018-2019
'''
import argparse
import json
import time
from xml.etree import ElementTree
import os
from Library.utils import *
from Library.usblib import usb_class
from Library.hdlc import hdlc
from enum import Enum
qcerror={
1:"None",
2:"Unkn... |
import base64
import os
import socket
import ssl
from typing import List
import qrcode
from node_launcher.constants import (
IS_WINDOWS,
LND_DEFAULT_GRPC_PORT,
LND_DEFAULT_PEER_PORT,
LND_DEFAULT_REST_PORT,
LND_DIR_PATH,
OPERATING_SYSTEM,
TOR_SERVICE_PATH)
from node_launcher.logging import ... |
from rich import print
#print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals())
from rich.console import Console
console = Console()
console.print("Hello", "World!", style="bold red")
console.print("Hello", style="5")
console.print("Hello", style="#af00ff")
console.print("Hello", style="rgb(175,0,2... |
import spira.all as spira
from spira.yevon.geometry import shapes
from spira.yevon.geometry.coord import Coord
class ProcessLayer(spira.Cell):
ref_point = spira.Parameter(fdef_name='create_ref_point')
t1 = spira.Parameter(fdef_name='create_t1')
width = spira.NumberParameter(default=10)
length = spir... |
#! /usr/bin/env python
# standard library imports
import sys # NOQA import sys to allow for mocking sys.argv in tests
import argparse
import textwrap
from pandashells.lib import module_checker_lib, arg_lib
module_checker_lib.check_for_modules(['pandas'])
from pandashells.lib import io_lib
import numpy as np
impor... |
salario = float(input('Qual seu salario atual?: '))
print('seu saário com 15% de aumento será R${:.2f}'.format(salario*1.15))
|
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.title('Azure')
window_height = 530
window_width = 800
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
x_cordinate = int((screen_width/2) - (window_width/2))
y_cordinate = int((screen_height/2) - (window_h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.