text
stringlengths
3.07k
22.1k
# %% import pickle import jsonlines import nltk from nltk.tokenize import sent_tokenize from nltk import word_tokenize import numpy as np from tabulate import tabulate from mosestokenizer import * import random from random import choices import os import sys import re from collections import defaultdict as ddict from s...
# BLS_QCEW.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 ''' Pulls Quarterly Census of Employment and Wages data in NAICS from Bureau of Labor Statistics Writes out to various FlowBySector class files for these data items EMP = Number of employees, Class = Employment PAYANN = Annual payroll ($1,000), Class = Money...
# -*- coding: utf-8 -*- # @Author: liuyulin # @Date: 2018-10-16 13:52:03 # @Last Modified by: liuyulin # @Last Modified time: 2018-10-18 21:05:45 import numpy as np def calculate_next_pnt_kf(current_state, current_cov, measure_state, m...
""" User interface for the Timesheet class Command line user interface for ease of use of logging time and other functions. @author: <NAME> """ import time, os, sys, re, pendulum from pyfiglet import Figlet def clear(): """ Global function that clears the command line """ os.system('cls' if os.name ==...
#!flask/bin/python from flask import Flask, jsonify, request, abort from footballDAO import footballDAO #from flask_cors import CORS # pip install flask # pip install flask_cors # set FLASK_APP=application.py # flask run # # cmd 1 # C:\Users\micha\GMIT\52957 DATA REPRESENTATION\52957_Data_Representation_Project (mas...
# Table S6: List of differential equations of the reduced model from .name2idx import C, V def diffeq(y, t, *x): re = [0] * 25 re[1] = x[C.k1_synthesis] * (y[V.pro_IRcom] - y[V.IRcom]) re[2] = x[C.k1_InsIRcom] * y[V.Ins] * y[V.IRcom] - x[C.k2_InsIRcom] * y[V.p1IRcom] re[3] = x[C.k1_p1IRcomDeg] * y[V...
import os import telebot from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton, InputMediaPhoto from flask import Flask, jsonify, request from flask_pymongo import PyMongo from config import * from functions import * import openai bot = telebot.TeleBot(TOKEN) # Flask app = Flask(_...
import tensorflow as tf from tensorflow.python.framework import ops OP_MODULE = tf.load_op_library('./src/ops.so') def identity(input_tensor): dim = input_tensor.get_shape().as_list().__len__() return OP_MODULE.def_identity(input_tensor, dim=dim) @ops.RegisterGradient('DefIdentity') def gradients(op, grad)...
import numpy as np import theano.tensor as tt import pymc3 as pm import starry from starry._plotting import ( get_moll_latitude_lines, get_moll_longitude_lines, ) from matplotlib import pyplot as plt from matplotlib import colors from scipy import optimize np.random.seed(42) starry.config.lazy = True ydeg = ...
#!/usr/bin/env python3 """ Manage the I/O on the Raspi GPIO or simulate them """ __author__ = "<NAME>" __version__ = "1.0.20170113" __email__ = "<EMAIL>" __license__ = "MIT" import threading import binascii try: import pigpio # reference at http://abyz.me.uk/rpi/pigpio/python.html _simulation = Fals...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import dash_core_components as dcc import dash_html_components as html import dash_table import plotly.graph_objs as go import plotly.figure_factory as ff import pandas as pd import math def layout_main(datasets, app): # TODO Move logos to top of screen scaling_factor_images = 0.3 return html.Div([ ...
import matplotlib.pyplot as plt import numpy as np import os import re plotsDir = "plots" def parseOutputs(outputsFile): out = { } out["count"] = {} out["roots"] = {} out["accuracy"] = {} outputs = open(outputsFile) experiment = None value = None count = None nFailures = None ...
# -*- coding: utf-8 -*- from __future__ import division import math import datetime import urlparse import urllib import hashlib import tornado.web from tornado import gen from utils.message import Message class Gravatar1(tornado.web.UIModule): def render(self, email, size=40, image_type='jpg'): url = u...
''' Logic gate circuit elements See elements.py for information on how elements are defined. ''' import numpy as _np _gap = [_np.nan, _np.nan] _leadlen = .35 _gateh = 1. _gatel = .65 _notbubble = .12 def andgate(inputs=2, nand=False, inputnots=[], name='AND'): ''' Build n-input AND gate element definitions...
import pandas as pd import numpy as np import pymc3 as pm import matplotlib.pyplot as plt import seaborn as sns from mpl_toolkits.mplot3d import Axes3D import theano.tensor as tt def fit_spindle_density_prior(): #data from purcell data = [[85, 177], [89, 148], [93, 115], [9...
import tkinter as tk import tkinter.ttk as ttk from tkinter import simpledialog import os import requests import threading import shutil import json import urllib.request import subprocess # ------------------------------MS imports for admin privileges start--------------------------------------------------- import cty...
from math import log as ln from math import sqrt, log, exp, sin, cos, tan, pi, e from ast import literal_eval """ >>> # EXAMPLE USAGE >>> result = rpn_to_infix('3 4 2 * 1 -5 - ln 2 3 ** ** / +', VERBOSE=True) TOKEN STACK 3 ['3'] 4 ['3', '4'] 2 ['3', '4', '2'] * ['3', Node('2','*','4')] 1 ['3'...
# coding=utf-8 # 为domain识别泛化语料 from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from absl import flags from absl import logging import os, sys, time from termcolor import colored import tensorflow as tf block_list = os.path.realpath(__f...
#!/usr/bin/env python3.2 # -*- coding: UTF-8 -*- # encoding: utf-8 """ TextStat.py (C) 2009-2011 by <NAME> <http://www.cavar.me/damir/> TextStat.py is a module that provides various statistical functions for text analysis and processing, N-gram model generation, vector space model generation and processing, and so o...
# coding: utf-8 ### # @file pytorch.py # @author <NAME> <<EMAIL>> # # @section LICENSE # # Copyright © 2018-2021 École Polytechnique Fédérale de Lausanne (EPFL). # See LICENSE file. # # @section DESCRIPTION # # Helpers relative to PyTorch. ### __all__ = ["relink", "flatten", "grad_of", "grads_of", "comput...
import uuid from z3 import * import z3_shapes as shapes # Change here to use Z3 import time import z3_solver # Global constraint variables MAX_SOLUTIONS = 1000000 GROUP_PROXIMITY = 5 GLOBAL_PROXIMITY = 5 # The global grid along which elements are aligned GRID_CONSTANT = 5 def contains(a_list, a_id): try: a_lis...
'''loadconfig library helpers tox is recommented for testing this file. For partial manual run: python -m doctest lib.py -v ''' __all__ = ['addpath', 'capture_stream', 'delregex', 'dfl', 'exc', 'findregex', 'import_file', 'read_config_file', 'ppath', 'Run', 'run', 'tempdir', 'tempfile'] __author__ = '<NAME...
import sys import six import random import operator import itertools from time import sleep from datetime import datetime, timedelta from six.moves.queue import Queue, Empty from QuadReg import QuadRegExtreme, QuadRegRemoveOutliersRobust, QuadRegRemoveOutliersRansac, QuadReg # Use a reference time to convert given tim...
#coding: utf-8 import pygame, sys from pygame.locals import * import random class GameObject(pygame.sprite.Sprite): def __init__(self, screen, image): super().__init__() self.hp = 1 self.screen = screen self.screenWidth = screen.get_width() self.image = image.convert() ...
'''definition of structs for vmdfile ''' from collections import namedtuple import struct import codecs ENCODING = 'shift-jis' LEFT = '左' RIGHT = '右' # # pragma pack (1) # # typedef struct VmdHeader_t { # char vmdHeader[30]; // "Vocaloid Motion Data 0002" # char vmdModelName[20]; # } VmdHeader; header_def = s...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ # CODE NAME HERE # CODE DESCRIPTION HERE Created on 2019-09-19 at 13:16 @author: cook """ from astropy.io import fits import numpy as np import os import ccf_functions as cf # ============================================================================= # Define va...
# -*- coding: utf-8 -*- __author__ = 'alpaloma' import logging import time from json import loads, dumps from flask import request, Blueprint, current_app, render_template_string, make_response, redirect from flask_cors import CORS from flask_restful import Resource, Api, reqparse from jwcrypto import jwk from request...
# Copyright 2010-present Basho Technologies, 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 a...
import sys import click import pendulum from deploy_tools.cli import ( auto_nonce_option, connect_to_json_rpc, gas_option, gas_price_option, get_nonce, jsonrpc_option, keystore_option, nonce_option, retrieve_private_key, ) from deploy_tools.deploy import build_transaction_options fr...
"""This is a module that performs an even-grid scan ...Module author: <NAME> ...Year: 2021 ...Email: <EMAIL> """ import numpy as np import pickle import mcmc import chi2 from tqdm import tqdm from scipy.interpolate import interp1d class Result(object): """The container that stores the results for a single m ...
""" This script contains the functions to encode promoter nucleotide sequences by different methods, depending on the requirement of the neural network that will receive the encoded sequence. """ import expressyeaself.organize_data as organize from expressyeaself.utilities import check_valid_line as check_valid_line fr...
# Python3.9 # Importiamo le librerie necessarie / Import needed libreries # MQTT Protocol per inviare i dati dei sensori all'applicativo online # // to send IoT sensor data to the online applicative/dashboard import paho.mqtt.client as mqtt # Serial Protocol per connettersi e riceve dati dai sensori colleg...
import numpy as np import torch from torch import nn from tensorboardX import SummaryWriter from scipy.special import softmax import argparse import time from general_functions.dataloaders import get_loaders, get_test_loader from general_functions.utils import get_logger, weights_init, load, create_directories_from_lis...
import os import re import logging import subprocess import pandas as pd import seaborn as sns import matplotlib.pyplot as plt logger = logging.getLogger(__name__) def shell_call(command, verbose=False): """ Method that performs a shell call while not forwarding stdout and stderr. """ try: i...
import os import sys import tkinter.messagebox from pathlib import Path from threading import Thread from tkinter import Tk, Frame, Entry, Button, LabelFrame, Label, X, BOTH, YES, filedialog, Menu import requests as req from utils.audio import Audio from utils.conf import Configuration from utils.languages import Lan...
""" # # 27/08/2018 # <NAME> - Copyright © 2018. all rights reserved. """ __author__ = '<NAME>' # IMPORTS import requests import re from decimal import Decimal from socketIO_client import SocketIO from socketIO_client.transports import get_response, XHR_PollingTransport from socketIO_client.parsers import get_byte, _...
# -*- coding: utf-8 -*- import pytest from mock import Mock from bravado_core.content_type import APP_JSON from bravado_core.model import create_model_type from bravado_core.model import Model from bravado_core.response import IncomingResponse from bravado_core.response import unmarshal_response from bravado_core.sche...
'''Ceed App ===================== The main module that runs the GUI. ''' import ceed from functools import partial from os.path import join, dirname, expanduser import time from base_kivy_app.app import BaseKivyApp, run_app as run_cpl_app from base_kivy_app.graphics import HighightButtonBehavior, BufferI...
import pandas as pd import seaborn as sns import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from sklearn.manifold import TSNE from sklearn.decomposition import PCA from sklearn.model_selection import train_test_split from sklearn.model_selection import StratifiedKFold ...
#-*-encoding=utf-8-*- # Copyright 2020 The 9nFL 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 req...
import sys import os # ---------------------------------------------- # Importing data from txt file # Clear Screen # Validation - Numbers, No input # Option 4 - Search based on price of products # ---------------------------------------------- products_data = [] f = open("products.txt","r") # Open and rea...
# coding: utf-8 # In[ ]: from collections import Counter from math import log, exp import re import os import sys import numpy as np import pandas as pd from bs4 import BeautifulSoup as bs # TODO: In your final submission, set `ALPHA` # to the value you think will be optimal for predicting on # unseen ...
from flask import ( render_template, Blueprint, session, g, flash, request, redirect, url_for, abort, current_app ) from werkzeug.utils import secure_filename import os from . import db, auth bp = Blueprint("submissions", __name__) @bp.route('/course/<int:course_id>/session/<int:session_id>/assignments/<int:assi...
# -*- coding: utf-8 -*- """ @File : train.py @Time : 2019/12/4 下午7:47 @Author : yizuotian @Description : """ import argparse import os import string import sys import time import numpy as np import torch from tensorboardX import SummaryWriter from torch import optim from torch.utils.data.dataloader impo...
""" Functions to interrogate and extract buoy data from the buoys.db SQLite3 database. """ from __future__ import print_function from datetime import datetime from pathlib import Path from netCDF4 import date2num from PyFVCOM.utilities.general import PassiveStore, warn import numpy as np try: import sqlite3 ...
import datetime import pandas as pd import numpy as np #Creating a dictionary containing the data sources for the three cities CITY_DATA = { 'chicago': './chicago.csv', 'Chicago': './chicago.csv', 'New York City': './new_york_city.csv', 'New york city': './new_york_city.csv', 'new york city'...
# coding: utf8 import re import os import sys import csv import unicodedata import urllib.request from tqdm import tqdm from bs4 import BeautifulSoup def fix_auto_closing(doc): """ Auto closes meta and link tags in html document :param doc: html document :type doc: str :return: html document ...
# Copyright 2017 Battelle Energy Alliance, 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 t...
import os import scipy.io as sio import scipy.sparse as sp import numpy as np import random dir_path = 'toy_sample/' def print_shape(): adj_files = ["adj.mat", "adj_gap_top5.mat"] for file in adj_files: data = sio.loadmat(dir_path+file) print(data.keys()) for k in data.keys(): ...
import json import pandas as pd from utils.Code_dictionary import CodeDictionary import os import numpy as np from utils.utils import nms, check_in, show_and_save_images, check_in_filter import shutil import glob def prio_check(prio_lst, code_lst): idx_lst = [] for code in code_lst: assert code in pri...
'''generic functions related to Davis-Putnam not specific to sudoku''' import time import logging from collections import defaultdict import pickle # constants U = 0 Y = 1 N = -1 EYE = lambda x: x # classes class State: '''container for our solver state''' rules: dict facts: dict occurrences: dict ...
import json import typing as t import gql_alchemy.schema as s import gql_alchemy.types as gt class Resolver: def __init__(self, for_type: t.Optional[str] = None) -> None: if for_type is not None: self.for_gql_type = for_type else: name = type(self).__name__ if ...
import warnings from pathlib import Path from tempfile import TemporaryDirectory from typing import List from urllib.parse import urldefrag import pyshacl import rdflib from rdflib import RDF, RDFS, DCTERMS, OWL from nanopub import Publication, NanopubClient from rdflib.tools.rdf2dot import rdf2dot from fairworkflows...
from contextlib import contextmanager from datetime import datetime import getpass import logging from multiprocessing import Process import os import platform import signal import sys import time import random from pymongo.errors import ConnectionFailure from mtq.log import MongoStream, MongoHandler from mtq.utils i...
# -*- coding: utf-8 -*- import json import logging import requests import time from requests import ReadTimeout from odoo import api, fields, models from odoo.exceptions import UserError _logger = logging.getLogger(__name__) class DingDingReportUser(models.Model): _name = 'dingding.report.user' _description ...
import datetime import json import os import sys import random import time from subprocess import call import uuid import threading import requests import platform import re #含有信息打印的延迟 def waitingSeconds(sleepNumber): print("请等待{}s".format(sleepNumber)) time.sleep(sleepNumber) #power为0.001时为毫秒级延...
import unittest import easydict import numpy as np import torch from utils import optim from utils.test import assertAllClose from utils.test import to_numpy class CrossEntropyLabelSmoothTest(unittest.TestCase): """Port from tensorflow""" def testSoftmaxLabelSmoothing(self): # Softmax Cross Entropy ...
import os import numpy as np import cv2 from util import draw_flow from flow_mode_detect import determine_flow_mode, Direction, Motion_pattern import flow_vis def downsample_flow(flow, n_grid_x, n_grid_y, smoothing=True): h, w, _ = flow.shape if h < n_grid_y or w < n_grid_x: # TODO pass li...
import csv import json import threading from datetime import date from os import listdir, remove from os.path import dirname, realpath # To get full path to python script import telebot from youtube_part import * users_daily = set() stats_date = date.today() SCRIPT_DIR = dirname(realpath(__file__)) ADMIN_USER_ID =...
# -*- coding: utf-8 -*- """ Created on Wed Mar 23 11:41:15 2022 vibronic model for pyrrole @author: <NAME> (<EMAIL>) Refs: Domcke JCP 2005 """ from numpy import sqrt, exp, tanh, pi, cos, sin import numpy as np from numpy.linalg import inv, det from lime.phys import heaviside, meshgrid, morse, Morse from lime.u...
print("Loading...") import sys import numpy as np from numpy import genfromtxt import tkinter as tk from tkinter import filedialog import os import pandas as pd import matplotlib.pyplot as plt import scipy.signal as signal from scipy import interpolate from scipy.stats import mode from ipfx import feature_extractor fro...
#!/usr/bin/env python # -*- coding: utf-8 -*- import glob import io import locale import os import platform import re import shutil import string import sys import tempfile # ================================================================================== import threading import xml.etree.ElementTree as ET from mult...
""" This is my implementation of the paper "emoji2vec: Learning Emoji Representations from their Description" (2016) written by <NAME>, <NAME>, <NAME>, <NAME>, and <NAME>. I am using their datasets (available here https://github.com/uclmr/emoji2vec/blob/master/data/raw_training_data/emoji_joined.txt) The paper is ...
from planner.planner import Planner from pyTORS import BeginMoveAction, EndMoveAction, MoveAction, ArriveAction, ExitAction, ServiceAction, \ WaitAction, SetbackAction, SplitAction, CombineAction, TrackPartType,\ State, Location, ShuntingUnit, Train, Incoming, Outgoing, Engine, Action, Track, Task import random...
import requests import io import random import time import os import sys # Speech Recognition Imports from pydub import AudioSegment import speech_recognition as sr # Selenium from selenium.webdriver.firefox.firefox_binary import FirefoxBinary from selenium.common.exceptions import NoSuchElementException...
from ..utils import * import torchvision.transforms as torchtf import torchvision.transforms.functional as F import torch class RandomHorizontalFlip: def __init__(self, prob=0.5): self.prob = prob def __call__(self, input, target): if torch.randn(1).item() < self.prob: return (F....
import torchvision.datasets as datasets from torch.utils.data import Dataset, DataLoader from torchvision import transforms from torchvision.datasets import VisionDataset import torch import numpy as np class MyDataset(Dataset): def __init__(self, data, target, train, transform=None): self.data = data ...
import os import PIL.Image import zipfile from operator import itemgetter from config import get_image_folder from flask import jsonify, request, abort, send_file from pbu import list_to_json from storage.image_store import Image from data.image_adapter import ImageAdapter def get_image_path(image, image_num=None): ...
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: <NAME> ## ShanghaiTech University ## <EMAIL> ## Copyright (c) 2019 ## ## This source code is licensed under the MIT-style license found in the ## LICENSE file in the root directory of this source tree ##++++++++++++++++++++++++++...
# Copyright 2021, 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...
from flask import Flask,render_template,send_from_directory,Markup,url_for,request,jsonify from markdown import markdown,markdownFromFile from bs4 import BeautifulSoup as bs #sys.path.insert(0,' /Users/xiaoking/PycharmProjects/CRM_project ') app = Flask(__name__) hello_index = '/Users/xiaoking/PycharmProjects/CRM_pro...
#!/usr/bin/env python # coding=utf-8 # Created by max on 17-5-5. import os import sys import time import numpy as np import pandas as pd import matplotlib.pyplot as plt from pandas import Series, DataFrame from pandas import datetime from sklearn.metrics import mean_squared_error from sklearn.preprocessing import M...
from collections import namedtuple from functools import partial import hashlib import urllib.request import os from os import path import string import sys import zipfile from cv2 import imread, imwrite, resize import keras.backend as K from keras.callbacks import Callback, ModelCheckpoint, LearningRateScheduler from...
import pytest from sheetfu import SpreadsheetApp, Table from sheetfu.model import Range from sheetfu.modules.table import Item from tests.utils import mock_google_sheets_responses class TestTableRanges: def test_full_range_data(self, full_table): for item in full_table.items: assert item.bac...
from .model3do import * from ijim.types.vector import * from ijim.text.serutils import * from typing import Tuple, List import os _file_magic = "3DO" _file_version = "2.3" def _vector_to_str(vector: Tuple, compact = True, align_width = 10): out = "" if compact else '(' if compact: format_text = " {:>"...
#!/usr/bin/env python3 # © 2021 Qualcomm Innovation Center, Inc. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause from hypercall import Variable, Hypercall, apply_template from lark import Lark, Tree import os import sys import argparse import subprocess import logging import pickle import inspect # D...
# coding:utf-8 __author__ = "gaunt" from hashlib import md5 import json from datetime import datetime, date import conf from conf import redis_conn_param as redis_config import jwt import enums from functools import wraps from bottle import request import redis from peewee import DoesNotExist from singletons import Lo...
# Recommender systems # 1- Find similar users using KNN and K-means # 2- Find useful movies # 3- Compute prediction list of values (predicted rank) # 4- Use evaluation metrics to analyze the quality of the prediction # 5- Plot the chart # # <NAME> # UFF - Universidade Federal Fluminense # Ajudantes import numpy as np ...
""" * @file mainGUI.py * @authors <NAME> & <NAME> * @date May 22 2018 * @modified Feb 22 2019 * @modifiedby SK * @brief GUI managment and creation */ """ import kivy """from atmSequence import atmosphere from control import deviceControl from networking import network from logg import deviceLog""" from logger i...
# encoding: utf-8 """ @author: liaoxingyu @contact: <EMAIL> """ import torch from torch import nn import torch.nn.functional as F from .backbones.resnet import ResNet, BasicBlock, Bottleneck from .backbones.senet import SENet, SEResNetBottleneck, SEBottleneck, SEResNeXtBottleneck def weights_init_kaiming(m): c...
# Copyright 2013 - 2017 Mirantis, 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 ...
""" ******************** Core GPIO Base Board ******************** :Author: <NAME> """ # Copyright (c) 2019-2021 MQTTany contributors # # 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...
from enum import IntEnum NUMBER_OF_ROWS = 3 NUMBER_OF_COLUMNS = 3 KOMI = 6.5 class Player(IntEnum): Black = 1 White = 2 class PositionState(IntEnum): Empty = 0 Black = 1 White = 2 class Result(IntEnum): Draw = 0 Black = 1 White = 2 class Go: @staticmethod def create_new_...
#!/usr/bin/env python # coding: utf-8 """ This script trains and evaluates an MLP implemeneted in PyTorch. The model accepts a pre-extracted, concatenated mutlimodal feature vector as its input and outputs a classification decision. """ import pandas as pd import numpy as np import torch import functools import oper...
import sys,os,readline prompt = "\033[33;1mSIP\033[37;1m}> \033[32;1m" def show(type,msg): if type=="error": print ("\033[33;1m{\033[31;1mERROR\033[33;1m}> \033[31;1m%s\033[0m"%(msg)) # sys.exit() elif type=="sukses": print ("\033[33;1m{\033[32;1mSUCCESS\033[33;1m}> \033[32;1m%s\033[0m"%(msg)) elif type=="warni...
# Copyright 2017 <NAME> # 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 applic...
import autograd.numpy as anp import numpy as np from pymoo.util.misc import stack from pymoo.model.problem import Problem from pymoo.factory import get_problem from pymoo.algorithms.nsga2 import NSGA2 from pymoo.factory import get_sampling, get_crossover, get_mutation from pymoo.factory import get_termination from pymo...
# ----------------------------------------------------------------- # pymdev.py # 5/30/2004 # By <NAME> (<EMAIL>) # ----------------------------------------------------------------- """ pymdev - A Python Emacs Development Module pymdev is a simple Python module that uses pymacs, a tool that allows both-wa...
# !/home/pi/lightshowpi/web/microweb # File must be run on Raspberry Pi 2 with lightshowpi preinstalled # web_app.py has to be located in the directory specified above # If it isn't, then the program will not work # html files are stored in the templates folder # css files are stored in the static folder # The progra...
#!/usr/bin/env python # coding: utf-8 # ### Explore processed pan-cancer data # In[1]: import os import sys import numpy as np; np.random.seed(42) import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.preprocessing import StandardScaler import mpmp.config as cfg import mpmp.utilit...
#!/usr/bin/env python3 #rhstree.py from errors import * from enum import Enum from serializer import Serializer class RHSType(Enum): IDENTIFIER = 0 TERMINAL = 1 OPTIONAL = 2 REPEAT = 3 GROUP = 4 ALTERNATION = 5 CONCATENATION = 6 REGEX = 7 class RHSKind(Enum): LIST = -1 LEAF = ...
from __future__ import print_function import os import subprocess import sys import platform import requests import shutil import struct import errno from zipfile import ZipFile, ZIP_DEFLATED print('Python ' + sys.version + '\n') IS_WINDOWS = False IS_LINUX = False IS_MACOS = False p = platform.system() if p == 'Win...
from __future__ import print_function import numpy as np import matplotlib.pylab as plt import rubin_sim.maf.db as db import rubin_sim.maf.metrics as metrics import rubin_sim.maf.slicers as slicers import rubin_sim.maf.metricBundles as metricBundles from rubin_sim.maf.metrics import BaseMetric from .calc_expected_visit...
import itertools import math from functools import cache from typing import List, Tuple, Iterable import numpy as np import pyclipper from OCP.BRep import BRep_Tool from OCP.BRepLib import BRepLib from OCP.BRepTools import BRepTools_WireExplorer from OCP.HLRAlgo import HLRAlgo_Projector from OCP.HLRBRep import HLRBRep...
import base64 import json try: from email.generator import _make_boundary as choose_boundary except ImportError: from mimetools import choose_boundary import mimetypes import os try: from urllib.parse import urlencode except ImportError: from urllib import urlencode try: from urllib.request import R...
import tensorflow as tf import numpy as np import os import sys from records import get_data from tf_utils import upsample3d from tf_utils import convolution3d from tf_utils import residual_block from tf_utils import downsample from tf_utils import normalization class Network(): def __init__(self, datafile, conf...
# -*- coding: utf-8 -*- import operator from functools import partial, reduce from typing import Callable, List, Mapping, TypeVar, Union from typing_extensions import Protocol T1 = TypeVar('T1') T2 = TypeVar('T2') _Number = Union[int, float, complex] def _fmap(callback): # pragma: nocover # TODO: Remove `pra...
"""Various helpers for instantiation.""" import itertools from copy import deepcopy from typing import List, Sequence, Union import gtwrap.interface_parser as parser ClassMembers = Union[parser.Constructor, parser.Method, parser.StaticMethod, parser.GlobalFunction, parser.Operator, parser.Variab...
"""Test script that ensures the generator methods can reproduce models that have been checked by other means.""" # Author: <NAME>, <EMAIL> # Date: 3-14-2022 #!~/software/blender-2.93/2.93/python/bin/python3.9 import sys, json import bpy class TestGenerator(): """Class for testing the generator.py mesh creation."""...