text
stringlengths
1
927k
""" pygments.lexers.asc ~~~~~~~~~~~~~~~~~~~ Lexer for various ASCII armored files. :copyright: Copyright 2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups from pygments.token import Comment, Generic, Name,...
from src import configs import pandas as pd import numpy as np # creates player instances from predefined options def player_factory(player_type, capital): if player_type == 'basic': return BasicPlayer(init_capital=capital) elif player_type == 'strategic': return StrategicPlayer(init_capital=c...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_str, compat_HTTPError, ) from ..utils import ( qualities, strip_or_none, int_or_none, ExtractorError, ) class FilmOnIE(InfoExtractor): IE_NAME = 'filmon' _VALID_URL ...
# Generated by Django 2.0.8 on 2019-03-19 11:53 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('home', '0005_auto_20190311_0832'), ('home', '0005_auto_20190315_0947'), ] operations = [ ]
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: LogHandler.py Description : 日志操作模块 Author : JHao date: 2017/3/6 ------------------------------------------------- Change Activity: 2017/3/6: log handler 2017/...
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' 1197. Lonesome Knight Time limit: 1.0 second Memory limit: 64 MB [Description] The statement of this problem is very simple: you are to determine how many squares of the chessboard can be attacked by a knight standing alone on the board. Recall that a knight moves two squ...
from genetic import Genetic genetic = Genetic() genetic.generation_gen() def normalize(datas, max_height, max_width): def compute(val, max, min): return (val - min) / max - min for data in datas: data.rocket_top = compute(data.rocket_top, max_height, 0) data.wall_left = compute(data.wall_lef...
import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Wedge import mpl_toolkits.mplot3d as a3 import matplotlib.colors as colors import pylab as pl import scipy as sp import math rigx = 0.5 rigy = 0.5 rigz = 0.0 cent = (rigx, rigy, rigz) radius = 0.5 cam_info = {"FOV pan": 0, # degrees ...
# License: Apache 2.0. See LICENSE file in root directory. # Copyright(c) 2020 Intel Corporation. All Rights Reserved. import platform import pyrealsense2 as rs from rspy import test import time dev = test.find_first_device_or_exit() depth_sensor = dev.first_depth_sensor() color_sensor = dev.first_color_sensor() pre...
#!/usr/bin/env python2 import os import subprocess # Custom modules from helpers import formatted_text def execute_command(cmd, stdout=None, stderr=None): # To wait on the standard output or the error output, # set either 'stdout' or 'stderr' to a value of 'subprocess.PIPE' print "Executing command: {0}...
#!/usr/bin/python3 import tensorflow as tf import numpy as np import pandas as pd import time, os, sys import argparse # User-defined from network import Network from utils import Utils from data import Data from model import Model from config import config_test, directories tf.logging.set_verbosity(tf.logging.ERROR)...
import argparse import os import numpy as np import pickle from PIL import Image from tqdm import tqdm import imageio from multiprocessing import Pool parser = argparse.ArgumentParser(description="Generate label stat info") parser.add_argument("-d", "--datadir", default="", help="path to load ...
import torch import numpy as np import time import matplotlib.pyplot as plt import os import h5py from load_vel import overthrust_model from generator import generator from tqdm import tqdm from scipy.interpolate import interp1d import matplotlib.ticker as ticker sfmt=ticker.ScalarFormatter(useMathText=True) sfmt.set_...
class Artist(object): def __init__(self, artist_uid: str, artist_name: str, artist_description: str = ""): self.artist_uid: str = artist_uid self.artist_name: str = artist_name self.artist_description: str = artist_description
# Based and improved from https://github.com/piratecrew/rez-gcc name = "gcc" version = "6.3.1" authors = [ "GNU" ] description = \ """ The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU to...
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc from __future__ import unicode_literals from snapshottest import Snapshot snapshots = Snapshot() snapshots['test_successful_pipeline_reexecution 1'] = { 'startPipelineExecution': { '__typename': 'StartPipelineExecutionSuccess', '...
from tkinter import Tk, Frame, Toplevel, Entry, Button, Text, Scrollbar, END, INSERT from tkinter.messagebox import showerror from mediawiki import MediaWiki wikipedia = MediaWiki() # Function to get summary using wikipedia module and display it def get_summary(): try: # clear text area answer.de...
from ROAR.agent_module.agent import Agent from ROAR.utilities_module.data_structures_models import SensorsData from ROAR.utilities_module.vehicle_models import Vehicle, VehicleControl from ROAR.perception_module.legacy.ground_plane_point_cloud_detector import GroundPlanePointCloudDetector from ROAR.visualization_module...
"""Solid definitions for the simple_pyspark example.""" import dagster_pyspark from pyspark.sql import DataFrame, Window from pyspark.sql import functions as f from dagster import make_python_type_usable_as_dagster_type, solid # Make pyspark.sql.DataFrame map to dagster_pyspark.DataFrame make_python_type_usable_as_d...
#encoding=utf8 #包里面可以调用的模块,默认是调用所有的模块 __all__=["m1","m2"]
# Generated by Django 4.0.3 on 2022-03-20 06:26 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('inadimplentes', '0005_alter_inquilino_ultimo_pagamento'), ] operations = [ migrations.DeleteModel( name='Kitnet', ), ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 7 12:02:45 2017 @authors: lwk, RH """ from datetime import datetime import os import sys import numpy as np import tensorflow as tf import vgg slim = tf.contrib.slim class INCEPTION(): """ Use the InceptionV3 architecture """ ...
# 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 ...
"""Support for Sky Hub.""" import logging import re import requests import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA, DeviceScanner, ) from homeassistant.const import CONF_HOST import homeassistant.helpers.config_validation as cv _LOGGER = logging.get...
# This code is part of Qiskit. # # (C) Copyright IBM 2017. # # 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 derivative wo...
from flask import Flask, request, session from twilio.twiml.messaging_response import MessagingResponse # The session object makes use of a secret key. SECRET_KEY = 'a secret key' app = Flask(__name__) app.config.from_object(__name__) # Try adding your own number to this list! callers = { "+14158675309": "Rey", ...
#!/usr/bin/env python # # 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 requir...
# coding=utf-8 from tests import box_data from wecube_plugins_itsdangerous.apps.processor import api def test(): data = { 'serviceName': 'qcloud/vm(resource)/action', 'inputParams': { 'name': 'destroy' }, # , 'script_type': 'shell' 'scripts': [{'content': box_data.scr...
# Examples from: # "CarHackersHandbook" by Craig Smith (UDS scan) (page 55) # "Adventures in Automotive Networks and Control Units" by Charlie Miller and Chris Valasek # # Load needed modules modules = { 'io/hw_USBtin': {'port': 'auto', 'debug': 1, 'speed': 500}, # IO hardware modu...
# Copyright 2015 Mirantis 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...
import operator from aiogram_dialog import ChatEvent, DialogManager from aiogram_dialog.widgets.kbd import Select from aiogram_dialog.widgets.text import Format # let's assume this is our window data getter async def get_data(**kwargs): fruits = [ ("Apple", '1'), ("Pear", '2'), ("Orange",...
# -*- coding: utf-8 -*- """ Created on Tue Mar 19 09:02:55 2019 @author: 67135099 """ ##reads all the files in the current working directory, make sure only input files are in folde import os #import numpy as np os.chdir(r"D:/DWD_overseas_subdy/data_pacific/") files = [ f for f in os.listdir( os.curdir ) if os.p...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # from kubernetes_py.models.v1.PersistentVolumeClaim import PersistentVolumeClaim from kubernetes_py.models.v1.PodTemplateSpec import PodTemplat...
""" CNTK function constructs. This is the core abstraction of all primitive operators in the CNTK computational graph. """ from os import path from enum import Enum, unique import sys import warnings import collections import cntk from cntk import cntk_py, Value from cntk.device import DeviceDescriptor, cpu from cnt...
import unittest import servertest import testutils import os, sys, threading, time import dxapi from sys import version_info testdir = os.path.dirname(__file__) if testdir != "": testdir = testdir + '/' class TestMultithreaded(servertest.TestWithStreams): def test_NextIfAvailableWithLoader(self): re...
class FrameworkElementAutomationPeer(UIElementAutomationPeer): """ Exposes System.Windows.FrameworkElement types to UI Automation. FrameworkElementAutomationPeer(owner: FrameworkElement) """ @staticmethod def __new__(self,owner): """ __new__(cls: type,owner: FrameworkElement) """ pass IsHwndHost=property...
# -*- coding: utf-8 -*- """DNACenterAPI Non-Fabric Wireless API fixtures and tests. Copyright (c) 2019 Cisco and/or its affiliates. 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 restric...
# Class to set up the MIP, solve it and write the results into a csv file (a copy of the DraftKings salary file) import csv from pulp import * from src.Data_processing import Data class Optimiser: def __init__(self, salary, projection, output): self.salary = salary self.projection = projection ...
""" To understand why this file is here, please read: http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django """ from django.conf import settings from django.db import migrations def update_site_forward(apps, schema_editor): """Set site d...
from .valueType import ValueType, ValueSubType class State: def __init__(self, name, ise_id, datapoints): self.name = name self.ise_id = ise_id self.datapoints = datapoints def __str__(self): return self.tostring() def get_name(self): return self.name def get...
from math import pi, sin, cos import numpy as np from dvoc_model.reference_frames import SinCos, Abc, Dq0, AlphaBeta from dvoc_model.constants import * from dvoc_model.simulate import simulate, shift_controller_angle_half from dvoc_model.elements import Node, RefFrames from dvoc_model.calculations import calculate_pow...
""" PERIODS """ numPeriods = 60 """ STOPS """ numStations = 6 station_names = ( "Hamburg Hbf", # 0 "Landwehr", # 1 "Hasselbrook", # 2 "Wansbeker Chaussee*", # 3 "Friedrichsberg*", # 4 "Barmbek*", # 5 ) numStops = 12 stops_position = ( (0, 0), # Stop 0 (2, 0), # Stop 1 (3, 0), # Stop 2 (4, 0), # S...
import homeassistant.helpers.config_validation as cv import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.const import CONF_ENTITY_ID, CONF_OFFSET, CONF_REPEAT DOMAIN = "spotcast" CONF_SPOTIFY_DEVICE_ID = "spotify_device_id" CONF_DEVICE_NAME = "device_name" CONF_SPOTIFY_URI =...
""" Django settings for edison_note project. Generated by 'django-admin startproject' using Django 3.0.2. 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 o...
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from de...
''' A data generator for 2D object detection. Copyright (C) 2018 Pierluigi Ferrari 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...
import pandas as pd import numpy as np from qc_time_estimator.config import config from qc_time_estimator.processing.data_management import load_pipeline from qc_time_estimator.processing.validation import validate_inputs from qc_time_estimator.metrics import mape, percentile_rel_90 from qc_time_estimator import __vers...
""" Utility evaluator. Comparing a reference dataset to 1 or more target datasets. """ import numpy as np import pandas as pd import matplotlib.pyplot as plt from pathlib import Path import synthesis.evaluation.metrics as metrics from synthesis.evaluation._base import BaseMetric, COLOR_PALETTE DEFAULT_METRICS = { ...
import subprocess site_url = 'http://www.rolfny.com' get_osInfo = subprocess.Popen(["python3.5","/var/www/py/armoredware.com/infosec/blackops/wig.py","-u",site_url,"&"],stdout = subprocess.PIPE,stderr = subprocess.PIPE) osInfo = get_osInfo.communicate()[0] p_status = get_osInfo.wait() print( osInfo)
import pytorch_lightning as pl import pytorch_lightning.callbacks class ResetOptimizers(pl.Callback): def __init__(self, verbose: bool, epoch_reset_field: str = "pretrain_epochs"): super().__init__() self.verbose = verbose self.epoch_reset_field= epoch_reset_field def on_train_epoch_en...
class Solution: def XXX(self, s: str) -> bool: i=0 j = len(s)-1 #lower()把所有大写字母改成小写,其余不变 s = s.lower() while i<j: while not(97 <= ord(s[i]) <= 122 or 48 <= ord(s[i]) <= 57): if i == j: return True i += 1 ...
# -*- coding: utf-8 -*- """ State to manage monitoring in Zenoss. .. versionadded:: 2016.3.0 This state module depends on the 'zenoss' Salt execution module. Allows for setting a state of minions in Zenoss using the Zenoss API. Currently Zenoss 4.x and 5.x are supported. .. code-block:: yaml enable_monitoring:...
import logging import os from pathlib import ( Path, ) import socket import sys import threading from web3._utils.threads import ( Timeout, ) from .base import ( JSONBaseProvider, ) try: from json import JSONDecodeError except ImportError: JSONDecodeError = ValueError def get_ipc_socket(ipc_pat...
# -*- coding: utf-8 -*- import os os.environ['OMP_NUM_THREADS'] = '1' import sys import math import random import shutil import pickle import logging import torch import torch.nn as nn import torch.optim as optim import torch.optim.lr_scheduler as lr_scheduler import torchvision.models as models import numpy as np fro...
import numpy as np POP_SIZE = 50 MAX_GEN = 1 DIM_SIZE = 3 ALPHA = 1.0 BETA0 = 0.5 GAMMA = 1.0 BOUND = 1000 UB = BOUND LB = -BOUND BUILDING = [20, 50, 200] #b1 # BUILDING = [20, 50, 250] #b2 # BUILDING =...
#!/usr/bin/env python3 # encoding: utf-8 """ uai2problog.py http://graphmod.ics.uci.edu/uai08/FileFormat Created by Wannes Meert on 31-01-2016. Copyright (c) 2016 KU Leuven. All rights reserved. """ import sys import os import argparse import itertools import logging from bn2problog import BNParser sys.path.append(...
from django.db import models from datetime import datetime from django.conf import settings from django.template.defaultfilters import slugify # Create your models here. class Category(models.Model): """ Model representation for blog post categpries.""" id = models.AutoField(primary_key=True) name = model...
# -*- coding: utf-8 -*- """Utilities for safely pickling exceptions.""" from __future__ import absolute_import, unicode_literals import datetime import numbers import sys from base64 import b64decode as base64decode from base64 import b64encode as base64encode from functools import partial from inspect import getmro f...
import bs4 html_str = """ <html> <body> <ul class="ko"> <li> <a href="https://www.naver.com/">네이버</a> </li> <li> <a href="https://www.daum.net/">다음</a> </li> </ul> <ul class="sns"> <li> ...
import numpy as np from numpy import linalg as LA def calc_minimizer_sog(point, p, sigma_sq, store_x0, matrix_test, store_c): """ Finds the nearest local minimizer for point using the Sum of Gaussians function. Parameters ---------- point : 1-D array with shape (d, ) A point used ...
#!/usr/bin/env python # Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google 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/LICEN...
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
# Copyright 2021 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...
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages import os with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [] with open('requirements.txt') as f: for line ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 5/15/20 4:49 PM # @File : grover.py # qubit number=2 # total number=20 import cirq import cirq.google as cg from typing import Optional import sys from math import log2 import numpy as np #thatsNoCode from cirq.contrib.svg import SVGCircuit # Symbols for...
from commands import add def run(keyConfig, message, totalResults=1): try: es = add.CommandsValue.query().fetch() available_commands = [] if len(es) > 0: for mod in es: available_commands.append(str(mod.key._Key__pairs[0][1])) return "I know:\n" + "\n".j...
from .c_attack_evasion import CAttackEvasion from .c_attack_evasion_pgd_ls import CAttackEvasionPGDLS from .c_attack_evasion_pgd_exp import CAttackEvasionPGDExp from .c_attack_evasion_pgd import CAttackEvasionPGD try: import cleverhans except ImportError: pass # cleverhans is an extra component else: from...
""" CHANGE LOG: Ver : 0.1 >> 20th December 2020 >> Added hover over widget feature >> Added comments in the code >> Added exclusive Zero Division Error output >> Entry Widget Screen font made significantly smaller for better looks >> Reduced Lot of unnecessary code """ from tkinter import * from PIL import Image, Ima...
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import matplotlib.collections import matplotlib.path as mpp import matplotlib.patches as patches import matplotlib as mpl import matplotlib.tri as tri try: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas ...
# -*- 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 "Lic...
# -*- coding: utf-8 -*- """ Code from the paper "Temporal Information Extraction by Predicting Relative Time-lines" by Artuur Leeuwenberg & Marie-Francine Moens, In Proceedings of EMNLP, Brussels, Belgium, 2018. Used to build relative time-lines from TimeML data (TL2RTL). """ import argparse, sys, os, shutil, torch, p...
''' An interactive plot of the ``sin`` function. This example demonstrates adding widgets and ``CustomJS`` callbacks that can update a plot. .. bokeh-example-metadata:: :apis: bokeh.plotting.Figure.line, bokeh.layouts.column, bokeh.layouts.row, bokeh.models.callbacks.CustomJS, bokeh.models.widgets.sliders.Slider ...
import json import logging class RunnerException(Exception): pass class AggregatedList: def __init__(self): self._dict = {} def add(self, params, new_items): params_hash = self.hash_params(params) if self._dict.get(params_hash) is None: self._dict[params_hash] = {"p...
import logging from typing import List, Optional import json from fastapi import APIRouter, Depends, HTTPException from starlette import status from pydantic import BaseModel from sqlalchemy.ext.asyncio import AsyncSession from api.endpoints.dependencies.db import get_db from api.endpoints.models.connections import (...
import enum class Omittable: def __init__(self): self.err_msg = None class Permission(enum.Enum): OWNER = '@owner' ACTIVE = '@active' class Key(Omittable): '''Having the ``name`` and 'Key' attributes. ''' def __init__(self, name, key_public, key_private): self.name = name...
import boto import os import re import urllib.parse from boto.s3 import connection from wal_e import log_help from wal_e.exception import UserException logger = log_help.WalELogger(__name__) _S3_REGIONS = { # See http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region 'ap-northeast-1': 's3.ap-north...
#!/usr/bin/env runaiida # -*- coding: utf-8 -*- from delete_nodes import delete_nodes_serial from aiida.common.links import LinkType from aiida.orm import load_node, Node from aiida.orm.calculation.chillstep import ChillstepCalculation from aiida.orm.querybuilder import QueryBuilder from aiida.orm.calculation import C...
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='Clients of a wholesale distributor.', author='Peter Myers', license='MIT', )
# # PySNMP MIB module BLADETYPE2-ACL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BLADETYPE2-ACL-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:22:06 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, ...
#!/usr/bin/python3 """Filter out input lines that have embedded spaces or quotes. Read std input, filter out any line with embedded spaces or quotes. Intended to screen out things that could cause problems with "ctags". """ import re import sys import script_utils as u # Setup u.setdeflanglocale() match1 = re.co...
a = 0 b = 1 c = 0 A = 0 while c <= (4 * 1000*1000): c = a + b if c % 2 == 0: A = A + c a = b b = c print(A)
# # Author: Qiming Sun <osirpt.sun@gmail.com> # import unittest import numpy import scipy.linalg import tempfile from pyscf import gto from pyscf import scf from pyscf import fci class KnowValues(unittest.TestCase): def test_davidson(self): mol = gto.Mole() mol.verbose = 0 mol.atom = [['H'...
import pandas as pd import pyspark as ps import regex as re import toolz from pkg_resources import parse_version import ibis.common.exceptions as com import ibis.expr.datatypes as dt import ibis.expr.lineage as lin import ibis.expr.operations as ops import ibis.expr.schema as sch import ibis.expr.types as ir from ibis...
"""Linked nodes in both direction""" class DoublyLinkedNode: """Represents doubly linked list of nodes from a doubly linked list""" def __init__(self, list_in, next_node=None, previous_node=None, value=None): self.next_node = next_no...
# SPDX-FileCopyrightText: Copyright (c) 2020 Bryan Siepert for Adafruit Industries # # SPDX-License-Identifier: MIT """ This module provides the LSM6DSOX subclass of LSM6DS for using LSM6DSOX sensors. """ from . import LSM6DS, LSM6DS_DEFAULT_ADDRESS, LSM6DS_CHIP_ID class LSM6DSOX(LSM6DS): # pylint: disable=too-many-...
""" Distribution plot options ========================= """ import numpy as np import seaborn as sns import matplotlib.pyplot as plt avgArr0 = [684.0322959592726, 884.7363009861817, 888.8322884189091, 942.080300986182, 970.7522934458182, 991.2322959592727, 991.2323009861818, 1011.712300986182, 1036.288295959273, 104...
# Payment Choices # ------------------------------ PAYMENT_BIZUM = "BIZUM" PAYMENT_TRANSFER = "TRANSFER" PAYMENT_CASH = "CASH" PAYMENT_CARD = "CARD" PAYMENT_WEB = "WEB" PAYMENT_TYPES_CHOICE = [ (PAYMENT_BIZUM, 'Bizum'), (PAYMENT_TRANSFER, 'Transferencia'), (PAYMENT_CASH, 'Efectivo'), (PAYMENT_CARD, 'Ta...
# # from __future__ import absolute_import # from __future__ import division # from __future__ import print_function import random import torch import torch.nn.functional as F import torchvision.models as models from torch.autograd import Variable import numpy as np import torch.nn as nn from torch.autograd import Func...
from Base.Base import Base import Page ''' 首页操作 ''' class xx_course_Page(Base): def __init__(self, driver): Base.__init__(self, driver) def for_click_sy_element(self): """ 循环点击首页元素 :return: """ self.click_elements(Page.sy_login_lsit_fun(), 3) def click_sy...
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Eric Larson <larson.eric.d@gmail.com> # Joan Massich <mailsik@gmail.com> # # License: BSD (3-clause) import numpy as np from copy import deepcopy from collections import Counter from ..transforms import _coord_frame...
""" Analyze a range of dates for new and lost Firefox profiles. """ import healthreportutils from datetime import date, datetime, timedelta import os, shutil, csv import sys, codecs import traceback import mrjob from mrjob.job import MRJob import tempfile try: import simplejson as json except ImportError: im...
import os from glob import glob import numpy as np from matplotlib.pyplot import imread from sklearn.model_selection import train_test_split def load_notmnist( path="./notMNIST_small", letters="ABCDEFGHIJ", img_shape=(28, 28), test_size=0.25, one_hot=False ): # download data if it's missing. If you have any...
import os class FileInfo: def __init__(self, lines): self.features = lines[0].strip().split(',')[1:] self.data = {} self.file = lines[1].split(',')[0].split('_')[0] for line in lines[1:]: sl = line.split(',') v = {} for i in range(1, len(sl)): if 'NULL' in sl[i]: v...
from .test_helper import argv_kiwi_tests import sys import mock from mock import patch import logging import azurectl from azurectl.commands.base import CliTask from azure.servicemanagement.models import Operation from pytest import raises class TestCliTask: def teardown(self): sys.argv = argv_kiwi_tests ...
from django.contrib.auth import get_user_model, authenticate from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers class UserSerializer(serializers.ModelSerializer): '''Serializer for the users object''' class Meta: model = get_user_model() fields = ('email', 'password',...
import copy import time def on_part(irc, conn, event): nick = event.source.nick channel = event.target if len(event.arguments) > 0: reason = event.arguments[0] else: reason = "" if event.source.nick == irc.get_nick(): for user in copy.deepcopy(irc.state["users"]): ...
# Generated by Django 3.1.2 on 2021-03-03 14:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recipients', '0055_mealrequest_senior'), ] operations = [ migrations.AlterField( model_name='groceryrequest', name='...
import tensorflow as tf import utils import voting from pose_model import pose_create_model, compile_model from pose_data import load_split, get_AVA_set import time from keras import backend as K import numpy as np import pickle def main(): root_dir = '../../data/AVA/files/' # Load list of action classes an...
""" Cisco Intersight Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan...