text
stringlengths
2
999k
# Copyright 2009-2018 Noviat # Copyright 2021 Tecnativa - João Marques # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging from dateutil.relativedelta import relativedelta from odoo import _, api, fields, models from odoo.exceptions import UserError, ValidationError _logger = logging.getL...
import os from staidelta.plotters.bladebit import install_bladebit from staidelta.plotters.madmax import install_madmax def install_plotter(plotter, root_path): if plotter == "chiapos": print("StaiDeltapos already installed. No action taken.") return elif plotter == "madmax": if not os...
import ray from ray.rllib.evaluation.postprocessing import Postprocessing, \ compute_advantages from ray.rllib.policy.tf_policy_template import build_tf_policy from ray.rllib.policy.sample_batch import SampleBatch from ray.rllib.utils import try_import_tf tf = try_import_tf() def post_process_advantages(policy, ...
from tkinter import * window = Tk() window.geometry("234x275") Label(window, text = "Programa de Tradução DNA e RNA").pack() window.title("BIOLOGIA") def btn_click(item): global expression expression = expression + item input_text.set(expression) def btn_clear(): global expression express...
# -*- coding: utf-8 -*- """ Basic CLexer Test ~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import unittest import os from pygments.token import Text, Number from pygments.lexers import CLexer class CLexerTest(unitte...
# Databricks notebook source # MAGIC %md-sandbox # MAGIC # MAGIC <div style="text-align: center; line-height: 0; padding-top: 9px;"> # MAGIC <img src="https://databricks.com/wp-content/uploads/2018/03/db-academy-rgb-1200px.png" alt="Databricks Learning" style="width: 600px"> # MAGIC </div> # COMMAND ---------- # M...
import numpy as np #import numpy library #integers i = 10 #integer print(type(i)) #print out the data type of i a_i = np.zeros(i,dtype=int) #declare an array of ints print(type(a_i)) #will return ndarray print(type(a_i[0])) #will return int64 #floats x = 119.0 #floating point number print(typ...
class DatabaseModelColumnAbstract: def __init__(self) -> None: super().__init__()
#!/usr/bin/env python import sys (last_key, max_val) = (None, -sys.maxint) for line in sys.stdin: (key, val) = line.strip().split("\t") if last_key and last_key != key: print "%s\t%s" % (last_key, max_val) (last_key, max_val) = (key, int(val)) else: (last_key, max_val) = (key, max(max_val, int(val))...
# -*- coding: utf-8 -*- # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. ...
import tensorflow as tf def project_biases(tf_features, n_features): """ Projects the biases from the feature space to calculate bias per actor :param tf_features: :param n_features: :return: """ tf_feature_biases = tf.Variable(tf.zeros([n_features, 1])) # The reduce sum is to perform...
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
"""Package for building physics."""
################################################################################## #ContextNetX10: Exploring Context and Detail for Semantic Segmentation in Real-time #Paper-Link: https://arxiv.org/abs/1805.04554 ################################################################################## import torch import to...
################################################################# #VIOLENCE DETECTOR PROJECT MORE INFO AT violencedetector.org #Usage python3 violence_detector.py -i gun.jpg ################################################################# from keras.applications.mobilenet import MobileNet from keras.preprocessing imp...
# Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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 t...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
from sys import argv hash = {} def readtags(): for line in open('tags').readlines(): hash[line.split()[0]] = int(line.strip().split()[1]) if __name__ == '__main__': c = 1 readtags() if len(argv) != 3: print 'parseDepData.py input output' data = open(argv[1]).readlines() writer = open(argv[2],'w') for line ...
from itertools import takewhile import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.neighbors import NearestNeighbors from tqdm import tqdm from sc.scorers import ratio def find_centers(X, y): c = [] for label in range(y.max() + 1): c.append(X[y ...
# qubit number=4 # total number=14 import pyquil from pyquil.api import local_forest_runtime, QVMConnection from pyquil import Program, get_qc from pyquil.gates import * import numpy as np conn = QVMConnection() def make_circuit()-> Program: prog = Program() # circuit begin prog += H(0) # number=1 pr...
# coding=utf-8 # Copyright (c) 2016-2018, F5 Networks, 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 applicabl...
import math import sys import time import torch import torchvision.models.detection.mask_rcnn from coco_utils import get_coco_api_from_dataset from coco_eval import CocoEvaluator import utils def train_one_epoch(model, optimizer, data_loader, device, epoch, print_freq): model.train() metric_logger = utils.M...
import glob import subprocess import sys import os open_files = {} dry_run = False def get_file(folder, name): full_path = os.path.join(folder, 'results-%s.csv' % name) if full_path in open_files: return open_files[full_path] if dry_run: f = 1 else: f = open(full_path, 'a') open_files[full_path]...
#appModules/outlook.py #A part of NonVisual Desktop Access (NVDA) #Copyright (C) 2006-2014 NVDA Contributors <http://www.nvaccess.org/> #This file is covered by the GNU General Public License. #See the file COPYING for more details. from comtypes import COMError import comtypes.client from hwPortUtils import S...
from typing import Callable import pytest from eth_tester.exceptions import TransactionFailed from web3 import Web3 from web3.contract import Contract from raiden_contracts.constants import TEST_SETTLE_TIMEOUT_MAX, TEST_SETTLE_TIMEOUT_MIN from raiden_contracts.tests.utils import LOCKSROOT_OF_NO_LOCKS, call_and_transa...
"""Views for blog.""" from django.shortcuts import render def post_list(request): """Render post list on the webpage.""" return render(request, 'blog/post_list.html', {})
# inferred_model.py contains functions to visualize # timeseries, models for predicting them, and their comparison. # # Authors: # Charlie Brummitt <charles_brummitt@hms.harvard.edu>, Github: cbrummitt # Andres Gomez <Andres_Gomez@hks.harvard.edu> import itertools import matplotlib as mpl import matplotlib.pyplot as p...
import logging import os.path import re from contextlib import closing from typing import Dict, Iterable, List, Optional import psycopg2.errors import simplejson as json from psycopg2.extensions import connection as Connection # only for type annotation import etl.config import etl.db import etl.design.load import e...
# coding: utf-8 # Copyright (C) University of Southern California (http://usc.edu) # Author: Vladimir M. Zaytsev <zaytsev@usc.edu> # URL: <http://nlg.isi.edu/> # For more information, see README.md # For license information, see LICENSE import json import logging import microidx import traceback from microidx import...
print('Ola esse é nosso sistema, que ira te ajudar,na analise do seu perfil\nMas antes preciso de algumas informações') vc = float(input('Qual o valor, da casa que você, gostaria de financiar?')) m = int(input('Você quer pagar, em quantos anos?')) print('Para que o financiamento seja aprovado, você só pode comprometer ...
import gc import math from typing import List import numpy as np import torch import torch.nn import parser.load from lab.experiment.pytorch import Experiment from simple_model import SimpleLstmModel from parser import tokenizer # Configure the experiment EXPERIMENT = Experiment(name="simple_lstm_1000", ...
0xff <= 255
# tests/unit/__init__.py # A part of NonVisual Desktop Access (NVDA) # This file is covered by the GNU General Public License. # See the file COPYING for more details. # Copyright (C) 2017-2019 NV Access Limited, Babbage B.V. """NVDA unit testing. All unit tests should reside within this package and should be ...
import tensorflow as tf from model import Model import numpy as np IMAGE_SIZE = 28 def get_convolution_extractor_shape(filter_list): with tf.Graph().as_default(): """Model function for CNN.""" features = tf.placeholder( tf.float32, shape=[None, IMAGE_SIZE * IMAGE_SIZE], name='feature...
# Generated by Django 2.2.12 on 2020-05-19 09:30 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('experiment', '0004_auto_20200518_1524'), ] operations = [ migrations.CreateModel( name='TrialR...
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') if __name__ == '__main__': app.run()
import collections import sys import re from util import * send_gdb('checkpoint') expect_gdb('Checkpoint 1 at') send_gdb('n') send_gdb('restart 1') send_gdb('c') expect_rr('EXIT-SUCCESS') ok()
from model import magic from flask import Flask, request, Response import sqlite3 import json import threading from current_form import get_current_season import datetime app = Flask(__name__) database_path = 'Data/database.db' @app.route('/') def index(): response = Response({}) response.headers['Access-Con...
from ezCheck.workspace import EzCheck
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2008 Doug Hellmann All rights reserved. # """Compare two files. """ __version__ = "$Id$" #end_pymotw_header import filecmp print 'common_file:', print filecmp.cmp('example/dir1/common_file', 'example/dir2/common_file'), print filecmp.cmp('...
# Copyright 2018 Contributors to Hyperledger Sawtooth # # 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 ...
# coding: utf-8 """ Purity//FB REST Client Client for Purity//FB REST API (1.0 - 1.3), developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/). OpenAPI spec version: 1.3 Contact: info@purestorage.com ...
#!/usr/bin/env python3 import cbthelper as cbt from selenium import webdriver import sys, os def main(): # set username and auth key for api requests username = os.environ['CBT_USERNAME'] or '' authkey = os.environ['CBT_AUTHKEY'] or '' if username == '' or authkey == '': print("Don't forget to ...
class Solution: def findCheapestPrice(self, n: int, flights: List[List[int]], src: int, dst: int, K: int) -> int: graph = collections.defaultdict(dict) for a, b, w in flights: graph[a][b] = w pq = [(0, K + 1, src)] # cost, stops, cur while pq: cost, stops, cur...
import wx import wx.grid as gridlib import my as my class registerTable(my.myTable): def __init__(self, parent, data): my.myTable.__init__(self, parent, data) self.labels = ('Name', 'DisplayName', 'Description', 'Offset', 'Size', 'Access', 'ResetValue') def GetRowLabelValue(self, row): ...
from __future__ import print_function from constant import * from models import * from dataset import * from utils import f_score import os import sys import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from sklearn.metrics import f1_score,precision_score,re...
# engine/default.py # Copyright (C) 2005-2019 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 """Default implementations of per-dialect sqlalchemy.engine classes. These are se...
""" Copyright 2013 Steven Diamond, Eric Chu This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is dis...
""" Distribution of PM2.5 at Various Sites across Delhi =================================================== _thumb: .2, .6 """ import matplotlib.pyplot as plt import seaborn as sns import openaq sns.set(style="ticks", font_scale=1.) api = openaq.OpenAQ() # grab the data res = api.measurements(city='Delhi', parameter...
import numpy from numba import jit def advect_dynamic_grid(lmda, s, u, v, dt, dx, dy, nx, ny): """ Subroutine to advect dynamic x-y grid """ pfl = lmda >= 0.0 advect_weno3(s, pfl, u, v, dt, dx, dy, nx, ny) return def advect_solid(s, u, v, dt, dx, dy, nx, ny): """ Subroutine to adv...
from urlparse import urlparse from django import forms from tower import ugettext_lazy as _lazy import amo from addons.models import Addon from mkt.api.forms import SluggableModelChoiceField class ReceiptForm(forms.Form): app = SluggableModelChoiceField( queryset=Addon.objects.filter(type=amo.ADDON_WE...
from dateutil.relativedelta import relativedelta from corehq.apps.userreports.models import StaticDataSourceConfiguration, get_datasource_config from corehq.apps.userreports.util import get_table_name from custom.icds_reports.const import AGG_CCS_RECORD_BP_TABLE from custom.icds_reports.utils.aggregation_helpers import...
import os import os.path import tempfile import unittest import unittest.mock import datetime import shutil from cate.core.ds import DATA_STORE_REGISTRY, DataAccessError from cate.core.types import PolygonLike, TimeRangeLike, VarNamesLike from cate.ds.local import LocalDataStore, LocalDataSource from cate.ds.esa_cci_od...
from typing import Dict import torch.nn.parallel from allennlp.data.vocabulary import Vocabulary from allennlp.models.model import Model from allennlp.modules import Seq2SeqEncoder, InputVariationalDropout, TimeDistributed from allennlp.training.metrics import CategoricalAccuracy from allennlp.modules.matrix_attention...
import platform from collections import UserString import attr import functools import re from typing import MutableSequence, Tuple, List, Union from ics.types import ContainerItem, ExtraParams, RuntimeAttrValidation, copy_extra_params from ics.utils import limit_str_length, validate_truthy allow_frozen_exceptions =...
import matplotlib.pyplot as plt __author__ = 'minjoon' def draw_pr(triple_dict): """ {threshold: [ref, ret, mat]} :param triple_dict: :return: """ ts = sorted(triple_dict.keys()) ps = [float(triple_dict[th][2])/max(1,triple_dict[th][1]) for th in ts] rs = [float(triple_dict[th][2])/ma...
# -*- coding: utf-8 -*- #pylint: disable-msg=E0611, E1101, C0103, R0901, R0902, R0903, R0904, W0232 #------------------------------------------------------------------------------ # Copyright (c) 2007-2021, Acoular Development Team. #------------------------------------------------------------------------------ """Impl...
class Test(): def __init__(self, name): self.name = name def decorator(method): def wrapper(self, *args, **kwargs): print(self.name) method(self, *args, **kwargs) return wrapper @decorator def method1(self): print("Instance name: {0}".format(se...
#!/usr/bin/env python3 # Copyright (c) 2014-2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class ...
""" A maxout neural network. """ from typing import Sequence, Union import torch from allennlp.common.checks import ConfigurationError from allennlp.common.registrable import FromParams class Maxout(torch.nn.Module, FromParams): """ This `Module` is a maxout neural network. # Parameters input_dim ...
# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or th...
# test file in test dir in a package def test_foo(): pass
# Overview # -------- # # The FX2 has four FIFOs, but only one at a time may be selected to be read (for OUT FIFOs) or # written (for IN FIFOs). To achieve high transfer rates when more than one stream of data is used # (bidirectional channel, two one-directional channels, and so on), the FPGA has its own FIFOs that # ...
import utils import consts from tqdm import tqdm from pathlib import Path from multiprocessing import Pool class Preprocessor: def __init__( self, path_corpus, num_cores=8, use_cache=True): self.use_cache = use_cache self.num_cores = num_cores ...
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import glob import hashlib import json import os import random import shutil import time from itertools import repeat from multiprocessing.pool import Pool, ThreadPool from pathlib import Path from threading import Thread from zipfile im...
import jittor as jt import numpy as np from zhusuan.distributions.base import Distribution class Normal(Distribution): """ The class of univariate Normal distribution. See :class:`~zhusuan.distributions.base.Distribution` for details. :param mean: A `float` Var. The mean of the Normal distribution. ...
def reverse(s): if len(s) <= 1: return s return s[-1]+reverse(s[:-1]) def isPalindrome(s): 'return True iff s is a palindrome' "your code here" return reverse(s) == s print(reverse("hallo")) print(isPalindrome("rentner"))
from sanic_jwt import exceptions from app import db_objects, links from app.database_models.model import Operation, OperatorOperation from app.database_models.model import operator_query, operation_query, operatoroperation_query, apitokens_query import datetime import json from sanic_jwt import Authentication, Configur...
import datetime import json import os import os.path as osp import pickle import random import sys import time from collections import namedtuple import __main__ as main import dateutil.tz import numpy as np from rlkit.core import logger from rlkit.launchers import conf from rlkit.torch.pytorch_util import set_gpu_mo...
# Copyright 2014 OpenStack Foundation # # 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 ...
# coding:utf8 """English dictionary""" en = { "LANGUAGE": "English", # Client notifications "config-cleared-notification": "Settings cleared. Changes will be saved when you store a valid configuration.", "relative-config-notification": "Loaded relative configuration file(s): {}", "connection-at...
""" Copyright 2021 - Present Okta, 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 law or agreed to in writing, softwa...
r""" Modules """ #***************************************************************************** # Copyright (C) 2005 David Kohel <kohel@maths.usyd.edu> # William Stein <wstein@math.ucsd.edu> # 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr> # ...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: collector.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports)...
SHOW_FRAMES = True SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 #IMAGE PROCESSING IMAGE_HEIGHT = 64 IMAGE_WIDTH = 256 IMAGE_CHANNELS = 3 TRAINING_DIRECTORY = 'C:\\Users\\Adam\\Documents\\NN\\AITruckingProject\\Data'
#!/usr/bin/env python # # Copyright 2011-2013 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice...
# coding=utf-8 from itertools import combinations import numpy as np class SKU: def __init__(self, name, gravity, deviation): self.name = name self.gravity = gravity self.deviation = deviation def __repr__(self): return "<SKU name:%s gravity:%d deviation:%d>" % (self.name, se...
from os.path import abspath, dirname from unittest.case import TestCase from unittest.mock import call, Mock from monitor.monitor import Monitor class MonitorTest(TestCase): def setUp(self) -> None: self._monitor = Monitor("ws://test.com", "eth9", "user", "pass", True) self._monitor._update_outpu...
import AirQualityIndex import Gmail import json if __name__ == "__main__": old_aqi = open('./last_category.txt', 'r').read() with open('./config.json') as config: # load config config = json.load(config) # create AirQualityIndex and Gmail instances AQI = AirQualityIndex.AirQual...
from __future__ import absolute_import import sys from pip._internal.cache import WheelCache from pip._internal.cli import cmdoptions from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import SUCCESS from pip._internal.models.format_control import FormatControl from pip._internal.o...
# -*- coding: utf-8 -*- """ Created on Sun Apr 22 17:13:28 2018 """ from statsmodels.tsa.stattools import adfuller import pandas as pd from scipy import stats def diff_nonstationary(x, alpha): """Returns number of differentiations required to transform a non-stationary time series into a stationary one. ...
# Copyright (c) 2020 the original author or authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
from enum import Enum from graphql import GraphQLResolveInfo import frappe from frappe.core.doctype.user.user import update_password class ResetPasswordWithKeyErrorCodes(Enum): INVALID_KEY = "INVALID_KEY" WEAK_PASSWORD = "WEAK_PASSWORD" def reset_pwd_with_key_resolver(obj, info: GraphQLResolveInfo, **kwarg...
import argparse import math import numpy as np import os import re import time import yaml # For physical simulation #import pybullet as p # For projection into nonpenetration # (pre-processing for simulation) #import pydrake #from pydrake.solvers import ik # Eventually, for visualization, # though not used yet. #fr...
# coding=utf-8 # Copyright 2020 The Facebook AI Research Team Authors and The HuggingFace Inc. team. # # 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/LIC...
#------------------Bombermans Team------------------------------------------# # Author : B3mB4m # Concat : b3mb4m@protonmail.com # Project : https://github.com/b3mb4m/shellsploit-library # LICENSE : https://github.com/b3mb4m/shellsploit-library/blob/master/LICENSE #---------------------------------------------------...
""" aggregation.py contains utility functions to handle multiple named and lambda kwarg aggregations in groupby and DataFrame/Series aggregation """ from collections import defaultdict from functools import partial from typing import Any, DefaultDict, List, Sequence, Tuple from pandas.core.dtypes.common import is_dic...
from devpi_tools.devpi_request import DevpiClient import json def mock_get_json_index(self, path, method='GET', **params): return { "root": { "indexes": { "pypi": { "type": "mirror", "volatile": False, "title": "PyPI", "mirror_u...
# Copyright (c) 2011 Jeff Garzik # # Previous copyright, from python-jsonrpc/jsonrpc/proxy.py: # # Copyright (c) 2007 Jan-Klaas Kollhof # # This file is part of jsonrpc. # # jsonrpc is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # th...
# Copyright 2018 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...
""" Support for status output of APCUPSd via its Network Information Server (NIS). For more details about this component, please refer to the documentation at https://home-assistant.io/components/apcupsd/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.const import (CONF...
import unittest from models.office import Office from models.room import Room class TestOffice(unittest.TestCase): """Test cases for the Office class""" def setUp(self): """Setup a new Office object to be used for testing""" self.office = Office('purple') def test_room_type(self): ...
# -*- coding: utf-8 -*- import dotenv import flask import os import redis dotenv.load_dotenv(dotenv.find_dotenv()) def create_app(): app = flask.Flask(__name__) r = redis.Redis(decode_responses=True) channel = os.environ.get('TWITCH_CHANNEL') def parse_messages(): stats = r.zrevrange(chann...
import _lib # Digital Ocean API token (to create temporary block storage / server) token = '' # Digital Ocean SSH Key ID (will be used to connect to temporary backing up server) sshkeyid = '' # your web sites root folder path (with the folders named: my.domain.com) sitepath = '/srv' sites = _lib.list_dirs(sitepath) #...
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") _GOMETALINTER_TARBALLS = { "darwin_amd64": ( "gometalinter-2.0.10-darwin-amd64.tar.gz", "gometalinter-2.0.10-darwin-amd64", "b21c28a236f05d1cd1a394240388afdc3a20a2ddfeb34acb19c651d5d1936523" ), "linux_amd64": ( ...
#========================================================================== # # Copyright Insight Software 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 # # ...
### import Tix as tk from pprint import pprint r= tk.Tk() r.title("test") l=tk.Label(r, name="a_label") l.pack() class MyGrid(tk.Grid): def __init__(self, *args, **kwargs): kwargs['editnotify']= self.editnotify tk.Grid.__init__(self, *args, **kwargs) def editnotify(self, x, y): return...
#Chess king moves horizontally, vertically or diagonally to any adjacent cell. Given two different cells of the chessboard, # determine whether a king can go from the first cell to the second in one move. r = int(input("Row, r =?")) if ( (r > 8) or (r <1)): print("Invalid entry!!") c = int(input("Column, c = ?"))...
#!/usr/bin/env python u""" MPI_DEM_ICESat2_ATL11.py Written by Tyler Sutterley (10/2021) Determines which digital elevation model tiles to read for a given ATL11 file Reads 3x3 array of tiles for points within bounding box of central mosaic tile Interpolates digital elevation model to locations of ICESat-2 ATL11 segmen...
#!/usr/bin/env python # $Id$ """many solutions""" import puzzler from puzzler.puzzles.heptiamonds import HeptiamondsTrefoil4 as puzzle puzzler.run(puzzle)