text stringlengths 1 927k |
|---|
#
# oci-boot-vol-vpus-decrease-python version 1.0.
#
# Copyright (c) 2020 Centroid, Inc.
# Licensed under the Apache License v 2.0 as shown at https://www.apache.org/licenses/LICENSE-2.0.txt
# This function will update the VPUs for Boot volume to balanced performamnce i.e. vpus set to 10
import io
import json
import o... |
# (c) Copyright IBM Corp. 2010, 2017. All Rights Reserved.
import pytest
import unittest
import mock
from resilient.bin.res_keyring import KeyringUtils
class TestKeyringUtils(unittest.TestCase):
mocked_resilient_class = mock.Mock()
mocked_resilient_get_config = mock.Mock()
@mock.patch("resilient.get_config... |
#encoding:utf-8
subreddit = 'selfie+DemEyesDoe+gonenatural'
t_channel = '@rselfie'
def send_post(submission, r2t):
return r2t.send_simple(submission) |
"""Log Number of Parameters after session creation"""
from typing import Tuple, List
import logging
import tensorflow as tf
from deepr.utils import mlflow
LOGGER = logging.getLogger(__name__)
class NumParamsHook(tf.train.SessionRunHook):
"""Log Number of Parameters after session creation"""
def __init__... |
from . import ceph_volume
from ansible.compat.tests.mock import MagicMock
import mock
import os
@mock.patch.dict(os.environ, {'CEPH_CONTAINER_BINARY': 'docker'})
class TestCephVolumeModule(object):
def test_data_no_vg(self):
result = ceph_volume.get_data("/dev/sda", None)
assert result == "/dev/s... |
import numpy.random as rnd
import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from common.gen_samples import *
from .simple_gcn import SimpleGCNAttack, AdversarialUpdater, set_random_seeds, \
get_gcn_option_list, GcnOpts, GraphAdjacency, create_gcn_default
from .gcn_test_support import read... |
def encode(json, schema):
payload = schema.Main()
payload.notifications.campfire.secure = \
json['notifications']['campfire']['secure']
payload.notifications.irc.secure = \
json['notifications']['irc']['secure']
payload.notifications.flowdock.secure = \
json['notifications']['... |
from setuptools import setup
with open("README.md") as f:
readme = f.read()
with open("aql/__init__.py") as f:
for line in f:
if line.startswith("__version__"):
version = line.split('"')[1]
setup(
name="aql",
description="asyncio query generator",
long_description=readme,
... |
# 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 pulumi
import pulumi.runtime
class ReceiptRuleSet(pulumi.CustomResource):
"""
Provides an SES receipt rule set resource... |
from os import path
import autolens as al
import autolens.plot as aplt
from test_autogalaxy.simulators.imaging import instrument_util
test_path = path.join("{}".format(path.dirname(path.realpath(__file__))), "..", "..")
def pixel_scale_from_instrument(instrument):
"""
Returns the pixel scale from an instrum... |
from statsmodels.compat.python import lrange
from statsmodels.compat.platform import PLATFORM_OSX, PLATFORM_WIN
from io import BytesIO
import pickle
import os
import warnings
import numpy as np
from numpy.testing import (assert_almost_equal, assert_, assert_allclose,
assert_raises)
import p... |
import os
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.jit.annotations import List, Dict
from torchvision.ops.misc import FrozenBatchNorm2d
from .feature_pyramid_network import FeaturePyramidNetwork, LastLevelMaxPool
class Bottleneck(nn.Module): # conv block 和 identity block
... |
import time
from flask import Flask
import whigo
app = Flask(__name__)
whigo.wrap_flask_app(app, 'test-flask-app')
def yolo():
time.sleep(3)
@app.route('/')
def hello_world():
yolo()
return 'Hello, World!'
if __name__ == '__main__':
app.run(port=9199) |
#!/usr/bin/env python
# Copyright 2018 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
import os, sys
from .errors import FatalError, TestSpecError
from .testcase import TestCase
... |
import bpy
from typing import List
from src.blenderApi.managers.BlenderFileManager import BlenderFileManager
from src.blenderApi.managers.MaterialShaderGraphManager import MaterialShaderGraphManager
from src.models.DirectoryContext import DirectoryContext
from src.models.FileMetadata import FileMetadata
from src.text... |
"""
Proposal Target Operator selects foreground and background roi and assigns label, bbox_transform to them.
"""
from __future__ import print_function
import mxnet as mx
import numpy as np
from distutils.util import strtobool
from rcnn.io.rcnn import sample_rois
DEBUG = False
class ProposalTargetOperator(mx.opera... |
# -*- coding: utf-8 -*
'''
You personal setting of AllPay
'''
ALLPAY_SANDBOX = True
AIO_SERVICE_URL = 'https://payment-stage.allpay.com.tw/Cashier/AioCheckOut/V2'
AIO_SANDBOX_SERVICE_URL = 'http://payment-stage.allpay.com.tw/Cashier/AioCheckOut'
'''
Get these from AllPay management panel
'''
MERCHANT_ID = '20... |
# Copyright 2016-2018, Rigetti Computing
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
.. contents:: :local:
.. currentmodule:: quantumflow
Circuit objects
###############
.. autoclass:: Circuit
:members:
.. ... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
optimizer = dict(
name='torch_optimizer',
torch_optim_class='AdamW',
lr=0.0001,
betas=(0.9, 0.999),
weight_decay=0.01,
parameters=[
dict(
params='absolute_pos_embed',
weight_decay=0
),
dict(
params='relative_position_bias_table',
... |
# imports
import torch
from torch.autograd import Variable
from torch import nn
from torch.nn import Parameter
import numpy as np
from numpy.linalg import norm
import scipy.io as sio
import pickle
usecuda = True
usecuda = usecuda and torch.cuda.is_available()
dtype = torch.FloatTensor
if usecuda:
dtype = torc... |
# -*- coding: utf-8 -*-
import sys
import time
from subprocess import call
#add the project folder to pythpath
sys.path.append('../../')
from library.components.SensorModule import SensorModule as Sensor
from library.components.MetaData import MetaData as MetaData
class Raspistill(Sensor):
def __init__(self):
... |
# Generated by Django 2.0.6 on 2018-06-27 08:21
from django.db import migrations
import djstripe.fields
class Migration(migrations.Migration):
dependencies = [
("djstripe", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="account",
name="busi... |
"""
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.
The tests in this file are inherited from the BaseExtensionTests, and only
minimal ... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyEinops(PythonPackage):
"""Flexible and powerful tensor operations for readable and relia... |
## mpiexec -n 2 python ex-2.08.py
# An exchange of messages
# --------------------------------------------------------------------
from mpi4pyve import MPI
import array
if MPI.COMM_WORLD.Get_size() < 2:
raise SystemExit
# --------------------------------------------------------------------
sendbuf = array.arr... |
'''
Plyer
=====
'''
__all__ = (
'accelerometer', 'audio', 'barometer', 'battery', 'bluetooth',
'brightness', 'call', 'camera', 'compass', 'cpu', 'email', 'filechooser',
'flash', 'gps', 'gravity', 'gyroscope', 'humidity', 'irblaster',
'keystore', 'light', 'notification', 'orientation', 'processors',
... |
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
import setuptools
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') ... |
import requests
import json
import os
HOUSTON_SERVICE_URL=os.environ['HOUSTON_SERVICE_URL']
url = f"http://{HOUSTON_SERVICE_URL}/api/keyValues/vpnonpremisevendor/"
# Additional headers.
headers = {'Content-Type': 'application/json' }
def test_vpnonpremisevendor():
#Testing POST request
resp_json = post... |
# -*- coding: utf-8 -*-
# author: https://github.com/Zfour
import json
import yaml
from bs4 import BeautifulSoup
from request_data import request
data_pool = []
def load_config():
f = open('_config.yml', 'r', encoding='utf-8')
ystr = f.read()
ymllist = yaml.load(ystr, Loader=yaml.FullLoader)
return... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyBitstring(PythonPackage):
"""Simple construction, analysis and modification of binary da... |
#!/usr/bin/env python
# Copyright (c) 2009, David Buxton <david@gasmark6.com>
# 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 co... |
import collections
import itertools
import random
import typing
from scipy import stats
from river.base import DriftDetector
class KSWIN(DriftDetector):
r"""Kolmogorov-Smirnov Windowing method for concept drift detection.
Parameters
----------
alpha
Probability for the test statistic of the... |
# Copyright © 2019 Javier Ayres
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See the LICENSE file for more details.
import re
from function_pipe import FunctionNode
VALID_NON_LETTER_SYMBOL... |
"""
********************************************************************************
* Name: metadata
* Author: Alan D. Snow
* Created On: April 24, 2017
* License: BSD-3 Clause
********************************************************************************
"""
def version():
return '0.3.1' |
from selenium import webdriver
driver = webdriver.Chrome(executable_path = "C:\Personal\Work\Selenium\Drivers\chromedriver.exe")
driver.get("https://www.saucedemo.com/") # assuming URL takes some time to open up
driver.implicitly_wait(10) # wait for 10s, applicable for all the elements of the page
... |
import pytest
from selenium import webdriver
from time import sleep
from selenium.webdriver.support.select import Select
import sqlite3
from static.classes.User import User, encryptPassword, decryptPassword
# Global variable
# Prepare the user and password for test
username_test = "test111"
password_test = "Aa123456!!... |
"""
Session: 4
Topic: Conditional: IF ELSE-If ELSE statement
"""
x = 100
y = 1000
if (x == y):
print('new line 3')
elif (x > y):
print ('x > y is true')
print ('new line 1')
elif (x < y):
print('x < y is true')
print('new line 2')
else:
print ('i will not print this statement')
print ('new lin... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
import polybench
NX = dace.symbol('NX')
NY = dace.symbol('NY')
TMAX = dace.symbol('TMAX')
#datatypes = [dace.float64, dace.int32, dace.float32]
datatype = dace.float64
# Dataset sizes
sizes = [{
TMAX: 20,
NX: 20,
NY: ... |
from output.models.nist_data.atomic.unsigned_long.schema_instance.nistschema_sv_iv_atomic_unsigned_long_total_digits_2_xsd.nistschema_sv_iv_atomic_unsigned_long_total_digits_2 import NistschemaSvIvAtomicUnsignedLongTotalDigits2
__all__ = [
"NistschemaSvIvAtomicUnsignedLongTotalDigits2",
] |
from dataclasses import dataclass
from typing import ClassVar
from datalabs.features.features import Features, Value
from datalabs.tasks.base import register_task, TaskTemplate, TaskType
@register_task(TaskType.kg_prediction)
@dataclass
class KGPrediction(TaskTemplate):
task: TaskType = TaskType.kg_prediction
... |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... |
#Ща мы будем мутить моделирование бросков кубиков (Предлагаю начать с 2 кубиков). Краткий экскурс: при броске кубика, мы имеем равные шансы получить число от 1 до 6, но когда мы кидаем 2 кубика, эти шансы меняется.
#Plotly оч полезная вещь, если вы решили сделать визуализацию данных или прочих таких интересных вещей. Б... |
from __future__ import annotations
from asyncio import iscoroutinefunction
from concurrent.futures import ThreadPoolExecutor
from contextlib import ExitStack
from threading import Lock
from typing import Any, Callable, Iterable
import attrs
from ..abc import Subscription
from ..events import Event
from ..util import... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.9.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
from abc import ABC, abstractmethod
from contextlib import contextmanager
from typing import TYPE_CHECKING, Iterator, Optional
if TYPE_CHECKING:
from dvc.fs.ssh import SSHFileSystem
from dvc.types import StrPath
class BaseMachineBackend(ABC):
def __init__(self, tmp_dir: "StrPath", **kwargs):
self... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import sys
from six.moves import html_parser as HTMLParser
import smtplib, quopri, json
from frappe import msgprint, _, safe_decode, safe_encode, enqueue
from frappe... |
# -*-coding:utf-8-*-
import re
from torchtext import data
import jieba
import logging
jieba.setLogLevel(logging.INFO)
regex = re.compile(r'[^\u4e00-\u9fa5aA-Za-z]')
def word_cut(text):
text = regex.sub(' ', text)
return [word for word in text if word.strip()]
def joint_word_cut(text):
return [word for... |
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example_app.settings")
try:
from django.core.management import execute_from_command_line
except ... |
# -*- 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
import hashlib
import logging
from datetime import datetime
from django.db.transaction import atomic
from django.utils import six, timezone
from django.utils.encoding import force_bytes
logger = logging.getLogger('django.db.backends.schema')
def _related_non_m2m_objects(old_field, new_field):
# Filters out m2m ... |
# pylint: disable=protected-access,pointless-statement,relative-beyond-top-level
import json
import os
from pathlib import Path
def test_env_variable():
"""Set OPTIMADE_DEBUG environment variable and check CONFIG picks up on it correctly"""
from optimade.server.config import ServerConfig
org_env_var = o... |
import tensorflow as tf
import numpy as np
import math
# weights initializers
he_normal = tf.contrib.keras.initializers.he_normal()
#he_normal = tf.contrib.layers.variance_scaling_initializer()
regularizer = tf.contrib.layers.l2_regularizer(1e-4)
def Convolutional_Block(inputs, shortcut, num_filters, name, is_trainin... |
import logging
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
return func.HttpResponse(
"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
status_code=200
) |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import os
import numpy as np
import cntk
from cntk import input_variable, Axis
from... |
#!/usr/bin/env python
#
# Use the raw transactions API to spend GUAPs received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a guapcoind or guapc... |
"""
[8/27/2012] Challenge #92 [intermediate] (Rubik's cube simulator)
https://www.reddit.com/r/dailyprogrammer/comments/ywm08/8272012_challenge_92_intermediate_rubiks_cube/
Your intermediate task today is to build a simple simulator of a [Rubik's
Cube](http://en.wikipedia.org/wiki/Rubik%27s_Cube). The cube should be ... |
default_app_config = 'apps.chunksapi.appconfig.ChunksAPIConfig' |
from django.contrib.contenttypes.models import ContentType
from ..game_catalog import models as catalog_models
from . import models
def get_distinct_games(library):
sb_ct = ContentType.objects.get_for_model(catalog_models.SourceBook)
md_ct = ContentType.objects.get_for_model(catalog_models.PublishedModule)
... |
def draw_mem():
c_width = int( w.Canvas2.cget( "width" ))
c_height = int( w.Canvas2.cget( "height" ))
print( c_width )
box_start = c_width * 0.05
box_end = c_width * 0.95
mem_title = w.Canvas2.create_text(( c_width / 2 ), 10, fill = "black", font = "Times 10", text = "Flash" )
mem1 = w.Canva... |
import tensorflow as tf
def build_shared_network(X, add_summaries=False):
"""
Args:
X: Inputs
add_summaries: If true, add layer summaries to Tensorboard.
Returns:
Final layer activations.
"""
# Three convolutional layers
in_layer = tf.contrib.layers.fully_conn... |
'''Training the page orientation model'''
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from tensorflow import keras
from datetime import datetime
import cv2
import numpy as np
import helper
# TODO:
# - Train to identify rotation of found pieces of paper
DATA_DIR = ... |
# pylint: disable=E1101
from __future__ import division
import operator
import warnings
from datetime import time, datetime, timedelta
import numpy as np
from pytz import utc
from pandas.core.base import _shared_docs
from pandas.core.dtypes.common import (
_INT64_DTYPE,
_NS_DTYPE,
is_datetime64_dtype,
... |
class Solution:
def isMatch(self, s: str, p: str) -> bool:
# 最后一位匹配:self.isMatch(s[:-1], p[:-1])
# 最后一位不匹配:
# 不是*:False
# 是*:<1> s[-1]和p[-2]不匹配:self.isMatch(s, p[:-2])
# <2> s[-1]和p[-2]匹配:self.isMatch(s[:-1], p) or self.isMatch(s, p[:-2])
... |
from typing import List
import pydash
from jesse.config import config
from jesse.models import Order
class OrdersState:
def __init__(self) -> None:
# used in simulation only
self.to_execute = []
self.storage = {}
for exchange in config['app']['trading_exchanges']:
f... |
from django.contrib import admin
from .models import Image, Location, Category
admin.site.register(Image)
admin.site.register(Location)
admin.site.register(Category) |
from ._BB8CustomServiceMessage import * |
import imp
import json
import base64
import codecs
import inspect
from pathlib import Path
from flask import request, jsonify, send_file
import lyrebird
from lyrebird import log
from lyrebird import application
from lyrebird.mock.context import make_fail_response, make_ok_response
from . import event_handler
from . imp... |
import _plotly_utils.basevalidators
class NticksValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(self, plotly_name="nticks", parent_name="mesh3d.colorbar", **kwargs):
super(NticksValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Update value by key"
class Input:
ARRAY = "array"
KEY = "key"
OBJECT = "object"
VALUE = "value"
class Output:
JSON = "json"
class UpdateInput(komand.Input):
schema = json.loads("... |
import numpy as np
"""
CLIFFORD ATTRACTORS
Each new point (x_n+1, y_n+1) is determined based on the preceding point (x_n, y_n), and the parameters a, b, c and d.
x_n+1 = sin(a * y_n) + c * cos(a x_n)
y_n+1 = sin(b * x_n) + d * cos(b y_n)
"""
def sample_histogram(a=0.98, b=1.7, c=1.48, d=1.57, h=None, dim=2000, sam... |
#!/usr/bin/env python
# coding=utf-8
import logging
import os
import math
import sys
from dataclasses import dataclass, field
from typing import Optional
import torch
import numpy as np
from datasets import ClassLabel, load_dataset, load_metric
import torch
from PIL import Image, ImageDraw, ImageFont
from sklearn.mani... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SyncJob(object):
"""N... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-19 19:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0201_zoom_video_chat'),
]
operations = [
migrations.AddField(
... |
# -*- coding: utf-8 -*-
"""
NRWAL config framework.
"""
from .config import NrwalConfig |
from grap2 import Ui_Form
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from sys import argv
from PyQt5.QtWidgets import *
import matplotlib as mpl
mpl.use('Qt5Agg')
import matplotlib.pyplot as plt
import numpy as np
class mas2(QWidget, Ui_Form):
def __init__(self):
super(mas2, self).__init__()
... |
#Hacked out of a class contained in Charl Botha's comedi_utils.py
#Incorporated edits by by Corine Slagboom & Noeska Smit which formed part of their comedi_utils module, used in their 'Emphysema Viewer'
#Final version by Francois Malan (2010-2011)
from module_kits.vtk_kit.utils import DVOrientationWidget
import operat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/mailer.py
#
# 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, th... |
import sys
import collections
from .solvers import FixedGridODESolver
from .misc import _scaled_dot_product, _has_converged
from . import rk_common
_BASHFORTH_COEFFICIENTS = [
[], # order 0
[11],
[3, -1],
[23, -16, 5],
[55, -59, 37, -9],
[1901, -2774, 2616, -1274, 251],
[4277, -7923, 9982,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def transform(f):
return (f - 32) * float(5) / 9
if __name__ == '__main__':
for i in range(0, 300, 10):
print transform(i) |
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from chatterbot.trainers import ChatterBotCorpusTrainer
from webscraper import get_response
import random
import ruamel.yaml
bot = ChatBot(
'Terminal',
storage_adapter='chatterbot.storage.SQLStorageAdapter',
database_uri='sqlite:///database.... |
# coding: utf-8
# flake8: noqa
"""
Associations
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
from __future... |
import sys
from typing import Dict, Tuple, List, Optional
from os.path import join
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWidgets import QGridLayout
from PyQt5.QtWidge... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0004_auto_20150702_2044'),
]
operations = [
migrations.RemoveField(
model_name='event',
na... |
# Faça um Programa que mostre a mensagem "Alo mundo" na tela.
def oi(s):
"""Função que imprime a mensagem 'Alo Mundo' com um str especifico
:param s:
:return:
"""
if s == 'oi':
print('Alo Mundo')
elif s != 'oi':
print('tente novamente')
def cumprimento():
return 'Alo Mund... |
#!/usr/bin/env python
import logging
import numpy as np
import time
from flask import Flask, request, jsonify
from os import getenv
import sentry_sdk
sentry_sdk.init(getenv("SENTRY_DSN"))
logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
logger = logging.getLogg... |
import numpy as np
import pandas as pd
import ipysheet
import pytest
from ipysheet.utils import transpose
import ipywidgets as widgets
import ipykernel.kernelbase
from .utils import adapt_value
class _KernelMock(ipykernel.kernelbase.Kernel):
@property
def session(self):
return self
def send(self,... |
class Reader:
@staticmethod
def readline():
import sys
return sys.stdin.buffer.readline().rstrip()
@classmethod
def read_int(cls):
i = int(cls.readline())
return i
@classmethod
def read_str(cls):
s = cls.readline().decode()
return s
@classm... |
from __future__ import annotations
import sys
import random
from abc import ABC, abstractmethod
from typing import List, Tuple
import pygame
# 画像ファイル
images = {
'bg': './assets/bg.png',
'bird': './assets/bird.png',
'pipe': './assets/pipe.png',
'ground': './assets/ground.png'
}
# フォントを設定する
pygame.fon... |
#!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Usage: <win-path-to-pdb.pdb>
This tool will take a PDB on the command line, extract the source files that
were used in building ... |
"""
Here you should do all needed actions. Standart configuration of docker container
will run your application with this file.
"""
from fastapi import FastAPI
from loguru import logger
from app.config import openapi_config
from app.initializer import init
app = FastAPI(
title=openapi_config.name,
version=ope... |
#!/usr/bin/env python
import rospy
from std_msgs.msg import String, Int32
from ar_track_alvar_msgs.msg import AlvarMarkers
from visualization_msgs.msg import Marker
packageOneFlag = False
packageTwoFlag = False
Q = [0,0,0,0]
boxInfo = [5,5,5,5]
#boxReference = {'ids': 0,1,2,3, 'width': 10,5,10,5, 'height': 5,5,5,5, 'd... |
import network
import machine
import ujson
import sys
from umqtt.simple import MQTTClient
import ubinascii
import time
# Reading configuration file
try:
with open("config.json") as file:
print("Loading config.json...")
config = ujson.loads(file.read())
print("Done.")
except (OSError, ValueE... |
"""
Multipersistence Module Approximation Library cython file.
Author(s): David Loiseaux, Mathieu Carrière
Copyright (C) 2022 Inria
"""
__author__ = "David Loiseaux, Mathieu Carrière"
__copyright__ = "Copyright (C) 2022 Inria"
__license__ = ""
#from distutils.core import setup
#from distutils.extension im... |
from Shoots.bin.shoots import Shoots
from Shoots.bin.info import Info
from Shoots.bin.ai.shooter import CFRShooter as AIShooter
class AIShoots(Shoots):
"""
automatically add two AIShooter
"""
def __init__(self):
super().__init__()
self.map.map = [
[self.map.ROAD] * 5
... |
class Player:
@classmethod
def from_json(cls, json_obj):
player = cls()
player.uuid = str(json_obj['player']['uuid'])
player.displayname = str(json_obj['player']['displayname'])
player.id = str(json_obj['player']['_id'])
player.playername = str(json_obj['player']['player... |
#!/usr/bin/python
# vector_comp.py
#
# Author: Nick Shelly, Spring 2013
# Description:
# - Loads SNAP as a Python module.
# - Randomly generates Python types
# - Compares conversion of Python types to SNAP types:
# 1. Python instantiation of SNAP type
# 2. Passing Python objects to SWIG ... |
def drift_rectangles(rectangles):
output_rectangle_list = []
for rectangle in rectangles["rectangles"]:
output_rectangle_list.append(drift_rectangle(rectangle))
return {
"rectangles": output_rectangle_list
}
def drift_rectangle(rectangle):
return rectangle |
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""OSX platform implementation."""
import errno
import functools
import os
from collections import namedtuple
from . import _common
from . import _psposi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.