text
stringlengths
1
927k
#The code is used for visulization, inspired from cocoapi # Licensed under the Simplified BSD License [see bsd.txt] import os import matplotlib.pyplot as plt from matplotlib.collections import PatchCollection from matplotlib.patches import Polygon, Circle import numpy as np import dota_utils as util from collections ...
"""Main application to be deployed in for example uvicorn. """ from fastapi import FastAPI from simcore_service_catalog.core.application import init_app # SINGLETON FastAPI app the_app: FastAPI = init_app()
""" transforms.py is for shape-preserving functions. """ import numpy as np from pandas.core.dtypes.common import ensure_platform_int def shift(values: np.ndarray, periods: int, axis: int, fill_value) -> np.ndarray: new_values = values # make sure array sent to np.roll is c_contiguous f_ordered = value...
import math # CRIVO m = 10 ** 6 + 10 eh_primo = [True] * m eh_primo[0] = False eh_primo[1] = False for i in xrange(int(math.sqrt(m))): if eh_primo[i]: for j in xrange(i * i, m, i): eh_primo[j] = False # ------------ n = int(raw_input()) a = int(math.sqrt(n)) b = int(math.sqrt(n)) if eh_pr...
from os.path import abspath, join def run(): from spitfire.chemistry.mechanism import ChemicalMechanismSpec from spitfire.chemistry.tabulation import build_adiabatic_slfm_library import spitfire.chemistry.analysis as sca import numpy as np test_xml = abspath(join('tests', 'test_mechanisms', 'h2-b...
import socket import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 ''' CONSTANTS ''' ''' CLIENT CLASS ''' class Server(): def __init__(self, host, port): self.host = host self.port = port self.validate() def validate(self): is_ip = Fals...
""" MIT License Copyright (c) 2021 TheHamkerCat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, ...
# coding: utf-8 """ Peacemakr This API describes the Peacemakr services, which enable seamless application layer encryption and verification. # noqa: E501 OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import i...
""" Vault API Allow clients to fetch Analytics through APIs. # noqa: E501 The version of the OpenAPI document: v3 Contact: analytics.api.support@factset.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from fds.sdk.Vault.model_utils import (...
"""Single-file example for serving an NBDT model. This functions as a simple single-endpoint API, using flask. """ from flask import Flask, flash, request, redirect, url_for, jsonify from flask_cors import CORS from nbdt.model import HardNBDT from nbdt.models import wrn28_10_cifar10 from torchvision import transform...
import os from datetime import datetime from app import app from app import utils # Treat *.plot files smaller than this as in-transit (copying) so don't count them MINIMUM_K32_PLOT_SIZE_BYTES = 100 * 1024 * 1024 class FarmSummary: def __init__(self, cli_stdout=None, farm_plots=None): if cli_stdout: ...
# imports are done directly to keep user's auto-complete clean from .detection import SquareBoxes2D from .detection import DenormalizeBoxes2D from .detection import RoundBoxes2D from .detection import ClipBoxes2D from .detection import FilterClassBoxes2D from .detection import CropBoxes2D from .detection import ToBoxe...
#!/usr/bin/env python # -*- coding: utf-8 -*- from cpt.packager import ConanMultiPackager if __name__ == "__main__": builder = ConanMultiPackager() builder.add_common_builds(pure_c=True) builder.run()
import os from django.urls import path, include import face_recognition import cv2 from imutils.video import VideoStream import imutils import numpy as np from tensorflow.keras.models import load_model from tensorflow.keras.applications.mobilenet_v2 import preprocess_input from tensorflow.keras.preprocessing.image impo...
station_map = { '12th': '12th St. Oakland City Center', '16th': '16th St. Mission (SF)', '19th': '19th St. Oakland', '24th': '24th St. Mission (SF)', 'ashb': 'Ashby (Berkeley)', 'balb': 'Balboa Park (SF)', 'bayf': 'Bay Fair (San Leandro)', 'cast': 'Castro Valley', 'civc': 'Civic Cent...
# Generated by Django 3.1 on 2020-08-25 06:00 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ("auth", "0012_alter_user_first_name_max_length"), ] operations = [ migrations.CreateModel( ...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from ansible_collections.ibm.ibm_zos_ims.plugins.module_utils.ims_module_error_messages import ErrorMessages as em # pylint: disable=import-error from pprint import pprint import pytest __metaclass__ = type SUCCESSFUL_RC = '0...
import extension_struct as es defines = { "output": "../lib/resty/openssl/x509/init.lua", "output_test": "../t/openssl/x509.t", "type": "X509", "has_extension_accessor_by_nid": True, "extensions_in_struct":"cert_info.extensions", "has_sign_verify": True, "sample": "Github.pem", "sample_...
# coding=utf-8 import os import boto3 import urlparse """ Required Lambda Environment Variables: - slacktoken: Your private Slack App Verification Token - allowed_users: List of Slack user_ids id1,id2,... """ # original reference source: https://dev.solita.fi/2018/08/16/easy-test-deployments-round-two.html def dep...
from sys import argv script, filename = argv file = open(filename,'w') file.write("__kernel void identification( __global uint *trainData, __global uint *dataSize, __global uint *changes, __global uint *changesSize, __global uint *rotule, __global uint *result){ /*first pass is normalize the trainData passing the no...
import sys import cro_mapper import os import unicodedata import numpy as np from scipy import misc def _get_all_file_paths(path): file_paths = [] for root, dirs, files in os.walk(path): for file_ in files: full_path = os.path.join(root, file_) if os.path.isfile(full_path) and f...
import numpy as np import os import json from PIL import Image import pickle import streamlit as st from streamlit.hashing import _CodeHasher from streamlit.report_thread import get_report_ctx from streamlit.server.server import Server import sys import urllib import torch import random import biggan from torchvision.u...
# orm/util.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .. import sql, util, event, exc as sa_exc, inspection from ..sql import expression...
from snowddl.blueprint import ObjectType from snowddl.converter.abc_converter import AbstractConverter, ConvertResult from snowddl.parser.database import database_json_schema class DatabaseConverter(AbstractConverter): def get_object_type(self) -> ObjectType: return ObjectType.DATABASE def get_existi...
"""Test ImperialMonth.""" from imperial_calendar.internal.ImperialMonth import ImperialMonth import unittest class TestImperialMonth(unittest.TestCase): """Test ImperialMonth.""" def test_days(self): """ใ“ใฎๆœˆใฎๆ—ฅๆ•ธ.""" for (month, days) in [ (1, 28), (2, 28), (...
# coding: utf-8 """ Argo Events No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v1.0.0 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six fr...
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def removeDuplicateNodes(self, head: ListNode) -> ListNode: if not head or not head.next: return head f = [False for i in range(20001)] ...
import logging import sqlite3 import time from ct.client.db import log_db from ct.client.db import database from ct.proto import client_pb2 class SQLiteLogDB(log_db.LogDB): def __init__(self, connection_manager): """Initialize the database and tables. Args: connection_manager: an SQLit...
""" Unit tests for module `homework_2.tasks.task_4`. """ from typing import Any, Callable, Tuple import pytest from homework_2.tasks.task_4 import cache @pytest.mark.parametrize( ["function", "args"], [ pytest.param( lambda a, b: (a ** b) ** 2, (100, 200), id="Com...
import datetime from typing import Optional def generate_token( user_id: str, jwt_secret: str, jwt_algorithm: str = "HS256", jwt_exp_delta_seconds: Optional[int] = None, ): """ Generate a token for SkyPortal to access Kowalski """ import jwt jwt_config = { "user_id": user_...
from dataclasses import dataclass @dataclass class Line: line: int level: int value: str
import re from collections import defaultdict from datetime import datetime, timedelta from functools import wraps import humanize import simplejson as json from dateutil.tz import tzutc from flask import Blueprint, g, redirect, request, url_for, current_app, jsonify from flask import session as cookie_session from fl...
#!/usr/bin/env python from gimpfu import * import math def fry_oil(img, layer) : gimp.progress_init("Frying oiling " + layer.name + "...") pdb.gimp_image_undo_group_start(img) pos = pdb.gimp_image_get_layer_position(img, layer) magenta = pdb.gimp_layer_copy(layer, True) pdb.gimp_layer_set_name(mag...
import service.app
#!/usr/bin/python3 import subprocess import cgi print("content-type: text/html") print() mydata = cgi.FieldStorage() myx = mydata.getvalue("c") myy = mydata.getvalue("d") if myx == str(1): output = subprocess.getoutput("sudo date") print(output) elif myx == str(2): output = subprocess.getoutput("sudo cal...
# _*_coding : UTF_8 _*_ # Author : Xueshan Zhang # Date : 2022/1/22 2:59 PM # File : Status.py # Tool : PyCharm # Reference : __repr__ << Thread << threading.py import threading import time, os def Subthread(n): for i in range(n): print('is going to sleep', i, 's.') time.sleep(i)...
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/general/shared_bunker_rebel_deep_chasm.iff" result.attribute_templa...
""" This is a django-split-settings main file. For more information read this: https://github.com/sobolevn/django-split-settings Default environment is `development`. To change settings file: `DJANGO_ENV=production python manage.py runserver` """ import django_heroku from split_settings.tools import include base_set...
from collections.abc import MutableSequence from typing import Iterable, Union, Sequence from google.protobuf.pyext._message import RepeatedCompositeContainer from ...proto.jina_pb2 import DocumentProto if False: from ..document import Document __all__ = ['DocumentSet'] class DocumentSet(MutableSequence): ...
# coding: utf-8 # In[ ]: #[GridSearch] SVM Learning Classification import pandas as pd import numpy as np import sys # Read dataset data_values = pd.read_csv("../../../Datasets/train_values_processed.csv") data_labels = data_values["status_group"] data_values.drop(['status_group'], axis=1, inplace=True) # In[ ]: ...
# Generated by Django 2.0.5 on 2018-06-28 08:54 from django.db import migrations, models import restaurants.validators class Migration(migrations.Migration): dependencies = [ ('restaurants', '0007_restaurant_owner'), ] operations = [ migrations.AlterField( model_name='restau...
# Copyright (c) OpenMMLab. All rights reserved. import os import tempfile from os import path as osp import mmcv import numpy as np import pandas as pd from lyft_dataset_sdk.lyftdataset import LyftDataset as Lyft from lyft_dataset_sdk.utils.data_classes import Box as LyftBox from pyquaternion import Quaternion from m...
"""python 3.7+ Run allele stage2_var_obj methods. Carmen Sheppard 2019-2022 """ import sys import os import exceptions from run_scripts.tools import run_mash_screen, create_dataframe, \ apply_filters, create_csv, get_variant_ids def sort_genes(gene, stage2_var_obj, allele_or_gene, session): """ Main run s...
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest, os, base64 import frappe from frappe import safe_decode from frappe.email.receive import Email from frappe.email.email_body import (rep...
import tkinter as tk from tkinter.ttk import * def f(): frame=tk.Tk() frame.geometry('1500x1500') c=tk.Canvas(frame,bg="white",height=1300,width=1200) return c,frame def circle(): c,e=f() c.create_oval(20,20,200,200,outline="red") c.pack() e.mainloop() def rect(): c,e=f() c.creat...
# -*- encoding: utf-8 -*- ''' Text Input ========== .. versionadded:: 1.0.4 .. image:: images/textinput-mono.jpg .. image:: images/textinput-multi.jpg The :class:`TextInput` widget provides a box for editable plain text. Unicode, multiline, cursor navigation, selection and clipboard features are supported. The :cl...
import argparse from collections import defaultdict import torch from transformers import T5ForConditionalGeneration, T5Tokenizer from tqdm import tqdm from util.util_funcs import load_jsonl model = T5ForConditionalGeneration.from_pretrained("t5-small") tokenizer = T5Tokenizer.from_pretrained("t5-small") MNLI_TO_FEV...
"""Entry point for the Tidal Disruption Catalog """ def main(args, clargs, log): from .tidaldisruptioncatalog import TidalDisruptionCatalog from astrocats.catalog.argshandler import ArgsHandler # Create an `ArgsHandler` instance with the appropriate argparse machinery args_handler = ArgsHandler(log) ...
# Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'conditions': [ ['OS=="linux"', {'os_include': 'linux'}], ['OS=="mac"', {'os_include': 'mac'}], ['OS=="win"', {'...
# Copyright (c) 2021 GradsFlow. 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 ...
import json import sys from copy import deepcopy from hashlib import sha256 from common.exceptions import PlenumTypeError, PlenumValueError from plenum.common.constants import TARGET_NYM, NONCE, RAW, ENC, HASH, NAME, \ VERSION, FORCE, ORIGIN, OPERATION_SCHEMA_IS_STRICT, SCHEMA_IS_STRICT from plenum.common.message...
"""Utilities for running custom scripts """ from argparse import Namespace from core.constructs.workspace import Workspace from core.constructs.output_manager import OutputManager def execute_run_cli(args) -> None: ws = Workspace.instance() output_manager = OutputManager() run_command(ws, output_mana...
__author__ = 'Dai Tianyu (dtysky)' from PIL import Image import os,re def hemorrhage(im,border={'top':10,'bottom':10,'left':10,'right':10},opcity=0.5): opcity = int(opcity * 255) xsize,ysize = im.size im = im.convert('RGBA') res_xsize = xsize + border['left'] + border['right'] res_ysize = ysize + border['top'] +...
""" Accelerated Failure Time (AFT) Model with empirical likelihood inference. AFT regression analysis is applicable when the researcher has access to a randomly right censored dependent variable, a matrix of exogenous variables and an indicatior variable (delta) that takes a value of 0 if the observation is censored ...
from os import listdir, system from os.path import isfile, join def iterate_dir(path): for f in listdir(path): if isfile(join(path, f)): if f.endswith('.wav'): system('sox ' + path + '/' + f + ' out.wav remix 1') system('rm ' + path + '/' + f) sy...
from __future__ import absolute_import from django.conf import settings from django.core.exceptions import ValidationError from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from typing import List, Optional, Set, Text from zerver.decorator import authenticated_json_p...
# # Copyright 2019 Lars Pastewka # 2018-2019 Antoine Sanner # # ### MIT license # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation...
import oneflow as flow import argparse import numpy as np import os import time from models.posenet import PoseNet from utils.ofrecord_data_utils import OFRecordDataLoader def _parse_args(): parser = argparse.ArgumentParser("flags for train posenet") parser.add_argument( "--save_checkpoint_path", ...
import os import unittest from cdm.enums import CdmObjectType, CdmStatusLevel from cdm.objectmodel import CdmCorpusContext, CdmCorpusDefinition from cdm.persistence.cdmfolder import ManifestPersistence from cdm.persistence.cdmfolder.types import ManifestContent from cdm.storage import LocalAdapter from tests.common i...
import os files=os.listdir('.') packages = ['N10_inheritance_2', 'N11_polymorphism_1', 'N12_polymorphism_2', 'N13_inheriting_init_constructor_1', 'N14_multiple_inheritance_1', 'N15_multiple_inheritance_2', 'N16_multiple_inheritance_3', ...
# Generated by Django 3.1.3 on 2021-05-22 14:08 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUT...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require_contenttypes_0002'), ('fieldsight', '0016_auto_20170706_1543'), ] operations = [ migrations.Cre...
# Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
from rest_framework import status from rest_framework.response import Response from rest_auth.registration.views import RegisterView as RestAuthRegisterView from rest_framework.views import APIView from rest_framework.permissions import AllowAny from allauth.account.models import EmailConfirmation, EmailConfirmationHMA...
suffix = '' run_name = __name__.split('.')[-1] + suffix backbone_specs = { 'backbone_module': 'imagenet_models', 'backbone_function': 'resnet34_backbone', 'kwargs': { 'pretrained': False, 'channel_config': (1, 2, 2, 2), 'channel_multiplier': 64, }, 'head_channel_multiplier'...
# Software License Agreement (BSD License) # # Copyright (c) 2012, 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 must retain the above...
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup from log_config import logger class Struct(object): """ An object that has attributes built from the dictionary given in constructor. So ss=Struct(a=1, b='b') will satisfy assert ss.a == 1 and assert ss.b == 'b'. """ def __init__(sel...
# python3 class Coordinates: class Builder: def __init__(self): self.obj = Coordinates() def lat(self, lat): self.obj.lat = lat return self def lon(self, lon): self.obj.lon = lon return self def build(self): ...
import abc from typing import Dict, Callable InterruptCallback = Callable[[str], None] class AbstractModule(abc.ABC): """ Defines the common methods of a module. """ @classmethod @abc.abstractmethod async def build(cls, port: str, interrupt_callback, ...
# Generated by Django 2.0.5 on 2018-05-28 10:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('transaction', '0015_merge_20180524_1853'), ] operations = [ migrations.AlterField( model_name='insurance', name='is_...
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2020 Huang Po-Hsuan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy...
import numpy as np from sklearn.base import BaseEstimator from pwass.spline import SplineBasis from pwass.distributions import Distribution class SimpliciadDistribOnDistrib(BaseEstimator): def __init__(self, fit_intercept=True, nbasis=-1, spline_basis=None, compute_spline=True): self.fit...
import unittest from ..src import arraylist # import arraylist class TestArrayList(unittest.TestCase): def setUp(self): self.array = arraylist.ArrayList() pass def test_append(self): array_test = [] for i in range(0,10): self.array.append(2*i) array_tes...
""" Purpose: To show how to use "Multidimensional Scaling" (MDS) to find a set of coordinates in 2D that best respect a matrix. In this particular example, students gave a distance matrix where they expressed how similar they thought different majors were to each other. This code loops through all student submission...
#!/usr/bin/python # encoding: utf-8 import sys import os.path from random import Random random = Random(0) # initialise with seed to have reproductible benches # for example: ./genbench.py /tmp/build 50 100 15 5 HELP_USAGE = """Usage: generate_libs.py root libs classes internal external. root - Root director...
class ShaderNodeWireframe: use_pixel_size = None
from datetime import datetime def get_this_month(): month = datetime.now() return month.strftime("%B") def get_this_day(): day = datetime.today() return day.day def get_month_and_day(): return f"{get_this_month()}_{get_this_day()}"
import sys, os, re ## Functions to prettify boost.Python autodoc output ## ## Based on code from minieigen (https://launchpad.net/minieigen/) // LGPLv3 ## and modified for Computational Crystallography Toolbox ## See: ## http://bazaar.launchpad.net/~eudoxos/minieigen/trunk/view/head:/doc/source/conf.py ## ht...
from mpi4py import MPI import sys import os import argparse import traceback import numpy as np from desispec.util import option_list from desispec.parallel import stdouterr_redirected from desisim import obs import desisim.scripts.newexp_random as newexp flavors = ['arc', 'arc', 'arc', 'flat', 'fla...
############################################################################## # Copyright 2017 Parker Berberian and Others # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # yo...
"""Conversation objects.""" import asyncio import datetime import logging from hangups import (parsers, event, user, conversation_event, exceptions, hangouts_pb2) logger = logging.getLogger(__name__) CONVERSATIONS_PER_REQUEST = 100 MAX_CONVERSATION_PAGES = 100 async def build_user_conversatio...
# Copyright 2021 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...
# 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 fro...
import re from prettytable import PrettyTable from IPython import embed def param_extract(args): param_set = [ 'batch_size', 'dropout', 'factors', 'lr', # 'num_layers', 'num_ng', 'reg_1', 'reg_2', ] print('Decide which parameter you want to tune') bar = 0 for param in param_set: ...
import time import os import subprocess import jk_utils import jk_mounting import jk_typing from .AbstractBackupConnector import AbstractBackupConnector from .ThaniyaIO import ThaniyaIO from .ThaniyaBackupContext import ThaniyaBackupContext from .BackupConnectorMixin_mountSFTP import BackupConnectorMixin_mountSFTP fr...
#!/usr/bin/env python3 # Copyright (c) 2014-2017 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the dir...
import pickle import sklearn import numpy as np import matplotlib.pyplot as plt from warnings import filterwarnings filterwarnings('ignore') import seaborn as sns sns.set() from pandas.plotting import scatter_matrix from sklearn import datasets from sklearn.preprocessing import StandardScaler from sklearn.preprocessin...
from unittest import TestCase from wagtail.wagtailcore.blocks.field_block import CharBlock from wagtail.wagtailcore.blocks.stream_block import StreamValue from pages.blocks import StreamBlock class TestCharBlock(CharBlock): def __init__(self, *args, **kwargs): self.expected = kwargs.pop('expected', None...
# Copyright 2020 - 2021 MONAI Consortium # 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 wri...
""" Ex 81 - Make a program that helps a MEGA SENA player to create guesses. the program will ask how many games will be generated and will draw 6 numbers between 1 and 60 for each game, registering everything in a composed list """ # ----- Import ----- from random import sample # ----- Var ----- draw = list() game =...
from django.contrib import admin # Register your models here. from app.models import Board, WorkIn, PostIt, VoteIn admin.site.register(Board) admin.site.register(WorkIn) admin.site.register(PostIt) admin.site.register(VoteIn)
import sys print (sys.version) class Car(): def __init__(self,clr,category): self.color = clr self.type = category print("Object Created Successfully!") honda = Car("red","sedan") print (honda.__dict__)
from django.contrib import admin from data.models import * from import_export.admin import ExportMixin from import_export.widgets import ForeignKeyWidget from import_export import fields, resources # Register your models here. class QuizDataResource(resources.ModelResource): code = fields.Field(attribute='code'...
# License: BSD 3-Clause from collections import OrderedDict import io import re import os from typing import Union, Dict, Optional import pandas as pd import xmltodict from ..exceptions import OpenMLCacheException from ..datasets import get_dataset from .task import ( OpenMLClassificationTask, OpenMLClusteri...
# Copyright 2013 OpenStack LLC. # 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 b...
import numpy as np from .._mpe_utils.core import Agent, Landmark, World from .._mpe_utils.scenario import BaseScenario class Scenario(BaseScenario): def make_world( self, num_good_agents=2, num_adversaries=4, num_landmarks=1, num_food=2, num_forests=2, ): ...
# encoding: UTF-8 from hsstock.vnpy.trader.app.riskManager.rmEngine import RmEngine from hsstock.vnpy.trader.app.riskManager.uiRmWidget import RmEngineManager appName = 'RiskManager' appDisplayName = u'้ฃŽ้™ฉ็ฎก็†' appEngine = RmEngine appWidget = RmEngineManager appIco = 'rm.ico'
import uuid from flask import jsonify, render_template, request, redirect, url_for from lnurl import encode as lnurl_encode from datetime import datetime from lnbits.db import open_db, open_ext_db from lnbits.extensions.withdraw import withdraw_ext @withdraw_ext.route("/") def index(): """Main withdraw link pag...
#!/usr/bin/env python3 import sys sys.path.append("..") from tinkoff.cloud.stt.v1 import stt_pb2_grpc, stt_pb2 from auth import authorization_metadata import grpc import os import wave endpoint = os.environ.get("VOICEKIT_ENDPOINT") or "api.tinkoff.ai:443" api_key = os.environ["VOICEKIT_API_KEY"] secret_key = os.envi...
import unittest import json from app.tests.v2.base_test import BaseTestCase #Registration endpoint reg_endpoint = "api/v2/auth/register" #Login endpoint login_endpoint = "api/v2/auth/login" #Logout endpoint logout_endpoint = "api/v2/auth/logout" class TestAuthBlueprint(BaseTestCase): data = { "email":...