text
stringlengths
2
999k
################################################################################ # 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...
''' <table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Filter/filter_range_contains.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_bla...
# -*- coding: utf-8 -*- # # prodrecs documentation build configuration file, created by # sphinx-quickstart. # # 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 # autogenerated file. # # All configuration values have ...
from kivy.uix.scrollview import ScrollView from kivy.properties import ObjectProperty, NumericProperty from kivy.lang import Builder Builder.load_string(''' #: import ScrollEffect kivy.effects.scroll.ScrollEffect <ScrollWid>: layout: layout id: e_scroll bar_width: dp(5) size_hint_y: None effect_cl...
from office365.runtime.queries.service_operation_query import ServiceOperationQuery from office365.runtime.resource_path import ResourcePath from office365.runtime.resource_path_service_operation import ResourcePathServiceOperation from office365.sharepoint.base_entity import BaseEntity from office365.sharepoint.princi...
# formando um triângulo print("\033[32m-=\033[m" * 30) print('\033[1;33mAnalisador de triângulos\033[m') print('\033[32m-=\033[m'* 30) r1 = float(input('\033[1;33mPrimeiro segmento:\033[m ')) r2 = float(input('\033[1;33mSegundo segmento: \033[m')) r3 = float(input('\033[1;33mTerceiro segmento:\033[m ')) if r1 < r2 + r3...
import numpy as np import matplotlib.pyplot as plt b = 2.5 x = np.linspace(0, 20, 200) f = np.exp(-((x - b) ** 2) / 2) fig, ax = plt.subplots(1, 1, figsize=(9, 3)) ax.plot(x, f, "k") ax.set_ylim([-0.5, 1.5]) ax.set_xticks(np.linspace(0, 20, 21)) ax.fill_between(x, f, np.zeros_like(f), color="k") ax.set_title("Seismic...
""" Components/Toolbar ================== .. seealso:: `Material Design spec, App bars: top <https://material.io/components/app-bars-top>`_ `Material Design spec, App bars: bottom <https://material.io/components/app-bars-bottom/app-bars-bottom.html>`_ .. image:: https://github.com/HeaTTheatR/KivyMD-data/raw...
# USAGE # python evaluateAlgorihm.py --image Db/Images/DM_DCM_1759.jpeg # import the necessary packages import cv2 import os from BarcodeDetector import BarcodeDetector from BarcodeRecognizer import BarcodeRecognizer import json images = [] folderTestImages = 'db/Images/' folderProcessedImages = 'db/Results/' folderP...
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2018-06-17 03:41 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('App', '0004_mainnustbuy'), ] operations = [ migrations.RenameModel( old...
"""ZMQServer Driver.""" from schema import Use, Or import zmq from testplan.common.config import ConfigOption as Optional from testplan.common.utils.timing import retry_until_timeout from ..base import Driver, DriverConfig class ZMQServerConfig(DriverConfig): """ Configuration object for :py:class:`~te...
""" Copyright (c) 2020 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 writin...
import unittest import warnings import pytest import numpy as np from SimPEG import ( Mesh, Maps, Directives, Regularization, DataMisfit, Optimization, Inversion, InvProblem ) from SimPEG import PF class DirectivesValidation(unittest.TestCase): def test_validation_pass(self): betaest = Directive...
# 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 RBamsignals(RPackage): """Extract read count signals from bam files. This package ...
# Generated by Django 2.0.5 on 2018-10-15 15:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('files', '0007_auto_20181015_1826'), ('diary', '0001_initial'), ] operations = [ migrations.AddField( model_name='diaryen...
import sys from PyQt5.QtWidgets import * class MyWindow(QMainWindow): def __init__(self): super().__init__() button = QPushButton(text="버튼", parent=self) button.move(10, 10) app = QApplication(sys.argv) win = MyWindow() win.show() app.exec_()
# 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 ...
""" This mod performs a gaussian filter on the data. The window size for the filter is specified by wx.lib.masked.NumCtrl widgets. """ from scipy.ndimage.filters import gaussian_filter from colorview2d import imod class Smooth(imod.IMod): """ The modification class. Convolutes a gaussian window of size ...
from django.contrib import admin from .models import Player, Bot, BasePlayer # Register your models here. @admin.register(Bot) class BotAdmin(admin.ModelAdmin): list_display = ("name", "player_id", "action", "order", "team", "in_vehicle", 'stuck', 'health_provider', 'ammo_provider', 'target_vehicle', 'in_vehicle_t...
from ursina import * def combine(entity, analyze=False, auto_destroy=True): verts = list() tris = list() norms = list() uvs = list() cols = list() to_destroy = list() o = 0 for e in scene.entities: if e.has_ancestor(entity) or e == entity: if not hasattr(e, 'mod...
from numpy import pi from waveforms.waveform import Waveform, cos, sin, step from .assembly_left import _allocQubits, _ctx_update_biases, call_opaque from .library import Library from .qlisp import (ADChannel, AWGChannel, Context, GateConfig, MeasurementTask, MultADChannel, MultAWGChannel, QLispCod...
# simple task generator double check the max Assignments import argparse import numpy as np import pandas as pd import json from sklearn.utils import shuffle parser = argparse.ArgumentParser(description='Create tasks to validate.') parser.add_argument('--hits', type=int, default=100, help='how many validate ordinary m...
# coding=utf-8 import importlib from datetime import datetime from weather.sojson import get_today_weather # from weather.rtweather import get_rttodayweather # from bot.qingyunke import get_qingyunke # from bot.tuling123 import get_tuling123 # from bot.yigeai import get_yigeai from main.common import ( get_yaml )...
import requests from requests.auth import HTTPBasicAuth from . import utilities def get(cryptocurrency:str, fields:list=[]): """Retrieve a single cryptocurrency balance on your wallets Returns balance in the specified currency. This is a call on the `getBalances` query with the `cryptocurrency` argument. ...
"""Homie Discovery Base helper""" import types from typing import Callable import attr from .change_listner import AttributeChangeListener STAGE_ALL = -1 STAGE_0 = 0 STAGE_1 = 1 STAGE_2 = 2 @attr.s(slots=True, frozen=True) class Subscription(object): """Class to hold data about an active subscription.""" c...
# 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 from ceph_medic import collector, metadata from mock import Mock class FakeConnRemoteModule(object): """ A fake remote_module class to be used with Mocked connection objects. This class contains stubbed methods for functions in ceph_medic.remote.functions which get their return ...
#!/usr/bin/env python # 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...
""" These are the core network and system settings. For user-preferences, take a look at `UserPreferences.py`. The settings are dynamically configurable, for instance to set them depending on CLI arguments. By default these are the testnet settings, but you can reconfigure them by calling the `setup(..)` methods. """ ...
from fastapi import APIRouter, Depends, Form, Request from sqlalchemy.orm import Session from app.dependencies import get_db, templates from app.internal.search import get_results_by_keywords router = APIRouter() @router.get("/search") def search(request: Request): # Made up user details until there's a user lo...
"""this is an example that demonstrates how to multiply three polynomials""" import numpy as np import matplotlib.pyplot as plt from numpyviz import VisualArray arr = np.array([[[r'$x^2y$', r'$xy^2$'],[r'$xy^2$', r'$y^3$']], [[r'$x^3$', r'$x^2y$'],[r'$x^2y$', r'$xy^2$']]]) va = VisualArray(arr) va.set...
from __future__ import absolute_import, unicode_literals import sys from datetime import timedelta from billiard.einfo import ExceptionInfo from celery import result from celery import states from celery.utils import gen_unique_id from djcelery.app import app from djcelery.backends.cache import CacheBackend from d...
from django.conf.urls import url from . import views from django.conf import settings from django.conf.urls.static import static urlpatterns=[ url('^$',views.index,name='index'), url(r'^image/(?P<category_name>\w+)/(?P<image_id>\d+)',views.single_image, name='single_image'), url(r'^location/(?P<location>\d...
import boto3 import json import os from boto3.dynamodb.types import TypeDeserializer from datetime import datetime, timedelta, timezone deserializer = TypeDeserializer() def deserialize(image): d = {} for key in image: d[key] = deserializer.deserialize(image[key]) return d def lambda_handler(even...
"""Read in an Ortec SPE file.""" import datetime import os import warnings import dateutil.parser import numpy as np from ..core import calibration from .parsers import BecquerelParserError, BecquerelParserWarning def read(filename, verbose=False): """Parse the ASCII SPE file and return a dictionary of data. ...
########################################################################## # # Copyright (c) 2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
#!/usr/bin/env python # -*- coding: utf-8 -*- from multiprocessing import Pool import socket, sys, pickle, json, time, struct #import argparse import numpy as np HEARTBEAT_PORT = 8881 CONNECTION_PORT = 8882 RECV_BUFFER = 8192 class Connection: def __init__(self): self.heartbeat_socket = socket.socke...
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import time '''...
# -------------- # Code starts here # Create the lists class_1=["Geoffrey Hinton","Andrew Ng","Sebastian Raschka","Yoshua Bengio"] class_2=["Hilary Mason","Carla Gentry","Corinna Cortes"] # Concatenate both the strings new_class= class_1+class_2 # Append the list new_class.append("Peter Warden") # Print ...
import datetime import calendar import operator class TimeMachine(object): def __init__(self): # maps weekdays, using Sunday as day 0. To map daystring to number, call weekdays.index(daystring) self.weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] def g...
import imaplib import email import csv import quopri from bs4 import BeautifulSoup import re from decouple import config class IMap(): def __init__(self, address=None, password=None): self.address = address self.password = password self.login(self.address, self.password) def login(self...
# -*- coding: utf-8 -*- # # Django Grappelli documentation build configuration file, created by # sphinx-quickstart on Sun Dec 5 19:11:46 2010. # # 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 # autogenerated file...
""" Copyright (C) 2018 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). """ from __future__ import print_function from utils import get_config, get_data_loader_folder, pytorch03_to_pytorch04 from trainer import MUNIT_Trai...
from rest_framework import serializers from django.utils import timezone from .models import Employee class EmployeeSerializer(serializers.ModelSerializer): class Meta: model = Employee fields = '__all__' read_only_fields = ("created_at", "updated_at") def validate_name(self, value): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.TradeFundBill import TradeFundBill from alipay.aop.api.domain.HbFqPayInfo import HbFqPayInfo from alipay.aop.api.domain.TradeSettleInfo import TradeSettleInfo from alip...
import albumentations import streamlit as st from elements import ( checkbox, element_description, min_max, num_interval, radio, rgb, several_nums, text_input, ) def select_next_aug(augmentations): """ Returns last selected transformation. Parameters: augmentation...
from .settings import * import os DEBUG = False ALLOWED_HOSTS = ['*'] WEBPACK_LOADER = { 'DEFAULT': { 'BUNDLE_DIR_NAME': '', 'STATS_FILE': os.path.join(BASE_DIR, 'frontend/webpack-stats-prod.json'), } } STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ] MEDIA_URL = '/dmedia/' MEDIA...
#! /usr/bin/env python # -*- coding: utf-8 -*- import random ileliczb = int(raw_input("Podaj ilość typowanych liczb: ")) maksliczba = int(raw_input("Podaj maksymalną losowaną liczbę: ")) if ileliczb > maksliczba: print "Błędne dane!" exit() liczby = [] i = 0 while i < ileliczb: liczba = random.randint(1,...
import os import unittest from unittest.mock import patch import sqlalchemy from auditor.audit_processor import AuditProcessor from auditor.auditor import Auditor from auditor.config import AuditorConfig from auditor.utils.blockchain_client.client import BlockchainClient from auditor.utils.key_client import KeyClient...
"""Tests for module iter8_analytics.api.v2""" # standard python stuff import logging import json import os import copy # python libraries import requests_mock from iter8_analytics import fastapi_app from iter8_analytics.api.v2.types import \ ExperimentResource, AggregatedMetricsAnalysis, VersionAssessmentsAnalysi...
if __name__ == "__main__": from argparse import ArgumentParser from gpiozero import LED import logging, logging.handlers import subprocess parser = ArgumentParser(description='Touch screen interface driver') parser.add_argument('--pin', type=int, default=25, help='Screen brightness GPIO pin; de...
people = 30 cars = 40 buses =95 if cars > people: print "we should take the cars" elif cars < people: print "we should NOT take the cars" else: print "what the f*ck" if buses > people: print "unnecesary amount of buses" elif people > buses: print "take the bus" else: print "wtf"
import numpy as np def make_spiral(n_samples, n_features, n_classes): N = n_samples // n_classes # number of points per class D = n_features # dimensionality K = n_classes # number of classes X = np.zeros((N*K,D)) # data matrix (each row = single example) y = np.zeros(N*K, dtype='uint8') # class la...
[ ## this file was manually modified by jt { 'functor' : { 'arity' : '2', 'call_types' : [], 'ret_arity' : '0', 'rturn' : { 'default' : 'typename nt2::meta::as_integer<typename boost::result_of<nt2::meta::arithmetic(T,T)>::type >::type', }, ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # (c) B.Kerler 2018-2021 GPLv3 License import logging, os from struct import pack, unpack from mtkclient.Library.utils import LogBase from binascii import hexlify # SEJ = Security Engine for JTAG protection def bytes_to_dwords(buf): res = [] for i in range(0, len(bu...
from __future__ import (absolute_import, division, print_function, unicode_literals) import pytest from itertools import chain, product import os.path import uuid import numpy as np from ..handlers_base import HandlerBase def _verify_shifted_resource(last_res, new_res): '''Check that res...
import numpy as np import os import tensorflow as tf from .data_utils import minibatches, pad_sequences, get_chunks from .general_utils import Progbar from .base_model import BaseModel class NERModel(BaseModel): """Specialized class of Model for NER""" def __init__(self, config): super(NERModel, se...
from typing import Sequence from visions.backends.python.series_utils import sequence_not_empty from visions.types.float import Float from visions.types.integer import Integer @Integer.register_relationship(Float, Sequence) def float_is_int(sequence: Sequence, state: dict) -> bool: try: return all(int(va...
#!/usr/bin/env python3 import sys import os def findparams(param_file_dirs): """ a simple script that returns (to stdout) the paths to _parameter files given a list of directories to search (as arguments on the commandline). This is used in various makefiles to get the input for write_probin.py ...
# lextab.py. This file automatically created by PLY (version 3.4). Don't edit! _tabversion = '3.4' _lextokens = {'DO': 1, 'ELIF': 1, 'RETURN': 1, 'LSBRACKET': 1, 'LESS_THAN_OR_EQUAL': 1, 'NUMBER': 1, 'SELECTOR': 1, 'LCBRACKET': 1, 'WHILE': 1, 'COLON': 1, 'MULTIPLY': 1, 'END': 1, 'LESS_THAN': 1, 'TRUE': 1, 'MINUS':...
# BASICS OF PYQT5 # Santiago Garcia Arango, July 2020 # Tutorial based on <sentdex: PyQt Python GUI Application Development> """ Remark: these first scripts are over-commented, so that anyone can read them and get the basic understanding of the PyQt library. """ import sys import os from PyQt5.QtGui import QIcon from...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 21 20:42:01 2020 @author: Gnana Murthiy @description: Passing input to the Keyboard(from camera). @Reference: #http://stackoverflow.com/questions/14489013/simulate-python-keypresses-for-controlling-a-game """ import ctypes import time SendInput = ct...
#!/usr/bin/python import sys import xml.etree.ElementTree as ET if len(sys.argv) < 3: print("need parameter 'xml source' and 'output file'") exit() xmlFile = sys.argv[1] outputFile = sys.argv[2] root = ET.parse(xmlFile).getroot() functionNameList = [] for enums in root.findall("commands"): for enum...
#These models are dowloaded via the repo https://github.com/Cadene/pretrained-models.pytorch #See licence here: https://github.com/Cadene/pretrained-models.pytorch/blob/master/LICENSE.txt from torch import nn from ..learner import model_meta from ...core import * pretrainedmodels = try_import('pretrainedmodels') if no...
""" Environment dependent settings: Production """ # Deployment checklist # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ from . base import * # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False ALLOWED_HOSTS = ['gjersund.com', 'www.gjersund.com'] SECURE_CONTENT...
#! /usr/bin/env python """ Retrieve the unitigs containing a set of k-mers, using exact/MPHF code. This _does not_ use the domset or neighborhood, merely recovers exactly the unitigs that contain the query k-mers. """ import argparse import os import sys import gzip import khmer import collections import bbhash import...
# THIS FILE IS AUTO-GENERATED. DO NOT EDIT from verta._swagger.base_type import BaseType class UacSetTeam(BaseType): def __init__(self, team=None): required = { "team": False, } self.team = team for k, v in required.items(): if self[k] is None and v: raise ValueError('attribute {...
"""empty message Revision ID: 25743fc519b2 Revises: 019bfb836074 Create Date: 2017-01-29 20:59:50.405191 """ # revision identifiers, used by Alembic. revision = '25743fc519b2' down_revision = '019bfb836074' from alembic import op import sqlalchemy as sa def upgrade(): # ### commands auto generated by Alembic ...
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def index(): posts = [ { "title" : "Thơ con chó", "content" : """Hôm nay trăng lên cao quá, anh muốn hôn em vào má""", "author" : "Tuấn Anh", "gender" : 1 ...
# coding: utf-8 """ Argo Server API You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9` # noqa: E501 The version of the OpenAPI document: v2.12.2 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 ...
"""Common settings and globals.""" from os.path import abspath, basename, dirname, join, normpath from sys import path ########## PATH CONFIGURATION # Absolute filesystem path to the Django project directory: DJANGO_ROOT = dirname(dirname(abspath(__file__))) # Absolute filesystem path to the top-level project fold...
from functools import reduce import operator template = """\ /* Copyright (C) 2018 Red Hat * * 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 limita...
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.comptool import TestManager, T...
teams = ((1, 'Ravens'),(2, 'Panthers'),(5, 'Eagles'),(7, 'Steelers')) # Notice tuple of tuples for index, name in teams: print(index, name)
import math import numpy def orth_normal_initializer(factor=1.0, seed=None): ''' Reference: Exact solutions to the nonlinear dynamics of learning in deep linear neural networks Saxe et al., 2014. https://arxiv.org/pdf/1312.6120.pdf Adapted from the original implementation by Mingxuan W...
import os import time import yaml import logging import argparse import numpy as np from pprint import pprint from attrdict import AttrDict import paddle import paddle.nn as nn import paddle.distributed as dist from mem_transformer import MemTransformerLM from reader import get_lm_vocab, get_lm_data_loader FORMAT = ...
from globals import * import life as lfe import judgement import movement import sight def tick(life): _guard = judgement.get_target_to_guard(life) if _guard: return movement.find_target(life, _guard, follow=False, distance=sight.get_vision(life)*.25, call=False) return movement.find_target(life, judgement...
from distutils.core import setup setup( name='os_xcode_tools', # How you named your package folder (MyLib) packages=['os_xcode_tools', 'os_xcode_tools.modules'], # Choose the same as "name" version='1.17', # Start with a small number and increase it with every change you make license='MIT', # Chose...
'''OpenGL extension ARB.shading_language_100 This module customises the behaviour of the OpenGL.raw.GL.ARB.shading_language_100 to provide a more Python-friendly API ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions, wrapper from OpenGL.GL import glget import ctypes from Open...
# 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, ...
# 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 GetClu...
# Copyright (c) 2012-2021, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from .aws import Action as BaseAction from .aws import BaseARN service_name = "Apache Kafka APIs for Amazon MSK clusters" prefix = "kafka-cluster" class Action(BaseAction): def __init__(self, actio...
#!/usr/bin/env python3 import numpy as np import os import pandas as pd import re _output_fold = '../../zz_old/coliva/outputs/extrapolation_vgg19' def get_prediction_mapes(output_fold): # Initialize results dataframes dfs = {} # Loop over devices for device in os.listdir(output_fold): if devi...
from xraylib import Crystal_GetCrystalsList import numpy import os, platform, six from xoppylib.xoppy_xraylib_util import bragg_calc from xoppylib.xoppy_util import locations def xoppy_calc_xcrystal( CRYSTAL_MATERIAL = 32, MILLER_INDEX_H = 1, MILLER_INDEX_K = 1, MILLER_INDEX_L = 1, TEMPER = 1, ...
import uuid import os from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \ PermissionsMixin from django.conf import settings def recipe_image_file_path(instance, filename): """Generate file path for new recipe image""" ...
import pandas as pd from collections import namedtuple from functools import lru_cache from typing import Any, Type, List, Iterable, Optional # noqa from backlight.datasource.marketdata import MarketData Transaction = namedtuple("Transaction", ["timestamp", "amount"]) def _max(s: pd.Series) -> int: if len(s) ...
from otp.ai.MagicWordGlobal import * from otp.otpbase import OTPGlobals from direct.fsm import ClassicFSM from direct.fsm import State from direct.distributed import DistributedNodeAI from direct.task import Task from toontown.toonbase import ToontownGlobals class DistributedAvatarAI(DistributedNodeAI.DistributedNodeA...
from django.test import TestCase from .Parser import parse_or,parse_and,Parse class TestParser(TestCase): def test_all(self): pass def test_basic(self): Parse({"status":"Completed"}) def test_or(self): d = {"or": { "status": "Completed", "ordered_by_id": 2...
import logging import os import shutil import sys from typing import Optional, List import environment def resource_path(relative_path): """ Get absolute path to resource. Works for development and for PyInstaller created binaries.""" try: # PyInstaller creates a temp folder and stores path in _MEIPA...
from django.apps import AppConfig class PaleositesConfig(AppConfig): name = 'paleosites'
import random import electrum.mpp_split as mpp_split # side effect for PART_PENALTY from electrum.lnutil import NoPathFound from . import ElectrumTestCase PART_PENALTY = mpp_split.PART_PENALTY class TestMppSplit(ElectrumTestCase): def setUp(self): super().setUp() # to make tests reproducible: ...
#!/usr/bin/python # # Copyright 2015 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 b...
# Copyright 2017-2020 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" fil...
from .interface import Interface ANY = '*' UNKNOW = object() CATEGORY = 'mdl' SENTINEL = object() class IApplication(Interface): """Application""" class IContext(Interface): """Transformation context"""
# The Computer Language Benchmarks Game # http://shootout.alioth.debian.org/ # # contributed by Antoine Pitrou # modified by Dominique Wahli # modified by Heinrich Acker import sys, time def make_tree(item, depth): if not depth: return item, None, None item2 = item + item depth -= 1 return item, make_...
#PCA in 2d on digit images. # Based on fig 14.23 of of "Elements of statistical learning". Code is from Andrey Gaskov's site: # Code modified from #https://github.com/empathy87/The-Elements-of-Statistical-Learning-Python-Notebooks/blob/master/examples/ZIP%20Code.ipynb import pandas as pd from matplotlib imp...
#!/usr/bin/env python3 # 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. """Tests for e2e test. Before deploying HWID Service to prod environment, one should run this test on the staging environment. The...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
#!/usr/bin/python import sys import json try: from NaServer import * NASERVER_AVAILABLE = True except ImportError: NASERVER_AVAILABLE = False if not NASERVER_AVAILABLE: module.fail_json(msg="The NetApp Manageability SDK library is not installed") DOCUMENTATTION = ''' --- module: broadcast_domain_del_ports...
import numpy as np import torch import torch.nn as nn ############################################################################### # basic modules ############################################################################### def default_conv(in_channels, out_channels, kernel_size, bias=True, dilation=1): ret...