text stringlengths 2 999k |
|---|
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
DEFAULTS = {
'label': '{icon}',
'label_alt': '{percent}% | remaining: {time_remaining}',
'update_interval': 5000,
'time_remaining_natural': False,
'charging_options': {
'icon_format': '{charging_icon} {icon}',
'blink_charging_icon': True
},
'status_thresholds': {
'cri... |
# -*- coding: utf-8 -*-
try:
from ztec.zdb import DB
except:
from zdb import DB
db=DB()
db.load=True
db('Menus').campo('Nombre',db.str,False,True,False,False,0,-1,None,None)
db('Menus').campo('Contenido',db.list,False,True,False,False,0,-1,None,None)
db('Menus').campo('args',db.dict,False,True,False,False,0,-1,None,N... |
# Copyright 2021 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, ... |
import logging
import dask.dataframe as dd
import pandas as pd
from dask_sql.datacontainer import ColumnContainer, DataContainer
from dask_sql.java import org
from dask_sql.physical.rel.base import BaseRelPlugin
from dask_sql.utils import convert_sql_kwargs, import_class
logger = logging.getLogger(__name__)
class ... |
#!/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', 'actstudiosbackend.settings')
try:
from django.core.management import execute_from_command_line
e... |
#!/usr/bin/env python
#
# Appcelerator Titanium Module Packager
#
#
import os, subprocess, sys, glob, string
import zipfile
from datetime import date
cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
os.chdir(cwd)
required_module_keys = ['name','version','moduleid','description','copyright','... |
#4. 利用reduce实现列表中元素求积
from functools import reduce
k = eval(input("请输入列表中的元素:")) #eval识别将输入的元素记到一个元组中
#print(type(k))
l = list(k) #将元组转换为列表
r = reduce(lambda x, y : x * y,l) # 利用reduce求所有元素的积
print("{}的所有元素的积为{}".format(l,r))
|
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def isSubtree(self, root: Optional[TreeNode], subRoot: Optional[TreeNode]) -> bool:
if not root or n... |
# -*- coding: utf-8 -*-
from sst_unittest import *
from sst_unittest_support import *
################################################################################
# Code to support a single instance module initialize, must be called setUp method
module_init = 0
module_sema = threading.Semaphore()
def initialize... |
# -*- encoding: utf-8 -*-
"""
Created by eniocc at 11/10/2020
"""
import ctypes
from py_dss_interface.models import Bridge
from py_dss_interface.models.Base import Base
from py_dss_interface.models.LoadShapes.LoadShapesS import LoadShapesS
from py_dss_interface.models.Text.Text import Text
class LoadShapesV(Base):
... |
from bigwebsite.data.switch import switch as sw
from bigwebsite.data.stack import callinfo as ci
from bigwebsite.elements.html import status as s
from bigwebsite.include.views import Response
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2019, 2020 Assured Information Security, Inc.
#
# 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 restric... |
import os
import numpy as np
from .utils import download_url, makedir_exist_ok
class JeopardyData:
"""Jeopardy Dataset.
Parameters
----------
root str :
Root directory of dataset where ``processed/training.npy`` lives.
download : bool, optional
If true, downloads the dataset fro... |
# 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 agreed to in writing, software
#... |
class Solution:
def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]:
d = {}
for num in nums1:
d[num] = d.get(num, 0) + 1
result = []
for num in nums2:
if num in d and d[num] > 0:
d[num] -= 1
re... |
#!/usr/bin/env python
"""
The script builds OpenCV.framework for iOS.
The built framework is universal, it can be used to build app and run it on either iOS simulator or real device.
Usage:
./build_framework.py <outputdir>
By cmake conventions (and especially if you work with OpenCV repository),
the output dir sh... |
from .orm.utils import get_num_of_tables
from .lineup import Lineup
from .completer import Completer
class Console(object):
def __init__(self, round, segment, table=None):
self.round = round
self.segment = segment
self.start_from_table = table if table is not None else 1
... |
from typing import Tuple
import numpy as np
import pandas as pd
def split_train_test(X: pd.DataFrame, y: pd.Series, train_proportion: float = .75) \
-> Tuple[pd.DataFrame, pd.Series, pd.DataFrame, pd.Series]:
"""
Randomly split given sample to a training- and testing sample
Parameters
-------... |
#!/usr/bin/env python
from setuptools import setup
install_requires = [
'six>=1.9.0',
'pytimeparse>=1.1.5',
'parsedatetime>=2.1',
'Babel>=2.0',
'isodate>=0.5.4',
'python-slugify>=1.2.1',
'leather>=0.3.2',
'PyICU>=2.4.2',
]
setup(
name='agate',
version='1.6.2',
description=... |
from __future__ import absolute_import, division, print_function
# LIBTBX_SET_DISPATCHER_NAME cctbx.xfel.plot_run_stats_from_experiments
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT=1
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export BOOST_ADAPTBX_FPE_DEFAULT=1
from libtbx.phil import parse
from libtbx.uti... |
#!/usr/bin/env python
import sys, re
from epasswd import EPasswd
if len(sys.argv)<4:
sys.exit(-2)
passfile=sys.argv[1]
myfaction=sys.argv[2]
mypasswd=sys.argv[3]
if mypasswd[0]=='"':
mypasswd=mypasswd[1:len(mypasswd)-1]
pw_data=EPasswd(passfile)
if pw_data.fac_exists(myfaction):
if pw_data.check(myfact... |
"""Message service"""
import asyncio
import logging
import socket
import time
from collections import deque
from multiprocessing import Event, Lock, Process, synchronize
from typing import Deque, Dict, Set
from uuid import uuid4
from .client import Client, LOCALHOST
from .connection_wrapper import NoData, NotMessage,... |
from unittest import mock
from unittest.mock import MagicMock
from hamcrest import assert_that, equal_to, contains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from tests.unit.unit_test_utils import check_mocked_functions_called
from uitestcore.finder import Finder
from ui... |
#!/usr/bin/env python3
# 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.
"""macOS specific tests."""
import re
import time
import psutil
from psutil import MACOS
from psutil import POSIX
from psutil.tes... |
#!/usr/bin/python
'''
Gets the inet4 addr assigned to an iface and texts it to a cellphone
'''
# Library for sys.exit
import sys
# Libraries for sending an SMS via SMTP
import smtplib
from email.mime.text import MIMEText
# Libraries for getting and formatting the current time
import time
import datetime
# Library f... |
# Copyright 2016 Google 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 writing, ... |
""" Step Scheduler
Basic step LR schedule with warmup, noise.
Hacked together by / Copyright 2020 Ross Wightman
"""
import math
import torch
from .scheduler import Scheduler
class StepLRScheduler(Scheduler):
"""
"""
def __init__(self,
optimizer: torch.optim.Optimizer,
... |
from __future__ import print_function, division
from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins import object
import os
import pickle as pickle
import numpy as np
from scripts import optim
class Solver(object):
"""
A Solver encapsulates all th... |
from django.contrib import messages
from django.http.response import HttpResponse
from django.core.mail import send_mail
from django.conf import settings
from django.shortcuts import redirect
from dashboard.models import *
def tasK_status_change(request):
if request.method == "GET" and request.is_ajax():
... |
from __future__ import absolute_import
from hashlib import sha256
import hmac
import json
import six
from sentry import options
from sentry.models import ApiToken, ProjectKey
from sentry.testutils import TestCase
UNSET = object()
class BaseWebhookTest(TestCase):
def setUp(self):
super(BaseWebhookTest, ... |
from redbreast.core.spec import AutoSimpleTask
from redbreast.core.spec import DONE
class CustomTask(AutoSimpleTask):
def default_execute(self, task, workflow):
print "Task %s executed, defined in CustomClass." % task.get_spec_name()
return DONE |
#!/usr/bin/env python2
# Copyright (c) 2015-2016 The MagnaChain Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if le... |
#!/usr/bin/env python
#
# texture.py - The Texture and Texture2D classes.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module provides the :class:`Texture` class, which is the base classes
for all other FSLeyes texture types. See also the :class:`.Texture2D` and
:class:`.Texture3D` classes.
"""
impor... |
import base64
import os
import cv2
import requests
import json
import numpy as np
import av
def ndarry2base64(img_np):
image = cv2.imencode('.jpg', img_np)[1]
base64_data = str(base64.b64encode(image))[2:-1]
return base64_data
def video_test():
# video_path = "/home/cv/AI_Data/MOT_dataset/HT21-03-ra... |
# Copyright (c) 2012 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.
from perf_tools import smoothness_metrics
from telemetry.core import util
from telemetry.page import page_measurement
class DidNotScrollException(page_me... |
import blspy
from chives.types.blockchain_format.sized_bytes import bytes32
def std_hash(b) -> bytes32:
"""
The standard hash used in many places.
"""
return bytes32(blspy.Util.hash256(bytes(b)))
|
# Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.testing import assert_allclose, assert_array_less
from scipy.interpolate import interp1d
from scipy.spatial.distance import cdist
import pytest
from mne import pick_types, pick_info
from mne... |
# Plot the Gaussian curvature of an example mesh. Override the
# default scalar bar range as the mesh edges report high
# curvature.
#
from pyvista import examples
hills = examples.load_random_hills()
hills.plot_curvature(curv_type='gaussian', smooth_shading=True,
clim=[0, 1])
|
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
# import pathlib
# import pkg_resources
from setuptools import setup, find_packages
# install_requires = []
# with pathlib.Path('requirements.txt').open() as requirements_txt:
# install_requires = [
# str(requirement)
# for requirement
# in pkg_resources.parse_requirements(requirements_txt... |
from setuptools import setup, find_packages
import os
setup(
name="atcli",
version="0.0.1",
packages=find_packages(),
python_requires=">=3.7.3",
install_requires=[
"click==8.0.0",
],
entry_points={
'console_scripts': [
'atcli = atcli.cli:main'
]
}
)
|
from pins import pin_empty_pump, pin_full_pump, pin_pump_control
import time
from helpers import clock, dbg
MINUTE_MS = 60000
COOLDOWN = 1 * MINUTE_MS
class PlumbingSystem:
def __init__(self):
self.tank = Tank()
self.pump = Pump()
self.last_activation = time.ticks_ms() - MINUTE_MS
de... |
# Generated by Django 2.0 on 2018-12-20 16:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('asset', '0001_initial'),
('auth', '0009_alter_user_last_name_max_length'),
]
operations =... |
import itertools
import scipy
import numpy as np
import plotly.express as px
import pandas as pd
import os
import json
from copy import deepcopy
from pymatgen import MPRester
from pymatgen.analysis.phase_diagram import PhaseDiagram
from pymatgen.util.string import latexify
from piro.data import GASES, GAS_RELEASE, DEFA... |
import tensorflow as tf
import sys
tf.logging.set_verbosity('WARN')
tf.compat.v1.enable_eager_execution()
files=sys.argv
for f in sys.argv[1:]:
print(f, sum(1 for i in tf.data.TFRecordDataset(f)))
|
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
from django.test import TestCase
from task.models import Task, Tag
from task.serializers import TaskSerializer
from django.conf import settings
class TestFullImageUrl(TestCase):
def setUp(self) -> None:
self.path = '/media/image.png'
self.task = Task.objects.create(name='demo', image='/image.png'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... |
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
import time
import json
import uvloop
import asyncio
from blinker import signal
from elasticsearch.helpers import bulk
from elasticsearch import Elasticsearch
from concurrent.futures import ThreadPoolExecutor
from utils import log
from utils import lpop_redis
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
l... |
# Created follow a tutorial at: https://towardsdatascience.com/how-to-track-coronavirus-with-python-a5320b778c8e
from datetime import date
from urllib.request import Request, urlopen
import pandas as pd
import smtplib
def get_data():
#req = Request('https://www.worldometers.info/coronavirus/#countries', headers=... |
# -*- coding: utf-8 -*-
from django.db import models, migrations
import webapp.apps.taxbrain.models
class Migration(migrations.Migration):
dependencies = [
('taxbrain', '0028_auto_20160926_1456'),
]
operations = [
migrations.AddField(
model_name='taxsaveinputs',
... |
# https://www.codechef.com/problems/PPSUM
def allen(d,n):
if(d==0): return n
else: return allen(d-1,sum(range(1,n+1)))
for T in range(int(input())):
d,n = map(int,input().split())
print(allen(d,n)) |
abi = [
{
"anonymous": False,
"inputs": [
{
"indexed": False,
"internalType": "bytes32",
"name": "uuid",
"type": "bytes32"
},
{
"indexed": False,
"internalType": "address",
"name": "codeAddress",
"type": "address"
}
]... |
helpMsg = {
"Pipe": "[u]Usage in Pipe mode[/u]\n\n \
1) Modify the [b]parameters[/b] so that they correspond to the real life pipes\n \
2) Connect the system to the [b]computer[/b]\n \
3) Select the [b]port[/b] on which the system is connected under the [b]Port[/b] section\n \
4) If the system has b... |
from .basestate import BaseState, BaseSubState
from .. import http
from ..objects.channelobject import (
CategoryChannel, ChannelType, DMChannel, GuildChannel, StageChannel,
StoreChannel, TextChannel, VoiceChannel
)
from ..snowflake import Snowflake
__all__ = ('ChannelState', 'GuildChannelState')
class Chann... |
'''
Cifar10 example in pytorch
'''
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import torch.optim as optim
from torchvision import datasets, transforms
from torchgpipe import GPipe
from torchgpipe.balance import balance_by_time
from typing import cast
import time
fro... |
from pygame import *
from random import randint
font.init()
font1 = font.SysFont("Arial Black", 30)
font2 = font.SysFont("Arial Black", 30)
win = font1.render("Выиграл!", True, (87, 80, 80))
lose = font1.render("Ты проиграл!", True, (87, 80, 80))
mixer.init()
mixer.music.load('space.ogg')
mixer.music.play()
fire_s... |
import pytest
from descarteslabs.common.proto.formats import formats_pb2
from descarteslabs.common.proto.destinations import destinations_pb2
from ..proto_to_user_dict import has_proto_to_user_dict
from ..user_dict_to_proto import user_dict_to_has_proto
@pytest.mark.parametrize(
"user_dict, msg_type",
[
... |
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@ecdsa.org
#
# 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... |
#!/router/bin/python
__copyright__ = "Copyright 2014"
"""
Name:
trex_general_test.py
Description:
This script creates the functionality to test the performance of the TRex traffic generator
The tested scenario is a TRex TG directly connected to a Cisco router.
::
Topology:
------- ... |
# -*- coding: utf-8 -*-
import os, uuid, re, pickle, urllib, glob
from gluon.admin import app_create, plugin_install
from gluon.fileutils import abspath, read_file, write_file
def reset(session):
session.app={
'name':'',
'params':[('title','My New App'),
('subtitle','powered by w... |
import json
import requests
import pickle
# open privates
with open('private.json', 'r') as f:
config = json.load(f)
# load token
with open('token', 'rb') as f:
token = pickle.load(f)
# refresh token
params = { 'grant_type': 'refresh_token',
'client_id': config['client_id'],
'refresh_token'... |
import io
import PIL.Image
import torch
from torchvision.prototype import features
from torchvision.transforms.functional import pil_to_tensor
__all__ = ["raw", "pil"]
def raw(buffer: io.IOBase) -> torch.Tensor:
raise RuntimeError("This is just a sentinel and should never be called.")
def pil(buffer: io.IOBas... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : gym_recorder.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 04/16/2020
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
import os.path as osp
import mujoco_py
from copy import deepcopy
import jacinle.io as ... |
#!/usr/bin/python
#----------------------------------------------------------------
# routeAsCSV - routes with OSM data, and generates a
# CSV file containing the result
#
#------------------------------------------------------
#------------------------------------------------------
# Copyright 2007-2008, Oliver White
... |
import pandas as pd
import numpy as np
data = np.array(["Bartu","Bozkurt","Osman"])
# s = pd.Series(data)
s = pd.Series(data ,index = [1,2,3])
print(s)
"""
0 Bartu
1 Bozkurt
2 Osman
dtype: object
"""
"""
1 Bartu
2 Bozkurt
3 Osman
dtype: objec... |
"""
Output functions
These are the output functions for latexing partitions and tableaux.
AUTHORS:
- Mike Hansen (?): initial version
- Andrew Mathas (2013-02-14): Added support for displaying conventions and
lines, and tableaux of skew partition, composition, and
skew/composition/partition/tableaux tuple shape.... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
import logging
from typing import List, Callable
import threading
from .mqtt_message import MQTTMessage
from . import topic_matcher
logger = logging.getLogger(__n... |
"""
This module houses the ctypes function prototypes for OGR DataSource
related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*,
OGR_Fld_* routines are relevant here.
"""
from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from djan... |
print('''Lista:
Produto 1 - R$5,30
Produto 2 - R$6,00
Produto 3 - R$3,20
Produto 4 - R$2,50
''')
qtde = int(input('Digite quantidade de produtos Desejados: '))
codigo = int(input('Digite codigo do Produto Desejado: '))
if codigo == 1:
valor_parcial = qtde * 5.30
... |
from .symbolicvector import SymbolicVector, symple_vector, ihat, jhat, khat
|
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
"""
FiftyOne utilities unit tests.
| Copyright 2017-2022, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import time
import unittest
from mongoengine.errors import ValidationError
import numpy as np
import fiftyone as fo
import fiftyone.constants as foc
import fiftyone.core.media as fom
import fiftyone.... |
from .test_primitives import *
from .test_addresses import *
from .test_bitfield import *
from .test_collections import *
|
"""
Copyright (c) 2018-2019 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 i... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import trillian_log_api_pb2 as trillian__log__api__pb2
class TrillianLogStub(object):
"""TrillianLog defines a service that can provide access to a Verifiable Log as defined in the
Verifiable Data Structures paper. It provides dire... |
import numpy as np
import cv2
import onnxruntime
import time
def test_conv2d(img, filter_size):
start = time.time()
# Load the model
model_path = f'conv_{filter_size}x{filter_size}.onnx'
ort_session = onnxruntime.InferenceSession(model_path)
# Run inference
ort_inputs = {ort_session.get_inputs()[0].name: i... |
import hashlib
door_id = "abbhdwsy"
known_answer = [
1739529, 1910966, 1997199, 2854555, 2963716, 3237361, 4063427, 7777889, 8460345,
9417946, 12389322, 12434824, 12850790, 12942170, 12991290, 13256331, 14024976,
15299586, 17786793, 17931630, 19357601, 19359925, 19808330, 20214395, 22339420,
23135423... |
from flask import redirect, url_for, request, send_from_directory
from . import app, talisman
from .helpers import render_template, convert_old_image_path, get_chapter_nextprev
from .validate import validate
from .config import get_config, DEFAULT_YEAR
import random
@app.route('/<lang>/<year>/')
@validate
def home(la... |
from django.urls import path
from django.conf.urls import url
from . import views
urlpatterns = [
# path('', views.index, name='index'),
url(r'^person_add', views.person_add, name='person_add'),
url(r'^person_search/(\w+)/$', views.person_search, name='person_search'),
url(r'^person_all', views.person_... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
"""This module contains the general information for VnicScsiIf ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class VnicScsiIfConsts:
OPER_STATE_DOWN = "down"
OPER_STATE_FAILED = "failed"
OPER_STATE_INDETERMINATE =... |
from . config_management import CONFIG_MANAGEMENT_HELP
class AwsumeException(Exception):
""""""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class ProfileNotFoundError(AwsumeException):
""""""
def __init__(self, profile_name='', message=''):
self.profile_nam... |
import logging
from types import FunctionType
from typing import Callable, List, Optional, Type, TypeVar, Union
import ray
from ray.rllib.utils.annotations import DeveloperAPI
from ray.rllib.evaluation.rollout_worker import RolloutWorker, \
_validate_multiagent_config
from ray.rllib.offline import NoopOutput, Json... |
from typing import List, Collection, Callable, Set, Generator, Tuple, Optional, ValuesView, Union
from .corpusHelper import *
from convokit.util import deprecation, warn
from .corpusUtil import *
from .convoKitIndex import ConvoKitIndex
import random
from .convoKitMeta import ConvoKitMeta
from .convoKitMatrix import Co... |
"""
The feed is an assembly of items of different content types.
For ease of querying, each different content type is housed in the FeedItem
model, which also houses metadata indicating the conditions under which it
should be included. So a feed is actually just a listing of FeedItem instances
that match the user's reg... |
# Time: O(m * n)
# Space: O(m * n)
class Solution(object):
def numEnclaves(self, A):
"""
:type A: List[List[int]]
:rtype: int
"""
directions = [(0, -1), (0, 1), (-1, 0), (1, 0)]
def dfs(A, i, j):
if not (0 <= i < len(A) and 0 <= j < len(A[0]) and A[i][j]... |
import numpy as np
from ..decorator import check_vector
class MAE:
def predict(self, y_predict, y):
result = np.mean(np.abs(y_predict - y))
return result
def __str__(self):
return 'mae'
class MSE:
@check_vector
def predict(self, y_predict, y):
result = np.square(y_predict - y)
result = ... |
config = {
"tenv" : {"tvar": 1}
}
|
"""
ASGI config for KulliSharif project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_S... |
"""
An integration module for the Virus Total v3 API.
API Documentation:
https://developers.virustotal.com/v3.0/reference
"""
from collections import defaultdict
from typing import Callable
from dateparser import parse
from CommonServerPython import *
INTEGRATION_NAME = "VirusTotal"
COMMAND_PREFIX = "vt"
INTEGRA... |
# -*- coding: utf-8 -*-
import unittest
from mock import patch, Mock
with patch('os.path.exists') as mock_exists:
mock_exists.return_value = True
import app as service_alti
from tests.unit_tests import DEFAULT_HEADERS
EAST_LV03, NORTH_LV03 = 632510.0, 170755.0
# LV95
EAST_LV95, NORTH_LV95 = 2632510.0, 117075... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This package runs a DDOS simulation"""
__Lisence__ = "BSD"
__maintainer__ = "Justin Furuness"
__email__ = "jfuruness@gmail.com, agorbenko97@gmail.com"
__status__ = "Development"
from .animater import Animater
|
import _plotly_utils.basevalidators
class YAxisValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(self, plotly_name="yaxis", parent_name="candlestick", **kwargs):
super(YAxisValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
from typing import Any, Dict
from flaskerize import SchematicRenderer
def run(renderer: SchematicRenderer, context: Dict[str, Any]) -> None:
template_files = renderer.get_template_files()
for filename in template_files:
renderer.render_from_file(filename, context=context)
renderer.print_summary(... |
"""
Created on May 21, 2014
@author: StarlitGhost
"""
from twisted.plugin import IPlugin
from desertbot.moduleinterface import IModule, BotModule
from zope.interface import implementer
from desertbot.response import IRCResponse
from desertbot.utils import string
@implementer(IPlugin, IModule)
class AutoPasteEE(Bot... |
#coding=utf-8
# coding=utf-8
'''
Created on 2014-1-5
@author: ETHAN
'''
from doraemon.api.ci.urlrouter import ci_task_urls
from doraemon.api.ci.urlrouter.ci_agent_urls import api_agent_router
from doraemon.api.ci.urlrouter.ci_service_urls import deploy_service_router
from doraemon.api.ci.urlrouter.ci_server_urls impo... |
#######################################
# Copyright 2019 PMP SA. #
# SPDX-License-Identifier: Apache-2.0 #
#######################################
import os
import signal
import logging
import subprocess
import threading
logger = logging.getLogger(__name__)
class Command(object):
"""
Create sub... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.