content
stringlengths
5
1.05M
#!/ usr/bin/env # coding=utf-8 # # Copyright 2019 ztosec & https://www.zto.com/ # # 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 r...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ tenxtools.svgfigure ~~~~~~~~~~~~~~~~~~~ SVG Figure @Copyright: (c) 2018-09 by Lingxi Chen (chanlingxi@gmail.com). @License: LICENSE_NAME, see LICENSE for more details. """ from svglib.svglib import svg2rlg from reportlab.graphics import renderPDF, ...
# -*-coding: utf-8 -*- """ https://github.com/PanJinquan/Face_Detection_Recognition @Project: IntelligentManufacture @File : image_processing.py @Author : panjq @ E-mail: pan_jinquan@163.com @Date : 2019-02-14 15:34:50 """ import os import glob import cv2 import numpy as np import matplotli...
# UI Style Lang Copyright (c) 2020 Noah Rahm, Correct Syntax. # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, # this list of condit...
"""The all pair shortest path algorithm is also known as Floyd-Warshall algorithm is used to find all pair shortest path problem from a given weighted graph. As a result of this algorithm, it will generate a matrix, which will represent the minimum distance from any node to all other nodes in the graph. """ """For bet...
import pygame vector = pygame.math.Vector2 from PIL import Image import numpy as np from random import uniform, randint from pygame.locals import K_LEFT, K_RIGHT, K_UP, K_DOWN from uuid import uuid4 as uuid from .checkpoint import Checkpoint from .nn import NN from .nn import mate as nn_mate im = Image.open('assets/c...
# coding: utf-8 import os import cv2 import time def cap_image(folder_t=time.localtime(), note='na'): folder_t_str = time.strftime("%Y_%m_%d", folder_t) file_t = time.localtime() file_t_str = time.strftime("%Y_%m_%d_%H_%M_%S", file_t) target_folder = f'{folder_t_str}' fname = f'{file_t_str}_{note}...
from pathlib import Path from pprint import pprint from decorators import requires_root, requires_docker_home_argument from infrastructure.image_locator import ImageLocator @requires_root @requires_docker_home_argument def run_show_image_history(args, image_mountpoint: Path, docker_home: Path): image_locator = I...
#!/usr/bin/env python import rospy import sys import cv2 import cv2.cv as cv from std_msgs.msg import String from sensor_msgs.msg import Image, CameraInfo from cv_bridge import CvBridge,CvBridgeError import numpy as np scale =1 delta = 0 ddepth = cv2.CV_16S class canny_operator(): def __init__(self,node_name): ...
from .agent import * from .component import * from .network import * from .utils import * from gym.envs.registration import register register( id='RiskChain-v0', entry_point='deep_rl.component.envs:RiskChain', )
"""@defgroup pycamunda pycamunda """ import logging logging.getLogger(__name__).addHandler(logging.StreamHandler())
# -*- coding: utf-8 -*- from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.utils.translation import ugettext_lazy as _ class ParameterModel(models.Model): """A simple parameter in a funcion. Has the param n...
class IFiltro(object): def __init__( self ): raise NotImplementedError( "Should have implemented this" ) def calculaPrediccion( self ): raise NotImplementedError( "Should have implemented this" ) def calcula_Prediccion_Cuarto( self ): raise NotImplementedError( "Should have implement...
class ConnectionError(Exception): def __init__(self, error): message = f'Connection error: {error}.' super().__init__(message)
import os import requests import pprint from signalwire.voice_response import VoiceResponse, Say, Gather, Record from flask import Flask,request app = Flask(__name__) # Entry point for incoming calls, prompts to leave a voice mail for processing. @app.route('/voice_entry', methods=['GET', 'POST']) def voice_entry():...
# Generated by Django 2.2.4 on 2020-03-24 00:42 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
import pandas as pd import tempfile import inspect import pypipegraph as ppg from pathlib import Path import time import re import pickle import zipfile import os import json import base64 from . import WideNotSupported settings = None def apply_ovca_settings(): global settings if settings is not None and s...
__version__ = '2.35.2'
#!/usr/bin/env python import sys #import matplotlib #matplotlib.use('GTK') #from matplotlib.figure import Figure #from matplotlib.axes import Subplot #from matplotlib.backends.backend_gtk import FigureCanvasGTK, NavigationToolbar #from matplotlib.numerix import arange, sin, pi import ConfigParser import os try...
from Data.data_utils import TreeNode, Vocab, VAR def normalize(exp: TreeNode, vocab: Vocab) -> (TreeNode, dict): """ the method (inplace) renames variables in the expression according to the order they appear. :param exp: the expression, as tree :param vocab: the vocabulary, all variables present in e...
# coding=utf-8 from django.apps import AppConfig class BriefConfig(AppConfig): name = 'brief'
""" =========== classify.py =========== This module contains functionality for classifying nanopore captures. """ import os import re from abc import ABC, abstractmethod from dataclasses import dataclass from pathlib import PosixPath from typing import * # I know people don't like import *, but I think it has benefi...
#coding:utf-8 headers = {"Content-Type": "application/json"} data = { "jsonrpc": "2.0", "id": 1, }
#!/usr/bin/env python import os import argparse import sys import pandas as pd import numpy as np # function to find the maximum/minimum # in a list that is currently in #string format def max_min(str_list, str_del,func, abval=False): if len(str_list) == 0: return np.NaN elif str_list == "False": return np.Na...
import cdms2 import MV2 from distarray.mvCubeDecomp import CubeDecomp import numpy import cdutil from mpi4py import MPI import sys fnm=sys.prefix+'/sample_data/clt.nc' # open file and read data try: clt = cdms2.open(fnm)['clt'] except: clt = cdms2.open('/home/pletzer/modave/cdat_tests/clt.nc')['clt'] def getPr...
# =========================================================================== # Copyright 2013 University of Limerick # # This file is part of DREAM. # # DREAM is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Founda...
"""Scanner for scanning filesystems data to elasticsearch.""" __author__ = """Alex Manning""" __contact__ = "alexander.manning@stfc.ac.uk" __copyright__ = "Copyright 2022 United Kingdom Research and Innovation" __license__ = "BSD - see LICENSE file in top-level package directory"
#!/usr/bin/env # -*- coding: utf-8 -*- """ Copyright 2017-2018 Jagoba Pérez-Gómez 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 ...
""" passenger_wsgi.py script to switch to python3 and use Bottle To reload: $ touch tmp/restart.txt (or) $ make touch """ import sys import os import os.path # Use python of choice DESIRED_PYTHON = 'python3.9' DREAMHOST_PYTHON_BINDIR = os.path.join( os.getenv('HOME'), 'opt/python-3.9.2/bin') if DREAMHOST_PYTH...
import tkinter as tk import time import locale try: locale.setlocale(locale.LC_ALL, "esp") except: locale.setlocale(locale.LC_ALL, "es_ES") ROOT = tk.Tk() ROOT.geometry("350x110") ROOT.title("Hora actual") ROOT.configure(bg="Black") fecha = time.strftime("%A, %d de %B de %Y") lblFecha = tk.Label(ROOT, text=f...
#!/usr/bin/env python3 import zmq import sys import time t = float(sys.argv[1]) def sink(): context = zmq.Context() socket_sink = context.socket(zmq.REQ) socket_sink.hwm = 10 socket_sink.connect("tcp://127.0.0.1:5001") while True: socket_sink.send(b'request') msg = s...
import re class Substitution: """ A substitution to be performed on a piece of text. """ def __init__(self, pattern, replacement, is_multiline): """ Initialize the Substitution: pattern: the pattern to match as will be passed to 're.sub'. replacement: the argum...
import re from collections import namedtuple import sublime Branch = namedtuple("Branch", ( "name", "remote", "name_with_remote", "commit_hash", "commit_msg", "tracking", "tracking_status", "active", "description" )) class BranchesMixin(): def get_branches(self, sort_by_rece...
import unittest from graph_peak_caller.shiftestimation.shift_estimation_multigraph import MultiGraphShiftEstimator import numpy as np import logging class TestMultiGraphShiftEstimation(unittest.TestCase): def test_simple(self): shift = 150 genome_size = 10000000 n_peaks = 400 pos...
import coremltools folder = 'EmotionClassification' coreml_model = coremltools.converters.caffe.convert( (folder + '/EmotiW_VGG_S.caffemodel', folder + '/deploy.prototxt'), image_input_names = 'data', class_labels = 'emotions.txt' ) coreml_model.author = 'Gil Levi and Tal Hassner' coreml_model.license = '...
# -:- encoding: utf-8 -:- # This file is part of the MapProxy project. # Copyright (C) 2013 Omniscale <http://omniscale.de> # # 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.a...
PREPROCESSING = { "data_file": "data/3day.1000.w2v.50d.twitter.csv", "date_format": "%d/%m/%Y",# "%Y-%m-%d", "test_split": 0.2, "difference": 0, "deseason": 0, "seasonal_period": 7, "log_dep_var": False, "log_indep_var": False, "horizon": 7, ...
"""Constants for the Roku integration.""" DEFAULT_PORT = 8060
from Cryptodome.Hash import SHA3_256 as sha class AESKey: def __init__(self, iv: str, key: str): self._iv: bytes = sha.new().update(iv.encode()).digest()[0:16] self._key: bytes = sha.new().update(key.encode()).digest() @property def IV(self) -> bytes: return self._iv ...
from rest_framework import serializers from core.models import Tag, Ingridient, Recipe class TagSerializer(serializers.ModelSerializer): """Serializer for tag object""" class Meta: model = Tag fields = ('id', 'name') read_only_fields = ('id',) class IngridientSerializer(serializers....
import os # disable autotune os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0' from tqdm import tqdm import numpy as np import mxnet as mx from mxnet import gluon import gluoncv from gluoncv.model_zoo.segbase import * from gluoncv.model_zoo import get_model from gluoncv.data import ms_batchify_fn from gluoncv.utils.vi...
import sys :q
""" Import Graph module """ import os import ast from scalpel.core.source_visitor import SourceVisitor class Tree: # a datastructure that contain information for a tree node # to be named def __init__(self, name): self.name = name self.full_name = "" self.children = [] ...
from common import * def simulate(HMM,desc='Truth & Obs'): """Generate synthetic truth and observations.""" Dyn,Obs,chrono,X0 = HMM.Dyn, HMM.Obs, HMM.t, HMM.X0 # Init xx = zeros((chrono.K+1,Dyn.M)) xx[0] = X0.sample(1) yy = zeros((chrono.KObs+1,Obs.M)) # Loop for k,kObs,t,dt in progbar(chrono.t...
import paddle from paddle.io import Dataset import numpy as np BATCH_SIZE = 64 BATCH_NUM = 20 class DataIterator(Dataset): """ 步骤一:继承paddle.io.Dataset类 """ def __init__(self, source, batch_size=256): super().__init__() self.file_source = source self.batch_size = batch_size ...
from .sk import ServerSocket from .packet import Packet import random class Client : def __createSocketId(self, length=7, step=3) : random_hash = 0 for _ in range(step) : random_hash += random.random() return str(random_hash).split(".")[1][:length] def __init__(self, cli...
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2017-10-27 09:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("registrations", "0008_auto_20170928_1025")] operations = [ migrations.AlterField( ...
import json from pathlib import Path from oauth2client.service_account import ServiceAccountCredentials from googleapiclient import errors, discovery from lifeloopweb import config, logging CONF = config.CONF LOG = logging.get_logger(__name__) TYPE = 'service_account' AUTH_URI = 'https://accounts.google.com/o/oauth2/...
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_combo_jsonapi import Api, ResourceDetail, ResourceList from sqlalchemy import String, func, Integer, Float from sqlalchemy.dialects.postgresql import ARRAY from marshmallow_jsonapi.flask import Schema from marshmallow_jsonapi import fields # S...
from __future__ import print_function import numpy as np import errno import os import glob import sys import datetime import time from PIL import Image from zipfile import ZipFile from scipy.optimize import differential_evolution import matplotlib.pyplot as plt import seaborn as sns sns.set_style('darkgrid') try: ...
# Generated by Django 3.1.6 on 2021-02-15 16:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('alarm', '0031_ping'), ] operations = [ migrations.AddField( model_name='ping', name='consecutive_failures', ...
# # PySNMP MIB module CHIPMODULE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CHIPMODULE-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:48:57 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2...
import unittest import numpy as np from datetime import datetime, timedelta from hagelslag.data.ModelOutput import ModelOutput from hagelslag.processing.tracker import label_storm_objects, extract_storm_objects from hagelslag.processing.TrackProcessing import TrackProcessor from hagelslag.processing.ObjectMatcher impor...
import asyncio import sys from easylap import UnicastClient async def main(): client = UnicastClient(callback=lambda m: client.logger.info('Received: {}'.format(m))) # FIXME: Bad design: if create_endpoint is not called BEFORE browse_for_service, there will be no ping task # FIXME: We should not create an endpo...
import os os.system("clear") def banner(): print("\033[1;36;40m_ _ _") print("| |_ ___ _ __ _ __ ___ _ ___ __ | |__ __ _ ___| | _____ _ __") print("| __/ _ \ '__| '_ ` _ \| | | \ \/ / | '_ \ / _` |/ __| |/ / _ \ '__|") print("| || __/ | | | | | | | |_| |> <...
############################################################################## # Copyright (c) 2016 Juan Qiu and others # juan_ qiu@tongji.edu.cn # 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 distributi...
import argparse import os from scipy import stats import deepfake from figures import profiles_viz from CellData import CellData import numpy as np import pandas as pd import random from shutil import copyfile def get_options(): parser = argparse.ArgumentParser(description='Version: 1.0') parser.add_argument('...
from src.services.actions.base_action import BaseAction class DummyAction(BaseAction): def perform(self) -> None: pass
import numpy as np def pmx(individual1, individual2, gene1=None, gene2=None): """ Creates a new individual by recombinating two parents using the Partially Mapped Crossover (PMX) method. Args: parent1 (np.array): First parent. parent2 (np.array): Second parent. Returns: n...
import torch from torch.autograd import Variable from models.moran import MORAN MORAN = MORAN(1, 37, 256, 32, 100, BidirDecoder=True, inputDataType='torch.FloatTensor', CUDA=False) input_data = Variable(torch.rand(1, 1, 64, 256)) text = Variable(torch.LongTensor([0, 0])) text_rev = text length = Variable(torch.LongTen...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __project__ = 'leetcode' __file__ = '__init__.py' __author__ = 'king' __time__ = '2020/1/10 22:37' _ooOoo_ o8888888o 88" . "88 (| -_- |) ...
"""Define the LinearRunOnce class.""" from openmdao.solvers.linear.linear_block_gs import LinearBlockGS class LinearRunOnce(LinearBlockGS): """ Simple linear solver that performs a single iteration of Guass-Seidel. This is done without iteration or norm calculation. """ SOLVER = 'LN: RUNONCE' ...
""" Copyright (C) University of Science and Technology of China. Licensed under the MIT License. """
from sqlalchemy import create_engine class MsSql(object): def __init__(self, host=None, db_name=None, user=None, pw=None, driver=None): self.conn = '' self.cursor = '' self.host = host self.db_name = db_name self.user = user self.pw = pw self.driver = driver...
# Copyright 2018 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 agreed to in writing, s...
__title__ = 'yahoo_weather' __description__ = 'Python library for yahoo weather new API' __url__ = 'https://github.com/M-Ahadi/yahoo_weather' __version__ = '1.0.8' __author__ = 'Mojtaba Ahadi' __author_email__ = 'm.ahadi@outlook.com' __license__ = 'Apache 2.0'
# -*- coding: utf-8 -*- """Climate indices computation package based on Xarray.""" from importlib.resources import path from xclim.core import units # noqa from xclim.core.indicator import build_indicator_module_from_yaml from xclim.core.options import set_options # noqa from xclim.indicators import atmos, land, sea...
from opentrons import protocol_api from opentrons.protocols.types import APIVersion from opentrons_functions.transfer import add_buffer metadata = { 'apiLevel': '2.5', 'author': 'Jon Sanders'} api_version = APIVersion(2, 5) cols = ['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A11',...
""" Tests for NWISWeb service calls. """ from types import GeneratorType from unittest import TestCase, mock from waterdata.services.nwis import NwisWebServices from ..rdb_snippets import SITE_RDB, PARAMETER_RDB class TestNwisWebServices(TestCase): def setUp(self): self.service_root = 'https://fake.nwi...
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A test runner for gtest application tests.""" import argparse import ast import logging import os import sys _logging = logging.ge...
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # 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 # lis...
import logging # Logger used by `importmod` logger = logging.getLogger(__name__)
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import logging from typing import Type, Optional, Dict, Any from fbpcs.pl_coordinator.pl_graphapi_utils...
""" Can keep pipelines in memory without constant read/writes for map, reduce, filter but when we get to an aggregate/execute we need to read everything at once and from disk: we can't keep everything in memory at that point do a `.partition(write_batch_size).map(write_to_aggregation_file_return_ids).partition(all_data...
""" A jenkins build represents a single execution of a Jenkins Job. Builds can be thought of as the second level of the jenkins heirarchy beneath Jobs. Builds can have state, such as whether they are running or not. They can also have outcomes, such as wether they passed or failed. Build objects can be associated wit...
from django.shortcuts import render from datetime import datetime from django.core.mail import send_mail from django.contrib import messages from django.conf import settings from contactForm.models import Contact from PortfolioContact.tasks import send_mail_to_admin, send_mail_to_user # Create your views here. def ...
# -*- coding: utf-8 -*- """ Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with url parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file and with no dependencies...
XXXXBB BBBBBBBBBBBB XXXXXBBBBBBB BBBBBBBBBBBBBBB XXXXXXXXBBBBBX BB BBBBBBBXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXBBBBB FFFF XXXXXX
from threading import Thread from flask import Blueprint from flask import abort from flask import redirect from flask import current_app from app import db from app.models import Url from app.models import Used bp = Blueprint( name="warp", import_name="warp", url_prefix="", ) def add_used(context, co...
import torch import torch.nn.functional as F from torch import nn # Import losses from .lovasz_losses import lovasz_softmax_flat ######################################################################### ### Loss Wrappers class LossWrapper(nn.Module): """LossWrapper creates a nn.Module object that allows to prepr...
from pyscalambda.formula import Formula from pyscalambda.utility import convert_operand class GetAttr(Formula): def __init__(self, value, name): """ :type value: Formula :type name: str """ super(GetAttr, self).__init__() self.value = value self.name = name...
"""Module that is the entry point from the interaces to invoke the GUI. """ def run_gui(): """Function that is the entry point into the GUI package. This is the function that will invoke and execute the GUI. """ print("GUI not implemented yet!") def _gui_helper(): """Example of internal helper f...
from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import argparse from bullet_journal import __prefix__, utils def add(date): utils.is_valid_date(date) directory = f'{__prefix__}/resources/{date}/add' utils.ensure_directory(directory) content = ...
import json import logging from pathlib import Path from joblib import Parallel, delayed from snips_nlu_metrics.utils.constants import ( AVERAGE_METRICS, CONFUSION_MATRIX, INTENTS, INTENT_UTTERANCES, METRICS, PARSING_ERRORS, UTTERANCES, ) from snips_nlu_metrics.utils.exception import NotEn...
from scripts.variables.localvars import * class BlinkingTile: def __init__(self, surface, range=(25, 150, 10)): self.surface = surface # The range specifies the way it should step through opacities, range[0] is the starting opacity and the minimum # level, range[1] is the ending opacity...
from . import datasets from . import groups from . import sites from . import stats from . import inject from . import delete from . import blockreplicas from . import subscriptions from . import requestlist from . import lfn2pfn from . import nodes from . import data from . import transferrequests export_data = {} ex...
from hops import project from hops import kafka from hops import util, constants from confluent_kafka import avro from confluent_kafka.schema_registry import SchemaRegistryClient import requests import toml import argparse ### Examples on how to interact with HopsWorks Schema Registry service ### externally from outsi...
import os.path from galaxy import config from galaxy.config import BaseAppConfiguration def test_object_store_store_by_set(): # object_store_store_by set by admin appconfig = config.GalaxyAppConfiguration(object_store_store_by="id", override_tempdir=False) assert appconfig.object_store_store_by == "id" ...
# Copyright 2022 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...
import sys, os #sys.path.insert(0, "F:\Flask\HelloWorld") sys.path.insert(0, os.path.split(os.path.realpath(__file__))[0]) from manager import app application = app
import gudhi as gd import tadasets data = tadasets.infty_sign(n=35, noise = 0.07) alpha_complex = gd.AlphaComplex(points = data) alpha_simplex_tree = alpha_complex.create_simplex_tree() print('run!') # diag_alpha = alpha_simplex_tree.persistence() # gd.plot_persistence_diagram(diag_alpha) # plt.show() # gd.plot_pe...
#Dados los catetos de un triángulo rectángulo, calcular su hipotenusa. import math cateto1 = float(input("Dime el valor del cateto 1: ")) cateto2 = float(input("Dime el valor del cateto 2: ")) hipotenusa = math.sqrt(cateto1 ** 2 + cateto2 ** 2) print("El resultado de la hipotenusa es %.2f"%(hipotenusa))
# # This file is part of Sample Database Utils. # Copyright (C) 2020-2021 INPE. # # Sample Database Utils is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. # """This file contains code utilities of Brazil Data Cubes sampledb.""" import o...
import re # Regex for matching emoji and other symbols: first line catches all # symbols in the Basic Multilingual Plane (BMP), second line catches # emoji and symbols in Supplementary Planes, third line includes # subsequent characters that modify emoji: i.e. text or emoji variant # and skin tones, so that those char...
#!/usr/bin/env python3 """ A better way to inspect filesystem usage. Look directly in the tree where the space is being taken.""" import os import re from subprocess import Popen, PIPE from argparse import ArgumentParser from operator import itemgetter def sizeof_fmt(num, suffix=''): """ Output human readabl...
# AUTO-GENERATED file from IFMapApiGenerator. Do Not Edit! from contrail_heat.resources import contrail try: from heat.common.i18n import _ except ImportError: pass from heat.engine import attributes from heat.engine import constraints from heat.engine import properties try: from heat.openstack.common imp...
from pathlib import Path import pytest import pyfqmr import numpy as np # Get the /example folder at the root of this repo EXAMPLES_DIR = Path(__file__, "..", "..", "example").resolve() def test_example(): import trimesh as tr bunny = tr.load_mesh(EXAMPLES_DIR / 'Stanford_Bunny_sample.stl') simp = pyfqm...
#!/usr/bin/env python3 import h5py from pathlib import Path import argparse import sys import numpy as np def read_potential2D(fn: Path, doplot: bool = False): fn = Path(fn).expanduser() if not fn.is_file(): print(fn, "not found", file=sys.stderr) raise SystemExit(77) with h5py.File(fn, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from nodal.core.nodes import BaseNode class Plus(BaseNode): _input_types = { -1: {'name': 'value', 'types': [int, float], 'default': 0.0} } _output_type = {'default': 0.0, 'type': float} _max_inputs = -1 def _execute(self): self._re...
from unityagents import UnityEnvironment import numpy as np ## Additional Package import torch import numpy as np from collections import deque import matplotlib.pyplot as plt # %matplotlib inline from agent import Agent # please do not modify the line below env = UnityEnvironment(file_name="Banana_Linux/Banana.x86_6...