text
stringlengths
2
999k
from .proxy import current_app, _app_context_ctx, switch_app, get_app __all__ = [ current_app, _app_context_ctx, switch_app, get_app ]
from functools import wraps from os import environ from backends.exceptions import ErrorException def wrap_exception(exception_type, error_message): def _typed_exception_wrapper(func): @wraps(func) def _adapt_exception_types(*args, **kwargs): try: return func(*args, **...
# coding: utf-8 # ### All imports # In[1]: from tf_idf import * from evaluation import * # In[3]: corpus_dict = loadCorpus("corpus") print("corpus loaded") # In[4]: len(corpus_dict) corpus_dict['CACM-0637'] # In[5]: full_corpus_dict = loadCorpus("full_corpus") print("full_corpus loaded") # In[6]: f...
import os """This submodule aims to provide utilities for the gaussian software package. It will allow the user to quickly write custom interfaces to analyse the output files. """ class Extractor: """This class supports data extraction from gaussian output files. It provides functionality to extract all the ...
#!/usr/bin/env python3 import unittest import torch import gpytorch from gpytorch.test.variational_test_case import VariationalTestCase class TestUnwhitenedVariationalGP(VariationalTestCase, unittest.TestCase): @property def batch_shape(self): return torch.Size([]) @property def distributi...
# # Copyright (c), 2016-2020, SISSA (International School for Advanced Studies). # All rights reserved. # This file is distributed under the terms of the MIT License. # See the file 'LICENSE' in the root directory of the present # distribution, or http://opensource.org/licenses/MIT. # # @author Davide Brunato <brunato@...
import pytest from naturalnets.brains.i_layer_based_brain import ILayerBasedBrainCfg from tests.pytorch_brains import IPytorchBrainCfg @pytest.fixture def torch_config() -> IPytorchBrainCfg: return IPytorchBrainCfg(type="GRU_PyTorch", num_layers=3, hidden_size=8, ...
# coding=utf-8 # # # 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, software # d...
from django.forms import forms, ModelForm class FileForm(forms.Form): file_name = forms.FileField(label=u"文件名称")
from __future__ import print_function import sys CLI = False DEBUG = False AUTO = False def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def setdebug(state): global DEBUG DEBUG = state Debug("Python:") for p in sys.version.split("\n"): Debug(p) def setauto(state)...
from django.apps import AppConfig class TimelineappConfig(AppConfig): name = 'timelineApp'
from typing import Any class DataContainer: def __init__(self, train: Any, validation: Any, test: Any): self.train = train self.validation = validation self.test = test
class EC(): def __init__(self, id=None): self.database = 'EC' self.id = id self._long_name = 'EC (Enzyme Commission) number of the Nomenclature Committee of the International Union of Biochemistry and Molecular Biology (IUBMB) Database of Interacting Proteins' self._web = 'https://...
"""dailypythontip home app URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='ho...
import json import logging import os import sys import lambda_utils as utils """ Configure these environment variables in your Lambda environment or CloudFormation Inputs settings): 1. TARGET_FQDN (mandatory): The Fully Qualified DNS Name used for application cluster 2. ELB_TG_ARN (mandatory): The ARN of the Elastic...
from typing import Dict, List from pydantic import BaseModel, Extra class NewTeam(BaseModel): name: str members: Dict[str, List[str]] # uid, role class Config: extra = Extra.forbid class Team(NewTeam): uid: str
from django.test import TestCase from webinterface.models import * class AssignmentTest(TestCase): @classmethod def setUpTestData(cls): # Config cls.reference_week = 2500 # Schedule cls.schedule = Schedule.objects.create(name="schedule", cleaners_per_date=2, frequency=2, weekd...
# Copyright (c) 2021 Food-X Technologies # # This file is part of foodx_devops_tools. # # You should have received a copy of the MIT License along with # foodx_devops_tools. If not, see <https://opensource.org/licenses/MIT>. import contextlib import io import sys @contextlib.contextmanager def capture_stdout_stderr(...
""" Modification of https://github.com/stanfordnlp/treelstm/blob/master/scripts/download.py Downloads the following: - Celeb-A dataset - LSUN dataset - MNIST dataset """ from __future__ import print_function import os import sys import gzip import json import shutil import zipfile import argparse import requests impo...
# This file is part of the Python aiocoap library project. # # Copyright (c) 2012-2014 Maciej Wasilak <http://sixpinetrees.blogspot.com/>, # 2013-2014 Christian Amsüss <c.amsuess@energyharvesting.at> # # aiocoap is free software, this file is published under the MIT license as # described in the accompany...
# https://towardsdatascience.com/elucidating-policy-iteration-in-reinforcement-learning-jacks-car-rental-problem-d41b34c8aec7 import numpy as np import matplotlib.pyplot as plt import seaborn as sns from scipy.stats import poisson import sys class Poisson: def __init__(self, exp_num): self.exp_num = exp_...
from vkwave.types.responses import * from ._category import Category from ._utils import get_params class Wall(Category): async def check_copyright_link( self, link: str, return_raw_response: bool = False, ) -> typing.Union[dict, BaseBoolResponse]: """ :param link: :param retur...
import time import torch from options.train_options import TrainOptions from data import create_dataset from models import create_model from util.visualizer import Visualizer if __name__ == '__main__': opt = TrainOptions().parse() # get training options dataset = create_dataset(opt) # create a dataset give...
""" WSGI config for hymn256 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.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTI...
#!/usr/bin/env python import gym import gym.spaces import numpy as np from PIL import Image from copy import deepcopy from collections import OrderedDict import mujoco_py from mujoco_py import MjViewer, MujocoException, const, MjRenderContextOffscreen from safety_gym.envs.world import World, Robot import sys # Dis...
"""Run an example script to quickly test any MyQ account.""" import asyncio from aiohttp import ClientSession import pymyq from pymyq.errors import MyQError async def main() -> None: """Create the aiohttp session and run the example.""" async with ClientSession() as websession: try: myq ...
#!/usr/bin/env python from ansible.module_utils.basic import * ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: cisco_ucs_ldap_provider_group short_description: configures ldap provider group on...
# Generated by Django 2.0.6 on 2019-02-20 17:23 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dog_account', '0001_initial'), ] operations = [ migrations.AlterField( model_name='account', name='accountNumber', ...
# -*- coding: utf-8 from __future__ import unicode_literals, absolute_import from django.conf.urls import url, include from django.contrib import admin from dj_experiment.urls import urlpatterns as dj_experiment_urls urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^', include(dj_experiment_u...
import numpy as np from sklearn.base import BaseEstimator from tensorflow import keras from .recommenders import KerasRecommender class ItemPopularity(BaseEstimator): """Recommender based solely on interactions per item.""" def fit(self, X=None, y=None): """Fit the recommender from the training datas...
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver import Firefox, Chrome, PhantomJS ...
import os import pytest import sys import random import tempfile import time import requests from pathlib import Path import ray from ray.exceptions import RuntimeEnvSetupError from ray._private.test_utils import ( run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition) from ray._private.utils ...
import MySQLdb as sql from config import sqlconfig class users: def __init__(): self.connection = sql.connect( host=sqlconfig.host, user=sqlconfig.user, passwd=sqlconfig.passwd ) self.cursor = self.connection.cursor() def __del__(): self.cursor.close() sel...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' helper classes and functions ''' import os, sys, string, hashlib import re, textwrap from unicodedata import normalize try: from cStringIO import StringIO except ImportError: from StringIO import StringIO class DummyStream: ''' dummyStream behaves like a...
import cv2 import numpy as np #load colored image img_1 = cv2.imread("Images\\sunflower.png", 1) #load grayscale image img_2 = cv2.imread("Images\\sunflower.png", 0) #resizing images resized_img_1 = cv2.resize(img_1, (int(img_1.shape[1]/2), int(img_1.shape[0]/2))) #printing images' shape(dimension) pri...
import glob import json from docutils import nodes from sphinx.util.docutils import SphinxDirective from sphinx.util import logging def add_prop_attr_row(prop, attr, tbody, key = None): desc_row = nodes.row() tbody += desc_row desc_row += nodes.entry() desc_key_entry = nodes.entry() desc_row += d...
# Works on Linux .sym files generated using the nm command # Like this: # nm -CSr --size-sort StereoKitC.sym > size.txt import re data = {} file1 = open('size.txt', 'r') while True: line = file1.readline() # if line is empty end of file is reached if not line: break matches = re.search("(\...
# # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
""" TSP SIMULATED ANNEALING """ # Imports import math import numpy as np # read data from file f = open("TSP-configurations/eil51.tsp.txt", "r") # f = open("TSP-configurations/a280.tsp.txt", "r") # f = open("TSP-configurations/pcb442.tsp.txt", "r") network = f.readlines()[6:-1] # create dictionary to store coordina...
from itertools import combinations __author__ = "\n".join(['Ben Edwards (bedwards@cs.unm.edu)', 'Huston Hedinger (h@graphalchemist.com)', 'Dan Schult (dschult@colgate.edu)']) __all__ = ['dispersion'] def dispersion(G, u=None, v=None, normalized=True, alpha=1.0, b=0.0,...
#!/usr/bin/env python3 # 2017, Georg Sauthoff <mail@gms.tf>, GPLv3 import sys def skip_comments(lines): state = 0 for line in lines: n = len(line) l = '' p = 0 while p < n: if state == 0: a = line.find('//', p) b = line.find('/*', p) if a > -1 and (a ...
from .models import User from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse from django.views.generic import ( RedirectView, UpdateView, DetailView, CreateView, ListView, ) User = get_user_model() class UserDeta...
"""The moon component."""
import http from typing import Optional from fastapi import FastAPI, Path, Query app = FastAPI() @app.api_route("/api_route") def non_operation(): return {"message": "Hello World"} def non_decorated_route(): return {"message": "Hello World"} app.add_api_route("/non_decorated_route", non_decorated_route)...
import argparse import sys import os import subprocess from pathlib import Path import threading def main(): # Cd to scripts/build.py directory os.chdir(os.path.dirname(__file__)) # Initialize parser parser = argparse.ArgumentParser() # Adding optional arguments parser.add_argument("-r", ...
from project.album import Album class Band: def __init__(self, name): self.name = name self.albums = [] def add_album(self, album: Album): if album in self.albums: return f"Band {self.name} already has {album.name} in their library." self.albums.append(album) ...
import ipaddress import socket import os def execute_sysctl_command(params): print("-> sysctl "+params) os.system('sysctl ' + params) def ip_string_to_unsigned_int(ip): ip_ = 0 bytes_ = ip.split(".") if len(bytes_) == 4: ip_ = socket.htonl((int(bytes_[0]) << 24) + (int(bytes_[1]) << 16) +...
""" Created on 21 de mar de 2018 @author: clebson """ from hidrocomp.files.fileRead import FileRead class Nasa(FileRead): """ class files read: National Aeronautics and Space Administration - NASA """ source = "NASA" extension = "hdf5" def __init__(self, params): ...
import logging import os import sys import json import time import re UNCENSORED_LOGGING = os.getenv("UNCENSORED_LOGGING") LOG_CENSOR = [ { "regex": r"(eyJ0e[A-Za-z0-9-_]{10})[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*([A-Za-z0-9-_]{10})", "replace": "\\g<1>XXX<JWTTOKEN>XXX\\g<2>", "des...
import logging import platform from localstack import config from localstack.constants import TEST_AWS_ACCOUNT_ID from localstack.services.infra import do_run, log_startup_message, start_proxy_for_service from localstack.services.install import INSTALL_PATH_KMS_BINARY_PATTERN from localstack.utils.common import get_ar...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('networks', '0011_add_dns_servers_group'), ] operations = [ migrations.RemoveField( model_name='network', ...
import io import os import sys import subprocess from test import support import unittest import unittest.test from .test_result import BufferedWriter class Test_TestProgram(unittest.TestCase): def test_discovery_from_dotted_path(self): loader = unittest.TestLoader() tests = [self] expe...
__author__ = 'swhite'
# Copyright 2018 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright (C) 2021 Intel 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
from django.db import models from django.template import Library from ..models import MetaTag from ..utils import truncate_language_code_from_path, check_caching_enabled register = Library() @register.inclusion_tag('metatags/includes/metatags.html', takes_context=True) def include_metatags(context, model_instance=N...
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License");...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import configparser import getpass import itertools import os import re from abc import ABC, abstractmethod from dataclasses import dataclass from funct...
from django.db import models, connection from django.utils import timezone from django.utils.translation import gettext_lazy as _ class DataOceanManager(models.Manager): # exclude soft-deleted objects from queryset def get_queryset(self): return super().get_queryset().exclude(deleted_at__isnull=False)...
#!/usr/bin/python3 print("content-type: text/html") print() import cgi import subprocess F = cgi.FieldStorage() pod_name = F.getvalue("podname") img_name = F.getvalue("imgname") output = subprocess.getoutput("sudo kubectl run {0} --image={1}".format(pod_name,img_name)) print("<pre>"+ output +"</pre")
import argparse import os import json from pathlib import Path import pandas as pd def parse_args(): parser = argparse.ArgumentParser( prog="exercise 3", description="preprocess meta data") parser.add_argument('-f', '--file', type=str, required=True, help='meta data file path') return parse...
''' This file generates the graph of the Model that we are going to use for the order planner for neural summary generator The function returns the graph object and some of the important handles of the tensors of the graph in a dictionary. Note, that all the possible tensor handles can be obtained by the tf...
import requests from termcolor import cprint class trace: def __init__(self,url): self.url = url def checktrace(self): headers = { "User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50" } ...
# -*- coding: utf-8 -*- # # Modified by Peize Sun, Rufeng Zhang # Contact: {sunpeize, cxrfzhang}@foxmail.com # # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from detectron2.config import CfgNode as CN def add_sparsercnn_config(cfg): """ Add config for SparseRCNN. """ cfg.MODEL...
# vim: set encoding=utf-8 # # Copyright (c) 2015 Intel 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://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
from torchvision import datasets, transforms from eeg_ml.base import BaseDataLoader class MnistDataLoader(BaseDataLoader): """ MNIST data loading demo using BaseDataLoader """ def __init__(self, data_dir, batch_size, shuffle, validation_split, num_workers, training=True): trsfm = transforms.C...
import os from alttprbot.tournament.core import TournamentConfig from alttprbot_discord.bot import discordbot from .sglcore import SGLCoreTournamentRace class TWWR(SGLCoreTournamentRace): async def configuration(self): guild = discordbot.get_guild(590331405624410116) return TournamentConfig( ...
class ToolStripRenderEventArgs(EventArgs): """ Provides data for the System.Windows.Forms.ToolStripRenderer.OnRenderImageMargin(System.Windows.Forms.ToolStripRenderEventArgs),System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs),and System.Windows.Forms.ToolSt...
import sys import os import ode import logging import threading from time import sleep, time from genie_python.genie_startup import * import pv_server import render from configurations import config_zoom as config from collide import collide, CollisionDetector from geometry import GeometryBox from move import move_all...
import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.layers import Layer from tensorflow.keras.initializers import RandomUniform, Initializer, Constant import numpy as np class InitCentersRandom(Initializer): """ Initializer for initialization of centers of RBF network as...
import argparse import glob import os import os.path as osp import sys import warnings from multiprocessing import Pool import mmcv import numpy as np # custom import import pandas as pd import pdb def extract_frame(vid_item): """Generate optical flow using dense flow. Args: vid_item (list): Video ...
#!/usr/bin/env python # # 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...
"""MeiliSearchHelper Wrapper on top of the MeiliSearch API client""" import meilisearch from builtins import range def remove_bad_encoding(value): return value.replace('&#x27;', "'") def clean_one_field(value): if isinstance(value, bool): return str(value) elif isinstance(value, str): ret...
""" chromeをアプリモードで起動するためのコマンドを生成する """ import sys, os from moray.exception import SupportError name = 'chrome' def create_command(path, url, cmdline_args): """ 起動コマンド生成 Attributes: path (str): chromeコマンドのパス url (str): 接続先のURL cmdline_args (list<str>): コマンドライ...
from typing import List, Optional import aiohttp import json from aiohttp.client import ClientSession from itspylearning.consts import ITSLEARNING_URL from itspylearning.organisation import Organisation _clientSession: Optional[ClientSession] = None def _getClient() -> aiohttp.ClientSession: global _clientSessi...
import pytest import uuid from fastapi import status # # INVALID TESTS # @pytest.mark.parametrize( "key,value", [ ("description", 123), ("description", ""), ("uuid", None), ("uuid", 1), ("uuid", "abc"), ("uuid", ""), ("value", 123), ("value", ...
from Comparison import Comparison from Action import Action from TransitionCodegen import TransitionCodegen from TransitionGraphic import TransitionGraphic import xml.etree.ElementTree as ET class Transition: def __init__(self, id): self.id = id self.fromStateID = None s...
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else [] PROJECT_CATKIN_DEPENDS = "".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else [] PROJECT_NAME = "kinova_bringup" PROJECT_SPACE_DIR = "...
try: from .pfdo_med2image import pfdo_med2image except: from pfdo_med2image import pfdo_med2image
# CONFIG_MLH = ["//mina/config"] CONFIG_MLH = select({ "//:profile_debug": ["//src/config/debug"], "//:profile_dev": ["//src:dev"], "//:profile_release": ["//src:release"], }, no_match_error = "Unknown profile")
import pytest from PIL import Image from img2gb.gbtile import GBTile class Test_GBTile(object): @pytest.fixture def image(self): return Image.open("./test/assets/tileset.png") @pytest.mark.parametrize("x,result", [ (0, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"), (8, "FF...
# -*- coding: utf8 -*- u""" Mathics: a general-purpose computer algebra system Copyright (C) 2011-2013 The Mathics Team 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 ver...
from __future__ import absolute_import from .base_transformer import Transformer # noqa from .fireeye_hx_transformer import FireEyeHXTransformer # noqa from .generic_transformer import GenericTransformer # noqa from .sysmon_transformer import SysmonTransformer # noqa from .evtx_transformer import WinEVTXTransforme...
import setuptools from version import __version__ with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="python2latex", version=__version__, author="Jean-Samuel Leboeuf", author_email="jean-samuel.leboeuf.1@ulaval.ca", description="A Python to LaTeX converter",...
from PIL import Image, ImageDraw, ImageFont import numpy as np from decimal import Decimal, ROUND_HALF_UP from math import radians, tan, cos, sin from os import path _round = lambda f, r=ROUND_HALF_UP: int(Decimal(str(f)).quantize(Decimal("0"), rounding=r)) rgb = lambda r, g, b: (r, g, b) upper_font_path = p...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Idiota object types tree - A tree (directory listing) object that represents the directory structure in a tree object. commit(ref) - A object that represents the changes in a single commit. blob - A blob object that represents a file or a piece of...
#===----------------------------------------------------------------------===## # # 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 # #===----------------------------------...
# -*- coding: utf-8 -*- # Scrapy settings for innerwest 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/t...
execfile('<%= @tmp_dir %>/common.py') # weblogic node params WLHOME = '<%= @weblogic_home_dir %>' JAVA_HOME = '<%= @java_home_dir %>' WEBLOGIC_VERSION = '<%= @version %>' # domain params DOMAIN_PATH = '<%= @domain_dir %>' DOMAIN = '<%= @domain_name %>' APP_PATH = '<%= @app_d...
# SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of sourc...
class RNNConfig(object): """ Holds logistic regression model hyperparams. :param height: image height :type heights: int :param width: image width :type width: int :param channels: image channels :type channels: int :param batch_size: batch size for training :type batch_size: in...
if __name__ == '__main__': n = int(input().strip()) if n % 2 != 0: print("Weird") elif 2 <= n <= 5: print("Not Weird") elif 6 <= n <= 20: print("Weird") else: print("Not Weird")
import hashlib import json import sys from logbook import Logger, StreamHandler from pycoin.coins.bitcoin.networks import BitcoinMainnet import pycoin.ui.key_from_text import pycoin.key import socket script_for_address = BitcoinMainnet.ui.script_for_address log = Logger(__name__) class Connection: def __init_...
from django.urls import path from .views import MyObtainTokenPairView, RegisterView from rest_framework_simplejwt.views import TokenRefreshView urlpatterns = [ path('login/', MyObtainTokenPairView.as_view(), name='token_obtain_pair'), path('login/refresh/', TokenRefreshView.as_view(), name='token_refre...
# Copyright 2020 Microsoft 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
#!/usr/bin/python3 import sys from signal import pause import RPi.GPIO as GPIO # script to activate and deactivate an amplifier, power led, etc. using a GPIO # pin on power up / down # see for an example implementation with a PAM8403 digital amplifier # (PAM pin 12 connected to GPIO 26) # https://github.com/MiczFlor...
import os import time from click.testing import CliRunner from bin.throne import cli as throne runner = CliRunner() shodan_key = os.getenv('SHODAN_KEY') throne_user = os.getenv('THRONE_USER') throne_pass = os.getenv('THRONE_PASS') def test_throne_setapi(): print("Testing: throne api setapi") response = runne...
# 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, software # distributed unde...
# coding:utf-8 import json import random import string import tornado.web import config from lib.jsdict import JsDict from model.user import User # route class Route(object): urls = [] def __call__(self, url, name=None): def _(cls): self.urls.append(tornado.web.URLSpec(url, cls, name=nam...
# # 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...