text
stringlengths
2
999k
"""Solves the lid-driven cavity Navier-Stokes equation with user defined block_structure. Compares block solver solution with builtin FEniCS solver.""" # -*- coding: utf-8 -*- ## Future-proofing for Python3+ from __future__ import print_function ## Import preliminaries ## from dolfin import * from pfibs import * impo...
############################################################################## # # Copyright (c) 2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
#!/usr/bin/env python3 from __future__ import print_function import os import sys import time import logging import tempfile import traceback import subprocess from shutil import disk_usage, rmtree from base64 import b64decode try: import pathlib import importlib.util except ImportError: ...
import torch.nn as nn import torch from ..OrthConv import * from ..SNConv import * from ..SphereConv import * __all__ = ['cnn_D','cnn_G','cnnv1_D','cnnv1_G','cnnv2_D','cnnv2_G','set_use_bias_cnn'] USE_BIAS = False def set_use_bias_cnn(x): global USE_BIAS USE_BIAS = x class CNN_D(nn.Module): def __init_...
# Copyright (c) 2018, MD2K Center of Excellence # - Sayma Akther <sakther@memphis.edu> # 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 co...
# coding: utf-8 """ FlashArray REST API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 2.11 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re import six import typing from ...
""" This file offers the methods to automatically retrieve the graph Desulfobacter curvatus. The graph is automatically retrieved from the STRING repository. Report --------------------- At the time of rendering these methods (please see datetime below), the graph had the following characteristics: Datetime: 2021...
import sys import numpy as np import pandas as pd from loguru import logger from sklearn import model_selection from utils import dataset_utils default_settings = { 'data_definition_file_path': 'dataset.csv', 'folds_num': 5, 'data_random_seed': 1509, 'train_val_fraction': 0.8, 'trai...
#!/usr/bin/env python # Copyright 2016 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/LICENSE-2.0 # # Unless required by applicable la...
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.5.1 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # MODFLOW 6 Tutorial 3: Observation packages # # ## ...
''' Module containing shared constants for CoG installation. ''' import os COG_SECTION_DEFAULT = 'DEFAULT' SECTION_DEFAULT = 'installer.properties' SECTION_ESGF = 'ESGF' SECTION_EMAIL = 'EMAIL' ESG_CONFIG_DIR = os.getenv("esg_config_dir","/esg/config") ESGF_PROPERTIES_FILE = '%s/esgf.properties' % ESG_CONFIG_DIR ESGF...
""" Basic building blocks for generic class based views. We don't bind behaviour to http method handlers yet, which allows mixin classes to be composed in interesting ways. """ from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.http import Http404 from rest_framewor...
#!/usr/bin/env python2.7 # # Original version supplied to me (Kano/kanoi) by xiangfu # # Modified to allow supplying the data to send # # Linux usAge: ./ubstest.py /dev/ttyUSB0 0xhexcodes|string|icarus # OR python ubstest.py /dev/ttyUSB0 0xhexcodes|string|icarus # # Windows usAge: ./ubstest.py COM1 0xhexcodes|string|...
# 在二叉树中,根节点位于深度 0 处,每个深度为 k 的节点的子节点位于深度 k+1 处。 # # 如果二叉树的两个节点深度相同,但父节点不同,则它们是一对堂兄弟节点。 # # 我们给出了具有唯一值的二叉树的根节点 root,以及树中两个不同节点的值 x 和 y。 # # 只有与值 x 和 y 对应的节点是堂兄弟节点时,才返回 true。否则,返回 false。 # #   # # 示例 1: # # # 输入:root = [1,2,3,4], x = 4, y = 3 # 输出:false # 示例 2: # # # 输入:root = [1,2,3,null,4,null,5], x = 5, y = 4 # 输出:true...
#!/usr/bin/env python3 """ Copyright (C) 2021-2022 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 applic...
from CalibTracker.SiStripCommon.shallowTree_test_template import * process.TFileService.fileName = 'test_shallowRechitClustersProducer.root' process.load('RecoTracker.TrackProducer.TrackRefitters_cff') process.load('CalibTracker.SiStripCommon.ShallowRechitClustersProducer_cfi') process.testTree = cms.EDAnalyzer( "S...
#Imports import pygeoip import re #city def geo_city(x): #Read in MaxMind binary files, storing in memory for speed ip4_geo = pygeoip.GeoIP(filename = "/usr/share/GeoIP/GeoIPCity.dat", flags = 1) ip6_geo = pygeoip.GeoIP(filename = "/usr/share/GeoIP/GeoLiteCityv6.dat", flags = 1) #Create output object out...
import inspect import logging import sys import time from collections import defaultdict from enum import Enum from ignite._utils import _to_hours_mins_secs IS_PYTHON2 = sys.version_info[0] < 3 class Events(Enum): """Events that are fired by the :class:`~ignite.engine.Engine` during execution.""" EPOCH_STAR...
import unittest import skimage.io import numpy as np from detector import Detector detector = Detector("../weight/mask_rcnn_fashion.h5", "detection") image_input = [10,10,20,20] class TestDetector(unittest.TestCase): def test_detection(self): # Test with image fashion image = skimage.io.imread("test.jpg") det...
#!/usr/bin/env python """ " hmerge.py " " Copyright (c) 2019 Peter Lenkefi " Distributed under the MIT License. " " A Python script to merge C++ header files into a single-header release. " Type hmerge --help or hmerge -h for options. """ import argparse import datetime import enum import glob import json impo...
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# (c) Copyright [2018] Micro Focus or one of its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
""" Deep Attention Matching Network """ import sys import os import six import numpy as np import time import multiprocessing import paddle import paddle.fluid as fluid import reader as reader from util import mkdir import evaluation as eva import config try: import cPickle as pickle #python 2 except ImportError ...
import cloudpickle import queue import threading import time from typing import Any import pytest import prefect from prefect import context from prefect.configuration import Config from prefect.utilities.context import Context def test_context_sets_variables_inside_context_manager(): """ Tests that the con...
# -*- coding: utf-8 -*- """ admin.py ~~~~~~~~~~~~~~ Admin pages/actions. :copyright: (c) 2016 by fengweimin. :date: 16/6/10 """ from flask import Blueprint admin = Blueprint("admin", __name__)
from __future__ import unicode_literals from django.db import models class Noun(models.Model): class Meta: unique_together = ( ('word', 'gender'), ) ordering = ('word', 'gender') GENDERS = ( ('m', 'Maskulin'), ('f', 'Feminin'), ('n', 'N...
#!/usr/bin/env python3 """ Author : echoappletree <echoappletree@localhost> Date : 2021-01-30 Purpose: Rock the Casbah """ import argparse import sys # -------------------------------------------------- def get_args(): """Get command-line arguments""" parser = argparse.ArgumentParser( descripti...
# Copyright 2019 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...
def length_of_longest_substring(s: str) -> int: """ The most obvious way to do this would be to go through all possible substrings of the string which would result in an algorithm with an overall O(n^2) complexity. But we can solve this problem using a more subtle method that does it with one linear tr...
# coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
import pandas as pd import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import sklearn from sklearn.model_selection import train_test_split from sklearn import svm from sklearn.linear_model import LinearRegression import seaborn as sns # Loading dataset df = pd.read_csv('data/...
from bk7084 import Window, app from bk7084.math import Vec3, Mat4 from bk7084.misc import PaletteDefault as Palette # Setup window and add camera from bk7084.scene import Mesh, Building, Component, Scene from bk7084.scene.mesh import SubMesh window = Window("BK7084: Construction", width=1024, height=1024) # window.cr...
import requests from beastx.Configs import Config from . import * @fire.on(admin_cmd(pattern="hero (.*)")) async def _(event): if event.fwd_from: return input_str = event.pattern_match.group(1) url = "https://superhero-search.p.rapidapi.com/" querystring = {"hero": input_str} i...
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-03-13 17:33 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('seats', '0012_auto_20180206_1936'), ] operations = [ migrations.RemoveField( ...
from pathlib import Path from typing import Optional, List, Type, Dict, Text, Any from unittest.mock import Mock import numpy as np import pytest import tests.core.test_policies from _pytest.monkeypatch import MonkeyPatch from _pytest.logging import LogCaptureFixture from rasa.core.constants import POLICY_MAX_HISTORY...
from __future__ import unicode_literals import sys from .common import InfoExtractor from ..utils import ExtractorError class CommonMistakesIE(InfoExtractor): IE_DESC = False # Do not list _VALID_URL = r'''(?x) (?:url|URL)$ ''' _TESTS = [{ 'url': 'url', 'only_matching': Tru...
# -*- coding: utf-8 -*- import re from ..base.simple_downloader import SimpleDownloader class CloudzillaTo(SimpleDownloader): __name__ = "CloudzillaTo" __type__ = "downloader" __version__ = "0.13" __status__ = "testing" __pyload_version__ = "0.5" __pattern__ = r"http://(?:www\.)?cloudzilla\...
#!/usr/bin/env python3 """ Bottle-style decorator for exposing functions via class-based tornado handlers, which may support concurrency. Right now only supports 'get'. by Dennis Toddenroth, 2022 Usage: from random import random from json import dumps from web import route, run @route("/","application/json") de...
<warning descr="Key 'name' has no corresponding argument">"{name}"</warning>.format() <warning descr="Key 'foo' has no corresponding argument">'{foo}'</warning>.format(boo=1)
import warnings from django.contrib.auth.models import Permission from django.shortcuts import render def insufficient_permissions(request): context = {} perm = request.session.get('failed_permission') if perm: # convert that into the actual Permission object ct, codename = perm.split('.'...
from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup(name='FContin', version='0.1', description='Numerical continuation using just the function', url='https://github.com/gpavanb1/FContin', author='gpavanb1', author_email='gpavanb@gmail.co...
# Author: Nikolay Mayorov <n59_ru@hotmail.com> # License: 3-clause BSD import numpy as np from scipy.sparse import issparse from scipy.special import digamma from ..metrics.cluster import mutual_info_score from ..neighbors import NearestNeighbors, KDTree from ..preprocessing import scale from ..utils import check_ran...
from libs.aws.sgs import get_security_groups from libs.db_context import DBContext from models.sgs import FreeSgs from settings import settings def sgs_sync_cmdb(): """没有和任何资源关联的安全组数据同步""" sgs_list = get_security_groups() with DBContext('w') as session: session.query(FreeSgs).delete(synchronize_se...
# -*- coding: utf-8 -*- # Scrapy settings for report_spider project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/...
# 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 ...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright © 2014 OnlineGroups.net and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this d...
from urllib.error import URLError import pytest from project0 import project0 # test fetchincident.py def test_fetchincidents(): url = "https://www.normanok.gov/sites/default/files/documents/2021-03/2021-03-04_daily_incident_summary.pdf" try: project0.fetchincidents(url) except URLError: ...
# -*- coding: utf-8 -*- import warnings from django.http import HttpRequest from django.template import ( Context, Engine, RequestContext, Template, Variable, VariableDoesNotExist, ) from django.template.context import RenderContext from django.test import RequestFactory, SimpleTestCase, ignore_warnings from djang...
"""যখন স্বাধীনভাবে কোন পাইথন স্ক্রিপ্টকে রান করানো য় তখন স্বয়ংক্রিয়ভাবে এর জন্য একটি __name__ নামের ভ্যারিয়েবল তৈরি হয় যার ভ্যালু সেট করা হয় স্ট্রিং "__main__" . """ def my_module_func(): print("Abdullah Al Noman") if __name__ == "__main__": print("Noman") print("It will be printed")
import sys sys.path.insert(0, '../') sys.path.insert(0, '../src/lib/') from models.model import create_model, load_model import datasets.dataset.jde as datasets import torch import numpy as np import cv2 import os import os.path as osp from models.networks.pose_dla_repvgg_conv import DLASeg #.DLASeg as repvgg_dla_seg...
import itertools import random import logging import numpy as np import matplotlib.pyplot as plt import os from mnist_stdp_multiple_baseline import * from utilis import * from args_mnist import args as my_args # from ax import optimize import pandas as pd from itertools import product import time if __name__ == '__ma...
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-08-02 07:35 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0004_auto_20170801_1139'), ] operations = [ migrations.AlterFie...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
import nengo import numpy as np # this is a dummy environment with a simple sensor and motor class ExampleIO: def __init__(self): self.data = 0.0 def sensor(self): return self.data + np.random.normal(0, 0.1) def motor(self, x): self.data += x * 0.001 io = ExampleI...
import abc class Miner(object): def __init__(self): pass @abc.abstractmethod def clean(self, terms): return terms @abc.abstractmethod def mine(self, text, offset): return text.split() @abc.abstractmethod def postprocess(self, terms): return terms @a...
"""Sites hosted on Github""" import base64 import json import os.path import re import time import typing from datetime import datetime import jwt import requests from flask import current_app from ghapi.all import GhApi from interpersonal.errors import InterpersonalNotFoundError from interpersonal.sitetypes import ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-06-01 22:04 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('chembddb', '0016_data_verification'), ] operations = [ migrations.RemoveFie...
import unittest from unittest.mock import * from src.time import * class CheckerTest(unittest.TestCase): def test_checker_before_17(self): checker = Checker() checker.env.getTime = Mock(name='getTime') checker.env.getTime.return_value = 11 checker.env.resetWav = Moc...
import networkx as nx import EoN from collections import defaultdict import matplotlib.pyplot as plt import scipy import random N=10**6 tau = 1. gamma = 1. colors = ['#5AB3E6','#FF2000','#009A80','#E69A00', '#CD9AB3', '#0073B3','#F0E442'] print('setting up --- requires a large network to make clear that effect is rea...
from user import User from user import Credential import unittest class TestUser(unittest.TestCase): def setUp(self): self.new_user = User( 'paul', 'pal', 'wasongapaul5@gmail.com', '0791555693', '12081998') def test__init__(self): self.assertEqual(self.new_user.first_name, 'paul'...
import gc import os import sys import emcee import numpy as np import matplotlib.pyplot as plt from multiprocessing import Pool, get_context from covid19model.visualization.optimization import traceplot from covid19model.visualization.output import _apply_tick_locator from covid19model.models.utils import stratify_beta...
from core.advbase import * from slot.a import * def module(): return Sinoa class Sinoa(Adv): a1 = ('a',0.13,'hp100') a3 = ('bt',0.2) conf = {} conf['acl'] = ''' `dragon, s=1 `s3, not self.s3_buff `s1 `s2 `s4 ''' coab = ['Dagger2', 'Gala_Sarisse', 'M...
# 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. # C...
"""Support for HomematicIP Cloud switches.""" import logging from typing import Any, Dict from homematicip.aio.device import ( AsyncBrandSwitchMeasuring, AsyncFullFlushSwitchMeasuring, AsyncHeatingSwitch2, AsyncMultiIOBox, AsyncOpenCollector8Module, AsyncPlugableSwitch, AsyncPlugableSwitchM...
import asyncio import gc import time import json from unittest import mock from contextlib import contextmanager import pytest from aiokafka.abc import ConsumerRebalanceListener from aiokafka.consumer import AIOKafkaConsumer from aiokafka.consumer.fetcher import RecordTooLargeError, FetchRequest from aiokafka.consume...
#!/usr/bin/env python3 # Copyright (c) 2014-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 the importprunedfunds and removeprunedfunds RPCs.""" from test_framework.test_framework import Uni...
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
""" Module that handles the command line arguments. """ import sys from argparse import _ArgumentGroup, ArgumentParser, Namespace from spotdl import _version from spotdl.download.progress_handler import NAME_TO_LEVEL from spotdl.utils.ffmpeg import FFMPEG_FORMATS from spotdl.utils.config import DEFAULT_CONFIG from s...
''' @author: l4zyc0d3r People who are happy makes other happy. I am gonna finish it slowly but definitely.cdt ''' class Solution: def suggestedProducts(self, P: List[str], sW: str) -> List[List[str]]: P.sort() prfx, ans = '', [] for c in sW: prfx+=c i = bisect.bisec...
import unittest import tempfile import os from gimmemotifs.prediction import PredictionResult from gimmemotifs.motif import read_motifs from gimmemotifs import rocmetrics from time import sleep class TestStats(unittest.TestCase): """ A test class to test motif stats """ def setUp(self): self.data_dir ...
# -*- coding: utf-8 -*- # Copyright 2022 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pi_web.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are y...
# -*- coding: utf-8 -*- """ Created on Thu Dec 24 13:16:19 2020 @author: Javier Fumanal Idocin (Fuminides) """ import numpy as np from imblearn.over_sampling import SMOTE, ADASYN, BorderlineSMOTE from imblearn.combine import SMOTEENN, SMOTETomek import Fancy_aggregations as fz from .. import bci_architectures as ath...
from testconfig import config from django.utils.unittest import skipIf from iml_common.lib.name_value_list import NameValueList from tests.integration.core.chroma_integration_testcase import ChromaIntegrationTestCase @skipIf(config.get('simulator'), 'RealRemoteOperations cant fake out ssh') class TestHostValidations(...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy from collections import defaultdict from astropy.cosmology.connect import convert_registry from astropy.cosmology.core import Cosmology from astropy.table import QTable, Row from .mapping import from_mapping def from_row(row, *, move_to_me...
import os, random def get_folders(): listdir=os.listdir() folders=list() for i in range(len(listdir)): if listdir[i].find('.') == -1: folders.append(listdir[i]) return folders def clean_audio(allie_dir, clean_dir): os.chdir(allie_dir) os.system('python3 allie.py --command clean --sampletype audio --dir %...
from unittest import TestCase import numpy as np import pandas as pd from copulas.multivariate.base import Multivariate from copulas.multivariate.tree import Tree, TreeTypes from copulas.multivariate.vine import VineCopula from copulas.univariate import KDEUnivariate from tests import compare_nested_dicts class Tes...
from phi import struct, math from ._geom import Geometry from ._empty import NO_GEOMETRY from ._transform import rotate from ._box import bounding_box, AABox @struct.definition() class Union(Geometry): def __init__(self, geometries, **kwargs): Geometry.__init__(self, **struct.kwargs(locals())) @stru...
"""CacheDatabase URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home'...
import logging import os import sys from flask import Flask, Response from flask.ext.compress import Compress from history.statebuffer import BufferCollection, BufferUpdater app = Flask(__name__) compress = Compress() state_buffer = None log = logging.getLogger(__name__) add_headers_cb = None try: import dcos_a...
# Copyright 2019 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...
from __future__ import division, print_function """ backend_wx.py A wxPython backend for matplotlib, based (very heavily) on backend_template.py and backend_gtk.py Author: Jeremy O'Donoghue (jeremy@o-donoghue.com) Derived from original copyright work by John Hunter (jdhunter@ace.bsd.uchicago.edu) Copyright ...
import paddlex as pdx from paddlex import transforms as T # 下载和解压昆虫检测数据集 dataset = 'https://bj.bcebos.com/paddlex/datasets/insect_det.tar.gz' pdx.utils.download_and_decompress(dataset, path='./') # 定义训练和验证时的transforms # API说明:https://github.com/PaddlePaddle/PaddleX/blob/release/2.0.0/docs/apis/transforms/transforms.m...
import sys import glob import os import time ############################################################################ ############################################################################ # helper function for input def text_input(DISPLAY): str = '' while (str == ''): str = input(DISPLAY) return s...
# -*- python -*- # This software was produced by NIST, an agency of the U.S. government, # and by statute is not subject to copyright in the United States. # Recipients of this software assume all responsibilities associated # with its operation, modification and maintenance. However, to # facilitate maintenance we as...
#!/usr/bin/env python import os from resource_management.libraries.script import Script from resource_management.libraries.functions.format import format from resource_management.libraries.functions.default import default from resource_management.libraries.functions.get_bare_principal import get_bare_principal from re...
import numpy as np import warnings warnings.filterwarnings('ignore',category=FutureWarning) import tensorflow as tf from tensorflow.contrib.training import HParams def default_hparams(): return HParams( n_vocab=0, n_ctx=1024, n_embd=768, n_head=12, n_layer=12, ) def sha...
import graphene from graphene_django.types import DjangoObjectType from .models import Tetrisroyale class MessdatenType(DjangoObjectType): class Meta: model = Tetrisroyale class Query(graphene.AbstractType): pass
from __future__ import absolute_import, unicode_literals import pickle import pytest import socket from copy import copy, deepcopy from case import Mock, patch, skip from kombu import Connection, Consumer, Producer, parse_url from kombu.connection import Resource from kombu.exceptions import OperationalError from k...
import pants import math import random import csv import sys import numpy as np import matplotlib.pyplot as plt import argparse nodes = [] invalid_lines = 0 #Traitement des arguements parser = argparse.ArgumentParser() parser.add_argument("-v", "--verbose", help="increase output verbosity", ...
from PyQt5.QtWidgets import QApplication, QPushButton, QMainWindow import sys from PyQt5 import QtGui # importing QRect to set the geometry from PyQt5.QtCore import QRect from PyQt5.QtCore import QSize # creating class class window(QMainWindow): def __init__(self): super().__init__() ...
from setuptools import setup package_name = 'rm_guard_patroller' setup( name=package_name, version='0.0.0', packages=[package_name], data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), ], ...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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. # # This program is distrib...
import argparse parser = argparse.ArgumentParser() parser.add_argument("--interactive", action="store_true") args = parser.parse_args() import trajoptpy import openravepy as rave import numpy as np import json import trajoptpy.math_utils as mu import trajoptpy.kin_utils as ku from trajoptpy.check_traj import traj_is_s...
# -*- coding: utf-8 -*- """Python phone number parsing and formatting library If you use this library, and want to be notified about important changes, please sign up to the libphonenumber mailing list at https://groups.google.com/forum/#!aboutgroup/libphonenumber-discuss. NOTE: A lot of methods in this module requir...
import os import logging from datetime import datetime, timezone from ibm_botocore.credentials import DefaultTokenManager from lithops.utils import is_lithops_function from lithops.config import CACHE_DIR, load_yaml_config, dump_yaml_config logger = logging.getLogger(__name__) class IBMIAMAPIKeyManager: def __i...
import re __all__ = ["build_prefixed_regex_pattern", "build_prefixed_regex_pattern_with_value"] def build_prefixed_regex_pattern(prefix: str, key_term: str) -> re.Pattern: """ A regular expression builder that returns a compiled regular expression that matches a string if: - An escaped `prefix` strin...
import string from otp.otpbase import OTPLocalizer from direct.directnotify import DirectNotifyGlobal from pandac.PandaModules import NSError from pandac.PandaModules import TextEncoder, TextNode notify = DirectNotifyGlobal.directNotify.newCategory('NameCheck') def filterString(str, filter): result = '' for ch...
import pandas as pd import unittest import sys sys.path.append('../lib') from survey import Survey sample_directory = '../sample_data/' def verify_survey_dtypes(survey): """ Verifies if dataframe is formed of desired data types Arguments: survey: an instance of the Survey class. Returns True on ...