text
stringlengths
2
999k
# -*- coding: utf-8 -*- """Wrapper for Jannovar germline annotation in parallel, genome is split into windows isort:skip_file """ import os import sys from snakemake import shell # A hack is required for being able to import snappy_wrappers modules when in development mode. # TODO: is there a more elegant way? base...
""" Tests key functionalities of DBMgr Author: Yuan Wang Copyright Jellifish 2015 """ import DBMgr as utils import sys import os from TaskSequence import TaskNode, TaskSequence db_fname_default = "test.db" def main(argv): n = 4 db_fname = db_fname_default if len(argv) > 1: if len(argv) > 2: ...
import re import sys from collections import Counter from xml.etree.ElementTree import fromstring import psycopg2 from ucca import convert, layer1 from ucca.layer1 import EdgeTags as ET from ucca.layer1 import NodeTags as NT UNK_LINKAGE_TYPE = 'UNK' PLACE_HOLDER = "%s" ##############################...
import os, sys, threading, Queue, time import traceback import abc import hashlib from coloredcoinlib import BlockchainStateBase from coloredcoinlib.store import DataStore class BaseStore(object): __metaclass__ = abc.ABCMeta def _rev_hex(self, s): return s.decode('hex')[::-1].encode('hex') def ...
# 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 PyDataladWebapp(PythonPackage): """DataLad extension for exposing commands via a web reque...
import threading from datetime import datetime from typing import Callable, Dict, Set, List from dataclasses import dataclass import zmq import zmq.auth from zmq.backend.cython.constants import NOBLOCK from tzlocal import get_localzone import pytz from vnpy.trader.constant import ( Direction, Exchange, Or...
import argparse import visit as Vi from os import getcwd, path, system from pymoab import core, tag, types def parse_arguments(): """ Parse the argument list and return the location of a geometry file, the location of a data file, whether or not to save images with a timestamp of the four default plot...
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################### # Author: Mu yanru # Date : 2019.3 # Email : muyanru345@163.com ################################################################### from dayu_widgets.divider import MDivider from dayu_widgets.page import ...
# -*- coding: utf-8 -*- from sklearn.model_selection import GridSearchCV from sktime.base import BaseEstimator from sktime.classification.distance_based._time_series_neighbors import ( KNeighborsTimeSeriesClassifier, ) from sktime.datasets import load_italy_power_demand from sklearn.pipeline import Pipeline from s...
import visa address = "visa://192.168.1.36:3537/ASRL3::INSTR" rm = visa.ResourceManager() bench = rm.open_resource(address, baud_rate=57600, data_bits=7) bench.parity = visa.constants.Parity(1) bench.stop_bits = visa.constants.StopBits(10) bench.timeout = 7000 bench.read_termination = '\n' model = bench.query('*I...
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Copyright (c) 2020 The JDCOIN developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test debug logging.""" import os from test_framework.test_fram...
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
# Copyright 2020 The Netket 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 applicable...
import pytest import numpy as np import numpy.testing as npt import scipy.sparse import scipy.sparse.linalg as spla sparray_types = ('bsr', 'coo', 'csc', 'csr', 'dia', 'dok', 'lil') sparray_classes = [ getattr(scipy.sparse, f'{T}_array') for T in sparray_types ] A = np.array([ [0, 1, 2, 0], [2, 0, 0, 3],...
import math from typing import List, Tuple def optimal_chunk_size_for_max_chunk_size(full_size: int, max_chunk_size: int) -> int: payload_size = max_chunk_size - 2 chunk_count = (full_size + payload_size - 1) // payload_size optimal_payload_size = (full_size + chunk_count - 1) // chunk_count optimal_...
# coding: utf-8 """ mzTab-M reference implementation and validation API. This is the mzTab-M reference implementation and validation API service. # noqa: E501 OpenAPI spec version: 2.0.0 Contact: nils.hoffmann@isas.de Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __...
""" Init all submodules for import. """ from sqlalchemy import MetaData, Table from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.inspection import inspect from ferry.database.database import Engine, Session from ferry.database.database_utilities import * from ferry.database.models import ( B...
""" Pythonista3 app to learn WebGL """ import wk.wkwebview as wkwebview import ui import pathlib uri = pathlib.Path('./index.html') class View(ui.View): def __init__(self): self.wv = wkwebview.WKWebView(flex='WH') self.wv.load_url(str(uri)) self.add_subview(self.wv) def will_close(self): self.w...
import copy from typing import List, Union, Tuple, Optional import gym from gym import spaces from gym.utils import seeding import numpy as np from highway_env import utils from highway_env.envs.common.observation import observation_factory from highway_env.envs.common.finite_mdp import finite_mdp from highway_env.env...
# Copyright 2018 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 -*- from django.conf.urls import patterns, url from users import views # # urlpatterns = patterns('', # # URL pattern for the UserListView # noqa # url( # regex=r'^$', # view=views.UserListView.as_view(), # name='list' # ), # # URL pattern for the UserRedire...
#!/usr/bin/env python ''' for python3 ''' import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) import sys import os import re # self module from stats import mean, median # From: https://www.bioinformatics.org/sms...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables __a...
from selenium import webdriver import threading import random import time ths=[] def work(driver): while True: try: driver.find_element_by_xpath("/html/body/div[1]/div").click() except: i=0 for i in range(0,20):#number of threads try: driver = webdriver.Firefox(...
import argparse import logging from operatorcert import validate_user def setup_argparser() -> argparse.ArgumentParser: # pragma: no cover parser = argparse.ArgumentParser( description="Verify if the Github user can submit the bundle" ) parser.add_argument( "--git-username", help="Userna...
import numpy as np import os from devito import Grid, Function, Constant from devito.logger import error __all__ = ['Model', 'demo_model'] def demo_model(preset, **kwargs): """ Utility function to create preset :class:`Model` objects for demonstration and testing purposes. The particular presets are ::...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function import os import sass import errno import re from lektor.pluginsystem import Plugin from termcolor import colored import threading import time COMPILE_FLAG = "scss" class scssPlugin(Plugin): name = u'Lektor scss' description...
from schematics.types import ModelType, StringType, PolyModelType from spaceone.inventory.model.sqldatabase.data import Database from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, DateTimeDyField, EnumDyField, \ ListDyField from spaceone.inventory.libs.schema.metadata.dynamic_layout imp...
# tgb - 5/21/2019 - Calculates statistics on Jordan networks # tgb - 4/27/2019 - Calculates precipitation PDF for each network on +0K and +4K # tgb - 4/24/2019 - Data-scarce using just 1-file --> calculate statistics on +0,1,2,3,4K; NNA version # tgb - 4/24/2019 - Validate the unconstrained multiple linear regression m...
#Author : Dhaval Harish Sharma #Red ID : 824654344 #Assignment 2, Question B_1 #Finding the histogram of an image #Importing the required libraries import skimage.io as io import matplotlib.pyplot as plt import numpy as np #Converting the image to a numpy array in_img = io.imread('Apple.jpeg') height = in_img.shape[0...
from ..forward import Forward from ...message_types import FORWARD, PROTOCOL_PACKAGE from unittest import mock, TestCase class TestForward(TestCase): to = "to" msg = "msg" def setUp(self): self.message = Forward(to=self.to, msg=self.msg) def test_init(self): assert self.message.to ...
"""This module holds the ``Process`` for normalizing text strings, usually before the text is sent to other processes. """ from dataclasses import dataclass from boltons.cacheutils import cachedproperty from cltk.alphabet.grc.grc import normalize_grc from cltk.alphabet.lat import normalize_lat from cltk.core.data_ty...
class LaundryConsts: building_id = { 'allen' : 1, 'bousefield' : 2, 'busey' : 3, 'clark' : 4, 'daniels' : 5, 'f.a.r' : 6, 'goodwingreen' : 7, 'hopkins' : 8, 'i.s.r' : 9, 'l.a.r' : 10, 'nugent' : 11, 'orcharddowns' : 12, 'p.a.r' : 13, 'scott' : 1...
# ---------------------------------------------------------------- # Copyright 2018-2019 Cisco Systems # # 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/L...
import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim from baselines.a2c.utils import fc, conv_to_fc from baselines.common.distributions import make_pdtype from ppo2ttifrutti_agent import nenvs class filmInit(object): def __init__(self, n): self.n = n # initw1 = tf.con...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2020 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...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
""" Contains class description of a square on the chessboard. """ from dataclasses import dataclass, field from ch_ss.game_engine.core.piece import Piece @dataclass(init=True, repr=True, eq=False, order=False, unsafe_hash=False, frozen=False) class Square: """ Dataclass that defines a square of a chessboard...
from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \ PermissionsMixin class userManager(BaseUserManager): def create_user(self, email, password=None, **extra_fields): """Create and saves a new user""" if not...
from math import sqrt import pygame as pygame from pygame.locals import * pygame.init() def get_list(l, indexes): return [l[i] for i in indexes] def polarity(n): if n == 0: return n return n / abs(n) def combine_lists(l1, l2, sign): l1 = list(l1) for i in range(2)...
"""Git deploy destination.""" import logging import os import re import shutil import subprocess import tempfile import git from protorpc import messages from grow.common import utils as common_utils from grow.deployments.destinations import base from grow.pods import env from grow.routing import router from grow.stor...
import time import logging import warnings import psutil from signal import signal, SIGINT from py3nvml.py3nvml import * from typing import Dict, Optional from kge import Config, Dataset from kge.distributed.parameter_server import init_torch_server, init_lapse_scheduler from kge.distributed.worker_process import Work...
#!/usr/bin/env python # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, thi...
# SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries # # SPDX-License-Identifier: MIT """ `adafruit_si5351` ==================================================== CircuitPython module to control the SI5351 clock generator. See examples/simpletest.py for a demo of the usage. This is based on the Arduino ...
import bisect import gc import glob import random import torch from others.logging import logger class Batch(object): def _pad(self, data, pad_id, width=-1): if (width == -1): width = max(len(d) for d in data) rtn_data = [d + [pad_id] * (width - len(d)) for d in data] return...
from .scraper import scraper
from migrate_postgres import create_category, create_activity, activate_activity GUIAS = ["1_conceptos.tex", "13_excepciones.tex", "17_PilasColas.tex", "20_ordenamiento_recursivo.tex", "5_ciclos.tex", "9_diccionarios.tex", "10_contratos.tex", "14_objetos.tex", "18_Modelo_de_ejecucion.tex", "...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import os import glob # from spacy_conll import Spacy2ConllParser import spacy import nltk import spacy_udpipe import spacy import stanza from spacy_stanza import StanzaLanguage import os import pathlib import massalign from massalign import annotators from massalign import models from massalign import core from massal...
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from __future__ import unicode_literals from ..model import MRISPreprocReconAll def test_MRISPreprocReconAll_inputs(): input_map = dict(args=dict(argstr='%s', ), copy_inputs=dict(), environ=dict(nohash=True, usedefault=True, ), fsgd_fil...
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indirectly) coin...
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/workspace/catkin_ws/devel/include;/home/workspace/catkin_ws/src/ball_chaser/include".split(';') if "/home/workspace/catkin_ws/devel/include;/home/workspace/catkin_ws/src/ball_chaser/include" != "...
import re f = lambda x: x.split(' ')[0].upper() + (' ' in x and f" {x.split(' ', 1)[1]}" or '') with open('raw_html_bits') as fd: raw_html = fd.read() al = re.findall(r"^<td axis=\".{6}\|\d+\|\d+/?\d*\|([^\"]+)\">([^<].+)</td>$", raw_html, re.MULTILINE) #al.insert(0xCB, ("BITS", "BITS")) #al.insert(0xDD, ("IX",...
from django.urls import path from django.conf.urls import url from .views import ( AssetsListView, AssetsDetailView, AssetsCreateView, AssetsUpdateView, AssetsDeleteView, ) from . import views urlpatterns = [ path('', AssetsListView.as_view(), name='assets_app_home'), path('assets/<int:pk>/...
from pwn import * context.arch='aarch64' frame = SigreturnFrame() registers = ['x%i' % i for i in range(0, 31)] registers += ['sp', 'pc'] for index, register in enumerate(registers): setattr(frame, register, index) assembly = '\n'.join([ shellcraft.read(constants.STDIN_FILENO, 'sp', 1024), shellcraft.sy...
#-*- coding: utf-8 -*- from django.conf.urls import url from ajaximage import views urlpatterns = [ url( '^upload/(?P<upload_to>.*)/(?P<max_width>\d+)/(?P<max_height>\d+)/(?P<crop>\d+)', views.ajaximage, name='ajaximage' ), ]
#!/usr/bin/env python # # Copyright 2017 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 requir...
api_key = "3a56486592cede72d273ca3b016d178b"
import asyncio import nextcord from nextcord.ext import commands from ..tools.Embeds import embeds import uuid import datetime import os from ..tools.Athena import Athena class moderation(commands.Cog, embeds): LOAD = True NAME = "Moderation" def __init__(self, client: Athena): sel...
# 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 ...
import requests from PIL import Image from io import BytesIO import streamlit as st from streamlit_app.navigation_radios import Introduction from streamlit_app.navigation_manager.navigation_manager import NavigationManager TSDS_ICON_URL = "https://raw.githubusercontent.com/thatscotdatasci/thatscotdatasci.github.io/m...
XSym 0075 b535cba88ebbec6fd9c903b93b8d9b16 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py ...
import time import random class PressureSensor: underPressure = 0 mode = 0 randCount = 0 randPeriod = 25 def __init__(self,api_info, mode=3, randPeriod=1): self.api_info = api_info self.mode = mode self.randPeriod = randPeriod self.read_from_sensor() def r...
def seconds(a): return a * 3600 print(seconds(2))
class Empresa(): def __init__(self,nom="",ruc=0,dire="",tele=0,ciud="",tipEmpr=""): self.nombre=nom self.ruc=ruc self.direccion=dire self.telefono=tele self.ciudad=ciud self.tipoEmpresa=tipEmpr def datosEmpresa(self):#3 self.nombre=input("Ingresar nombre ...
def create(cls): return cls() class A: def __init__(self): self.msg = "A.m()" def m(self): print(self.msg) a = A() a.m() b = create(A) b.m()
"""This module contains the general information for StorageStorageStats ManagedObject.""" from ...ucscentralmo import ManagedObject from ...ucscentralcoremeta import UcsCentralVersion, MoPropertyMeta, MoMeta from ...ucscentralmeta import VersionMeta class StorageStorageStatsConsts(): SUSPECT_FALSE = "false" ...
from general import visitor, errors from general import ast_hierarchy as ast from .type import Type # SELF_TYPE: is represented by a normal type with name SELF_TYPE and the parent is the class class TypeCheckerVisitor: def __init__(self): self.current_type = None # type(current_type) = Type ...
from ..pkc import RSA from ..Encoding import encodeText, decodeBits class RSAsig: def __init__(self, pubKey=None, privKey=None, modulus=None, primeLength=None): self.RSA = RSA(pubKey, privKey, modulus, primeLength, asciiEncode=False) def generateKeys(self): return self.RSA.generateKeys() ...
from __future__ import absolute_import, division, unicode_literals import datetime import warnings import pytest try: import numpy as np import numpy.testing as npt from numpy.compat import asbytes from numpy.testing import assert_equal except ImportError: pytest.skip('numpy is not available', all...
# # 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...
import pygame class Label(pygame.sprite.Sprite): def __init__(self): pygame.sprite.Sprite.__init__(self) self.font = pygame.font.SysFont("Calibri", 48) self.text = "" self.fgColor = ((0xFF, 0xFF, 0xFF)) self.bgColor = ((0x00, 0x00, 0x00)) self.center = (10...
test = { 'name': 'q3a', 'points': 1, 'suites': [ { 'cases': [ {'code': '>>> isinstance(fv_q3a, float)\nTrue', 'hidden': False, 'locked': False}, {'code': '>>> fv_q3a > 30420\nTrue', 'hidden': False, 'locked': False}, {'code': '>>> np....
# 1 2 3 4 5 ... till n terms # Write a program that prints the above series and calculates the sum of all the terms. # t(i) = i def formula(i): return i if __name__ == "__main__": n = int(input("Enter the number of terms: ")) print() print("The series is:") print() sum = 0 for i in range(...
import sys import signal import socket from pype.modules.ftrack.ftrack_server.ftrack_server import FtrackServer from pype.modules.ftrack.ftrack_server.lib import ( SocketSession, SocketBaseEventHub ) from pype.modules import ModulesManager from pype.api import Logger log = Logger().get_logger("FtrackUserServ...
# -*- coding: utf-8 -*- """ Created on Fri Mar 13 11:32:14 2020 @author: Ravi """ from collections import Counter def isValid(s): s1 = Counter(s) values = list(s1.values()) val_max = max(values) val_min = min(values) if val_max == val_min or (val_max - val_min == 1 and values.cou...
# SOURCE: https://makersportal.com/blog/2019/11/11/raspberry-pi-python-accelerometer-gyroscope-magnetometer # this is to be saved in the local folder under the name "mpu9250_i2c.py" # it will be used as the I2C controller and function harbor for the project # refer to datasheet and register map for full explanation ...
#!/usr/bin/env python # Copyright 2017 Calico 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 ...
class Solution(object): def hammingWeight(self, n): """ :type n: int :rtype: int """ cnt = 0 while n is not 0: cnt = cnt + n % 2 n = n >> 1 return cnt
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 26 11:11:10 2019 @author: Greg """ import sys, getopt from datetime import datetime # Internal lib from MarsTimeConverter import MarsTimeConverter def main(argv): from pathlib import Path from obspy import UTCDateTime from datetime import da...
from common.dali_utils import add_dali_pipeline_args, get_rec_pipeline_iter def add_dali_args(parser): return add_dali_pipeline_args(parser, [('--use-dali', 'store_true', 'use dali pipeline and augmentation'), ('--resize', int, 256, 'Shortest image edge size after resizi...
# -*- coding: utf-8 -*- from __future__ import print_function import numpy as np import pandas as pd from lifelines.fitters import UnivariateFitter from lifelines.utils import _preprocess_inputs, _additive_estimate, StatError, inv_normal_cdf,\ median_survival_times from lifelines.plotting import plot_loglogs cla...
import json import time import cherrypy class albums: def __init__(self,artist,year,title,num): self.artist=artist self.year=year self.title=title self.N=num class owner(albums): def __init__(self,nome,date): self.album_list=[] self.nome=nome self.last_...
# Copyright 2013 Huawei Technologies Co.,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 applica...
"""empty message Revision ID: 3d19e58d3b05 Revises: 4e0fa8fcae09 Create Date: 2021-01-01 00:35:39.920394 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3d19e58d3b05' down_revision = '4e0fa8fcae09' branch_labels = None depends_on = None def upgrade(): # ...
import interface import data data.Config.load_config() interface.main()
#! /usr/bin/python import mtree if __name__ == "__main__": try: mtree.main() except KeyboardInterrupt, e: import sys print >>sys.stderr, "Exiting on C-c." sys.exit(1)
# coding: utf-8 """ Pure Storage FlashBlade REST 1.9 Python SDK Pure Storage FlashBlade REST 1.9 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/). OpenAPI spec version: 1.9 Contact: i...
from __future__ import unicode_literals from django.db import models from django.shortcuts import get_object_or_404 from django.test import TestCase from rest_framework import generics, renderers, serializers, status from rest_framework.test import APIRequestFactory from rest_framework.tests.models import BasicModel, C...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- __version__ = '1.51.23' # ----------------------------------------------------------------------------- import asyncio import concurrent.futures import socket import certifi import aiohttp import ssl import sys i...
"""A parser for XML, using the derived class as static DTD.""" # Author: Sjoerd Mullender. import re import string import warnings warnings.warn("The xmllib module is obsolete. Use xml.sax instead.", DeprecationWarning, 2) del warnings version = '0.3' class Error(RuntimeError): pa...
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
from django.db.models import get_models, signals from django.conf import settings from django.utils.translation import ugettext_noop as _ if "notification" in settings.INSTALLED_APPS: from notification import models as notification def create_notice_types(app, created_models, verbosity, **kwargs): not...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * ''' IMPORTS ''' from datetime import datetime from typing import Dict, List, Any, Optional, Tuple import uuid import json import requests # disable insecure warnings requests.packages.urllib3.disable_warnings() ''' GL...
# -*- coding: utf-8 -*- """ Sympy helpers """ from __future__ import absolute_import, division, print_function import numpy as np import six import utool as ut import ubelt as ub def custom_sympy_attrs(mat): import sympy def matmul(other, hold=True): if hold: new = sympy.MatMul(mat, other...
""" Create a StackInfo-object and it will spawn a different thread. That thread will sleep for 'average' ms (reformatted to seconds). Then it will log the stacktrace of all active threads. Moreover, it logs cpu- and memory-info. """ import time import traceback from threading import Thread import sys i...
#!/usr/bin/env python # -*-coding:utf-8-*- import tensorflow as tf import numpy as np from tensorflow.contrib.crf import viterbi_decode SEG_DICT = {"B": 0, "M": 1, "E": 2, "S": 3} def decode(logits, trans, sequence_lengths, tag_num): viterbi_sequences = [] small = -1000.0 start = np.asarray([[small] * ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------------------------- # - Generated by tools/entrypoint_co...
# import unittest # from translator import english_to_french, french_to_english # class TestTranslator(unittest.TestCase): # def test(self): # self.assertEqual(french_to_english('Bonjour'),'Hello') # self.assertEqual(english_to_french('Hello'), 'Bonjour') # unittest.main()
# Fully Written by @HeisenbergTheDanger (Keep credits else gay) # Permission Seeked By @StarkXD - Approved import asyncio import datetime from telethon import events from var import Var from uniborg.util import admin_cmd, sudo_cmd, edit_or_reply from telethon.tl.types import ( DocumentAttributeFilename, Docume...