text stringlengths 2 999k |
|---|
from .coil_dataset import CoILDataset
from .coil_sampler import BatchSequenceSampler, RandomSampler, PreSplitSampler
from .augmenter import Augmenter
from .splitter import select_balancing_strategy |
import os.path
import paramiko
import logging
from sys import stderr
"""
EteGatherDataListener implements the ROBOT listener API version 2 and is
instantiated via the robot cammmand line option
--listener EteGatherDataListener:<jobbumber>:<key filename>
The purpose is to gather and preserve debugging data from ea... |
# ----------------------------------------------------------------------
# Copyright (c) Microsoft Corporation.
# All rights reserved.
# ----------------------------------------------------------------------
import json
import unittest
import unittest.mock as mock
import random
from tests.common import async_test
fr... |
import urllib.request
import requests
import json
import time
import os
import datetime
import shutil
import subprocess
from sys import stdout
from config import *
# Test notifications when printer disconnects while printing
# Add ability to change sound per notification type
# Add link for timelapse folder?
# Add in... |
"""
pygments.lexers.grammar_notation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for grammar notations like BNF.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, include, this, us... |
import torch
#Nota bene: In training, the average of losses in each batch is returned.
#In testing, this is not the case.
def loss_enc(z_code, z_code_hat, test):
if(test):
l_enc = torch.sum((z_code - z_code_hat)**2, dim=(1))
else:
l_enc = torch.sum((z_code - z_code_hat)**2, dim=(1))... |
from django.shortcuts import render
from django.views.generic import ListView, DetailView
from .models import Reservation
class ReservationList(ListView):
"""Lists all the reservations"""
model = Reservation
template_name = 'reservations/reservation_list.html'
class ReservationDetails(DetailView):
... |
# 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 u... |
from nltk.tag import TaggerI
import spacy.tokens
class SpacyTagger(TaggerI):
def __init__(self):
super(SpacyTagger, self).__init__()
self.nlp = spacy.load('en_core_web_sm', disable=['parser', 'ner'])
def tag(self, tokens):
doc = spacy.tokens.doc.Doc(self.nlp.vocab, words=tokens)
... |
import json
import logging
logger = logging.getLogger(__name__)
class MallCop:
async def verify_node(self, node):
return True
async def verify_controller(self, controller):
return True
async def verify_msg(self, msg):
return msg
async def verify_directive(self, directive):... |
# Copyright (C) 2020 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""This module contains constants used for integration tests only."""
FLAG_VALIDATORS = (
('FALSE', False),
('False', False),
('false', False),
(' false ', False),
('TRUE', True),
... |
import sys
import click
import pkg_resources
from nb_cli.commands.plugin import plugin
from nb_cli.commands.main import run, init
from nb_cli.utils import ClickAliasedGroup
from nb_cli.commands.adapter import adapter
from nb_cli.handlers import handle_no_subcommand
from nb_cli.commands.deploy import exit, build, depl... |
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F, Y'
TIME_FORMAT = 'g:i A'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'... |
# 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... |
# Copyright (c) 2020 Jeff Irion and contributors
#
# This file is part of the adb-shell package. It incorporates work
# covered by the following license notice:
#
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ex... |
import torch
import numpy as np
import fenics as df
class ROM(object):
def __init__(self, physics, M, dtype, device):
self.M = M
self.dtype = dtype
self.device = device
self._bc_dofs = torch.tensor(physics.constrained_dofs.copy(), dtype=torch.long, device=device)
self._f... |
from amuse.units import units
from amuse.community.evtwin.interface import EVtwin
from amuse.ext.star_to_sph import convert_stellar_model_to_SPH
from amuse.datamodel import Particle
def convert_star_to_hydro_model(M, t_end):
stellar_evolution = EVtwin()
star = stellar_evolution.particles.add_particle(Particle(... |
from netapp.netapp_object import NetAppObject
class VolumeIdAttributes(NetAppObject):
"""
Identification information about a volume.
"""
_comment = None
@property
def comment(self):
"""
A description for the volume. Range:[0..1023]
<p>
Attributes: optional-f... |
# BioPandas
# Author: Sebastian Raschka <mail@sebastianraschka.com>
# License: BSD 3 clause
# Project Website: http://rasbt.github.io/biopandas/
# Code Repository: https://github.com/rasbt/biopandas
#
#
#
#
# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
#
# Generic release mark... |
# Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
#
# 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... |
from tkinter import Tk, LabelFrame, Entry, Button, Label, Checkbutton, IntVar, END
from time import sleep
import webbrowser
class Gui(Tk):
def __init__(self):
super().__init__()
self.title("Quick Web Search")
self.geometry("+1000+300")
self.search_engines = {
"Google":... |
from flask import Flask
from flask_login import LoginManager
import os
#create app
app = Flask(__name__)
app.debug=True
SECRET_KEY = os.urandom(32)
app.config['SECRET_KEY'] = SECRET_KEY
# Please note this is not at the top and is after creating "app"
from app import routes
#init LoginManager for app
... |
import struct
def get_arch(path):
'''
Get the arch of the binary.
Args:
path (str): The absolute/relative path to the binary.
Returns:
str: the arch of the binary, 32 or 64.
Raises:
NotImplememtedError: if the arch is not x86 or x64.
Examples:
>>> print(get_arch... |
from .utils import load_config, date_feats, reduce_mem_usage
|
''' deletemove module
'''
from DPlanner import selectCandidateDeleteComps
|
_base_ = ["./FlowNet512_1.5AugCosyAAEGray_Flat_Pbr_01_ape.py"]
OUTPUT_DIR = "output/deepim/lmPbrSO/FlowNet512_1.5AugCosyAAEGray_Flat_lmPbr_SO/can"
DATASETS = dict(TRAIN=("lm_pbr_can_train",), TEST=("lm_real_can_test",))
# bbnc10
# objects can Avg(1)
# ad_2 17.72 17.72
# ad_5 89.57 89.57
# ad_10 ... |
import requests
from Jumpscale import j
from .GiteaUserCurrentGpgKey import GiteaUserCurrentGpgKey
from .GiteaGpgKeys import GiteaGpgKeys
JSBASE = j.baseclasses.object
class GiteaUserCurrentGpgKeys(GiteaGpgKeys):
def new(self):
return GiteaUserCurrentGpgKey(self.client, self.user)
def get(self, id,... |
import json
import logging
import os
import re
import uuid
from collections import OrderedDict, namedtuple
from copy import deepcopy
from django.core.cache import cache
from django.db.models import Max
from django.http import Http404
from django.urls import reverse
from django.utils.translation import ugettext as _
i... |
#
# Copyright 2013 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 to in wr... |
from django.shortcuts import render, get_object_or_404, redirect
from django.views.generic import FormView, UpdateView, TemplateView, ListView, CreateView, DetailView
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.core.urlresolvers import rever... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['MovingAverage'] , ['Seasonal_Minute'] , ['MLP'] ); |
from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
"""Default user for aviata."""
#: First and last name do not cover name patterns around the globe
nam... |
from functools import partial
from langcodes import Language
from models import gcld3, langid, langdetect, pycld2, fasttext
BENCHMARKS = {
'fasttext': {
'run': partial(fasttext.run, model_path=fasttext.MODEL_BIN),
'measure_memory': partial(fasttext.measure_memory, model_path=fasttext.MODEL_BIN),
'suppo... |
# Copyright (C) 2022 Boba Birds Developers
#
# 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, publis... |
from explorerphatdashboard.api.explorerphat.connection import Connection
class Analog(object):
def __init__(self, id):
self._id = id
self._name = self._get_name_from_id(id)
def _get_name_from_id(self, id):
if id == 1:
return 'one'
if id == 2:
return ... |
NUMBERS = (12, 67, 98, 34)
print(f"The original list is : {NUMBERS}")
def sum_digits(array: list | tuple) -> int:
return sum(list(map(lambda i: sum(int(char) for char in str(i)), array)))
if __name__ == "__main__":
print(f"List Integer Summation : {sum_digits(NUMBERS)}")
|
from unittest import TestCase
from qcodes.tests.instrument_mocks import DummyInstrument
from qcodes.instrument.parameter import Parameter
import qcodes.utils.validators as vals
class TestSetContextManager(TestCase):
def setUp(self):
self.instrument = DummyInstrument('dummy_holder')
self.instrum... |
import mmcv
import numpy as np
import os.path as osp
from torch.utils.data import Dataset
from .pipelines import Compose
from .registry import DATASETS
@DATASETS.register_module
class CustomDataset(Dataset):
"""Custom dataset for detection.
Annotation format:
[
{
'filename': 'a.jpg',... |
#
# Copyright (C) 2018 S[&]T, The Netherlands.
#
from __future__ import absolute_import, division, print_function
from django.conf import settings
from django.conf.urls import url, include
from .routers import MuninnRouter
router = MuninnRouter()
for archive_name in settings.MUNINN.keys():
router.register_muni... |
'''
定义一个列表的操作类:Listinfo
包括方法:
1 列表元素添加:add_key(keyname)[keyname:字符串或者整数类型]
2 列表元素取值:get_key(num)[num:整数类型]
3列表合并:update_list(list)[list:列表类型]
4 删除并且返回最后一个元素:del_key()
'''
class Listinfo(object):
def
|
from flask import Blueprint
from flask import redirect, url_for, render_template, flash, request
from flask_breadcrumbs import register_breadcrumb, default_breadcrumb_root
from flask_login import current_user
from dashboards.appTracker.events.forms import NewEvent, EditEvent
from dashboards.appTracker.events.utils impo... |
def main():
digits = input("How Many Digits of Pi Would Like To See: ")
print("Here is " + digits + " digit(s) of Pi: ")
digits = int(digits)
if(digits > 1000000):
print("Sorry, we only support 1000000 digits right now.")
exit()
if(digits != 1):
digits = digits + 1
pi = open("pi.txt", "r")
print(pi.read(in... |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config():
SECRET_KEY = 'abcdefggknmlgb'
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data.sqlite')
SQLALCHEMY_TRACK_MODIFICATIONS = True |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import pytest
from indico.modules.events.persons.util import cre... |
def create_model(opt):
model = None
print(opt.model)
if opt.model == 'csa_net':
from .CSA import CSA
model = CSA()
else:
raise ValueError("Model [%s] not recognized." % opt.model)
model.initialize(opt)
print("model [%s] was created" % (model.name()))
return model
|
import setuptools
setuptools.setup(
name='mac-speech-cache',
version='2020.12.3',
install_requires=open('requirements.txt').read().splitlines(),
packages=setuptools.find_packages(),
scripts=['scripts/speech-cache']
)
|
# encoding: utf-8
# module System.Windows.Converters calls itself Converters
# from WindowsBase,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35
# by generator 1.145
""" NamespaceTracker represent a CLS namespace. """
# no imports
# no functions
# classes
class Int32RectValueSerializer(ValueS... |
"""
.. module: lemur.plugins.lemur_aws.sts
:platform: Unix
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
from functools import wraps
import boto
import boto.ec2.elb
import boto3
from fla... |
#########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... |
import pandas as pd
from sklearn.base import BaseEstimator
from hcrystalball.utils import check_X_y
from hcrystalball.utils import enforce_y_type
from hcrystalball.utils import check_fit_before_predict
from hcrystalball.utils import get_estimator_name
from hcrystalball.exceptions import DuplicatedModelNameError
clas... |
# -*- coding: utf-8 -*-
"""
This module is used to provide configuration, fixtures, and plugins for pytest.
It may be also used for extending doctest's context:
1. https://docs.python.org/3/library/doctest.html
2. https://docs.pytest.org/en/latest/doctest.html
"""
import pytest
@pytest.fixture(autouse=True)
def _m... |
# Copyright 2020 Broadband Forum
#
# 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 writi... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import inspect
import textwrap
from pyiron.base.job.generic import GenericJob
"""
The GenericMaster is the template cla... |
from django.urls import path
from {{ cookiecutter.project_slug }}.test_app.views import home_page_view
app_name = "users"
urlpatterns = [
path("", view=home_page_view, name="home"),
]
|
# Copyright 2019 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 agree... |
from typing import Tuple
class UnixGroup:
def __init__(self, name: str, id_: int, members: Tuple[str] = ()):
self._name = name
self._id = id_
self._members = members
@property
def name(self) -> str:
return self._name
@property
def id(self) -> int:
return ... |
"""
This module contains helpers/fixtures to assist in testing Fabric-driven code.
It is not intended for production use, and pulls in some test-oriented
dependencies such as `mock <https://pypi.org/project/mock/>`_. You can install
an 'extra' variant of Fabric to get these dependencies if you aren't already
using the... |
#!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.qtumcash import *
from test_framework.blocktools import *
from test_framework.key import *
import io
impo... |
import pytest
from django.test import RequestFactory
from q_n_a.users.api.views import UserViewSet
from q_n_a.users.models import User
pytestmark = pytest.mark.django_db
class TestUserViewSet:
def test_get_queryset(self, user: User, rf: RequestFactory):
view = UserViewSet()
request = rf.get("/fa... |
import os.path
import random
import torchvision.transforms as transforms
import torch
import torch.utils.data as data
from data.image_folder import make_dataset
from PIL import Image
class AlignedDataset(data.Dataset):
def __init__(self, opt):
# super(AlignedDataset,self).__init__(opt)
self.opt = o... |
"""
Consolidate Services
Description of all APIs # noqa: E501
The version of the OpenAPI document: version not set
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import argocd_python_client
from argocd_python_client.model.cluster_connector import ClusterConnector
globa... |
# This program is placed into the public domain.
"""
Gets the current version number.
If in a git repository, it is the current git tag.
Otherwise it is the one contained in the PKG-INFO file.
To use this script, simply import it in your setup.py file
and use the results of get_version() as your package version:
f... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
# TestMainExecutable.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2019 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS... |
import taichi as tc
from math import *
from random import *
from async_mpm import AsyncMPM
r = 300
task_id = 'combo'
Async = True
if __name__ == '__main__':
res = (r, r, r)
if Async:
mpm = AsyncMPM(
res=res,
particle_collision=False,
optimized=True,
verbose_bgeo=True,
... |
import math
import warnings
from typing import List
from torch.optim import Optimizer
from torch.optim.lr_scheduler import _LRScheduler
class WarmupCosineLR(_LRScheduler):
"""
Sets the learning rate of each parameter group to follow a linear warmup schedule
between warmup_start_lr and base_lr followed by... |
#!/usr/bin/env python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
"""
ASGI config for api 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.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_... |
from __future__ import annotations
from typing import List, Literal, Optional, TypeVar
import networkx as nx
import numpy as np
import torch
from graphein.utils.utils import import_message
try:
from torch_geometric.data import Data
except ImportError:
import_message(
submodule="graphein.ml.conversio... |
# -*- coding:utf-8 -*-
# @Time: 2021/1/30 11:40
# @Author: Zhanyi Hou
# @Email: 1295752786@qq.com
# @File: autocomp.py
import re
import time
import logging
from qtpy.QtCore import QThread, Signal
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class AutoCompThread(QThread):
'''
当一段时间没有补全需... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 0, transform = "Anscombe", sigma = 0.0, exog_count = 100, ar_order = 12); |
r"""simple is a module for using paraview server manager in Python. It
provides a simple convenience layer to functionality provided by the
C++ classes wrapped to Python as well as the servermanager module.
A simple example::
from paraview.simple import *
# Create a new sphere proxy on the active connection and ... |
from setuptools import setup
from rfh.version import __version__
desc = "Rofi helpers for tmux, tuya, ..."
setup(
name="rfh",
version=__version__,
description=desc,
author="Rares Cosma",
author_email="rares@getbetter.ro",
keywords="rofi tmux tuya alacritty i3 manage switch",
packages=["rfh... |
from ..tokens import py2toml, toml2py
from ..util import is_dict_like, is_sequence_like
from . import common
from .errors import InvalidElementError
class AtomicElement(common.TokenElement):
"""
An element containing a sequence of tokens representing a single atomic value that can be updated in place.
Ra... |
# 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 ... |
from .insight import InsightObject
|
"""Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2020 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... |
import os
import time
import numpy as np
import tensorflow as tf
import cv2
import sys
sys.path.append('../')
from model.lat_net import *
from model.loss import *
from model.lattice import *
from utils.experiment_manager import *
from tqdm import *
import matplotlib
import matplotlib.pyplot as plt
FLAGS = tf.app.... |
>>> from functools import partial
>>> Y = lambda f: partial(f, f)
>>> fib = lambda f, n: None if n < 0 else (0 if n == 0 else (1 if n == 1 else f(f, n-1) + f(f, n-2)))
>>> [ Y(fib)(i) for i in range(-2, 10) ]
[None, None, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
|
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import COMMASPACE, formatdate
import logging
import smtplib
from smtplib import SMTPException
class Mail:
def __init__(self, **kwargs):
server = kwargs.get('server', 'localhost')
self.server = smtpl... |
# Copyright 2019 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... |
# 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 appli... |
#!/usr/bin/env python
#
# Copyright 2012 The Closure Linter 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
#
#... |
"""
WSGI config for bigpicture 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/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... |
from mysql.connector.errors import ProgrammingError
from db import nova_conexao
sql = 'INSERT INTO contatos (nome, tel) VALUES (%s, %s)'
args = ('Danilo', '94955-2951')
with nova_conexao() as conexao:
try:
cursor = conexao.cursor()
cursor.execute(sql, args)
conexao.commit()
except Prog... |
"""Representation base class."""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import int
from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins ... |
class TooShort(Exception):
pass
class Stale(Exception):
pass
class Incomplete(Exception):
pass
class Boring(Exception):
pass
|
import importlib
import inspect
import os
import flask
import mercadopago
class App(flask.Flask):
def __init__(self):
super().__init__(__name__)
self.mp = mercadopago.SDK(os.environ["MERCADO_PAGO_ACCESS_TOKEN"])
self._load_blueprints()
def _load_blueprints(self):
for root, ... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import os
import tensorflow as tf
import math
from dataloader.pretrained_weights.pretrain_zoo import PretrainModelZoo
"""
r3det+gwd (only refine stage) + sqrt tau=2 + data aug. + ms + res152 + 6x + 5*256conv head
multi-scale+fli... |
#!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 la... |
# Copyright 2013: Mirantis 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 b... |
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
import os
'''
COLUMNS DEFINITION 1
======= ========== 1
1... |
from django.urls import path
from .views import IndexView
app_name = 'volunteer'
urlpatterns = [
path('', IndexView.as_view(), name='index'),
]
|
from tastypie.authentication import Authentication
class ConnectAuth(Authentication):
def __init__(
self,
scopes=[],
resource=None,
*args, **kwargs):
super(ConnectAuth, self).__init__(*args, **kwargs)
self.scopes = scopes #: required sco... |
# -*- 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutAsserts(Koan):
def test_assert_truth(self):
"""
We shall contemplate truth by testing reality, via asserts.
"""
#### self.assertTrue(False) # This should be true
self.assertTrue(True) # This... |
from setuptools import setup, find_packages
with open('README.rst', encoding='UTF-8') as f:
readme = f.read()
setup(
name='pgbackup',
version='0.1.0',
description='Database backups locally or to AWS S3.',
long_description=readme,
author='Robin Smorenburg',
author_email='robin@smorenburg.io... |
# Inter-key timings. Save Time32x32 and Time24x24 arrays in data/ files.
#Time32x32 = interkey_times32x32 + np.transpose(np.tri(32,32, -1) * interkey_times32x32)
#Time32x32 = np.ndarray.tolist(Time32x32)
#for times in Time32x32:
# times_strings = [str(np.int(x)) for x in times]
# print(','.join(times_strings))
... |
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from ..common._registration import register_converter
from ..common._topology import Scope, Operator
from ..common._container import ModelComponentContainer
from ..algebra.onnx_ops import (
OnnxConcat, OnnxReshapeApi13, OnnxIdentity)
try:
from ..algebra.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.