text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
"""
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
"""
from __future__ import unicode_literals
from ..model.body_type impo... |
"""Provide pre-made queries on top of the recorder component."""
from collections import defaultdict
from datetime import timedelta
from itertools import groupby
import json
import logging
import time
from typing import Optional, cast
from aiohttp import web
from sqlalchemy import and_, bindparam, func, not_, or_
from... |
import pydrs
import time
import struct
hradcVariant = ['HRADC-FBP','HRADC-FAX-A','HRADC-FAX-B','HRADC-FAX-C','HRADC-FAX-D']
def check_hradc_boarddata(drs,hradc_id):
print('\n######################################################################')
print('\nConfigurando placa ' + str(hradc_id+1) + ' em UFM mode... |
ASSIGNMENT 04
Student's Quest ID: j4mai
**** Testing Results **********************************************************
65/69 Total Mark
** Question 1: 14/14
** Question 2: 16/16
** Question 3: 28/32
** Question 4: 7/7
(Question 1, Test t01, 1 marks): ^apowers:base^a: Passed; passed.
(Question 1, Test t02, 1 ... |
from django.contrib.auth import authenticate, login, get_user_model
from django.http import HttpResponse
from django.shortcuts import render, redirect
from .forms import ContactForm, LoginForm, RegisterForm
from django.contrib.auth.models import User
def home_page(request):
context = {
"title" : "Hello Ho... |
"""
A near carbon copy of httpx.Auth adapted to work in the
framework of websockets.legacy.WebsocketClientProtocol
HTTPX Auth Source (Credit encode)
https://github.com/encode/httpx/blob/master/httpx/_auth.py
"""
from typing import AsyncGenerator, Generator
from .types import Request, Response
class Auth:
... |
# Generated by Django 2.2.10 on 2021-03-09 18:40
import apps.ingest.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ingest', '0007_merge_20210208_2009'),
]
operations = [
]
|
import tensorflow as tf
import numpy as np
from tensorflow.keras import Model, Sequential
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.layers import (Dense, Conv1D, Embedding, UpSampling1D, AveragePooling1D,
AveragePooling2D, GlobalAveragePooling2D, Activation, LayerNormalization, Dropou... |
import ctypes
import typing as tp
from datetime import date, datetime, timedelta, timezone
from typing import Any, Dict, Tuple, Union
import numpy as np
def _process_null_values(
null_values: Union[None, str, tp.List[str], Dict[str, str]] = None,
) -> Union[None, str, tp.List[str], tp.List[Tuple[str, str]]]:
... |
from functools import partial
from typing import Optional
import numpy as np
import pytest
from packaging.version import parse as version_parse
import aesara.scalar.basic as aes
from aesara.compile.function import function
from aesara.compile.mode import Mode
from aesara.compile.ops import DeepCopyOp, ViewOp
from aes... |
import pytest
@pytest.mark.parametrize('bytecount,expected_output', [
(1000, '1000b'),
(1024, '1kb'),
(10240, '10kb'),
(102400, '100kb'),
(1024*1024, '1mb'),
(1024*1024*512, '512mb'),
(1024*1024*1024, '1gb'),
(1024*1024*1024*512, '512gb'),
(1024*1024*1024*1024, '1tb'),
])
def test_... |
# Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ProcessPoolExecutor.
The follow diagram and text describe the data-flow through the system:
|======================= In-process =====================|== Out-of-process ==|
+----------+ +----------... |
import datetime
from unittest.mock import MagicMock
import pytest
from dynamo_query.data_table import DataTable
from dynamo_query.dynamo_table import DynamoTable, DynamoTableError
from dynamo_query.dynamo_table_index import DynamoTableIndex
from dynamo_query.expressions import ConditionExpression
@pytest.fixture
de... |
from django.contrib import admin
from . import models
# Register your models here.
@admin.register(models.Image)
class ImageAdmin(admin.ModelAdmin):
pass
@admin.register(models.Like)
class LikeAdmin(admin.ModelAdmin):
pass
@admin.register(models.Comment)
class CommentAdmin(admin.ModelAdmin):
pass |
from datetime import datetime
from decimal import Decimal
from unittest import mock
import unittest
import dbt.flags
from dbt.task import generate
class GenerateTest(unittest.TestCase):
def setUp(self):
dbt.flags.STRICT_MODE = True
self.maxDiff = None
self.manifest = mock.MagicMock()
... |
# 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... |
#/*
#(c) 2019 Hyland Software, Inc. and its affiliates. All rights reserved.
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#DISCLAIME... |
"""
Copyright 2020 Tianshu AI Platform. 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 ... |
"""
@Project : DuReader
@Module : lstm_sentiment.py
@Author : Deco [deco@cubee.com]
@Created : 5/17/18 4:33 PM
@Desc :
"""
import numpy as np
import tensorflow as tf
import os
file_dir = os.path.dirname(os.path.abspath(__file__))
fn_review = os.path.join(file_dir, 'data/reviews.txt')
fn_label = os.pat... |
from rpython.jit.backend.x86.test.test_basic import Jit386Mixin
from rpython.jit.metainterp.test.test_dict import DictTests
class TestDict(Jit386Mixin, DictTests):
# for the individual tests see
# ====> ../../../metainterp/test/test_dict.py
pass
|
from toolz import curry
import re
@curry
def test(pattern, string):
"""Determines whether a given string matches a given regular expression"""
return bool(re.search(pattern, string))
|
from snapshottest import snapshot
from werkzeug.datastructures import EnvironHeaders
import responses
import requests
import os
from lmsrvcore.tests.fixtures import fixture_working_dir_with_auth_middleware
class ContextMock(object):
"""A simple class to mock the Flask request context"""
def __init__(self, hea... |
'''_base_ = './cascade_rcnn_r50_fpn_1x_coco.py'
model = dict(
pretrained='open-mmlab://resnext101_32x4d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type... |
# Copyright 2018-2020 Streamlit 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... |
# 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
# distributed under the... |
from typing import Any, Dict
RawObject = Dict[str, Any]
|
# 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, overload
from ... import _utilities
__... |
# Copyright (c) 2014-2018 Sine Nomine Associates
#
# 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 notice, this
# list of conditions and the followi... |
import asyncio
from envoy_local_reader.envoy_reader_factory import EnvoyReaderFactory
factory = EnvoyReaderFactory("envoy.local")
loop = asyncio.get_event_loop()
r = loop.run_until_complete(factory.get_reader())
d = loop.run_until_complete(r.get_data())
print(d)
|
# 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... |
import json
from collections import OrderedDict
from datetime import date, datetime, timedelta
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.db.models import Q, Sum
from django.template import loader
from django.utils.translation import ugettext, ugettex... |
import numpy as np
from collections import namedtuple
from scipy import ndimage
Point = namedtuple('Point', 'x y')
array = np.array([[1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],
[1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0]])
# print(array)
# index,uniques = np.unique(array,return_i... |
import asyncio
import errno
import logging
import os
import shutil
import threading
import uuid
import warnings
import weakref
from contextlib import suppress
from inspect import isawaitable
from multiprocessing.queues import Empty
from time import sleep as sync_sleep
import psutil
from tornado import gen
from tornado... |
"""
WSGI config for datascience 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/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... |
from __future__ import absolute_import, division, print_function
import numpy as np
import pytest
from ..obsbandpass import ObsBandpass
@pytest.mark.remote_data
def test_err_col():
"""Test that this obsmode does not raise exception."""
obs = ObsBandpass('stis,ccd,50ccd,mjd#55000')
assert np.any(obs.thro... |
from nltk.corpus import wordnet as wn
import numpy as np
from nltk import word_tokenize
import utils.name_convention as name
from exceptions import Exception
from Queue import Queue
class DuplicationKey(Exception):
def __init__(self, message=""):
print "Keys are duplicated."
print message
class ... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
load BJ Data from multiple sources as follows:
meteorologic data
"""
from __future__ import print_function
import os
import pickle
from copy import copy
import numpy as np
import h5py
from tfpredictor.preprecessing.loadh5file import ... |
import sys
s = sys.stdin.readline().rstrip()
def main():
l = len(s)
if l & 1:
return 'No'
if s == 'hi' * (l // 2):
return 'Yes'
else:
return 'No'
if __name__ == '__main__':
ans = main()
print(ans)
|
# -*- coding: utf-8 -*-
"""
This module defines built-in evaluation functions for segmentation applications
Segmentations can be evaluated at several scales:
'foreground' refering to metrics computed once for a foreground label
'label' refering to metrics computed once for each label (including background)
'cc' referr... |
#originally inspired by http://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html ,
#but substantially modified from that
import numpy as np
from sklearn import datasets, linear_model
from sklearn.cross_validation import cross_val_score, KFold
import csv
#Load the data
#TODO: allow loading from an arb... |
"""
This file is responsible for sending multilingual mails.
When multiple templates are available, RFC8255_ must be commonly adopted.
As this, at the time of writing, RFC8255_ is not yet commonly adopted, so only
one language per email must be specified.
.. _RFC8255: https://tools.ietf.org/html/rfc8255
"""
import os... |
import graphene
import graphql_jwt
from . import mixins
from .testcases import GraphQLSchemaTestCase
class ObtainJSONWebTokenTests(mixins.ObtainJSONWebTokenTestsMixin,
GraphQLSchemaTestCase):
class Mutations(graphene.ObjectType):
token_auth = graphql_jwt.relay.ObtainJSONWe... |
# -*- coding: utf-8 -*-
import time
import numpy as np
import pandas as pd
import statsmodels.api as sm
from sklearn.linear_model import LinearRegression as lr
from dramkit.logtools.utils_logger import logger_show
#%%
def get_exp_decay_weight(n, adjust=True, logger=None, **kwargs):
'''
计算指数衰减权重序列
| ... |
from collections import defaultdict
import json
def collect_autologistic_results(file_paths):
results = defaultdict(list)
for file_path in file_paths:
jdata = None
with open(file_path, 'r') as f:
jdata = json.load(f)
if jdata is None:
continue
feature = ... |
import pytest
from mingle.utilities.db_utils import DBExtractor
class metadata():
pass
class FakeTable():
def __init__(self):
self.metadata = metadata()
self.metadata.bind = 5
@pytest.fixture()
def test_table():
table = FakeTable()
table.c = {"label1": 0, "label2": 5}
table.meta... |
import os
import platform
def _settings_root_XP():
return os.path.join(os.environ['USERPROFILE'], 'Local Settings')
def _settings_root_Vista():
return os.environ.get('LOCALAPPDATA', os.environ.get('ProgramData', '.'))
def _data_root_Windows():
release, version, csd, ptype = platform.win32_ver()
ro... |
from django import forms
from .models import Topic
class NewTopicForm(forms.ModelForm):
message = forms.CharField(
widget=forms.Textarea(
attrs={'rows': 5, 'placeholder': 'dump your thoughts here!'}
),
max_length=4000,
help_text="max_length is 4k"
)
emai... |
"""
@author: acfromspace
"""
def duplicate_items(list_numbers):
duplicates = []
list_numbers.sort()
for index in range(1, len(list_numbers)):
# If the number we look at is equal to the number before, we append it.
if list_numbers[index] is list_numbers[index - 1]:
duplicates.ap... |
outfile_dict = {
"setup": ["results/checkpoints/modes/phylogenomics_setup.done"],
"orthology": ["results/checkpoints/modes/phylogenomics_setup.done"],
"filter-orthology": ["results/checkpoints/modes/phylogenomics_setup.done", "results/checkpoints/modes/orthology.done"],
"align": ["results/checkpoints/modes/phyloge... |
# 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... |
#!e:\myproject\2019\blogger\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging, os
import torch
from torch import nn
import torch.nn.functional as F
from detectron2.structures import ImageList
from detectron2.utils.logger import log_first_n
from detectron2.modeling.backbone import build_backbone
fro... |
import ctypes
class Building:
def cleanup(self):
self.clib.free_building.argtypes = []
self.clib.free_building.restype = None
self.clib.free_building()
def __init__(self):
self.clib = ctypes.CDLL("bldg_lib.so")
self.clib.init_building.argtypes = []
self.clib.init_building.restype = None
self.clib.init_... |
# -*- coding: utf-8 -*-
from pyqtgraph.Qt import QtCore, QtGui, QtWidgets
from pyqtgraph.graphicsItems.GraphicsObject import GraphicsObject
from pyqtgraph import functions as fn
from pyqtgraph.pgcollections import OrderedDict
from pyqtgraph.debug import printExc
from ami.flowchart.Terminal import Terminal
from networkf... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'category_window.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_CategoryWindow(object):
def setupUi(self, CategoryWindow):
... |
###
### Copyright (C) 2018-2019 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
from ....lib import *
from ..util import *
import os
@slash.requires(have_gst)
@slash.requires(*have_gst_element("vaapi"))
@slash.requires(*have_gst_element("checksumsink2"))
class TranscoderTest(slash.Test):
require... |
"""========================================
Interpolation (:mod:`scipy.interpolate`)
========================================
.. currentmodule:: scipy.interpolate
Sub-package for objects used in interpolation.
As listed below, this sub-package contains spline functions and classes,
one-dimensional and multi-dimensio... |
import pandas as pd
import analyzeModel
def makePredsPerformanceTable(preds_f, phase = None):
preds = pd.read_csv(preds_f)
perf = analyzeModel.performanceMetrics(preds)
if phase is not None:
perf = analyzeModel.performanceMetricsWithPhase(preds)
perf = perf[phase]
for k in perf.keys... |
# coding=utf-8
from __future__ import unicode_literals
from api_x.zyt.evas.constant import NotifyRespTypes
from api_x.config import ali_pay
from .constant import BizType, NotifyType
from pytoolbox.util.log import get_logger
from .commons import notify_verify
from decimal import Decimal
from .commons import is_success_... |
from django.core.management.base import BaseCommand, CommandError
from scanmodule.models import *
import pytz
class Command(BaseCommand):
help = 'The help information for this command.'
def add_arguments(self, parser):
parser.add_argument('--host_ip_name', type=str, help='IP address.')
par... |
import calendar
import datetime
from urllib.parse import quote
from django.contrib.auth import get_user_model
from django.test import Client, TestCase
from django.urls import reverse
from django.utils import timezone
from oauth2_provider.models import get_access_token_model, get_application_model
from accounts.models... |
import discord
from discord.ext import commands
from cogs.utils import checks
import random
import asyncio
import re
import sqlite3
def setup(bot):
bot.add_cog(Gambling(bot))
def moneyparser(money):
money = str(money)
nmoney = ""
if money.endswith("000000000000000"):
nmoney = money[:-15] + "Q... |
# -*- coding: utf-8 -*-
"""
Created on 2020.05.19
@author: Jiahua Rao, Weiming Li, Hui Yang, Jiancong Xie
Code based on:
Errica, Federico, et al. "A fair comparison of graph neural networks for graph classification." (ICLR 2020).
-> https://github.com/diningphil/gnn-comparison
"""
import numpy as np
from math import... |
# 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 may ... |
# Copyright 2022 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... |
import dialogflow_v2 as df
project_id = 'hacking-carrots-242514'
session_cli = df.SessionsClient()
def talk_to_assistant(text, session_id):
session = session_cli.session_path(project_id, session_id)
text_input = df.types.TextInput(text=text, language_code='pl')
query_input = df.types.QueryInput(text=tex... |
import os
import boto3
import json
import csv
s3 = boto3.resource('s3')
bucket = s3.Bucket('tracking-metrics')
# Iterates through all the objects, doing the pagination for you. Each obj
# is an ObjectSummary, so it doesn't contain the body. You'll need to call
# get to get the whole body.
with open('unsubbed_tot.csv... |
import logging
from typing import Dict, Awaitable, Callable, Any, Set, List, Optional
from opentrons.types import Mount, Point, Location
from opentrons.config import feature_flags as ff
from opentrons.hardware_control import ThreadManager, CriticalPoint, Pipette
from opentrons.protocol_api import labware
from opentron... |
from __future__ import annotations
import dataclasses
import datetime
import uuid
from typing import Type
from graplinc.common.v1beta1.types_pb2 import Duration as _Duration
from graplinc.common.v1beta1.types_pb2 import Timestamp as _Timestamp
from graplinc.common.v1beta1.types_pb2 import Uuid as _Uuid
from python_pr... |
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy.orm import backref
from sqlalchemy.orm import exc as orm_exc
from sqlalchemy.orm import mapper
from sqlalchemy.orm import relationship
from sqlalchemy.tes... |
def validateUserChoice(playerName, turn, boardSize,board): #used to check that the user has selected a valid cell
while True:
try:
userInput = int(input(playerName + " please select a cell to enter '" + turn + "' :")) #Get user input as an integer
row = ... |
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2014, 2015 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany th... |
# Copyright 2019-2021 ObjectBox 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 required by applicable ... |
import os
import jwt
import requests
import logging
logger = logging.getLogger(__name__)
myFormatter = logging.Formatter('[%(asctime)s] [%(levelname)s] %(message)s')
handler = logging.StreamHandler()
handler.setFormatter(myFormatter)
logger.addHandler(handler)
def get_user_data_from_token(token):
token_dict = v... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_mrp.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are y... |
#!/usr/bin/env pypy3
# http://m2.hkgolden.com/view.aspx?message=6307521&type=SW&page=1
# 熊大地產經紀
from itertools import permutations
def check(i):
if i[0] == 0 or i[2] == 0 or i[4] == 0 or i[6] == 0:
return
ab = i[0] * 10 + i[1]
cd = i[2] * 10 + i[3]
ef = i[4] * 10 + i[5]
if ab - cd != ... |
import os
import subprocess
from unittest import mock
from . import *
from .... import *
from mopack.builders.bfg9000 import Bfg9000Builder
from mopack.config import Config
from mopack.sources import Package
from mopack.sources.apt import AptPackage
from mopack.sources.sdist import GitPackage
from mopack.types import... |
"""
Copyright (c) 2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... |
xs = {foo for
foo |
import sys
import unittest
from functools import reduce
from http import HTTPStatus
from unittest.mock import call, patch
import cloudfoundry_client.main.main as main
from abstract_test_case import AbstractTestCase
class TestServiceBindings(unittest.TestCase, AbstractTestCase):
@classmethod
def setUpClass(cl... |
# -*- coding: utf-8 -*-
from base import BaseTopology, InstanceDeploy
from physical.models import Instance
class BaseRedis(BaseTopology):
def get_upgrade_steps_extra(self):
return (
'workflow.steps.util.volume_provider.AttachDataVolume',
'workflow.steps.util.volume_provider.MountDa... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 1.5, s, t 3, s, t 4.1, s, q"
tags = "compose_acti... |
# 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... |
import redis
def testa_chave(chave):
try:
conn = conectar()
dados = conn.keys(pattern='produtos:*') # chamar as chaves e depois os produtos
dados = str(dados)
if chave in dados:
return True
else:
return False
except redis.exceptions.Connection... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
from setuptools import setup, find_packages
setup(name="abuseipdb-rapid7-plugin",
version="5.0.8",
description="Enables the look up of IP reports, provides list and details of blacklisted IPs, and submissions of abusive IPs",
author="rapid7",
author_emai... |
# Copyright 2008-2018 Univa Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
# -*- coding: utf-8 -*-
# Copyright 2021 Tampere University and VTT Technical Research Centre of Finland
# This software was developed as a part of the ProCemPlus project: https://www.senecc.fi/projects/procemplus
# This source code is licensed under the MIT license. See LICENSE in the repository root directory.
# Auth... |
import ee
from ee_plugin import Map
collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')\
.filter(ee.Filter.eq('WRS_PATH', 44))\
.filter(ee.Filter.eq('WRS_ROW', 34))\
.filterDate('2014-01-01', '2015-01-01')
median = collection.median()
Map.setCenter(-122.3578, 37.7726, 12)
Map.addLayer(median, {"ba... |
# generated from genmsg/cmake/pkg-genmsg.context.in
messages_str = ""
services_str = ""
pkg_name = "roi_extractor"
dependencies_str = "std_msgs;geometry_msgs;sensor_msgs"
langs = "gencpp;geneus;genlisp;gennodejs;genpy"
dep_include_paths_str = "std_msgs;/opt/ros/melodic/share/std_msgs/cmake/../msg;geometry_msgs;/opt/ro... |
from typing import Dict, List
import torch
class ScaledEmbedding(torch.nn.Embedding):
"""Embedding layer that initializes its values to use a truncated normal distribution."""
def reset_parameters(self) -> None:
"""Overriding default ``reset_parameters`` method."""
self.weight.data.normal_(0,... |
#!/usr/bin/env python
# Copyright 2011 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
#
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ZhimaCreditPeIndustryTradeQueryModel import ZhimaCreditPeIndustryTradeQueryModel
class ZhimaCreditPeIndustryTradeQueryRequest(object... |
from bge import logic, types
class AxisOrientation(types.KX_GameObject):
def __init__(self, own):
pass
def update(self, pos, orient):
self.worldPosition = pos
self.worldOrientation = orient |
"""
Modeling Transposition Gain
===========================
Calculating the gain in insolation of a tilted module over a flat module.
"""
# %%
# This example shows how to evaluate the transposition gain of a racking
# strategy. The transposition gain is the additional insolation collected
# by orienting at a tilt in... |
from bin.Settings.SettingsManager import SettingsLoader, SettingsManagerMock
from bin.Settings.SettingsEntity import get_settings_entity_from_list
from bin.Settings.SettingsSerialEntity import SettingsSerialEntity
from bin.Settings.SettingsUDPEntity import SettingsUDPEntity
from bin.Dispatcher.Dictionary import *
impor... |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # ignore tf warnings about cuda
from keras.layers import Conv2D, MaxPooling2D, Dropout, Dense, Flatten
from keras.metrics import CategoricalAccuracy
from sklearn.metrics import classification_report, matthews_corrcoef
from keras.losses import CategoricalCrossentropy
fr... |
# Original code taken from a few files by:
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
# -*-
# transmogrifying added by dezldog 3JAN22
import time
import subprocess
import digitalio
import board
#from gpsdclient import GPSDClient
from PIL import Image, ImageDraw, Image... |
#!/usr/bin/python
import os
import sys
import time
import numpy as np
import cPickle
import mahotas
import StringIO
import base64
import math
import zlib
import theano
import theano.tensor as T
from theano.tensor.signal import downsample
from theano.tensor.nnet import conv
from scipy.ndimage.interpolation import sh... |
# this program will try to close firefox
import os
import time
time.sleep(60*60)
os.system("TASKKILL /F /IM firefox.exe") |
from .common import *
MEDIA_URL = "%(FQDN)s/media/"
STATIC_URL = "%(FQDN)s/static/"
# This should change if you want generate urls in emails
# for external dns.
SITES["front"]["scheme"] = "%(PROTOCOL)s"
SITES["front"]["domain"] = "%(SERVER_NAME)s"
SECRET_KEY = '%(SECRET_KEY)s'
DEBUG = True
PUBLIC_REGISTER_ENABLED =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.