text
stringlengths
1
927k
""" ASGI config for hotel project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTING...
''' @Copyright (c) tkianai All Rights Reserved. @Author : tkianai @Github : https://github.com/tkianai @Date : 2020-04-26 14:14:18 @FilePath : /ImageCls.detectron2/imgcls/modeling/backbone/mobilenet.py @Description : ''' import torch import torch.nn as nn from detectron2.layers imp...
from .adaptor import Adaptor, SleapObjectType from .filehandle import FileHandle class TextAdaptor(Adaptor): @property def handles(self): return SleapObjectType.misc @property def default_ext(self): return "txt" @property def all_exts(self): return ["txt", "log"] ...
import unittest from anchore_engine.services.policy_engine.engine.policy.params import JsonSchemaValidator, BooleanStringValidator, TypeValidator, CommaDelimitedNumberListValidator, EnumValidator, \ DelimitedEnumStringValidator, IntegerValidator, NameVersionListValidator, PipeDelimitedStringListValidator, CommaDel...
import time class Clock: def __init__(self): self.start_time = time.time() self.current_time = time.time() def get_time(self): return time.time() - self.start_time def get_dt(self): return time.time() - self.current_time def update(self): self.current_time = time.time() def delay(self, sec): time.s...
#!/usr/bin/env python """ Read a maf file and print the regions covered to a set of bed files (one for each sequence source referenced in the maf). Only blocks with a positive percent identity are written out. TODO: Can this be generalized to be made more useful? usage: %prog bed_outfile_prefix < maf """ from __f...
import sys import pymongo connection = pymongo.MongoClient("mongodb://localhost") db = connection.test users = db.users doc = {'firstname':'Andrew', 'lastname':'Erlichson'} print doc print "about to insert the document" try: users.insert_one(doc) except Exception as e: print "insert failed:", e print doc p...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-LOG 蓝鲸日志平台 is licensed under the MIT License. License for BK-LOG 蓝鲸日志平台: ------------------------------------------------...
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for the functions below. main() is already se...
# -*- coding: utf-8 -*- """Test configs.""" from openair.app import create_app from openair.settings import DevConfig, ProdConfig def test_production_config(): """Production config.""" app = create_app(ProdConfig) assert app.config['ENV'] == 'prod' assert app.config['DEBUG'] is False assert app.co...
# PRD environment setting # Flask-NegLog Settings LOG_LEVEL = 'debug' LOG_FILENAME = "/var/camel/error.log" LOG_ENABLE_CONSOLE = False
from gensim.models import Word2Vec from sklearn.decomposition import PCA from matplotlib import pyplot import string import fnmatch # define training data #sentences = open('new_file_sentence.txt', 'r', encoding='utf-8') path = 'predictions_v11_1500_clean.txt' output_file = open("predictions_v11_500.txt", "w") input...
# -*- coding: utf-8 -*- import re import csv from elizabeth.core.providers import Structured from unittest import TestCase from elizabeth.core import interdata as common from ._patterns import STR_REGEX class StructuredBaseTest(TestCase): def setUp(self): self.structured = Structured('en') def tear...
from django.db import models class WorkflowManager(models.Manager): def launch_for(self, document): for workflow in document.document_type.workflows.all(): workflow.launch_for(document)
import sys import os import pytest import mock from keras.models import Sequential from keras.layers import Dense import sklearn.datasets as datasets import pandas as pd import numpy as np import yaml import tensorflow as tf import mlflow.pyfunc.scoring_server as pyfunc_scoring_server from mlflow import pyfunc from m...
(S'822675c38199b44f85699c1653abb0fc' p1 (ihappydoclib.parseinfo.moduleinfo ModuleInfo p2 (dp3 S'_namespaces' p4 ((dp5 S'FSA' p6 (ihappydoclib.parseinfo.classinfo ClassInfo p7 (dp8 g4 ((dp9 (dp10 S'nextStates' p11 (ihappydoclib.parseinfo.functioninfo FunctionInfo (dp12 g4 ((dp13 (dp14 tsS'_exception_info' p15 (dsS'_para...
#!/usr/bin/env python3 # Copyright (c) 2015-2017 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 bitcoind with different proxy configuration. Test plan: - Start nesteggd's with different proxy c...
# 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...
"""Calculates the Frechet Inception Distance (FID) to evalulate GANs The FID metric calculates the distance between two distributions of images. Typically, we have summary statistics (mean & covariance matrix) of one of these distributions, while the 2nd distribution is given by a GAN. When run as a stand-alone progr...
import procrunner def test(dials_data, tmp_path): mtz_file = dials_data("lysozyme_electron_diffraction").join("refmac_final.mtz") result = procrunner.run( ["dials.plot_Fo_vs_Fc", "hklin=" + mtz_file.strpath], working_directory=tmp_path ) assert not result.returncode and not result.stderr a...
#Создай собственный Шутер! from pygame import * dfgshfhsdljfvhs ssdkgvkshdv sdhvljsdhv sljgvksjdg
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import itertools imp...
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries # # SPDX-License-Identifier: MIT """ Slider Trinkey Hue Brightness Python Example (Requires Hue and Monitor Brightness CircuitPython example to be running on the Slider Trinkey) """ import sys from phue import Bridge import serial from serial.tools i...
"""Mira 2020.""" import functools import requests from flask import ( Blueprint, flash, g, redirect, render_template, request, session, url_for ) from werkzeug.security import check_password_hash, generate_password_hash BLUEPRINT = Blueprint('auth', __name__, url_prefix='/auth') @BLUEPRINT.route('/login', methods...
"""Device discovery functions for Zigbee Home Automation.""" from collections import Counter import logging from typing import Callable, List, Tuple from homeassistant import const as ha_const from homeassistant.core import callback from homeassistant.helpers.dispatcher import ( async_dispatcher_connect, asyn...
from matplotlib.cbook import iterable import matplotlib.pyplot as plt from matplotlib.testing.decorators import image_comparison import matplotlib.units as munits import numpy as np try: # mock in python 3.3+ from unittest.mock import MagicMock except ImportError: from mock import MagicMock # Basic class...
# -*- coding: utf-8 -*- # Copyright © 2019 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import turicreate as _tc import numpy as _np import time as _time from turicreate.t...
from __future__ import annotations from collections.abc import Iterable from reprlib import Repr from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set, Tuple, Type from uuid import UUID, uuid4 from restio.event import EventListener from restio.fields.base import Field, T_co from restio.shared imp...
# -*- coding: utf-8 -*- # Input data files are available in the "../input/" directory. # For example, running this (by clicking run or pressing Shift+Enter) will # list the files in the input directory from subprocess import check_output #print(check_output(["ls", "../input"]).decode("utf8")) #ORB is basically a fu...
import setuptools with open("README.md") as f: long_description = f.read() setuptools.setup( name='twarc-hashtags', version='0.0.5', url='https://github.com/docnow/twarc-hashtags', author='Ed Summers', author_email='ehs@pobox.com', py_modules=['twarc_hashtags'], description='A twarc pl...
import re regex_pattern = r'M{0,3}(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[VX]|V?I{0,3})$' print(str(bool(re.match(regex_pattern, input()))))
import MiniNero import ed25519 import binascii import PaperWallet import cherrypy import os import time import bitmonerod import SimpleXMR2 lasttime = 0 def HexSigningPubKey(s): return binascii.hexlify(ed25519.publickey(ed25519.encodeint(MiniNero.hexToInt(s)))) def Signature(m, sk): #note this seems to return ni...
import dvc.logger as logger from dvc.command.base import CmdBase from dvc.exceptions import DvcException class CmdRun(CmdBase): def _joined_cmd(self): if len(self.args.command) == 0: return '' if len(self.args.command) == 1: return self.args.command[0] cmd = '' ...
#!/usr/bin/env python import sys import string from collections import defaultdict def freq(iterable): """ Returns a dictionary of counts for each item in an iterable. >>>freq("ACGTTTAAA") {'A': 4, 'C': 1, 'G': 1, 'T': 3} """ ret = defaultdict(int) for el in iterable: ret[el] += 1 ...
# DExTer : Debugging Experience Tester # ~~~~~~ ~ ~~ ~ ~~ # # Copyright (c) 2018 by SN Systems Ltd., Sony Interactive Entertainment Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # ...
# -*- coding: utf-8 -*- # # 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 #...
#/usr/bin/env python from pygg import * import pandas from sqlalchemy import create_engine from tempfile import mkstemp import sys, os resfname='fig8.csv' res = pandas.read_csv(resfname) """ t = theme(axis.line=element_blank(), axis.text.x=element_blank(), axis.text.y=element_blank(), ...
# [LICENSE] # Copyright (c) 2018, Alliance for Sustainable Energy. # All rights reserved. # # Redistribution and use in source and binary forms, # with or without modification, are permitted provided # that the following conditions are met: # # 1. Redistributions of source code must retain the above # copyright no...
# ----------------------------------------------------------------------------------- # <copyright company="Aspose" file="test_table.py"> # Copyright (c) 2020 Aspose.Words for Cloud # </copyright> # <summary> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and asso...
import io from os.path import abspath, dirname, join from setuptools import find_packages, setup HERE = dirname(abspath(__file__)) LOAD_TEXT = lambda name: io.open(join(HERE, name), encoding='UTF-8').read() DESCRIPTION = '\n\n'.join(LOAD_TEXT(_) for _ in [ 'README.rst' ]) setup( name = 'pichetprofile', ...
#Libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set_style('whitegrid') from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.calibration import Calib...
import gaopt from gaopt import search_space import pandas as pd import numpy as np import lightgbm as lgb from sklearn.model_selection import train_test_split from sklearn.metrics import r2_score from sklearn.datasets import load_diabetes params_range={ 'lambda_l1': search_space.discrete_int(-8, 2), 'lambda_...
import _plotly_utils.basevalidators class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name='tickfont', parent_name='contour.colorbar', **kwargs ): super(TickfontValidator, self).__init__( plotly_name=plotly_name, parent...
#! /usr/bin/env python # # This script is used to generate the files src/utils/syscalls{32,64}.cpp. # As the list of syscalls depends of your Kernel version. We must # generate the list at the compile time. # from __future__ import print_function import argparse import sys import re import platform HEADER = """ /*! ...
import asyncio import tempfile from decimal import Decimal import os from contextlib import contextmanager from collections import defaultdict import logging import concurrent from concurrent import futures import unittest from aiorpcx import TaskGroup from electrum_ltc import constants from electrum_ltc.network impo...
import tkinter import tkintermapview # create tkinter window root_tk = tkinter.Tk() root_tk.geometry(f"{1000}x{700}") root_tk.title("map_view_simple_example.py") # create map widget map_widget = tkintermapview.TkinterMapView(root_tk, width=1000, height=700, corner_radius=0) map_widget.pack(fill="both", expand=True) ...
#!/usr/bin/env python import argparse import subprocess import iotools as io import obtools as ob import qctools as qc import tctools as tc try: _runserial = False from scoop import futures from scoop import utils except: _runserial = True print "No scoop, no concurency \n Running in serial mode......
import http.client import os import json import wget import mapping_functions import pprint import sys HOST = 'episteme2.scc.kit.edu' PORT = '8080' URL = os.path.join('http://' + HOST + ':' + PORT, 'api/v1/dataresources') output_folder = sys.argv[1] payload = "{\n \t\"resourceType\": {\n \t\t\"typeGeneral\":\"TEXT\"...
from rest_framework import serializers from profiles_api import models class UserProfileSerializer(serializers.ModelSerializer): """serializes a user profile object""" class Meta: model = models.UserProfile fields = ('id', 'name', 'email', 'password') extra_kwargs = { 'pas...
def a(z, b): print(z + b) a(0, 0.0) a('e', '')
import warnings from typing import Union, Iterable, TextIO, Dict, Optional import numpy as np from ...clients.base import InputType, CallbackFnType from ...enums import DataInputType from ...helper import deprecated_alias class AsyncCRUDFlowMixin: """The asynchronous version of the Mixin for CRUD in Flow""" ...
import pytest from galaxy.tool_util.lint import LintContext from galaxy.tool_util.linters import inputs from galaxy.util import etree NO_SECTIONS_XML = """ <tool name="BWA Mapper" id="bwa" version="1.0.1" is_multi_byte="true" display_interface="true" require_login="true" hidden="true"> <description>The BWA Mappe...
# # The Python Imaging Library # $Id$ # # Adobe PSD 2.5/3.0 file handling # # History: # 1995-09-01 fl Created # 1997-01-03 fl Read most PSD images # 1997-01-18 fl Fixed P and CMYK support # 2001-10-21 fl Added seek/tell support (for layers) # # Copyright (c) 1997-2001 by Secret Labs AB. # Copyright (c) 1995-20...
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
class Color: WHITE = (255, 255, 255) BLACK = (0, 0, 0 ) GRAY = (100, 100, 100) RED = (220, 20, 60 ) GREEN = (50, 205, 50 ) YELLOW = (255, 255, 0 ) PURPLE = (218, 112, 214) ALL = [WHITE, BLACK, GRAY, RED, GREEN] # just for printing colors in terminal class bcolo...
# Copyright (c) SenseTime. All Rights Reserved. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import logging import sys import os import cv2 import numpy as np from torch.utils.data import Dataset from...
# coding: utf-8 # 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...
# Copyright 2018 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# -*- coding: utf-8 -*- # (c) Copyright 2020 Sensirion AG, Switzerland ############################################################################## ############################################################################## # _____ _ _ _______ _____ ____ _ _ # / ____| ...
# Generated by Django 3.0.4 on 2021-02-11 21:05 from django.db import migrations import martor.models class Migration(migrations.Migration): dependencies = [ ('tutorials', '0030_auto_20200408_1257'), ] operations = [ migrations.AlterField( model_name='historicalsoftware', ...
#!/usr/bin/env python import sys import argparse import logging from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio.SeqFeature import SeqFeature, FeatureLocation logging.basicConfig(level=logging.INFO) log = logging.getLogger() def get_id(feature=None, parent_prefix=None): r...
import argparse import os import warnings import mmcv import torch from mmcv import Config, DictAction from mmcv.cnn import fuse_conv_bn from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import get_dist_info, init_dist, load_checkpoint from mmcv.runner import (HOOKS, DistSamplerSeedH...
from __future__ import annotations import unittest from datetime import date, datetime from cl_sii.dte.data_models import DteDataL1, DteXmlData from cl_sii.dte.constants import TipoDteEnum from cl_sii.dte.parse import DTE_XMLNS from cl_sii.libs import encoding_utils from cl_sii.libs import tz_utils from cl_sii.libs i...
#!/usr/bin/env python # Import modules import matplotlib.colors import matplotlib.pyplot as plt import numpy as np import sklearn from sklearn.preprocessing import LabelEncoder import pickle from sensor_stick.srv import GetNormals from sensor_stick.features import compute_color_histograms from sensor_stick.features im...
from aiocloudflare.commons.auth import Auth class Import_(Auth): _endpoint1 = "zones" _endpoint2 = "dns_records/import" _endpoint3 = None
#!/usr/bin/env python import rospy from geometry_msgs.msg import Twist from sensor_msgs.msg import LaserScan def callback(msg): L,M,R = msg.ranges[719],msg.ranges[360],msg.ranges[0] move.linear.x = .2 if M < 1.2: move.linear.x = .05 move.angular.z = .1 elif L > 30 and R > 30 and M > 30:...
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.constant.ParamConstants import * class KoubeiSalesKbassetStuffProduceqrcodeBatchqueryModel(object): def __init__(self): self._batch_id = None self._page_size = None self._produce_order_id = None ...
from datetime import timedelta import pytest from feast import PushSource from feast.batch_feature_view import BatchFeatureView from feast.data_format import AvroFormat from feast.data_source import KafkaSource from feast.infra.offline_stores.file_source import FileSource from feast.stream_feature_view import StreamF...
# -*- coding: utf-8 -*- # Copyright (C) 2005 Michael Urman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. import wa...
"""Example Extorter, useful as a starting point""" import typing import logging import dataclasses import datetime # 3rdparty import slugify # We use ibflex from ibflex import parser, FlexStatement, CashAction from coolbeans.extort.base import ExtortionProtocol from coolbeans.tools.seeds import Trade, Transfer, E...
#!/usr/bin/env python3 import asyncio import random import matplotlib.pyplot as plt import pathmagic with pathmagic.context(): from Simulator import Simulator from MissionPlanner import MissionPlanner if __name__ == "__main__": # define the world map_width_meter = 25.0 map_height_meter = 25.0 ...
# # Copyright(c) 2019-2020 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause-Clear # import random from itertools import permutations import pytest from api.cas.ioclass_config import IoClass from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan from test_tools import fs_utils from test_to...
from abc import ABC def route(rule, **options): """Decorator for defining routes of FlaskController classes. Acts in the same way ass @app.route. Can be used for a class to set a base route too. Args: path (str): The path of the newly defined route options: refer to flasks docs for t...
# Torch from torch.jit.annotations import BroadcastingList2, BroadcastingList3 # noqa: F401 from torch.testing._internal.common_methods_invocations import non_differentiable, create_input, \ unpack_variables import torch.nn.functional as F import torch import torch.cuda import torch.jit import torch.jit._logging i...
import sys import setuptools requires = [ 'requests>=2.19.1', 'backoff>=1.6.0', 'flatten_dict>=0.3.0' ] tests_require = [] extras_require = {} setuptools.setup( name='hedera-python-client', description='Python API client for Hedera Hashgraph.', version='0.0.1', author='TBD', author...
#!/usr/bin/python # Copyright (c) 2020, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
#!/usr/bin/env python3 import tensorflow_hub as hub import numpy as np import tensorflow_text import json, re, os from threading import Thread from keywords import keywords embeddings = {} embed = None def loadModelData(): ''' Loads Tensorflow enconder and pre-encodes the problem data ''' global embed ...
#!/usr/bin/env python from pyspark.sql import SparkSession from pyspark.sql.functions import col, window, asc, desc, lead, lag, udf, hour from pyspark.sql.functions import month, year, lit, when, collect_list, struct, mean, stddev, stddev_pop import pyspark.sql.functions as F from pyspark.sql.window import Window from ...
from abc import ABC, abstractmethod from contextlib import contextmanager import socket import time from lightlab import visalogger as logger from rvisa.util import from_ascii_block class InstrumentSessionBase(ABC): ''' Base class for Instrument sessions, to be inherited and specialized by VISAObject and Prol...
#!/usr/bin/env python3 # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. """ADO user API wrapper.""" import logging from typing import cast from simple_ado.base_client import ADOBaseClient from simple_ado.context import ADOContext from simple_ado.exceptions import ADOException from simple_ado...
from django.apps import AppConfig class ControllerConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'controller'
import numpy as np import itk import matplotlib.pyplot as plt # Input file name input_filename = './jenga_g_150.png' # Set dimension Dimension = 2 # Read input image itk_image = itk.imread(input_filename) # Setting for input image (Grayscale) InputPixelType = itk.UC InputImageType = itk.Image[InputPixelType, Dimens...
# -*- coding: utf-8 -*- # Upside Travel, 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...
"""Keras implementation of SSD.""" import keras.backend as K from keras.layers import Activation from keras.layers import AtrousConvolution2D from keras.layers import Convolution2D from keras.layers import Dense from keras.layers import Flatten from keras.layers import GlobalAveragePooling2D from keras.layers import I...
# This file is autogenerated. Do not edit it manually. # If you want change the content of this file, edit # # spec/fixtures/responses/whois.nic.ve/property_nameservers_missing # # and regenerate the tests with the following script # # $ scripts/generate_tests.py # from nose.tools import * from dateutil.parser imp...
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from dataclasses import dataclass from typing import Tuple from pants.backend.python.lint.pylint.subsystem import ( Pylint, PylintFieldSet, ...
"""Media Player component to integrate TVs exposing the Joint Space API.""" from datetime import timedelta import logging from haphilipsjs import PhilipsTV import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.components.media_player.const imp...
import os import logging import subprocess import yaml import pandas as pd from .example_filetype_format import FileTypeFormat from . import process_functions logger = logging.getLogger(__name__) class Assayinfo(FileTypeFormat): ''' Assay information file type ''' _fileType = "assayinfo" _proc...
import argparse import pandas as pd import json import pickle import numpy as np from pathlib import Path from scipy.special import softmax import shutil parser = argparse.ArgumentParser() parser.add_argument('--config', type=str) parser.add_argument('--raw_result_dir', type=str) parser.add_argument('--output_dir', ty...
# Python3 def diffOne(a, b): count = 0 for i in range(len(a)): if a[i] != b[i]: count += 1 if count == 2: return False return bool(count) def func(inputArray, curr): if len(inputArray) == 1: return diffOne(inputArray[0], curr) for i in range(len(inpu...
from setuptools import setup, Extension import numpy import os import config def find(name, path): for root, dirs, files in os.walk(path): if name in files: return os.path.join(root, name) return ''; print('locating directories...') defines = [ ('MAJOR_VERSION',0),('MINOR_VERSION',1) ...
from emojitations.emojitypes import EmojiAnnotations emoji = [ EmojiAnnotations(emoji='😀', codepoints=(128512,), name='ծիծաղող դեմք', slug='ծիծաղող_դեմք', annotations=frozenset({'դեմք', 'քմծիծաղել'})), EmojiAnnotations(emoji='😁', codepoints=(128513,), name='ծիծաղող դեմք ժպտացող աչքերով', slug='ծիծաղող_դեմք_ժպտացո...
from ._types import array def abs(x: array, /) -> array: """ Calculates the absolute value for each element ``x_i`` of the input array ``x`` (i.e., the element-wise result has the same magnitude as the respective element in ``x`` but has positive sign). .. note:: For signed integer data types, the ...
from ipykernel.kernelapp import IPKernelApp from .CWLKernel import CWLKernel IPKernelApp.launch_instance(kernel_class=CWLKernel)
import argparse import time import numpy as np import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import torch.utils.data.distributed import torchvision.transforms as transforms import resnet_multigpu_cgc as resnet import cv2 import datasets as pointing_d...
global_var = 10 def function_example(local_var_1, local_var_2): print(local_var_1, local_var_2, global_var) function_example(11, 12) def function_example_1(local_var_1, local_var_2): global global_var global_var = 20 print(local_var_1, local_var_2, global_var, id(global_var)) function_example_1(11...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['None'] , ['MovingAverage'] , ['Seasonal_Second'] , ['MLP'] );
"""Utilities for making unittests easier to write.""" # pylint: disable=protected-access import asyncio import os import queue from typing import Dict, List, Optional, Union from ibapi import wrapper from ibpy_native import error from ibpy_native import models from ibpy_native.interfaces import delegates from ibpy_na...
#!/usr/bin/env python3 # date: 2019.08.06 # https://stackoverflow.com/questions/57366488/how-to-pass-the-single-link-in-a-nested-url-scrape import scrapy from scrapy.loader import ItemLoader from scrapy.loader.processors import MapCompose def clean(text): text = text.replace('\xa0', ' ') text = text.strip()....