text stringlengths 2 999k |
|---|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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... |
# Copyright 2017 The Bazel 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 la... |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import warnings
from collections import defaultdict
from math import isnan
import numpy as np
from pymatgen.core.composition import Composition
from pymatgen.analysis.reaction_calculator import (
Balance... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, AmpasDev and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestOrder(unittest.TestCase):
pass
|
import cv2
import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
class GuidedBackProp():
def __init__(self, model, use_cuda):
self.model = model.eval()
self.use_cuda = use_cuda
if self.use_cuda:
self.model = self.model.cuda()
... |
"""
Exercise: Sets
Author:
Date:
""" |
#!/usr/bin/env python3
#
# Copyright 2019 Miklos Vajna. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""The wsgi module contains functionality specific to the web interface."""
import os
from typing import Any
from typing import Callable
... |
from scipy.misc import imread, imresize
import numpy as np
def detect_ingrs(recipe, vocab):
#去重
try:
ingr_names = [ingr['text'] for ingr in recipe['ingredients'] if ingr['text']]
except:
ingr_names = []
print ("Could not load ingredients! Moving on...")
detected = set(... |
""""""
# Standard library modules.
# Third party modules.
# Local modules.
import remarkable-tools
# Globals and constants variables.
def test_import():
pass
|
# 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
from... |
from flask import request
from flask import jsonify
from clover.views import CloverView
from clover.keyword.service import KeywordService
from clover.core.exception import catch_exception
class KeywordView(CloverView):
def __init__(self):
super(KeywordView, self).__init__()
self.service = Keywo... |
from RPG.bot_classes.base_handler import BaseHandler
from RPG.consts.game_states import PLAYER_PROFILE
class PlayerProfile(BaseHandler):
def __init__(self, game):
super().__init__(game, PLAYER_PROFILE)
self.reply_keyboard.row('⬅Atrás')
def show(self, message):
self.game.bot.send_messa... |
# Generated by Django 3.1.5 on 2021-04-30 19:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('produtos', '0002_auto_20210430_1357'),
]
operations = [
migrations.AlterField(
model_name='produto',
name='categoria... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# force_extension, functions to work with and show force extension curves
# Copyright 2019 Tobias Jachowski
#
# 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 Li... |
import ipaddress
import os
# Terraform VARs
PRIV_SUBNET = '${private_subnet}'
NUM_MASTERS = ${master_count}
NUM_WORKERS = ${worker_count}
CLUSTER_NAME = '${cluster_name}'
num_total = NUM_MASTERS + NUM_WORKERS
master_string = ''
worker_string = ''
for i in range(0, NUM_MASTERS):
master_string += " - address... |
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.views import (
password_reset, password_reset_done, password_reset_confirm... |
# -*- coding: utf-8 -*-
"""
unifonicnextgen
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
from unifonicnextgen.api_helper import APIHelper
class Configuration(object):
"""A class used for configuring the SDK by a user.
This class need not be in... |
""" Contains functions to fetch info from different simple online APIs."""
import util.web
def urbandictionary_search(search):
"""
Searches urbandictionary's API for a given search term.
:param search: The search term str to search for.
:return: defenition str or None on no match or error.
"""
... |
import collections
import math
from copy import deepcopy
import numpy as np
import pytest
import megengine as mge
import megengine.functional as F
import megengine.hub as hub
import megengine.module as M
from megengine.core._trace_option import use_symbolic_shape
from megengine.utils.module_stats import module_stats
... |
from doubles.class_double import ClassDouble
from doubles.lifecycle import current_space
def patch_class(target):
"""
Replace the specified class with a ClassDouble
:param str target: A string pointing to the target to patch.
:param obj values: Values to return when new instances are created.
:re... |
"""
train_xcept.py
Train the Xception network to classify HV pylons
"""
import os
from os import path as op
from functools import partial
from datetime import datetime as dt
import pickle
import pprint
import numpy as np
from keras import backend as K
from keras.models import Model
from keras.layers import Dense, Dro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... |
import unittest
import onnxruntime
import torch
import numpy as np
import io
import itertools
import copy
import os
import random
from torch.nn.utils import rnn as rnn_utils
from model_defs.lstm_flattening_result import (LstmFlatteningResultWithSeqLength,
LstmFlatteningR... |
import pickle
import scipy.io
import numpy as np
'''
Handle reading and writing of geometry and generated mesh from the program
'''
def loadGeometry(name):
with open(name, 'rb') as file:
test = pickle.load(file)
return test
def saveGeometry(g, name="Untitled"):
if not name.endswith(".cfg"):
... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Django_Admin.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise I... |
# -*- coding: utf-8 -*-
"""
Azure (ARM) DNS State Module
.. versionadded:: 3000
:maintainer: <devops@eitr.tech>
:maturity: new
:depends:
* `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0
* `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8
* `azure-mgmt <https://pypi.python.org/py... |
# Coded By: Tom Sumner
# Date: 07-04-2022
# Github: Tom-Sumner / https://github.com/Tom-Sumner
# Discord: TSumner#5215
# License: MIT
# Note: If you use this code, you MUST credit me in your project.
import nextcord, os, sys, colorama, time, asyncio
from operator import itemgetter
from colorama import init, Fore, Ba... |
from setuptools import setup
from setuptools import find_packages
from setuptools.command.test import test as TestCommand
import sys
version = '1.1.0.dev0'
# Remember to update local-oldest-requirements.txt when changing the minimum
# acme/certbot version.
install_requires = [
'acme>=0.31.0',
'certbot>=0.39.... |
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... |
# Copyright 2017, OpenCensus 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 w... |
import numpy as np
from scipy import ndimage
import mahotas.center_of_mass
np.random.seed(2321)
def _mean_out(img, axis):
if len(img.shape) == 2: return img.mean(1-axis)
if axis == 0:
return _mean_out(img.mean(1), 0)
return _mean_out(img.mean(0), axis - 1)
def slow_center_of_mass(img):
'''
... |
from datetime import date
data = date.today().yaer
print(data) f |
import unittest
import openmesh
class Python(unittest.TestCase):
def setUp(self):
self.mesh = openmesh.TriMesh()
# Add some vertices
self.vhandle = []
self.vhandle.append(self.mesh.add_vertex(openmesh.Vec3d(0, 1, 0)))
self.vhandle.append(self.mesh.add_vertex(openmesh.Vec3... |
import time
import logging
import os
import sys
import json
from martypy import Marty
jointNames = [
'left hip',
'left twist',
'left knee',
'right hip',
'right twist',
'right knee',
'left arm',
'right arm',
'eyes'
]
def betweenCommands():
time.sleep(3)
def testBoolCmd(cmdS... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""(Semi-)Autogenerated django module for app management."""
from __future__ import print_function
import... |
"""Unit tests for the database initialization."""
import pathlib
import unittest
from unittest.mock import Mock, mock_open, patch
from initialization.database import init_database
class DatabaseInitTest(unittest.TestCase):
"""Unit tests for database initialization."""
def setUp(self):
"""Override t... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... |
from typing import Optional, cast
from ..apps import AbstractApp
from ..handlers import HandlerFunction
from ..requests import Request
from ..resolvers import Resolver
from ..responses import StreamResponse
__all__ = ("AbstractMiddleware",)
class AbstractMiddleware:
def __init__(self, resolver: Optional[Resolve... |
from copy import copy
import logging
import subprocess
from build_migrator.helpers import (
get_module_target,
ModuleTypes,
get_source_file_reference,
)
from build_migrator.common.argument_parser_ex import ArgumentParserEx
import build_migrator.common.os_ext as os_ext
from .base.compiler_parser import Compi... |
# Generated by Django 3.0.8 on 2020-08-29 19:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('donations', '0005_auto_20200821_1151'),
]
operations = [
migrations.AlterField(
model_name='donationform',
name='fix... |
bot_token = ""
users = [
]
website_links =[
"https://www.google.com",
]
|
"""TemporaryDirectory class, copied from Python 3
NamedFileInTemporaryDirectory and TemporaryWorkingDirectory from IPython, which
uses the 3-clause BSD license.
"""
from __future__ import print_function
import os as _os
import warnings as _warnings
import sys as _sys
# This code should only be used in Python version... |
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class PointLikeMixer(nn.Module):
def __init__(self, args):
super(PointLikeMixer, self).__init__()
self.args = args
self.n_agents = args.n_agents
self.n_groups = args.mixing_group_dim
... |
"""Sets the default appconfig to :py:cls:`~crudlfap.apps.DefaultConfig`."""
from django.utils.module_loading import autodiscover_modules
def autodiscover():
autodiscover_modules('crudlfap')
default_app_config = 'crudlfap.apps.DefaultConfig'
|
# Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... |
# Generated by Django 2.0.8 on 2018-09-28 11:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0030_brandingperiod_override_listings_root'),
]
operations = [
migrations.AlterField(
model_name='event',
... |
def queens(n):
a = list(range(n))
up = [True]*(2*n - 1)
down = [True]*(2*n - 1)
def sub(i):
if i == n:
yield tuple(a)
else:
for k in range(i, n):
j = a[k]
p = i + j
q = i - j + n - 1
if up[p] and down... |
"""
This is a very simple form of twenty one. Ace only counts as value 1 not 1 or
11 for simplicity. This means that there is no such thing as a natural or two
card 21. This is a good example of showing how it can provide a good solution
to even luck based games.
"""
import datetime
import os
from random import randin... |
import numpy as np
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
import datetime as dt
from flask import Flask, jsonify
engine = create_engine("sqlite:///Resources/hawaii.sqlite")
# reflect an existing database into ... |
"""Test main.py
"""
from starlette.testclient import TestClient
from toolz.curried import pipe, curry
from main import app
client = TestClient(app) # pylint: disable=invalid-name
def get(url):
"""Get the response given a file URL
"""
return client.get(f"/get/?url={url}")
@curry
def get_contour(colx,... |
from .binner import Binner
from .globalcontrastrowscaler import GlobalContrastRowScaler
from .logmeanvariancescaler import LogMeanVarianceScaler
from .lpscaler import LpScaler
from .meanvariancescaler import MeanVarianceScaler
from .minmaxscaler import MinMaxScaler
__all__ = [
'Binner',
'GlobalContrastRowScale... |
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
import difflib
import Levenshtein
from lxml import etree
import math
import conf
import g
from gwis.exception.gwis_error import GWIS_Error
from item.feat import byway
from item.feat import region
from item.... |
import os
from typing import (
Any,
Sequence, List
)
def ensure_list(value: Any) -> List:
# if isinstance(value, Sequence) and not isinstance(value, str):
if hasattr(value, '__iter__') and not isinstance(value, str):
return list(value)
else:
return [value]
def files_exist(files: ... |
# Copyright (c) 2020 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... |
import os
import asyncio
import logging
import uuid
from datetime import datetime
from websockets import ConnectionClosed
from sanic import Sanic
from sanic.log import access_logger
from sanic.response import file, redirect
class PingFilter(logging.Filter):
def filter(self, record):
return not (record.r... |
#
#
#
import unittest, sys
import IfxPy
import config
from testfunctions import IfxPyTestFunctions
class IfxPyTestCase(unittest.TestCase):
def test_148_CallSPDiffBindPattern_01(self):
obj = IfxPyTestFunctions()
obj.assert_expect(self.run_test_148)
def run_test_148(self):
conn = IfxPy.connect(conf... |
from model.contact_info import Contact_info
def test_edit_first_contact(app):
app.contact.edit_first_contact(Contact_info(firstname="2", middlename="2", lastname="2", nickname="2", title="2", company_name="2", company_address="1", company_home_num="1", company_home_phone="1", add_company_name="1", company_fax="1"... |
from datetime import datetime
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Avg
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import redirect
from django.urls import reverse, reverse_lazy
from django.contrib.auth import authenticate, login, lo... |
from __future__ import print_function
import logging
import os
import socket
import sys
from contextlib import closing
from typing import TYPE_CHECKING
from tornado.curl_httpclient import CurlAsyncHTTPClient
from tornado.httpclient import AsyncHTTPClient
from tornado.httpserver import HTTPServer
from tornado.ioloop i... |
from os import path as osp
import numpy as np
# vizdoom
MAP_NAME_TEMPLATE = 'map%02d'
MOVE_FORWARD = [0, 0, 0, 1, 0, 0, 0]
MOVE_BACKWARD = [0, 0, 0, 0, 1, 0, 0]
MOVE_LEFT = [1, 0, 0, 0, 0, 0, 0]
MOVE_RIGHT = [0, 1, 0, 0, 0, 0, 0]
STAY_IDLE = [0, 0, 0, 0, 0, 0, 0]
TURN_LEFT = [0, 0, 0, 0, 0, 1, 0]
TURN_RIGHT = [0, 0, 0... |
#################################################################################################################
# ewstools
# Description: Python package for computing, analysing and visualising
# early warning signals (EWS) in time-series data
# Author: Thomas M Bury
# Web: http://www.math.uwaterloo.ca/~tbury/
# Cod... |
# Copyright 2013 Rackspace Hosting
# 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 require... |
# Copyright (c) 2021 PPViT 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 l... |
from django.shortcuts import get_object_or_404, get_list_or_404, render
from django.http import JsonResponse, HttpResponse
from django.core import serializers
from .models import Employee, LeaveBalance, LeaveType, LeaveRequest
from .models import Department
from django.views.decorators.csrf import csrf_exempt
# Creat... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Launch... |
# Copyright 2016-2021 Blue Marble Analytics 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 ag... |
import asyncio
import glob
import hashlib
import os
import threading
import logging
from typing import Tuple, Coroutine
def get_filepaths_with_glob(root_path: str, file_regex: str):
return glob.glob(os.path.join(root_path, file_regex))
def hash_file(tmp_file_path):
BUF_SIZE = 65536 # lets read stuff in 64... |
import torch
from pytorchfi.core import fault_injection as pfi_core
from .util_test import helper_setUp_CIFAR10_same
class TestWeightFIcpu:
"""
Testing focuses on weight perturbations.
"""
def setup_class(self):
torch.manual_seed(0)
self.BATCH_SIZE = 1
self.WORKERS = 1
... |
"""Модуль запуска сервера."""
import os
from flask import Flask, url_for
from flask_admin.contrib.sqla import ModelView
from flask_admin.menu import MenuLink
from flask_dance.contrib.github import make_github_blueprint
from flask_mail import Mail
from flask_sessionstore import SqlAlchemySessionInterface
from src imp... |
import time
import busio
import logging
from digitalio import DigitalInOut, Direction, Pull
import board
import adafruit_ssd1306
import adafruit_rfm9x
LOG_FORMAT = "%(asctime)s:%(levelname)s:%(message)s"
logging.basicConfig(
filename="/home/pi/logs/button.log",
level=logging.INFO,
format=LOG_FORMAT,
da... |
from .coefficient_set import CoefficientSet
from .lattice_cpa import run_lattice_cpa, setup_lattice_cpa, finish_lattice_cpa
from .utils import load_data_from_csv, print_model |
import os
import re
import threading
import socket
import pyftpdlib.__main__
from pyftpdlib.ioloop import IOLoop
import pyftpdlib.handlers as Handle
from pyftpdlib.servers import FTPServer
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib._compat import PY3, u, b, getcwdu, callable
class FTPDHandler (Ha... |
from flask import Blueprint, request, url_for, jsonify
from flask_api import status
from models.main import *
from models.appendix import *
from flask_jwt_extended import (create_access_token, create_refresh_token,
jwt_required, get_jwt_identity)
from config import Config
app_auth = Blu... |
"""
Input and output file creation functions and main part are implemented in this file.
To run, just type "python3 main.py" into the Console.
"""
import sys
from state import State
from typing import Tuple, List
from idastar import ida_star
from astar import a_star
def take_input() -> State:
with ope... |
import torch
from torch import nn, Tensor
from torch.nn.modules.utils import _pair
from torch.jit.annotations import List, BroadcastingList2
from torchvision.extension import _assert_has_ops
from ._utils import convert_boxes_to_roi_format, check_roi_boxes_shape
def roi_pool(
input: Tensor,
boxes: Tensor,
... |
from selenium import webdriver
import getpass
import time
# codechef credentials for login
username = "mohansha"
password = getpass.getpass("Password: ")
# problem code
problem = input("Problem code: ")
# submission code
submission_file = input("Submission file: ")
with open(submission_file, 'r') as f:
code = f.re... |
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedNodeAI import DistributedNodeAI
from direct.distributed.ClockDelta import *
from toontown.fishing import FishingTargetGlobals
from direct.task import Task
import random, math
class DistributedFishingTargetAI(DistributedNodeAI):
n... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
__all__ = ['pdb']
__version__ = '0.9.0'
import sys
# backwards compatibility to support `from fairseq.meters import AverageMeter`
from fairs... |
from __future__ import annotations
import pathlib
from dataclasses import dataclass
from typing import Dict, List, Optional, Set, Tuple
# Describes how exactly a type was created from a generic
@dataclass(eq=True)
class GenericSource:
generic: Generic
arg: Type
class Type:
def __init__(
self,
... |
# coding: utf-8
"""
forumsentry_api
"""
import pprint
import re # noqa: F401
import six
class Document(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is at... |
# --------------
# Code starts here
# Create the lists
class_1=["Geoffrey Hinton" , "Andrew Ng" , "Sebastian Raschka" , "Yoshua Bengio"]
class_2=["Hilary Mason" , "Carla Gentry" , "Corinna cortes"]
new_class=class_1+class_2
print(new_class)
new_class.append("Peter Warden")
print(new_class)
new_class.remove("... |
from opytimizer.optimizers.misc import DOA
# One should declare a hyperparameters object based
# on the desired algorithm that will be used
params = {
'r': 1.0
}
# Creates a DOA optimizer
o = DOA(params=params)
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
from .sql_updates import check_and_insert_user_agent
from .sql_updates import get_username_random, get_username_to_unfollow_random
from .sql_updates import (
get_usernames_first,
get_usernames,
get_username_row_count,
... |
#!/usr/bin/env python
# -*- coding: utf8 - *-
from __future__ import print_function, unicode_literals
from cihai.core import Cihai
from cihai.extend import Dataset
data = {} # any data source, internal, a file, on the internet, in a database...
class MyDataset(Dataset):
def bootstrap(self): # automatically ra... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
##############################################################################
#
# PURPOSE:
# Probe the HLS video segment (.ts) file outputted by MediaLive to extract
# metadata about the video segment an... |
#
# 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... |
from flask import Flask, render_template
import requests
import json
app = Flask(__name__)
r = requests.get('https://gist.githubusercontent.com/the-akira/4f2244540d61f8a9d3ec73b280af5f9b/raw/7d55ea6600b25292d4e0b8b76743204403747e38/pokedex.json')
dados = r.text
pokemons = json.loads(dados)
@app.route('/')
def home(... |
# -*- 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... |
# Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... |
#############################################################################
# Copyright (c) 2018, Voilà Contributors #
# Copyright (c) 2018, QuantStack #
# #
# Distri... |
# This is a script to add references shared objects into zip file.
# It gets output of `ldd libkleisli-haskell.so` and adds referenced
# dynamic libraries to the zip file (`Kleisli.zip`).
from __future__ import print_function
import os.path
import re
import subprocess
import sys
# Zip file is first argument
zipFile =... |
from netapp.netapp_object import NetAppObject
class LicenseV2Cleanup(NetAppObject):
"""
Status information about a licensable package.
When returned as part of the output, all elements of this typedef
are reported, unless limited by a set of desired attributes
specified by the caller.
<p>
W... |
# Minimum and Maximum
playerOneScore = 10
playerTwoScore = 4
print(min(playerOneScore, playerTwoScore))
print(min(0, 12, -19))
print(min("Kathryn", "Katie"))
print(min("Angela", "Bob"))
print(max(playerOneScore, playerTwoScore))
playerThreeScore = 14
print(max(playerThreeScore, playerTwoScore, playerOneScore))
print... |
'''
Created on Apr 12, 2018
@author: ywz
'''
import numpy, os
import tensorflow as tf
from replay_memory import ReplayMemory
from optimizer import Optimizer
from actor_critic_net import ActorCriticNet
class DPG:
def __init__(self, config, task, directory, callback=None, summary_writer=None):
... |
from imutils import face_utils
import dlib
import cv2
import numpy as np
pre_trained_model = 'classifier/shape_predictor_68_face_landmarks.dat'
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(pre_trained_model)
video = cv2.VideoCapture('video/somi.mp4')
while video.read():
_, image_... |
# 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 ... |
# Copyright (c) 2018-2021, Texas Instruments
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of condition... |
from enum import Enum, unique
from capexplain.cl.cfgoption import DictLike
import logging
# logger for this module
log = logging.getLogger(__name__)
################################################################################
# Cmd types
@unique
class CmdTypes(Enum):
Mine = 1,
Explain = 2,
Stats = 3,
... |
__all__ = ['CallFlagsType',
'CallMethod',
'ContractType',
'CreateMethod',
'CreateMultisigAccountMethod',
'CreateStandardAccountMethod',
'DestroyMethod',
'GasProperty',
'GetCallFlagsMethod',
'GetMinimumDeploymentFeeMethod'... |
from __future__ import unicode_literals
from datetime import date
import unittest
from django import forms
from django.conf import settings
from django.contrib.admin.options import (ModelAdmin, TabularInline,
HORIZONTAL, VERTICAL)
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.widgets... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.