text
stringlengths
1
927k
#!/usr/bin/env python3 import sys import argparse from requests import get from transip_rest_client import TransipRestClient def getOptions(args=sys.argv[1:]): parser = argparse.ArgumentParser(description="DynDNS: Updates a DNS record for a dynamic IP address.") parser.add_argument("-u", "--user", help="Your ...
import unittest from tempfile import mkdtemp from shutil import rmtree class WidgetTestCase(unittest.TestCase): def setUp(self): from kivy.uix.widget import Widget self.cls = Widget self.root = Widget() def test_add_remove_widget(self): root = self.root self.assertEqu...
import time import sys import random import datetime import rq import rq.job import rq.compat import rq.worker from rq.defaults import (DEFAULT_LOGGING_FORMAT, DEFAULT_LOGGING_DATE_FORMAT) class NonForkWorker(rq.Worker): def __init__(self, *args, **kwargs): if kwargs.get('default_worker_ttl', None) is N...
# -*- coding: utf-8 -*- ############################################################################ # # Copyright © 2011, 2012, 2013, 2014, 2015 OnlineGroups.net and # Contributors. # # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the Z...
"""\ C++ code generator @copyright: 2002-2007 Alberto Griggio @copyright: 2012-2016 Carsten Grohmann @copyright: 2017-2020 Dietmar Schwertberger @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """ import os.path, re, logging from codegen import BaseLangCodeWriter, BaseSourceFileContent, _repla...
import sys import os from io import StringIO from datetime import datetime import unittest from unittest.mock import patch sys.path.append(os.path.abspath("./src/")) from calendarApp.models import Event, Calendar class CalendarModelTests(unittest.TestCase): @classmethod def setUpClass(cls): cls.data1...
"""Visual Studio Helper Utils.""" #=============================================================================== # Imports #=============================================================================== import uuid #=============================================================================== # Globals #=========...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() with open("requirements.txt") as f: required = f.read().splitlines() setuptools.setup( name="pymeritrade", version="0.1.4", author="Shrivu Shankar", author_email="shrivu1122+pymeritrade@gmail.com", descri...
import threading import socket import sys import getopt from log import logger from Codecs.AdcpCodec import AdcpCodec from Comm.AdcpSerialPortServer import AdcpSerialPortServer class DecodeSerialData: def __init__(self, tcp_port, comm_port, baud): """ Initialize the thread to read the data from ...
r"""Setup fixtures for testing :py:class:`lmp.model.LSTMModel`.""" import pytest import torch from lmp.model import LSTMModel from lmp.tknzr import BaseTknzr @pytest.fixture def lstm_model( tknzr: BaseTknzr, d_emb: int, d_hid: int, n_hid_lyr: int, n_pre_hid_lyr: int, ...
"""add cityname indexes for filtering Revision ID: b4eea63fd165 Revises: 850af1d21f5e Create Date: 2022-05-05 17:39:57.826059 """ import os from alembic import op here = os.path.dirname(os.path.realpath(__file__)) # revision identifiers, used by Alembic. revision = "b4eea63fd165" down_revision = "850af1d21f5e" bra...
# # Generated with ExtremeValueBlueprint from dmt.blueprint import Blueprint from dmt.dimension import Dimension from dmt.attribute import Attribute from dmt.enum_attribute import EnumAttribute from dmt.blueprint_attribute import BlueprintAttribute from sima.sima.blueprints.moao import MOAOBlueprint class ExtremeValu...
import os import argparse import numpy as np import matplotlib.pyplot as plt def get_args(): # create argument parser parser = argparse.ArgumentParser() # parameter for problem parser.add_argument('--seed', type=int, default=1) parser.add_argument('--benchmark_id', type=int, default=0) parser.a...
#!/usr/bin/env python3 """Main function for the DOVPN project.""" import argparse import logging import os import yaml import vpnorchestrator def main(): """Main function that sets up script to run. Handles arguments, logging, and configuration before passing of control to the orchestrator object.""" ...
from argparse import Namespace import csv from logging import Logger import os from pprint import pformat from typing import List import numpy as np from tensorboardX import SummaryWriter import torch from tqdm import trange import pickle from torch.optim.lr_scheduler import ExponentialLR from .evaluate import evalua...
from functools import partial import numpy as np from skimage import img_as_float, img_as_uint from skimage import color, data, filters from skimage.color.adapt_rgb import adapt_rgb, each_channel, hsv_value # Down-sample image for quicker testing. COLOR_IMAGE = data.astronaut()[::5, ::6] GRAY_IMAGE = data.camera()[:...
""" Pooling-based Vision Transformer (PiT) in PyTorch A PyTorch implement of Pooling-based Vision Transformers as described in 'Rethinking Spatial Dimensions of Vision Transformers' - https://arxiv.org/abs/2103.16302 This code was adapted from the original version at https://github.com/naver-ai/pit, original copyrigh...
from cloudshell.shell.core.driver_context import ResourceCommandContext, AutoLoadDetails, AutoLoadAttribute, \ AutoLoadResource from collections import defaultdict class LegacyUtils(object): def __init__(self): self._datamodel_clss_dict = self.__generate_datamodel_classes_dict() def migrate_autol...
''' This code is based on pytorch_ssd and RFBNet. Details about the modules: TUM - Thinned U-shaped Module MLFPN - Multi-Level Feature Pyramid Network M2Det - Multi-level Multi-scale single-shot object Detector Author: Qijie Zhao (zhaoqijie@pku.edu.cn) Finished Date: 01/1...
from .orm import metadata, start_mappers
from scipy.io.wavfile import read import numpy as np import io import csv class TensorFlowPredictor: def __init__(self, tensorflow_client, config): self.client = tensorflow_client self.class_names = self.class_names_from_csv("class_names.csv") def class_names_from_csv(self, csv_file): ...
#!/usr/bin/env python # ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. # ## # Title: run.py # # Notes: # # Universal script to setup and run the xunit console runner. The script relies # on run.proj and the bash and ...
# -*- coding: utf-8 -*- """ sphinx.websupport ~~~~~~~~~~~~~~~~~ Base Module for web support functions. :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import warnings from sphinx.deprecation import RemovedInSphinx20Warning try: fr...
#!/usr/bin/env python from __future__ import print_function import roslib roslib.load_manifest('faa_computer_admin') import rospy import argparse import subprocess from faa_utilities import FindData from faa_data_processing import TrackingDataProcessor from faa_data_processing import VideoDataProcessor from faa_data_p...
from .init import init from .draw_timeseries_graph import draw_timeseries_graph from .draw_pie_charts import draw_pie_chart from .draw_top_list import draw_top_list __all__ = ["init", "draw_timeseries_graph", "draw_pie_chart", "draw_top_list"]
# -*- coding: utf-8 -*- """read_csv Read the different csv files Created on Mon Oct 11 21:30:00 2021 @author: Dan Kotlyar Last updated on Mon Oct 11 21:45:00 2021 @author: Dan Kotlyar """ import numpy as np import pandas as pd def ReadCsv(csvFile): data = pd.read_csv('bootstrap.csv') ID = np.array(data['...
__all__ = [ 'DesignerLinkLabel', 'RecentItem', 'RecentFilesBox' 'DesignerStartPage'] from utils.utils import get_designer, get_fs_encoding from kivy.properties import ObjectProperty, StringProperty from kivy.uix.scrollview import ScrollView from kivy.uix.boxlayout import BoxLayout from kivy.lang.builder impor...
from tethys_sdk.testing import TethysTestCase from tethys_compute.models.dask.dask_scheduler import Scheduler, DaskScheduler from tethys_compute.models.dask.dask_job import DaskJob from django.contrib.auth.models import User import dask from unittest import mock import time @dask.delayed def inc(x): return x + 1 ...
# 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 test.dungeons.TestDungeon import TestDungeon class TestSkullWoods(TestDungeon): def testSkullWoodsFrontAllEntrances(self): self.starting_regions = ['Skull Woods First Section', 'Skull Woods First Section (Left)', 'Skull Woods First Section (Top)'] self.run_tests([ ["Skull Woods -...
from . import db # connect class user to
# -*- coding: utf-8 -*- # Copyright 2020 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...
import asyncio from asyncio import Task from typing import Any, Callable import appdaemon.plugins.hass.hassapi as hass import appdaemon.plugins.mqtt.mqttapi as mqtt import pytest from cx_core import Controller from pytest import MonkeyPatch from tests.test_utils import fake_fn async def fake_run_in( self: Contr...
import argparse from pathlib import Path from nndet.io import load_pickle from nndet.core.boxes.ops_np import box_center_np THRESHOLD = 0.5 if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('source', type=Path) args = parser.parse_args() source = args.source pre...
import torch import numpy as np import argparse import pandas as pd import sys import os from torch import nn from torch.nn import functional as F import tqdm import pprint from src import utils as ut import torchvision from haven import haven_utils as hu from haven import haven_chk as hc from src import datasets, mod...
#!/usr/bin/python ''' Generate a command file for automated kSim experiment with out-of-dataset queries Example: ./gen_ksim_outside_exp.py 10 10 dataset.txt 0.3 experiment.txt results.txt -k 1 3 5 7 -m 7 --seed 23 -n 10 ''' from __future__ import absolute_import from __future__ import division from __future__ imp...
#!/usr/bin/env python """PMFP. 一个项目管理脚手架. """ import warnings from .entrypoint import ppm import sys from typing import List from pmfp.entrypoint import ppm from colorama import init init() def main(argv: List[str] = sys.argv[1:]) -> None: """服务启动入口. 设置覆盖顺序`环境变量>命令行参数`>`'-c'指定的配置文件`>`项目启动位置的配置文件`>默认配置. ...
import os import re import json import itertools from typing import List, Union, Any import pytest from client.client import Client from tools import utils from tools.constants import IDENTITIES from .contract_paths import ( CONTRACT_PATH, ILLTYPED_CONTRACT_PATH, all_contracts, all_legacy_contracts, ) ...
# Copyright (c) 2021 PaddlePaddle 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 appli...
import ast import importlib import os import logging import logging.config import sys from flask import Flask, Blueprint from flask_restful import Api from flask_cors import CORS from typing import Dict, Any # noqa: F401 from flasgger import Swagger from search_service.api.dashboard import SearchDashboardAPI from se...
"""SampleProject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class...
from django.contrib import admin from .. import models @admin.register(models.Problem) class ProblemeAdmin(admin.ModelAdmin): """ 문제관리 """ list_display = ['problem_name', 'limit_time', 'limit_memory', 'scoring_type', 'level', 'info', 'is_open', 'checker_code'] class Meta: model = models....
############################################################################## # Copyright by The HDF Group. # # All rights reserved. # # # # Th...
from datetime import timedelta from functools import partial import numpy as np from hyperopt import fmin, space_eval, tpe from fedot.core.data.data_split import train_test_data_setup from fedot.core.log import Log from fedot.core.pipelines.tuning.hyperparams import convert_params, get_node_params from fedot.core.pip...
""" Ops for downsampling images. Planned: Pool, DownsampleAvg, DownsampleSoftmax. """ from __future__ import absolute_import, print_function, division # This file should move along with conv.py import warnings import itertools import numpy as np from six.moves import xrange import six.moves.builtins as builtins import...
from django.test import TestCase, Client from django.contrib.auth import get_user_model from django.urls import reverse class AdminSiteTests(TestCase): def setUp(self): self.client = Client() self.admin_user = get_user_model().objects.create_superuser( email='admin@test.com', ...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange from ccxt.base.errors import ExchangeError from ccxt.base.errors import InsufficientFunds from ccxt...
""" Copyright 2016, Andrew Lin All rights reserved. This software is licensed under the BSD 3-Clause License. See LICENSE.txt at the root of the project or https://opensource.org/licenses/BSD-3-Clause """ import pytest from app.gameshow import make_gameshow @pytest.fixture def app(): """The whole gameshow app."...
from importlib import import_module try: from django.core.urlresolvers import reverse except ImportError: # Django 1.11 from django.urls import reverse from django.template.loader import render_to_string from jet.dashboard import modules from jet.dashboard.models import UserDashboardModule from django.utils.tr...
import binascii import os import subprocess import sys from migen.fhdl import * from litex.soc.interconnect.csr import * def git_root(): if sys.platform == "win32": # Git on Windows is likely to use Unix-style paths (`/c/path/to/repo`), # whereas directories passed to Python should be Windows-styl...
import os from collections import OrderedDict from copy import copy from conans.errors import ConanException from conans.util.conan_v2_mode import conan_v2_behavior DEFAULT_INCLUDE = "include" DEFAULT_LIB = "lib" DEFAULT_BIN = "bin" DEFAULT_RES = "res" DEFAULT_SHARE = "share" DEFAULT_BUILD = "" DEFAULT_FRAMEWORK = "F...
# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (BSD-3-Clause) # ####################################################################### # # Test Python API generated from references....
""" Provide help message for command line interface commands. """ PROVIDER_NAME_HELP = 'A provider of hosting for software development and version control name.' ORGANIZATION_NAME_HELP = "The provider's organization name." REPOSITORY_NAME_HELP = "The provider's repository name." BRANCH = 'A branch.' BASE_BRANCH = 'A br...
# Online Python compiler (interpreter) to run Python online. # Write Python 3 code in this online editor and run it. import numpy as np list_a = [] for i in range(2): for j in range(5): list_a.append(i) list_a = np.random.permutation(list_a) print('class labels') print(list_a) list_a = np.array(list_a) i...
import vtk from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor import math import numpy as np import numpy.matlib import os import json import cv2 # Z # / # / # / # ---------- X # | # | # | # Y class vtkRenderer(): def __init__(self, widget=None...
from distutils.core import setup from setuptools import find_packages import os # User-friendly description from README.md current_directory = os.path.dirname(os.path.abspath(__file__)) package_name = os.path.basename(current_directory) try: with open(os.path.join(current_directory, 'README.md'), encoding='utf-8')...
from datetime import datetime, timedelta from bisect import bisect_left import numpy.ma as ma from cdippy.cdippy import CDIPnc, Archive, Realtime, RealtimeXY, Historic import cdippy.timestamp_utils as tsu import cdippy.utils as cu class StnData(CDIPnc): """ Returns data and metadata for the specified s...
""" Local routines Written by S.Haesaert CONTENT helpfull functions for JPL project Bridging Tulip with the Statechart autocoder DATE 2 June """ # TODO : Check whether output set of reduced mealy machines (i,e.,ctrl.outputs) is too big? from __future__ import absolute_import from __future__ import...
import _plotly_utils.basevalidators class ValueValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="value", parent_name="scatterpolar.marker.colorbar.tickformatstop", **kwargs ): super(ValueValidator, self).__init__( plot...
import time from twilio import jwt class IpMessagingGrant(object): """ Grant to access Twilio IP Messaging """ def __init__(self, service_sid=None, endpoint_id=None, deployment_role_sid=None, push_credential_sid=None): self.service_sid = service_sid self.endpoint_id = endpoint...
# Copyright (c) 2012 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 ...
# 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 torch import torch.nn from torch.nn.parallel import DistributedDataParallel as DDP from collections import OrderedDict import os.path as osp import wandb from utils.utils import DotDict class Model: def __init__(self, hp, net_arch, loss_f, rank=0, world_size=1): self.hp = hp self.device =...
# 2. Write a code which accepts a sequence of words as input # and prints the words in a sequence after sorting them alphabetically. print("Enter sequence of words") print("For example -\nMy name is Sumit\n") words = input(">>> ") temp = words.split(" ") temp.sort() sorted_string = " ".join(temp) print("string afte...
# Copyright 2018 Tensorforce Team. 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 la...
# -*- coding: utf-8 -*- import numpy as np import pymc3 as pm from scipy.stats import kstest from .base_test import _Base from .physical import ImpactParameter, QuadLimbDark class TestPhysical(_Base): random_seed = 19860925 def test_quad_limb_dark(self): with self._model(): dist = QuadL...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011,2012,2013 American Registry for Internet Numbers # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear i...
# 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 ...
print(int(int(input())**.25))
"""Per-prefix data, mapping each prefix to a dict of locale:name. Auto-generated file, do not edit by hand. """ from ..util import u # Copyright (C) 2011-2020 The Libphonenumber Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
# pylint: disable=no-member, too-many-lines, redefined-builtin, protected-access, unused-import, invalid-name # pylint: disable=too-many-arguments, too-many-locals, no-name-in-module, too-many-branches, too-many-statements """Read invidual image files and perform augmentations.""" from __future__ import absolute_impor...
""" A small Test application to show how to use Flask-MQTT. """ import eventlet import json from flask import Flask, render_template from flask_mqtt import Mqtt from flask_socketio import SocketIO from flask_bootstrap import Bootstrap eventlet.monkey_patch() app = Flask(__name__) app.config['SECRET'] = 'my secret ...
# # CRC32 hash implementation # using polynomial 0x04c11db7 # _author: nagaganesh jaladanki # class crc32(): def __init__(self, data=None): self.poly = 0x04c11db7 if data != None: self.update(data) def update(self, bytestring): if type(bytestring) != bytes: byt...
import cv2 import time import numpy as np import sys sys.path.append("../") from train_models.MTCNN_config import config from Detection.nms import py_nms class MtcnnDetector(object): def __init__(self, detectors, min_face_size=25, stride=2, thr...
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from . import models, serializers class ExploreUsers(APIView): def get(self, request, format=None): last_five = models.User.objects.all().order_by('-date_joined')[:5] serializ...
from __future__ import annotations from typing import List x: List def b(*, x: list[str]): pass
"""Version details for maluforce""" __title__ = "maluforce" __description__ = "A basic Salesforce and Pandas interface" __url__ = "https://github.com/rodrigoelemesmo/maluforce" __version__ = "0.0.6" __author__ = "Rodrigo Maluf" __author_email__ = "rodrigo1793@gmail.com" __license__ = "None" __maintainer__ = "Rodrigo M...
# -*- coding: utf-8 -*- from __future__ import print_function import os import re import pickle import numpy as np from collections import Counter from functools import lru_cache from . import constants from .data_utils import tokenize word_detector = re.compile('\w') class VocabModel(object): def __init__(self,...
from .base import * # noqa from .base import env # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key SECRET_KEY = env( "DJANGO_SECRET_KEY...
import array class bmp: """ bmp data structure """ def __init__(self, w=1080, h=1920): self.w = w self.h = h def calc_data_size (self): if((self.w*3)%4 == 0): self.dataSize = self.w * 3 * self.h else: self.dataSize = (((self.w * 3) // 4 + 1) * 4) * se...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import copy import logging import os import torch from caffe2.proto import caffe2_pb2 from torch import nn from detectron2.config import CfgNode as CN from .caffe2_export import export_caffe2_detection_model from .caffe2_export import export_onnx...
import sys,os sys.path.append(os.path.dirname(__file__) + os.sep + '../') from FINDER import FINDER import numpy as np from tqdm import tqdm import time import networkx as nx import pandas as pd import pickle as cp import random def mkdir(path): if not os.path.exists(path): os.mkdir(path) g_type = "barab...
""" DataFrame --------- An efficient 2D container for potentially mixed-type time series or other labeled data series. Similar to its R counterpart, data.frame, except providing automatic data alignment and a host of useful data manipulation methods having to do with the labeling information """ from __future__ import...
# Natural Language Toolkit: Compatibility Functions # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Steven Bird <sb@csse.unimelb.edu.au> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT """ Backwards compatibility with previ...
from django.contrib import admin # Register your models here. from .models import commands class CommandsAdmin(admin.ModelAdmin): list_display = ('title', 'command', 'describe') admin.site.register(commands, CommandsAdmin)
# -*- coding: utf-8 -*- # # Copyright 2014 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
# This is free and unencumbered software released into the public domain. class Message: """A message.""" def __init__(self, id=None): self.id = id def __repr__(self): """Returns a human-readable string representation of this object.""" return "message{{id={}}}".format(self.id) ...
import logging from cached_property import threaded_cached_property from .credentials import BaseCredentials from .protocol import RetryPolicy, FailFast from .transport import AUTH_TYPE_MAP from .util import split_url from .version import Version log = logging.getLogger(__name__) class Configuration: """ A...
# Copyright 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Declare a couple of functions called from Boost.Build # # Each function will receive as many arguments as there ":"-separated # arguments in bj...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
# !/usr/bin/python3 # -*- coding: utf-8 -*- # @Time : 2021/7/5 下午5:29 # @Author : Latent # @Email : latentsky@gmail.com # @File : sequence_nick.py # @Software: PyCharm # @class : 清晰店铺的相关信息 """ 字段说明: 1.nick_id ---->数据库自增 2.nick_name 3.nick 4.brand 5.company_name 6.platform """ from tools_class import Tools_Class cla...
import setuptools with open("README.md", mode="r", encoding="utf-8") as readme_file: long_description = readme_file.read() setuptools.setup( name="DialogTag", version="1.1.3", author="Bhavitvya Malik", author_email="bhavitvya.malik@gmail.com", description="A python library to classify dialogue...
""" Linear SVM ========== This script fits a linear support vector machine classifier to random data. It illustrates how a function defined purely by NumPy operations can be minimized directly with a gradient-based solver. """ import numpy as np from autodiff.optimize import fmin_l_bfgs_b def test_svm(): rng =...
try: from prawframe.obfuscation import Scrambler except ImportError: from .obfuscation import Encryptor def bytes_packet(_bytes, termination_string=']'): """ Create a packet containing the amount of bytes for the proceeding data. :param _bytes: :param termination_string: :return: """ ...
import torch.nn as nn import torch class TransHeadNet(nn.Module): def __init__(self, in_channels, num_layers=3, num_filters=256, kernel_size=3, output_dim=3, freeze=False, with_bias_end=True): super(TransHeadNet, self).__init__() self.freeze = freeze if kernel_size == 3: ...
#!/usr/bin/env python # # File: cont_pipeline.py # # Created: Friday, July 15 2016 by rejuvyesh <mail@rejuvyesh.com> # import argparse import os import yaml import shutil import rltools from pipelines import pipeline # Fix python 2.x try: input = raw_input except NameError: pass def phase_train(spec, spec_f...
import sys sys.path.insert(0,'../../../deeplab-public-ver2/python') import caffe import leveldb import numpy as np from caffe.proto import caffe_pb2 import csv import cv2 # Wei Yang 2015-08-19 # Source # Read LevelDB/LMDB # ================== # http://research.beenfrog.com/code/2015/03/28/read-leveldb-lmdb-f...
import sys import os sys.path.append(os.path.abspath('..')) sys.path.append(os.path.abspath('./demo/')) from determined_ai_sphinx_theme import __version__ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # do...
import urwid class AlwaysFocusedEdit(urwid.Edit): """ This Edit widget is convinced that it is always in focus. This is so that it will respond to input events even if it isn't.' """ def render(self, size, focus=False): return super(AlwaysFocusedEdit, self).render(size, focus=True)
#!/usr/bin/env python """ Copyright 2019 Kubeinit (kubeinit.com). 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 ...