text
stringlengths
2
999k
import json import os, errno import sys import time import shutil import subprocess from subprocess import Popen, PIPE EXECUTABLE = 'hcbr_learning' BUILD_FOLDER = '../build' DATA_FOLDER = '../data' KFOLD_SCRIPT = 'kfold_validation.py' ACCURACY_ROW = 4 #METAOPTIMIZATION = '../tuning/hyperopt_wrapper.py' #METAOPTIMIZAT...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: DIYer22@github @mail: ylxx@live.com Created on Thu Jan 16 18:17:20 2020 """ from boxx import * from boxx import deg2rad, np, pi import bpy import random def set_cam_pose(cam_radius=1, cam_deg=45, cam_x_deg=None, cam=None): cam_rad = deg2rad(cam_deg) ...
# # # Copyright (C) University of Melbourne 2013 # # # #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...
import pandas as pd from .entity import CatalogEntity from .repository.dataset_repo import get_dataset_repo from .repository.variable_repo import get_variable_repo from .repository.constants import VARIABLE_FILTER from .summary import variable_describe, head, tail, counts, quantiles, top_values, histogram _DESCRIPTI...
from libcrypto import hamming_distance from libcrypto import split_blocks from libcrypto import xor from libcrypto import freq_score from base64 import b64decode from operator import itemgetter def main(): file64 = "" for line in open("../assets/inputS1C6.txt","r"): file64 += line.rstrip() file...
# Copyright 2015 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...
# A simple CLI runner for slurm that can be used when running Galaxy from a # non-submit host and using a Slurm cluster. from logging import getLogger try: from galaxy.model import Job job_states = Job.states except ImportError: # Not in Galaxy, map Galaxy job states to Pulsar ones. from pulsar.util im...
"""DenseNet models for Keras. # Reference paper - [Densely Connected Convolutional Networks] (https://arxiv.org/abs/1608.06993) (CVPR 2017 Best Paper Award) # Reference implementation - [Torch DenseNets] (https://github.com/liuzhuang13/DenseNet/blob/master/models/densenet.lua) - [TensorNets] (https://gith...
#!/usr/bin/env python3 import gevent.monkey gevent.monkey.patch_all() import argparse import json import re import string import socket import urllib.parse import webbrowser import flask import gevent.pool import gevent.pywsgi import requests app = flask.Flask(__name__, template_folder='.') con...
''' Система линейных уравнений - 2 ''' a = float(input()) b = float(input()) c = float(input()) d = float(input()) e = float(input()) f = float(input()) if a == 0 and b == 0 and c == 0 and d == 0 and e == 0 and f == 0: print(5) elif a * d == b * c and a * f != c * e: print(0) elif a == 0 and b == 0 and e != 0: ...
# -*- coding: utf-8 -*- """ Author ------ Bo Zhang Email ----- bozhang@nao.cas.cn Created on ---------- - Fri Jul 3 13:13:06 2015 read_spectrum Modifications ------------- - Fri Nov 20 10:16:59 2015 reformatting code - Sun Feb 28 14:39:16 2016 migrated to bopy.spec.lamost - Fri Jul 15 16:08:00 2016 mig...
class BaseDownsizing: def __init__(self, raw_file_f, raw_file_r=None): self.raw_file_f = raw_file_f self.raw_file_f = raw_file_f self._downsized_f = None if raw_file_r: self.raw_file_r = raw_file_r self.raw_file_r = raw_file_r self._downsized_r = ...
from collections import OrderedDict from django.conf import settings from django.db.models import Count, F from django.http import HttpResponseForbidden, HttpResponse from django.shortcuts import get_object_or_404 from drf_yasg import openapi from drf_yasg.openapi import Parameter from drf_yasg.utils import swagger_au...
# --------------------------------------------------------------------- # Angtel.Topaz.get_interface_status # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- ...
# -*- coding: utf-8 -*- """ pygments.lexers.diff ~~~~~~~~~~~~~~~~~~~~ Lexers for diff/patch formats. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups from pygments.tok...
from disco import Disco class Config: def __init__(self): self._numero_discos = int(input("\nInforme a quantidade de discos: ")) def adiciona_discos(self, torre_inicial): discos = self.add_disco() for ix in range(self._numero_discos): torre_inicial.empilha(discos[ix]) ...
import os import platform import socket import copy import json import numpy as np from datetime import datetime import time from .metadata import acdd import flopy # globals FILLVALUE = -99999.9 ITMUNI = { 0: "undefined", 1: "seconds", 2: "minutes", 3: "hours", 4: "days", 5: "years", } PRECISI...
# -*- coding: utf-8 -*- from .Enviopack import Enviopack from .Auth.Auth import Auth from .Quote.Quote import Quote from .Pickings.Pickings import Pickings from .Orders.Orders import Orders __version__ = "0.4.6" __author__ = "Federico Gobea"
""" WSGI config for billsengine_31836 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.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJ...
import requests import threading import random import json usernames = json.loads(open("usernames.json", "r").read()) password = '%4B%65%6E%79%6F%6E%35%25' # A hex encoded password siteurl = '192.168.122.61' def run(): username = random.choice(usernames) token = requests.get('http://' + siteurl + '/login/toke...
import pytest from autogluon.core.space import Categorical from autogluon.vision._gluoncv import ObjectDetection def get_dataset(path): return ObjectDetection.Dataset.from_voc(path) @pytest.mark.skip(reason="ObjectDetector is not stable to test, and fails due to transient errors occasionally.") def test_object...
#!/usr/bin/python # -*- coding: UTF-8 -*- import asyncio import pyppeteer import time import os import random from exe_js import js1, js3, js4, js5 # http://www.mamicode.com/info-detail-2302923.html # https://segmentfault.com/a/1190000011627343 """ { proxy: "127.0.0.1:1234", proxy-auth: "userx:passx", prox...
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api_yamdb.settings') application = get_wsgi_application()
""" Django settings for bingo project. Generated by 'django-admin startproject' using Django 3.0.5. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # B...
from zenml.steps import BaseStepConfig class PreTrainingConfigs(BaseStepConfig): # The configuration for the pre-training of the agent ENV_NAME: str = "BreakoutDeterministic-v4" WRITE_TENSORBOARD: bool = True TENSORBOARD_DIR: str = "tensorboard/" LEARNING_RATE: float = 0.00001 INP...
import educative.course1.stacks_queues.stack as s input_data = [23, 60, 12, 42, 4, 97, 2] expected_output_data = [2, 4, 12, 23, 42, 60, 97] # This solution uses a second stack # 1. until input stack is not empty, we pop the top value and compare it # with the top value of the second stack # 2. if value > top of s...
# Copyright DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
from __future__ import print_function from __future__ import division
# Author: Denys Makogon # # 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 t...
from abc import abstractmethod from .apr_fetcher import APRFetcher from typing import Dict, List, Union, Any from .dapp_apr_fetcher import DappAPRFetcher from .utils.utils import ( calculate_lp_token_price, get_block_average_time, get_token_price_from_dexs, open_contract, usdt_address, platform_...
from django.test import TestCase from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient QUIZZES_URL = reverse('questionary:quiz-list') class PublicQuizzesApiTests(TestCase): """Test the publicly available tags API""" def setUp(self): self.client ...
############################################################################### # Author: CallMeCCLemon # Date: 2019 # Copyright: 2019 Thomas Littlejohn (@CallMeCCLemon) - Modified BSD License ############################################################################### from enum import Enum from Py...
from __future__ import unicode_literals import Queue import datetime import errno import gettext import itertools import json import locale import os import subprocess import sys import threading import wx import openslides from openslides.utils.main import ( detect_openslides_type, filesystem2unicode, ...
#-*- coding: utf-8 -*- from __future__ import unicode_literals import aldryn_apphooks_config.fields import app_data.fields import djangocms_text_ckeditor.fields from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '__first__'), ('djangocms_blo...
import copy import re from collections import defaultdict from typing import List, Dict from .substitution_augmenter import SubstitutionAugmenter from ..actions import Chemical from ..utils import extract_chemicals from paragraph2actions.misc import TextWithActions class CompoundNameAugmenter(SubstitutionAugmenter):...
# Generated by Django 3.1.13 on 2021-09-02 17:31 import django.contrib.postgres.fields from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ('stac_api', '0015_data_collection_summaries'), ] operations = [ migrations.AddFie...
SOURCE_DOC_PATH = ''
import numpy as np from i3Deep import utils from tqdm import tqdm import os # name = "KGU-53317EB91645" # load_mask = "D:/Datasets/medical_data/ExportKGU/3D Slicer 2/" + name + "/mask.nii.gz" # load_label_table = "D:/Datasets/medical_data/ExportKGU/3D Slicer 2/" + name + "/label_table.txt" # save_mask = "D:/...
import base64 import json import requests import urllib3 from contextlib import contextmanager from packaging.version import Version from requests.adapters import HTTPAdapter from urllib3.util import Retry from requests.exceptions import HTTPError from mlflow import __version__ from mlflow.protos import databricks_pb2...
""" sampling.py We sample Metropolis-Hastings: * Random walk proposals * Langevin proposals * Langevin proposals with preconditioning * Hamiltonian MC * Hamiltonian MC with preconditioning NOTE: The functionality of this module is restricted to log-densities, i.e. densities of the form p(s...
# Copyright 2019 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 applicable law or agreed to...
import pytest import torch from torch.testing import assert_allclose from kornia.augmentation.random_generator import ( random_prob_generator, random_color_jitter_generator, random_perspective_generator, random_affine_generator, random_rotation_generator, random_crop_generator, random_crop_...
# coding: utf-8 # # Copyright 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 "lice...
#!/usr/bin/env python3 # Copyright (c) 2016-2018 The Test Coin Super Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test various net timeouts. - Create three testcoinsuperd nodes: no_verack_node - we never...
MRPYTHON_VERSION_MAJOR = 3 MRPYTHON_VERSION_MINOR = 0 MRPYTHON_VERSION_PATCH = 9 MRPYTHON_VERSION_TAG = "beta" def version_string(): return "{}.{}.{}{}".format(MRPYTHON_VERSION_MAJOR, MRPYTHON_VERSION_MINOR, MRPYTHON_VERSION_PATCH, ...
import torch import torch.optim as optim def set_optimizer(model, cfg): r"""Sets the optimizer """ if cfg.optimizer == 'SGD': optimizer = optim.SGD(model.parameters(), lr=cfg.lr, momentum=cfg.momentum, weight_decay=cfg.weight_decay, neste...
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from datetime import datetime from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union from uuid import UUID, uuid4 from pydantic import BaseModel, Field, root_validator, validator from pydantic.datacl...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'test.ui' # # Created by: PyQt5 UI code generator 5.15.0 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore, QtGui, ...
from .hn import NewsClient
from functools import reduce from itertools import chain from operator import add from typing import Iterable, Optional, TypeVar from lhotse.audio import Recording, RecordingSet from lhotse.cut import Cut, CutSet, MixedCut from lhotse.features import FeatureSet, Features from lhotse.supervision import SupervisionSegme...
# 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 ag...
from csrv.model import actions from csrv.model.actions import play_run_event from csrv.model import cost from csrv.model import events from csrv.model import timing_phases from csrv.model.cards import card_info from csrv.model.cards import event class TrashForFree(actions.TrashOnAccess): COST_CLASS = cost.NullCost ...
from __future__ import print_function import copy import time from pprint import pformat import uuid import ast import urllib import urllib3 import requests.exceptions from demisto_client.demisto_api.rest import ApiException import demisto_client import json from Tests.test_utils import print_error, print_warning, pri...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
from charms.reactive import Endpoint, when, set_flag, clear_flag import charmhelpers.core.hookenv as hookenv from charmhelpers.core.hookenv import log class GearmanRequires(Endpoint): @when('endpoint.{endpoint_name}.joined') def joined(self): # if any(unit.received['port'] for unit in self.all_joined_...
import csv import sys from flee import flee from flee import SimulationSettings class InputGeography: """ Class which reads in Geographic information. """ def __init__(self): self.locations = [] self.links = [] def ReadLocationsFromCSV(self, csv_name, columns=["name", "region", "...
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier # NOTE: Make sure that the outcome column is labeled 'target' in the data file tpot_data = pd.read_csv('PATH/TO/DATA/FILE', sep='COLUMN_SEPARATOR', dtype=np.float64) features =...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Nicole Thomas <nicole@satlstack.com>` ''' # Import Salt Testing Libs from salttesting import TestCase from salttesting.mock import MagicMock, patch from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') # Import Salt Libs from salt.modules i...
# coding: utf-8 # (C) Copyright IBM Corp. 2019, 2020. # # 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...
import torch from torch.nn import functional as F from dassl.optim import build_optimizer, build_lr_scheduler from dassl.utils import count_num_param from dassl.engine import TRAINER_REGISTRY, TrainerX from dassl.engine.trainer import SimpleNet @TRAINER_REGISTRY.register() class CrossGrad(TrainerX): """Cross-gra...
# 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 numpy as np import pandas as pd import torch import torch.nn as nn import itertools import collections import matplotlib.pyplot as plt # Read in data df = pd.read_csv("Chinese_Names_Corpus_Gender(120W).txt", header=2) df = df[df.sex != "未知"] names = df["dict"].values # Compute charact...
import sys import numpy as np import pennylane as qml import pytest import qiskit from pennylane_qiskit import AerDevice, BasicAerDevice from conftest import state_backends pldevices = [("qiskit.aer", qiskit.Aer), ("qiskit.basicaer", qiskit.BasicAer)] class TestDeviceIntegration: """Test the devices work corr...
# coding=utf-8 # Copyright 2019 The TensorFlow Datasets Authors. # # 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...
# -*- coding: utf-8 -*- """ rwlock.py A class to implement read-write locks on top of the standard threading library. This is implemented with two mutexes (threading.Lock instances) as per this wikipedia pseudocode: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Using_two_mutexes ...
# -*- coding: utf-8 -*- """ Created on Wed May 20 11:36:58 2020 @author: nastavirs """ import numpy as np import tensorflow as tf def net_u(self, x, t): u = self.neural_net(tf.concat([x,t],1), self.weights, self.biases) return u
# flake8: noqa # DEV: Skip linting, we lint with Python 2, we'll get SyntaxErrors from `yield from` # stdlib import time import asyncio # 3p import aiopg from psycopg2 import extras # project from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY from ddtrace.contrib.aiopg.patch import patch, unpatch from ddtrace im...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
#!/usr/bin/python -tt import os import argparse import subprocess import shutil parser = argparse.ArgumentParser(description="Compile the Mount&Blade Warband shaders.") parser.add_argument("-b", "--compile-b", action="store_true", help="compile the ps_2_b profile as well") args = parser.parse_args() if no...
# import riaps from riaps.run.comp import Component import logging class Hello(Component): def __init__(self): super(Hello, self).__init__() def on_clock(self): now = self.clock.recv_pyobj() # Receive time.time() as float self.logger.info('on_clock(): %s' % str(now))
# 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 from...
from keras.models import Sequential from keras.layers.convolutional import Conv2D from keras.layers.convolutional import MaxPooling2D from keras.layers.core import Activation from keras.layers.core import Flatten from keras.layers.core import Dense from keras import backend as K class LeNet: @staticmethod def...
# Copyright 2021 Torsten Mehnert # # 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 wri...
from CyberSource import * import os import json from importlib.machinery import SourceFileLoader config_file = os.path.join(os.getcwd(), "data", "Configuration.py") configuration = SourceFileLoader("module.name", config_file).load_module() # To delete None values in Input Request Json body def del_none(d): for ke...
#Crie um programa que vai ler vários números e colocar em uma lista. #Depois disso, crie duas listas extras que vão conter apenas valores pares #e os valores impares digitados, respectivamente. #Ao final, mostre o conteúdo das três listas geradas principal = [] par = [] impar = [] while True: n = int(input('Digite...
# -*- coding: utf-8 -*- import sys import os import re sys.path.append('../') # noqa from jinja2 import Template from cli_bdd.core.steps import ( command, environment, file as file_steps, ) BASE_PATH = os.path.dirname(os.path.normpath(__file__)) TEMPLATES_PATH = os.path.join(BASE_PATH, 'templates') S...
#!/usr/bin/env python3 # Copyright (c) 2016-2017 The Michaellaoliu Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test Hierarchical Deterministic wallet function.""" from test_framework.test_framework import Mi...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: locale.py """ Locale support. The module provides low-level access to the C lib's locale APIs and adds high level number formatting APIs as ...
"""Utilities for working with data. These are intended to be used predominantly by the filing cabinet in order to read and write datasets appropriately. """ from typing import Any def _get_handlers(location:str=""): """Returns available file handlers. This checks for a handlers folder at this location and w...
from __future__ import print_function import yaml import subprocess import re import argparse from keras.models import model_from_yaml from betago.model import KerasBot from betago.processor import SevenPlaneProcessor from betago.gtp.board import gtp_position_to_coords, coords_to_gtp_position argparser = argparse.Arg...
import os import sys from time import sleep import threading import window import comunication import DisplayActions debugMode = True def main(): print("starting...",end='') state = True print("[" + ("OK" if state else "ERROR" ) + "]") winThread.start() comunication.start() winThread = thre...
# Write a script that generates daily edit AND view counts for Panama Papers over its first 30 days of existence, and prints them to a CSV or TSV file in reverse-chronological order. You file should have three colums with the headers "date", "edits" and "views". import csv import json import requests import operator f...
from unittest.mock import MagicMock from twisted.web.resource import NoResource from txweb.resources import RoutingResource from txweb import App from txweb.http_codes import Unrenderable from txweb.resources import ViewClassResource from unittest.mock import sentinel import typing as T from .helper import RequestR...
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild from pkg_resources import parse_version import kaitaistruct from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO import collections if parse_version(kaitaistruct.__version__) < parse_version('0.9'): raise E...
import json from typing import Optional import zipcodes from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.exceptions import InvalidExpectationConfigurationError from great_expectations.execution_engine import ( PandasExecutionEngine, SparkD...
#!/usr/bin/python from setuptools import setup, find_packages import sys install_requires = [] pyversion = sys.version_info[:2] if pyversion < (2, 7) or (3, 0) <= pyversion <= (3, 1): install_requires.append('argparse') setup( name='radosgw-agent', version='1.0', packages=find_packages(), author...
from flask import Blueprint, request from app.spiders.core import * from app.utils import build_result from app.constants import code core = Blueprint('core', __name__) @core.route('/login', methods=['POST']) def login(): data = request.form username = data.get('username') password = data.get('password'...
#!C:\Users\Aditya\PycharmProjects\python-docs-azure-app\venv\Scripts\python.exe # -*- coding: utf-8 -*- # This file is part of pygal # # A python svg graph plotting library # Copyright © 2012-2016 Kozea # # This library is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser Gener...
""" Python wrapper for libui. """ import ctypes from . import clibui class uiCombobox(ctypes.Structure): """Wrapper for the uiCombobox C struct.""" pass def uiComboboxPointer(obj): """ Casts an object to uiCombobox pointer type. :param obj: a generic object :return: uiCombobox """ ...
import click import pandas as pd # Due textacy problems try: from textacy.preprocess import preprocess_text except Exception: from textacy.preprocess import preprocess_text def preprocess_f(text, fix_unicode=True, lowercase=True, no_urls=True, no_emails=True, no_phone_numbers...
#coding=utf-8 import sys import getopt from core.interface.action import server_action from core.helper.usage import usage_helper from prettytable import PrettyTable from core.helper.parser import config_parser import re class action_list(server_action): # 参数列表示例,可以在这边增加参数描述,最终代码将根据argname生成对对应的参数 _parameters ...
# 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...
#make print in python 2, 3 compatible from __future__ import print_function import numpy as np import pyedda as edda #Univariate Gaussian print("//////////Univariate Gaussian///////") dummy_data = np.random.rand(100) gaussian = edda.Gaussian(100, 20) print("gaussian.getMean():", gaussian.getMean()) print("gaussian.g...
import graphene from graphene import Node from graphene_django.filter import DjangoFilterConnectionField from graphene_django.rest_framework.mutation import SerializerMutation from graphene_django.types import DjangoObjectType from rest_framework.generics import get_object_or_404 from contact.models import Contact fro...
# µPing (MicroPing) for MicroPython # copyright (c) 2018 Shawwwn <shawwwn1@gmail.com> # License: MIT # Internet Checksum Algorithm # Author: Olav Morken # https://github.com/olavmrk/python-ping/blob/master/ping.py # @data: bytes # ping statistics, loop mode and KeyboardInterrupt handler, + esp8266 compatible # copyri...
from __future__ import absolute_import import operator from celery.concurrency import solo from celery.utils.functional import noop from celery.tests.case import AppCase class test_solo_TaskPool(AppCase): def test_on_start(self): x = solo.TaskPool() x.on_start() def test_on_apply(self): ...
#-*- coding: utf-8 -*- import sys import os import random import re import time import torch from torch.autograd import Variable from torch import optim import torch.nn as nn #sys.path.append('../') from hybrid_bid_t1_model import Seq2Seq from hybrid_data_utils import * sub = '-'*20 def init_command_l...
import json import logging import os import re import sys import time def setup_logger(): console = logging.StreamHandler(sys.stdout) handlers = [console] logging.basicConfig(handlers=handlers) root = logging.getLogger() root.setLevel(logging.INFO) setup_logger() log = logging.getLogger(__name_...
# -*- coding: utf-8 -*- """ Goes through the clean dataset and determines when audio is occuring by measuring across a simple threshold We use these labels for the 15, 10 5, 0dB SNR samples Created on Sun Dec 4 15:37:11 2016 @author: brady """ import os import wavio from fe_utils import * from config import TRAI...