text stringlengths 1 927k |
|---|
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
from utils.masked_cross_entropy import *
from utils.config import *
import random
import numpy as np
import datetime
from utils.measures import wer,moses_multi_bleu
from tqdm import tqdm
from s... |
arguments = ["self", "info", "args"]
minlevel = 4
helpstring = "join <channel>"
def main(connection, info, args):
"""Makes sonicbot join a channel"""
connection.rawsend("JOIN %s\n" % (args[1])) |
# -*- coding: utf-8 -*-
###############################################################################
#
# ShowUser
# Returns information about given user.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ... |
i = 0 # This is an example of the while loop
while i < 5:
print(i)
i += 1
i = None # 0
# 1
# 2
# 3
# 4
for i in range(5): # This example uses the iterable object 'range'
print(i) # 0
# 1
# 2
# 3
... |
"""The tests for the Logger component."""
from collections import namedtuple
import logging
import unittest
from homeassistant.setup import setup_component
from homeassistant.components import logger
from tests.common import get_test_home_assistant
RECORD = namedtuple('record', ('name', 'levelno'))
NO_DEFAULT_CONFI... |
import torch
from ..utils import box_utils
from .data_preprocessing import PredictionTransform
from ..utils.misc import Timer
class Predictor:
def __init__(self, net, size, mean=0.0, std=1.0, nms_method=None,
iou_threshold=0.45, filter_threshold=0.01, candidate_size=200, sigma=0.5, device=None):... |
# 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.package import *
class PyProtobuf(PythonPackage):
"""Protocol buffers are Google's language-neutral, plat... |
# Copyright (c) 2010-2011 OpenStack Foundation
#
# 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 torch import nn
from tsl.nn.utils import utils
class Dense(nn.Module):
r"""
A simple fully-connected layer.
Args:
input_size (int): Size of the input.
output_size (int): Size of the output.
activation (str, optional): Activation function.
dropout (float, optional): D... |
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from recipe import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
router.register('ingredinets', views.IngredientViewSet)
router.register('recipes', views.RecipeViewSet)
app_name = 'recipe'
urlpatterns ... |
# -*-coding:utf-8 -*-
u"""
:创建时间: 2022/3/17 23:09
:作者: 苍之幻灵
:我的主页: https://cpcgskill.com
:QQ: 2921251087
:爱发电: https://afdian.net/@Phantom_of_the_Cang
:aboutcg: https://www.aboutcg.org/teacher/54335
:bilibili: https://space.bilibili.com/351598127
""" |
############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import gym
from gym.envs.registration import register
import sys, os
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import random as pr
class DQN:
def __init__(self, session, input_size, output_... |
"""SCons.Tool.as
Tool-specific initialization for as, the generic Posix assembler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The S... |
import pytest
from collections import OrderedDict
from test_plus import APITestCase
from tests.profile.factories import ProfileFactory, IndicatorCategoryFactory, IndicatorSubcategoryFactory, ProfileIndicatorFactory
from tests.datasets.factories import DatasetFactory, IndicatorFactory, IndicatorDataFactory, GroupFacto... |
# -*- encoding: utf-8 -*-
# Copyright 2019 the authors.
# This file is part of Hy, which is free software licensed under the Expat
# license. See the LICENSE.
import math, itertools
from hy import mangle
from hy._compat import PY36
import hy.importer
def test_direct_import():
import tests.resources.pydemo
as... |
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... |
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.core.exceptions import ValidationError, PermissionDenied
from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from dja... |
import os
from PyQt4 import QtCore, QtGui
import envi.cli as e_cli
import envi.qt.memory as e_q_memory
import envi.qt.memcanvas as e_q_memcanvas
#from envi.threads import firethread
import vqt.colors as vq_colors
import vqt.hotkeys as vq_hotkeys
#import vqt.shortcut as vq_shortcut
from vqt.basics import *
from vqt.... |
# This file may be modified by the user (or site administrator, in a
# multi-user environment) to change settings or modify VPython to work
# around local configuration issues.
## Disabling shaders may be necessary on some systems where Visual fails
## to detect that the video hardware or drivers are incapable of comp... |
from os.path import join, exists, isdir
import json
from functools import lru_cache
import pathlib
import typing
from sys import intern
from . import lazyproperty
from . import _types
from .exceptions import InvalidCachePackage
import tarfile
class PackagePool(object):
"""
Common pool for sharing PackageIn... |
from django.core.exceptions import ValidationError
import re
def validate_password(value):
if not re.match(r'', value):
raise ValidationError("Password must be ...") |
# -*- coding: utf-8 -*-
"""DrCIF test code."""
import numpy as np
from sklearn.metrics import accuracy_score
from sktime.classification.interval_based import DrCIF
from sktime.datasets import load_unit_test
def test_drcif_train_estimate():
"""Test of DrCIF on unit test data."""
# load unit test data
X_tr... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mushrooms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... |
"""
Software License Agreement (Apache 2.0)
Copyright (c) 2020, The MITRE Corporation.
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
https://www.apache.org/licenses/LICENSE-... |
import enum
from abc import ABC, abstractmethod
from .errors import FieldError, FormError
from .fields import UnboundField
LAMBDA = lambda:0
class JsonForm(ABC):
def __init__(self, data: dict = None):
self.fields = list()
for name, obj in self.__class__.__dict__.items():
if not isinst... |
import copy
def mult_in(needles, haystack):
for needle in needles:
if needle in haystack:
return True
return False
class OcrHint:
SINGLE_LINE = 'single_line'
SPARSE = 'sparse'
class Rect:
def __init__(self, x, y, w=0, h=0, *, right=None, bottom=None):
self.x = x
... |
# Copyright 2021 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 wr... |
# Generated by Django 2.1 on 2020-06-04 10:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('analysis', '0007_product_date_w'),
]
operations = [
migrations.AlterField(
model_name='product',
name='date_w',
... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.WGL import _types as _cs
# End users want this...
from OpenGL.raw.WGL._types import *
from OpenGL.raw.WGL import _errors
from OpenGL.constant import Constant as _C
import ctype... |
from __future__ import print_function
_ = raw_input()
words = [set(w) for w in raw_input().split()]
result = 0
def search(words, layer=0):
global result
if len(words) + layer <= result:
# simple cut
return
if layer > result:
result = layer
def isConflict(word1, word2):
... |
# 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... |
"""This module implements an ORIGEN v2.2 transmutation solver.
"""
from __future__ import print_function, division
import os
import subprocess
import tempfile
from collections import Mapping
from warnings import warn
from pyne.utils import QAWarning
import numpy as np
from pyne import data
from pyne import rxname
fr... |
import urllib.request
with urllib.request.urlopen("https://www.google.com/") as response:
html = response.read()
print(html) |
import numpy as np
def computeCentroids(X, idx, K):
"""returns the new centroids by
computing the means of the data points assigned to each centroid. It is
given a dataset X where each row is a single data point, a vector
idx of centroid assignments (i.e. each entry in range [1..K]) for each
examp... |
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noq... |
# SPDX-FileCopyrightText: 2017 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_bme280.advanced`
=========================================================================================
CircuitPython driver from BME280 Temperature, Humidity and Barometric
Pressure sensor
* Author(s): l... |
# 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 Relax(CMakePackage):
"""A set of Reflex libraries for the most common used general data ty... |
#!/usr/bin/env python
# import dddoc
# import dddoc_html
# import sys
# import os
#
# # Command line: main.py <inpath> [ <module> ]*
#
# if len(sys.argv) < 2: inpath = "../../projects/library"
# else: inpath = sys.argv[1]
#
# print("Welcome to Dot.Dot.Doc")
#
# buildfull = (len(sys.argv) < 3)
# indexonly = not bui... |
import signal
import time
import numpy as np
from pyqtgraph.Qt import QtCore
import pyqtgraph as pg
import config
from pyqtgraph.graphicsItems.LabelItem import LabelItem
from pyqtgraph.graphicsItems.TextItem import TextItem
class Plotter:
"""
Displays a grid of plots in a window
"""
def __init__(se... |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/tyler/Github/game-design/devel/include".split(';') if "/home/tyler/Github/game-design/devel/include" != "" else []
PROJECT_CATKIN_DEPENDS = "std_msgs;message_runtime".replace(';', ' ')
PKG_CONFIG... |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:2992")
else:
access = Ser... |
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_snov
# Purpose: Spiderfoot plugin to search Snov.IO API for emails
# associated to target domain
#
# Author: Krishnasis Mandal <krishnasis@hotmail.com>
#
# Created: 1... |
from .menus_view import MenuView
from .players_view import PlayerView
from .tournaments_view import TournamentView
from .rounds_view import RoundView |
# import needed library
import os
import logging
import random
import warnings
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.multiprocessing as mp
from utils import net_builder, get_logger, count_parame... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 21 14:43:51 2020
@author: w6733
"""
from subprocess import Popen, PIPE
from threading import Thread
from queue import Queue, Empty
import shlex
import re
from time import time#, sleep
def strip_newline(string):
nl_match = re.compile(r'(?P<str>^.*)[/r/n]*$')
retur... |
from os.path import join
from pydantic import BaseSettings
import appdirs
APP_NAME = "iscc-registry"
APP_DIR = appdirs.user_data_dir(appname=APP_NAME)
ENV_PATH = join(APP_DIR, ".env")
__version__ = "0.1.0"
# Ledger-ID Ethereum
LEDGER_ID_ETH = 0b01000000 .to_bytes(1, "big")
class Settings(BaseSettings):
ipfs_a... |
#!/usr/bin/env python3
import actionlib
import argparse
import math
import os
import random
import rospy
import sys
from time import sleep
from actionlib_msgs.msg import GoalStatus
from geometry_msgs.msg import Vector3, Quaternion
from bitbots_msgs.msg import KickGoal, KickAction, KickFeedback
from visualization_msgs... |
"""
Test for the Plot class.
"""
import unittest
from topo.base.sheet import *
#from testsheetview import ImageGenerator
SHOW_PLOTS = False
### JC: My new imports
from topo.plotting.plot import make_template_plot
import numpy as np
import param
from holoviews.core import BoundingBox, NdMapping
from holoviews.inte... |
import numpy as np
import networkx as nx
class SearchTree:
def __init__(self,net,i_m, f_m):
self.net = net
self.i_m = i_m
self.f_m = f_m
def compute_incidence_matrix(self,net):
"""
We compute the incidence matrix of a Petri Net. It provides us with the firing requirem... |
"""Tests for updating PlanNodeStatus"""
import time
from tamr_unify_client.operation import Operation
from tamr_toolbox.workflow.concurrent import PlanNodeStatus, PlanNode
from tamr_toolbox.utils.testing import mock_api
from tamr_toolbox import utils
from tests._common import get_toolbox_root_dir
CONFIG = utils.conf... |
# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Endpoi... |
# -*- coding: utf-8 -*-
from pyramid.view import view_config
from h.notification.models import Subscriptions
@view_config(route_name='unsubscribe',
renderer='h:templates/unsubscribe.html.jinja2')
def unsubscribe(request):
token = request.matchdict['token']
payload = request.registry.notification... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
import numpy as np, time, sys
import smbus2
# code of driver class included below
# import relevant pieces from adafruit
class groveADCConfig(object):
'''grove ADC configuration and in... |
# Copyright 2014 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 ... |
from arm.logicnode.arm_nodes import *
class MergeNode(ArmLogicTreeNode):
"""Activates the output when any connected input is activated.
@option New: Add a new input socket.
@option X Button: Remove the lowermost input socket."""
bl_idname = 'LNMergeNode'
bl_label = 'Merge'
arm_section = 'flow'... |
from secrets import token_hex
from textwrap import dedent
from PySide6.QtCore import QObject
from PySide6.QtQml import QQmlComponent
from lk_logger import lk
from .. import path_model
from ..pyside import app
from ..pyside import pyside
from ..typehint.qmlside import *
def setup():
def register_qmlside(obj: TQO... |
# Bubblebox
# Author: Audun Skau Hansen 2022
import bubblebox.mdbox
import bubblebox.binding_models
import bubblebox.ising
import bubblebox.lattice_models
from bubblebox.mdbox import mdbox, box
from bubblebox.binding_models import bindingbox
from bubblebox.ising import isingbox
from bubblebox.lattice_models import ... |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
l = [
{
"name": "Karyn Hewitt",
"email": "malesuada@Sedneque.org",
"created": "2014-05-01T12:46:02-07:00",
"company": "Scelerisque Scelerisque Corporation",
"address": "1355 Semper. Av.",
"city": "Oostkerke",
"gps": "4.43078, -70.00362",
"iban": "AD2767222199357116156730"
},
{
"name": "Amelia Hayes... |
#!/usr/bin/env python
# Copyright (c) 2018-2018 The Elements Explorer developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
if __name__ != '__main__':
raise ImportError(u"%s may only be run as a script" % __file__)
prin... |
from aparse import click, ConditionalType
import os
import tqdm
import json
import numpy as np
from PIL import Image
from typing import Optional
from typing import List
from viewformer.utils.tensorflow import load_model
from viewformer.data.loaders import get_loaders
import tensorflow as tf
from viewformer.evaluate.eva... |
import platform
from PIL import Image
import constants
import gen_ascii
CHARS = gen_ascii.get_char_set(
constants.CHAR_DARKNESS_TEXT_ONLY, constants.MAX_VAL
)
more = gen_ascii.get_char_set(
constants.CHAR_DARKNESS_NON_TEXT, constants.MAX_VAL
)
i = 0
for smaller_list in CHARS:
for character in more[i]:
... |
import abc
import re
import textwrap
from parse import parse
from string import Formatter
__all__ = ["UnresolvedRef", "Label", "Operand", "Instr"]
class UnresolvedRef(Exception):
pass
class Label:
__slots__ = ["name"]
def __init__(self, name):
self.name = name
def __repr__(self):
... |
# Adapted from
# https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/SpeechSynthesis/FastPitch
# Copyright (c) 2019 NVIDIA CORPORATION. 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 ob... |
# not to use sys and use python packages
from .control_task_base import ControlTaskBase
""" This test control task demonstrates how to set and read info from the SFR"""
class TestControlTask(ControlTaskBase):
def __init__(self):
pass
def default(self):
self.sfr.set("test", True)
def ex... |
import psycopg2
from flask_restful import Resource, reqparse
from api.app.v2.models.user import UserModel
class UserRegistration(Resource):
"""User registration class."""
parser = reqparse.RequestParser()
parser.add_argument('name',
type=str,
required=True,
help="Name cannot be... |
import inspect
class NotApplicableError(Exception):
"""Raised when a method of a class instance is called but when such class should not call the method"""
def __init__(self, *args):
if len(args) == 0:
stack = inspect.stack()[1]
_class = stack.frame.f_locals['self'].__class__.... |
import logging
from functools import wraps
from typing import Any, Callable, Dict, List, Optional, Type, Union
import numpy as np
import great_expectations.exceptions as ge_exceptions
from great_expectations.core import ExpectationConfiguration
from great_expectations.core.util import convert_to_json_serializable
fro... |
from promissory_note.entities import Beneficiary, Emitter, PromissoryNote
from promissory_note.value_objects import Name, Cpf, Email
class IssuePromissoryNote:
def __init__(self, image_generation_service, email_promissory_note_issued):
self._image_generation_service = image_generation_service
self... |
import os
import sys
from tkinter import *
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from keras_en_parser_and_analyzer.library.dl_based_parser import line_types, line_labels
from keras_en_parser_and_analyzer.library.utility.io_utils import read_pdf_and_docx
class AnnotatorGui(Frame):
def __... |
from ._orca import (
ensure_server,
shutdown_server,
validate_executable,
reset_status,
config,
status,
) |
import json
from django.test import Client
from django.urls import reverse
from django.test.client import RequestFactory
from rest_framework import status
from rest_framework.test import APITestCase
from api.account.models import User
from api.like.models import Like
from .REST_API.serializers import PostSerializer
... |
'''
Variables that are created outside of a function (as in all of the examples above) are known as global variables.
Global variables can be used by everyone, both inside of functions and outside.
'''
import global_var_one
print(f'global_var_one.x: {global_var_one.x}')
'''
update the global variable
'''
global_v... |
# 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 ... |
from ztag.annotation import *
class NetGearSmartSwitch(Annotation):
protocol = protocols.HTTP
subprotocol = protocols.HTTP.GET
port = None
tests = {
"netgear_smart_switch":{
"global_metadata":{
"manufacturer":Manufacturer.NETGEAR,
"device_type":Type.SWITCH,
... |
import logging
import colorama
from colorama import Fore, Style
from terminaltables import SingleTable
from pprint import pformat
import datetime
import re
from me4storage.api.session import Session
from me4storage.common.exceptions import ApiError
from me4storage.common.nsca import CheckResult
import me4storage.commo... |
import os
import sys
import cPickle as pickle
import numpy as np
import tensorflow as tf
def _read_data(data_path, train_files):
"""Reads CIFAR-10 format data. Always returns NHWC format.
Returns:
images: np tensor of size [N, H, W, C]
labels: np tensor of size [N]
"""
images, labels = [], []
# Loa... |
import unittest
from unittest.mock import MagicMock, patch
import prestodb
import tdclient
from pytd import __version__
from pytd.query_engine import HiveQueryEngine, PrestoQueryEngine
class QueryEngineEndpointSchemeTestCase(unittest.TestCase):
def test_presto_endpoint(self):
presto = PrestoQueryEngine(... |
"""Fisheries."""
import logging
import csv
import os
from osgeo import gdal
from . import fisheries_io as io
from . import fisheries_model as model
from .. import utils
from .. import validation
LOGGER = logging.getLogger(__name__)
LABEL = 'Fisheries'
ARGS_SPEC = {
"model_name": "Fisheries",
"module": __nam... |
from tests.helper import restricted_exec
SIMPLE_SUBSCRIPTS = """
def simple_subscript(a):
return a['b']
"""
def test_read_simple_subscript(mocker):
value = None
_getitem_ = mocker.stub()
_getitem_.side_effect = lambda ob, index: (ob, index)
glb = {'_getitem_': _getitem_}
restricted_exec(SIMP... |
#!/usr/bin/env python2
from __future__ import absolute_import
import copy
import imp
import json
import logging
import os
import subprocess
import traceback
import six.moves.configparser
from ansible.module_utils.basic import AnsibleModule
ANSIBLE_METADATA = {"metadata_version": "1.1", "status": ["preview"], "suppo... |
# Generated by Django 2.2.3 on 2019-08-03 23:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('emails', '0005_auto_20190802_0145'),
]
operations = [
migrations.AddField(
model_name='email',
name='internal_title'... |
# -*- coding: utf-8 -*-
'''
This module contains an opionated gateway for the capakey webservice.
.. versionadded:: 0.2.0
'''
from __future__ import unicode_literals
import six
import json
import logging
log = logging.getLogger(__name__)
from crabpy.gateway.exception import (
GatewayRuntimeException,
Gatew... |
# Copyright (c) 2014, Morgan Herlocker (JavaScript implementation)
# Copyright (c) 2021, CARTO
from helper import length_to_radians
from math import radians, asin, cos, sin, atan2, degrees
from ..helper import PRECISION
import geojson
def destination(geom, distance, bearing, units):
# Check if geom is a point
... |
import unittest
from collections import Counter
from libs.review_db import ReviewDB
from libs.nlp_length_functions import NLPLengths
from libs.histogram_comparisons import HistogramComparison
class HistogramTests(unittest.TestCase):
def test_density_estimator(self):
db = ReviewDB('tests/test_data/')
... |
# coding=utf-8
# 创建人员
import requests
import json
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
'Content-Type': 'application/json; charset=UTF-8'
}
data = {
"userid": "fenxiaohui",
"name": "冯晓辉",
... |
# Copyright 2012-2014 Ravello Systems, 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 t... |
# 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... |
"""Support for Abode Security System alarm control panels."""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
ATTR_ATTRIBUTION,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED,
)
from . import AbodeDevice
from .const im... |
from setuptools import setup, find_packages
__version__ = '0.1.12'
config = dict(
name='hoursofoperation',
packages=find_packages('.', include=['hoursofoperation', 'hoursofoperation.*']),
version=__version__,
description = 'Utilities for loading and doing calculations with a partner\'s hours of oper... |
from graphviz import Digraph
from graphviz import Graph
import yaml
import sys
VERSION = '2019.12.09'
YAML_TAG_CONFIGURATION = 'config'
YAML_TAG_CONFIGURATION_COLORING = 'coloring'
YAML_TAG_STATES_SPECIAL = 'states_special'
YAML_TAG_STATES_TRANSITIONS = 'states_transitions'
YAML_TAG_SECONDARY_STATE_CHECK = 'secondary... |
"""empty message
Revision ID: 0c18ff62b414
Revises: ad7d196d91e9
Create Date: 2021-07-12 14:07:02.060217
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0c18ff62b414'
down_revision = 'ad7d196d91e9'
branch_labels = None
depends_on = None
def upgrade():
# ... |
''' A module for the various different errors that can be raised. '''
class AbortError(Exception):
''' An exception for aborting computations with.
This is thrown by clicking 'cancel' on a progress box. '''
def __init__(self, message=None):
super().__init__()
self.message = messag... |
from ccmlib.node import Node
from decorator import decorator
from distutils.version import LooseVersion
from threading import Thread
import re, os, sys, fileinput, time, unittest, functools
from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from dtest import Tester, DISABLE_VNODES
de... |
"""Implementations restoration functions"""
import numpy as np
import numpy.random as npr
from scipy.signal import fftconvolve, convolve
from . import uft
__keywords__ = "restoration, image, deconvolution"
def wiener(image, psf, balance, reg=None, is_real=True, clip=True):
"""Wiener-Hunt deconvolution
Re... |
# system modules
from pykeepass import PyKeePass
import string
import getpass
import sys
# own modules
import getch
import fuzzy
def clearScreen():
print(chr(27) + "[2J" + chr(27) + "[H", end='')
def resetColor():
print(chr(27) + "[0m", end='')
def grayScale(level):
cmap = ["37;1", "37"]
if level > ... |
import datetime
import os
import re
import time
from data.Instance import *
from data.TensorInstances import *
from data.Vocab import *
rex = ['blk_(|-)[0-9]+', '(/|)([0-9]+\.){3}[0-9]+(:[0-9]+|)(:|)']
def creatVocab(alldatas):
'''
All instances for vocab generation
:param alldatas: ALL instances list
... |
# # single inheritance
# class Employee:
# company = 'Google'
# def showDetails(self):
# print("This is an employee")
# class Programmer(Employee):
# language = "Python"
# def getLang(self):
# print(f"the language is {self.language}")
# #if there are two same method in base and ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.