text
stringlengths
1
927k
""" This module consists of functions to calculate the [equivalent latitude](https://journals.ametsoc.org/doi/citedby/10.1175/1520-0469%282003%29060%3C0287%3ATELADT%3E2.0.CO%3B2) and edge of a polar vortex using [Nash criteria](https://agupubs.onlinelibrary.wiley.com/doi/10.1029/96JD00066). ### Installation ``` pip ...
from __future__ import absolute_import import logging logger = logging.getLogger(__name__) import sys import os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) from topology.graph.graph import Graph from topology.graph.graph import Node from clint.textui import colored import json im...
""" #Trains a ResNet on the CIFAR10 dataset. """ from __future__ import print_function import keras from keras.layers import Dense, Conv2D, BatchNormalization, Activation from keras.layers import AveragePooling2D, Input, Flatten from keras.optimizers import Adam from keras.callbacks import ModelCheckpoint, LearningRa...
import json import re import time import typing import warnings import inspect import numpy as np import zmq from weakref import WeakSet import threading import copy import sys from threading import Lock class DataSocket: """ Wrapper for ZMQ socket that sends and recieves dictionaries Includes ZMQ client,...
import streamlit as st import pandas as pd import seaborn as sns import pylab as plt import datetime as dt #import geopandas as gpd df = pd.read_csv('/Users/nicholasjones/Desktop/code/wbg-location-data/notebooks/nick/df_india_may9.csv') df.ds = pd.to_datetime(df.ds) df = df.set_index('ds') df['datetime'] = df.index.co...
# 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 from ... import _utilities, _tables __a...
# Generated by Django 3.0.5 on 2020-04-03 20:19 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('project_first_app', '0001_initial'), ] operations = [ migrations.AddField( model_name='person', name='vehicles', ...
def avg_array(arrs): x=[] for i in zip(*arrs): x.append(sum(i)/len(arrs)) return x
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.23 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
import unittest from unittest.mock import MagicMock from chocolate.space import * from chocolate.base import SearchAlgorithm class TestSearchAlgorithm(unittest.TestCase): def setUp(self): self.mock_conn = MagicMock(name="connection") def test_space_none_none(self): self.mock_conn.get_space.r...
from project.deliveries.product import Product class Food(Product): food_quantity: int = 15 def __init__(self, name: str): super().__init__(name, self.food_quantity)
#!/usr/bin/env python # Copyright (c) 2013-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. from __future__ import division,print_function,unicode_literals import biplist from ds_store import DSStore...
""" Test for markdown2man launcher.""" import gzip import os import sys import tempfile import test_common.fs.ops as test_ops from test_common.fs.temp import temp_dir # TODO: Refactor project layout to leave tests folder out of src. sys.path.append("src") import src.markdown2man as markdown2man def test_launcher_a...
__author__ = 'Alex' import re def main(line): sub = re.sub(r"(\t)", r" ", line) return sub
""" Set up all the endpoints for the web service. """ import fastapi from . import financing_statement, healthcheck, search router = fastapi.APIRouter() router.include_router(healthcheck.router, prefix='/operations', tags=['Operations']) router.include_router(financing_statement.router, tags=['Financing Statement'...
# MIT License # # Copyright (c) 2021 Soohwan Kim and Sangchun Ha and Soyoung Cho # # 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...
#!/usr/bin/env python # coding: utf-8 # #### Show the common numbers for $x^2=y^3$ # # [Link](https://www.quora.com/Is-64-the-first-perfect-square-and-a-perfect-cube-Is-it-the-only-one/answer/Alon-Amit?ch=3&share=e27e1c03&srid=iBLa) to Quora (Alon Amit's answer) # # # # In[1]: import numpy import sympy import p...
from __future__ import absolute_import import pprint def pp(stuff): pretty_printer = pprint.PrettyPrinter(indent=3) pretty_printer.pprint(stuff)
#!/usr/bin/python3 """ Responsible for ingesting data related to the business performance over time. Data is placed into the asx_company_financial_metric collection, ready for the core viewer app to use. Stocks whose financial details have been retrieved in the past month are skipped. """ import pymongo import argparse...
import re from django.core.validators import MinValueValidator from django.utils.translation import gettext_lazy as _ from rest_framework import exceptions as rf_exceptions from rest_framework import serializers as rf_serializers from waldur_core.core import serializers as core_serializers from waldur_core.structure ...
import socket from logging import getLogger from .abs import AddressProviderAbs, AddressProviderException logger = getLogger(__name__) class AddressProviderHostName(AddressProviderAbs): @property def name(self): return "hostname" def _detect_ip_address(self) -> None: try: da...
"""Diagnostics support for HomeKit.""" from __future__ import annotations from typing import Any from pyhap.accessory_driver import AccessoryDriver from pyhap.state import State from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from . import HomeKit from .const import...
import os import gym from optical_rl_gym.envs.rmsa_env import shortest_path_first_fit, shortest_available_path_first_fit, \ least_loaded_path_first_fit, SimpleMatrixObservation from optical_rl_gym.utils import evaluate_heuristic, random_policy import pickle import logging import numpy as np import matplotlib.pypl...
try: Hours=input('Enter Hours:') Rates=input('Enter Rates:') if int(Hours)>40: pay=40*int(Rates)+(int(Hours)-40)*(int(Rates)*1.5) print(pay) else: pay=int(Hours)*int(Rates) print(pay) except: print('Error,Please enter numeric input.')
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-12-31 03:27 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] # ('markets', '0012_aut...
from WhatsAppManifest import ADB, Automator # Note: We need the AdbServer class (even without using SSH) so that Automator can open the internal connection. with ADB(use_ssh=False) as AdbServer: automator = Automator(adb_server=AdbServer, adb_host="127.0.0.1", adb_port=5037) for device in automator.list_...
from __future__ import division, print_function, absolute_import import numpy as np from scipy.misc import factorial from scipy.lib.six.moves import xrange __all__ = ["KroghInterpolator", "krogh_interpolate", "BarycentricInterpolator", "barycentric_interpolate", "PiecewisePolynomial", "piecewise_polynomial_interpola...
class Solution: def validPalindrome(self, s: str) -> bool: left, right = self.twopointer(0, len(s) - 1, s) if left >= right : return True return self.valid(left + 1, right, s) or self.valid(left, right - 1, s) def valid(self, left, right, s) : l, r = self.twopoin...
# 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...
# Download the Python helper library from twilio.com/docs/python/install import os from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] auth_token = os.environ['TWILIO_...
import sys import os sys.path.append("../img2vec_pytorch") # Adds higher directory to python modules path. from img_to_vec import Img2Vec from PIL import Image from sklearn.metrics.pairwise import cosine_similarity input_path = './test_images' print("Getting vectors for test images...\n") img2vec = Img2Vec() # For...
import os import shutil from shutil import Error import unittest import numpy as np import tensorflow as tf from cdes_for_testing import all_cdes from cfl.dataset import Dataset ''' The following code runs all tests in CondExpInputTests on all implemented CondExpXxxx classes. ''' def make_cde_io_tests(cond_ex...
# -*- 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.async_support.base.exchange import Exchange import hashlib from ccxt.base.errors import ExchangeError from ccxt.base.errors impor...
def place_3_balls(): put_ball() put_ball() put_ball() def move_twice(): move() move() move() place_3_balls() move_twice() place_3_balls() move_twice() place_3_balls() move()
from pydantic import BaseModel class A(BaseModel): abc: str class B(A): abc: str class C(A): abc: str # expected A(abc='cde') B(abc='cde') C(ab<caret>c='cde') ## count: 1
class Solution: def plusOne(self, digits: List[int]) -> List[int]: cnt = len(digits) if digits[cnt-1] != 9: digits[cnt-1] = digits[cnt-1] + 1 return digits else: for i in range(0, len(digits)): digits[i] = str(digits[i]) intd...
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/liudiyang1998/Git/ROS-Robotics-By-Example/Chapter_7_code/src/hector_quadrotor/hector_quadrotor_controller_gazebo/include".split(';') if "/home/liudiyang1998/Git/ROS-Robotics-By-Example/Chapter_7_...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_persistentkv ---------------------------------- Tests for `persistentkv` module. """ try: import unittest2 as unittest except ImportError: import unittest import os import common from wikipediabase import persistentkv as pkv DATABASE = "/tmp/remove-me....
import argparse import re import sys from collections import Counter sys.path.append("..") from ml_humor_recogniser import read_data from screenplay import Line def run(data, output): screenplays = read_data(data) txt = screenplays_to_txt(screenplays) word_counts = get_word_counts(txt) word_probabil...
from _tkinter import * root = tkinter.Tk() root.mainloop()
# built-in from argparse import ArgumentParser from types import MappingProxyType from typing import Callable, Mapping, Sequence # app from ._lint import lint_command from ._memtest import memtest_command from ._stub import stub_command from ._test import test_command CommandsType = Mapping[str, Callable[[Sequence[s...
#!/usr/bin/env python # # Copyright (C) 2009-2020 the sqlparse authors and contributors # <see AUTHORS file> # # This example is part of python-sqlparse and is released under # the BSD License: https://opensource.org/licenses/BSD-3-Clause # # This example illustrates how to extract table names from nested # SELECT stat...
from cassandra.cluster import Cluster class CassandraMgr: """ Manage orerations with Apache Cassandra. """ def __init__(self, config): """ Constructor. :param config: configuration of the cluster of Apache Cassandra -> ip, replicator factor, replication class and key s...
# Generated by Django 3.1.3 on 2020-11-09 10:42 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
# 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 u...
/home/runner/.cache/pip/pool/70/91/d2/f5d75cdb5bed21a1004b1a4f5dbe1978b2a45ab6bedfa5d6b5bbb225e8
import os import sys from flask import Flask from flask.ext.dropbox import Dropbox from flask.ext.lazyviews import LazyViews from flask.ext.script import Manager import settings # Initialize and configure Flask app app = Flask(__name__) app.config.from_object(settings) # Setup Dropbox and script extensions dropbox...
#!python import string # Hint: Use these string constants to encode/decode hexadecimal digits and more # string.digits is '0123456789' # string.hexdigits is '0123456789abcdefABCDEF' # string.ascii_lowercase is 'abcdefghijklmnopqrstuvwxyz' # string.ascii_uppercase is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' # string.ascii_letters ...
""" Script for evaluating trained model on Keras (validate/test). """ import argparse import time import logging import keras from common.logger_utils import initialize_logging from keras_.utils import prepare_ke_context, prepare_model, get_data_rec, get_data_generator, backend_agnostic_compile def parse_args():...
from flask import render_template,redirect,url_for,flash,request from . import auth from flask_login import login_user,logout_user,login_required from ..models import User from .forms import LoginForm,RegistrationForm from .. import db from ..email import mail_message @auth.route('/login',methods=['GET','POST']) def...
# Copyright (c) 2021, jan and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class LinkedSuppliers(Document): pass
import board import busio import adafruit_bd3491fs i2c = busio.I2C(board.SCL, board.SDA) bd3491fs = adafruit_bd3491fs.BD3491FS(i2c) bd3491fs.active_input = adafruit_bd3491fs.Input.A bd3491fs.input_gain = adafruit_bd3491fs.Level.LEVEL_20DB bd3491fs.channel_1_attenuation = 0 bd3491fs.channel_2_attenuation = 0
# -*- coding: utf-8 -*- import logging from math import floor from PyQt5.QtCore import ( QPointF, QRectF, Qt ) from PyQt5.QtGui import ( QPainterPath, QKeyEvent, QMouseEvent ) from PyQt5.QtWidgets import ( QGraphicsItem, QGraphicsItemGroup, QGraphicsPathItem, QGraphicsSceneMouse...
from pathlib import Path import tempfile import os import subprocess from collections import defaultdict from multiprocessing import Pool from os.path import join, abspath, isfile from typing import Union, List, Dict from logzero import logger as logging import yaml from lama import common from lama.common import cfg...
# 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 u...
# -*- coding: utf-8 -*- # Copyright 2020 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...
from typing import Any import sys import time import os import tempfile class Logger2(): def __init__(self, file1: Any, file2: Any): self.file1 = file1 self.file2 = file2 def write(self, data: str) -> None: self.file1.write(data) self.file2.write(data) def flush(self) -> ...
""" Django settings for profiles_project 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/ """ impor...
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # AlliedTelesis.AT8100.get_version # --------------------------------------------------------------------- # Copyright (C) 2007-2018 The NOC Project # See LICENSE for details # -----------------------------------------------...
""" The :mod:`imblearn.pipeline` module implements utilities to build a composite estimator, as a chain of transforms, samples and estimators. """ # Adapted from scikit-learn # Author: Edouard Duchesnay # Gael Varoquaux # Virgile Fritsch # Alexandre Gramfort # Lars Buitinck # C...
import unittest from net.wyun.mer.basicfunction import BasicFunction class TestBasicFunction(unittest.TestCase): def setUp(self): self.func = BasicFunction() def test_1(self): self.assertTrue(True) def test_2(self): self.assertTrue(True) def test_3(self): self.ass...
# -*- coding: utf-8 -*- # # Copyright 2014 Google 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 requir...
"""Author: Brandon Trabucco, Copyright 2019, MIT License""" from playground.algorithms.algorithm import Algorithm import tensorflow as tf class DDPG(Algorithm): def __init__( self, policy, target_policy, qf, target_qf, replay_buffer, ...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v0/proto/resources/gender_view.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from...
from .pun import pun_threshold from .kapur import kapur_threshold, kapur_multithreshold from .johannsen import johannsen_threshold
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.backend.jvm.rules.targets import COMMON_JVM_FIELDS from pants.engine.target import Sources, StringField, Target class JaxbJavaPackage(StringField): """Java package (com.co...
# -*- coding: utf-8 -*- import os import numpy as np import matplotlib as m import matplotlib.pyplot as plt from scipy.fftpack import * from plot_spectr import * def main_routine(): print(os.getcwd()) nfile = './store.dat' #Read the file by blocks to reduce required memory with open(nfile,'r') as f: nel =...
from .entrypoints import nvidia_tacotron2, nvidia_tts_utils
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v4/proto/enums/change_status_resource_type.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.prot...
# -*- coding: utf-8 -*- import pathlib import time from asyncy.Stories import MAX_BYTES_LOGGING, Stories from asyncy.utils import Dict, Resolver from pytest import mark def test_stories_init(app, logger, story): assert story.entrypoint == app.stories['hello.story']['entrypoint'] assert story.app == app ...
# -*- coding: utf-8 -*- """ UNET LOwered Model : This customized UNet Model has been generated lowering the filters to their 25% . """ import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.layers import Input , Conv2D , MaxPooling2D , Dropout , co...
# Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the "License"); you may not u...
from __future__ import absolute_import import os import sys from django.core.management.base import BaseCommand import celery import djcelery DB_SHARED_THREAD = """\ DatabaseWrapper objects created in a thread can only \ be used in that same thread. The object with alias '%s' \ was created in thread id %s and this...
from tkinter import * from tkinter import messagebox import tkinter as tk from tkinter import ttk #IMAGENS DEFEITO: 240X240 class Tela: def fechar(self, event): janela.destroy() exit() def fecharPc(self, event): self.lb_simulador.place_forget() self.imgFundo....
class VectorException(Exception): """Base exception for Vector operations""" pass class WaitTimeoutError(VectorException): """The timeout period for a wait operation has been exceeded""" pass class FailedJobError(VectorException): """Used to indicate that an asynchronous job has failed""" ...
# -*- coding: utf-8 -*- """ Created on Mon Jul 9 14:56:07 2018 f(n) = n * f(n-1) and if a is a string variable a = "hello" b = a b = b+" world" print(b): hello world print(a): hello so "=" equal "copy" and creat a new date @author: lele """ a = "1234" #def permutation(a,size,n): # if n == 1: # print(new_...
# # Copyright (c) 2021 Airbyte, Inc., all rights reserved. # import json from datetime import datetime from typing import Dict, Generator import smartsheet from airbyte_cdk import AirbyteLogger from airbyte_cdk.models import ( AirbyteCatalog, AirbyteConnectionStatus, AirbyteMessage, AirbyteRecordMess...
import urllib.request import json import sys import os # specify the url format for downloading the json data url_format = 'https://data.gov.in/node/{0}/datastore/export/json' years = [2011, 2009, 2006, 2004, 2002] # default data for constructing the urls for each States and union teritories json_string = json.dumps(...
import datetime from os import stat class GromosFactory: """Class to build the string needed to create a Gromos input file (*.imd), a make_script fiel (*.arg) and a job file (*.job)""" def __init__(self, configuration: dict, structure: str) -> None: self.configuration = configuration self.str...
""" ASGI config for borsa 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.setdefault('DJANGO_SETTING...
''' Tests the WindowDiff evaluation metric. .. moduleauthor:: Chris Fournier <chris.m.fournier@gmail.com> ''' #=============================================================================== # Copyright (c) 2011-2012, Chris Fournier # All rights reserved. # # Redistribution and use in source and binary forms, with or...
# Copyright The PyTorch Lightning 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/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
import gym import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import copy from torch.utils.tensorboard import SummaryWriter from torch.distributions import Normal class Actor(nn.Module): def __init__(self, state_dim, action_dim, hidden_width, max_action): super(Actor, se...
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this f...
"""This module exists as a place to centralize functionality and configuration related to privacy. """ import hashlib import logging class RedactingFormatter(object): """ Credits - this formatter was heavily inspired by https://relaxdiego.com/2014/07/logging-in-python.html """ @classmethod def i...
import simple class Simple2: def __init__(self): self.info = "SimpleClass2" class Simple3(simple.Simple): def __init__(self): simple.Simple.__init__(self) text = "text in simple" assert simple.text == text _s = simple.Simple() _s3 = Simple3() assert _s.info == _s3.info import recursive_i...
from django.conf.urls import include, patterns, url from tastypie.api import Api import mozillians.groups.api import mozillians.users.api v1_api = Api(api_name='v1') v1_api.register(mozillians.users.api.UserResource()) v1_api.register(mozillians.groups.api.GroupResource()) v1_api.register(mozillians.groups.api.Skil...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import networkx as nx from typing import Any, Dict, List, Optional, Tuple from graspologic.layouts.classes import NodePosition import matplotlib.pyplot as plt def _calculate_x_y_domain( positions: List[NodePosition], ) -> Tuple[Tuple[float,...
import subprocess import os import shutil def split(audio,output): command = f"ffmpeg -i '{audio}' -f segment -segment_time 0.0416666666666667 -c copy {output}" subprocess.call(command,shell=True) split('audio.wav','out%03d.wav') elements = os.listdir('./') if(os.path.isdir("./audioChunks/")): shutil.rmtree...
x = int(input()) if x % 2 == 0: y = x + 1 print(y) y = y + 2 print(y) y = y + 2 print(y) y = y + 2 print(y) else: y = x print(y) y = y + 2 print(y) y = y + 2 print(y) y = y + 2 print(y)
"""Base Github use case.""" from __future__ import annotations import traceback from typing import Any import git_portfolio.config_manager as cm import git_portfolio.github_service as gs import git_portfolio.responses as res class GhUseCase: """Github use case.""" def __init__( self, config...
# # Copyright 2013 Apache Software 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 or agree...
from sys import exit def gold_room(): print("This room is full of gold. How much do you take?") choice=input("> ") if "0" in choice or "1" in choice: how_much=int(choice) else: dead("Man,learn to type a number.") if how_much < 50: print("Nice,you're not greedy,you win!")...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' API_KEY = '87c7712a9b72646a269102230858837b' place = 'Магнитогорск' # pip install pyowm import pyowm owm = pyowm.OWM(API_KEY) observation = owm.weather_at_place(place) w = observation.get_weather() temperature = w.get_temperature('celsius')['tem...
# SimpleCache Tests # ~~~~~~~~~~~~~~~~~~~ from datetime import timedelta from rediscache import SimpleCache, RedisConnect, cache_it, cache_it_json, CacheMissException, ExpiredKeyException, \ DoNotCache from unittest import TestCase, main import time class ComplexNumber(object): # used in pickle test def __in...
# Natural Language Toolkit: Language Model Unit Tests # # Copyright (C) 2001-2020 NLTK Project # Author: Ilia Kurenkov <ilia.kurenkov@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT import unittest from nltk import FreqDist from nltk.lm import NgramCounter from nltk.util import everygr...
#!/usr/bin/env python """ 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");...
# 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 __...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-05-11 09:00 from __future__ import unicode_literals import django.contrib.auth.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0004_add_high_priority_user_group'), ] ...
from gym_race.envs.race_env import * from gym_race.envs.pyrace_2d import PyRace2D