text
stringlengths
2
999k
import unittest import numpy as np import tensorflow as tf import embed import utils def static_rnn(core, inputs, initial_state): unroll_length = tf.nest.flatten(inputs)[0].shape[0] def get_input(i): return tf.nest.map_structure(lambda t: t[i], inputs) state = initial_state outputs = [] for i in rang...
#!/usr/bin/env python # -*- encoding: utf-8 -*- from django.contrib.auth.models import User from django.db import models # Create your models here. class UserProfile(models.Model): is_approval_set = ( (-2, "拒绝注册"), (-1, "停用"), (0, "待通过"), (1, "注册通过"), ) user_id = models.Au...
class UvMap(object): def __init__(self, coords=[], texture_file_name='', name=''): self.coords = tuple(coords) self.texture_file_name = texture_file_name self.name = name
model.n_iter_
# -*- coding: utf-8 -*- # Copyright 2016 Yelp 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 ...
from __future__ import absolute_import import warnings from ..core.has_props import abstract from ..core.properties import Any, Bool, ColumnData, Dict, Enum, Instance, Int, JSON, List, Seq, String from ..model import Model from ..util.dependencies import import_optional from ..util.warnings import BokehUserWarning f...
""" Example with custom penalty class for unimodality for all but one component --------------------------------------------------------------------------- In this example, we first demonstrate how to specify exactly how the penalties are imposed in the AO-ADMM fitting procedure. Then, we create a custom penalty that ...
import logging from typing import Union, Iterable, Tuple, List from ete3 import Tree from genomics_data_index.api.query.TreeBuilder import TreeBuilder from genomics_data_index.configuration.connector import DataIndexConnection from genomics_data_index.storage.SampleSet import SampleSet logger = logging.getLogger(__n...
"""Models and database functions for deep-paint""" from datetime import datetime from flask_sqlalchemy import SQLAlchemy from os import remove, path, getcwd from PIL import Image as PILImage from time import time from werkzeug.security import generate_password_hash, check_password_hash from fast_style_transfer.evalua...
from rest_framework.viewsets import GenericViewSet, mixins from landscapesim.async.serializers import RunModelReadOnlySerializer, RunModelCreateSerializer from landscapesim.models import RunScenarioModel class RunModelViewset(mixins.CreateModelMixin, mixins.RetrieveModelMixin, GenericViewSet): queryset = RunScen...
import re # From https://github.com/hatnote/hashtag-search/blob/1e02506a732b3e018521c431c4b5c3f3c0618215/common.py EXCLUDED = ('redirect', 'weiterleitung', 'redirection', 'ifexist', 'switch', 'ifexpr', 'if', 'rs') def ha...
"""Attribute mappings.""" def map(attribute_data, idp): """ Map attribute data from an IdP's SAML Response to values that are easier to consume. """ attribute_map = {idp.id_attribute: idp.mapped_id_attribute} attribute_map.update(idp.attribute_map) for key, values in attribute_data.items()...
#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* Copyright (c) Schrodinger, LLC. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* -------...
from setuptools import setup setup( name='otp', version='0.0.1', license='MIT', description='Module for generating and validating HOTP and TOTP tokens', author='renzhexigua', author_email='renzhexigua@163.com', packages=['otp'], package_data={ 'otp': ['README.md', 'LICENSE'] ...
import json import os import shutil from warnings import warn def write_results(res: dict): with open("/output/results.json", "w") as f: f.write(json.dumps(res, ensure_ascii=True, indent=2)) if __name__ == "__main__": # The algorithm owner is free to define the input from the participants # What...
from app.worker.celery_init import celery from celery.utils.log import get_task_logger from app.settings import Config from app.utils.project_config import ProjectConfig from app.utils.predict_queue import PredictQueue from app.utils.priority_queue import TweetStore from app.utils.data_dump_ids import DataDumpIds from ...
import json from requests import Response class BaseCase: def get_cookie(self, response: Response, cookie_name): assert cookie_name in response.cookies, f"Cannot find cookie with name {cookie_name} in the last response" return response.cookies[cookie_name] def get_headers(self, response: Res...
import glob import os.path import shutil import sys import tempfile import re from types import ModuleType from typing import List, Tuple from mypy.test.helpers import Suite, assert_equal, assert_string_arrays_equal from mypy.test.data import DataSuite, DataDrivenTestCase from mypy.errors import CompileError from myp...
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings') try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the ...
############################################################################## # Copyright 2016-2018 Rigetti Computing # # 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...
"""General utils functions.""" from typing import Dict, List, Optional, Tuple import matplotlib import matplotlib.patches as mpatches import matplotlib.pyplot as plt import numpy as np from matplotlib.path import Path from nanoid import generate # type: ignore from pycocotools import mask as mask_utils # type: igno...
from predictions import forecast from predictions.utils import get_frame, get_series def run_prediction() -> None: steps_ahead = 15 time_freq = 'D' sample = get_frame('data/dev/input_temperature.csv') sample_series = get_series(sample, 'time', 'temperature') naive_pred = forecast(sample_series, st...
#!/usr/bin/python """Universal feed parser Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds Visit http://feedparser.org/ for the latest version Visit http://feedparser.org/docs/ for the latest documentation Required: Python 2.1 or later Recommended: Python 2.3 or later Recommended: CJKCodecs and...
import numpy as np from sklearn.ensemble import BaggingRegressor from sklearn.tree import DecisionTreeRegressor, ExtraTreeRegressor from robo.models.base_model import BaseModel ############################################################### # Decision tree #########################################################...
# qubit number=4 # total number=44 import cirq import qiskit from qiskit.providers.aer import QasmSimulator from qiskit.test.mock import FakeVigo from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import ...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.20 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import r...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'RMMainwindow.ui' # # Created by: PyQt5 UI code generator 5.14.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): M...
######## # Copyright (c) 2015 GigaSpaces Technologies Ltd. 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...
import base64 import hmac import time try: import urllib.parse as parse # for Python 3 except ImportError: import urllib as parse # for Python 2 try: from hashlib import sha1 as sha from hashlib import sha256 as sha256 except ImportError: import sha sha256 = None # query string argument of ...
import numpy as np import math import pandas as pd def Rs(alpha,beta,gamma): '''Generates an array that's used to transform (rotate) the stress tensor into a geographic coordinate system Geographic coordinates are X North, Y East, and Z Down. Input Euler angles alpha, beta, gamma in degrees D...
# -*- coding: utf-8 -*- # # MolVS documentation build configuration file, created by sphinx-quickstart on Thu Apr 24 14:35:38 2014. # 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 configurati...
from __future__ import absolute_import import threading import Queue import time from ..util import defaultproperty from ..async import AbstractAsyncManager def _spin_wait(fn, timeout): """ Spin-wait blocking only 1 second at a time so we don't miss signals """ elapsed = 0 while True: if fn(timeo...
# ====================================================================================================================== # File: Model/ListTableBase.py # Project: AlphaBrew # Description: A definition for a beer hops in list form. # Author: Jared Julien <jaredjulien@gmail.com> # Copyright: (...
# By Mostapha Sadeghipour Roudsari # Sadeghipour@gmail.com # Honeybee started by Mostapha Sadeghipour Roudsari is licensed # under a Creative Commons Attribution-ShareAlike 3.0 Unported License. """ Convert HDR to TIF - Provided by Honeybee 0.0.55 Args: _HDRFilePath: Path to an HDR image file ...
#!/usr/bin/python # Copyright (c) Ontic. (http://www.ontic.com.au). All rights reserved. # See the COPYING file bundled with this package for license details. ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: kong_service ...
import pandas as pd import numpy as np import scanpy as sc def test_rank_genes_groups_with_renamed_categories(): adata = sc.datasets.blobs(n_variables=4, n_centers=3, n_observations=200) assert np.allclose(adata.X[1], [9.214668, -2.6487126, 4.2020774, 0.51076424]) sc.tl.pca(adata) sc.pp.neighbors(...
# -*- coding:utf8 -*- import time from .compat import GreenPipe from .connection import Urllib3HttpConnection from .serializer import JSONSerializer from .exceptions import (NOSException, ServiceException, ConnectionError, ConnectionTimeout, InvalidObjectName, InvalidB...
# coding: utf-8 """ wima.tests ========== Project test suite. :copyright: Copyright (c) 2014 Andrey Martyanov. All rights reserved. :license: MIT, see LICENSE for more details. """
"""Utilities to get elements of generated spec""" from apispec.utils import build_reference def get_schemas(spec): if spec.openapi_version.major < 3: return spec.to_dict()["definitions"] return spec.to_dict()["components"]["schemas"] def get_responses(spec): if spec.openapi_version.major < 3: ...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
import botbowl from botbowl.core import Action def player_hash(player: botbowl.core.model.Player) -> str: if player.position is None: pos = None else: pos = hash(player.position) return f"p[{player.name}-{pos}-{hash(player.state)}]" def team_hash(game: botbowl.Game, team: botbowl.Team): ...
#coding=utf-8 from distutils.core import setup setup( name='picturesdownloader', version='0.1dev', packages=['picspider',], license='GPL', long_description=open('README.txt').read(), )
from .base_roi_head import BaseRoIHead from .bbox_heads import (BBoxHead, ConvFCBBoxHead, DoubleConvFCBBoxHead, Shared2FCBBoxHead, Shared4Conv1FCBBoxHead) from .cascade_roi_head import CascadeRoIHead from .double_roi_head import DoubleHeadRoIHead from .dynamic_roi_head import DynamicRoIHead fro...
from functools import partial from typing import cast, List from pytest import mark, raises # type: ignore from graphql.language import parse from graphql.pyutils import FrozenList from graphql.type import ( GraphQLEnumType, GraphQLEnumValue, GraphQLField, GraphQLInputField, GraphQLInputType, ...
from six import b from django.test import TestCase from django.contrib.auth.models import User, Group, Permission from django.core.urlresolvers import reverse from django.core.files.base import ContentFile from wagtail.wagtaildocs import models from wagtail.tests.utils import WagtailTestUtils # TODO: Test serve vie...
import pytest from requests.exceptions import InvalidURL import cdpy from cdpy import cdp class TestGetTargets: @pytest.fixture def response(self): return [ { "description": "", "devtoolsFrontendUrl": "/devtools/inspector.html?ws=127.0.0.1:9222/devtools/pag...
# Copyright 2016 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...
""" Examples how boolean works in python """ a = True b = False print(a) print(b) print("*********") print(bool(0)) print(bool(1)) print(bool(2)) c = "" print(bool(c)) c = "Some Value" print(bool(c))
from .oauth import map_twitter
import sys import os import json from loguru import logger from ..default import EOS, LOGGING_FILE, VERBOSE_FILE ROTATION = "10 MB" class Logger(object): def __init__(self): self.logger = logger self.logger.remove() self._console = None self._file = None self.fmt = "{time...
# encoding: utf-8 # Copyright 2011 California Institute of Technology. ALL RIGHTS # RESERVED. U.S. Government Sponsorship acknowledged. from curator import ICurator from identifiable import IIdentifiable from registryobject import IRegistryObject from service import IService from servicebinding import IServiceBinding ...
from typing import Any, List import hydra import numpy as np import pytorch_lightning as pl import wandb from omegaconf import DictConfig, OmegaConf from pytorch_lightning import loggers as pl_loggers from prostate_cancer_segmentation import metrics from prostate_cancer_segmentation.callbacks.log_media import LogMedi...
# -*- mode: python; encoding: utf-8 -*- # # Copyright 2013 Jens Lindström, Opera Software ASA # # 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...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Syncs a database table to the `DocType` (metadata) .. note:: This module is only used internally """ import re import os import frappe from frappe import _ from frappe.utils...
"""Model benchmark case list.""" MODEL_BENCHMARK_CASES = [ { "benchmark_name": "BM_MobileNetV1", "model_path": "mobilenet_v1_1.0_224_quant", }, { "benchmark_name": "BM_MobileNetV1_25", "model_path": "mobilenet_v1_0.25_128_quant", }, { "benchmark_name": "BM_Mo...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The American Gut Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------...
def main(): from collections import deque from sys import stdin input = stdin.readline N, M = map(int, input().split()) G = [[] for _ in range(N)] for _ in [0] * (N - 1): x, y = map(int, input().split()) x -= 1 y -= 1 G[x].append(y) G[y].append(x) #各頂...
begin_unit comment|'# Copyright (c) 2010 Citrix Systems, Inc.' nl|'\n' comment|'# Copyright 2010 OpenStack Foundation' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with the License. You may...
# Copyright 2016-2022 The FEAGI 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 applic...
import sys, os import io from PIL import Image import threading import signal import ssl from SimpleWebSocketServer import WebSocket, SimpleWebSocketServer, SimpleSSLWebSocketServer from optparse import OptionParser import numpy as np import json sys.path.append('../pix2pix_wrapper') from pix2pix_wrapper import pix2...
from .base_processor import ( _BaseProcessor, SharedProperty ) from .digitizer import DigitizerProcessor from .azimuthal_integration import ( AzimuthalIntegProcessorPulse, AzimuthalIntegProcessorTrain, ) from .binning import BinningProcessor from .correlation import CorrelationProcessor from .image_processor im...
import torch import numpy as np from torch import nn import torchvision import torch.nn.functional as F from pathlib import Path from asteroid import torch_utils from asteroid.engine.optimizers import make_optimizer from asteroid.filterbanks import transforms # Reference: https://github.com/bill9800/speech_separation...
#!/usr/bin/env python # encoding: utf-8 """ @author:nikan(859905874@qq.com)🎂 @file: geventreactor.py @time: 2018/10/28 下午10:28 """ import gevent from greenlet import GreenletExit from gevent import get_hub from gevent._interfaces import ILoop from gevent._socketcommon import getaddrinfo, wait_read, wait_write from ...
__all__ = ['ttypes', 'constants', 'Foo']
import regex import synapse.lib.cmdr as s_cmdr from synapse.tests.common import * class SynCmdCoreTest(SynTest): def test_cmds_auth(self): with self.getSslCore() as proxies: uprox, rprox = proxies # type: s_cores_common.CoreApi, s_cores_common.CoreApi outp = self.getTestOutp() ...
from year2019.intcode_v2 import Intcode from common import input_integer_sep def part_one(inp_list): program1 = ( "NOT A J\n" "NOT B T\n" "OR T J\n" "NOT C T\n" "OR T J\n" "AND D J\n" "WALK\n" ) p = Intcode( inp_list, [ord(char) for ch...
import numpy as np import time from copy import deepcopy from utils.sigmoid import sigmoid, step_function from utils.check_data import check_data from sklearn.datasets import load_iris # Author: Zhengting Li <heyimzhengting@gmail.com> class Logistic_Regression(): def __init__(self, early_stop=False, iteration=1...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayOpenPublicFollowingQueryModel(object): def __init__(self): self._user_id = None @property def user_id(self): return self._user_id @user_id.setter def user_...
import os import sys import time import argparse import math import wavio import pdb import numpy as np from numpy import finfo from waveglow.glow import WaveGlow import torch from distributed import apply_gradient_allreduce import torch.distributed as dist from torch.utils.data.distributed import DistributedSampler f...
# -*- encoding: utf-8 -*- # # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 asyncio import re from datetime import timedelta from typing import Any, Dict, List, Mapping, NamedTuple, Optional, Tuple, Union import arrow import dateutil.parser import discord.errors import regex from async_rediscache import RedisCache from dateutil.relativedelta import relativedelta from discord import Col...
# 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...
import unittest import set_up import os class DirectoryHandlerTestCase(unittest.TestCase): """docstring for DirectoryHandlerTestCase.""" def setUp(self): self.directoryHandler = set_up.DirectoryHandler() def test_gets_home_directory(self): actual_home_directory = self.directoryHandler.get_h...
__author__ = 'fengyu' from typing import Dict from overrides import overrides import math import torch import torch.nn as nn from torch.autograd import Variable from torch.distributions import Bernoulli from wolf.modules.discriminators.discriminator import Discriminator class MultiLabelDiscriminator(Discriminator): ...
import os import pandas as pd from datetime import datetime def clean_data(): file_name = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data.csv") pd_frame = pd.read_csv(file_name, delimiter=",", index_col=False) pd_frame.drop(labels=pd_frame.columns[[0, 9]], inplace=True, axis=1) pd_fr...
import os datasets = [ 'iris', 'heart', 'arrhythmia', #'abalone', 'wine', 'segment', #'sensorless_drive', ] model = ['jehm', ] mix = ['none', 'random'] for i_mix in mix: for i_d in datasets: print('Current Met...
# -*- coding: utf-8 -*- # # nifty documentation build configuration file, created by # sphinx-quickstart on Sun Aug 27 21:05:51 2017. # # 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...
from PIL import Image from PIL import ImageDraw from PIL import ImageFont import sys from struct import * import array import numpy as np import os thisdir = os.getcwd() for r, d, f in os.walk(thisdir): for file in f: if file.endswith(".data"): image_name = os.path.join...
import operator def getRankedList(filteredListofWords): rank={} for i in filteredListofWords: rank[i]=0 for i in filteredListofWords: rank[i]=rank[i]+1 ranked = sorted(rank.iteritems(), key=operator.itemgetter(1),reverse=True) keys=[x for (x,y) in...
# -*- coding: utf-8 -*- from __future__ import print_function import sys import json import optparse import itertools import six from . import backends from .util import Bag desc = "Manipulate the AnADAMA dependency database" def dump_dependencies(backend): for key in backend.keys(): b = Bag() ...
""" A note on how jobs are scheduled and run: Any job that has to touch the database should not be scheduled directly. This is because of the issues laid out in <https://brandur.org/job-drain>, but to summarize: if a job is triggered in the same transaction as the data it relies on is written, it may try to run before...
""" This module provides some basic helper/formatting utilities. >>> hexdump( bytearray( [0x00] ) ) '0000 0x00 .' >>> 0x00 == HighByte( 0x0F ) True >>> 0x0F == LowByte( 0x0F ) True >>> CRC16CCITT.compute( bytearray( [ 2, 6, 6, 3 ] ) ) 16845 >>> CRC16CCITT.compute( bytearray( [ 0x02, 0x09, ...
import datetime import pytest import os import sys sys.path.insert(1, os.path.join(sys.path[0], "..")) from mabel.adapters.disk import DiskReader from mabel.data import Reader from rich import traceback traceback.install() def test_can_read_parquet(): r = Reader( inner_reader=DiskReader, row_for...
#!/usr/bin/python2 from PyQt4 import QtNetwork, QtCore from TaskManager import * import os, sys, readline, time, subprocess, signal version = "1.0.1" GL_PROG = "gloader" base_data_dir = os.environ["GINI_HOME"] + "/data" data_dir = base_data_dir recovery = False server = None shell = None class Server(QtCore.QObject...
# client - port scanner # Goal - Find open ports import socket import sys #usage: Python port_scanner.py www.nmap.org 1 200 try: host = sys.argv[1] min_port = int(sys.argv[2]) max_port = int(sys.argv[3]) except IndexError as e: print("Usage: Python port_scanner.py TargetIP Min_Port Max_port") print...
class block: tupledict = {} mass = 0.0 size = 0.0 dimension = 0 colsetDict = {} colDegreeDicts = {} colKeysetDicts = {} def __init__(self, tupledict, colsetDict, colDegreeDicts, colKeysetDicts, mass, size, dimension): self.tupledict = tupledict self.mass = mass ...
from panda3d.core import WindowProperties, ClockObject class Window: __slots__=( 'panda_winprops', 'get_display_modes', '_aspect2D_edges', '_show_fps' ) def __init__(self): self.panda_winprops = WindowProperties() self.get_display_modes = ez.panda_sho...
""" This module contains functions that generate ctypes prototypes for the GDAL routines. """ from ctypes import c_char_p, c_double, c_int, c_void_p from functools import partial from django.contrib.gis.gdal.prototypes.errcheck import ( check_arg_errcode, check_errcode, check_geom, check_geom_offset, check_po...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import argparse import datetime import json import random import time from pathlib import Path import numpy as np import torch from torch.utils.data import DataLoader, DistributedSampler import datasets import util.misc as utils from datasets impo...
from sympy import exp, symbols, sqrt, I, pi, Mul, Integer, Wild, Rational from sympy.matrices import Matrix, ImmutableMatrix from sympy.physics.quantum.gate import ( XGate, YGate, ZGate, random_circuit, CNOT, IdentityGate, H, X, Y, S, T, Z, SwapGate, gate_simp, ...
import base64 import json from gzip import compress import mock from kubernetes.client.models.v1_list_meta import V1ListMeta from kubernetes.client.models.v1_object_meta import V1ObjectMeta from kubernetes.client.models.v1_secret import V1Secret from kubernetes.client.models.v1_secret_list import V1SecretList from da...
# 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 ...
from django.db import models # Create your models here. class OnedenCategory(models.Model): name = models.CharField(max_length=100) class OnedenAliment(models.Model): category = models.ForeignKey(OnedenCategory, null=False, blank=False) name = models.CharField(max_length=250) calories = models.DecimalField(max_d...
# MIT License # Copyright (c) 2017 MassChallenge, Inc. import json from accelerator.models import ProgramRole from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from rest_framework.test import APIClient from test_plus.test import TestCase from impact.tests.fac...
# -*- coding: utf-8 -*- # # Pymote documentation build configuration file, created by # sphinx-quickstart on Wed Nov 07 19:26:40 2012. # # 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 ...
from django.contrib import admin from . import models from import_export.admin import ImportExportModelAdmin class OwnerAdmin(ImportExportModelAdmin): list_display = [ 'name', 'mobile', ] list_display_links = [ 'name', ...
#!/usr/bin/env python import os import werkzeug werkzeug.cached_property = werkzeug.utils.cached_property from flask import Flask from flask_cors import CORS from mongo import mongo from apis.db import blueprint as db_blueprint # Mongo settings MONGO_URI = os.environ.get('MONGO_URI') MONGO_DBNAME = os.environ.get('...
# Copyright 1999-2020 Alibaba Group Holding Ltd. # # 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...
from django.contrib import admin from django.urls import reverse from django import forms from puzzles.models import ( Round, Puzzle, Team, TeamMember, PuzzleUnlock, AnswerSubmission, ExtraGuessGrant, PuzzleMessage, Erratum, Survey, Hint, ) class RoundAdmin(admin.ModelAdmi...
import torch import torch.nn as nn class LeNet(nn.Module): def __init__(self): super(LeNet, self).__init__() self.fc2 = nn.Linear(500, 10) self.fc1 = nn.Linear(800, 500) self.dp = nn.Dropout(p=0.5) self.conv2 = nn.Conv2d(20, 50, (5, 5)) self.conv1 = nn.Conv2d(1, 20,...