text
stringlengths
1
927k
# coding: utf8 # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # # 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 requ...
# # Copyright 2019 Verto Lab 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 ...
import datetime import calendar import httpagentparser from flask import Blueprint, make_response, jsonify, request, url_for, render_template from models import PostModel, TagModel, LikeModel, ReplyModel, Analyze_Pages, UserModel, Ip_Coordinates, bcrypt, \ Notifications_Model, Subscriber, Analyze_Session import d...
from ciscoconfparse import CiscoConfParse cisco_conf = CiscoConfParse('cisco_ipsec.txt') crypto_maps = cisco_conf.find_objects(r'crypto map') print '\nThe following are the crypto maps defined in the file' print '-----------------------------------------------------' for i in crypto_maps: print i.text childr...
import inspect import sys import typing from dataclasses import dataclass if sys.version_info < (3, 8): from typing_extensions import Literal else: from typing import Literal from di.typing import get_markers_from_parameter from xpresso._utils.typing import model_field_from_param from xpresso.binders._body.o...
# Copyright 2015 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...
import pandas as pd from police_api import PoliceAPI def first_job(api, dates, t_current): """ Creates the tables and populates them with the historical data from ​T​_0 ​ ​to ​T​_current """ # subset of dates dates_hist = dates[dates <= t_current] # crime_categories table s_crime_c...
from typing import Any, Dict, List, Mapping def replace_placeholders_with_files( operations: Dict[str, Any], files_map: Dict[str, List[str]], files: Mapping[str, Any], ) -> Dict[str, Any]: path_to_key_iter = ( (value.split("."), key) for (key, values) in files_map.items() for v...
# -*- coding: utf-8 -*- import numpy as np import torch from torch import autograd from torch.autograd import Variable import torch.nn as nn from maptrainer.model.MAPModel import MAPModel from ..data import INIT_RANGE_BOUND class LinRNNModel(MAPModel): """ `LinRNNModel`: Linear-output RNN model Contain...
import datetime import unittest from time import sleep from unittest import TestCase from pbx_gs_python_utils.utils.Dev import Dev from gw_bot.elastic.Save_To_ELK import Save_To_ELK from gw_bot.helpers.Test_Helper import Test_Helper class Test_Save_To_ELK(Test_Helper): def setUp(self): super().setUp() ...
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved. # This is licensed software from AccelByte Inc, for limitations # and restrictions contact your company contract manager. # # Code generated. DO NOT EDIT! # template file: justice_py_sdk_codegen/__main__.py # pylint: disable=duplicate-code # pylint: disable=li...
# Generated by Django 2.2.5 on 2019-09-10 08:10 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Entry', fields=[ ('id', models.AutoField(au...
from django.conf.urls import url from djview import views urlpatterns = [ url(r'^$', views.djview_index, name='djview_index'), url(r'^about/', views.djview_about, name='djview_about'), url(r'^add_category/', views.add_category, name='add_category'), url(r'^category/(?P<category_name_slug>[\w\-]+)/$', v...
#!/usr/bin/env python3 import math def fac_bench(n): return sum(math.factorial(i) for i in range(1, n)) print(fac_bench(3001), end='')
# -*- coding: utf-8 -*- # @Time : 2018/7/9 上午10:41 # @Author : waitWalker # @Email : waitwalker@163.com # @File : MTTAESHandler.py # @Software: PyCharm from Handlers import MTTBaseHandler from Security import MTTSecurityManager from Crypto.Cipher import AES class MTTAESHandler(MTTBaseHandler.MTTBaseHandler):...
import sys from pprint import pprint from silk import Silk, ValidationError def adder(self, other): return other + self.x s = Silk() s.__add__ = adder s.bla = adder s.x = 80 print(s.x.data) print(s.bla(5)) print(s+5) s2 = Silk(schema=s.schema) s2.x = 10 print(s2+5) s3 = Silk(schema=s2.schema) s3.x = 10 print(s3...
import time from selenium import webdriver from selenium.webdriver.chrome.service import Service service = Service('./drivers/chromedriver.exe') service.start() driver = webdriver.Remote(service.service_url) driver.get('http://www.google.com/'); time.sleep(5) # Let the user actually see something! driver.quit()
from .base import ApiCaller from PyQt5.QtCore import pyqtSignal from surirobot.core.common import State, ehpyqtSlot import requests import logging import os class SttApiCaller(ApiCaller): """ API class for STT API https://github.com/suricats/surirobot-api-converse """ update_state = pyqtSignal(st...
############################################################################### ## ## Copyright (C) Tavendo GmbH and/or collaborators. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are met: ## ## 1....
# -*- coding: utf-8 -*- # # CP Demo documentation build configuration file, created by # sphinx-quickstart on Wed Dec 17 14:17:15 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. # # A...
"""Univariate features selection.""" # Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay. # L. Buitinck, A. Joly # License: BSD 3 clause import numpy as np import warnings from scipy import special, stats from scipy.sparse import issparse from ..base import BaseEstimator from ..prepr...
import inspect import hashlib import logging import os from django.core.files.uploadedfile import TemporaryUploadedFile from django.db.models import FieldDoesNotExist from django.db.models.fields.files import FileField from django.http import QueryDict from django.utils.datastructures import MultiValueDict logger = l...
import mxnet as mx import numpy as np import cv2 import random from io import BytesIO from collections import namedtuple from train_mnist import read_data, Get_image_lable import random def get_ocrnet(): data = mx.symbol.Variable('data') conv1 = mx.symbol.Convolution(data=data, kernel=(5, 5), num_filter=32) ...
# Copyright 2007-2010 by Peter Cock. All rights reserved. # Revisions copyright 2007-2008 by Michiel de Hoon. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Testing online c...
# Copyright (c) Facebook, Inc. and its affiliates. # 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. import importlib import json import os import sys import unittest import unittest.mock from collections import Co...
#!/usr/bin/env python3 import os, subprocess from libsw import builder, version class ImageMagickBuilder(builder.AbstractGitBuilder): def __init__(self, build_dir="/usr/local/src/", source_version=False): super().__init__('image-magick', build_dir, source_version, branch="main") def get_source_url(se...
#!/bin/python3 import math import os import random import re import sys # # Complete the 'twoArrays' function below. # # The function is expected to return a STRING. # The function accepts following parameters: # 1. INTEGER k # 2. INTEGER_ARRAY A # 3. INTEGER_ARRAY B # def twoArrays(k, A, B): # Write your co...
__doc__=''' Sending stats to the server for a while. Duration is specified as an argument or it goes on forever. ''' import sys from lib.utilities import * from lib.common import Monitor server = startServer() print "sending stats command to server\n" mcm = Monitor() mcm.run(int(sys.argv[-1])) print "stats collecte...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # funwithserverless 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. # ...
# Copyright (c) 2017-2018 Cloudify Platform 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 required ...
import FWCore.ParameterSet.Config as cms hltDiEG25CaloIdLHgcalHEUnseededFilter = cms.EDFilter("HLTEgammaGenericQuadraticEtaFilter", absEtaLowEdges = cms.vdouble(0.0, 1.0, 1.479, 2.1), candTag = cms.InputTag("hltDiEG25CaloIdLClusterShapeSigmavvUnseededFilter"), doRhoCorrection = cms.bool(False), effecti...
#!python3 #pull_xml.py uses the requests module to pull down the feed xml file for use in the xml parser script. #This will result in just one call/request to the Steam webserver hosting this XML file. import requests # TODO Create a namedtuple ('URL_chooser', 'index URL XML_file') URL = "https://www.stuff.co.nz/rss...
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The CounosH Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPC commands for signing and verifying messages.""" from test_framework.test_framework import Cou...
# Copyright (c) 2017 Sony Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
#!/usr/bin/python2.4 # # Copyright 2008 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 o...
""" @Title: dataToParquet.py @author: Ashia Lewis GOAL: Create and update the parquet files for the air and soil data, separately. """ import os import glob import pandas as pd import pyarrow as pa import pyarrow.parquet as pq #CODE TO BE USED FOR THE BATCH DATA """ #file directories for the air and soil files air_di...
# -*- coding: utf-8 -*- class Solution(object): def isAnagram(self, s, t): if not s and not t: return True if (not s and t) or (s and not t): return False map_s = {} for i, char in enumerate(s): map_s[char] = map_s.get(char, 0) + 1 map_t ...
""" Test cases for time series specific (freq conversion, etc) """ from datetime import ( date, datetime, time, timedelta, ) import pickle import numpy as np import pytest from pandas._libs.tslibs import ( BaseOffset, to_offset, ) import pandas.util._test_decorators as td from pandas import (...
# 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...
from __future__ import division from math import cos, pi, sin import pygame from pygame.rect import Rect from arena import ARENA_MARKINGS_COLOR, ARENA_MARKINGS_WIDTH, Arena from ..markers import Token from ..vision import MARKER_TOKEN_GOLD, MARKER_TOKEN_SILVER HOME_ZONE_SIZE = 2.5 INNER_CIRCLE_RADIUS = 0.42 OUTER_...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Community.uid' db.alter_column(u'communities_community', 'uid', self.gf('django.db.models...
def rotate_left3(numbers:list)->list: """Returns a new list containing the same elements, but they are "rotated left". >>>rotate_left3(1,2,3) [2,3,1] >>>rotate_left3(2,3,4) [3,4,2] """ lst[0] = b ,lst[1] = c, lst[2] = a return [b,c,a]
# # PySNMP MIB module CISCO-WAN-ATM-CONN-CAPABILITY (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WAN-ATM-CONN-CAPABILITY # Produced by pysmi-0.3.4 at Mon Apr 29 18:03:44 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python ve...
import unittest from tests.utils.base import TestBase class ObjectPropertyAxiomsTestCase(TestBase): @unittest.expectedFailure def test_something(self): self.assertEqual(True, False) if __name__ == '__main__': unittest.main()
from functools import partial from typing import cast from plateau.core.docs import default_docs from plateau.core.factory import _ensure_factory from plateau.core.naming import ( DEFAULT_METADATA_STORAGE_FORMAT, DEFAULT_METADATA_VERSION, SINGLE_TABLE, ) from plateau.core.uuid import gen_uuid from plateau....
import pandas as pd from IPython.core.display import display def bordered_table(hide_headers=[], color='#ddd'): return [ {'selector': 'th', 'props': [('text-align', 'center'), ('border', f'1px solid {color}')]}, {'selector': 'td', 'props': [('border', f'1px solid {color}')]}, *[ ...
from pathlib import Path import pytest from pydantic import ValidationError from fastapi_serviceutils.app import collect_config_definition from fastapi_serviceutils.app import Config @pytest.mark.parametrize( 'config_path', [ 'tests/configs/config.yml', 'tests/configs/config2.yml', '...
# Copyright 2013 OpenStack Foundation # 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 requ...
# Purpose: takes a list of filenames AND/OR publically accessible urls. # Returns a tiled image file of tiles SIZExSIZE, separated by spaces of width # DIFF, in rows if length ROWSIZE. # files that can't be retrieved are returned blank. import os import numpy as np from PIL import Image import urllib.request impor...
# Python program to find N largest # element from given list of integers # Function returns N largest elements def Nmaxelements(list1, N): final_list = [] for i in range(0, N): max1 = 0 for j in range(len(list1)): if list1[j] > max1: max1 = list1[j]; list1.remove(max1); final_list....
#! /usr/bin/python2 import subprocess import sys import os import time from subprocess import PIPE import socket default_params = '' output_file_prefix = 'output' if len(sys.argv) > 1: output_file_prefix = sys.argv[1] # # http://stackoverflow.com/questions/4675728/redirect-stdout-to-a-file-in-python # class Logg...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/config/config.bt_defaults.ipynb (unless otherwise specified). __all__ = ['path_results', 'path_models', 'path_data', 'file_format', 'verbose', 'name_logger', 'save_splits', 'group', 'error_if_present', 'overwrite_field', 'mode_logger', 'separate_labels', 'warn...
""" Copyright 2020 Tianshu AI Platform. 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 ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.visualization.wcsaxes.core import WCSAxes import matplotlib.pyplot as plt from matplotlib.backend_bases import KeyEvent from astropy.wcs import WCS from astropy.coordinates import FK5 from astropy.time import Time from astropy.tests.image_tes...
# -*- coding: utf-8 -*- # This module contains all the Object classes used by the MIT Core Concept # Catalog (MC3) Handcar based implementation of the OSID Type Service. from ...abstract_osid.type import objects as abc_type_objects from ..osid import objects as osid_objects from .. import settings from ..primitives i...
import pytest from telebot import types from tululbot.utils import TululBot, lookup_kamusslang, lookup_urbandictionary, lookup_slang from tululbot.types import Message class TestTululBot: def test_create_bot(self): bot = TululBot('TOKEN') assert bot._telebot is not None assert bot._user...
class TestNothing: def test_nothing(self): pass
# -*- coding: utf-8 -*- """ Created on Wed Nov 28 01:15:31 2018 @author: Andres """ import pandas as pd url = 'http://catalogo.datosabiertos.gob.ec/api/action/datastore_search?resource_id=8513f446-1c94-426e-8592-d4cbdd295f33&limit=1000' datos = pd.read_json(url, typ='frame') datos =pd.DataFrame.from_dict(datos["resu...
# 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...
"""Here we are trying to provide an secure and safe space for evaluate simple python expressions on some 'data'. If you only need a oneshot evaluation, you call safeEval and enjoy the result. Otherwise call first compile to get the ast representation and execute that compiled expression multiple times with different da...
#!/usr/bin/env python # rrt.py # This program generates a simple rapidly # exploring random tree (RRT) in a rectangular region. # # Written by Steve LaValle # May 2011 import sys, random, math, pygame from pygame.locals import * from math import sqrt,cos,sin,atan2 import heapq import numpy as np #constants XDIM = 50...
# -*- coding: utf-8 -*- from collections import defaultdict from matplotlib import ticker from downward.reports.scatter import ScatterPlotReport from downward.reports.plot import PlotReport, Matplotlib, MatplotlibPlot # TODO: handle outliers # TODO: this is mostly copied from ScatterMatplotlib (scatter.py) class ...
# 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 ...
import os import unittest import logging import tempfile import subprocess from .base_utils import (HAS_PBCORE, pbcore_skip_msg, get_temp_file, get_temp_dir) from pbcommand.resolver import (resolve_tool_contract, ...
""" This package holds the Optimal BPM plugin, its libraries and UI The Optimal Framework loads this that """ import runpy __author__ = 'Nicklas Borjesson' def run_agent(): runpy.run_module(mod_name="optimalbpm.agent.agent", run_name="__main__")
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
import octosql_py_native import yaml from .connection import OctoSQLConnection class OctoSQL: def __init__(self): octosql_py_native.init() def connect(self, sources): conf = { "dataSources": list(map(lambda source: source.generateConfigObject(), sources)) } config...
from .account import Account from .session import Session from .outbound_group_session import OutboundGroupSession from .inbound_group_session import InboundGroupSession from .utility import ed25519_verify
import json from django import forms from django.contrib.auth.models import User from django.http.response import HttpResponse from django.test import TestCase from django.test import client from django.test.client import RequestFactory from django.test.utils import override_settings import six import advanced_reports ...
import six from syntaxerrors import automata from syntaxerrors.parser import Token from syntaxerrors.pytoken import python_opmap_bytes from syntaxerrors.pytoken import tokens from syntaxerrors.error import TokenError, TokenIndentationError from syntaxerrors.pytokenize import tabsize, whiteSpaceDFA, \ triple_quoted...
from graphene import ObjectType, relay from graphene_django import DjangoObjectType from graphene_django.filter import DjangoFilterConnectionField from . import models as m class FileNode(DjangoObjectType): class Meta: model = m.File interfaces = (relay.Node,) filter_fields = [ ...
""" Meta social community forms """ from django import forms from .models import Community class EditCommunityForm(forms.ModelForm): """ Community editing form """ def __init__(self, *args, **kwargs): super(EditCommunityForm, self).__init__(*args, **kwargs) for key in self.fields: ...
"""empty message Revision ID: 276ef161b610 Revises: Create Date: 2017-10-24 19:30:22.200973 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '276ef161b610' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
# Generated by Django 2.0 on 2018-06-05 12:08 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('djconnectwise', '0060_auto_20180605_0840'), ] operations = [ migrations.AlterModelOptions( name='team', options={'ordering': (...
'''Copyright 2018 Province of British Columbia 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,...
# Copyright 2015-2018 Capital One Services, 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 ...
# -*- coding: utf-8 -*- # # FeinCMS documentation build configuration file, created by # sphinx-quickstart on Mon Aug 10 17:03:33 2009. # # 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...
import datetime import resource from pandas_datareader import data as pdr import fix_yahoo_finance as yf from tickers import test_tickers def get_all_stock_data(start, end, threads=(int)(resource.RLIMIT_NPROC*0.25)): assert isinstance(start, datetime.datetime), "Error: start time must be datetime object" asse...
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = ['coverage==4.5.1', 'mock==2.0.0', 'my...
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet keypool and interaction with wallet encryption/locking.""" from test_framework.test_fr...
# Fit a straight line, of the form y=m*x+b import tensorflow as tf xs = [0.00, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00] # Features ys = [-0.82, -0.94, -0.12, 0.26, 0.39, 0.64, 1.02, 1.00] # Labels """ with enough iterations, initial weights dont matter since our cost function is convex. """ m_initial = -0.5 # I...
import requests import os import argparse import json import lzma import subprocess import shutil import sys from configparser import ConfigParser parser = argparse.ArgumentParser( description='Tool for managing Gmod Steam content') parser.add_argument("-nogmad", help="for travis", action="store_true") parser.add_...
import sys from types import MappingProxyType, DynamicClassAttribute from builtins import property as _bltin_property, bin as _bltin_bin __all__ = [ 'EnumType', 'EnumMeta', 'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag', 'auto', 'unique', 'property', 'verify', 'FlagBoundary', 'STRICT'...
# -*- coding:utf-8 -*- from flask_restful import Resource, reqparse, request from fileserver.git_fs import gitlab_project from common.const import role_dict from common.log import loggers from common.sso import access_required from common.audit_log import audit_log from flask import g from resources.sls import delete_s...
"""Interface for AlphaGo self-play""" from AlphaGo.go import PASS, WHITE, GameState class play_match(object): """Interface to handle play between two players.""" def __init__(self, player1, player2, save_dir=None, size=19): # super(ClassName, self).__init__() self.player1 = player1 se...
import argparse import requests from cromwell_tools.cromwell_api import CromwellAPI from cromwell_tools.cromwell_auth import CromwellAuth from cromwell_tools.diag import task_runtime from cromwell_tools import __version__ diagnostic_index = { 'task_runtime': task_runtime.run } def parser(arguments=None): # ...
""" Define the User model """ from . import db from .abc import BaseModel, MetaBaseModel class User(db.Model, BaseModel, metaclass=MetaBaseModel): """ The User model """ __tablename__ = "user" key = db.Column(db.Integer, primary_key=True) first_name = db.Column(db.String(300), primary_key=False) ...
#!/usr/bin/env python # Copyright 2019 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. """Clobbers all builder caches for a specific builder. Note that this currently does not support windows. """ import argparse import ...
import bpy, bmesh from math import radians import numpy as np import os import random import sys sys.path.append("D:\ProgramFiles\Anaconda\envs\py37\Lib\site-packages") from pyntcloud import PyntCloud file_dir = os.path.dirname(__file__) sys.path.append(file_dir) from blender_utils import extrude, gancio, get_min_m...
""" Register everything to do with matmul """ import tvm from tvm import te, relay, autotvm from tvm.topi import generic import tvm.relay.op as _op from tvm.relay.op.strategy.generic import * import os from ..simulator import architecture from ..tiles import tiles from tvm.auto_scheduler import is_auto_scheduler_enabl...
import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras import Input, Model from tensorflow.keras.layers import Dense, Conv2D, BatchNormalization, Dropout, Lambda, \ GlobalAveragePooling2D, Activation, MaxPooling2D, AveragePooling2D, \ Concatenate, Add, Multiply, Softmax, Reshape...
import _plotly_utils.basevalidators class ShowtickprefixValidator( _plotly_utils.basevalidators.EnumeratedValidator ): def __init__( self, plotly_name='showtickprefix', parent_name='layout.scene.zaxis', **kwargs ): super(ShowtickprefixValidator, self).__init__( ...
import cv2 import os import random import time import torch import torch.backends.cudnn as cudnn import models from utils.logger import Logger import myexman from utils import utils import sys import torch.multiprocessing as mp import torch.distributed as dist import socket from torchvision import transforms,datasets f...
import pdf_to_json as p2j import json url = "file:data/multilingual/Latn.INA/Serif_16/udhr_Latn.INA_Serif_16.pdf" lConverter = p2j.pdf_to_json.pdf_to_json_converter() lConverter.mImageHashOnly = True lDict = lConverter.convert(url) print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: monitoring/DataMonitoringService.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import sym...
# -*- coding: utf-8 -*- # filename: reply.py import time from wenpl.divide import showReply class Msg(object): def __init__(self): pass def send(self): return "success" class TextMsg(Msg): def __init__(self, toUserName, fromUserName, content): self.__dict = dict() self._...
from django.urls import re_path from django.conf.urls.static import static from django.conf import settings from . import views urlpatterns=[ re_path('^$',views.home,name = 'home'), re_path(r'^all/',views.index, name= 'all'), re_path(r'^categories/(\d+)',views.categories,name = 'categories'), re_path(r...
import os import random import tarfile from collections import defaultdict from unittest.mock import patch from parameterized import parameterized from torchtext.datasets.stsb import STSB from ..common.case_utils import TempDirMixin, zip_equal, get_random_unicode from ..common.torchtext_test_case import TorchtextTest...
# Copyright 2015 Mirantis 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...
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists...