text
stringlengths
2
999k
# Singly-linked lists are already defined with this interface: class ListNode(object): def __init__(self, x): self.value = x self.next = None def condense_linked_list(node): root = ListNode(0) root.next = node.next p1 = node.next if p1 is None: return root.next p = p1.n...
from dns import resolver from asyncio.subprocess import PIPE, create_subprocess_exec from requests.exceptions import ConnectionError from raccoon_src.utils.help_utils import HelpUtilities from raccoon_src.utils.exceptions import RaccoonException from raccoon_src.utils.logger import Logger from raccoon_src.utils.colorin...
from .get_dataset import get_dataset_with_opts from .kitti_dataset import KITTIColorDepthDataset from .make3d_dataset import Make3DDataset from .nyu_dataset import NYUv2_Dataset __all__ = [ 'get_dataset_with_opts', 'KITTIColorDepthDataset', 'Make3DDataset', 'NYUv2_Dataset' ]
import os from django.urls import reverse_lazy try: from .LocalSetting import * DEBUG = True ALLOWED_HOSTS = [] except: # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False ALLOWED_HOSTS = ['*'] # Build paths inside the project like this: os.path.join(BASE_DIR, ...) ...
#!/usr/bin/python # # 2019 Graham R Pugh # # 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 ...
# Copyright 2020-2021 Dolthub, 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...
""" Entrada Salario base-->float-->SB Ventas departamento1-->float-->dep1 Ventas departamento2-->float-->dep2 Ventas departamento3-->float-->dep3 Salidas Venta total-->float-->VT """ #entrada SB=float(input("Digite el sueldo base:")) dep1=float(input("Digite el valor de ventas departamento 1:")) dep2=float(input("Digi...
import pandas as pd from enum import Enum import io import requests _EXCHANGE_LIST = ['nyse', 'nasdaq', 'amex'] headers = { 'authority': 'api.nasdaq.com', 'accept': 'application/json, text/plain, */*', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko...
from riemann import tx from riemann import utils as rutils from ledger import blue, utils from typing import cast, List, Optional, Tuple from ledger.ledger_types import LedgerXPub, PrevoutInfo # https://ledgerhq.github.io/btchip-doc/bitcoin-technical-beta.html SIGHASH_ALL = tx.shared.SIGHASH_ALL def _parse_publi...
from whparser import WrapperHeaderParserElement
def description_from_url_walmart(link): """ :param link: :return: """ description = "" try: remove_initial = link.replace("https://www.walmart.com/ip/", "") for i in remove_initial: if i != "/": description += i else: break...
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # import cv2 def get_optflow_retval(algorithm): if algorithm.lower() == 'deepflow': retval = cv2.optflow.createOptF...
from lmfit import Parameter from numpy.testing import assert_allclose def assert_paramval(param, val, tol=1.e-3): """assert that a named parameter's value is close to expected value""" assert(isinstance(param, Parameter)) pval = param.value assert_allclose([pval], [val], rtol=tol, atol=tol, ...
""" 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 use this ...
# Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np import torch from openvino.tools.pot.graph import node_utils as nu from openvino.tools.pot.utils.logger import get_logger from .utils import get_weight_node logger = get_logger(__name__) # pylint: disable=W0221 cla...
""" Note about version numbers: The version number is tied to the API version of mailchimp that we support. Version 1.3.0 indicated the first release supporting v1.3 of the API. """ __version__ = '1.3.0'
# Copyright (c) 2017 The Verde Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause # # This code is part of the Fatiando a Terra project (https://www.fatiando.org) # """ A minimal integration test to make sure the most critical parts of Verde work as expected. ...
import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * from Configuration.Generator.Pythia8aMCatNLOSettings_cfi import * generator = cms.EDFilter("Pythia8HadronizerFilter", maxEventsToPrint = cms.unt...
from math import inf from dndme.commands import Command class SetCondition(Command): keywords = ["set"] help_text = """{keyword} {divider} Summary: Set a condition on a target, optionally for a duration Usage: {keyword} <target> <condition> [<duration> [<units>]] Examples: {keyword} Frodo prone {k...
# Generated by Django 2.2.13 on 2020-08-12 19:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("studies", "0020_add_collaborator_role")] operations = []
# Copyright 2015, Thales Services SAS # 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 requ...
"""Added foreignkey between User and Food Revision ID: b4665a9e2eb9 Revises: f8327bd2abe7 Create Date: 2020-02-13 15:55:55.657220 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'b4665a9e2eb9' down_revision = 'f8327bd2abe7' branch_labels = None depends_on = Non...
""" Uncertainties in the parameters (p6) """ import numpy import math from pylab import * import matplotlib.pyplot as plt from weighted_least_squares import Regress as wls """ For brevity, I have defined mu as the sum of x**2/sigma**2 and have defined phi as the sum of inverse of sigma. The advantage here is that t...
from flask import Flask app = Flask(__name__) from views import * from configuration import * if __name__ == "__main__": app.run(debug=True)
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'IPTest' project = "Blacklist Tester for IP Addresses" project_no_spaces = project.replace(' ', '') version = '0.1.1' description = 'It does cool things with...
from sqlalchemy.orm import Session from app.crud.user import crud_user from app.schemas.user import UserCreate from app.core.config import settings def init_db(db: Session) -> None: user = crud_user.get_by_email(db, email=settings.FIRST_SUPERUSER_EMAIL) if not user: user_in = UserCreate( ...
# Functions to local IPFS peer and remote IPFS Cluster Pinning Service # # Docs: # go-ipfs peer RPC API (v0.11.0): https://github.com/ipfs/ipfs-docs/blob/8ca256c8dd383490b5c26f5dfa0e3fe80859381c/docs/reference/http/api.md # IPFS Pinning Service API (1.0.0): https://ipfs.github.io/pinning-services-api-spec from . impo...
import logging import random from django.conf import settings from django.http import (HttpResponseRedirect, HttpResponse, HttpResponseForbidden, HttpResponseNotFound, Http404) from django.utils import simplejson from django.shortcuts import get_object_or_404, render_to_response from django.template import ...
# # Copyright 2017 Human Longevity, 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 ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'seconscreen.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form,MainWindow,ocr): Form...
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os import click from semver import finalize_version, parse_version_info from ...constants import BETA_PACKAGES, NOT_CHECKS, VERSION_BUMP, get_agent_release_requirements from ...git import get_curr...
# Copyright 2018 The Batfish Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# -*- coding: ISO-8859-15 -*- # ============================================================================= # Copyright (c) 2011 Tom Kralidis # # Authors : Tom Kralidis <tomkralidis@gmail.com> # # Contact email: tomkralidis@gmail.com # ============================================================================= fro...
# 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: v1.15.9 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six fr...
from functools import partial from typing import Optional, Tuple, List import numpy from numpy.typing import ArrayLike from skimage.restoration import denoise_nl_means as skimage_denoise_nl_means from skimage.restoration import estimate_sigma from aydin.it.classic_denoisers import _defaults from aydin.util.crop.rep_c...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017-2019 Luiz Augusto Alves Ferraz # . # 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/license...
from selenium import webdriver from fixture.session import SessionHelper from fixture.group import GroupHelper from fixture.contact import ContactHelper class Application: def __init__(self, browser, base_url): if browser == "firefox": self.wd = webdriver.Firefox() elif browser == "chro...
#!/usr/bin/env python3 import itertools import json import re import sys import tarfile import xml.etree.ElementTree as etree from concurrent.futures import ProcessPoolExecutor, as_completed from pathlib import Path from urllib import request GOOGLE1000_PATH = './data/google1000' GOOGLE1000_URL = 'https://ocrhl.jbait...
import asyncio import xjsonrpc from xjsonrpc.client.backend import aiohttp as xjsonrpc_client async def main(): async with xjsonrpc_client.Client('http://localhost/api/v1') as client: response = await client.send(xjsonrpc.Request('sum', params=[1, 2], id=1)) print(f"1 + 2 = {response.result}") ...
# Copyright 2020 Google Research. 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...
import colorama import RPG_Input import RPG_Player import RPG_World import RPG_Map import multiprocessing import sys def main(): p=multiprocessing.Process(target=RPG_Map.print_loading, args=("Loading...",)) p.start() colorama.init(wrap=True, convert=True) RPG_Map.clear_screen() World1=RPG_World.W...
# coding: utf-8 """ FlashArray REST API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 2.9 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re import six import typing from ....
""" Copyright 2021 Inmanta 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 ...
from plotly.basedatatypes import BaseTraceHierarchyType import copy class Project(BaseTraceHierarchyType): # x # - @property def x(self): """ Determines whether or not these contour lines are projected on the x plane. If `highlight` is set to True (the default), the pr...
# 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...
#!/usr/bin/env python """ Captures pictures from a Thorlabs Scientific series cameras (such as Zelux). This follows the structure of uc480 written by Hazen Run python setup.py install inside: Temp1_Scientific_Camera_Interfaces-Rev_H.zip\Scientific Camera Interfaces\SDK\Python Compact Scientific Camera Toolkit\thorlabs...
#!/usr/bin/env python # Copyright 2013 The Swarming Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 that # can be found in the LICENSE file. """Uploads a ton of stuff to isolateserver to test its handling. Generates an histogram with the latencies to download ...
import logging import filetype from tempfile import mkdtemp from collections import namedtuple import os import subprocess from . import cacheget from . import file from . import utils opt_recursive = False log = logging.getLogger('hashget') class Package(object): """ Represents universal interface to a...
# -*- coding: utf-8 -*- import datetime import sqlalchemy from sqlalchemy import orm from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from sqlalchemy_serializer import SerializerMixin from .db_session import SqlAlchemyBase from .model import Model class User(...
from selenium import webdriver from time import sleep import json import Client t = Client.get_servers_raw() if t == None: print('Failed to get the list of servers') raise SystemExit if len(t) == 0: print('The list of servers is empty') raise SystemExit print(f'Added {len(t)} servers to the queue') wi...
# -*- coding: utf-8 -*- """Generate the Resilient customizations required for fn_geocoding""" from __future__ import print_function from resilient_circuits.util import * def codegen_reload_data(): """Parameters to codegen used to generate the fn_geocoding package""" reload_params = {"package": u"fn_geocoding...
#!/usr/bin/env python3 from util import main, State from random import randint from queue import PriorityQueue def parse(grammar, sentence): work = PriorityQueue() chart = set() def enqueue(s): if s not in chart: work.put((s.loc, s)) chart.add(s) def predict(s): for rhs i...
# Universal Power Supply Controller # USAID Middle East Water Security Initiative # # Developed by: Nathan Webster # Primary Investigator: Nathan Johnson # # Version History (mm_dd_yyyy) # 1.00 03_24_2018_NW # ###################################################### # Import Libraries import shutil import datetime import...
import os import logging import shutil import numpy as np import fitsio from legacypipe.catalog import read_fits_catalog from tractor.basics import PointSource from tractor.galaxy import DevGalaxy from tractor.sersic import SersicGalaxy from legacypipe import runbrick as lprunbrick from legacypipe.survey import wcs_fo...
from ....model.window.controller import WindowHandleController def get_all_window_handles(driver: object, controller: WindowHandleController, selenium: bool = False) -> list[str]: if selenium: return driver.window_handles # type: ignore else: return [window_handle.id for window_handle in cont...
import unittest import numpy as np import math import warnings from sklearn.datasets import make_blobs import ps6 as ps6 class TestPS6(unittest.TestCase): def test_01_prep_dataset(self): raw_data = np.random.randint(10, size=(10,100)) prepped_data = ps6.prep_dataset(raw_data) ...
import torch import torchsparse_backend from torch.autograd import Function __all__ = ['sphashquery'] class SparseQuery(Function): @staticmethod def forward(ctx, hash_query, hash_target): if len(hash_query.size()) == 2: C = hash_query.size(1) else: C = 1 idx_t...
#!/usr/bin/env python """ A bidirectional tool to synchronize remote and local directory trees using FTP. For usage information, run ``ftpsync.py --help``. Homepage: https://github.com/mehmandarov/ftpsync2d """ # Author: Pearu Peterson # Created: April 2008 # Further development: Rustam Mehmandarov # License: BSD __...
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 3.1.3. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib ...
import csv import pandas as pd from scraper import scraper LINKS = ['https://timesofindia.indiatimes.com/', 'https://www.thehindu.com/', 'https://www.bbc.com/news', 'https://www.theguardian.co.uk/'] def create_df(content_list): ''' To write the data to csv file takes a list of list wher...
# Copyright 2011 Terena. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the fol...
"""ecommerce URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/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='home') Class-bas...
#python3 Steven 12/01/20,Auckland,NZ #pytorch: optimizer traning convergence speed import numpy as np import matplotlib.pyplot as plt import torch import torch.optim as optim import torch.nn as nn import os,time import imageio from torchsummary import summary #pip install torchsummary from commonTorch import Regressi...
# Copyright 2018 The Texar 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 applicable ...
# -*- coding: utf-8 -*- # Copyright (C) 2022 Machine Learning Group of the University of Oldenburg. # Licensed under the Academic Free License version 3.0 from __future__ import division, print_function import os import re import glob import numpy as np from utils import eval_fn import matplotlib from matplotlib.tick...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
import cv2 import numpy as np def nothing(x): pass # Load image image = cv2.imread('1.jpg') # Create a window cv2.namedWindow('image') # Create trackbars for color change # Hue is from 0-179 for Opencv cv2.createTrackbar('HMin', 'image', 0, 179, nothing) cv2.createTrackbar('SMin', 'image', 0, 255...
""" Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None """ class Solution: """ @param root: The root of binary tree. @return: Preorder in ArrayList which contains node values. """ def preorderTraversal(self, root)...
class Solution: def advantageCount(self, A: List[int], B: List[int]) -> List[int]: sortedA = sorted(A) sortedB = sorted(B) assigned = {b: [] for b in B} remaining = [] j = 0 for a in sortedA: if a > sortedB[j]: assigned[sortedB[j]].append(a...
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='CS:GO AI Challenge', author='thecml', license='MIT', )
import requests import os class authApi: def login(api_client): head = {'accept': 'application/json', 'Content-Type': 'application/json'} data = { "username": api_client.username, "password": api_client.password } api_client.send_request(url_su...
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from abc import ABC, abstractmethod from datetime import datetime from types import ModuleType from typing import List from pytz import timezone from dataclasses import dataclass from importlib import import_module from .constant import Interval, Exchange from .object import BarData, TickData from .setting import SETT...
''' General/Mapping/reverse _______________________ Mapping object with forward and reverse lookups, providing O(1) time performance for both key and value lookups. :copyright: (c) 2015 The Regents of the University of California. :license: GNU GPL, see licenses/GNU GPLv3.txt for more details....
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import testpy def GetConfiguration(context, root): return testpy.ParallelTestConfiguration(context, root, 'async-hooks')
# # 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 un...
import itertools import logging from tqdm import tqdm from common.container.uri import Uri from common.graph.edge import Edge from common.graph.node import Node from common.utility.mylist import MyList class Graph: def __init__(self, kb, logger=None): self.kb = kb self.logger = logger or logging...
from .logging import debug from .open import open_file from .promise import Promise from .typing import List, Dict, Any, Iterable, Optional, Tuple from .url import uri_to_filename from functools import partial import operator import sublime # tuple of start, end, newText, version TextEdit = Tuple[Tuple[int, int], Tup...
from __future__ import print_function import sys import base64 from os.path import splitext def encode(names): for name in names: basename, ext = splitext(name) ext = ext.lstrip('.') with open(name) as fp: data = fp.read(32000); # max-size in data-uri I think b64string ...
from __future__ import print_function import sys from builtins import range sys.path.insert(1, "../../../") import h2o from tests import pyunit_utils from h2o.estimators.kmeans import H2OKMeansEstimator class Test_PUBDEV_2981_kmeans: """ PUBDEV-2981: Sometimes algos just hangs and seem to be doing nothing....
import torch from torch import nn, optim from torch.nn import functional as F EPS = 1e-12 class VAE(nn.Module): def __init__(self, img_size, latent_spec, temperature=.67, use_cuda=False): """ Class which defines model and forward pass. Parameters ---------- img_size : tup...
from browser import ajax from .futures import Future class HTTPException(Exception): """ A class representing a HTTPRequest error """ def __init__(self, request): super(HTTPException, self).__init__() self.req = request class HTTPRequest(Future): """ A class represen...
#Creacion de un nuevo archivo print("Hola Mundo")
import subprocess def convert_video(video_input, video_output): cmds = ['ffmpeg', '-i', video_input, video_output] print("DOne") subprocess.Popen(cmds)
"""***************************************************************************** * Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * responsibility to ...
def bubbleSort(list): for i in range(len(list)): for j in range(len(list) - i - 1): if list[j] > list[j + 1]: list[j + 1], list[j] = list[j], list[j + 1] return list my_list = [5, 9, 1, 4, 2, 8, 0, 3, 7, 6] print("Original list: \n", my_list) print("List with bubble sort: \...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Generated by Django 3.0.5 on 2020-04-28 14:18 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Subject', fields=[ ...
from .text_encoders import TextEncoder
from datetime import datetime, timedelta import os import uuid from app.main.util.preprocess_datetime import save_datetime_title from werkzeug.utils import secure_filename from app.main import db from app.main.model.user import User from app.main.service import config from app.main.util import utils_response_object fro...
from __future__ import print_function from numpy import pi, arange, sin, cos import numpy as np import os.path from bokeh.objects import (Plot, DataRange1d, LinearAxis, ColumnDataSource, Glyph, PanTool, WheelZoomTool) from bokeh.glyphs import Circle from bokeh import session x = arange(-2*pi, 2*pi, 0.1) y = sin(...
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
import json import shutil from sepal_ui import sepalwidgets as sw import ipyvuetify as v from component.message import cm from component import parameter as cp from component import widget as cw from component import scripts as cs from .gwb_tile import GwbTile class DistTile(GwbTile): def __init__(self, io): ...
import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.ticker as ticker import itertools # switch to Physical Review compatible font matplotlib.rcParams['text.usetex'] = True matplotlib.rcParams['text.latex.preamble'] = r'\usepackage{amsmath,amssymb,txfonts}' matplotlib.rcParams['font.f...
#! /bin/env python3 import sys from tokenizers import SentencePieceBPETokenizer from tokenizers.pre_tokenizers import Whitespace import gensim tokenizer = SentencePieceBPETokenizer() pre_tokenizer = Whitespace() tokenizer.pre_tokenizer = pre_tokenizer data = gensim.models.word2vec.LineSentence(sys.argv[1]) tokeniz...
import random """ Example display: Player is dealt K and 3 (total = 13) Dealer is dealt 8 Player hits and receives 5. (total = 18) Player stays. Dealer hits and receives 4 (total = 12) Dealer hits and receives Q (total = 22) Dealer busts! Player wins! """ class BlackJack: def __init__...
#!/usr/bin/python # Copyright (C) 2014 The Android Open Source Project # # 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 require...
# Licensed to Elasticsearch B.V under one or more agreements. # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information import time from itertools import chain from .connection import Urllib3HttpConnection from .connection_pool import C...
r""" Interval Exchange Transformations and Linear Involution An interval exchage transformation is a map defined on an interval (see help(iet.IntervalExchangeTransformation) for a more complete help. EXAMPLES: Initialization of a simple iet with integer lengths:: sage: T = iet.IntervalExchangeTransformation(Per...