text
stringlengths
2
999k
from teradata.dataframe.core.dataframe import Frame class Series(Frame): pass
#!/usr/bin/env python import unittest from juriscraper.lib.date_utils import is_first_month_in_quarter, quarter from juriscraper.lib.diff_tools import normalize_phrase from juriscraper.lib.string_utils import ( CaseNameTweaker, clean_string, convert_date_string, fix_camel_case, force_unicode, ...
# Copyright (c) Jeremías Casteglione <jrmsdev@gmail.com> # See LICENSE file. from os import path from pytest import raises from _sadm.errors import EnvError, ServiceError from _sadm.plugin import service def test_defaults(testing_env): env = testing_env(name = 'service', profile = 'plugin') assert env.name() == 's...
""" Module for serving static files. """ from flask import send_from_directory def serve_index(): """ Serves `index.html` for root endpoints. """ return send_from_directory('../client', 'index.html') def serve_files(path): """ Serves files using the path provided. Args: path (st...
# ---------------------------------------------------------------------- # | # | FilenameTypeInfo_UnitTest.py # | # | David Brownell <db@DavidBrownell.com> # | 2018-04-23 00:04:03 # | # ---------------------------------------------------------------------- # | # | Copyright David Brownell 2018....
import itertools # [Name, P, S, Q, I] # TODO bis 18.5.2018 # install pip more-itertools # Restliche Geräte messen # Skript schreiben um Median zu berechnen # Einzelne Geräte in CSV erfassen mit folgender Struktur: 'Gerätename', Median(P), Median(S), Median(Q), Median(I) # Geräte: Wasserkocher, Toaster, Haarfön, Stabm...
from flask import render_template,redirect,url_for,flash,request from ..models import User,Blog,Subscriber from .forms import RegistrationForm,LoginForm,SubscriberForm from flask_login import login_user,logout_user,login_required,current_user from . import auth from .. import db from ..email import mail_message @auth....
""" Copyright (c) Facebook, Inc. and its affiliates. """ from attribute_helper import AttributeInterpreter, maybe_specific_mem from memory_filters import ( MemoryFilter, FixedMemFilter, BasicFilter, ApplyAttribute, CountTransform, ExtremeValueMemorySelector, ) from comparator_helper import inter...
from unittest import TestCase from stubsGenerator import generator from stubsGenerator import pasta2 as pasta import os path = r"C:\Projects\QuantConnect\JoeYuZhou\ironpython-stubs\release\stubs\QuantConnect" class Test(TestCase): def test_generate(self): generator.generate(path, keep_partial=False, parti...
""" ASGI config for eduvibeapi 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.setdefault('DJANGO_SE...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import typing from typing import Any from typing import Dict from typing import List from typing import Optional from typing import Text from rasa_nlu.co...
""" WSGI config for CloudMusic project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_S...
# -*- coding: utf-8 -*- ######################################################################### ## This scaffolding model makes your app work on Google App Engine too ## File is released under public domain and you can use without limitations ######################################################################### ...
# 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. # --------------------------------------------------------------------...
""" Digita endpoint. You must declare environment variable DIGITA_URL to activate this plugin. """ import os import json import logging import binascii import dateutil import pytz from django.conf import settings from django.conf.urls import url from django.http import HttpResponse from django.views.decorators.csrf ...
import matplotlib.pyplot as plt import os import torch class EvaluateTask: def __init__(self, mantra_model): if mantra_model.task: mantra_model.task.latest_loss = mantra_model.task.evaluate(mantra_model) print('%s: %s' % (mantra_model.task.evaluation_name, mantra_model.task.late...
# -*- coding: utf-8 -*- """ Created on Mon Jan 15 22:07:53 2018 @author: dye """ import matplotlib.pyplot as plt decisionNode = dict(boxstyle="sawtooth", fc="0.8") leafNode = dict(boxstyle="round4", fc="0.8") arrow_args = dict(arrowstyle="<-") def plotNode(nodeTxt, centerPt, parentPt, nodeType): createPlot.ax1....
# Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy.testing import assert_allclose from astropy.time import TimeDelta, Time from ..time import ( time_ref_from_dict, time_ref_to_dict, time_relative_to_ref, absolute_time, ) def test_time_ref_from_dict(): d = dict(MJDREFI=51910...
import numpy as np import scipy import cv2 def cycle(iterable): while True: for x in iterable: yield x def evaluate_pose(E, P): R_gt = P[:3, :3] t_gt = P[:3, 3] R1, R2, t = cv2.decomposeEssentialMat(E) t = t.squeeze() theta_1 = np.linalg.norm(scipy.linalg.logm(R1.T.dot(R_...
""" TensorFlow Layers Convenience functions but Input and Output should be tensors. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow.contrib import seq2seq _phase = tf.Variable(False, name='phase', trainable=Fals...
#!/usr/bin/env python # Copyright (C) 2006 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser Ge...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the fundrawtransaction RPC.""" from decimal import Decimal from test_framework.test_framework imp...
# -*- coding: utf-8 -*- # # Copyright (C) 2022 CERN. # # Invenio-Requests is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Request views decorators module.""" from functools import wraps from flask import g from invenio_requests...
import os import tempfile import shutil from xml.etree import ElementTree as ET from django.test import TransactionTestCase from django.core.files.uploadedfile import UploadedFile from django.contrib.auth.models import Group from django.db import IntegrityError from hs_core import hydroshare from hs_core.hydroshare ...
# # 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 us...
from haystack import indexes from oscar.core.loading import get_class, get_model # Load default strategy (without a user/request) is_solr_supported = get_class('search.features', 'is_solr_supported') Selector = get_class('partner.strategy', 'Selector') class ProductIndex(indexes.SearchIndex, indexes.Indexable): ...
import os import sys import json import pickle import hashlib import traceback import cclib import openbabel.pybel as pybel import numpy as np import openbabel as ob import scipy.sparse as sp import sklearn.preprocessing # constants CstBohr2Ang = 0.52917721092 CstHartree2eV = 27.21138505 CstHartree2cm1 = 219474.63137...
import pymc3 as pm from .helpers import SeededTest import numpy as np import theano class TestShared(SeededTest): def test_deterministic(self): with pm.Model() as model: data_values = np.array([.5, .4, 5, 2]) X = theano.shared(np.asarray(data_values, dtype=theano.config.floatX), bo...
################################################################### # File Name: feeder.py # Author: Zhongdao Wang # mail: wcd17@mails.tsinghua.edu.cn # Created Time: Thu 06 Sep 2018 01:06:16 PM CST ################################################################### from __future__ import print_function from __future_...
import pytest from selenium import webdriver from methods import litecart @pytest.fixture def wd(request): wd = webdriver.Chrome() request.addfinalizer(wd.quit) return wd def test_links(wd): litecart.login_to_admin(wd) litecart.check_links_on_country_page(wd) litecart.logout_from_admin(wd)
#!/usr/bin/python3 -i # # Copyright (c) 2017 The Khronos Group Inc. # Copyright (c) 2017 Valve Corporation # Copyright (c) 2017 LunarG, Inc. # # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Yo...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="secret-key-generator", version="0.0.7", author="Kirill Sayed", author_email="sayed.kirill@gmail.com", description="Package for secret key generation in Django framework.", long_descrip...
# -*- coding: utf-8 -*- import re def replace(input): output = input output = input output = output.replace(u'\u004F', u'\u1025') # u output = output.replace(u'\u00CD', u'\u1009') # nya-lay output = output.replace(u'\u00DA', u'\u1009') # #####Consonent output = output.replace(u'\u0075'...
# Copyright (C) 2020 Adek Maulana. # All rights reserved. # # Licensed under the Raphielscape Public License, Version 1.d (the "License"); # you may not use this file except in compliance with the License. # """Heroku manager for your userbot""" import codecs import heroku3 import aiohttp import math import os import ...
# coding=utf-8 # Copyright 2022 The Google Research 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...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import print_function import os import re from astropy.table import Table from astropy.tests.helper import pytest import astropy.coordinates as coord import astropy.units as u from ...utils.testing_tools import MockResponse from ... imp...
from tastypie.authorization import Authorization from tastypie.exceptions import Unauthorized class CustomAuthorization(Authorization): def read_list(self, object_list, bundle): # This assumes a ``QuerySet`` from ``ModelResource``. print(bundle.request.user) return object_list ...
import datetime from app import db, ma user_contact = db.Table( "user_contact", db.Column("user_id", db.Integer, db.ForeignKey("users.id"), primary_key=True), db.Column("contact_id", db.Integer, db.ForeignKey("users.id"), primary_key=True), db.Column("created_at", db.DateTime, default=datetime.datetime...
#!/usr/bin/python from __future__ import absolute_import, division, print_function # Copyright 2019-2020 Fortinet, Inc. # # 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 the ...
from .user import User from .measurement import Measurement, FrequencyMeasurement, FrequencyMeasurementDaily from .plan import Plan, PlanEntry
# orm/persistence.py # Copyright (C) 2005-2022 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php """private module containing functions used to emit INSERT, UPDATE and DELETE st...
""" Compute the principal eigenvector of a matrix using power iteration. See also numpy.linalg.eig which calculates all the eigenvalues and eigenvectors. """ from typing import Tuple import numpy def _normalise(nvec: numpy.ndarray) -> numpy.ndarray: """Normalises the given numpy array.""" with numpy.errsta...
# 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 ...
# 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 ...
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from mininode import * from blockstore import BlockStore, TxStore from util import p2p_port ''' This is a tool for comparing two or more drivercoinds ...
A = float(input("")) B = float(input("")) media = ((A * 3.5) + (B * 7.5))/11 print("MEDIA = {:.5f}".format(media))
"""Create the dataset.csv from some test morphologies.""" from pathlib import Path import pandas as pd if __name__ == "__main__": dataset = pd.DataFrame(columns=["morph_path", "mtype"]) dataset.index.name = "morph_name" morph_path = Path("morphologies") for morph in morph_path.iterdir(): if mo...
from sys import path from django.conf.urls import url #from django.conf.urls import views #from . import views from vtapp import views from django_filters.views import FilterView urlpatterns = [ url(r'^$',views.index, name='index'), url(r'ajout/',views.ajout, name='ajout'), url(r'consulter/',views.consult...
# Copyright 2017 Google 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 # # Unless required by applicable law or a...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspa...
# -*- coding: utf-8 -*- """Tools to compute KnowledgeGradient and optimize the next best point(s) to sample using KG through C++ calls. This file contains a class to compute Knowledge Gradient + derivatives and a functions to solve the q,p-KG optimization problem. The :class:`moe.optimal_learning.python.cpp_wrappers.k...
# The MIT License (MIT) # Copyright (c) 2018 Massachusetts Institute of Technology # # Author: Cody Rude # This software has been created in projects supported by the US National # Science Foundation and NASA (PI: Pankratius) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this sof...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Michael Still # 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/l...
import os from os.path import join import shutil import subprocess import numpy.random as npr import numpy as np import scipy.stats from dipy.io.image import load_nifti, save_nifti from dipy.io import read_bvals_bvecs from dipy.segment.mask import median_otsu from dipy.reconst.csdeconv import ConstrainedSphericalDecon...
# 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 __future__ import print_function import sys from io import StringIO import os import csv import json import numpy as np import pandas as pd from sklearn.externals import joblib from sagemaker_containers.beta.framework import ( content_types, encoders, env, modules, transformer, worker) feature_columns_name...
# ---------------------------------------------------------------------------- # CLASSES: nightly # # Test Case: bestfit.py # # Tests: queries - "Best Fit Line" # expressions - distance_to_best_fit_line # # Defect ID: none # # Programmer: Brad Whitlock # Date: Fri Nov 18 16:43:42 PST...
import warnings import re import collections import importlib if importlib.util.find_spec("pandas") is not None: import pandas as pd from xbrr.base.reader.base_parser import BaseParser from xbrr.edinet.reader.element_value import ElementValue class Finance(BaseParser): def __init__(self, reader): tag...
import os import requests # pip install requests # The authentication key (API Key). # Get your own by registering at https://app.pdf.co API_KEY = "******************************************" # Base URL for PDF.co Web API requests BASE_URL = "https://api.pdf.co/v1" # Source PDF file SourceFile = ".\\sample.pdf" # PD...
# Copyright 2021 Huawei Technologies Co., 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 applicable law or agreed to...
# Copyright ClusterHQ Inc. See LICENSE file for details. """ Tests for ``flocker.testtools``. """ from subprocess import CalledProcessError from flocker.testtools import run_process, TestCase class RunProcessTests(TestCase): """ Tests for ``run_process``. """ def _failing_shell(self, expression): ...
import re import os from typing import Optional, Pattern, Match from ..mark import Mark from ..targets.file_target import FileTarget, ContentType from ..utils import camel_to_snake from .finder import BaseFinder class RailsLogControllerFinder(BaseFinder): """ From a text that looks like this `Processing by Or...
# This file is automatically generated by the rmf-codegen project. # # The Python code generator is maintained by Lab Digital. If you want to # contribute to this project then please do not edit this file directly # but send a pull request to the Lab Digital fork of rmf-codegen at # https://github.com/labd/rmf-codegen ...
import time from robworld.RobotEPuck import RobotEPuck """ Robot thymio2: Sensores de Proximidad: 0: frontal izquierdo izquierdo 1: frontal izquierdo 2: frontal frontal 3: frontal derecho 4: frontal derecho derecho 5: trasero izquierdo 6: trasero derecho ...
# Import packages import pandas from mbc import learn_mbc_cll, learn_mbc_generative, l_bfgs from export import get_adjacency_matrix_from_et from var_elim import PyFactorTree from data_type import data as datat # Load ASIA dataframe file_name = "data/asia.csv" data = pandas.read_csv(file_name) var_classes = [['yes','no...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os import subprocess import sys import threading import unittest from concurrent.futures import ThreadPoolExecutor, as_completed from maro.communication import Proxy, SessionMessage, dist from utils import get_random_port, proxy_generato...
# Copyright (c) Facebook, Inc. and its affiliates. from copy import deepcopy import torch from mmf.common.registry import registry from mmf.models.base_model import BaseModel from mmf.modules.encoders import MultiModalEncoderBase from mmf.utils.build import build_classifier_layer class UnimodalBase(MultiModalEncode...
""" molecool A Python package for analyzing and visualizing xyz files """ # Add imports here --> note the star allows you to do all functions from .functions import canvas from .measure import calculate_distance, calculate_angle from .visualize import draw_molecule, bond_histogram from .molecule import build_bond_list...
from cctool.common.lib import default_visualization from cctool.common.enums import ( ConnectionOption, MapColours, ) from cctool.graphs.models import ( NodePlus ) def generate_graph_options(): graph_options = default_visualization.generate_graph_options() graph_options['layout'].pop('randomSeed')...
""" Copyright (c) 2019-2020 Uber 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 agreed to in...
import pickle import time import os import shutil def main(): s = Setup() s.startup() s.main_loop() class Setup: def __init__(self): self.WORKINGDIR = os.path.dirname(os.path.realpath(__file__)) self.ROAMINGDIR = os.getenv('APPDATA') self.APPDATADIR = os.path.join(self.ROAM...
##### # # This class is part of the Programming the Internet of Things project. # # It is provided as a simple shell to guide the student and assist with # implementation for the Programming the Internet of Things exercises, # and designed to be modified by the student as needed. # import logging from time import s...
import socket import sys from io import BytesIO from opendis.DataOutputStream import DataOutputStream from opendis.dis7 import EntityStatePdu data_in = " ".join(sys.argv[1:]) udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) def send_dis(host, port): pdu = EntityStatePdu() # Entity ID pdu....
# Generated by Django 3.2.2 on 2021-10-04 14:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("memberbucks", "0003_auto_20210427_1500"), ] operations = [ migrations.AlterField( model_name="memberbucks", name="id...
# Copyright (c) OpenMMLab. All rights reserved. import torch import torch.nn as nn from einops import rearrange from mmcv.cnn import build_norm_layer, constant_init from mmcv.cnn.bricks.registry import ATTENTION, FEEDFORWARD_NETWORK from mmcv.cnn.bricks.transformer import FFN, build_dropout from mmcv.runner.base_module...
# 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 ...
from . import session_api import tornado.gen @session_api(direct=True) async def sleep(delay, handler=None): await tornado.gen.sleep(delay) @session_api(direct=True) async def moment(handler=None): await tornado.gen.moment
import os from azul import config, require from azul.template import emit expected_component_path = os.path.join(os.path.abspath(config.project_root), 'terraform', config.terraform_component) actual_component_path = os.path.dirname(os.path.abspath(__file__)) require(os.path.samefile(expected_component_path, actual_co...
import numpy as np import tensorflow as tf def evaluate_voxel_prediction(predictions, gt, threshold=1): """ Calculate metrics based on the output of model Args: predictions: the ouput of voxel decoder gt: the ground truth of object Returns: """ predtions_occupy = predictions >=...
from common import profile from util import RepeatTimer, default_timer class DigsbyBot(RepeatTimer): def __init__(self, seconds=60, max_emails=24, max_email_time=60*60*4): self.seconds = seconds self.max_emails = max_emails self.max_email_time = max_email_time self.errorno =...
r"""Mobjects representing matrices. Examples -------- .. manim:: MatrixExamples :save_last_frame: class MatrixExamples(Scene): def construct(self): m0 = Matrix([[2, 0], [-1, 1]]) m1 = Matrix([[1, 0], [0, 1]], left_bracket="\\big(", ...
import unittest from letter_n_gram_list import letter_n_gram_list from inc_freq import inc_freq class TestLetterNGramList(unittest.TestCase): def test_letter_n_gram_list(self): ss = [ "今日は", "今日は", "今日は", "今日は", "abcd", "abcd", ...
import numpy as np import pandas as pd import re import math from typing import Union def get_all_entity(tuples: list) -> list: entities = [] for _tuple in tuples: if _tuple[1] in ["类型", "产地", "生产时间(s)"]: if not "公式" in _tuple[0]: entities.append(_tuple[0]) else: ...
# Copyright 2019 Open Source Robotics Foundation, 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...
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import pytest import sys from sys import platform from pathlib import Path from threading import Event, Thread from time import sleep, time from queue import Queue from openvino.inference_engine import IENetwork, IECore, Execu...
import os import sys from robotframework_ls.impl.robot_lsp_constants import ( ENV_OPTION_ROBOT_LSP_DEBUG_PROCESS_ENVIRON, ENV_OPTION_ROBOT_LSP_DEBUG_MESSAGE_MATCHERS, ) def _is_true_in_env(env_key): return os.getenv(env_key, "") in ("1", "True", "true") class Options(object): tcp = False host =...
import os import pandas as pd import biom from copy import deepcopy from microsetta_public_api.exceptions import ConfigurationError from skbio.stats.ordination import OrdinationResults from qiime2.core.type.grammar import TypeExp from qiime2 import Artifact, Metadata from qiime2.metadata.io import MetadataFileError fro...
#!/usr/bin/env python3 # encoding: utf-8 import sys import wave scp = sys.argv[1] dur_scp = sys.argv[2] with open(scp, 'r') as f, open(dur_scp, 'w') as fout: cnt = 0 for l in f: items = l.strip().split(' ') wav_id = items[0] fname = items[1] cnt += 1 with wave.open(fnam...
# Generated by Django 2.2.4 on 2019-08-10 19:19 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='BlogPost', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=F...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from future.builtins.disabled import * import re import os from ._guest_common import * class GuestDownload(GuestCommand): def __init__(self, *args, **kwargs): supe...
''' Objective: 1. to crop the images to 30x30 2. convert to grayscale 3. Apply Gaussian Blur 4. Apply dilation 5. Apply some kind of mask? (Why?) ''' import os import cv2 import numpy as np # This is the path from root directory to this project PATH = "/home/pallab/gestures-cnn/raw-data/" IMG_DIR = "/home/pallab/ges...
import pytest from diofant import (Derivative, Dummy, E, Ei, Eq, Float, Function, I, Integer, Integral, LambertW, Matrix, Mul, O, Piecewise, Rational, RootOf, Subs, Symbol, acos, acosh, asin, asinh, atan, cbrt, cos, diff, dsolve, erf, erfi, exp, log, oo, p...
#!/usr/bin/env python # coding: utf-8 # In[1]: #Estabelecendo conexão e requisitando a página que onde os dados estão import urllib3 url = 'https://www.br.undp.org/content/brazil/pt/home/idh0/rankings/idhm-uf-2010.html' conexao = urllib3.PoolManager() retorno = conexao.request('GET',url) #Iniciando a manipulação do...
"""Utilities that depend on Tensorflow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf # adapts batch size in response to ResourceExhaustedErrors class RobustPredictor(object): """A wrapper for predictor fun...
"""Script which verifies that all source files have a license header. Has two modes: 'fix' and 'check'. 'fix' fixes problems, 'check' will error out if 'fix' would have changed the file. """ import os import re import sys import datetime from itertools import chain from typing import Iterator, List GIT = 'https://g...
# 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 from .. import _utilitie...
# This program is free software: you can redistribute it and/or modify it under the # terms of the Apache License (v2.0) as published by the Apache Software Foundation. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or...
# 字符串匹配 # 1.朴素的字符串匹配;2.KMP算法 # 朴素的字符串匹配 def naive_amtching(t, p): m, n = len(p), len(t) i, j = 0, 0 while i < m and j < n: if p[i] == t[j]: i, j = i + 1, j + 1 else: i, j = 0, j - i + 1 if i == m: return j - i return -1 ...
""" Revision ID: 101b182bd0ce Revises: 3aecef07d21a Create Date: 2020-07-15 15:13:13.020740 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '101b182bd0ce' down_revision = '3aecef07d21a' branch_labels = None depends_on = None def upgrade(): # ### commands ...