content stringlengths 5 1.05M |
|---|
from django.contrib import admin
from services.models import Service
class ServiceAdmin(admin.ModelAdmin):
"""
Edit services
"""
list_display = ('type_of_service', 'price', 'per')
list_editable = ('price', 'per')
list_per_page = 10
list_max_show_all = 30
search_fields = ('type_of_serv... |
import base64
import os
import random
import sys
import threading
import uuid
from datetime import datetime
from pathlib import Path
import cv2
import face_recognition
import numpy as np
import requests
import torch
import torch.nn.functional as F
import zmq
from dotenv import load_dotenv
from PIL import Image
from m... |
'''OpenGL extension NV.vertex_buffer_unified_memory
This module customises the behaviour of the
OpenGL.raw.GL.NV.vertex_buffer_unified_memory to provide a more
Python-friendly API
Overview (from the spec)
This extension provides a mechanism to specify vertex attrib and
element array locations using GPU... |
#! /usr/bin/python
import numpy as np
import wave
import struct
import matplotlib.pyplot as plt
# frequency is the number of times a wave repeats a second
frequency = 1000
noisy_freq = 50
num_samples = 48000
# The sampling rate of the analog to digital convert
sampling_rate = 48000.0
#Create the sine wave and noise
... |
import altair_recipes as ar
from altair_recipes.common import viz_reg_test, gather
from altair_recipes.display_pweave import show_test
import numpy as np
import pandas as pd
from vega_datasets import data
#' <h2>Histogram</h2>
@viz_reg_test
def test_histogram():
return ar.histogram(data.movies(), column="IMDB R... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
""" Target """
# Packages
from __future__ import division
import math
import scipy.stats as st
import scipy as sp
from bandits_to_rank.data.Methode_Simulation_KappasThetasKnown import *
""" Target"""
class Target :
"""
Target_XXXXXXX: initalisation of a MH algorithm... |
import bottle
import collections
import headers_util
from models.result_handler import DefaultResultHandler
JSON_ELEMENT = 'headers'
class HttpHeadersHandler(DefaultResultHandler):
@property
def headers(self):
props = collections.OrderedDict(headers_util.HTTP_HEADERS)
props[head... |
'''
* @author: ashwek
* @date: 26/12/2018
'''
def pattern7(num):
Upper = []
for i in range(1, num+1):
Upper.append("* " * (num-i+1) + #Left Triangle
" "*(i-1) + #Space
"* " * (num-i+1) #Right Triangle
)
for i in Upper: # Upper Hal... |
#!/usr/bin/env python3
"""
__author__ = "Blaze Sanders"
__email__ = "blaze.d.a.sanders@gmail.com"
__company__ = "Robotic Beverage Technologies, Inc"
__status__ = "Development"
__date__ = "Late Updated: 2020-07-08"
__doc__ = "Class to define OTA commuications architecture for 30K+ Tapomatic kiosk"
"""
# Allo... |
#!/usr/bin/env python
#
# Copyright 2014+ Carnegie Mellon University
#
# 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 resources.BoundingBox import BoundingBox
from datetime import datetime
from crud.db import get_cursor
from crud.Territory_CRUD import TerritoryCRUD
from crud.Land_CRUD import LandCRUD
import functools
from math import log, floor
import logging
from crud.State_CRUD import StateCRUD
import conf
from werkzeug.excepti... |
import pyaudio
import wave
import os
import sys
import time
#from light import Light
from sensor import Sensor
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
RECORD_SECONDS = 10 # 最多60秒
WAVE_OUTPUT_FILENAME = "./assets/usersay.wav" # 文件名
#led = Light(18)
mysensor = Sensor(17)
def wait_sound... |
import zmq
import logging as log
import multiprocessing as prc
import time
class DBNode:
def __init__(self, netconf, name="Database"):
self.name=name
self.listen_addr = netconf.get_address('database')
def _init_sockets(self):
ctx = zmq.Context()
listen_addr = self.listen_addr
... |
import json
from chalicelib.core import authorizers, metadata, projects
from chalicelib.utils import helper
from chalicelib.utils import pg_client
from chalicelib.utils import dev
from chalicelib.utils.TimeUTC import TimeUTC
from chalicelib.utils.helper import environ
from chalicelib.core import tenants
import secre... |
__author__ = "Christian Kongsgaard"
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules
import os
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = [10, 5]
import datetime
fro... |
# Copyright (c) Facebook, Inc. and its affiliates.
from mmf.datasets.builders.textvqa.dataset import TextVQADataset
class OCRVQADataset(TextVQADataset):
def __init__(self, config, dataset_type, imdb_file_index, *args, **kwargs):
super().__init__(config, dataset_type, imdb_file_index, *args, **kwargs)
... |
# 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 agreed to in writing, ... |
from streamlit_option_menu import option_menu
import os,io,base64,csv
import streamlit as st
import pandas as pd
from PIL import Image
from datetime import datetime
from annotated_text import annotated_text
def config():
file_path = "./components/img/"
img = Image.open(os.path.join(file_path, 'logo.ico'))
... |
core_gt = curry2(lambda a, b : a > b)
|
from jet_bridge.responses.base import Response
class UpdateAPIViewMixin(object):
def update(self, *args, **kwargs):
partial = kwargs.pop('partial', False)
instance = self.get_object()
serializer = self.get_serializer(instance=instance, data=self.data, partial=partial)
serializer.i... |
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
#!/usr/bin/env python3
"Run a regresion test the... |
import cc_dat_utils
# Imported to facilitate opening and reading data
import json
import test_json_utils
import test_data
import cc_data
import cc_json_utils
#Part 1
#Use cc_data_utils.make_cc_data_from_dat() to load pfgd_test.dat
#print the resulting data
print(cc_dat_utils.make_cc_data_from_dat("data/pfgd_test.dat")... |
__author__ = 'ceposta'
import sys, urllib2, json;
# http://fuse102-dev.openshift.com
FUSE_ROOT_URL = sys.argv[1]
# app name, eg, fuse102
FUSE_APP_NAME = sys.argv[2]
FUSE_CONSOLE_PASSWORD = sys.argv[3]
def encodeUserData(username,passwd):
return "Basic %s" % (("%s:%s" % (username,passwd)).encode('base64').rstr... |
# Generated by Django 2.2.9 on 2020-03-08 01:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0017_message_user'),
]
operations = [
migrations.AddField(
model_name='article',
name='tags',
fie... |
import os
import sys
from PIL import Image
import loader
def askForCorrectPath():
print( "please input the correct path for Project folder(\"官方营算法\" folder):" )
loader.path = input()
try:
assert os.getcwd().split('\\')[-1] == "my_code"
sys.path.append(loader.path)
sys.path.append(loader.path +... |
'''
Given a time in
-hour AM/PM format, convert it to military (24-hour) time.
Note: Midnight is 12:00:00AM on a 12-hour clock, and 00:00:00 on a 24-hour clock. Noon is 12:00:00PM on a 12-hour clock, and 12:00:00 on a 24-hour clock.
Function Description
Complete the timeConversion function in the editor below. It s... |
from .tinderfortanda import (
load, get_next_person, get_next_venue, swipe_left, swipe_right,
get_matched_venues, is_venue, get_matched_users
) |
from twisted.python import log
from ccoin import settings
from ccoin.exceptions import TransactionApplyException
from ccoin.utils import get_random_string
def make_candidate_block(worldstate, chain, txqueue, coinbase=settings.BLANK_SHA_256):
"""
:param worldstate:
:type worldstate: ccoin.worldstate.World... |
import os
import unittest
from pymatgen.core import Structure
from atomate.feff.fireworks.core import EXAFSPathsFW
from atomate.utils.testing import AtomateTest
__author__ = "Kiran Mathew"
__email__ = "kmathew@lbl.gov"
module_dir = os.path.dirname(os.path.abspath(__file__))
db_dir = os.path.join(module_dir, "..", "... |
from __future__ import absolute_import
from keras import backend as K
from .utils import utils
class Loss(object):
"""Abstract class for defining the loss function to be minimized.
The loss function should be built by defining `build_loss` function.
The attribute `name` should be defined to identify los... |
from paprika.actions.Actionable import Actionable
from paprika.repositories.ProcessActionPropertyRepository import ProcessActionPropertyRepository
from paprika.repositories.ProcessPropertyRepository import ProcessPropertyRepository
from paprika.repositories.ProcessRepository import ProcessRepository
from paprika.system... |
def render_all(con, entities, game_map, fov_recompute,
root_console, screen_width, screen_height, colors):
"""Draw all tiles in the game map"""
if fov_recompute:
for x, y in game_map:
wall = not game_map.transparent[x, y]
if game_map.fov[x, y]:
if ... |
"""
test_strategy.py
Copyright 2012 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in the hope th... |
from dataclasses import dataclass, field
from typing import Optional
from bindings.csw.knot_type import KnotType
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
class KnotPropertyType:
"""
Encapsulates a knot to use it in a geometric type.
"""
knot: Optional[KnotType] = field(
defaul... |
# -*- coding: utf-8 -*-
# Copyright 2011 Takeshi KOMIYA
#
# 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... |
from ast import Pass
from turtle import position
def run():
mis_datos = {
'Name': "Mateo",
'Age': 29,
'Weight': 85,
'Height': 175,
'Gender': 'M'
}
# print(mis_datos)
# print(mis_datos['Gender'])
for dato in mis_datos.keys(): # iterate wi... |
import datetime
from fireworks.utilities.fw_serializers import FWSerializable, serialize_fw
__author__ = "Anubhav Jain"
__copyright__ = "Copyright 2014, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Anubhav Jain"
__email__ = "ajain@lbl.gov"
__date__ = "Jan 21, 2014"
class TestSerializer(FWSerializabl... |
import ipaddress
# ip = '192.168.1.0/24'
def dhcp_details(ip):
ip_addr = ip.split('/')[0]
cidr = ip.split('/')[1]
print(ip_addr)
print(cidr)
total = ipaddress.ip_network(str(ip_addr) + '/' + str(cidr))
print("The subnet mask is: " + str(total.netmask))
ip_list = []
usable_ips = total.... |
def filter1(a):
return '[{}]'.format(a)
def filter2(c, d):
return '{}and{}'.format(c, d)
|
from glob import glob
use_files = ["../requirements.txt", "../test-requirements.txt"]
files = set()
# Collect a list of dependencies
for ifile in use_files:
with open(ifile, 'r') as ff:
lines = ff.readlines()
files = files.union(lines)
# Sort and save
files = list(files)
files.sort()
with open('.... |
"""
Converter class that handles the conversion of paths from Api Gateway to Flask and back.
"""
import re
# The regex captures any path information before the {proxy+}. This is to support paths that have other params in
# them. Otherwise the regex will match the first { with the last +} giving incorrect results.
# E... |
import os
import sys
import pulumi
import pulumi_aws as aws
import socket
import os
parent_dir_name = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(parent_dir_name)
from local_settings import PUBLIC_KEY
## Settings
EC2_SIZE = 't2.micro'
EC2_KEY_NAME = 'ez_django_key'
## AWS
#
## ... |
'''
@说明 :订单接口。
@时间 :2020/3/19 下午4:51:48
@作者 :任秋锴
@版本 :1.0
'''
from .base import base
class order(base):
def __init__(self, token):
super().__init__(token)
def list(self, pageNum=1, pageSize=10):
api_name = "manager/order/list"
data = {
"pageNum": pageNum,
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-07-19 14:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('strategy', '0003_auto_20170705_1624'),
]
operations = [
migrations.AlterField... |
import komand
from .schema import ConnectionSchema, Input
# Custom imports below
import urllib3
from requests import Session
from requests.auth import HTTPBasicAuth
from requests.exceptions import RequestException
from komand_rapid7_insightvm.util import async_requests
from collections import namedtuple
from komand_rap... |
import unittest
from limitlessled.group.commands.legacy import CommandLegacy, CommandSetLegacy, CommandSetWhiteLegacy, CommandSetRgbwLegacy
class TestLegacyCommands(unittest.TestCase):
def setUp(self):
self.commands = CommandSetLegacy(1, 10)
def test_convert_brightness(self):
self.assertEqua... |
# Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
#
# marvin (c) by Jeffrey Maggio, Hunter Mellema, Joseph Bartelmo
#
# marvin is licensed under a
# Creative Commons Attribution-ShareAlike 4.0 International License.
#
# You should have received a copy of the license along with this
# work. If not, see <http://creativecommons.org/licenses/by-sa/4.0/>.
#
#
import cv2
i... |
def wslMapLinuxWindows(path):
if not path or path.find("/mnt/") == -1:
return path
path = path[5].upper() + ":" + path[6:]
path = path.replace("/", r"\\")
return path
def wslMapWindowsLinux(path):
if path.find(":\\") == -1:
return path
path = path.replace("\\", "/")
drive =... |
import os
from abc import ABC, abstractmethod
import hashlib
import json
from pymongo import MongoClient
from wpscraper.document import Document
def create_directory(directory):
parent_directory = os.path.dirname(os.path.realpath(directory))
if not os.path.exists(parent_directory):
create_directory(... |
import asyncio
import rx
class AsyncObserver(rx.Observer):
def async_fire(self, coroutine):
async def fire():
try:
await coroutine
except Exception as e:
self.on_error(e)
asyncio.get_event_loop().ensure_future(fire())
|
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def generateTrees(self, n):
"""
:type n: int
:rtype: List[TreeNode]
"""
if n == 0:
return []
... |
"""
正在测试中
"""
def youdao(word):
realUrl = "https://dict.youdao.com/w/"+word+"/"
response = requests.get(url=realUrl)
response.encoding="utf-8"
#解析
treeObj=etree.HTML(response.text)
ukSymbolText=treeObj.xpath('//*[@id="phrsListTab"]/h2/div/span[1]/span/text()')[0]
ukVoiceSector=treeObj.xpat... |
# -*- coding: utf-8 -*-
"""
Copyright 2020 Andrea López Incera.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Please acknowledge the authors when re-using this code and maintain this notice intact.
Code written by Andrea López I... |
#coding:utf-8
"""
Global constants for vtel
"""
VERSION = 'v1.1.0-Beta'
|
import json
import base64
import logging
from flask import render_template, redirect, request, jsonify
from flask.ext.login import login_required, current_user
from ybk.settings import CONFS
from ybk.trade import (update_trade_account, quote_detail,
order, withdraw, transfer,
... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("//bazel_tools:java.bzl", "da_java_library")
load("//bazel_tools:javadoc_library.bzl", "javadoc_library")
load("//bazel_tools:pkg.bzl", "pkg_empty_zip")
load("//bazel_tools:pom_f... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# ======================================================================================================================== #
# Project : Conversion Rate Prediction (CVR) #
# Version : 0.1.0 ... |
"""
This project uses the json library to read data from a json file. The data is a python dictionary containing a large number of words along with their definitions. Hence it can be used to create a simple cli dictionary of common english words and phrases.
The project can handle words in upper, lower and mixed cases.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `ratpy` package."""
import pytest
from ratpy import ratpy
from ratpy import cli
|
#!/usr/bin/env python3
'''
genetribe - RBH.py
Copyright (C) Yongming Chen
Contact: chen_yongming@126.com
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... |
from typing import List, Union
from typedflow.exceptions import FaultItem
from typedflow.nodes import TaskNode, LoaderNode, DumpNode
def lst() -> List[str]:
return ['hi', 'hello', 'konnichiwa']
def count_chars(s: str) -> int:
return len(s)
def lst_with_fi() -> List[Union[str, FaultItem]]:
return ['hi... |
import os
import pytest
from nixui.options import parser
SAMPLES_PATH = 'tests/sample'
@pytest.mark.datafiles(SAMPLES_PATH)
def test_get_all_option_values():
assert parser.get_all_option_values(
os.path.abspath(os.path.join(SAMPLES_PATH, 'configuration.nix'))
)
@pytest.mark.datafiles(SAMPLES_PATH)... |
import os
import sys
import traceback
import time
import datetime;
import random
import socket
import math
import json
# NOTE: This message manager requires that your receiving socket's buffer size is as large or larger than the sending socket's buffer size.
class Buffered_Message_Manager:
def __init__(self, buffer... |
# Generated by Django 2.0.4 on 2018-04-15 16:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... |
import dash_mantine_components as dmc
from lib.configurator import create_configurator
controls = [
{"property": "color", "component": "ColorPicker", "value": "#34c6ef5"},
{"property": "size", "component": "DemoSlider", "value": "md"},
{"property": "radius", "component": "DemoSlider", "value": "sm"},
... |
import json,random,datetime,re,os
import requests
basepath = os.path.abspath(os.path.dirname(__file__))
def getSongJson(filehash,albumid):
default_url = "http://www.kugou.com/yy/index.php?r=play/getdata&hash={HASH}&_={TIMESTAMP}"
current_timestamp = datetime.datetime.utcnow().timestamp() * 1000 # timst... |
from functools import wraps
from sys import exit
exceptions = []
class ParseException(Exception):
def __init__(self,mes):
Exception.__init__(self,mes)
class LexerException(Exception):
def __init__(self,mes):
Exception.__init__(self,mes)
class SemanticException(Exception):
def __init__(... |
# -*- coding: utf-8 -*-
"""Database module, including the SQLAlchemy database object and DB-related utilities."""
from stuart.extensions import db
def reference_col(tablename, nullable=False, pk_name='id', **kwargs):
"""Column that adds primary key foreign key reference.
Usage: ::
category_id = refe... |
"""This produces a GUI that allows users to switch between segmentation
algorithms and alter the parameters manually using a slider. It shows two images,
one with the original image with the resulting mask and one with the original image
with the negative of the resulting mask."""
import matplotlib.pylab as plt
i... |
from metaphor.slack_directory.extractor import SlackRunConfig
def test_json_config(test_root_dir):
config = SlackRunConfig.from_json_file(
f"{test_root_dir}/slack_directory/config.json"
)
assert config == SlackRunConfig(
oauth_token="oauth_token",
page_size=1,
include_dele... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Miscellaneous utilities
"""
def fix_multi_T1w_source_name(in_files):
"""
Make up a generic source name when there are multiple T1s
>>> fix_mu... |
from Cython.Build import cythonize
import numpy as np
from setuptools import setup, find_packages, Extension
# To compile and install locally run "python setup.py build_ext --inplace"
# To install library to Python site-packages run "python setup.py build_ext install"
ext_modules = [
Extension(
'pycoco... |
from shape import Shape
class Line(Shape):
def draw(self):
print('Print line')
|
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from decimal import Decimal
from workflow.models import Work
class Product(models.Model):
name = models.CharField(max_length=30, verbose_name='Nome')
desc = models.CharField(max_length=30, blank=True, null=True,... |
from django.core.management.base import BaseCommand
import paho.mqtt.client as mqtt
from project.settings import MQTT_HOST
from project.settings import MQTT_PORT
from project.settings import MQTT_USERNAME
from project.settings import MQTT_PASSWORD
from project.settings import MQTT_WATER_SENSOR_TOPIC
import time
from in... |
""" Localize module. """
TEXT_FOLLOWING_PATHS_WILL_BE_ADDED = "The following paths will be added to the package." |
import time
class NativeTest:
def __init__(self, name, level):
self.publicvar = 1
self.__name = name
self.__level = level
def get_name(self):
return self.__name
def get_level(self):
return self.__level
def set_name(self, new_name):
assert type(new_nam... |
from .helper import get_video_input_devices_names |
# -*- coding: utf-8 -*-
"""
OCM: object Command Mapping
"""
import sys
import json
import logging
import subprocess as sp
from shutil import which
from collections import OrderedDict
logger = logging.getLogger('OCM')
RUNNING = 0
SUCCESS = 1
FAILED = -1
class OCMError(Exception):
"""ocm error"""
class BadParam... |
from schematics import Model
from schematics.types import ModelType, ListType, StringType, IntType, BooleanType
class Tags(Model):
key = StringType()
value = StringType()
class SubResource(Model):
id = StringType(serialize_when_none=False)
name = StringType(serialize_when_none=False)
class DdosSet... |
# Copyright 2019 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 or agreed to in writing, ... |
import unittest
from mock import Mock, call
import photolist
from download import FlickrApiDownloader
import json
class MockFlickrApiForDownload:
def __init__(self, photos_return_values):
self.people = MockFlickrPeople(photos_return_values)
class MockFlickrPeople:
def __init__(self, photos_return_valu... |
# -*- coding: utf-8 -*-
# 在类中定义装饰器
from functools import wraps
class A:
def deco1(self, func):
@wraps(func)
def wrapper(*args, **kwargs):
print('instance deco')
return func(*args, **kwargs)
return wrapper
@classmethod
def deco2(cls, func):
@wraps(f... |
import re
import time
from mycroft import MycroftSkill, intent_file_handler, intent_handler
from mycroft.util import LOG
from jikanpy import Jikan
from jikanpy.exceptions import APIException
USERNAME_SETTING_KEY = 'username'
class Mal(MycroftSkill):
def __init__(self):
MycroftSkill.__init__(self)
de... |
import requests
from infraboxcli.log import logger
session = requests.Session()
connection_error_message = 'Can\'t connect to the remote. Please, check your connection or remote url.'
def get(url, headers=None, cookies_handler=None, verify=None, timeout=60):
try:
response = session.get(url, headers=head... |
"""
The MIT License (MIT)
Copyright (c) 2021-Present AbstractUmbra
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, modif... |
from .tokens import tokens
from .Scanner import Scanner
__all__ = ['tokens', 'Scanner']
|
"""
This holds a set of constant variables for qute
"""
import os
import logging
from . import resources
log = logging.getLogger('qute')
# -- This is the name of the environment variable we will
# -- check for
QUTE_STYLE_PATH = 'QUTE_STYLE_PATH'
# -- This will look at the environment variable for styles and pull
#... |
import os
import shutil
from boltons import funcutils as bfu
from google.cloud import storage as gs
from joblib.disk import mkdirp
from memoized_property import memoized_property
from . import blobstores as bs
# TODO: catch and retry w/new client on
# BrokenPipeError: [Errno 32] Broken pipe
# ConnectionResetError: ... |
"""
"""
from caysen.game.state import GameSubSystem
from caysen.kernel import Kernel
from caysen.subsystem.audio import AudioSubSystem
from caysen.subsystem.display import DisplaySubSystem
from caysen.subsystem.input import InputSubSystem
def create_kernel():
kernel = Kernel()
kernel.add(AudioSubSystem())
... |
"""LCLS2 data format assumes that 2d panel data is saved in dict = {<panel-number>:<panel-data-2d>}.
This module is intended to test consumed time for conversion from 3-d array to diict and back.
"""
from time import time
import numpy as np
from psana.detector.NDArrUtils import info_ndarr, print_ndarr
def load_n... |
# MIT License
#
# Copyright The SCons Foundation
#
# 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, ... |
from django.urls import path
from . import views as v
app_name='home'
urlpatterns = [
path('',v.Home, name='Home'),
path('somos/',v.QuemSomos, name='QuemSomos'),
path('local/',v.Localizacao, name='Localizacao'),
path('Agradecimentos/', v.Agradecimentos, name='Agradecimentos')
]
|
# type: ignore
from fastapi import APIRouter
from typing import List
from base.provider import pancake as provider
from base.schema import pancake as api
router = APIRouter()
@router.get("/types",
name="List Pancake types",
description="Fetch list of all available pancake types",
... |
# -*- coding: utf-8 -*-
"""
directors component module.
"""
from pyrin.application.decorators import component
from pyrin.application.structs import Component
from charma.persons.directors import DirectorsPackage
from charma.persons.directors.manager import DirectorsManager
@component(DirectorsPackage.COMPONENT_NAM... |
import re
import json
import fire
import time
from tqdm import tqdm
from datetime import datetime, timedelta
from collections import Counter
from Config import get_noau_config
_, db, r = get_noau_config()
def get_query_str(partner, triggers, target):
# start = (now - time_delta).strftime("%Y-%m-%d %H:%M:%S")
... |
from acondbs import ops
from acondbs.models import Log
def test_create(app):
with app.app_context():
count = Log.query.count()
model = ops.create_log(level="ERROR", message="An exception occurred")
assert model.message == "An exception occurred"
ops.commit()
id_ = model.id... |
from .base import * # noqa
POCKET_CONSUMER_KEY = env.str("POCKET_CONSUMER_KEY", default="CONTINUOUSINTEGRATION")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.