text
stringlengths
2
999k
"""Tools to print a traceback for an error in Myia.""" import ast import sys import warnings import prettyprinter as pp from colorama import Fore, Style from ..abstract import Reference, data, format_abstract, pretty_struct from ..ir import ANFNode, Graph from ..parser import Location, MyiaDisconnectedCodeWarning, M...
from chembl_webresource_client.new_client import new_client import pandas as pd from progress.bar import ShadyBar def retrieve_data(target_id='CHEMBL3979', waitbar=True, endpoints = ["Ki", "Kd"], relations = ["="]): """ Function to retrieve the data from ChEMBL, starting from a given ChEMBL ID (target) :p...
from main import Defaults, Param Defaults("Example1", b=4, d="dsf") Defaults("Example2", b=4, d="dssf", GPU=True) Defaults("Example3", a=2, instances=2, k=Param("name2", s=11))
T, P = input(), input() for i in range(len(T)): if T[i:].startswith(P): print(i)
# -*- coding: utf-8 -*- # Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. import copy from collections import defaultdict from collections.abc import Iterable from itertools import chain import numpy as n...
import spotipy import spotipy.util as util from json.decoder import JSONDecodeError import pandas as pd import numpy as np from sklearn.mixture import GaussianMixture from sklearn.neighbors import NearestNeighbors from sklearn.preprocessing import StandardScaler import sys import os # This is for Jovin's sp...
from collections import deque import random class ReplayBuffer(object): def __init__(self, buffer_size): self.buffer_size = buffer_size self.num_experiences = 0 self.buffer = deque() def get_batch(self, batch_size): return random.sample(self.buffer, batch_size) ...
async def fetch(session, url, headers={}): async with session.get(url, headers=headers) as resp: return await resp.json()
# -*- coding: utf-8 -*- # # Tencent is pleased to support the open source community by making QT4W available. # Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License");you may not use this # file except in compliance with the License. You may...
# 원(₩)에서 달러($)로 바꿔주는 함수 def krw_to_usd(won): return won / 1000 # 달러($)에서 엔(¥)로 바꿔주는 함수 def usd_to_jpy(dollars): return dollars * (1000/8) # 원(₩)으로 각각 얼마인가요? amounts = [1000, 2000, 3000, 5000, 8000, 13000, 21000, 34000] print("한국 화폐: " + str(amounts)) # amounts를 원(₩)에서 달러($)로 바꿔주기 i = 0 while (i < len(amounts...
#!/usr/bin/env python import functools as func import glob import os.path as osp import re import numpy as np url_prefix = 'https://github.com/open-mmlab/mmfewshot/blob/master/' files = sorted(glob.glob('../configs/*/README.md')) stats = [] titles = [] num_ckpts = 0 for f in files: url = osp.dirname(f.replace(...
from subprocess import call def _notify(text): call(["killall","notify-osd"]) call(["notify-send", text]) def notify(x): if isinstance(x, str) or isinstance(x, unicode): _notify(x) elif hasattr(x,"__call__"): def wrapper(*args, **kwargs): func_name = x.func_name ...
import numpy as np import networkx as nx from gurobipy import * from algorithms.algorithm import Algorithm from utils.ccg_utils import transform_dcop_instance_to_ccg, set_var_value class LPSolver(Algorithm): def __init__(self, name, dcop_instance, args={'max_iter:': 1, 'relax':False}, seed=1234): super(LP...
from allauth.account.models import EmailAddress from rest_framework import permissions class HasVerifiedEmail(permissions.BasePermission): """ Permission class for if the user has verified the email or not """ message = "Please verify your email!" def has_permission(self, request, view): ...
from django import forms from .models import FeatureValidator, CategoryFeature from mainapp.models import Category class NewCategoryFeatureKeyForm(forms.ModelForm): class Meta: model = CategoryFeature fields = '__all__' class NewCategoryForm(forms.ModelForm): class Meta: model = C...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-07 14:32 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('document', '0025_auto_20170223_1407'), ] operation...
""" Unit tests for `git push deis master` and related commands. Run these tests with "python -m unittest client.tests.test_releases" or with "./manage.py test client.ReleasesTest". """ from __future__ import unicode_literals from unittest import TestCase class ReleasesTest(TestCase): pass
import tensorflow as tf from tensorflow import keras import os import pandas as pd # Function asks for a dictionary as input with the following keys (and associated datatypes) # params = {'input_shape': 3, # 'output_shape': 1, # 'output_activation': 'sigmoid', # 'hidden_layers': [20, 20...
import eventlet import socketio import time import random sio = socketio.Client() eventlet.monkey_patch() FACETRACKTRIGGER=False @sio.event def connect(): print('connected to server') @sio.event def disconnect(): print('disconnected from server') sio.connect('http://peppersock.isensetune.com:9543') def...
class KoNPron: def __init__(self): self.base_digit = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] self.super_digit = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹'] self.small_scale = ['', '십', '백', '천'] self.large_scale = ['', '만 ', '억 ', '조 ', '경 ', '해 '] self.lite...
def line_intersection(line1, line2): xdiff = (line1[0][0] - line1[1][0], line2[0][0] - line2[1][0]) ydiff = (line1[0][1] - line1[1][1], line2[0][1] - line2[1][1]) #Typo was here def det(a, b): return a[0] * b[1] - a[1] * b[0] div = det(xdiff, ydiff) if div == 0: raise Exception('lin...
import os # TODO: Document all def get_default_config_path(): # TODO: Document env var path = os.environ.get("EDGE_CONFIG_PATH") if path is None: path = os.path.join(os.getcwd(), "edge.yaml") return path def get_default_config_path_from_model(caller: str): path = os.environ.get("EDGE_CON...
""" Django settings for blog project. Generated by 'django-admin startproject' using Django 2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os # Buil...
# -*- python -*- # Adapted from RobotLocomotion/drake:tools/install/install.bzl load("//tools:common.bzl", "dirname", "join_paths", "output_path") InstallInfo = provider() #============================================================================== #BEGIN internal helpers #----------------------------------------...
import argparse import binascii import sys from collections import namedtuple from dataclasses import dataclass from pathlib import Path from typing import Any, Dict, List, Optional, Tuple from .bits import bytes_to_float, bytes_to_int, clearBit, testBit from .magic import get_pyc_header_lenght, get_pyc_python_version...
#!/usr/bin/env python ''' Mantis shader export script ''' import sys import os import platform import subprocess import tempfile import argparse import re #------------------------------------------------------------------------------- def error(msg) : print("ERROR: {}".format(msg)) sys.exit(10) #-----------...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-12 23:29 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('voteapp', '0025_auto_20170312_1618'), ] operations...
import pickle from parameterized import parameterized from torch.utils.data.graph import traverse from torch.utils.data.graph_settings import get_all_graph_pipes from torchdata.datapipes.iter import Shuffler, ShardingFilter from torchtext.datasets import DATASETS from ..common.torchtext_test_case import TorchtextTest...
from __future__ import annotations from typing import TYPE_CHECKING, Optional if TYPE_CHECKING: from .embed import Embed from .file import File from .message import Message from .state import State __all__ = ("Messageable",) class Messageable: """Base class for all channels that you can send me...
# coding: utf-8 # Copyright 2021 The Oppia 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 requir...
# Copyright 2016 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...
opcao = 0 n1 = float(input('Digite o primeiro número: ')) n2 = float(input('Digite o segundo número: ')) soma = 0 mult = 0 maior = 0 while opcao != 5: opcao = int(input('Digite a opção desejada:' '\n[1] Somar\n[2] Multiplicar\n[3] Maior\n[4] Novos números\n[5] Sair do Programa.\n ' ...
# Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. # See LICENSE in the project root for license information. # Client ID and secret. personal registration #client_id = 'd50f5659-e0d2-49ab-9aa8-e60dc3684124' #client_secret = 'QzQURFGCu9Aqd9ruLs9dJJe' # business registration client_id = '...
""" Example of key derivation with 24-words mnemonic phrase in the same way of Brave crypto wallets extension (legacy). The old version of Brave crypto wallets extension (now referred as "legacy") worked differently from BIP39 when a 24-words mnemonic phrase was used. In fact, instead of computing the seed from the mn...
#!/usr/bin/python3 import tensorflow as tf import numpy as np import pandas as pd import time, os, sys import argparse # User-defined from network import Network from utils import Utils from data import Data from model import Model from config import config_test, directories tf.logging.set_verbosity(tf.logging.ERROR)...
from .obj import * from .widgets import * from .md2html import * __title__ = 'markwise' __author__ = 'SnowballSH, Tekgar' __license__ = 'MIT' __version__ = '0.2.0'
# %% [markdown] # # THE MIND OF A MAGGOT # %% [markdown] # ## Imports import os import time import warnings import colorcet as cc import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.transforms as transforms import numpy as np import pandas as pd import seaborn as sns from anytree import LevelOr...
class Solution: def cherryPickup(self, grid: List[List[int]]) -> int: n = len(grid) @lru_cache(None) def fn(t, i, ii): """Return maximum cherries collected at kth step when two robots are at ith and iith row""" j, jj = t - i, t - ii #columns if n...
# Import the file to be used by the cProfiler #import plot_dict_face_patches # Import needed libraries --Do not change import os import cProfile, pstats import io from prettytable import PrettyTable import csv filename = "plot_pcr_vs_pls.py" ################# Memory profiling ################# print ("...Memory Prof...
# -*- test-case-name: calculus.test.test_client_2 -*- from twisted.protocols import basic from twisted.internet import defer, reactor class ClientTimeoutError(Exception): pass class RemoteCalculationClient(basic.LineReceiver): callLater = reactor.callLater timeOut = 60 def __init__(self): ...
# Copyright (c) Meta Platforms, Inc. and affiliates. # 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. import torch from pytorch3d import _C # Example functions for blending the top K features per pixel using the...
# Copyright (C) 2018 Riedel Communications GmbH & Co. KG # # Modifications Copyright 2018 British Broadcasting Corporation # # 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...
#TODO: how to block this for production AUTH_ROLE_PUBLIC = 'Admin'
from src.NetworkLayer import NetworkLayer from src.NeuronLayer import NeuronLayer class NeuralNetwork: def __init__(self, layers): # init self.neuron_layers = [NeuronLayer(i) for i in layers] self.network_layers = [NetworkLayer(self.neuron_layers[i].length(), self.neuron_layers[i...
#!/usr/bin/env python3 def go(is_b=False): with open("in") as f: inp = [list(map(int, line.strip().replace("->", ",").split(","))) for line in f] field = [ [0 for _ in range(max(max([(c[0], c[2]) for c in inp])) + 1)] for _ in range(max(max([(c[1], c[3]) for c in inp])) + 1) ] ...
import pandas as pd import numpy as np import datetime # Read in injury data set injuries = pd.read_csv("injuries.csv") injuries.drop('Unnamed: 0', axis=1, inplace = True) injuries.rename(columns={'Played':'played_inj'}, inplace=True) # Drop healthy rows inj_no_healthy = injuries.loc[~ (injuries.Injury == 'Healthy'),...
DEBUG = True letters = "qwertyuiopasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM" digits = "0123456789" symbol = ";:,[](){}+-*=<" whitespace = "\n\r\t\v\f " slash = "/" all_valid = letters + digits + symbol + whitespace + slash keywords = ["if", "else", "void", "int", "repeat", "break", "until", "return", "endif"] NUM = "...
import datetime from django.test import SimpleTestCase from zentral.contrib.santa.events import (_build_file_tree_from_santa_event, EventMetadata, SantaEnrollmentEvent, SantaEventEvent, SantaRuleSetUpdateEvent, SantaRuleUpdateEvent) c...
# mutating inside of tuples # http://radar.oreilly.com/2014/10/python-tuples-immutable-but-potentially-changing.html my_tuple = ("Valdis", "programmer", 45, 200, [1, 2, 3], { 'food': 'potatoes', 'drink': 'milk'}) print(my_tuple) # we can not change references to tuple object # my_tuple[1] = "coding" # my_t...
# -*- coding: utf-8 -*- """ Clamor ~~~~~~ The Python Discord API Framework. :copyright: (c) 2019 Valentin B. :license: MIT, see LICENSE for more details. """ from .meta import * from .rest import * import logging fmt = '[%(levelname)s] %(asctime)s - %(name)s:%(lineno)d - %(message)s' logging.basicConfig(format=fm...
import unittest from jnpr.jsnapy.operator import Operator import os import yaml from jnpr.jsnapy.check import Comparator from mock import patch, MagicMock from nose.plugins.attrib import attr @attr('unit') class TestCheck(unittest.TestCase): def setUp(self): self.diff = False self.chk = False ...
from rest_framework import generics from rest_framework.authtoken.views import ObtainAuthToken from rest_framework.settings import api_settings from .serializers import UserSerializer, AuthTokenSerializer class CreateUserView(generics.CreateAPIView): """Create a new user in the system""" serializer_class = U...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# 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! *** # Export this package's modules as members: from .get_integration_account import * from .get_integration_account_agreement import * from .get_integrati...
import os.path import gzip import re from ckg.graphdb_builder import mapping as mp, builder_utils def parser(databases_directory, drug_source, download=True): config = builder_utils.get_config(config_name="siderConfig.yml", data_type='databases') url = config['SIDER_url'] header = config['header'] ou...
# Copyright 2021 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, ...
''' XbrlDpmEbaDB.py implements an SQL database interface for Arelle, based on the DPM EBA database. This is a semantic data points modeling representation of EBA's XBRL information architecture. This module may save directly to a Postgres, MySQL, SEQLite, MSSQL, or Oracle server. This module provides the execution...
#!/usr/bin/env python3 # SPDX-License-Identifier: (Apache-2.0 OR MIT) # Add new JSON files here (corresponding to ../data/*.json.xz) FIXTURES = [ "canada.json.xz", "citm_catalog.json.xz", "github.json.xz", "twitter.json.xz", ]
# # Copyright (C) 2013 by Gilbert Ramirez <gram@alumni.rice.edu> # # SPDX-License-Identifier: GPL-2.0-or-later import os.path import unittest # Run by unittest.defaultTestLoader.discover in test.py def load_tests(loader, standard_tests, pattern): this_dir = os.path.dirname(__file__) package_tests = loader.d...
# Generated by Django 4.0.3 on 2022-04-10 18:47 from django.db import migrations, models import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Product', fields=[ ('id', model...
# -*- coding: utf-8 -*- import asyncio import logging import pytest import websockets from collections import namedtuple from asynctest.mock import CoroutineMock from asynctest.mock import patch from asynctest.mock import PropertyMock from poke_env.player.player_network_interface import PlayerNetwork from poke_env.pl...
from steem.account import Account from datetime import datetime a = Account('whoami') # 계정명 입력 comment_histories = list(a.get_account_history(index = -1, limit = 20, filter_by=['comment'], raw_output=True)) comment_histories = [ comment for comment in comment_histories if comment[1]['op'][1]['title'] == '' ] com...
__author__ = 'Elahe' import sqlite3 as lite import numpy as np import ephem import pandas as pd def update(Schedule): con = lite.connect('FBDE.db') cur = con.cursor() #TODO avoid overwrite t_start = Schedule[0]['ephemDate'] t_end = Schedule[-1]['ephemDate'] N_visits = np.count_nonzero(Sc...
"""Driver of the test execution framework.""" from __future__ import absolute_import import threading import time from . import fixtures from . import hook_test_archival as archival from . import hooks as _hooks from . import job as _job from . import report as _report from . import testcases from .. import config a...
from __future__ import print_function from data import * from utils.augmentations import SSDAugmentation from layers.modules import MultiBoxLoss from ssd import build_ssd import os import sys import time import torch from torch.autograd import Variable import torch.nn as nn import torch.optim as optim import torch.back...
from rest_framework import serializers from v1.accounts.serializers.user import UserSerializer from v1.replies.models.album_reply import AlbumReply class AlbumReplySerializer(serializers.ModelSerializer): user = UserSerializer() class Meta: model = AlbumReply fields = '__all__' class AlbumR...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Geopm(AutotoolsPackage): """GEOPM is an extensible power management framework targeting HP...
""" ASGI config for Goorm_Project project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setde...
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import _foo # noqa: F401
# -*- coding: utf-8 -*- """ A simple Tic Tac Toe Game that written in python. This game can be played in commant-line. Requirements: * 2 players should be able to play the game (both sitting at the same computer) * The board should be printed out every time a player makes a mov...
#!/usr/bin/env python2 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import hashlib import sys import os from random import SystemRandom import base64 import hmac if len(s...
import pathlib import traceback import pytest import pandas as pd from hw5 import * def test_valid_input(): fname = pathlib.Path(__file__) q = QuestionnaireAnalysis(fname) assert fname == q.data_fname def test_str_input(): q = QuestionnaireAnalysis(__file__) assert pathlib.Path(__file__) == q.d...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import time import requests import pandas as pd from tqdm import tqdm from bs4 import BeautifulSoup MAX_RETRY = 5 PDF_PATH = 'uttarakhand_{:d}' links = {2007: 'http://election.uk.gov.in/pdf_roll/01012007/Uttranchal_pdf_page.htm', 2008: 'http://electi...
import datetime as dt from typing import Dict, List, Union from notion.models.rich_text import RichText from notion.models.file import File from notion.models.emoji import Emoji from notion.models.property import Property class Parent(): """ https://developers.notion.com/reference/database#page-parent """...
class SecondLargestElementInArray: def __init__(self, array_list): self.__numbers_list = array_list def find_second_largest_number(self): largest, second_largest = 0, -1 for i in range(len(self.__numbers_list)): if self.__numbers_list[i] > self.__numbers_list[largest]: ...
""" WSGI config for ProjectManager project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANG...
# 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...
from somebox.common.protocol import Protocol from somebox.client.client import Client
from pathlib import Path import cv2 import numpy as np from PIL import Image def unity_visualize(): root = Path('data/unity') labels = root / 'SemanticSegmentation' rgbs = root / 'RGB' for f, l in zip(sorted(rgbs.glob('*.png'), key=lambda x: int(str(x.stem)[4:])), sorted(labels.glob...
"""Floyd-Warshall algorithm for shortest paths. """ import networkx as nx __all__ = [ "floyd_warshall", "floyd_warshall_predecessor_and_distance", "reconstruct_path", "floyd_warshall_numpy", ] def floyd_warshall_numpy(G, nodelist=None, weight="weight"): """Find all-pairs shortest path lengths usi...
#!/usr/bin/env python #=============================================================================# # # # NAME: util_plotTk.py # # ...
import logging logger = logging.getLogger(__name__) from database.Database import LocalDatabaseServer, DatabaseManager server = LocalDatabaseServer() server.LoadDatabase() manager = DatabaseManager(server) manager.AddCourse(name="Differential Equations", crn="13756", credits=5, code="MAT 210", grade_letter="DD",...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange import hashlib from ccxt.base.errors import ExchangeError from ccxt.base.errors import ArgumentsReq...
from dateparser import parse import demistomock as demisto from CommonServerPython import * def get_feed_integration_errors() -> TableOrListWidget: integration_search_res = demisto.internalHttpRequest( 'POST', '/settings/integration/search', '{}', ) table = TableOrListWidget() ...
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import logging from sleekxmpp.xmlstream import register_stanza_plugin from sleekxmpp.plugins.base import BasePlugin, register_...
#!/usr/bin/env python from __future__ import print_function import argparse import csv import json import re import sys import time import closeio_api import unidecode from closeio_api import Client as CloseIO_API from closeio_api.utils import count_lines, title_case, uncamel from progressbar import ProgressBar from...
# DADSA - Assignment 1 # Reece Benson import json import random from classes import Player as Player from classes import Season as Season from classes import Tournament as Tournament from classes import Round as Round from classes import Match as Match class Handler(): # Define the variables we will be using ...
from __future__ import division from __future__ import print_function import sys from os import path sys.path.append(path.dirname(path.dirname(path.abspath(__file__))) + '/utils/') from algorithm_utils import TransferData, ExaremeError class DescrStatsLocal_DT(TransferData): def __init__(self, transf_var_list):...
from typing import Any, Dict from ...utils import HTTPClient path = "/_/example/httpx" async def provider() -> Dict[str, Any]: """Define a basic example data provider function.""" async with HTTPClient() as client: response = await client.get("https://httpbin.org/ip") ip = response.json()["...
import json from decorators import with_logging @with_logging def handler(event, context): return json.loads(event)
user = int(raw_input("enter a number")) i = 2 while i <= user: if user % 2 != 0: print i,"prime hain" else: print i,"prime nhi h" i = i + 1
# Questão 1 def ordena(): lista = [] for i in range(5): n = int(input()) lista.append(n) lista.sort() return lista recept = ordena() print(recept) # Questão 2 def primo(n): eh_primo = True if n <= 1: eh_primo = False else: for i in range(2, n): if...
"""empty message Revision ID: 4546151d3696 Revises: 364dce00caf6 Create Date: 2019-08-12 18:00:47.387988 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4546151d3696' down_revision = '364dce00caf6' branch_labels = None depends_on = None def upgrade(): # ...
import pytest import pygamehack as gh from pygamehack.code import Code @pytest.fixture def code(arch): if arch == 32: return Code(offset=12, offset_size=4, begin='TestProgram-32.exe', size=0, code='00 00 A1 ?? ?? ?? ?? 40 83 E0 ?? A3 ?? ?? ?? ?? E9 ?? ?? ?? ?? 5? ?8 ?? ?? ?? ?? 52') ...
# -*- coding: utf-8 -*- # !/usr/bin/env python """ ------------------------------------------------- File Name: project.py Description: 处理与项目(增减改)相关的工作 Author: Dexter Chen Date:2017-09-04 ------------------------------------------------- Development Note: 1. 扫描所有项目文件夹,项目文件夹数可大于csv中登记数 2. 根据需要新建项目,生...
from kivy.metrics import dp from kivy.uix.anchorlayout import AnchorLayout from kivymd.app import MDApp from kivymd.uix.datatables import MDDataTable class Example(MDApp): def build(self): layout = AnchorLayout() data_tables = MDDataTable( size_hint=(0.9, 0.6), use_paginat...
NAME = "PyYAML" VERSION = "3.13" DESCRIPTION = "YAML parser and emitter for Python" LONG_DESCRIPTION = """\ YAML is a data serialization format designed for human readability and interaction with scripting languages. PyYAML is a YAML parser and emitter for Python. PyYAML features a complete YAML 1.1 parser, Unicode s...
import codecs import os.path import re try: from setuptools import setup except ImportError: from distutils.core import setup def fpath(name): return os.path.join(os.path.dirname(__file__), name) def read(fname): return codecs.open(fpath(fname), encoding='utf-8').read() def grep(attrname): pa...
#!/usr/bin/env python import argparse import matplotlib.pyplot as plot import gudhi """ This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. Author(s): Vincent Rouvreau C...