text
stringlengths
1
927k
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1.12.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import u...
class ZipLib: def kw_from_zip(self, arg): print '*INFO*', arg return arg * 2
# -*- coding: utf-8 -*- """ Copyright 2017-2018 Shota Shimazu. 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...
# -*- coding: utf-8 -*- import pytest from dhmn_demo.public.forms import LoginForm from dhmn_demo.user.forms import RegisterForm from .factories import UserFactory class TestRegisterForm: def test_validate_user_already_registered(self, user): # Enters username that is already registered form = Re...
from pymongo import MongoClient from aiogram.contrib.fsm_storage.memory import MemoryStorage from data.config import IP client = MongoClient(IP) storage = MemoryStorage() database = client['DTM-Moderator'] user_db = database['users']
# Show a mesh from :func:`pyvista.Plane` is not composed of all # triangles. # import pyvista plane = pyvista.Plane() plane.is_all_triangles # Expected: ## False <CallableBool> # # Show that the mesh from :func:`pyvista.Sphere` contains only # triangles. # sphere = pyvista.Sphere() sphere.is_all_triangles # Expected: #...
# Author: Lakshmi Krishnan # Email: lkrishn7@ford.com # Author: YAO Matrix # Email: yaoweifeng0301@126.com """Builds the deepSpeech network. Summary of major functions: # Compute input feats and labels for training. inputs, labels, seq_len = inputs() # Compute inference on the model inputs to make a predict...
# -*- coding:utf-8 -*- from __future__ import absolute_import, unicode_literals from django.db import models from django.utils.encoding import force_text from six import python_2_unicode_compatible @python_2_unicode_compatible class KeyMap(models.Model): key = models.CharField(max_length=40, unique=True) val...
# -*- coding: utf-8 -*- # @Time : 19-3-28 上午10:14 # @Author : Redtree # @File : emotion_cn.py # @Desc : import load_dict all_list = load_dict.getAllList() import jieba import random #文本情感分析算法 def cutSentence(input): #结巴分词 seg_list = jieba.cut(input) # 默认是精确模式 segwordList = (",".join(seg_list)) s...
"""Test your system from the command line.""" import getpass import logging import sys from client import TotalConnectClient logging.basicConfig(filename="test.log", level=logging.DEBUG) if len(sys.argv) < 2 or len(sys.argv) > 3: print("usage: python3 test.py username [password]\n") sys.exit(1) USERNAME ...
from faker import Factory from homes_to_let.models import LettingFeature from homes_to_let.factories.letting_factory import LettingFactory import factory fake = Factory.create('en_GB') class LettingFeatureFactory(factory.DjangoModelFactory): class Meta: model = LettingFeature property = factory.S...
import logging import time from datetime import timedelta, datetime import json import push_receiver import random import requests from urllib.parse import parse_qs, urlparse import uuid import time import curlify from .const import ( DOMAIN, BRANDS, BRAND_HYUNDAI, BRAND_KIA, DATE_FORMAT, VEHI...
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.util as util import benchexec.tools.template class Tool(benchexec.tools...
from enum import Enum from overrides import overrides from deeppavlov.core.common.registry import register from deeppavlov.core.models.component import Component from deeppavlov.core.common.log import get_logger from .feb_objects import * from question2wikidata.questions import pretty_json from time import time f...
import sys import re import time import urllib2 import logging import datetime from version import __version__ from .db import create_tables, drop_tables, connect_db from .models import League, Season, SeasonType, Team, Conference, \ Division, Arena, Game from .collect import NHLTeams, NHLDivision...
# -*- coding: utf-8 -*- # ProDy: A Python Package for Protein Dynamics Analysis # # Copyright (C) 2010-2012 Ahmet Bakan # # 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 version 3 of th...
import os import multiprocessing bind = '0.0.0.0:5700' backlog = 2048 worker_class = 'gevent' workers = 1 threads = 1 worker_connections = 1000 timeout = 30 keepalive = 2 max_requests = 1000 max_requests_jitter = 50 spew = False daemon = False pidfile = None umask = 666 user = os.getenv('USER') group = os.getenv('U...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 OpenStack Foundation # 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.apach...
""" This module allows automatic splitting of a DataFrame into smaller DataFrames (by clusters of columns) and doing model training and text generation on each sub-DF independently. Then we can concat each sub-DF back into one final synthetic dataset. For example usage, please see our Jupyter Notebook. """ import abc...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/Users/blogin/PycharmProjects/HMT-git/src/ui/ui_wallet_dlg_options1.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_WdgOptions1(...
from .main import cli from .scheme import Node, Graph
#!/usr/bin/env python # Copyright (c) 2012-2016 The Bitcoin Core developers # Copyright (c) 2017-2019 The Raven Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Extract _("...") strings for translation and conver...
from logging import getLogger from typing import Any, Dict, Optional from aim.ext.resource.configs import DEFAULT_SYSTEM_TRACKING_INT from aim.sdk.num_utils import is_number from aim.sdk.run import Run try: from transformers.trainer_callback import TrainerCallback except ImportError: raise RuntimeError( ...
# -*- coding: utf-8 -*- # # This class was auto-generated. # from onlinepayments.sdk.param_request import ParamRequest from onlinepayments.sdk.request_param import RequestParam class GetProductGroupsParams(ParamRequest): """ Query parameters for Get product groups """ __country_code = None __cur...
import pygame import os pygame.init() clock = pygame.time.Clock() class Player(): walkRight = [pygame.image.load(os.path.join('SideScrollSprites', 'R1.png')), pygame.image.load(os.path.join('SideScrollSprites', 'R2.png')), pygame.image.load(os.path.join('SideScrollSprites', 'R3...
#!/usr/bin/env python # -*- coding: utf-8 -*- #---- Dronekit Imports --------------- from __future__ import print_function from dronekit import connect, VehicleMode, LocationGlobalRelative, LocationGlobal, Command import time import math from pymavlink import mavutil #----- Radar Imports ---------------- from signa...
import json import logging import boto3 import subprocess import shlex import os import re from ruamel import yaml from datetime import date, datetime from crhelper import CfnResource from time import sleep logger = logging.getLogger(__name__) helper = CfnResource(json_logging=True, log_level='DEBUG') try: s3_cli...
"""core URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/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-based vi...
from opentrons.protocol_api import labware from opentrons.types import Point, Location minimalLabwareDef = { "metadata": { "displayName": "minimal labware" }, "cornerOffsetFromSlot": { "x": 10, "y": 10, "z": 5 }, "parameters": { "isTiprack": False, }, ...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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 code import sys import click from flask import json from flask.cli import with_appcontext @click.command() @with_appcontext def command(): """Runs a shell in the app context. Runs an interactive Python shell in the context of a given Flask application. The application will populate the default ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import random try: ileliczb = int(input("Podaj ilość typowanych liczb: ")) maksliczba = int(input("Podaj maksymalną losowaną liczbę: ")) if ileliczb > maksliczba: print("Błędne dane!") exit() except ValueError: print("Błędne dane!") ex...
#!/usr/bin/env python # coding: utf-8 # # Author: Kazuto Nakashima # URL: http://kazuto1011.github.io # Created: 2017-05-26 from collections import Sequence import numpy as np import torch import torch.nn as nn from torch.nn import functional as F from tqdm import tqdm class _BaseWrapper(object): def __...
import socket, threading, os, struct,selectors#,atexit from pathlib import Path from tkinter import * import queue # thread-safe Q = queue.Queue() sel = selectors.DefaultSelector() serv_fd = None CLIENT_PORT = 9999 MAX_MSG = 4096 last_cmd = '' last_print = '' class CleanExit: pass class TextEditor: #@staticmetho...
#!/usr/bin/env python # Copied from fftpack.helper by Pearu Peterson, October 2005 """ Test functions for fftpack.helper module """ from numpy.testing import * from numpy.fft import fftshift,ifftshift,fftfreq from numpy import pi def random(size): return rand(*size) class TestFFTShift(TestCase): def test_de...
import math class Citizen: def __init__(self, economicPosition, socialPosition): self.economicPosition = economicPosition self.socialPosition = socialPosition def vote(self, politicians): vote = (0, None) for politician in politicians: score = self._score(politician...
""" Code taken from https://github.com/cattaneod/PointNetVlad-Pytorch/blob/master/models/PointNetVlad.py """ from __future__ import print_function import torch import torch.nn as nn import torch.nn.parallel import torch.utils.data from torch.autograd import Variable import numpy as np import torch.nn.functional as F i...
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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...
#!/usr/bin/env python3 # # Copyright Soramitsu Co., Ltd. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # from . import ed25519 import hashlib import binascii import grpc import time import re import os from . import commands_pb2 from . import endpoint_pb2 from . import endpoint_pb2_grpc from . import pri...
from imes4d.utils import slices_to_npz from tqdm import tqdm if __name__ == "__main__": with tqdm(total=7) as pbar: slices_to_npz('/home/laves/Pictures/oct/Kugelplatte/0/*.JPG', 'sb_0.npz') pbar.update() slices_to_npz('/home/laves/Pictures/oct/Kugelplatte/1/*.JPG', 'sb_1.npz') pbar...
import datetime from flask import Blueprint, request, abort from app.auth.helper import token_required from app.programs.helper import response, response_for_program, get_programs_json_list, response_for_programs_list, get_programs, get_single_program from app.models.user import User from app.models.program import Prog...
class Solution(object): def longestValidParentheses(self, s): """ :type s: str :rtype: int """ def length(it, start, c): depth, longest = 0, 0 for i in it: if s[i] == c: depth += 1 else: ...
""" ASGI config for user_authentication_drf 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.2/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefau...
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" Let's start by building a form to submit new images. """ from urllib import request from django.core.files.base import ContentFile from django.utils.text import slugify from django import forms from .models import Image class ImageCreateForm(forms.ModelForm): """ This form is a ModelFOrm form built from ...
#!/usr/bin/env python """Chainer example: train a VAE on MNIST """ import argparse import os import warnings import numpy as np import chainer from chainer import training from chainer.training import extensions import chainerx import net import matplotlib matplotlib.use('Agg') def main(): parser = argparse.A...
# # Source code for the 'Checkpointing RDDs' Exercise in # Data Analytics with Spark Using Python # by Jeffrey Aven # # $ spark-submit --master looping_test.py # import sys from pyspark import SparkConf, SparkContext sc = SparkContext() sc.setCheckpointDir("file:///tmp/checkpointdir") rddofints = sc.parallelize([1,2,...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
import os import time import pytest import requests from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.chrome.options import Options BROWSER = os.environ.get('BROWSER', 'ChromeHeadless') @pytest.fixture(scope="module") def browser(request): if BRO...
# -*- coding: utf-8 -*- """ flask.ext.social.views ~~~~~~~~~~~~~~~~~~~~~~ This module contains the Flask-Social views :copyright: (c) 2012 by Matt Wright. :license: MIT, see LICENSE for more details. """ from importlib import import_module from flask import (Blueprint, current_app, redirect, requ...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from itertools import ifilter from operator import itemgetter from data_source import DataSource from extensions_paths import PRIVATE_TEMPLATES import featu...
# coding=utf-8 # Copyright 2019 The ML Fairness Gym 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 applicab...
from typing import Tuple, List import torch import torch.nn as nn import torch.nn.functional as F from kornia.filters.kernels import normalize_kernel2d def compute_padding(kernel_size: Tuple[int, int]) -> List[int]: """Computes padding tuple.""" # 4 ints: (padding_left, padding_right,padding_top,padding_bot...
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the 'license' file acc...
from rest_framework.generics import ListAPIView from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet from apps.contents.models import GoodsCategory from apps.goods.models import SKU, SPU, SPUSpecification from apps.meiduo_admin.serialize...
# Copyright (c) 2010-2020 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
vertex_upload_model_op = ( kubernetes_pod_operator.KubernetesPodOperator( image="gcr.io/my-project/vertex_upload_model_image:latest", name="vertex_upload_model_pod", arguments=[ '--project=my-project', '--region=us-central1', '--model_display_name=uploaded...
import os import cv2 import time import argparse from google.colab.patches import cv2_imshow from detector import DetectorTF2 def DetectFromVideo(detector, Video_path, save_output=False, output_dir='output/'): cap = cv2.VideoCapture(Video_path) if save_output: output_path = os.path.join(output_dir, 'detection_'...
from asyncio.tasks import create_task, sleep from asyncpg.connection import Connection from bot import GrowContext, MessagedError from discord.ext import commands from typing import Dict, List, Optional, Literal, Tuple from discord import User, Message, Embed from secrets import token_urlsafe from discord.utils import ...
""" Copyright (c) Facebook, Inc. and its affiliates. """ import json import logging import os import re import spacy from typing import Tuple, Dict, Optional from glob import glob import sentry_sdk import preprocess from base_agent.memory_nodes import ProgramNode from base_agent.dialogue_manager import DialogueManag...
class GooglePlayScraperException(Exception): pass class NotFoundError(GooglePlayScraperException): pass class ExtraHTTPError(GooglePlayScraperException): pass
""" Copyright (c) 2018-2020 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 unittest.mock import patch from django.core.management import call_command from django.db.utils import OperationalError from django.test import TestCase class CommandTests(TestCase): def test_wait_for_db_ready(self): with patch('django.db.utils.ConnectionHandler.__getitem__') as gi: gi....
from twisted.logger import Logger from autobahn.twisted.wamp import ApplicationSession class MySession(ApplicationSession): log = Logger() def __init__(self, config): a = 1 / 0 self.log.info("MySession.__init__()") ApplicationSession.__init__(self, config) def onJoin(self, detail...
from flask import Flask from shellshocker_server.saferproxyfix import SaferProxyFix from raven.contrib.flask import Sentry import os app = Flask(__name__) app.config['SECRET_KEY'] = os.environ['SECRET_KEY'] try: if os.environ['SECRET_KEY'] is not None: app.config['USE_SENTRY'] = True app.config['SENTRY_DSN...
import os import unittest from checkov.terraform.plan_parser import parse_tf_plan class TestPlanFileParser(unittest.TestCase): def test_tags_values_are_flattened(self): current_dir = os.path.dirname(os.path.realpath(__file__)) valid_plan_path = current_dir + "/resources/plan_tags/tfplan.json" ...
# Advent of Code 2020 # Day 2 from pathlib import Path # input with open(Path(__file__).parent / "input.txt") as f: inp = f.readlines() # part 1 # Find how many passwords are valid according to the policy of at_least-at_most char : password. import re def part_1(): count = 0 for pwd_policy in inp: ...
# Path of your chrome driver # You'll need to download the Chrome driver compatible with # your OS and provide the path here. Find the driver: # https://chromedriver.chromium.org/downloads CHROME_DRIVER_PATH = "./chromedriver_win32/chromedriver" # Put your github user name here YOUR_NAME = "snowwhite-boss" YOUR_PASS =...
# Debug helper functions # Author: Matej Kastak from colors import Color from context import Context def debug_print(s): if Context().debug_enabled: Color.print(Color.GREEN, str(s)) def debug_enabled(): return Context().debug_enabled
import pathlib # import finrl import pandas as pd import datetime import os # pd.options.display.max_rows = 10 # pd.options.display.max_columns = 10 # PACKAGE_ROOT = pathlib.Path(finrl.__file__).resolve().parent # PACKAGE_ROOT = pathlib.Path().resolve().parent TRAINED_MODEL_DIR = f"trained_models" # DATASET_DIR =...
import loguru import logging import itertools import pytest import py import os import subprocess import datetime import time import calendar default_levels = loguru._logger.Logger._levels.copy() @pytest.fixture(autouse=True) def reset_logger(): def reset(): loguru.logger.stop() loguru.logger.__i...
from setuptools import setup setup( name="libkge", version="0.1", description="A knowledge graph embedding library", url="https://github.com/uma-pi1/kge", author="Universität Mannheim", author_email="rgemulla@uni-mannheim.de", packages=["kge"], install_requires=[ "torch>=1.3.1",...
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from vshare.utils import pretty_date from tests import TestCase class TestPrettyDate(TestCase): def test_func(self): days = [ [timedelta(days=365 * 3), '3 years ago'], [timedelta(days=365), '1 year ago'], ...
from enum import Enum class Templates(str, Enum): TEMPLATE_START = ("# {}" "\n\n" "_{}_" "\n\n" "## Functions" "\n\n") TEMPLATE_DEFINE = ("### {}" "\n\n") TEMPLATE_FUNC = ...
# encoding : utf-8 # anthor : comi from gameloop import * from pygame import * import pygame,sys,time if __name__ == '__main__': player = game() player.game_start('KEEP-GOING') while player.playing: player.new() player.screen.fill(black) player.game_start('GAME-OVER') time.sleep(1.5)
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
import numpy as np import pytest from numpy import testing from landlab import RasterModelGrid from landlab.components import ErosionDeposition, FlowAccumulator def test_Ff_too_high_vals(): """ Test that instantiating ErosionDeposition with a F_f value > 1 throws a ValueError. """ # set up a 5x5...
# Copyright 2022 The AI Flow 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 or agreed to in wri...
# Lint as: python3 # Copyright 2020 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 requ...
#! /usr/bin/env python from setuptools import setup import sys PACKAGE = "seqcolapi" # Additional keyword arguments for setup(). extra = {} # Ordinary dependencies DEPENDENCIES = [] with open("requirements/requirements-all.txt", 'r') as reqs_file: for line in reqs_file: print(line) if not line.s...
# Copyright (c) 2018 PaddlePaddle 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 app...
#!/usr/bin/python3 import cv2 import numpy as np import sqlite3 import time class QualityCheck: def __init__(self): """ Record model runs """ self.db = sqlite3.connect("logs.db", isolation_level=None) self.db.execute(""" CREATE TABLE IF NOT EXISTS ModelRun( run_i...
# # Autogenerated by Thrift Compiler (0.10.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException import sys import airavata....
from dataclasses import asdict, dataclass from enum import Enum from typing import List class NodeState(str, Enum): # Node is still initializing INITIALIZING = 'INITIALIZING' # Node is ready to establish new connections, sync, and exchange transactions. READY = 'READY' @dataclass class Peer: ""...
from setuptools import setup setup( name='cfn_get_export_value', packages=['cfn_get_export_value'], # this must be the same as the name above version='0.0.4', description='Get an exported value in AWS CloudFormation', author='Simon-Pierre Gingras', author_email='spgingras@poka.io', url='ht...
# -*- coding: utf-8 -*- from django.conf.urls import include, url from django.contrib import admin from django.views.generic import RedirectView from fast_reconcile_app import views admin.autodiscover() urlpatterns = [ # url( r'^admin/login/', RedirectView.as_view(pattern_name='login_url') ), url( r'^adm...
"""Implements an operator that detects obstacles.""" import logging import time import erdos import numpy as np import pylot.utils from pylot.perception.detection.obstacle import Obstacle from pylot.perception.detection.utils import BoundingBox2D, \ OBSTACLE_LABELS, load_coco_bbox_colors, load_coco_labels from p...
# coding=utf-8 # Copyright 2021 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 ...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 OpenAPI spec version: v1.14.7 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class V1alpha1Ro...
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def removeNthFromEnd(self, head, n): """ :type head: ListNode :type n: int :rtype: ListNode """ ptr = head ln...
__author__ = 'tinglev@kth.se' import sys import os import subprocess import unittest import mock from modules.steps.base_pipeline_step import BasePipelineStep from modules.steps import base_pipeline_step from modules.util import exceptions, data_defs class ConcreteBPS(BasePipelineStep): def get_required_env_vari...
# -*- coding: utf-8 -*- """ Offers different rate providers meant to be used with the converter package. """ from .interface import RateProviderInterface from .random_provider import RandomRateProvider from .ecb_rate_provider import ECBRateProvider
# View more 3_python 2_tensorflow_old on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial """ Please note, this code is only for 3_python 3+. If you are using 3_python 2+, please modify the code...
from os import environ def get_program(environment_variable: str, backup: str) -> str: return environ.get(environment_variable, default=backup) def get_terminal_program(program: str) -> str: return f"{PROGRAMS['terminal']} -e {program}" def get_site(url: str) -> str: return f'{PROGRAMS["browser"]} {ur...
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseBetween(self, head: Optional[ListNode], left: int, right: int) -> Optional[ListNode]: if left == right: return head fh = L...
# -*- coding: utf-8 -*- from flask import request from marshmallow import Schema, fields from marshmallow.compat import text_type as _text_type from webargs.flaskparser import FlaskParser, abort as _abort import warnings FIELD_MAPPING = { # type, [use_function] (preprocessing) fields.Integer: (int, None), ...
# #590: a subpackage that turns itself into a module from elsewhere on sys.path. I_AM = "the subpackage that was replaced with a system module" import sys import system_distro sys.modules[__name__] = system_distro
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import csv import io import json import os import re from ast import literal_eval from datetime import datetime, timezone from json.decoder import JSONDecodeError import requests import semver import yaml...
from .interface import TableDDl from lib.db.ddl import mysql class Table(TableDDl): def __init__(self, table_name, content_name, keyid, suffix='words'): self._tableName = table_name + '_' + content_name + '_' + suffix self._keyid = keyid self.DDLTable = None # type: mysql.DDLBuild ...
#!/usr/bin/env python """Installer for yolk.""" import ast from setuptools import setup def version(): """Return version string.""" with open('yolk/__init__.py') as input_file: for line in input_file: if line.startswith('__version__'): return ast.parse(line).body[0].valu...