text
stringlengths
2
999k
from django import test from django.conf import settings from django.contrib.auth import get_user_model from django.core import management from django.utils import timezone from model_bakery import baker from devilry.devilry_account.models import PermissionGroup from devilry.utils import datetimeutils from devilry.d...
""" Routines for calculating common metrics of data quality based on merging of redundant observations. """ from __future__ import division from iotbx import data_plots from libtbx.str_utils import make_sub_header, format_value from libtbx.utils import Sorry, null_out from libtbx import group_args, Auto from math imp...
import logging from logging.config import dictConfig import sys def set_up_logging(): logging.config.dictConfig( { "version": 1, "disable_existing_loggers": False, "formatters": { "standard": { "format": "%(asctime)s [%(levelname)s] (...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 6 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_8_1_1 from i...
#!/usr/bin/env python3 ############################################################################### # Copyright 2018 The Apollo 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...
# coding utf-8 from app import app if (__name__ == "__main__"): app.run()
from functools import partial from warnings import warn import autograd.numpy as np import autograd.numpy.random as npr from autograd.scipy.special import logsumexp from autograd.scipy.stats import dirichlet from autograd import hessian from ssm.util import one_hot, logistic, relu, rle, ensure_args_are_lists, LOG_EPS...
#Deleting a node from the linked list class Node: def __init__(self,data): self.data=data self.next=None class LinkedList: def __init__(self): self.head=None def add(self,data): new = Node(data) if self.head is None: self.head=new ...
#!/usr/bin/env python """ Module for tasks that do post-run processing of output files. """ __author__ = "Lloyd McCarthy" __license__ = "MIT" import datetime import json import logging import re import subprocess import time from os import remove from typing import List from uuid import uuid4 from cidc_utils.requests...
import types class F(object): def __init__(self, func): self._func = func def __call__(self, *args, **kwargs): return self._func(*args, **kwargs) class G(object): def __init__(self, func): self._func = func def __get__(self, obj, type_=None): # print('*', self, obj, type_) if isinstance(obj, type_):...
# -*- coding: utf-8 -*- """ Created on Sat Nov 20 21:04:10 2021 @author: Yerke """ #import necessary libraries from bs4 import BeautifulSoup import requests import pandas as pd import sys import http.client import json import time #my api_key. You will receive your own if you register on https://api....
#! /usr/bin/env python # -*- encoding: UTF-8 -*- """Example: Use ALBehaviorManager Module""" import qi import argparse import sys import time def main(session, behavior_name): """ Use ALBehaviorManager Module. """ # Get the service ALBehaviorManager. behavior_mng_service = session.service("ALBe...
from __future__ import print_function ########### # imports # ########### import numpy as np from matplotlib.image import imread ############# # functions # ############# def construct_target_grid(num_cells): """Constructs a rectangular grid. First a grid resolution is randomly chosen. grid_resolution equal...
import sys, os, bottle, py2neo dir = os.path.dirname(__file__) sys.path = [dir+'/bottle/'] + sys.path sys.path = [dir+'/service/'] + sys.path os.chdir(os.path.dirname(__file__)) # This loads your application import graphstory application = bottle.default_app() # This monitors your application for changes import m...
#!/usr/bin/python3 #sends data to a uart rf module import serial from time import sleep import struct ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=None) def putRF(rf_uart, data): #arguments to make function more self-contained and function-like rf_uart.setDTR(True) #if the extra pins on the ttl usb are conne...
"""add account_id column in tasks table Revision ID: 031a07fb0811 Revises: 885632ab6357 Create Date: 2021-04-14 17:48:33.958394 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '031a07fb0811' down_revision = '885632ab6357' branch_labels = None depends_on = None ...
# 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 # d...
import pytest @pytest.fixture def input_value(): input = 39 return input
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# coding=utf-8 # Copyright (C) ATHENA AUTHORS; Ruixiong Zhang; # 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 # # Un...
import json import tempfile from collections import OrderedDict from unittest import TestCase from mock import patch from nose_parameterized import parameterized from six import assertCountEqual from samcli.commands.validate.lib.exceptions import InvalidSamDocumentException from samcli.commands.local.lib.api_provider...
import json import falcon class JsonLoader: def __init__(self, logger): self.logger = logger.with_class_name(self) def process_resource(self, req, res, resource, params): if not getattr(resource, 'has_json_body', False): return try: req.context.body = json.load...
# - * - coding:utf-8 - * - import time def pline(line="===", num=50): print(line * num) def p(msg="", ts=0, line=""): try: if line: print(str(msg) + line * 30) else: print(str(msg)) except: print(" \n === Can't print msg" + str(type(msg)) + " =========...
# 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...
from application.constant import Constant class Ar40Ar38CompositionOfAtmospheric(Constant): def __new__(cls, value=None): return super().__new__(cls, key="Ar40_Ar38_composition_of_atmospheric", value=value)
"""py-motmetrics - metrics for multiple object tracker (MOT) benchmarking. Christoph Heindl, 2017 Toka, 2018 https://github.com/cheind/py-motmetrics Fast implement by TOKA """ import numpy as np def norm2squared_matrix(objs, hyps, max_d2=float('inf')): """Computes the squared Euclidean distance matrix between ob...
#!/usr/bin/env python # coding=utf-8 # Stan 2012-03-10 from __future__ import (division, absolute_import, print_function, unicode_literals) import os from .file import proceed_file from ...reg import set_object from ...reg.result import * def reg_dir(dirname, runtime, ROOT=None): DIR =...
from __future__ import absolute_import import logging import tornado from bs4 import BeautifulSoup from dxlbootstrap.util import MessageUtils from dxlclient import Message, json import dxlconsole.util from dxlconsole.handlers import BaseRequestHandler logger = logging.getLogger(__name__) class MessagesHandler(Base...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: pogoprotos/data/capture/capture_award.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google...
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License """ Tests for dataframeeditor.py """ from __future__ import division # Third party imports from pandas import DataFrame, date_range from qtpy.QtGui import QColor import pytest # Local imports from spyde...
# client.py # # Common client. Measure the response rate of the echo server from socket import * import time from threading import Thread import atexit import sys if len(sys.argv) > 1: MSGSIZE = int(sys.argv[1]) else: MSGSIZE = 1 msg = b'x' * MSGSIZE sock = socket(AF_INET, SOCK_STREAM) sock.connect(('localh...
import logging from typing import Optional, Union import numpy as np import pandas as pd import torch from anndata import AnnData from pytorch_lightning.callbacks import Callback from pytorch_lightning.callbacks.early_stopping import EarlyStopping import scvi from scvi import _CONSTANTS from scvi.data import register...
import requests from bs4 import BeautifulSoup import re """Module responsible for getting recipes from tasty.co """ baseUrl = 'https://tasty.co/' class Recipe: def __init__(self, title, ingredients_sections, preparation, url): self.title = title self.ingredients_sections = ingredients_sections ...
# Natural Language Toolkit: Agreement Metrics # # Copyright (C) 2001-2016 NLTK Project # Author: Tom Lippincott <tom@cs.columbia.edu> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT # """ Implementations of inter-annotator agreement coefficients surveyed by Artstein and Poesio (2007), Inter-Coder ...
from panther_base_helpers import IN_PCI_SCOPE # pylint: disable=import-error def policy(resource): # Only check the volumes that are in scope for PCI if not IN_PCI_SCOPE(resource): return True return bool(resource['Encrypted'])
import cv2 import menpo.io as mio from menpo.visualize import print_progress from menpo.landmark import labeller, face_ibug_68_to_face_ibug_68_trimesh from pathlib import Path import menpo.io as mio from menpo.visualize import print_progress path_to_images = '/home/ice/Documents/Micro-Expression/SAMM/006/006_1_2/' tr...
# -*- coding: utf-8 -*- # Copyright (c) 2020, Aakvatech and contributors # For license information, please see license.txt from __future__ import unicode_literals # import frappe from frappe.model.document import Document class PreviousRadiologyProcedurePrescription(Document): pass
SIZE = 32
# Copyright The IETF Trust 2018-2019, All Rights Reserved # -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-02-20 10:52 from __future__ import absolute_import, print_function, unicode_literals import datetime from django.db import migrations, models import django.db.models.deletion import ietf.utils.acce...
import hashlib from time import time import json """ Block structure: -index -hash -transactions[] -nonce -previousHash -timestamp Consider: -bloc_0 # Root Block -pending_transactions[] -blockchain[] * Nouvelle transaction 👍 * Validation de la transaction 👍 * Ajout de la transaction dans un block pendant 👍 * rep...
# Generated by Django 3.0.6 on 2020-05-27 14:12 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('chapters', '0001_initial'), ] operations = [ migrations.CreateModel( name='...
class script(object): START_MSG = """ <b>Hi {} I'm Dracarys of @MovieVilla666, And Just Don't Command Me. I'll Accept Commands Only From @Mikhael324. Contact Him For Any Queries Or Promotion. For more click <i>help</i></b>""" HELP_MSG = """<b>How to use the bot??</b> <i> * Add bot to your group...
""" Ory APIs Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501 The version of the OpenAPI document: v0.0.1-alpha.93 Contact: support@ory.sh Generated by: htt...
from typing import Union, Dict from pycrunch_trace.events.base_event import Event from pycrunch_trace.proto import message_pb2 class EventBufferInProtobuf: files: Dict[str, int] def __init__(self, event_buffer, files: Dict[str, int]): self.files = files self.event_buffer = event_buffer ...
import pandas as pd import networkx as nx import matplotlib.pyplot as plt def show(from_verts, to_verts): df = pd.DataFrame( {'from': from_verts, 'to': to_verts}) G = nx.from_pandas_edgelist(df, 'from', 'to') # TODO: check https://stackoverflow.com/a/54876985 for why the graph is squished nx....
# In the Deepmind paper they use RMSProp however then Adam optimizer # improves training time import logging import datetime import gym import numpy as np import tensorflow as tf import itertools from tensorflow import keras from tensorflow.keras import layers import multiprocessing from lords_ai.q_model import create...
import warnings import keras.backend as K import numpy as np import tensorflow as tf if tf.__version__.startswith("2"): tf.compat.v1.disable_eager_execution() import tensorflow.compat.v1 as tf from tensorflow.python.training import moving_averages def unpack_data(data, unroll_generator_x=False, unroll_genera...
# -*- coding: utf-8 -*- """ Created on Wed May 16 22:21:26 2018 Author: Josef Perktold License: BSD-3 """ import numpy as np from numpy.testing import assert_allclose, assert_equal import statsmodels.base._penalties as smpen from statsmodels.tools.numdiff import approx_fprime, approx_hess class CheckPenalty(object...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from .sample_methods import sample_multinomial, epsilon_greedy from ..args_provider import ArgsProvider class Sampler:...
template = '<Rectangle Opacity="0" Fill="White" HorizontalAlignment="Left" ' template += 'Margin="%d,%d,0,0" Name="rectangle%d%d" VerticalAlignment="Top" ' template += 'Width="%d" Height="%d" ' template += 'mt:MultitouchScreen.NewContact="pitch_NewContact%d%d"/>\n' tab='\s\s\s\s' colMax = 8 rowMax = 9 width = 140 heig...
import collections.abc import unittest.mock import warnings from datetime import datetime from django.core.paginator import ( EmptyPage, InvalidPage, PageNotAnInteger, Paginator, UnorderedObjectListWarning, ) from django.test import SimpleTestCase, TestCase from .custom import ValidAdjacentNumsPag...
# Copyright 2017 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 a...
""" spark.py ~~~~~~~~ Module containing helper function for use with Apache Spark """ import __main__ from os import environ, listdir, path import json from pyspark import SparkFiles from pyspark.sql import SparkSession from dependencies import logging def start_spark( app_name="spark-app", master="local[*]",...
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.utils.encoding import smart_text from django.utils.translation import get_language, ugettext_lazy as _ from rest_framework import fields, serializers from olympia.amo.utils import to_language from olymp...
# ---------------------------------------------------------------------- # # Brad T. Aagaard, U.S. Geological Survey # Charles A. Williams, GNS Science # Matthew G. Knepley, University at Buffalo # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copy...
from data_detective_airflow.dag_generator.dags.python_dag import PythonDag from data_detective_airflow.dag_generator.dags.tdag import TDag from data_detective_airflow.dag_generator.dags.yaml_dag import YamlDag __all__ = ( 'TDag', 'PythonDag', 'YamlDag', )
import datetime from collections import namedtuple _Field = namedtuple('_Field', [ 'name', 'default', 'help', 'import_string', ]) class Field(_Field): def __new__(cls, name, *, default=None, help=None, import_string=False): return super().__new__( cls, name=name, default=defa...
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed # under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
#!/usr/bin/env python # Helpful little script that spits out a comma-separated list of # language codes for Qt icons that should be included # in binary Crowdcoin Core distributions import glob import os import re import sys if len(sys.argv) != 3: sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%...
"""Testing TaskManager class.""" import aiotaskmgr import asyncio import unittest from aiotaskmgr.logging import capture_logging from pprint import pprint as print class TaskManagerTests(unittest.TestCase): def setUp(self) -> None: self.tm = aiotaskmgr.TaskManager() asyncio.new_event_loop() ...
import paddlelite.lite as lite opt = lite.Opt() opt.set_model_file("output_inference/ppyolo_mbv3_large_qat/model.pdmodel") opt.set_param_file("output_inference/ppyolo_mbv3_large_qat/model.pdiparams") opt.set_optimize_out("detect_model") opt.set_model_type("naive_buffer") opt.set_valid_places("arm") opt.run()
from django.shortcuts import render # Create your views here. def index(request): output = 'Hi there' return output
def class_titles_bar_chart(dataset, pass_class, cpalette=palette): ttl_data = dataset[dataset['Pclass'] == int(pass_class)] title_possibilities = list(ttl_data['Title'].value_counts().index) title_values = list(ttl_data['Title'].value_counts().values) int_possibilities = np.arange(len(title_possibil...
import json import requests import urllib.parse from django.conf import settings from twitter_data.twitter_bot import TwitterBot from twitter_data.models import Feature def get_response(text, endpoint, api_name, api_key): text = urllib.parse.quote(text) url = f"{endpoint}phrase/{text}/" payload = json.du...
#☆𝒐𝒎𝒂𝒋𝒊𝒏𝒂𝒊☆# import sys import math from math import ceil, floor import itertools from functools import lru_cache from collections import deque sys.setrecursionlimit(10000000) input=lambda : sys.stdin.readline().rstrip() '''''✂''''''''''''''''''''''''''''''''''''''''''''''''''''''''' n,k=map(int,input().split(...
from django.test import TestCase from django.conf import settings from django.contrib.auth.models import User, Permission, ContentType from common.models import Project, Settings from testreport.models import TestPlan from testreport.models import Launch from testreport.models import Build from testreport.models impor...
import rebase.util.api_request as api_request import requests import json import dill import rebase as rb def create(site_id, model): """Create a new model for the specified site Args: site_id (str): the id of the site model (class): the model class to create Returns: str: - ...
try: from .wrapper import sphinx_search except ImportError: pass VERSION = (0, 0, 11,) __version__ = '.'.join(map(str, VERSION))
"""Unit tests for the :mod:`networkx.algorithms.community.quality` module. """ import pytest import networkx as nx from networkx import barbell_graph from networkx.algorithms.community import coverage from networkx.algorithms.community import modularity from networkx.algorithms.community import performance from netwo...
# -*- coding: utf-8 -*- ''' tests.unit.version_test ~~~~~~~~~~~~~~~~~~~~~~~ These tests are copied from python's source `Lib/distutils/tests/test_version.py` Some new examples were added and some adjustments were made to run tests in python 2 and 3 ''' # pylint: disable=string-substitution-usage-error ...
# This file is a part of Arjuna # Copyright 2015-2021 Rahul Verma # Website: www.RahulVerma.net # 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...
import re, sys, os import matplotlib.pyplot as plt from yolact.utils.functions import MovingAverage with open(sys.argv[1], 'r') as f: inp = f.read() patterns = { 'train': re.compile(r'\[\s*(?P<epoch>\d+)\]\s*(?P<iteration>\d+) \|\| B: (?P<b>\S+) \| C: (?P<c>\S+) \| M: (?P<m>\S+) \|( S: (?P<s>\S+) \|)? T: (?P<t>\S+...
""" Module: 'uctypes' on esp8266 v1.10 """ # MCU: (sysname='esp8266', nodename='esp8266', release='2.2.0-dev(9422289)', version='v1.10-8-g8b7039d7d on 2019-01-26', machine='ESP module with ESP8266') # Stubber: 1.1.0 ARRAY = -1073741824 BFINT16 = -671088640 BFINT32 = -402653184 BFINT8 = -939524096 BFUINT16 = -805306368 ...
#!/usr/bin/python # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Contains functionality used to implement a partial mock.""" import collections import logging import mock import os import re ...
"""Testing handling with Security.""" from unittest.mock import AsyncMock, patch import pytest from supervisor.coresys import CoreSys from supervisor.exceptions import CodeNotaryError @pytest.mark.skip() async def test_content_trust(coresys: CoreSys): """Test Content-Trust.""" with patch("supervisor.securi...
# Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveShell instances. # #...
import pathlib def git_path(repo_root, tail=None): """Returns a Path to the .git directory in repo_root with tail appended (if present) or None if repo_root is not set. """ path = None if repo_root: path = pathlib.Path(repo_root) / ".git" if tail is not None: path = pat...
# Copyright 2020 MONAI Consortium # 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...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import pg_fts.fields from pg_fts.migrations import CreateFTSIndexOperation, CreateFTSTriggerOperation class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.Crea...
"""Defines the linter class.""" import os import time import logging from typing import ( Any, Generator, List, Sequence, Optional, Tuple, Union, cast, Iterable, ) import pathspec from sqlfluff.core.errors import ( SQLBaseError, SQLLexError, SQLLintError, SQLParseE...
# -*- coding: utf-8 -*- """Snakemake wrapper for summarising the de novo counts. """ import tempfile from snakemake.shell import shell __author__ = "Manuel Holtgrewe <manuel.holtgrewe@bihealth.de>" shell.executable("/bin/bash") with tempfile.NamedTemporaryFile("wt") as tmpf: # Write paths to input files into t...
from typing import Any, Dict, List from rotkehlchen.order_formatting import asset_movements_from_dictlist, trades_from_dictlist from rotkehlchen.transactions import transactions_from_dictlist from rotkehlchen.typing import Timestamp def accounting_history_process( accountant, start_ts: Timestamp, ...
""" This file implements the class for Euler's equation in Special Relativity. To solve the conservative -> primitive transformation we use the scipy library. """ import numpy from scipy.optimize import root_scalar def prims_given_p(p, D, S, tau, gamma): """ A helper function. Given the conserved variables ...
from server.custom_exceptions.duplicate_trade import DuplicateTrade from server.custom_exceptions.duplicate_user import DuplicateUser from server.custom_exceptions.email_wrong_format import EmailWrongFormat from server.custom_exceptions.input_missing import InputMissing from server.custom_exceptions.input_not_int impor...
import sys import re import json import urllib import os import base64 import requests import mistletoe import pandas as pd from mistletoe.latex_renderer import LaTeXRenderer OUTPUT_IMG_CNT = 0 OPERATING_PATH = "" CHAPTER_TOP = True sectionRE = r'\\section{(?P<title>[\s\S]*?)}(?P<post>[\s\S]*)' subsectionRE = r'\\sub...
# Copyright 2019 Google LLC. 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 a...
import discord from discord.ext import commands from discord.utils import get class c91(commands.Cog, name="c91"): def __init__(self, bot: commands.Bot): self.bot = bot @commands.command(name='Cosmic_Absolution', aliases=['c91']) async def example_embed(self, ctx): embed = discord.Embed(ti...
"""All constants related to the ZHA component.""" from __future__ import annotations import enum import logging import bellows.zigbee.application import voluptuous as vol from zigpy.config import CONF_DEVICE_PATH # noqa: F401 # pylint: disable=unused-import import zigpy.types as t import zigpy_deconz.zigbee.applicat...
# -*- coding: utf-8 -*- # Copyright 2018 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Functions for automatic caching of expensive function calls.""" from __future__ import print_function import functools import...
#!/usr/bin/env python import rospy from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped, Pose from styx_msgs.msg import TrafficLightArray, TrafficLight from styx_msgs.msg import Lane from sensor_msgs.msg import Image from cv_bridge import CvBridge from light_classification.tl_classifier import TLCla...
# This Python file uses the following encoding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest import json from bhivegraphenebase import objects from bhivegraphenebase import types from bhive.amou...
from dataclasses import dataclass, asdict, field from typing import Any, List, Optional from explainaboard.feature import Features import json import os from explainaboard import config from explainaboard.utils.logging import get_logger import dataclasses import copy logger = get_logger(__name__) @dataclass class Ta...
#!/usr/bin/env python spheres = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'] def main(): # twos() # threes() # fours() fives() def twos(): d1 = {} for v1 in spheres: for v2 in spheres: if v1 == v2: continue l1 = [v1, v2] ...
from tests.integration.util.api import get_api from tests.integration.util.db_seed import create_account, delete_account def test_get_detailed_scores(admin): account_id = '012345678911' api = get_api(admin['token']) create_account( {'accountId': account_id} ) result = api.get_account_detail...
# optimizer optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2)) # learning policy lr_config = dict( policy='step', warmup='linear', warmup_iters=500, warmup_ratio=0.001, step=[24, 33]) total_epochs = 36
# -*- coding: utf-8 -*- __author__ = "karlvorndoenitz@gmail.com"
# Copyright (c) 2015 Mirantis, 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 w...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by German M. Bravo (Kronuz) # Copyright (c) 2013 German M. Bravo (Kronuz) # # License: MIT # """This module exports the rst plugin linter class.""" from SublimeLinter.lint import highlight, Linter import docutils from...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # # Copyright 2011, Piston Cloud Computing, Inc. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in ...
from os import error, name, supports_bytes_environ import clean import phone_book as pb import notes_book_1 as nb # tuple with commands words EXIT_COMMANDS = ("good bye", "close", "exit", "bye") FIND_COMMANDS = ("find",) EDIT_COMMANDS = ("edit",) BIRTHDAY_COMMANDS = ("birthday",) SELECT_COMMANDS = ("select", "sel") A...