text stringlengths 2 999k |
|---|
from dagster import check
from .system import SystemStepExecutionContext
class StepExecutionContext(object):
__slots__ = ['_system_step_execution_context', '_legacy_context']
def __init__(self, system_step_execution_context):
self._system_step_execution_context = check.inst_param(
system... |
from setuptools import setup, find_packages
with open('requirements.txt') as requirements_file:
install_requirements = requirements_file.read().splitlines()
setup(
name="yootto",
version="0.1.5",
description="yootto(ヨーッと) is tiny YouTube Music unofficial uploader",
author="yanoshi",
author_email... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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... |
"""
sentry.tagstore.v2.models.grouptagvalue
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2017 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
from django.db import models, router, transaction, DataError
from djan... |
import os
import sys
from robotframework_ls.constants import NULL
from robocode_ls_core.robotframework_log import get_logger
log = get_logger(__name__)
def _normfile(filename):
return os.path.abspath(os.path.normpath(os.path.normcase(filename)))
def _get_libspec_mutex_name(libspec_filename):
from robocode_... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode:
if not head or not head.next:
return None
# make this st... |
from django.apps import AppConfig
class Apiv3Config(AppConfig):
name = "apiv3"
|
# -*- coding: utf-8 -*-
# Copyright 2022 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... |
import param
import numpy as np
from cartopy import crs as ccrs
from cartopy.img_transform import warp_array, _determine_bounds
from holoviews.core.util import cartesian_product, get_param_values
from holoviews.operation import Operation
from shapely.geometry import Polygon, LineString, MultiPolygon, MultiLineString
... |
from typing import Any, Dict, Union
import httpx
from ...client import Client
from ...types import UNSET, Response, Unset
def _get_kwargs(
*,
client: Client,
common: Union[Unset, None, str] = UNSET,
) -> Dict[str, Any]:
url = "{}/common_parameters".format(client.base_url)
headers: Dict[str, Any... |
import pytest
import allure
from _pytest.nodes import Item
from _pytest.runner import CallInfo
from selene.core.exceptions import TimeoutException
from selene.support.shared import browser
@pytest.fixture(scope='function', autouse=True)
def browser_management():
"""
Here, before yield,
goes all "setup" co... |
#!/usr/bin/python
# -*- coding: utf_8 -*-
"""Access and query Twitter's API with the simplistic twitter package (`pip install twitter`).
"""
from __future__ import print_function
from __future__ import unicode_literals
import csv
import os
import time
from twitter import OAuth
from twitter import Twitter
def setup... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
# pandas standard library
import sys
# third-party
import pandas
import matplotlib
import matplotlib.pyplot as plot
matplotlib.style.use('ggplot')
GENDER_COUNT = 24
MALES_PROMOTED = 21
FEMALES_PROMOTED = 14
GENDER_DIFFERENCE = MALES_PROMOTED - FEMALES_PROMOTED
FEMALES_NOT_PROMOTED = GENDER_COUNT - FEMALES_PROMOTED
... |
# python3.7
"""Utility functions for latent codes manipulation."""
import numpy as np
from sklearn import svm
from .logger import setup_logger
__all__ = ['train_boundary', 'project_boundary', 'linear_interpolate']
def train_boundary(latent_codes,
scores,
chosen_num_or_ratio=0.... |
from setuptools import setup, find_packages
setup(
name='scrapy-djangoitem',
version='1.1.1',
url='https://github.com/scrapy-plugins/scrapy-djangoitem',
description='Scrapy extension to write scraped items using Django models',
long_description=open('README.rst').read(),
author='Scrapy develop... |
import os
import pytest
from virtool.subtractions.utils import (
check_subtraction_file_type,
get_subtraction_files,
join_subtraction_path,
rename_bowtie_files,
)
def test_join_subtraction_path(tmp_path, config):
assert join_subtraction_path(config, "bar") == tmp_path / "subtractions" / "bar"
... |
# -*- coding: utf-8 -*-
"""
Module to compute least cost xmission paths, distances, and costs one or
more SC points
"""
from concurrent.futures import as_completed
import geopandas as gpd
import json
import logging
import numpy as np
import os
import pandas as pd
from pyproj.crs import CRS
import rasterio
from scipy.sp... |
# Copyright 2015 Mirantis 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 agre... |
from interpriters.smart.IntelX25Interpriter import IntelX25Interpriter
from interpriters.smart.SmartBasicInterpriter import SmartBasicInterpriter
from interpriters.smart.SanDiskInterpriter import SmartSanDiskInterpriter
from interpriters.nvme.NvmeBasicInterpriter import NvmeBasicInterpriter
SPECIAL_INTERPRITERS = [Sm... |
from PyQt5.QtWidgets import (QApplication, QComboBox, QGridLayout, QGroupBox, QLabel, QPushButton,
QFileDialog, QMessageBox, QWidget, QSizePolicy, QCheckBox)
from matplotlib.backends.backend_qt5agg import FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
impo... |
from .rosetta_util import *
|
# -*- coding: utf-8 -*-
try:
from StringIO import StringIO
except ImportError:
from io import StringIO # New stdlib location in 3.0
from . import _unittest as unittest
from .common import TempDirTestCase
from toron.graph import Graph
from toron._gpn_node import Node
from toron import IN_MEMORY
class TestIn... |
# Copyright 2015 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... |
#!/usr/bin/env python
"""Read zip format file from stdin and write new zip to stdout.
With the --store option the output will be an uncompressed zip.
Uncompressed files are stored more efficiently in Git.
https://github.com/costerwi/rezip
"""
import sys
import io
from zipfile import *
import argparse
parser = argpa... |
"""
domonic.webapi.dragndrop
====================================
https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API
"""
from domonic.events import DragEvent
class DataTransfer:
def __init__(self):
self.data = {}
self.types = []
self.files = []
se... |
"""API ROUTER"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
from flask import jsonify, Blueprint
from gfwanalysis.errors import WHRCBiomassError
from gfwanalysis.middleware import get_geo_by_hash, get_geo_by_use, get_geo_by_wdpa, \
... |
#%%
import numpy as np
import pandas as pd
import time
from sklearn.base import BaseEstimator, TransformerMixin
from collections import defaultdict
from sklearn.model_selection import KFold, StratifiedKFold
class Timer:
def __enter__(self):
self.start=time.time()
return self
def __exit__(... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from commands.basecommand import BaseCommand
class Ports(BaseCommand):
def __init__(self):
self.__name__ = 'Ports'
def run_ssh(self, sshc):
res = self._ssh_data_with_header(sshc, '/ip service print detail')
sus_... |
##############################################################################
# Parte do livro Introdução à Programação com Python
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2020
# Primeira edição - Novembro/2010 - ISBN 978-85-7522-250-8
# Segunda edição - Junho/2014 - ISBN 978-85-7522-408-3
# Terce... |
from InstagramAPI import InstagramAPI
from colorama import Fore, Back, Style
import getpass
import sys
import webbrowser
import time
import requests
import json
print(Fore.GREEN + """
░░███╗░░███╗░░██╗░██████╗████████╗░░██╗██╗██████╗░░█████╗░███╗░░░███╗██████╗░██████╗░██████╗░
░████║░░████╗░██║██╔════╝... |
# The MIT License
#
# Copyright 2015-2017 University Library Bochum <bibliogaphie-ub@rub.de> and UB Dortmund <api.ub@tu-dortmund.de>.
#
# 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 wit... |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... |
# Copyright 2020 Dragonchain, Inc.
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
# 6. Tr... |
# Copyright (c) 2020 Institute for Quantum Computing, Baidu Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
# Space: O(n)
# Time: O(n)
class Solution:
def numDecodings(self, s: str) -> int:
if len(s) == 0: return 0
self.cache = {}
self.cache[''] = 1
def recursive(string):
if string in self.cache: return self.cache[string]
if string[0] == '0': return 0
... |
# Copyright 2012 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from .embedvideos import EmbedVideosXBlock
|
from .toolbox import Vin
from .exceptions import ValidationError, VininfoException
VERSION = (1, 6, 0)
"""Application version number tuple."""
VERSION_STR = '.'.join(map(str, VERSION))
"""Application version number string.""" |
# -*- coding: utf-8 -*-
from lxml import etree
import pkgutil
from io import BytesIO
from . import xml_functions, construction_functions, layer_functions
from . import surface_functions, space_functions, building_functions
from . import opening_functions, zone_functions
class Gbxml():
"A class that represents a ... |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from REL.ner.base import NERBase, Span
from REL.ner.flair_wrapper import load_flair_ner
from REL.ner.ngram import Cmns
|
import discord
from discord.ext import commands
from discord.ext.commands import has_permissions, MissingPermissions
import json
import asyncio
bot = commands.Bot(command_prefix=".")
bot.remove_command("help")
@bot.event
async def on_ready():
print("Bot running with:")
print("Username: ", bot.user.name)
p... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2020-01-14 21:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('dhis2', '0005_delete_jsonapilog'),
]
operations = [
mi... |
"""Routines related to PyPI, indexes"""
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
import enum
import functools
import itertools
import logging
import re
from typing import FrozenSet, Iterable, List, Optional, Set, Tuple, Union
from pip._vendor.packaging impo... |
from .aaa_util import eval_results, get_summary, convert_df
class AnchorDetector:
def __init__(self, offline):
self.offline = offline
def initialize(self, seq_info):
self.seq_info = seq_info
self.previous_offline = None
def fixed_detect(self, frame_idx, duration):
feedbac... |
"""
Unit and regression test for the maxsmi package.
"""
# Import package, test suite, and other packages as needed
# import maxsmi
# import pytest
import sys
def test_maxsmi_imported():
"""Sample test, will always pass so long as import statement worked"""
assert "maxsmi" in sys.modules
|
#
# Copyright 2015 Quantopian, 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... |
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is d... |
"""
GraphSense API
GraphSense API # noqa: E501
The version of the OpenAPI document: 0.5.1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from graphsense.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
M... |
# Generated by Django 2.1.5 on 2019-03-31 18:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODE... |
import os
import sys
import random
import pygame
def load_image(name, colorkey=None): # not sure if this method is needed
fullname = os.path.join('data', name)
# если файл не существует, то выходим
if not os.path.isfile(fullname):
print(f"Файл с изображением '{fullname}' не найден")
sys.e... |
from config import Config
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_bootstrap import Bootstrap
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
bootstrap = Bootstrap(app)
from flask_app import route... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Utilities for testing"""
import os
import sys
from numpy.testing import assert_allclose
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.time import Time
__all__ = [
"requires_dependency",
"requires_data",
"mp... |
# coding=utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules import conv
from torch.nn.modules.utils import _single
from ..functions.max_sv import max_singular_value
class SNConv1d(conv._ConvNd):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, paddin... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... |
# -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ classifiers.py ]
# Synopsis [ 'Naive Bayes' and 'Decision Tree' training, testing, and tunning functions ]
# Author [ Ting-Wei Liu (Andi611) ]
# Copyright [... |
from . import venv
|
class Curve_Parms():
def Curve_Parms_Paths(self):
return [str(self.a),str(self.b),str(self.c),str(self.NFrames)]
def Curve_Parms_Path(self):
return "/".join( self.Curve_Parms_Paths() )
def Curve_Parms_FileName(self,cname,fname,ext="svg"):
fnames=self.Curve_Parms_Paths()... |
#!/usr/bin/env python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# analytics_uvetest.py
#
# UVE and Alarm tests
#
import os
import sys
import threading
threading._DummyThread._Thread__stop = lambda x: 42
import signal
import gevent
from gevent import monkey
monkey.patch_all()
import unitt... |
from .objects import Server, Zone, RRSet, Record, Comment, Cryptokey, Metadata, SearchResult, StatisticItem, \
MapStatisticItem, RingStatisticItem, SimpleStatisticItem, CacheFlushResult
from .exceptions import PDNSApiException, PDNSApiNotFound
import json
from functools import partial
import requests
import loggin... |
"""
The agent module contains three abstract classes that are subclassed in order to create algorithms.
The classes are:
* Player - for an algorithm that cannot learn and can only play
* Learner - for a learning algorithm controlling a single agent
* MultiLearner - for a learning algorithm of controlling a number of a... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2013 eNovance
#
# Author: Julien Danjou <julien@danjou.info>
#
# 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/... |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
from ckuser import client,server
import os
def print_client_menu():
print("用户菜单:")
print("-"*25)
print("0"+"-"*10+"显示用户菜单"+"-"*10)
print("1"+"-"*10+"显示服务菜单"+"-"*10)
print("2"+"-"*10+"用户登录系统"+"-"*10)
print("3"+"-"*10+"用户修改信息"+"-"*10)
print("4"+"-"*10+"用户注册信息"+"-"*10)
pr... |
import os
import re
import argparse
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.preprocessing.image import load_img, img_to_array
IMAGE_SHAPE = [(224, 224), (240, 240), (260, 260), (300, 300), (380, 380), (456, 456), (528, 528), (600, 600)]
def main(paths : list, mod... |
#!/usr/bin/python3
import os
import sys
from shutil import copyfile
import argparse
from pathlib import Path
import logging
logging.basicConfig(level=logging.INFO)
NUMBERED_FILENAME_SPLIT_CHARACTER = "_"
parser = argparse.ArgumentParser(description='')
parser.add_argument('filepath', help='')
parser.add_argument('--... |
#######################################################################
# Copyright (C) #
# 2016-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# 2016 Kenta Shimada(hyperkentakun@gmail.com) #
# 2017 Nicky van Foreest(vanfore... |
import os
import cv2
source_path = './test_images/'
def processImage(filename, mImage):
if '2019' in filename:
# ----------------------------------
# Remove noise - by applying guassian blur on src image
mImage = cv2.GaussianBlur(mImage, (5, 5), cv2.BORDER_DEFAULT)
# pink rgb values - 255, 153, 255
# whit... |
"""
Copyright 2016 Deepgram
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
distri... |
"""
design_choice
~~~~~~~~~~~~~~
IMPORTANT: This is a straightforward adaptation of sphinx's todo extension
done by search/replace.
Allow design_choices to be inserted into your documentation.
Inclusion of design_choices can be switched of by a configuration variable.
The design_choice_li... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Changgon Kim, Mingeyong Yang, Taeeun Kim
# @Date: 2021-04-26 17:14
# @Last modified by: Changgon Kim
from __future__ import absolute_import, division, print_function
class LvmIebError(Exception):
"""A custom core LvmIeb exceptio... |
import os
from collections import defaultdict
import numpy as np
import torch
from termcolor import colored
from torch.utils.tensorboard import SummaryWriter
from common import utils
class Manager():
def __init__(self, model, optimizer, scheduler, params, dataloaders, logger):
# params stat... |
import asyncio
import discord
import time
import parsedatetime
from datetime import datetime
from operator import itemgetter
from discord.ext import commands
from Cogs import ReadableTime
from Cogs import DisplayName
from Cogs import Nullify
def setup(bot):
# Add the bot and deps
settings = bot.... |
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, 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.o... |
#!/usr/bin/env python
# coding=utf-8
"""
__created__ = '06/01/2017'
__author__ = 'deling.ma'
"""
from aio_rest.routes import RouteCollector, Route
from example.views import publish, IndexView
routes = RouteCollector(prefix='/app', routes=[
Route('/', IndexView),
Route('/publish', publish, method='GET'),
])
|
import tensorflow as tf
#placeholder variable(scalar)
X=tf.placeholder(tf.float32,shape=[None])
Y=tf.placeholder(tf.float32,shape=[None])
W=tf.Variable(tf.random_normal([1]),name='weight')
b=tf.Variable(tf.random_normal([1]),name='bias')
hypothesis=X*W+b
#average
cost=tf.reduce_mean(tf.square(hypothesis-Y))
optimiz... |
import chainer
import chainer.functions as F
import chainer.links as L
"""
Based on chainer official example
https://github.com/pfnet/chainer/tree/master/examples/ptb
Modified by shi3z March 28,2016
"""
class RNNLM(chainer.Chain):
"""Recurrent neural net languabe model for penn tree bank corpus.
This is... |
import mitsuba
import pytest
import os
import enoki as ek
def test01_construct(variant_scalar_rgb):
from mitsuba.core.xml import load_string
# With default reconstruction filter
film = load_string("""<film version="2.0.0" type="hdrfilm"></film>""")
assert film is not None
assert film.reconstructi... |
import pytest
class TestParseParameter:
@pytest.mark.parametrize(
"values",
[
("PARAMETER test = 4", 4.0),
("PARAMETER=4", 4.0),
("PARAMETER WARNING = 4", 4.0),
("PARAMETER = _=4", 4.0),
("WARNING = PARAMETER = 4", 4.0),
("PAR... |
import requests_cache
from requests_cache import SQLiteCache
requests_cache.install_cache(
"grabtrack_sqlite_cache", SQLiteCache("spotify_api_cache", timeout=30)
)
|
import json
from re import match
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_POST
from django.shortcuts import redirect, render
from gui.mon.forms import BaseAlertFilterForm
from gui.utils import collect_view_data
from gui.decorators import ajax_required,... |
# Primer juego...
print("Mi poesia:")
print("Las rosas son Rojas")
print("Las violetas son Azules")
print("Y yo te amo a ti")
# Mad Libs
# ingresar palabras random, adjetivos, verbos, sustantivos.
print("Ahora te toca a vos")
print("")
color = input("Ingrese un color: ")
sustantivo_plular = input("Ingrese un sustanti... |
#!/usr/bin/env python
import sys
if __name__ == '__main__':
total = 0.0
n = 0
for line in sys.stdin:
total += float(line)
n += 1
print total / n |
import logging
from . import common_functions as c_f
import os
import torch
from collections import defaultdict
import sqlite3
# You can write your own hooks for logging.
# But if you'd like something that just works, then use this HookContainer.
# You'll need to install record-keeper and tensorboard.
# pip ... |
# 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://www.apache.org/licenses/LICENSE-2.0
#
# or in th... |
'''
A: suffix solution
1. subproblems: define dp(i, j) = is_match(s[i:], p[j:]), suffix
2. guess,
2.1 the current char in p is a '*'
- use '*', repeat the char before it
- do not use '*', skip to next char after '*'
2.2 current char in s and p are match, s[i] == p[j] or ... |
import argparse
import imp
import importlib
import random
from opentamp.src.policy_hooks.vae.vae_main import MultiProcessMain
def load_config(args, reload_module=None):
config_file = args.config
if config_file != '':
if reload_module is not None:
config_module = reload_module
... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... |
# Copyright 2017 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... |
# -*- coding: utf-8 -*-
"""WSGI server."""
import argparse
import sys
from flask import Flask, jsonify
from flask_cors import CORS
from werkzeug.exceptions import BadRequest, NotFound, MethodNotAllowed, \
Forbidden, InternalServerError
from projects.api.compare_results import bp as compare_results_blueprint
from ... |
from PIL import Image
import numpy as np
import os.path as osp
import glob
import os
import argparse
import yaml
parser = argparse.ArgumentParser(description='create a dataset')
parser.add_argument('--dataset', default='df2k', type=str, help='selecting different datasets')
parser.add_argument('--artifacts', default=''... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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... |
"""
This module demonstrates and practices:
-- using ARGUMENTs in function CALLs,
-- having PARAMETERs in function DEFINITIONs, and
-- RETURNING a value from a function,
possibly CAPTURING the RETURNED VALUE in a VARIABLE.
-- UNIT TESTING.
Authors: David Mutchler, Valerie Galluzzi, Mark Hays, Amanda St... |
from django.shortcuts import render, HttpResponseRedirect
from django.urls import reverse
from urllib.parse import urlencode, unquote
import requests
from bs4 import BeautifulSoup
from django.utils.crypto import get_random_string
from django.contrib import messages
from urllib.parse import urlparse, urljoin
from django... |
"""Contains the Switch parent class."""
import asyncio
from functools import partial
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.machine import MachineController
from mpf.core.system_wide_device import SystemWideDevice
from mpf.core.utility_functions import Util
from mpf.core.platform import Switch... |
"""
Created on May 17, 2013
@author: tanel
"""
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst
GObject.threads_init()
Gst.init(None)
import logging
import thread
import os
logger = logging.getLogger(__name__)
import pdb
class DecoderPipeline2(object):
def __init__(self, conf=... |
print('---------- Bem vindo ao exercicio 61 ------')
print('\033[32m Reçaca o desafio 51. Lendo o primeiro termo e a razao de uma PA. Mostrando os 10 primeiros termos da progressa usando a estrutura while\033[m')
primeiro = int(input('Primeiro termo: '))
razao = int(input('Razão: '))
termo = primeiro
c = 1
while c... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If exte... |
from netmiko import ConnectHandler
import yaml
from pprint import pprint
def send_show_command(device, show_command):
with ConnectHandler(**device) as ssh:
ssh.enable()
result = ssh.send_command(show_command)
return result
def send_config_commands(device, config_commands):
with ConnectHa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.