text
stringlengths
2
999k
import info class subinfo(info.infoclass): def setTargets(self): for ver in ["1.4"]: self.targets[ver] = f"https://gitlab.freedesktop.org/vdpau/libvdpau/-/archive/{ver}/libvdpau-{ver}.tar.bz2" self.targetInstSrc[ ver ] = "libvdpau-" + ver self.targetDigests['1.4'] = (['42588...
import numpy as np from multiprocessing import Process, Pipe from drlhp.deprecated.a2c.common.vec_env import VecEnv def worker(remote, env_fn_wrapper): env = env_fn_wrapper.x() while True: cmd, data = remote.recv() if cmd == 'step': ob, reward, done, info = env.step(data) ...
# sorteando um item na lista from random import choice n1 = input('Primeiro aluno: ') n2 = input('Segundo aluno: ') n3 = input('Terceiro aluno: ') lista = [n1, n2, n3] escolhido = choice(lista) print('O aluno escolhido foi {}!'.format(escolhido))
""" Google Translate Available Commands: .tl LanguageCode as reply to a message .tl LangaugeCode | text to translate""" import emoji from googletrans import Translator from userbot.utils import admin_cmd @borg.on(admin_cmd("tl ?(.*)")) async def _(event): if event.fwd_from: return if "trim" in event....
""" Reading from the sensor is handled by the command line tool "gatttool" that is part of bluez on Linux. No other operating systems are supported at the moment """ from threading import current_thread import os import logging import re import time from typing import Callable from subprocess import Popen, PIPE, Timeo...
"""Generated client library for bigtableadmin version v2.""" # NOTE: This file is autogenerated and should not be edited by hand. from apitools.base.py import base_api from googlecloudsdk.third_party.apis.bigtableadmin.v2 import bigtableadmin_v2_messages as messages class BigtableadminV2(base_api.BaseApiClient): ""...
"""Tornado handlers for the notebook. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as p...
"""posts table Revision ID: 2de40401dd9c Revises: dbd8b3b5fbc6 Create Date: 2018-09-30 13:38:51.289812 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '2de40401dd9c' down_revision = 'dbd8b3b5fbc6' branch_labels = None depends_on = None def upgrade(): # ##...
from boucanpy.db.migrate.config import get_config # late import of alembic because it destroys loggers def upgrade(directory=None, revision="head", sql=False, tag=None, x_arg=None): from alembic import command """Upgrade to a later version""" config = get_config(directory, x_arg=x_arg) command.upgrade...
# Copyright (c) 2021-2022, InterDigital Communications, Inc # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted (subject to the limitations in the disclaimer # below) provided that the following conditions are met: # * Redistributions of source cod...
import sys import copy from collections import defaultdict input_lines = [line for line in open(sys.argv[1]).read().split('\n') if line != ''] grid = set() for y, line in enumerate(input_lines): for x, c in enumerate(input_lines[y]): if c == '#': grid.add((x, y, 0, 0)) def kill(grid, coord): cx, cy, cz, cw = c...
import os import sys import numpy assert numpy.__version__ == '1.12.1' has_mkl = not int(os.getenv('NOMKL', 0)) print('HAS MKL: %r' % has_mkl) mkl_version = getattr(numpy, '__mkl_version__', None) print('MKL VERSION: %s' % mkl_version) assert has_mkl == bool(mkl_version) import numpy.core.multiarray import numpy.cor...
import sublime import os import sys import time import json import traceback import threading from collections import OrderedDict try: str_cls = unicode except (NameError): str_cls = str PACKAGE_ROOT_DIRECTORY = os.path.dirname( os.path.dirname( os.path.realpath( __file__ ) ) ) CURRENT_PACKAGE_NAME = os....
import requests, json, logging, traceback def PushMessage(summary, content): url = "https://wxpusher.zjiecode.com/api/send/message" payload = { "appToken": "", "content": content, "summary": summary, "contentType": 1, "uids": [""] } payload = json.dump...
from setuptools import setup, find_packages with open("README.md") as f: long_description = f.read() setup( name="pdf_statement_reader", version="0.2.3", description="PDF Statement Reader", long_description=long_description, long_description_content_type="text/markdown", url="https://githu...
import numpy as np class PCA: def __init__(self, target_dimension = 3): self.target_dimension = target_dimension def process(self, features): self.features = features dots = self.features cov = np.cov(np.matrix(dots).T) eigenvalue, feature_vector = np.linalg.eig(cov) reduce_matrix = feature_vector[np...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2021 Riverbed Technology Inc. # The MIT License (MIT) (see https://opensource.org/licenses/MIT) DOCUMENTATION = """ --- module: create_ip_subnet_to_group_mapping short_description: Create a txt file from information extracted from a Netprofiler Hostgroup o...
#!/usr/bin/env python # # Use the raw transactions API to spend manos received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a manod or MANO-Qt r...
#!/usr/bin/env python #-*- coding: utf-8 -*- #/*########################################################################## # Copyright (C) 2016 K. Kummer, A. Tamborino, European Synchrotron Radiation # Facility # # This file is part of the ID32 RIXSToolBox developed at the ESRF by the ID32 # staff and the ESR...
import numpy as np from numpy.testing import assert_, assert_raises, assert_array_almost_equal from modpy.tests.test_util import run_unit_test from modpy.optimize import quadprog class TestQuadProg: def test_unconstrained_result(self): H = np.array([(6., 2., 1.), (2., 5., ...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import sys import os class ConvBlock(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, with_se=False, normalize=True, num_cls=3, num_scale=5): super().__init__() self.num_scale = num_scale ...
from app1 import server if __name__ == "__main__": server.run(host='0.0.0.0', port=8000)
from __future__ import absolute_import from pyramid.httpexceptions import HTTPForbidden from pyramid.httpexceptions import HTTPUnauthorized from pyramid.httpexceptions import HTTPUnprocessableEntity from pyramid.response import Response from pyramid.view import view_config from libweasyl.text import markdown, slug_fo...
from ..meta_classes import DataSetProperties from ..meta_classes.data_set_properties import PersonStyleWeightDistribution, PersonStyleWeight, ProductStyleWeight from ..utils import WeightedOption, Distribution from ..classes import PersonStylePreferenceEnum, ProductStyleEnum, Style from graph_io.classes.dataset_name im...
import os import torch from .data_cls import BertDataBunch from .data_ner import BertNERDataBunch from .learner_cls import BertLearner from .learner_ner import BertNERLearner from transformers import AutoTokenizer import warnings warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwa...
""" If the applicant has good income and has a good credit score then he is applicable to apply for a loan. """ #Taking Values of income and credit income = float(input("What is your income in Indian Rupee: ")) credit_score = float(input("What is your credit score: ")) #Checking if credit_score > 500 and income ...
# coding: utf-8 """ No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use ...
`[1 for i in range(5)]`
"""Entry point for Twitoff Application .""" from .app import create_app APP = create_app()
############################################################################## # Copyright (c) 2015 Huawei Technologies Co.,Ltd and other. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, a...
import threading from typing import Union import jesse.helpers as jh from jesse.models import Order from jesse.services import logger class API: def __init__(self) -> None: self.drivers = {} if not jh.is_live(): self.initiate_drivers() def initiate_drivers(self) -> None: ...
import csv import time import os.path import numpy as np import azure_utils.client as client import graphutils.getConnection as gc from FetchLabeledData import * from Simon import * from Simon.Encoder import * from Simon.DataGenerator import * from Simon.LengthStandardizer import * def main(checkpoint, data_count, d...
import logging from typing import NamedTuple import numpy as np import cv2 from layered_vision.utils.image import ImageArray, get_image_size, has_alpha from layered_vision.filters.api import AbstractOptionalChannelFilter from layered_vision.config import LayerConfig LOGGER = logging.getLogger(__name__) DEFAULT_PO...
""" Will be replaced by urscript_wrapper This module wraps standard UR Script functions. Main change is that plane information substitute for pose data """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import Rhino.Geometry as rg from compas_rcf.utils.r...
# Copyright (c) 2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web._auth}. """ from zope.interface import implements from zope.interface.verify import verifyObject from twisted.trial import unittest from twisted.internet.address import IPv4Address from twisted.cred import err...
# knownnames.py # Copyright 2017 Roger Marsh # Licence: See LICENCE (BSD licence) """Interface to results database for player names known in other editions of event. """ from .playerfind import find_player_names_in_other_editions_of_event class KnownNames: """Extend to represent subset of games on file that ma...
from dungeon_model import Monsters, Players import re import math def initiative_sort(init_order): """sorts all the characters for a given combat by initiative""" print("passed into sort function: ", init_order) for i in range(len(init_order)): check = init_order[i] print("the check is: ",...
from WebApi.Google.Translate import Translator sentence = "My name is Ann. " print('翻訳前:', sentence) print('翻訳後:', Translator.Translate(sentence, 'en', 'ja'))
#!C:\Python27\python.exe #------------------------------------------------------------------------------- # scripts/readelf.py # # A clone of 'readelf' in Python, based on the pyelftools library # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #---------------------------------------------------...
import json import pytest from specklepy.api import operations from specklepy.transports.server import ServerTransport from specklepy.transports.memory import MemoryTransport from specklepy.serialization.base_object_serializer import BaseObjectSerializer from specklepy.objects import Base from specklepy.objects.geometr...
""" PatchGAN Discriminator (https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/models/networks.py#L538) """ import torch.nn as nn def weights_init(m): classname = m.__class__.__name__ if classname.find('Conv') != -1: nn.init.normal_(m.weight.data, 0.0, 0.02) elif classname.find('...
[ ## this file was manually modified by jt { 'functor' : { 'arity' : '2', 'call_types' : [], 'ret_arity' : '0', 'rturn' : { 'default' : 'T', }, 'simd_types' : [], 'special' : ['cephes'], 'type_defs' : [], 'types' :...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is a minimized six model. """ import sys import types PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY3: string_types = str, integer_types = int, class_types = type, text_type = str binary_type = bytes MAXSIZE = sys.m...
""" A module for mapping operators to their corresponding eigenstates and vice versa It contains a global dictionary with eigenstate-operator pairings. If a new state-operator pair is created, this dictionary should be updated as well. It also contains functions operators_to_state and state_to_operators for m...
#! /usr/bin/env python """GUI interface to webchecker. This works as a Grail applet too! E.g. <APPLET CODE=wcgui.py NAME=CheckerWindow></APPLET> Checkpoints are not (yet??? ever???) supported. User interface: Enter a root to check in the text entry box. To enter more than one root, enter them on...
from vk_api.keyboard import VkKeyboard, VkKeyboardColor keyboard = VkKeyboard(one_time = True) keyboard.add_button('Графики', color=VkKeyboardColor.SECONDARY) keyboard.add_button('Команды', color=VkKeyboardColor.POSITIVE) keyboard.add_line() # Переход на вторую строку keyboard.add_button('Сейчас', color=VkKeyboardC...
""" Session Memory Module """ from masonite.contracts import SessionContract from masonite.drivers import BaseDriver from masonite.app import App class SessionMemoryDriver(SessionContract, BaseDriver): """Memory Session Driver """ _session = {} _flash = {} def __init__(self, app: App): ...
import functools import math import warnings import numpy as np import cupy from cupy.cuda import cufft from cupy.fft import config _reduce = functools.reduce _prod = cupy.core.internal.prod @cupy.util.memoize() def _output_dtype(dtype, value_type): if value_type != 'R2C': if dtype in [np.float16, np....
""" ======================== Plot a 2D static flatmap ======================== quickflat visualizations use matplotlib to generate figure-quality 2D flatmaps. Similar to webgl, this tool uses pixel-based mapping to project functional data onto the cortical surfaces. This demo will use randomly generated data and plo...
#!/usr/bin/env python # Copyright (c) 2015-2017 The Crowncoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Perform basic ELF security checks on a series of executables. Exit status will be 0 if successful, an...
#!/pxrpythonsubst # # Copyright 2016 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ...
from docx import Document from docx.shared import Mm from docx.enum.table import WD_ALIGN_VERTICAL from docx.enum.text import WD_ALIGN_PARAGRAPH from openpyxl import Workbook from openpyxl.styles import Alignment, Border, Font, Side from openpyxl.utils.cell import get_column_letter from django.http import HttpRespons...
from quokka.utils.text import slugify_category from flask import current_app as app def url_for_content(content): """Return a relative URL for content dict or Content model """ if not isinstance(content, dict): data = content.data else: data = content category_slug = data.get('cat...
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ VERSION = "7.0.0b8"
# Copyright 2020 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" file acc...
""" Tirar un dado 100 veces y acumular los valores obtenidos para imprimirlos al final del programa """ from random import randint INICIO_RANGO_DADO = 1 FIN_RANGO_DADO = 6 VECES = 100 acumulador = 0 # que es el elemento neutro de la suma for v in range(VECES): valor = randint(INICIO_RANGO_DADO, FIN_RANGO_DADO) ...
import sys from larlib import * sys.path.insert(0, 'test/py/boolean/') from test06 import * """ From triples of points to LAR model """ WW = AA(LIST)(range(len(W))) FE = crossRelation(FW,EW,WW) triangleSet = boundaryTriangulation(W,FW,EW,FE) TW,FT = triangleIndices(triangleSet,W) VIEW(EXPLODE(1.2,1.2,1.2)(MKPOLS((W,...
import numpy as np import tensorflow as tf import tensorflow.keras.layers as tfkl import tensorflow_probability as tfp tfd = tfp.distributions tfpl = tfp.layers N_LATENT = 5 prior = tfd.Independent(tfd.Normal(loc=np.zeros((N_LATENT,), dtype=np.float32), scale=np.ones((N_LATENT,), dt...
from .command import Command from .command_unix_account import CommandUnixAccount __all__ = [ "Command", "CommandUnixAccount", ]
from os import add_dll_directory from flask import Flask, json, jsonify, request from flask_restful import Api, Resource app = Flask(__name__) api = Api(app) def checkPostedData(postedData, functionName): if (functionName == "add" or functionName=="subtract" or functionName=="multiply"): if "x" not in pos...
# -*- coding: utf-8 -*- """ tests.wrappers ~~~~~~~~~~~~~~ Tests for the response and request objects. :copyright: 2007 Pallets :license: BSD-3-Clause """ import contextlib import json import os import pickle from datetime import datetime from datetime import timedelta from io import BytesIO impor...
""" WSGI config for Nagoya Rest project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATIO...
# coding: utf-8 class Solution: def __init__(self): self.head, self.tail = None, None """ @param root, the root of tree @return: a doubly list node """ def bstToDoublyList(self, root): # Write your code here # 还是中序遍历,然后插入双链表节点。 if root: self.bstToDou...
# -*- coding: utf-8 -*- """GakuNin RDM mailing utilities. Email templates go in website/templates/emails Templates must end in ``.txt.mako`` for plaintext emails or``.html.mako`` for html emails. You can then create a `Mail` object given the basename of the template and the email subject. :: CONFIRM_EMAIL = Mail...
from setuptools import setup setup( data_files=[('share/jupyter/nbextensions/jupyter-vextab', ['jupyter_vextab/static/vextab-div.js'])] # The rest of the setuptools configuration comes from `setup.cfg`. The # `data_files` argument is here since it's not yet supported in # `setup.cfg` )...
# Copyright 2007-2010 by Peter Cock. All rights reserved. # Revisions copyright 2007-2008 by Michiel de Hoon. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Testing online ...
''' drr +++ The qdisc doesn't accept any parameters, but the class accepts `quantum` parameter:: ip.tc('add', 'drr', interface, '1:') ip.tc('add-class', 'drr', interface, '1:10', quantum=1600) ip.tc('add-class', 'drr', interface, '1:20', quantum=1600) ''' from pr2modules.netlink import nla from pr2module...
# Faça um programa que leia nome e peso de várias pessoas guardando tudo em uma lista. # no final mostre: # a) quantas pessoas foram cadastradas # b) uma listagem com as pessoas mais pesadas # c) uma listagem com as pessoas mais leves temp = [] prc = [] maior = menor = 0 while True: temp.append(str(input('Nome: ')...
# This file is MACHINE GENERATED! Do not edit. # Generated by: tensorflow/python/tools/api/generator/create_python_api.py script. """Core module for TensorFlow distribution objects and helpers. """ from __future__ import print_function as _print_function import sys as _sys from tensorflow.python.ops.distributions.be...
import requests from steamapi.steamapikey import SteamAPIKey from reddit.botinfo import message #message = True heroDictionary = {} heroDictionaryDotabuff = {} def requestGetHeroes(): if message: print('[getheroes] request get heroes...') URL = "https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/?ke...
import re import json from datetime import datetime from collections import Counter puzzleInput = open('input.txt', 'r').read().split('\n') def mapper(row): m = re.search( r'\[(?P<time>[0-9\- :]+)\]\s+(Guard #(?P<guard>\d+))?(?P<wakeup>wakes up)?(?P<asleep>falls asleep)?', row) if m.group('wakeup'): ...
def get_listener(item): if item is None: return None return listeners.get(item.uniqueID) def set_listener(item, listener): listeners[item.uniqueID] = listener def _dispatchEvent(sender, event, useCap): if not event: evt = wnd().event else: evt = event #print "_dispatc...
#!/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. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, ...
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
import os import sqlite3 DIR = os.path.dirname(os.path.abspath(__file__)) SELECT_FROM_PROFILE_WHERE_NAME = "SELECT * FROM profiles WHERE name = :name" INSERT_INTO_PROFILE = "INSERT INTO profiles (name) VALUES (?)" SQL_CREATE_ACTIONS_TABLE = """ CREATE TABLE IF NOT EXISTS `actions` ( `acoount_name` TEXT ...
# qubit number=4 # total number=13 import pyquil from pyquil.api import local_forest_runtime, QVMConnection from pyquil import Program, get_qc from pyquil.gates import * import numpy as np conn = QVMConnection() def make_circuit()-> Program: prog = Program() # circuit begin prog += H(0) # number=1 pr...
#COMPARANDO NÚMEROS # Escreva um programa que leia dois números inteiros e compare-os. mostrando na tela uma mensagem: # – O primeiro valor é maior # – O segundo valor é maior # – Não existe valor maior, os dois são iguais num = int(input('Digite um numero inteiro: ')) num2 = int(input('Digite outro numero inteiro: ')...
from __future__ import absolute_import import torch from torch import nn from torch.autograd import Variable import torch.nn.functional as F def to_contiguous(tensor): if tensor.is_contiguous(): return tensor else: return tensor.contiguous() def _assert_no_grad(variable): assert not variable.requires_g...
import time import pandas as pd from sklearn import neighbors from sklearn.model_selection import GridSearchCV from sklearn.preprocessing import MinMaxScaler #from fastai.tabular import add_datepart scaler = MinMaxScaler(feature_range=(0, 1)) def predict(comstring): try: print("RUNNING C8") # ret...
# Copyright 2013-2020 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 Rocfft(CMakePackage): """Radeon Open Compute FFT library""" homepage = "https://gith...
# Copyright 2019 Oleg Butuzov. 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...
# __author: kangchen # date: 2018/1/24 import lxml from bs4 import BeautifulSoup import requests def getHTMLText(url): try: headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'} r = requests...
"""Top-level package for modern-python-boilerplate.""" __author__ = """Jean Piaget""" __email__ = "jpiaget@example.com" __version__ = "0.1.0"
# -*- coding: utf-8 -*- import scrapy from scrapy.spiders import Spider from news_sites.items import ReadMeItem from urllib.parse import urljoin from scrapy.http import Request class DailymirrorlkSpider(scrapy.Spider): name = "readmelk" allowed_domains = ["readme.lk"] start_urls = ['http://www.readme.lk/ca...
from __future__ import absolute_import, division, print_function, unicode_literals #import ctypes import math import random import numpy as np from pi3d.Buffer import Buffer from pi3d.Shape import Shape from pi3d.util.RotateVec import rotate_vec import logging LOGGER = logging.getLogger(__name__) class MergeShape(S...
# # Copyright 2019 The Eggroll 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 ap...
#!/usr/local/bin/python import os, re, sqlite3 from bs4 import BeautifulSoup, NavigableString, Tag conn = sqlite3.connect('holoviews.docset/Contents/Resources/docSet.dsidx') cur = conn.cursor() try: cur.execute('DROP TABLE searchIndex;') except: pass cur.execute('CREATE TABLE searchIndex(id INTEGER PRIMARY KEY, nam...
## TODO: define the convolutional neural network architecture import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F # can use the below import should you choose to initialize the weights of your Net import torch.nn.init as I from torchvision import models from collecti...
# coding: utf-8 """ Metal API This is the API for Equinix Metal. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. The official API docs are hosted at <https://metal.equinix.com/dev...
import csv import os class csvReader: def __init__(self, address) -> None: self.address = address self.data = [] def read(self, delimiter=",") -> None: with open(self.address) as csvfile: reader = csv.reader(csvfile, delimiter=delimiter) self.fields = next(read...
import sys from _pydevd_bundle import pydevd_xml from os.path import basename import traceback try: from urllib import quote, quote_plus, unquote, unquote_plus except: from urllib.parse import quote, quote_plus, unquote, unquote_plus #@Reimport @UnresolvedImport #==============================================...
# -*- coding: utf-8 -*- # Copyright (c) 2021 Intel Corporation # # 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...
import os import unittest from pathlib import Path import openmc import paramak import pytest class TestObjectNeutronicsArguments(unittest.TestCase): """Tests Shape object arguments that involve neutronics usage""" def setUp(self): self.test_shape = paramak.ExtrudeMixedShape( points=[ ...
"""Per-prefix data, mapping each prefix to a dict of locale:name. Auto-generated file, do not edit by hand. """ from ..util import u # Copyright (C) 2011-2020 The Libphonenumber Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
from package import Package from package.source import PackageSource class AppleCursor(Package): name = 'theme/apple-cursor' description = 'macOS Cursor Theme' repo = 'ful1e5/apple_cursor' source = PackageSource.GITHUB_RELEASE asset_pattern = r'.*macOSBigSur.tar.gz' link_pattern = {'./macOSB...
from .code import Code from .payment import Payment from .account import Account from .preauth import Preauth from .pending import Pending __all__ = [ 'Code', 'Payment', 'Account', 'Preauth', 'Pending', ]
"""`Report` stores the results of a comparison.""" import json from typing import Dict, List, Tuple import numpy as np from tabulate import tabulate from .frozenset_dict import FrozensetDict chars = list("abcdefghijklmnopqrstuvwxyz") super_chars = list("ᵃᵇᶜᵈᵉᶠᵍʰᶦʲᵏˡᵐⁿᵒᵖ۹ʳˢᵗᵘᵛʷˣʸᶻ") metric_labels = { "hits": "H...
# -*- coding: utf-8 -*- # file: sentiment_classifier.py # author: yangheng <yangheng@m.scnu.edu.cn> # Copyright (C) 2020. All Rights Reserved. import json import os import pickle import random import numpy import torch from findfile import find_file from termcolor import colored from torch.utils.data import DataLoader...
from test_support import TestFailed import mimetools import string,StringIO start = string.ascii_letters + "=" + string.digits + "\n" for enc in ['7bit','8bit','base64','quoted-printable']: print enc, i = StringIO.StringIO(start) o = StringIO.StringIO() mimetools.encode(i,o,enc) i = StringIO.String...
# Copyright 2013 Red Hat, 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 agre...