text
stringlengths
2
999k
"""Initial migration. Revision ID: 0e6439be42a3 Revises: Create Date: 2021-05-09 11:59:28.271181 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '0e6439be42a3' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto...
# coding: utf-8 """ Aeternity Epoch This is the [Aeternity](https://www.aeternity.com/) Epoch API. # noqa: E501 OpenAPI spec version: 0.7.0 Contact: apiteam@aeternity.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six cl...
from django.http.response import HttpResponse from django.http.request import HttpRequest from django.shortcuts import render from django.views.generic import ListView, DetailView from django.views import View from django.db.models import Q from django.core.paginator import Paginator from django.http import JsonRespons...
""" Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. The Universal Permissive License (UPL), Version 1.0 """ import os import copy from oracle.weblogic.deploy.util import WLSDeployArchive from oracle.weblogic.deploy.util import VariableException from wlsdeploy.aliases import model_constant...
class RebarShapeSegmentEndReferenceType(Enum, IComparable, IFormattable, IConvertible): """ A choice of two reference points for one end of a constraint driving the length of a RebarShapeSegment. enum RebarShapeSegmentEndReferenceType,values: Exterior (1),Straight (0) """ def __eq__(self...
# Copyright 2019-2021 The ASReview 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 appl...
from django.apps import apps from django.test import TestCase from django_http_referrer_policy.apps import DjangoHttpReferrerPolicyConfig class TestDjangoHttpReferrerPolicyConfig(TestCase): def test_apps(self): self.assertEqual(DjangoHttpReferrerPolicyConfig.name, 'django_http_referrer_policy') s...
import streaming_data_types.eventdata_ev42 as ev42 import streaming_data_types.histogram_hs00 as hs00 from streaming_data_types.eventdata_ev42 import EventData from just_bin_it.exceptions import JustBinItException def get_schema(buf): """ Extract the schema code embedded in the buffer :param buf: The ra...
# Full url to this task: https://ctflearn.com/challenge/305 # Usefull videos: * https://www.youtube.com/watch?v=SkJcmCaHqS0 # * https://www.youtube.com/watch?v=oHcJ4QLiiP8 import sys sys.path.append('../../../modules/crypto/') import vigenere_crypto encrypted_message = 'gwox{RgqssihYspOntqpxs}' key = ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
# Author: Stan Fortoล„ski # Date: 02.05.2020 # Proper Executable from random import random from driver import getDriver from tinder.login.tinderlogin import TinderLogin from tinder.tinderbot import TinderBot from tinder.finder.instagramfinder import InstagramFinder from tinder.finder.snapchatfinder import SnapchatFinde...
# -*- coding: utf-8 -*- """Module for defining an extractor that accepts a list of tokens and outputs tokens that exist in a user provided trie""" import copy import json import re from digExtractor.extractor import Extractor from landmark_extractor.extraction.Landmark import Rule, RuleSet class DigLandmarkExtractor...
from __future__ import absolute_import, unicode_literals from collections import OrderedDict from django.test import TestCase from django.urls import reverse from django.utils.http import urlencode import six from django_prbac.models import Role from tastypie.models import ApiKey from corehq.apps.accounting.models ...
from typing import runtime_checkable from uuid import uuid4 import pytest from backend.domain.contracts import AuthenticationService, TokenData from backend.domain.rules.auth.parse_token_data import ParseTokenData @pytest.fixture() def sut(authentication_service: AuthenticationService): return ParseTokenData(au...
from unittest.mock import patch from magicbandreader.handlers.turn_off_mickey import TurnOffMickeyHandler as Handler, register def test_Handler___init__(context_with_led_controller): h = Handler(context_with_led_controller) assert h.priority == 50 assert h.ctx == context_with_led_controller def test_ha...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.13.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys i...
# -*- coding: utf-8 -*- # Copyright (2017-2018) Hewlett Packard Enterprise Development LP # # 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 # # U...
import re import socket import logging from . import protocol from . import messages from . import Parsing from . import AgentTypes class Parser : def __init__(self, player_type, *args): self.type = player_type def initNetwork(self): self.link = socket.socket(soc...
# 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...
import matplotlib.pyplot as plt LOG_FILE_NAME = '2019_03_22__11_40_21_trash' timestamps = [] pre_processeds = [] not_pre_processeds = [] total = [] lines = [] with open('../../logs/log_%s.log' % LOG_FILE_NAME, 'r') as f: for line in f: if 'PLOT' not in line: continue lines.append(lin...
#!/usr/bin/python # Run with directory arguments from any directory, with no special setup required. # Or: # for i in libc libdl libm linker libstdc++ ; do ./libc/tools/generate-NOTICE.py $i > $i/NOTICE ; done import ftplib import hashlib import os import re import shutil import string import subprocess import sys imp...
# @see: https://www.codewars.com/kata/decode-the-morse-code def decodeMorse(morseCode): return ' '.join( map(lambda m_word: ''.join( map(lambda m_symbol: MORSE_CODE[m_symbol], m_word.split())), morseCode.strip().split(' ')))
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
from flask_wtf import FlaskForm from wtforms import StringField, BooleanField from wtforms.validators import InputRequired class OrganizationForm(FlaskForm): name = StringField('Nome', [InputRequired()]) tell = StringField('Telefone', [InputRequired()]) email = StringField('Email', [InputRequired()]) ...
## @package predictor_exporter # Module caffe2.python.predictor.predictor_exporter from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.proto import caffe2_pb2 from caffe2.proto import metanet_pb2 from ...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
from output.models.ms_data.regex.re_c32_xsd.re_c32 import Doc __all__ = [ "Doc", ]
# Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved. # # This file is Licensed under the Apache License, Version 2.0. # A copy of the Licence is available in LICENCE, or at: # # http://www.apache.org/licenses/LICENSE-2.0 # r"""This module includes neural graph embedding models and support functions. ...
import argparse import json import sys import requests from flask import Flask, request, abort, jsonify with open(".config.json") as _: secrets = json.loads(_.read()) def get_secret(setting, secrets=secrets): try: return secrets[setting] except KeyError: error_msg = "Should set the {} envi...
# 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 ...
#!/usr/bin/python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import io import json import unittest from contextlib import contextmanager from typing...
from conans import ConanFile, tools, AutoToolsBuildEnvironment from conan.tools.files import rename from conan.tools.microsoft import is_msvc from contextlib import contextmanager import os required_conan_version = ">=1.45.0" class GslConan(ConanFile): name = "gsl" description = "GNU Scientific Library" ...
import requests from .settings import ADDONS def is_available(operation): """Checks wether the service for the operation is defined and listening""" if operation in ADDONS: health = ADDONS[operation]["health"] try: response = requests.request(health["method"], health["uri"]) ...
#!/usr/bin/env python """Extracts the results from Clowder """ import os import sys import json import requests clowder_uri = os.getenv("CLOWDER_HOST_URI", "http://localhost:9000") API_BASE = "%s/api" % (clowder_uri) # Get the name of the test dataset fetch_ds_name = None argc = len(sys.argv) if argc > 1: fetc...
import nltk from nltk.tokenize import word_tokenize example = 'this is an example sentence.' words = word_tokenize(example) word_tags = nltk.pos_tag(words)
from bot_code.models import base_reinforcement import numpy as np import tensorflow as tf import random import bot_code.livedata.live_data_util as live_data_util import collections class BaseActorCritic(base_reinforcement.BaseReinforcement): frames_since_last_random_action = 0 network_size = 128 ...
# 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...
"""Common functions script This script will be appended to each server script before being executed. Please notice that to add custom common code, add it to the CommonServerUserPython script. Note that adding code to CommonServerUserPython can override functions in CommonServerPython """ from __future__ import print_fu...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import yaml master_doc = 'index' html_theme = 'redirect_template' html_theme_path = ['.'] try: with open(os.path.join(os.path.dirname(os.path.abspath(__file__)),'redirect.yml')) as redirect: redirect_data = redirect.read() redirect_data = ya...
import os.path from flask import ( Blueprint, jsonify, g, url_for, request, session, current_app, render_template, redirect, abort, flash ) from flask.ext.login import login_user, current_user from dropbox.rest import ErrorResponse from .models import Blog from .extensions import db frontend = Blueprint('f...
# 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...
import time import typing import attr from dbnd_postgres.postgres_contreoller import PostgresController from targets.value_meta import ValueMeta from targets.values import register_value_type from targets.values.builtins_values import DataValueType if typing.TYPE_CHECKING: from targets.value_meta import ValueM...
import sys import datetime import json from os import path sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) ) import utils.loadConfig from stravalib.client import Client from stravalib import unithelper from utils import loadConfig config = loadConfig.getConfig() user_name = config['keys']['st...
# -*- coding: utf-8 -*- # mpc_nbody/mpc_nbody/parse_input.py """ ---------------------------------------------------------------------------- mpc_nbody's module for parsing OrbFit + ele220 elements Mar 2020 Mike Alexandersen & Matthew Payne & Matthew Holman This module p...
from model import Model from dataset import TReNDS_dataset, ToTensor, AugmentDataset, fMRI_Aumentation, Normalize, RandomCropToDim, ResizeToDim import shutil from torch.utils.data import DataLoader, random_split from torchvision import transforms import os os.setgid(1000), os.setuid(1000) def clean_folder(folder, me...
from django.contrib import admin #from .models import Profile # the 'Profile' table is not currently used in this application, but might get utilized later #admin.site.register(Profile)
# Copyright 2019 DeepMind Technologies Limited. 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 ...
#!/usr/bin/env python2 """ Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ import re from craw.modules.trail.plugins.util import wget_content __url__ = "https://urlhaus.abuse.ch/downloads/text/" __check__ = "URLhaus" __info__ = "m...
# -*- coding: utf-8 -*- """ Created on Wed Apr 8 15:05:29 2020 @author: Wallace Examples based on https://realpython.com/linear-regression-in-python/ """ # Step 1: Import packages import numpy as np from sklearn.linear_model import LinearRegression from sklearn.preprocessing import PolynomialFeatures import matpl...
from options.train_options import TrainOptions from data.data_loader import CreateDataLoader from models.models import create_model import os import util.util as util from torch.autograd import Variable import torch.nn as nn opt = TrainOptions().parse() opt.nThreads = 1 opt.batchSize = 1 opt.serial_batches = True op...
import markdown import os from bs4 import BeautifulSoup from backend.config import MARKDOWN_EXTENSIONS, SERIES_FILENAME from ...models import Series from .article_data import load_article_datas from .file_data import FileData class SeriesData(FileData): def __init__(self, dir_entry, default_author, last_update...
from unittest import TestCase from os.path import dirname, join import json from pytezos.michelson.micheline import get_script_section from pytezos.michelson.types.base import MichelsonType from pytezos.michelson.program import MichelsonProgram from pytezos.michelson.format import micheline_to_michelson from pytezos.m...
# # Copyright IBM 2016. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
import sys #import traceback #import os import re import time PARAMS = {} NAME_PREFIX = 'vm_' METRICS = { 'time' : 0, 'data' : {} } LAST_METRICS = dict(METRICS) METRICS_CACHE_MAX = 5 ############################################################################### # Explanation of metrics in /proc/meminfo can...
class Punto: '''Representacion de un punto en coordenadas cartesianas (x, y)''' def __init__(self, x, y): '''Constructor de Punto. x e y deben ser numeros caso contrario se levanta una excepcion''' self.x = validar_numero(x) self.y = validar_numero(y) ...
# coding=utf-8 import numpy as np nd5=np.random.random([3,3]) #็”Ÿๆˆ3่กŒ3ๅˆ—็š„็Ÿฉ้˜ต print(nd5) print(type(nd5)) '''่พ“ๅ‡บ [[0.30996243 0.70525938 0.23778251] [0.36607574 0.07691564 0.25879282] [0.78231402 0.64058363 0.44167507]] <class 'numpy.ndarray'> '''
import mock from nose.tools import * from tests.base import OsfTestCase from tests.factories import ProjectFactory, AuthUserFactory from framework.auth import Auth from website.addons.figshare import model from website.addons.figshare import exceptions from website.addons.figshare import settings as figshare_settings...
import datetime import re import humanize # Replace html chars def htmlspecialchars(text): return (text.replace("&", "&amp;").replace('"', "&quot;").replace( "<", "&lt;").replace(">", "&gt;")) # remove_emojis from https://stackoverflow.com/a/58356570 def remove_emojis(data): emoj = re.compile( ...
import math import os import re import json import _pickle as Cpickle ''' ๅฎž็ŽฐBM25็ฎ—ๆณ• ''' class bm25: doc_len_bm25 = None dictionary = None @staticmethod def init(): bm25.doc_len_bm25 = {} listFile = os.walk(r"IRProjectDataLinguisted") reg = r"data(\d+)\.json" ...
"""Contains the scan group of the commands for Fidesctl.""" import click from fidesctl.cli.utils import with_analytics from fidesctl.core import dataset as _dataset from fidesctl.core import system as _system @click.group(name="scan") @click.pass_context def scan(ctx: click.Context) -> None: """ Scan extern...
#!/usr/bin/env python3 # vim: set expandtab tabstop=4 shiftwidth=4: # Copyright (c) 2020 CJ Kucera (cj@apocalyptech.com) # # This software is provided 'as-is', without any express or implied warranty. # In no event will the authors be held liable for any damages arising from # the use of this software. # # Permissio...
import time from threading import Thread import pytest from taro import warning from taro.jobs.runner import RunnerJobInstance from taro.test.execution import TestExecution from taro.test.observer import TestWarnObserver @pytest.fixture def execution(): return TestExecution(wait=True) @pytest.fixture def job(...
# Time: O(n) # Space: O(1) # # Given a binary tree # # struct TreeLinkNode { # TreeLinkNode *left; # TreeLinkNode *right; # TreeLinkNode *next; # } # Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. # # Initi...
#!/usr/bin/env python """ Simple example of a custom, very slow history, that is loaded asynchronously. By wrapping it in `ThreadedHistory`, the history will load in the background without blocking any user interaction. """ from __future__ import unicode_literals import time from prompt_toolkit2 import PromptSession...
# ####### # Copyright (c) 2016 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
"""Function that generates csv tables for the paper """ import numpy as np from datetime import datetime, timedelta import pandas as pd import logging, os, sys,coloredlogs from codetiming import Timer import csv # Locals dirname = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) sys.path.a...
#image to text from PIL import Image from pytesseract import image_to_string img=Image.open('/home/soham/Pictures/check.png') text=image_to_string(img) print(text)
# -*- coding: utf-8 -*- """ this script give IDs to the source codes. input: (project_name).csv output: files_production.txt file_id_list.csv """ import re import sys import csv import os.path import os import subprocess import csv def id_giver_production(): id = 1 writer = csv.writer(file("file_id_list_productio...
from .client_gateway import * from .heartbeat import * from .rate_limit import * from .voice_client_gateway import * __all__ = ( *client_gateway.__all__, *heartbeat.__all__, *rate_limit.__all__, *voice_client_gateway.__all__, )
#!/usr/bin/python3.9+ # -*- coding: utf-8 -*- # ๐Ÿ“Œ๏ธ M4nifest0 Black Hat Hacking Teamโ„ข๐Ÿ’ช # ๐Ÿ“Œ๏ธ ๐•ฟ๐–๐–Ž๐–˜ ๐•ด๐–˜ ๐•ฟ๐–๐–Š ๐“œ4๐“ท๐“ฒ๐“ฏ๐“ฎ๐“ผ๐“ฝ0 ๐•ฟ๐–Š๐–†๐–’โ„ข # ๐Ÿ“Œ๏ธ Author hack4lx ๐Ÿ‘Š # ๐Ÿ“Œ ๐Ÿ’ช Site : https://m4nifest0.com ๐Ÿ‘Š # ๐Ÿ“Œ ๐Ÿ’ช Site : https://m4nifest0.group ๐Ÿ‘Š # ๐Ÿ“Œ ๐Ÿ’ช Site : https://m4nifest0.shop ๐Ÿ‘Š # ๐Ÿ“Œ ๐Ÿ’ช Channel Telegr...
""" WSGI config for orm_aggregate_demo project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("D...
#!/usr/bin/env python # coding=utf-8 from datetime import datetime, timedelta import lxml import lxml.builder as lb import json import requests QUERY_SITEMATRIX = 'https://www.mediawiki.org/w/api.php?action=sitematrix' \ '&format=json&formatversion=2&smtype=language&smstate=all' QUERY_ALLUSERS = '/w/api.php?act...
#!/usr/bin/env python # 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...
#!/usr/bin/env python import sys import os import psutil import subprocess import logging from PyQt5 import Qt import online_monitor from online_monitor.utils import settings from online_monitor.OnlineMonitor import OnlineMonitorApplication from online_monitor.utils import utils def kill(proc): # kill process by id...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 12, transform = "Integration", sigma = 0.0, exog_count = 20, ar_order = 12);
import geneticOpt as gOpt def fitFunction(chrom): soma = 0 for i in range(7): soma = soma + chrom[i]**2 return soma model = gOpt.realCodificationModel(objective= 'min', fitFunction= fitFunction, maxGenerations= 10000, populationSize= 500, totalFamilies= 250, tot...
# -*- coding: utf-8 -*- # Author: Cyrill Lippuner # Date: October 2018 """ SoftWEAR Communications module. The API provided by this class is asynchronous; i.e. there is a background thread doing all the work and calls are non-blocking. """ import socket as sock # Standard sock...
import sys, pdb import numpy as np import theano import theano.tensor as T feat_n = 2 k = T.iscalar('k') x = T.tensor4('x') ind = T.argsort(x, axis = 3) sorted_ind = T.sort(ind[:,:,:, -k:], axis = 3) dim0, dim1, dim2, dim3 = sorted_ind.shape indices_dim0 = T.arange(dim0).repeat(dim1 * dim2 * dim3) indices_dim1 = ...
from animlib.animations.animation import Animation, AnimationOut from animlib.geometies.base import Base try: import cairo except: import cairocffi as cairo import numpy as np from enum import Enum class UnveilDirections(Enum): LEFT = ( 1.0, 0.0, 1.0, 0.0) TOP_LEFT = ( 1.0, 1.0, 1.0...
class colors: RED = '\033[91m' GREEN = '\033[92m' BLUE = '\033[94m' CYAN = '\033[96m' WHITE = '\033[97m' YELLOW = '\033[93m' MAGENTA = '\033[95m' GREY = '\033[90m' BLACK = '\033[90m' DEFAULT = '\033[39m' def getInfo(): return colors.WHITE + "INFO: " + colors.DEFAULT ...
# -*- coding: utf-8 -*- ############################################################################ # # Copyright ยฉ 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 ZPL should accompany th...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: pogoprotos/networking/responses/set_favorite_pokemon_response.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _me...
"""Figure of the Gaussian Peak Integrand function in 3D. x1 is evaluated on [0, 1] x2 is evaluated on [0, 1] y is the result of applying the Gaussian Peak Integrand function on each combination of x1 and x2 and u1,u2 = 0.5 """ import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D ...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright ยฉ 2021 jasoncheung <jasoncheung@iZwz95ffbqqbe9pkek5f3tZ> # # Distributed under terms of the MIT license. """ """ import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "1" import tensorflow as tf from transformers import AutoTokenizer, TFAutoMode...
import signal import argparse from pyhap.accessory_driver import AccessoryDriver from pyhap_vesync.utils.wrapper import Bridge if __name__ == '__main__': parser = argparse.ArgumentParser(description='Vesync HomeKit Bridge. ' 'Allows you to setup a Etekcit...
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import logging from typing import Iterator, List, Optional, Tuple, Union from azure.devops.connection import Connection from azure.devops.credentials import BasicAuthentication from azure.devops.exceptions import ( Az...
# -*- coding: utf-8 -*- """Python binding for pylibvw class""" from __future__ import division import pylibvw import warnings # baked in con py boost https://wiki.python.org/moin/boost.python/FAQ#The_constructors_of_some_classes_I_am_trying_to_wrap_are_private_because_instances_must_be_created_by_using_a_factory._Is_...
import os print("Press any key to install RunAsUser...") os.system("pause") os.system("pip install keyboard") os.system("pip install pyunpack") os.system("pip install webbrowser") os.system("pip install patool") import webbrowser as www import keyboard import time import patoolib www.open_new_tab("https://gi...
import os import secrets from PIL import Image from flask import url_for, current_app from flask_mail import Message from app import mail, app def save_picture(form_picture): random_hex = secrets.token_hex(8) _, f_ext = os.path.splitext(form_picture.filename) picture_fn = random_hex + f_ext picture_pa...
import numpy as np RADIUS1 = [3484.3,3661.0,3861.0,4061.0,4261.0,4461.0,4861.0,5061.0,5261.0,5411.0,5561.0,5711.0,5841.0,5971.0,6071.0,6171.0,6260.0,6349.0] RADIUS2 = [3661.0,3861.0,4061.0,4261.0,4461.0,4861.0,5061.0,5261.0,5411.0,5561.0,5711.0,5841.0,5971.0,6071.0,6171.0,6260.0,6349.0,6371.0] class Model(list): ...
import torch.nn as nn class TokenEmbedding(nn.Embedding): def __init__(self, vocab_size, embed_size=512): super().__init__(vocab_size, embed_size, padding_idx=0)
# Copyright (c) 2019, Palo Alto Networks # # 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 in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS...
from tests.case import DSLTestCase from xpath import dsl as x from xpath.renderer import to_xpath class TestGte(DSLTestCase): __fixture__ = "simple.html" def test_checks_greater_than_or_equal(self): xpath = to_xpath(x.descendant("p")[x.position().gte(2)]) results = self.find_all(xpath) ...
import numpy as np import os import time import IPython from scipy.stats import pearsonr def get_try_check(model, X_train, Y_train, Y_train_flipped, X_test, Y_test): def try_check(idx_to_check, label): Y_train_fixed = np.copy(Y_train_flipped) Y_train_fixed[idx_to_check] = Y_train[idx_to_check] ...
# To make python 2 and python 3 compatible code from __future__ import absolute_import from threading import Thread import time import sys if sys.version_info[0] < 3: # e.g python version <3 import cv2 else: import cv2 # from cv2 import cv2 # import the Queue class from Python 3 if sys.version_info >= (3...
# generated from genmsg/cmake/pkg-genmsg.context.in messages_str = "" services_str = "/home/fizzer/new-enph353-team-grimm/enph353-team-grimm/convolutionNN_2_ws/src/2019F_competition_student-master/enph353/enph353_gazebo/srv/GetLegalPlates.srv;/home/fizzer/new-enph353-team-grimm/enph353-team-grimm/convolutionNN_2_ws/sr...
# -*- coding:utf-8 -*- import os import sys import numpy as np import tensorflow as tf from tf_util import Layers class RNNLayers(Layers): def __init__(self, name_scopes, hidden_dims): assert(len(name_scopes) == 1) super().__init__(name_scopes) self.hidden_dims = hidden_dims def...
from abc import ( ABC, abstractmethod ) from argparse import ( ArgumentParser, _SubParsersAction, ) import asyncio import logging import pathlib import signal from typing import AsyncIterator, Type, TYPE_CHECKING, Union from async_generator import asynccontextmanager from lahja import AsyncioEndpoint,...
# coding: utf-8 """ VNS3 Controller API Cohesive networks VNS3 API providing complete control of your network's addresses, routes, rules and edge # noqa: E501 The version of the OpenAPI document: 4.8 Contact: solutions@cohesive.net Generated by: https://openapi-generator.tech """ from __future...
""" Provide classes to perform the groupby aggregate operations. These are not exposed to the user and provide implementations of the grouping operations, primarily in cython. These classes (BaseGrouper and BinGrouper) are contained *in* the SeriesGroupBy and DataFrameGroupBy objects. """ import collections import n...