text
stringlengths
1
927k
import colander from yaml import load from pkg_resources import iter_entry_points from pkg_resources import load_entry_point from wiseguy.schema import NoSchema from wiseguy import WSGIComponent class EPParser(object): EP_GROUP = 'wiseguy.component' PASTE_EP_GROUPS = ('paste.filter_app_factory', 'paste.app_...
from .dice import Dice def setup(bot): bot.add_cog(Dice(bot))
""" eZmax API Definition This API expose all the functionnalities for the eZmax and eZsign applications. # noqa: E501 The version of the OpenAPI document: 1.1.3 Contact: support-api@ezmax.ca Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from ...
from __future__ import (absolute_import, print_function, unicode_literals, division) from .context import gragrapy as gg from gragrapy.__main__ import parse_kwargs def test_parse_kwargs(): assert parse_kwargs([]) == {} assert parse_kwargs(['a=b', 'c=d']) == {'a': 'b', 'c': 'd'} ass...
# -*- coding: utf-8 -*- """ werkzeug.testsuite.datastructures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the functionality of the provided Werkzeug datastructures. TODO: - FileMultiDict - Immutable types undertested - Split up dict tests :copyright: (c) 2014 by Armin Ronacher....
#!/usr/bin/env python # # Copyright 2007 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2019 Palo Alto Networks, 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 # #...
import fileinput report_numbers = [line.strip() for line in fileinput.input()] gamma = "" epsilon = "" for i in range(len(report_numbers[0])): zeros = 0 ones = 0 for entry in report_numbers: if entry[i] == "0": zeros += 1 else: ones += 1 else: if zeros >...
# 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...
from pip._vendor.packaging.specifiers import SpecifierSet from pip._vendor.resolvelib.providers import AbstractProvider from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import Any, Dict, Optional, Sequence, Set, Tuple, Union from pip._internal.req.req_install impor...
"""Tests for the enum overlay.""" from pytype import file_utils from pytype.tests import test_base class EnumOverlayTest(test_base.BaseTest): """Tests the overlay.""" def test_can_import_module_members(self): self.Check(""" import enum enum.Enum enum.IntEnum enum.IntFlag enum.F...
''' Models for bitcoin core. Copyright 2018-2022 DeNova Last modified: 2022-01-10 ''' from django.core.validators import MaxValueValidator from django.db import models from django.utils.translation import gettext_lazy as _ MAX_LENGTH = 1000 # default max length class HourField(models.PositiveSmallInte...
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved. import os import io import ntpath import hashlib import fnmatch import shlex import speakeasy.winenv.defs.windows.windows as windefs import speakeasy.winenv.arch as _arch from speakeasy.errors import FileSystemEmuError def normalize_response_path(path): def...
import pprint import numpy as np import copy import operator from cloud_mocks import * pp = pprint.PrettyPrinter(indent=2) class BaseStrategy(object): def execute(self, cluster, goal): raise NotImplementedError() def Migration(vm, source, dest): return { 'vm': vm.name, 'source': so...
# Generated by Django 2.2.9 on 2020-04-07 14:47 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('application', '0009_auto_20200407_1208'), ] operations = [ migrations.RemoveField( model_name='collections', name='subtitles...
#! /usr/bin/env python from __future__ import print_function import sys import json import requests import struct import argparse def load_all_packages(elm_version, url=None): if url is None: url = "http://package.elm-lang.org/all-packages?elm-package-version=" payload = requests.get("{url}{elm_versi...
import logging from pathlib import Path import sys import tempfile from typing import Optional import pytest from unittest.mock import patch import ray from ray.dashboard.modules.job.common import CURRENT_VERSION, JobStatus from ray.dashboard.modules.job.sdk import ( ClusterInfo, JobSubmissionClient, pars...
.table char str_nil[] = "nil" char str_0[] = "digite o valor de \033[33m'a'\033[0m: " char str_1[] = "it works!" char str_2[] = "suspicious" char str_3[] = "no else" char str_4[] = "teenage" char str_5[] = "only when a = " char str_6[] = "nested ifs" char str_7[] = "a = " .code cast: seq $0, #1, 1 brnz cast_F2I, $0 c...
# 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. #------------------------------------------------------------------------ ...
# coding: utf-8 """ Python SDK for Opsgenie REST API Python SDK for Opsgenie REST API # noqa: E501 The version of the OpenAPI document: 2.0.0 Contact: support@opsgenie.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class AddDetailsToAle...
from komparse import Parser, Grammar, Sequence, OneOf, \ Optional, OneOrMore, Many class _Grammar(Grammar): def __init__(self): Grammar.__init__(self, case_sensitive=True) self._init_tokens() self._init_rules() def _init_tokens(self): self.add_comment(';', '\n') ...
from ..peer import Peer class QuickButtonSelected: def __init__(self, json_object): self.update_id = json_object.get("updateId") self.dialog = Peer(json_object.get("dialog")) self.sender = Peer(json_object.get("sender")) self.metadata = json_object.get("metadata") @property ...
from os.path import isfile from ._print_and_run_command import _print_and_run_command def check_bam_using_samtools_flagstat(bam_file_path, n_job=1, overwrite=False): flagstat_file_path = "{}.flagstat".format(bam_file_path) if not overwrite and isfile(flagstat_file_path): raise FileExistsError(flag...
from rest_framework.generics import GenericAPIView from drf_spectacular.types import OpenApiTypes from crum import get_current_user from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404 from django.utils import timezone from django.core.exceptions import ValidationError from djang...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import string import pytest import sqlalchemy as sa from h._compat import text_type from h.util.query import column_windows meta = sa.MetaData() test_cw = sa.Table( 'test_column_windows', meta, sa.Column('id', sa.Integer, autoincrement=...
def drw_grid(subplot, projection, lw=1, dlon=30, dlat=30): ax=plt.subplot(subplot, projection=projection) z = numpy.linspace(0,1,128) lon0 = -int(180/dlon)*dlon # Grid lines for lon in range(lon0, 181, dlon): ax.plot(lon+0*z,-89+178*z,'k--',transform=cartopy.crs.PlateCarree(),linewidth=lw) ...
base = 'path/to/folder/train_with_your_data' #please do not put / at the end lib = "/path/to/the/pyNMR" #please do not put / at the end
# # Depends # Copyright (C) 2014 by Andrew Gardner & Jonas Unger. All rights reserved. # BSD license (LICENSE.txt for details). # from PySide import QtCore, QtGui import depends_node import depends_data_packet """ A QT graphics widget that displays the state of a given scenegraph. The user can also mouseover a gi...
from flask import Flask, render_template from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.security import Security, SQLAlchemyUserDatastore, \ UserMixin, RoleMixin, login_required # Create app app = Flask(__name__) app.config['DEBUG'] = True app.config['SECRET_KEY'] = 'super-secret' app.config['SQLALCHEM...
from math import ceil, floor from collections import Counter def mean(numLS): """ Finds the sum of a list of numbers and divided by the length of the list leaving the mean. """ return sum(numLS) / float(len(numLS)) def median(numLS): """ The middle value of a set of ordered data. """ ...
#!/usr/bin/env python """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 = [ ] setup_requirements = ['pytest-runner', ] test_requiremen...
from wurst.searching import * from wurst.errors import MultipleResults, NoResults import pytest def test_contains(): func = contains("n", "foo") assert func({"n": "foobar"}) assert not func({"n": "bar"}) def test_equals(): func = equals("n", "foo") assert func({"n": "foo"}) assert not func({...
import sys def whoami(depth=1): return f"{sys._getframe(depth).f_code.co_name}()"
import sys import os.path import numpy as np import pykitml as pk from pykitml.datasets import mnist from pykitml.testing import pktest_graph, pktest_nograph def test_download(): # Download the mnist data set mnist.get() # Test ran successfully assert True @pktest_graph def test_adagrad(): # Load...
#!/usr/bin/env python3.7 import logging from obfuscapk import obfuscator_category from obfuscapk.obfuscation import Obfuscation class NewSignature(obfuscator_category.ITrivialObfuscator): def __init__(self): self.logger = logging.getLogger('{0}.{1}'.format(__name__, self.__class__.__name__)) su...
import warnings import numpy as np from .. import coding, conventions from ..core import indexing from ..core.pycompat import integer_types from ..core.utils import FrozenDict, HiddenKeyDict from ..core.variable import Variable from .common import AbstractWritableDataStore, BackendArray, _encode_variable_name # need...
# -*- coding: utf-8 -*- """ Created on Wed Jul 29 17:52:00 2020 @author: hp """ import cv2 import numpy as np def get_face_detector(modelFile = "models/res10_300x300_ssd_iter_140000.caffemodel", configFile = "models/deploy.prototxt"): """ Get the face detection caffe model of OpenCV's D...
# Imports library """ from chatterbot import ChatBot """ import pyttsx3 from gtts import gTTS from playsound import playsound import sys import speech_recognition as sr from images.face import reconhecimento_facial class Main(): def __init__(self): self.response = "" self.speech = "" sel...
from rest_framework import serializers from django.core.validators import URLValidator from django.core.exceptions import ValidationError from .models import User from .models import ShortenedUrl class RegisterSerializer(serializers.ModelSerializer): class Meta: model = User fields = ("id", "emai...
import os import time from typing import Dict from cereal import car from common.kalman.simple_kalman import KF1D from common.realtime import DT_CTRL from selfdrive.car import gen_empty_fingerprint from selfdrive.config import Conversions as CV from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX from selfdri...
from .config import _OptimizerConfig, AdamConfig, LambConfig, SGDConfig from .lr_scheduler import ( _LRScheduler, ConstantWarmupLRScheduler, CosineWarmupLRScheduler, LinearWarmupLRScheduler, PolyWarmupLRScheduler, ) from .fused_adam import FusedAdam, AdamWMode from .fp16_optimizer import FP16_Optim...
# Copyright 2021 MIT Probabilistic Computing Project # Apache License, Version 2.0, refer to LICENSE.txt import ast from . import hirm def intify(x): if x.isnumeric(): assert int(x) == float(x) return int(x) return x def load_schema(path): """Load a schema from path.""" signatures = ...
# 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, s...
import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg import glob def abs_sobel_threshold(img, orientation='x', kernel_size=3, threshold=(0, 255)): """ `orientation` Input for setting the sobel operator gradient orientation (x, y) `kernel_size` Input for kernel size...
# Kapatma butonu eklenebilir # dekoratif butonlara işlevsiz butonlara basıldığında basılan buton da dahil diğer butonların renginin random olarak değişmesi # özelliği eklenebilir. (bence sol alta) # değişik olur # qss dosyaların dışarı dan çekilmesi # kullanıcı parola ve kullanıcı adı kontrolü eklenebilir vs. i...
# # Copyright 2019 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...
from ctypes import * from collections import deque import abc import platform import os import sys import struct arch = 8 * struct.calcsize("P") pf = platform.platform() c_int_p = POINTER(c_int) c_uint_p = POINTER(c_uint) c_short_p = POINTER(c_short) c_ushort_p = POINTER(c_ushort) def load_libpcap(): ...
from django.db import models class Estacionamiento(models.Model): nombre_duenio = models.CharField(max_length=30) nombre_est = models.CharField(max_length=30,unique=True) direccion = models.CharField(max_length=30) telefono1 = models.IntegerField(max_length=11) telefono2 = models.IntegerField(max_l...
from suerpsql import Query, Schema, String class Department(Schema): __tablename__ = 'deaprtments' name = String(25) query = Query( vendor="postgres", host="localhost:5432", port=5432, user="postgres", password="postgres:user:password" ) expected_sql = """ CREATE FUNCTION get_department...
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
from http.server import HTTPServer as BaseHTTPServer, SimpleHTTPRequestHandler server_address = ("", 8000) external_mesh_dir = '/Users/jmw110/data/bunny' external_resource_prefix = '/mesh' class MyRequestHandler(SimpleHTTPRequestHandler): def translate_path(self, path): if self.path.startswith(external_re...
"""Landlab component that simulates overland flow. This component simulates overland flow using the 2-D numerical model of shallow-water flow over topography using the de Almeida et al., 2012 algorithm for storage-cell inundation modeling. .. codeauthor:: Jordan Adams Examples -------- >>> import numpy as np >>> fro...
# Copyright 2013 - Red Hat, 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 writi...
# -*- coding=utf-8 -*- import urllib2 import socket import time urls = "https://sherman.fe.liulishuo.com/dubbing?shareId=1597934420:4a40e7e1bed498ed" print "\nAccess web page start..." brushNum = 360000 for i in range(brushNum): url = urls socket.setdefaulttimeout req_header = {'User-Agent':'Mozilla/5.0 (Windo...
# # This file is part of LiteX. # # This file is Copyright (c) 2013-2014 Sebastien Bourdeauducq <sb@m-labs.hk> # This file is Copyright (c) 2014-2019 Florent Kermarrec <florent@enjoy-digital.fr> # This file is Copyright (c) 2018 Dolu1990 <charles.papon.90@gmail.com> # This file is Copyright (c) 2019 Gabriel L. Somlo <g...
# Generated by Django 3.1.3 on 2020-12-11 12:30 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tasks', '0019_auto_20201211_1229'), ] operations = [ migrations.AlterField( model_name='task', name='estimate_time',...
import asyncio class Right(asyncio.Protocol): SEP = b'\n' def __init__(self, logger, loop, left): self.logger = logger self.loop = loop self.left = left self.buffer = bytes() self.transport = None self.w_q = asyncio.Queue() self.peername = (None, None)...
import json import traceback from mitreattack.navlayers.core.exceptions import UninitializedLayer, BadType, BadInput, handler from mitreattack.navlayers.core.layerobj import _LayerObj class Layer: def __init__(self, init_data={}, name=None, domain=None, strict=True): """ Initialization - cre...
"""Plugin for adding external error handlers """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def init(api): """initialize the error_handlers plugin. @api.errorhandler(<MyError>) def _my_error(err): ...
import asyncio from mitmproxy.test.taddons import RecordingMaster async def err(): raise RuntimeError async def test_exception_handler(): m = RecordingMaster(None) running = asyncio.create_task(m.run()) asyncio.create_task(err()) await m.await_log("Traceback", level="error") m.shutdown() ...
""" Project Euler - Problem Solution 016 Copyright (c) Justin McGettigan. All rights reserved. https://github.com/jwmcgettigan/project-euler-solutions """ def sum_digits(n): s = 0 while n: s, n = s + n % 10, n // 10 return s def power_digit_sum(power): return sum_digits(2**power) if __name__ == "__main__...
#!/usr/bin/env python # # Bitbang'd SPI interface with an MCP3008 ADC device # MCP3008 is 8-channel 10-bit analog to digital converter # Connections are: # CLK => SCLK # DOUT => MISO # DIN => MOSI # CS => CE0 import time import sys import spidev spi = spidev.SpiDev() spi.open(0,0) def buildReadCo...
#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
import asyncio import inspect import re import traceback import typing from enum import Enum from starlette.concurrency import run_in_threadpool from starlette.convertors import CONVERTOR_TYPES, Convertor from starlette.datastructures import URL, Headers, URLPath from starlette.exceptions import HTTPException from sta...
# -*- coding: utf-8 -*- """ @author: Thorsten """ import numpy as np from numba import jit import os import sys nb_dir = os.path.split(os.getcwd())[0] if nb_dir not in sys.path: sys.path.append(nb_dir) from lib import bresenham @jit def addMeasurement(grid, x, y, pos_sensor, offset, resolution, l_occupied, l_fr...
#!/usr/bin/env python # CREATED:2013-03-11 18:14:30 by Brian McFee <brm2132@columbia.edu> # unit tests for librosa.onset from __future__ import print_function import pytest from contextlib2 import nullcontext as dnr # Disable cache import os try: os.environ.pop("LIBROSA_CACHE_DIR") except: pass import war...
import sys from docx import Document from docx2pdf import convert from configuration import Configuration import shutil from pathlib import Path USAGE = "Usage: python3 create-cover-letter.py <FILENAME>" CONFIG_FILE = "config.json" # Ensure the filename argument is passed or print help message if len(sys.argv) != 2 o...
"""empty message Revision ID: c552235f6967 Revises: ef3c58af741e Create Date: 2022-03-21 14:53:58.715602 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "c552235f6967" down_revision = "ef3c58af741e" branch_labels = None depends_on = None def upgrade(): # ...
"""A module for the DoFileCollection class.""" from typing import List from .do_file import DoFile from .settings import SettingsManager from ..dataset import DatasetCollection class DoFileCollection: """A class to represent do files coming from the same ODK file. The DoFileCollection class corresponds to t...
#!C:\Python27\ArcGIS10.4\python.exe # -*- coding: utf-8 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # Angelos Tzotsos <tzotsos@gmail.com> # # Copyright (c) 2015 Tom Kralidis # # Permission is hereby granted, free of charge, to any pe...
sandbox.foo.i = 5 assert sandbox.foo.i == 5 foo = trick.Foo() trick.stop(10)
import tensorflow as tf import cnn_indices data = cnn_indices.read_data_sets() import final_index import numpy as np saver = tf.train.import_meta_graph('/home/asdf/Documents/juyan/paper/salinas/cnn/model/NEW/' 'CNN0507.ckpt.meta') batch_size = data.valid._num_examples with tf.Session...
import re import pandas as pd from ....core import flatten from ....utils import natural_sort_key class Engine: """ The API necessary to provide a new Parquet reader/writer """ @classmethod def read_metadata( cls, fs, paths, categories=None, index=None, g...
from datetime import datetime from itertools import zip_longest from pathlib import Path from random import Random import lorem from django.conf import settings from django.contrib.auth.hashers import make_password from django.core.management.base import BaseCommand from django.core.management.base import CommandError...
# -*- coding: utf-8 -*- import functions #import download_function #Listener def listener(messages): for m in messages: cid = m.chat.id if m.content_type == 'text': print ("[" + str(cid) + "]: " + m.text) functions.bot.set_update_listener(listener) ####################################...
import logging from common.my_collections import CircularList class Game: def __init__(self, initial, additional_cups=0): self.cups = CircularList() self.nodes = [None] * (len(initial) + additional_cups + 1) for init in initial: node = self.cups.append(init) self.n...
#!/usr/bin/env python3 # Copyright 2012-2017 The Meson development team # 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 -*- """ Created on Thu Sep 13 00:33:14 2019 @author: Amanda Development of a Machine Vision Based Yield Monitor for Shallot Onions and Carrot crops Precision Agriculture and Sensor Systems (PASS) Research Group McGill University, Department of Bioresource Engineering RUN.py --- This is a yield mo...
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html # For details: https://github.com/PyCQA/astroid/blob/main/LICENSE # Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt """Transform utilities (filters and decorator)""" import typing import wrapt from astroi...
import matplotlib.pyplot as plt import matplotlib.dates as mdates from datetime import datetime as dt import pandas as pd import numpy as np # Load the csv df1 = pd.read_csv('data/aggregate-daily-values.csv') df2 = pd.read_csv('data/aggregate-daily-values-covid-19.csv') df3 = pd.read_csv('data/aggregate-daily-values-...
# # Copyright (c) 2015-2016 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from nfv_common import debug from nfv_common import tasks from nfv_vim.nfvi._nfvi_plugin import NFVIPlugin DLOG = debug.debug_get_logger('nfv_vim.nfvi.nfvi_identity_plugin') class NFVIIdentityPlugin(NFVIPlugin): """ ...
import abc from typing import Callable from typing import Iterator from typing import List from typing import Optional from xsdata.codegen.models import Class from xsdata.models.config import GeneratorConfig from xsdata.utils.constants import return_true class ContainerInterface(metaclass=abc.ABCMeta): """Wrap a...
#This file is part of ElectricEye. #SPDX-License-Identifier: Apache-2.0 #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 un...
print("sa")
r""" Hopf algebras with basis """ # **************************************************************************** # Copyright (C) 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr> # Copyright (C) 2008-2011 Nicolas M. Thiery <nthiery at users.sf.net> # # Distributed under the terms of the GNU General Publi...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Thu Dec 13 17:56:06 2018 by generateDS.py version 2.29.5. # Python 3.6.5 (default, May 19 2018, 11:27:13) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] # # Command line options: # ('-o', '../python/PTSPodRequest.xsd.py') # # Command line argum...
from . import config from . import mame from . import util from . import exy
# This test suite covers the functionality of mirror feature in SwSS import distro import pytest import time from swsscommon import swsscommon from distutils.version import StrictVersion class TestMirror(object): def setup_db(self, dvs): self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0) sel...
# -*- coding: utf-8 -*- """ Created on Thu Mar 3 00:20:07 2022 @author: sachi """ # Bubble sort in Python def bubbleSort(array): for i in range(len(array)): for j in range(0, len(array) - i - 1): if array[j] > array[j + 1]: temp = array[j] array[j] = array[j...
from typing import Optional, Iterable import numpy as np import pytest from jina import Document, DocumentArray from jina.drivers.search import KVSearchDriver from jina.executors.indexers import BaseKVIndexer from jina.types.ndarray.generic import NdArray class MockIndexer(BaseKVIndexer): def add( self,...
import json import os from website.settings import parent_dir HERE = os.path.dirname(os.path.abspath(__file__)) STATIC_PATH = os.path.join(parent_dir(HERE), 'static') MAX_RENDER_SIZE = (1024 ** 2) * 3 ALLOWED_ORIGIN = '*' BUCKET_LOCATIONS = {} ENCRYPT_UPLOADS_DEFAULT = True # Load S3 settings used in both front a...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import gzip from abc import ABCMeta from abc import abstractmethod class TextTransformer(object): __metaclass__ = ABCMeta def __init__(self, dictionary_file=None): if dictionary_f...
# -*- coding: utf-8 -*- from __future__ import print_function import os import re import sys import yaml import traceback from twccli.twcc.session import Session2 from twccli.twcc.util import isNone, isDebug, timezone2local, send_ga from twccli.twcc.clidriver import ServiceOperation from twccli.twccli import logger # ...
import logging, uvicorn from dotenv import find_dotenv, load_dotenv # # Load environment variables from the '.env' file # Make sure you have your credentials there for local development. # (On Azure, those env vars will be already be set via Application Settings, and we don't override them here) # load_dotenv(find_do...
import gdown url = 'https://drive.google.com/uc?id=1s52ek_4YTDRt_EOkx1FS53u-vJa0c4nu' output = 'basnet.pth' gdown.download(url, output, quiet=False) gdown.cached_download(url, output, postprocess=gdown.extractall) url = 'https://drive.google.com/uc?id=1rbSTGKAE-MTxBYHd-51l2hMOQPT_7EPy' output = 'u2netp.pth' gdown.dow...
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
pkgname = "libXrandr"
import datetime import decimal from platform import python_version import re import uuid try: from bson import decimal128, Regex _HAVE_PYMONGO = True except ImportError: _HAVE_PYMONGO = False class _NO_VALUE(object): pass # we don't use NOTHING because it might be returned from various APIs NO_VALU...
# coding: utf-8 # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019-Present Datadog, Inc. import re # noqa: F401 import sys # noqa: F401 import nulltype # ...
# -*- coding: utf-8 -*- # pylint: disable=invalid-name,too-many-instance-attributes, too-many-arguments """ Copyright 2019 Paul A Beltyukov Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rl...