text
stringlengths
3.07k
22.1k
import numpy as np from . import utils, dynamics from numba import jit from scipy.optimize import linear_sum_assignment from scipy.ndimage import convolve def mask_ious(masks_true, masks_pred): """ return best-matched masks """ iou = _intersection_over_union(masks_true, masks_pred)[1:,1:] n_min = min(iou....
from __future__ import absolute_import, division, print_function import collections import logging import random import sys import iotbx.phil from cctbx import sgtbx from xfel.clustering.cluster_groups import unit_cell_info from dials.algorithms.clustering.unit_cell import UnitCellCluster from dials.algorithms.symme...
# # ElGamal.py : ElGamal encryption/decryption and signatures # # Part of the Python Cryptography Toolkit # # Originally written by: <NAME> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the ...
# Copyright (c) 2019 NVIDIA Corporation import collections import json import os from typing import Any, Dict, List, Optional, Union import pandas as pd import nemo from nemo.collections.asr.parts import manifest, parsers logging = nemo.logging class _Collection(collections.UserList): """List of parsed and pre...
# Copyright The PyTorch Lightning team. # # 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 i...
"""Parse workflow input into data structures of plain engine""" from typing import List, Dict, Callable, Union, Coroutine, Tuple, cast import logging from hetdesrun.models.workflow import ( WorkflowNode, ComponentNode, WorkflowConnection, WorkflowInput, WorkflowOutput, ) from hetdesrun.models.comp...
#!/usr/local/bin/python #- # Copyright (c) 2010-2011 Varnish Software AS # All rights reserved. # # Author: <NAME> <<EMAIL>> # # 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 ret...
import abc import logging from datetime import datetime as dt from typing import Tuple import numpy as np from progress.bar import Bar from slaid.commons import Filter, Mask, NapariSlide from slaid.commons.base import ImageInfo from slaid.models import Model from slaid.commons.base import ArrayFactory, NumpyArrayFact...
# -*- coding: utf-8 -*- import json from urllib.parse import unquote from scrapy.utils.misc import load_object from scrapy.utils.serialize import ScrapyJSONEncoder from twisted.internet.defer import Deferred from twisted.python.failure import Failure from twisted.web import resource, server from twisted.web.error impo...
# -*- coding: utf-8 -*- """Function for data preparation This module includes functions used for data preparation. A typical usage would be to call make_dataset() and make_dataloader() in trainer.py in when training. Example: dataset = make_dataset(self.config.data_dir_root, self.args) dataloader = make_dat...
# Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) 2020, <NAME> (@e-bug). # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import json import logging import _pickle as cPickle import numpy as np import torch from to...
# -*- coding: utf-8 -*- import os import struct from .base import FirmwareObject, BaseObject, StructuredObject from .me import MeContainer from .utils import * from .structs.flash_structs import * class RegionSection(StructuredObject): size = 20 def __init__(self, data): self.parse_structure(data, ...
from bs4 import BeautifulSoup import urllib import pafy from slugify import slugify from logzero import logger as log import os from spotdl import spotify_tools from spotdl import internals from spotdl import const # Fix download speed throttle on short duration tracks # Read more on mps-youtube/pafy#199 pafy.g.open...
# Copyright (c) 2017 NVIDIA Corporation from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import time import numpy as np import tensorflow as tf # pylint: disable=no-name-in-module from tensorflow.python import debug as tf_debug from six.moves import range from ...
""" Get and set remote values on series 3 routers. """ import collections import csv import datetime import itertools import shellish import syndicate.data import time from . import base class DeviceSelectorsMixin(object): """ Add arguments used for selecting devices. """ search_fields = ['name', 'desc', 'm...
## 파이썬의 tkinter를 통해 계산기를 만들어보자 ## tkinter import 하기 ''' 버전1 계산기입니다 5×4 크기로 구성했습니다 기능: 숫자입력, 등호, 사칙연산, 소괄호, 소수점, 입력창 초기화 기본적인 연산만 가능합니다 부족한 기능을 추가하여 버전2 계산기를 만들 예정입니다 ''' import tkinter as tk import tkinter.font ## 윈도우창 생성 window = tk.Tk() ## 윈도우 제목 설정 window.title('계산기') ## 윈도우 창 크기 설정 window.geometry('350x500+800+...
# (C) Datadog, Inc. 2010-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import platform import re import socket from copy import deepcopy import mock from datadog_checks.tcp_check import TCPCheck from . import common def test_down(aggregator): """ Service expected to b...
# Copyright (c) 2015, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright notice, # this list of conditio...
from algo import * from ui import* import sys import pygame, sys import time from pygame.locals import * def drawEmptyBoard(screen): for x in range(height): for y in range(width): rect = pygame.Rect(x*block_size, y*block_size, block_size, block_size) if (x+y)%2 == ...
"""Unit tests for the DiffElement class. Copyright (c) 2020-2021 Network To Code, LLC <<EMAIL>> 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...
import os import numpy from urllib.request import urlretrieve from silx.io.specfile import SpecFile from orangecontrib.xoppy.util.xoppy_xraylib_util import bragg_metrictensor from f0coeffs_fit import crystal_get_f0_coeffs from symbol_to_from_atomic_number import symbol_to_from_atomic_number """ <NAME>, <EMAIL>, <NAME>...
from math import * def erGyldigOrgNummer(orgnummer): if len(orgnummer) == 9.0: failures = DoubleReference() failures.doubleValue = 0.0 d1 = charToNumber(orgnummer[int(0.0)], failures) d2 = charToNumber(orgnummer[int(1.0)], failures) d3 = charToNumber(orgnummer[int(2.0)], failures) d4 = charToN...
"""PHENICX-Anechoic Dataset Loader .. admonition:: Dataset Info :class: dropdown This dataset includes audio and annotations useful for tasks as score-informed source separation, score following, multi-pitch estimation, transcription or instrument detection, in the context of symphonic music: <NAME>, <NAM...
#!/usr/bin/env python #-*- coding:utf-8 -*- # Author: LiuHuan # Datetime: 2020/3/18 11:10 from captcha.image import ImageCaptcha import matplotlib.pyplot as plt import numpy as np import random import string characters = string.digits + string.ascii_uppercase print(characters) width, height, n_len, n_class = 128, 6...
import json import ast import plotly.plotly as py import plotly.graph_objs as go import plotly.io as pio import os import re #PARAMS logs_path = "C:\\Users\\gbosetti\\Desktop\\foot_2015_selected" output_path = "C:\\Users\\gbosetti\\Desktop" # Functions def draw_barchart(**kwargs): data = [] all_y_axis_valu...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, <NAME> <<EMAIL>> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = '...
import pytest import shutil import os import numpy as np import astropy.table as at from astropy.io import fits import astropy.convolution as ac import astropy.units as u from ....obsobj import obsObj from .. import plainDecomposer ra = 140.099341430207 dec = 0.580162492432517 dir_parent = './testing/' dir_obj = ...
"""Local Media Source Implementation.""" from __future__ import annotations import logging import mimetypes from pathlib import Path import shutil from aiohttp import web from aiohttp.web_request import FileField import voluptuous as vol from homeassistant.components import http, websocket_api from homeassistant.com...
NAME = 'PyYAML' VERSION = '5.2' DESCRIPTION = "YAML parser and emitter for Python" LONG_DESCRIPTION = """\ YAML is a data serialization format designed for human readability and interaction with scripting languages. PyYAML is a YAML parser and emitter for Python. PyYAML features a complete YAML 1.1 parser, Unicode s...
# coding : utf-8 ''' Copyright 2020-2021 <NAME>. 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 writin...
import matplotlib import matplotlib.pyplot as plt import numpy as np import torch import torch.nn.functional as F from lib.utils import ( grid_positions, upscale_positions, downscale_positions, savefig, imshow_image ) from lib.exceptions import NoGradientError, EmptyTensorError matplotlib.use('Agg') def loss...
#!/usr/bin/env python import sys import numpy as np import math as m class ball: """ Ball object for motion model which includes friction and collision data members: x : x coordinate of ball y : y coordinate of ball xd : dx/dt of ball yd : dy/dt of ball xdd : d^2x/dt^2 of ball y...
import os import numpy as np from numpy.testing import assert_array_almost_equal from nose.tools import assert_true, assert_raises from nose.plugins.skip import SkipTest import warnings from mne.fixes import tril_indices from mne.connectivity import spectral_connectivity from mne.connectivity.spectral import _CohEst ...
import logging from app.model.a_config import AnfisaConfig from app.model.condition import ConditionMaker from xl_cond import XL_Condition, XL_NumCondition #=============================================== class XL_Unit: def __init__(self, xl_ds, descr, unit_kind = None): self.mDataSet = xl_ds self.m...
"""generate_int.py Generate interaction files based on fits """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals from os import mkdir, path from FitFunction import FitFunction from ExpInt import ExpInt from metafitters_sp import single_particle_firstp_metafi...
from dace import data, dtypes from dace.codegen.tools import type_inference from dace.sdfg import SDFG, SDFGState, nodes from dace.sdfg import nodes from dace.sdfg.utils import dfs_topological_sort from typing import Dict, List ############################################################################# # Connector t...
""" Copyright (c) 2019-2020 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 applicable law or agreed to in w...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow.contrib.layers.python.layers import batch_norm from tensorflow.contrib.layers.python.layers import l2_regularizer def log_sum_exp(x, axis=1): m = tf.reduce_...
import json import pandas as pd pd.set_option('display.max_rows', 30) pd.set_option('display.max_columns', 50) pd.set_option('display.width', 1200) import matplotlib.pyplot as plt import seaborn as sns # used for plot interactive graph. import warnings warnings.filterwarnings('ignore') def load_tmdb_movies(path): ...
import json from typing import Dict, List, Optional from unittest import TestCase from unittest.mock import Mock, call, patch from reconcile import openshift_namespace_labels from reconcile.openshift_namespace_labels import state_key # TODO: use a dataclass when python > 3.6 class NS(): """ Simple utility c...
# Copyright 2013-2022 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) """Define a common data structure to represent external packages and a function to update packages.yaml given a list of det...
import os os.sys.path.insert(0, os.path.abspath("../..")) import numpy as np import torch import torch.nn as nn from torch.optim import Adam from lib.rl.memory import SequentialMemory from lib.utils.utils import to_numpy, to_tensor, sample_from_truncated_normal_distribution criterion = nn.MSELoss() USE_CUDA = torc...
# Copyright (c) 2020 Horizon Robotics and ALF Contributors. 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...
# -*- coding: utf-8 -*- # cython: language_level=3 # Copyright (c) 2020 Nekokatt # Copyright (c) 2021-present davfsa # # 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, inc...
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Cisco Systems, Inc. and others. 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...
# # Copyright (c) 2019 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 applicable law or agreed to...
# -*- coding: utf-8 -*- import time import os import math import argparse from glob import glob from collections import OrderedDict import random import warnings from datetime import datetime import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm import pandas as pd import joblib import cv2 from sk...
# pm and tagged messages logger for catuserbot by @mrconfused (@sandy1709) # imported from catuserbot # modified by @AbOuLfOoOoOuF for fizilion import asyncio, re from userbot import bot, PMLOG, PMLOG_CHATID, CMD_HELP, LOGS, ISAFK, BOTLOG, BOTLOG_CHATID, trgg, tgbott from userbot.modules.sql_helper import pm_permit...
#!/usr/bin/env python # -*- coding: utf-8 -*- """A short and simple example experiment with restarts. The script is fully functional but also emphasises on readability. It features restarts, timings and recording termination conditions. To benchmark a different solver, `fmin` must be re-assigned and another `elif` bl...
# Copyright Contributors to the Testing Farm project. # SPDX-License-Identifier: Apache-2.0 import json import threading import urllib from pymemcache.client import base # type: ignore import gluetool from gluetool.log import LoggerMixin, log_dict from gluetool.result import Result from typing import Any, Dict, Li...
# # Copyright (c) 2019 Juniper Networks, Inc. All rights reserved. # """Base class for feature plugins.""" import abc from builtins import object from builtins import str from collections import OrderedDict import copy from abstract_device_api.abstract_device_xsd import * from attrdict import AttrDict import db from...
# Ex. 3 --- --- --- --- --- --- import random def Ex3(): a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] for num in a: if num < 5: print(num) ins = int(input("Your Number: ")) for num in a: if num < ins: print(num) Ex3() # Ex. 4 --- --- --- --- --- --- def Ex4()...
# -*- coding: utf-8 -*- # Copyright (c) 2018-2021 shmilee ''' Contains ipynb UI class. ''' import ipywidgets from IPython.display import display, HTML from ..__about__ import __data_path__ from ..processors import get_processor, Processor_Names from ..processors.lib import Processor_Lib __all__ = ['IpynbUI', 'Scro...
import discord from discord.ext import commands from showerHelper import * import os import time GREEN= 0x00D31F #hexidecimal color code constants QUEUE_LEN = 16 #Max number of songs that an be queued class Musica(commands.Cog): def __init__(self, bot): self.bot = bot #make bot self.queue = [] #em...
# Copyright 2020,2021 Sony Corporation. # Copyright 2021 Sony Group 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 ...
"""Test CanICA""" import numpy as np import pytest import warnings from numpy.testing import assert_array_almost_equal import nibabel from nilearn._utils.testing import write_tmp_imgs from nilearn.decomposition.canica import CanICA from nilearn.input_data import MultiNiftiMasker from nilearn.image import iter_img f...
import pygame from pygame.locals import * # CONSTANTES largura_tela = 900 # WIDTH X altura_tela = 450 # HEIGHT Y PULO = 10 SPEED = 5 # constante de velocidade cenario e personagem gravidade = 10 camada_largura = largura_tela camada_altura = altura_tela class Ninja(pygame.sprite.Sprite): # modela um objeto do mu...
# Copyright [2021] <NAME>, <NAME>, # <NAME>, <NAME>, and # <NAME>. # # 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 app...
"""The pandas client implementation.""" from __future__ import absolute_import import re from functools import partial import dateutil.parser import numpy as np import pandas as pd import pytz import toolz from multipledispatch import Dispatcher from pandas.api.types import CategoricalDtype, DatetimeTZDtype from pkg...
# -*- 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 "L...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from copy import deepcopy import requests from ..objects import ( Agent, Locations, Parcels, PDFConfig, Receiver, Sender, SenderPartners, Service) from ..shipments import Shipment CARRIER_CODE = "POSTI" CARRIER_DESCRIPTION = "Posti Oy, Paketit ...
r""" Parse additional arguments along with the setup.py arguments such as install, build, distribute, sdist, etc. Usage: python setup.py install <additional_flags>..<additional_flags> <additional_arg>=<value>..<additional_arg>=<value> export CC=<C++ compiler>; python setup.py install <additional_flags>..<additi...
#!/usr/bin/env python import csv import fileinput import sys from argparse import ArgumentParser # This prevents prematurely closed pipes from raising # an exception in Python from io import TextIOWrapper from pathlib import Path from signal import SIGPIPE, SIG_DFL, signal from typing import AnyStr, IO, Iterable, Itera...
""" server.py - Serving Notes'n'Todos frontend and web API using gunicorn and bottle MIT license - see LICENSE file in Notes'n'Todos project root Gunicorn is used in a slightly unusual way here because of the NoteCollection object which must stay alive and represent the state of the notebook, thus: - Exactly one in...
__author__ = "Altertech" __license__ = "MIT" __version__ = '0.1.6' from textwrap import fill from itertools import chain FORMAT_RAW = 0 FORMAT_GENERATOR = 1 FORMAT_GENERATOR_COLS = 2 ALIGN_LEFT = 0 ALIGN_NUMBERS_RIGHT = 1 ALIGN_RIGHT = 2 ALIGN_CENTER = 3 ALIGN_HOMOGENEOUS_NUMBERS_RIGHT = 4 COLUMN_WIDTH_CALC = 0 COL...
from datetime import timedelta from django.conf import settings from django.contrib import messages from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse from django.utils import timezone from django.views.generic import CreateView...
import sys import logging import pandas as pd import alphapept.io import os import psutil import logging from alphapept.__version__ import VERSION_NO BASE_PATH = os.path.dirname(__file__) HOME = os.path.expanduser("~") LOG_PATH = os.path.join(HOME, "alphapept", "logs") LATEST_GITHUB_INIT_FILE = ( "https://raw.git...
#!/usr/bin/env python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Project: Implement the Needleman-Wunsch algorithm for pair-wise alignments. Purpose: This implementation demonstrates how to align two nucleotide/protein sequences using the Needleman-Wunsch algorithm developed by <NAME> and <NAME>. https://en.wikipedia.org/wiki/Needl...
from django.conf import settings from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.urls import reverse from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.views.generic import C...
""" This is a simple example of recursive fractal drawing using turtle graphics """ import turtle from enum import Enum from random import randint WIDTH = 1200 HEIGHT = 800 MENU = [ '''Please enter the desired option: (1) Concentric circles (2) Binary lateral circles (3) Koch's curve (4) Koch's tri...
from pyedflib import highlevel from wfdb import rdsamp, wrsamp import numpy as np import pandas as pd import datetime as dt import os import glob from vital_sqi.common import generate_timestamp, utils from vital_sqi.data.signal_sqi_class import SignalSQI def ECG_reader (file_name, file_type = None, channel_num = None...
# Copyright 2013 OpenStack Foundation # 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 requ...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # 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 modif...
import numpy as np logo = """ _____ _ _ _ / ____| | | | | | | (___ | |__ ___ ___| |_ ___| | \___ \| '_ \ / _ \/ _ \ __/ __| | ____) | | | | __/ __/ |_\__ \_| |_____/|_| |_|\___|\___|\__|___(_) ...
# 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, overload from ... import _utilities __...
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC. 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...
from datetime import datetime from pandas_datareader import DataReader from pandas_datareader._utils import RemoteDataError from keras.models import Sequential from keras.layers import LSTM, Dense from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import mean_squared_error import random import math imp...
from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.conf import settings from django.db.models import QuerySet from jsonfield.fields import JSONField from six import python_2_unicode_compatible from django.u...
#!/usr/bin/env python2 """ objects.py Python types under value.Obj. See the invariant in osh/runtime.asdl. """ from __future__ import print_function from core.util import log from oil_lang import regex_translate from typing import Union, TYPE_CHECKING, List, Dict, Any, Optional if TYPE_CHECKING: from typing impor...
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and ...
from flask import Flask, render_template, request, redirect, url_for, make_response, jsonify, send_file import numpy as np from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, Mess...
#!/usr/bin/env python3 # Copyright (C) 2020 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # """ Create comparison table based on MemCheckTests results from 2 runs Usage: ./scrips/compare_memcheck_2_runs.py cur_source ref_source \ --db_collection collection_name --out_file file_name """ # pylint:disabl...
#!/usr/bin/env python # # usage: svd2regs.py [-h] [--group] (--mcu VENDOR MCU | --svd [SVD]) # [--save FILE] [--fmt ['ARG ..']] [--path PATH] # peripheral # # positional arguments: # peripheral Name of the Peripheral # # optional arguments: # -h, --help show this ...
# Copyright (C) 2013 eNovance SAS <<EMAIL>> # # 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...
""" Defines the expectation class which is the basis for performing the assertions. """ import re import hamcrest as hc from .patched import IsNot from .matchers import lookup, suggest, ContextManagerResult __author__ = "Ivan -DrSlump- Montes" __email__ = "<EMAIL>" __license__ = "MIT" class OPERATOR: """ Define...
# Natural Language Toolkit: Aligned Sentences # # Copyright (C) 2001-2011 NLTK Project # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT import sys import logging import nltk.metrics from nltk.util import defaultdict class AlignedSent(object): """ Aligned sentence object. Encapsulates...
# # Copyright (c) 2021, NVIDIA 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 applicable law or agreed ...
import logging import re from json import JSONDecodeError from typing import Iterable, Iterator, List, Match, Optional, Union, cast import requests from bs4 import BeautifulSoup from bs4.element import Tag from notifier.parsethread import ( count_pages, get_user_from_nametag, parse_thread_meta, parse_...
#!/usr/bin/env python # -*- encoding: utf-8 -*- """A script for backing up your Goodreads library. Writes a backup to `goodreads_backup.json`, or you can provide an alternative name as the first command-line argument. See the README for more details. """ from __future__ import print_function import argparse import...
# Copyright 2018 The Texar Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
""" The MIT License (MIT) Copyright (c) 2015-2021 Rapptz Copyright (c) 2021-present Pycord Development 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 limit...
# featureExtractors.py # -------------------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://a...
import numpy as np from prox_tv import tv1_1d, tv1w_1d, tv2_1d, tv1_2d, tvp_1d, \ tv1w_2d, tvp_2d, tvgen def test_tv1w_1d(): methods = ('tautstring', 'pn') for _ in range(20): dimension = np.random.randint(1e1, 1e3) x = 100*np.random.randn(dimension) w = 20*np.rand...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # ------------------------------------------------------------------- # Purpose: Naver Cloud Platform APIs Test # Author: <NAME> (<EMAIL>) # Filename: test_ncpapi.py # Date: Since October 25, 2021 # # # Reference: # - https://api.ncloud-docs.com/beta/docs/common-ncpapi# # -...
from typing import List, Dict, Union, Optional, Tuple, Any, Callable, ClassVar import numpy import threading from loguru import logger import asyncio import functools import aiohttp import asyncio import pickle import requests def server_wrapper(func): """Checks for a server at http://localhost:22647/. If there i...
########################################### # Suppress matplotlib user warnings # Necessary for newer version of matplotlib import warnings warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib") # # Display inline matplotlib plots with IPython from IPython import get_ipython get_ipython().run_...
# Copyright 2020 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...
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Layout container. """ # Standard library imports from collections import OrderedDict import sys # Third party imports from qtpy.QtCore import Qt,...
# -*- coding: utf-8 -*- # # Copyright (C) 2019 <NAME> <<EMAIL>> # All rights reserved. # # This code is licensed under the MIT License. # # 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 withou...