text
stringlengths
1
927k
# ------------------------------------------------------------------------------ from . import database as db # ------------------------------------------------------------------------------ def checkUser(username, passwd): return db.checkUser(username, passwd) # ------------------------------------------------...
__all__ = ['VERSION'] YOUTUBE_API_SERVICE_NAME = "youtube" YOUTUBE_API_VERSION = "v3" VIDEO = 'youtube#video' YOUTUBE_VIDEO_URL = 'https://www.youtube.com/watch?v=' VERSION = '4.0.0'
# Copyright (c) OpenMMLab. All rights reserved. from .utils import check_norm_state, is_block, is_norm __all__ = ['is_block', 'is_norm', 'check_norm_state']
import pytest import stweet as st from stweet.auth import TwitterAuthTokenProvider, SimpleAuthTokenProvider from stweet.exceptions import RefreshTokenException, ScrapBatchBadResponse from tests.integration.mock_web_client import MockWebClient def test_get_auth_token_with_incorrect_response_1(): with pytest.raise...
"""Models about verify """ from django.db import models from utils import getdate_now, randkey from utils.checker import UserInfoChecker class VerifyCode(models.Model): """VerifyCode """ session_id = models.IntegerField() phone = models.CharField(max_length=11) code = models.CharField(max_length=8...
# 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...
# 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 may ...
''' python setup.py build_ext -i to compile ''' # setup.py from distutils.core import setup, Extension # from Cython.Build import cythonize from Cython.Distutils import build_ext import numpy setup( name='mesh_core_cython', cmdclass={'build_ext': build_ext}, ext_modules=[Extension("mesh_core_cython", ...
from collections import OrderedDict def csv_to_groups_data(csv_path=None, csv_string=None): """Read a CSV to get the data to feed to ``find_statistical_saboteurs()`` or ``find_logical_saboteurs()``. See examples of such a file in the code repository: https://github.com/Edinburgh-Genome-Foundry/sabot...
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # # License: BSD (3-clause) from copy import deepcopy import re import numpy as np from .constants import FIFF from ..utils import logge...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of REANA. # Copyright (C) 2017, 2018 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """OpenAPI generator.""" from apispec import APISpec from flask ...
# Generated by Django 3.1.7 on 2021-07-04 13:04 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrations.AddField( ...
"""TLS Lite + asyncore.""" import asyncore from gdata.tlslite.TLSConnection import TLSConnection from AsyncStateMachine import AsyncStateMachine class TLSAsyncDispatcherMixIn(AsyncStateMachine): """This class can be "mixed in" with an L{asyncore.dispatcher} to add TLS support. This class essentially si...
# # (c) 2019, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible_collections.arista.eos.tests.unit.compat.mock import patch from ansible_collections.a...
#!/usr/bin/env python from random import shuffle import copy import inspect import pickle import unittest from ordereddict import OrderedDict class TestOrderedDict(unittest.TestCase): def test_init(self): self.assertRaises(TypeError, OrderedDict, ([('a', 1), ('b', 2)], None)) # too man...
from django.contrib import admin class ModelAdmin(admin.ModelAdmin): """Future app-wide admin customizations"""
# # Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. # """Contains utility functions used for Sandesh initialization and logging.""" from builtins import object import time from job_manager.job_exception import JobException from job_manager.job_messages import MsgBundle class SandeshUtils(object): ...
# -*- coding: utf-8 -*- from fastapi import APIRouter, Body, Security from pycloud_api.crud.tenant import get_tenant_by_id from pycloud_api.crud.user import get_current_user, check_free_username_and_email from pycloud_api.models.schemas.tenant import Tenant, TenantInResponse from pycloud_api.models.schemas.user import ...
from amaranth.build import * from amaranth.vendor.xilinx_7series import * __all__ = ["ZTurnLiteZ007SPlatform"] class ZTurnLiteZ007SPlatform(Xilinx7SeriesPlatform): device = "xc7z007s" package = "clg400" speed = "1" resources = [] connectors = [ Connector("expansion", 0, ...
import copy import json import ssl import flexssl import re import base64 import subprocess import os import gzip import random from bson import json_util from py_mini_racer import py_mini_racer import utils.redis_utils import proxy_modules.utils def handle_connection_close_header(request_breakdown, json_config): ...
#MIT License # #Copyright (c) 2020 signag # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, di...
import gym from gym import spaces from gym.utils import seeding import numpy as np from os import path class PendulumEnv(gym.Env): metadata = {"render.modes": ["human", "rgb_array"], "video.frames_per_second": 30} def __init__(self, g=10.0): self.max_speed = 8 self.max_torque = 2.0 se...
# -*- coding: utf-8 -*- from pythainlp.tokenize import etcc print(etcc.etcc("คืนความสุข")) # /คืน/ความสุข
# GridPot code # switch object class for integrating with a GridLAB-D simulation instance # Author: sk4ld import logging import urllib2 logger = logging.getLogger(__name__) from GL_obj import GL_obj # base object class for integrating with a GridLAB-D simulation instance class GL_TRANSFORMER(GL_obj): def init_p...
from a import b,c as c,d from b import c import d import d as dd
# sql/ddl.py # Copyright (C) 2009-2021 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php """ Provides the hierarchy of DDL-defining schema items as well as routines to invoke the...
# Test some subscription scenarios from typing import List, Tuple, Dict, Union from numbers import Number import pytest from numpy import ndarray from qcodes.dataset.param_spec import ParamSpec # pylint: disable=unused-import from qcodes.tests.dataset.temporary_databases import (empty_temp_db, ...
from sklearn.metrics import classification_report as sk_classification_report from sklearn.metrics import confusion_matrix import pickle import gzip from rdkit import DataStructs from rdkit import Chem from rdkit.Chem import QED from rdkit.Chem import Crippen from rdkit.Chem import AllChem from rdkit.Chem import Draw ...
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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. Redistributions of source code must retain the above copyright # notic...
"""Interface module to download Amazon product and history data from keepa.com """ import requests import asyncio import datetime import json import logging import time from functools import wraps import aiohttp import numpy as np import pandas as pd from tqdm import tqdm from keepa.query_keys import DEAL_REQUEST_KE...
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl, # K.U. Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can...
#!/usr/bin/env python3 from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from glob import iglob import os import logging from subprocess import run BIN_EXTS = [ '.wasm', '.png', ] VERSION_STR = None logging.basicConfig(level=logging.INFO) def abspath(p): op = os.path return op.absp...
# Squarified Treemap Layout # Implements algorithm from Bruls, Huizing, van Wijk, "Squarified Treemaps" and Laserson with some modifications # (but not using their pseudocode) # INTERNAL FUNCTIONS not meant to be used by the user def pad_rectangle(rect): if rect["dx"] > 2: rect["x"] += 1 rect[...
import pytest import numpy as np from mxnet.gluon import data import gluonnlp as nlp from gluonnlp.data import sampler as s N = 1000 def test_sorted_sampler(): dataset = data.SimpleDataset([np.random.normal(0, 1, (np.random.randint(10, 100), 1, 1)) for _ in range(N)]) gt_samp...
# -*- coding: utf-8 -*- """ Copyright (c) 2018 Robert Bosch GmbH All rights reserved. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. @author: Andreas Doerr """ import os from prssm.benchmarks.run import run from prssm.tasks.real_world_tasks i...
# Copyright 2013-2021 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 Inputproto(AutotoolsPackage, XorgPackage): """X Input Extension. This extension defin...
import os from os.path import join as pjoin from flask_sketch import templates from flask_sketch.sketch import Sketch from flask_sketch.const import requirements as reqs from flask_sketch.utils import GenericHandler def restx_handler(sketch: Sketch): if sketch.api_framework == "restx": sketch.add_requirem...
# -*- coding: utf-8 -*- """ Created on Tue Feb 9 16:31:57 2021 @author: beccamayers """ import schedule from datetime import datetime from alert_bot import get_alert import time now = datetime.now() timestamp = now.strftime("%b%d%Y %H%M%p") def job(): print("Launching Alert Bot app...") get_alert() sched...
from typing import Any, Dict from overrides import overrides from keras.layers import Input, Dense, Dropout, merge from keras.regularizers import l2 from ...data.instances.logical_form_instance import LogicalFormInstance from ..layers.tree_composition_lstm import TreeCompositionLSTM from ...training.text_trainer impo...
# Copyright 2018 New Vector 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 agreed to in writin...
""" This is a rdflib plugin for parsing NQuad files into Conjunctive graphs that can be used and queried. The store that backs the graph *must* be able to handle contexts. >>> from rdflib import ConjunctiveGraph, URIRef, Namespace >>> g = ConjunctiveGraph() >>> data = open("test/nquads.rdflib/example.nquads", "rb") >>...
"""Support for the Nettigo Air Monitor service.""" from __future__ import annotations import logging from homeassistant.components.button import ( ButtonDeviceClass, ButtonEntity, ButtonEntityDescription, ) from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant f...
# Generated by Django 2.2.5 on 2019-10-03 15:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pacientes', '0001_initial'), ] operations = [ migrations.AlterField( model_name='profile', name='empresa', ...
#!/usr/bin/env python3 """Parser for the Orkney Islands""" import arrow import dateutil import logging import requests from bs4 import BeautifulSoup # There is a 2MW storage battery on the islands. # http://www.oref.co.uk/orkneys-energy/innovations-2/ TZ = 'Europe/London' DATETIME_LINK = 'https://www.ssen.co.uk/anm...
import numpy as np import unittest from collections import OrderedDict import bnpy from AbstractEndToEndTest import AbstractEndToEndTest class TestEndToEnd(AbstractEndToEndTest): __test__ = True def setUp(self): """ Create the dataset """ rng = np.random.RandomState(0) X = rn...
# Generated by Django 3.1.6 on 2021-04-26 20:29 import datetime from django.db import migrations, models from django.utils.timezone import utc import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('auctions', '0012_auto_20210426_1628'), ] operations = [ m...
import pytest from deepproblog.utils.standard_networks import DummyNet from problog.logic import Term, Var from deepproblog.engines import ExactEngine, ApproximateEngine from deepproblog.heuristics import geometric_mean from deepproblog.model import Model from deepproblog.query import Query from deepproblog.network imp...
def next_lucky(n): if len(n) == 0: return '' if int(n[0]) < 3: return '3'*len(n) elif int(n[0]) == 3: pos1 = int(n[0]+next_lucky(n[1:])) pos2 = int('5'+'3'*(len(n)-1)) if pos1 > pos2: pos1,pos2 = pos2,pos1 if pos1 > int(n): return str(pos1) ...
f = open("Writelist.txt", "r") data = f.read(6) print(data) f.close()
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayEcoMycarViolationCityPushModel(object): def __init__(self): self._city_code = None self._push_type = None self._service_status = None @property def city_cod...
import random import boto3 import botocore # A list of user agents that won't trigger GuardDuty safe_user_agents = [ 'Boto3/1.7.48 Python/3.7.0 Windows/10 Botocore/1.10.48', 'aws-sdk-go/1.4.22 (go1.7.4; linux; amd64)', 'aws-cli/1.15.10 Python/2.7.9 Windows/8 botocore/1.10.10' ] # Grab the current user a...
""" @brief Event Template class Instances of this class describe a specific event type. For example: AF_ASSERT_0 or cmdSeq_CS_CmdStarted @date Created July 2, 2018 @author R. Joseph Paetz @bug No known bugs """ from fprime.common.models.serialize import type_base from fprime.common.models.serialize.type_exceptions ...
import os import warnings from functools import wraps from ddtrace.vendor import debtcollector class RemovedInDDTrace10Warning(DeprecationWarning): pass def format_message(name, message, version): """Message formatter to create `DeprecationWarning` messages such as: 'fn' is deprecated and will...
import codecs import json import os import numpy as np from nlplingo.nn.sequence_model import SequenceXLMRBase, SequenceXLMRCustom from nlplingo.nn.spanpair_model import SpanPairModelEmbedded from nlplingo.tasks.entitycoref.feature import EntityCorefFeatureGenerator from nlplingo.tasks.entitycoref.generator import Ent...
from .base_backbone import BaseBackboneWraper
"""Tests for the Bond fan device.""" from datetime import timedelta from typing import Optional from bond_api import Action, DeviceType, Direction from homeassistant import core from homeassistant.components import fan from homeassistant.components.fan import ( ATTR_DIRECTION, ATTR_SPEED_LIST, DIRECTION_F...
import numpy as np import matplotlib.pyplot as plt from one_a import one_a from one_b import one_b from one_c import one_c from one_d import one_d from one_e import one_e def random_generator(seed, m=2 ** 64 - 1, a=2349543, c=913842, a1=21, a2=35, a3=4, a4=4294957665): """ Generates psuedorandom numbers w...
XX XXX
import sys from numpy import * narg = len(sys.argv) if narg != 2: print "usage: %s <file>" % sys.argv[0] exit(1) fpath = sys.argv[1] f = open(fpath) X = f.readlines() f.close() N = len(X) # the number of test segments for each subject T = [ 502, 1000, 907, 990, 191, 195, 150 ] assert( N == sum(T)+1 ) # cums...
# This challenge just wants us to determine if a string contains a # given subsequence. We do this by iterating through the string and # test whether the characters from the subsequence appear one by one. for case in range(int(input())): s = input() i = 0 for c in s: if i < 10 and c == 'hackerrank'[i]: ...
import glob import yaml import json def to_json(path): # print(f"path: {path}") stem = path.rsplit(".", 1)[0] data = yaml.load(open(path, "r", encoding="UTF-8"), Loader=yaml.FullLoader) print(f"stem: {stem}.json") json.dump(data, open(f"{stem}.json", "w", encoding="utf-8"), ensure_ascii=False, ind...
import numpy as np # from https://github.com/songrotek/DDPG/blob/master/ou_noise.py class OUNoise: def __init__(self, action_dimension, scale=0.1, mu=0, theta=0.15, sigma=1):#sigma=0.2 self.action_dimension = action_dimension self.scale = scale self.mu = mu self.theta = theta ...
# -*- coding: utf-8 -*- """dash.cli.__main__: executed when bootstrap directory is called as script.""" from .cli import main main()
import _plotly_utils.basevalidators class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="alignsrc", parent_name="heatmapgl.hoverlabel", **kwargs ): super(AlignsrcValidator, self).__init__( plotly_name=plotly_name, parent_n...
from django.conf.urls import include, url from . import views from django.contrib.auth import views as auth_views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^home/$', views.home, name='home'), url(r'^stream/(?P<user_id>[0-9]+)/$', views.stream, name='stream'), url(r'^post/$', views.p...
# 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 class Color(object): RED = "\033[31m" GREEN = "\033[32m" YELLOW = "\033[33m" BLUE = "\033[34m" PURPLE = "\033[35m" CYAN = "\033[36m" WHITE = "\033[37m" BOLD = "\033[1m" END = "\033[0m" @classmethod def get_colored(cls, color, text): return color + te...
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from lib.core.enums import PRIORITY __priority__ = PRIORITY.HIGHEST def dependencies(): pass def tamper(payload, **kwargs): """ Replaces greater than...
""" This example uses a finite number of workers, rather than slamming the system with endless subprocesses. This is more effective than endless context switching for an overloaded CPU. """ import asyncio from pathlib import Path import shutil import sys from typing import Iterable import os FFPLAY = shutil.which("ff...
#!/usr/bin/python # Copyright (C) 2003. Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test that the <dll-path> property is correctly set when using # <hardcode-dll-paths>true. import BoostBuild ...
import logging import os def setup(): logging.basicConfig( format="%(asctime)s %(levelname)s: %(message)s", level=logging.DEBUG )
from bs4 import BeautifulSoup import requests import ast def scrap_website(url, filter): soup = __get_html_content_as_soup(url) return __extract_data(soup, filter) def __get_html_content_as_soup(url): response = requests.get(url) return BeautifulSoup(response.text, 'lxml') def __extrac...
''' 48. Rotate Image Medium You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation. ''' class Solution: def rotate(...
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import os import sys VERSION = '3.11.0-dev.2' INSTALL_PREFIX = os.path.normpath( os.path.abspath(os.path.join(os.path.dir...
import numpy as np from program_synthesis.algolisp.tools import bleu from program_synthesis.algolisp.dataset import executor def is_same_code(example, res): correct = False if hasattr(res, 'code_sequence'): if res.code_sequence is not None: correct = res.code_sequence == example.code_sequ...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Copyright (c) 2019, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # #-------------------------------------------------------------------------------# # Configuration file for the Sp...
"""new fields in user moodel Revision ID: f1578ff17ae1 Revises: bda639e5aafd Create Date: 2021-01-11 10:01:54.417977 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'f1578ff17ae1' down_revision = 'bda639e5aafd' branch_labels = None depends_on = None def upgra...
from typing import Callable, Tuple, Union, Optional, List import torch import torch.nn.functional as F from torch import nn class Network(nn.Module): def __init__(self, input_size: int, output_size: int, hidden_layers: List[int], drop_p: float = 0.5) -> None: ''' Builds a feedforward network with arbitrar...
from typing import Any, Dict, List, Optional, cast from dagster import DagsterEvent, check from dagster.core.definitions import NodeDefinition, NodeHandle from dagster.core.definitions.utils import DEFAULT_OUTPUT from dagster.core.errors import DagsterInvariantViolationError from dagster.core.execution.plan.outputs im...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import User class CustomUserAdmin(UserAdmin): readonly_fields = ('email', ) admin.site.register(User, CustomUserAdmin)
#!/usr/bin/env python """ This script will query the AWS API using boto3 and provide a list (table) of all regions and availability zones. Example Usage: ./list-availability-zones.py """ from __future__ import print_function import boto3 import requests import sys from botocore.exceptions import ClientError f...
# Copyright 1999-2021 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...
# Copyright (C) 2015-2016 The bitcoin-blockchain-parser developers # # This file is part of bitcoin-blockchain-parser. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of bitcoin-blockchain-parser, including this file, may be copied, # modif...
# # Copyright 2019 Xilinx Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
from typing import Dict from alnlp.modules.feedforward import FeedForward from alnlp.modules.time_distributed import TimeDistributed from .highway_variational_lstm import * import torch from alnlp.modules import util from ...parsers.biaffine.biaffine import Biaffine def initializer_1d(input_tensor, initializer): ...
# Generated by Django 3.2.9 on 2021-11-25 03:34 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('copy...
# 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: v1.18.20 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re #...
# # Copyright 2020 XEBIALABS # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, subli...
#!/usr/bin/python3 import os import argparse import shutil import subprocess import yaml import sys import pprint #import oyaml as yaml from collections import OrderedDict import glob import numpy as np import datetime import time ts = time.time() class UnsortableList(list): def sort(self, *args, **kwargs): ...
# -*- 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...
a<caret>
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.FileItem import FileItem from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.KoubeiMarketingCampaignOpenDeliveryDeleteModel import KoubeiMarketingCampaignOpenDeliveryDeleteModel class KoubeiMarketingCampaignOp...
""" Utilities for vectorization. **The contents of this module are intended only for internal Deephaven use and may change at any time.** """ import ast import traceback from collections import OrderedDict import collections from io import UnsupportedOperation import numba as nb import numba.types import numba.typin...
# uwsgi --queue 10 --queue-store test.queue --master --module tests.queue --socket :3031 import uwsgi import os from flask import Flask,render_template,request,redirect,flash app = Flask(__name__) app.debug = True app.secret_key = os.urandom(24) @app.route('/') def index(): return render_template('queue.html', ...
#!/usr/bin/env python # This file is part of PASTA and is forked from SATe # PASTA like SATe is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
# Copyright 2016 Splunk, Inc. # SPDX-FileCopyrightText: 2020 2020 # # SPDX-License-Identifier: Apache-2.0 """ Splunk platform related utilities. """ import os import os.path as op import subprocess import socket try: from ConfigParser import ConfigParser CONF_PARSER_KWARGS = {} except ImportError: from ...
""" Helper functions for uploading image to Flickr """ import flickr_api from django.conf import settings from django.core.files.storage import FileSystemStorage def handle_uploaded_file(uploaded_file, duck_id, duck_name, comments): """ Upload duck location image to flickr """ title = 'Duck #' + str(duck_id) +...
import os from datetime import datetime from urllib.parse import urlparse from flask import Flask from flask_github import GitHub from markdown2 import markdown as from_markdown from markupsafe import Markup from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker app = Flask(__name__) app.config....
''' Most of the driver API is unsupported in the simulator, but some stubs are provided to allow tests to import correctly. ''' def device_memset(dst, val, size, stream=0): dst.view('u1')[:size].fill(bytes([val])[0]) def host_to_device(dst, src, size, stream=0): dst.view('u1')[:size] = src.view('u1')[:size]...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('testreport', '0030_launch_duration'), ...