text
stringlengths
8.04k
46.5k
import re import uuid from collections import defaultdict from datetime import datetime from itertools import chain from typing import ( Any, Callable, DefaultDict, Dict, List, NamedTuple, Optional, Tuple, Union, ) from django.utils.translation import ugettext as _ import pytz from...
#!/usr/bin/env python import torch from torchvision import transforms from torch import nn import torch.nn.functional as F from torch.autograd import Variable from torch.utils.data import Dataset, DataLoader import sklearn from sklearn.model_selection import train_test_split from sklearn.metrics import r2_score from ...
# ---------------------------------------------------------------------------- # Copyright (c) 2018-2021, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm plt.rcParams.update({"font.size": 14, "font.serif": "Computer Modern Roman"}) import numpy as np from numpy import ndarray import nisqai from pyquil import get_qc, Program from pyquil.api import WavefunctionSimulator ...
import numpy as np import pandas as pd from matplotlib import pyplot as plt from datetime import datetime as dt from pandas_datareader import DataReader as DR import seaborn as sb import numdifftools as nd from wquantiles import quantile import statsmodels.api as sm import multiprocessing import pickle from collections...
""" pyndl.preprocess ---------------- *pyndl.preprocess* provides functions in order to preprocess data and create event files from it. """ import collections import gzip import multiprocessing import os import random import re import sys import time def bandsample(population, sample_size=50000, *, cutoff=5, seed=N...
# Based on https://github.com/Reddy2/suffix-tree by Reddy2 @ Github. # # Licensed under the MIT license. from collections import Counter class SuffixTreeNode: __slots__ = ['children', 'start', '_end', 'suffix_link', 'string_id', 'string_ids', 'parent', 'dfs_num'] leaf_end = -1 def ...
"""Implementation of RootOf class and related tools. """ from mpmath import findroot, mpc, mpf, workprec from mpmath.libmp.libmpf import prec_to_dps from ..core import (Add, Dummy, Expr, Float, I, Integer, Lambda, Rational, cacheit, symbols, sympify) from ..core.compatibility import ordered from ....
#!/usr/bin/env python3 import timeit import os import arcade # from arcade.examples.frametime_plotter import FrametimePlotter # from arcade import FrametimePlotter from pyglet.gl import GL_NEAREST, GL_LINEAR import pymunk import logging import math import time import threading import argparse from signal import signal,...
#!/usr/bin/env python3 #-*- coding: utf-8 -*- import re import argparse import sys import os import itertools from Bio.Seq import Seq from Bio import SeqIO from Bio.SeqRecord import SeqRecord iupac_codes = { "R": "[AG]", "Y": "[CT]", "S": "[GC]", "W": "[AT]", "K": "[GT]", "M": "[AC]", "B":...
import logging from django.core.exceptions import ValidationError from django.db.utils import IntegrityError from framework import sentry from framework.auth import Auth from framework.celery_tasks import app as celery_app from osf.exceptions import ( NodeStateError, RegistrationBulkCreationRowError, Use...
"""Defines the model for the database. This package defines the database model, which is in roughly three parts: 1. Type classes, linked with type_ tables in the database, which define the basic elements of other classes, such as word age, or declension. In general, these come from the inflections_package.ads f...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from unittest import mock except ImportError: import mock from textwrap import dedent import types import gevent from greenswitch import esl from tests import TestInboundESLBase from tests import fakeeslserver class TestInboundESL(TestInboundESLBase): ...
#!/usr/bin/env python3 import struct import sys import array, math, random from math3d import * def compute_tbn(vdata, tdata, triangles): # vdata = list of vertex positions (x,y,z coordinates) # tdata = list of texture coordinates (s,t tuples) # triangles = dictionary. Key = string, value = list of triang...
#Convert NEON field sample points into bounding boxes of cropped image data for model training import cv2 import os import glob import sys import geopandas as gpd import rasterio import random import numpy as np import math import shapely import pandas as pd import traceback from matplotlib import pyplot from DeepTree...
# To compute and plot a metric for an already run benchmark, use eg: # python3 vio_benchmark/benchmark/compute_metrics.py \ # output/2021-01-04_13-08-26 \ # -p --metric_set=full_3d_align import argparse, os, sys from collections import OrderedDict import numpy as np import json import math from pathlib impor...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 03/04/2015 @author: jorgesaw ''' from __future__ import absolute_import, print_function, unicode_literals from imperial.core.gui.MsgBox import MsgBox from imperial.core.model.datamodel.dataModel import DataModel from imperial.dao.DAOMovVentaProd import DAO...
# Copyright 2019 The Blueqat Developers # # 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...
#!/usr/bin/env python """ Maintains a stable view of / access to state: - Combines multiple underlying blockchain sources, - Temporally tracks degrees of confidence based on age, with chain reorg support. """ ## ## Note: BUG1 refers to, ## ## When you have nested manager.dict()'s, instead of: ## h['a']['b'] = 'c...
import logging import decimal import random import string from abc import ABCMeta, abstractmethod, abstractproperty from datetime import date, datetime, timedelta from decimal import Decimal import pytz import tushare as ts from django.conf import settings from django.contrib.auth import get_user_model from django.db ...
import os import time import glob import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim from tensorflow.python.ops import control_flow_ops import scipy.misc import random import subprocess import cv2 from datetime import datetime from modules.videosr_ops import * from modules.utils import *...
import datetime import json import pickle import random import threading import time import logging import traceback logger = logging.getLogger('myLogger') logger.setLevel(logging.DEBUG) fm = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') # ch = logging.StreamHandler() # ch.setFormatter(fm) ...
#!/usr/bin/env python3 # # Copyright 2016 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 requir...
from Selenium2Library.keywords import _browsermanagement import re import importlib import inspect import warnings from robot.utils import asserts from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.remote.webelement import We...
# Copyright 2016 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...
''' Versione del gioco "finale" dopo il corso su PyGame 1 - https://youtu.be/rdT_Z23YRAY 2 - https://youtu.be/xG4IKcAzMCw 3 - https://youtu.be/V3VuqFeJ1hc ovvero con utilizzo di Sprites e gruppi di collisioni e maggiore orientamento OOP ''' import pygame import time import sys import functools # Palette - RGB colors ...
""" Clean text, make it readable and obtain metadata from it. """ import functools import re import unicodedata from collections import Counter from urllib.parse import urlparse import cld2 import numpy import spacy import spacy.matcher import textacy import textacy.ke import textacy.text_utils from bs4 import Beauti...
# # Copyright (c) 2019-2020, 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 ag...
#!/usr/bin/env python3 # # Copyright (C) 2018 ETH Zurich, University of Bologna # # 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 ...
# *************************************************************** # Copyright (c) 2020 Jittor. Authors: # <NAME> <<EMAIL>>. # <NAME> <<EMAIL>> # # All Rights Reserved. # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part of this source code package. # *******************...
#!/usr/bin/env python # # Fuzzylookup search command # # Compares a field in Splunk search results against values in a lookup field # Supports filtering and masking of data within the lookup, including using data from the event # # Author: <NAME> <<EMAIL>> # # Version: 1.0.4 (2021-06-16) from __future__ import uni...
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 import math import random from typing import Dict, List, Optional, Tuple from shared.insn_yaml import Insn from shared.operand import (OperandType, ...
#!/usr/bin/env python # encoding: utf-8 ''' @author: <NAME> @license: (C) Copyright 2013-2017, Node Supply Chain Manager Corporation Limited. @contact: <EMAIL> @time: 6/17/20 7:53 PM @desc: ''' import os os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true' import sys import time # import tensorflow as tf from skimage.met...
################Python modules ###miscellaneous def unique(mylist): seen = set() return [x for x in mylist if not (x in seen or seen.add(x))] def unlist(listed, d=','): """takes a list and converts to delimiter-separated string; comma delimited by default""" unlisted=(d.join(a for a in listed)) r...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Import csv library; Part of python standard libs import csv # Import 3rd party packages. Check if installed and die with error message # if not. try: import matplotlib as mpl import mpl_toolkits.axes_grid1 mpl.use('Qt5Agg') mpl.interactive(True) im...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2008-2020 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at https://trac.edgewall.org/wiki/TracLicense. ...
from __future__ import print_function, division, absolute_import """ Machine Structure Initialization -------------------------------- In ``aphla`` one machine includes several accelerator structure, e.g. "nsls2v2" is a machine with several submachine or lattice V1LTD, V1LTB, V2SR. Submachines are also called latti...
""" Plots for a model that has been run. """ import logging from math import ceil from typing import Callable, List import numpy as np import pandas as pd import seaborn as sns from matplotlib import pyplot from summer import Compartment from autumn.tools.inputs.demography.queries import get_population_by_agegroup fr...
# -*- coding: utf-8 -*- from django.shortcuts import render, HttpResponse, redirect from django.http import JsonResponse from .forms import ComputeForm from .models import restaurant as restaurant_, addr, likes, stats from django.contrib.auth.decorators import login_required from nltk.sentiment.vader import SentimentIn...
# Copyright 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 ...
import datetime import pickle import struct import hashlib import json import socket from threading import Thread import os, sys import random from RSA import RSA import pandas as pd prKey = (98581262173360837326167111125113695068362686677036762762847714161386363356381, 394325048693443349304668444500454780270931536429...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Gaussian Mixture Model Class: contains the basic fields and methods of GMMs The class GMM _old uses C bindings which are computationally and memory efficient. Author : <NAME>, 2006-2009 """ from __futu...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import datetime import glob import sys import numpy as np from uresnet.iotools import io_factory from uresnet.trainval import trainval import uresnet.utils as utils import torch import psut...
#!/usr/bin/env python # coding:utf-8 # Purpose: simple with basic dxf eintities created dimension lines, but not # the basic DXF-DIMENSION entities. # module belongs to package: dxfwrite.py # Created: 10.03.2010 # Copyright (C) 2010, <NAME> # License: MIT License """ Simple 2D dimension lines build with basic dxf enti...
#! /usr/bin/env python3 import os, sys, string, time, logging, argparse import pygame from PIL import Image import AnimatedSprite import BlinkingLED try: import dispense except: import dispensenull as dispense try: import RPi.GPIO as GPIO except: import nullgpio as GPIO try: import config except Import...
# encoding: utf-8 """ 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 without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribut...
import sys import numpy as np from phonopy.units import Hbar, EV, THz from phonopy.phonon.degeneracy import degenerate_sets from phono3py.phonon3.triplets import (get_triplets_integration_weights, occupation) from phono3py.file_IO import (write_gamma_detail_to_hdf5, ...
# -*- coding: utf-8 -*- """ Created on Mon Jan 4 10:43:52 2016 @author: huaijun """ from pandas import read_excel import re from openpyxl import Workbook import time import os class Weibo: def __init__(self,excel_worksheet,source,defatul_f,log_f): self.worksheet = excel_worksheet self.col_name = ...
#!/usr/bin/env python3 # This variable defines all the external programs that this module # relies on. lxbuildenv reads this variable in order to ensure # the build will finish without exiting due to missing third-party # programs. LX_DEPENDENCIES = ["riscv", "nextpnr-ecp5", "yosys"] # Import lxbuildenv to integrate ...
from __future__ import division import os import sys import tensorflow as tf import skimage.io as io import numpy as np import scipy # import cv2 # import dlib import pandas as pd from PIL import Image import csv sys.path.append('/Users/yu-chieh/seg_models/models/slim/') from portrait_plus import BatchDatset, TestDatas...
# -*- coding: utf-8 -*- """ Created on Mon May 21 09:00:01 2018 @author: Jon """ import numpy as np import networkx as nx import rivgraph.deltas.delta_directionality as dd import rivgraph.ln_utils as lnu """ This script contains algorithms that were ported from Matlab scripts provided by <NAME> to comput...
import typing import numpy as np import requests import os import platform from enum import Enum List = typing.List Tuple = typing.Tuple torch = None hub_url = "http://zifuture.com:1556/fs/25.shared" def lazy_import(): global torch if torch is not None: return import torch class LogLeve...
from element import * from generic import * from PyQt5.QtCore import Qt, QPointF, QRect, QRectF, QXmlStreamWriter, QEvent, QLineF from tree import PFSTreeItem from image import PFSRelationIcon from contents import PFSRelationContent, PFSSecondaryFlowContent from PyQt5.QtWidgets import QStyleOptionGraphicsItem, QWidget ...
import tensorflow as tf import pickle import utils from tensorflow.contrib.layers import xavier_initializer from tensorflow.contrib import rnn from tensorflow.python.keras.preprocessing.sequence import pad_sequences import numpy as np import Evaluate import time from datetime import timedelta import Layers i...
import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from Borehole_Example.src_ProdKernel_vvCV_MD1P.vv_CV_unbalanced_FixB_MD1P_borehole import * from Borehole_Example.src_ProdKernel_vvCV_MD1P.vv_CV_unbalanced_MD1P_borehole import * from Borehole_Example.src_ProdKernel_vvCV_MD1P.s...
from collections import deque import pydash import six from typing import List # noqa from . import variables from . import element_updater builtin_element_types = {} def builtin(cls): builtin_element_types[cls.__name__] = cls return cls class Element(object): allow_children = True def __init...
#!/usr/env/bin python ''' This module provides the main simulation classes. InputHandler() provides the main user interface. It can be used to start a simulation, generate a terrain, deploy animals, modify parameters etc. See the docstrings from the different classes and methods for more detailed documentation. ''...
# !/usr/bin/env python3 __author__ = '<NAME>' __original_author__ = "<NAME>" __version__ = '0.0.5' from scripts.parallel import TaskCmd, runCmdParallel, reportFailedCmd from scripts.Validator.validator import Validator from scripts.MetaDataTable.metadatatable import MetadataTable import sys import os import random i...
''' De Noising Auto Encoder ''' from __future__ import print_function import numpy as np import numpy import math import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import scipy import timeit import inspect import sys import numpy from theano.tensor.nnet import conv import theano import theano.ten...
import os import sys import numpy as np import time import torch import glob import random import logging import argparse import tensorflow as tf tf.enable_eager_execution() import utils import utils_nvidia import torch.nn as nn import torch.utils import torchvision.datasets as dset import torchvision.transforms as tr...
import torch import torchvision as tv import torch.nn as nn from torch.autograd import Variable import matplotlib.pyplot as plt from random import shuffle import networkx as nx import pickle as pkl import scipy.sparse as sp import logging import random import shutil import os import time from model import binary_cros...
# Copyright 2021 DeepMind Technologies Limited. 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 ...
######################################################################################################################## # Module: utils.py # Description: Some useful functions including TemporalGaussian potential evaluations and leapfrog integrator. # # Web: https://github.com/SamDuffield/mocat #######################...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np import os, argparse ,time ,sys, configparser from os.path import basename import gc import cv2, sklearn from utils import face_preprocess from nets.mtcnn_model import P...
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: <NAME> import json import logging from ares.Lib.html import AresHtml from ares.Lib import AresImports # External package required render_template_string = AresImports.requires(name='flask', reason='URL remappings', install='No need to install', p...
from __future__ import annotations import sys import types import typing as t from collections import ChainMap from collections.abc import Callable from typing_extensions import Self from warnings import warn from threading import Lock, RLock from functools import ( lru_cache, update_wrapper, wraps, cache, ...
import os import json import logging from datetime import timedelta import itertools import tenacity from tenacity import retry import airflow from airflow import DAG from airflow.sensors.http_sensor import HttpSensor from airflow.hooks.http_hook import HttpHook from airflow.hooks.base_hook import BaseHook from airfl...
from mycv.utils.general import disable_multithreads disable_multithreads() import os from pathlib import Path import argparse import json import time from tqdm import tqdm from collections import defaultdict import torch import torch.cuda.amp as amp from torch.nn.parallel import DistributedDataParallel as DDP from myc...
""" MIT License Copyright (c) 2020 Dropper Lab 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 limitation the rights to use, copy, modify, merge, publish, d...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Indic Language Character Map # Copyright 2008 <NAME> <<EMAIL>> # http://www.smc.org.in # # This program 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 Foundation; e...
#!/user/bin/env python # -*- coding: utf-8 -*- # # The interfaces of TreeSearchAgent import keras from keras.models import Sequential from keras.layers import Dense from sklearn.svm import LinearSVC from scipy.linalg import norm import numpy as np import random from itertools import repeat, chain from typing import Li...
import utils import time import random import datetime from urllib.parse import urlparse, parse_qsl, urlencode import requests # use postgres, put results in database. Send everything to checkout service which will automatically put it into the checkout service import json import os users = utils.load_json("user.json"...
""" User interface Controls for the layout. """ from __future__ import unicode_literals from pygments.token import Token from abc import ABCMeta, abstractmethod from collections import defaultdict, namedtuple from six import with_metaclass from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER from prompt_too...
#!/usr/bin/env python """ These are helper scripts to populate the database """ ### make imports import sys,os,re,time,csv import sqlalchemy import getpass import numpy as np from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from htsint import Configure from .DatabaseTables import Base,Taxon...
import os import math import re from PyQt5.QtCore import pyqtSlot, QTimer, QThread, QEventLoop from PyQt5.QtWidgets import QApplication from youtube_dl import YoutubeDL import time from pprint import pprint import settings import playlist import upnp_dlna import functions """implemnet history, for the back button"...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. """ Testing ShardedDDP """ from contextlib import suppress import copy import tempfile import numpy as np import pytest import torch from to...
import pandas as pd from matplotlib import pyplot as plt import numpy as np import world pd.options.mode.chained_assignment = None # default='warn' def plot_position_vs_steps(dataframe, list_of_agents): raise DeprecationWarning("Not supported anymore - no guarantee of correct run") fig, ax = plt.subplots(1,...
from PIL import Image, ImageDraw, ImageFont import os import statistics import operator import json from parse_battles import calculate_cards_percentages, calculate_decks_percentages, calculate_used_decks_percentages src_dir = os.getcwd() base_dir = os.path.normpath(src_dir + os.sep) samples_folder = os.path.join(bas...
# coding: utf-8 import numpy as np import pandas as pd from scipy import stats from matplotlib import pyplot as plt from tqdm import trange DIRECTION_NUMS = { 'clockwise': 1, 'counter_clockwise': 0 } DEBUG = False def reset_df(df): """ :param pd.DataFrame df: """ df.direction = '' if '...
# ActiveSync diagnostics script # Author: <NAME> (<EMAIL>) # # This implements a small portion of the ActiveSync protocol for diagnostic purposes and # may be a useful example for other developers tasked with similar hellish quests. # # Please note this script is not designed to be reusable. A lot of things are hardco...
from tkinter import * from DESfiddle.utils import preprocess_key, preprocess_plaintext, encrypt, generate_round_keys, calc_diff, txt_to_hex, hex_to_bin import matplotlib.pyplot as plt ''' Sample plaintext and keys pt = "This is even cooler" key = "Yessss" pt = "010101010101010101010101010101010101010101010101010101...
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...
# Copyright 2013-2015 ARM Limited # # 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...
#!/usr/bin/env python3.9 import os import sys from collections import deque, defaultdict from copy import deepcopy from decimal import Decimal, DecimalException from enum import Enum, IntEnum from itertools import chain from math import inf from pathlib import Path from typing import * import clingo class ASPSubpro...
#!/pxrpythonsubst # # Copyright 2016 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ...
# 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, ...
import collections from math import sqrt, ceil, floor from functools import partial import logging import numpy as np from sklearn.decomposition import PCA from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA from yass import geometry as geom try: import matplotlib.pyplot as plt from ma...
""" The Purpose of the RoibalBot Python Program is to create an automated trading bot (functionality) on Binance Beginner Version Utilized Python-Binance ( https://github.com/sammchardy/python-binance ) Advanced-Version capable of all exchanges, all coins (using ccxt) Created 4/14/2018 by <NAME> V 0.01 - Updated...
import heapq as hp import random import numpy as np import time import gurobipy from .k_shortest_path import k_shortest_path_all_destination def dijkstra(graph, initial_node, destination_node=None, return_path=False): priority_q = [(0, initial_node, None)] parent_list = [None] * len(graph) distances = [No...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
# -*- coding:utf-8 -*- """ 用于生成各种有趣图片的简单脚本 """ from __future__ import unicode_literals import os import sys import argparse import random import textwrap import itertools import multiprocessing from datetime import datetime from functools import partial from PIL import Image, ImageOps, ImageStat, PngImagePlugin IS_P...
import pickle import re from functools import partial from itertools import compress import os import io import torch import pandas as pd import numpy as np from bokeh.models import HoverTool import panel as pn import holoviews as hv from holoviews import opts pn.extension('tabulator') hv.extension('bokeh') from oggm...
import numpy as np import pandas as pd import math import torch import matplotlib.pyplot as plt from scipy.spatial import distance from scipy import signal from sklearn.model_selection import train_test_split from torch.utils.data import Dataset, DataLoader class HumanMotion(Dataset): def __init__(self, x, y): ...
# -*- coding: utf-8 -*- ##--------------------------------------------------------------------------------------------------- # world & dungeon panel # # ##--------------------------------------------------------------------------------------------------- import imports from imports import * import config def exclud...
#!/usr/bin/env python import copy import re import argparse import os from os.path import join, abspath, exists, basename import sys from tempfile import mkdtemp import shutil import subprocess import multiprocessing as mp import glob import itertools import collections import time import yaml from yaml import CLoade...
import unittest import os import numpy as np from pymicro.crystal.microstructure import Orientation, Microstructure from pymicro.crystal.lattice import Symmetry, Lattice, CrystallinePhase, HklPlane, HklDirection, SlipSystem from config import PYMICRO_EXAMPLES_DATA_DIR class MicrostructureTests(unittest.TestCase): ...
#!/usr/bin/env python3 # coding=utf-8 #--------------------------------------------------------------- # This script is used to test whether pylib work appropriately. # It prints basic information and current work directory for # the user. # # By shashibici (<EMAIL>) # 11/02/2015 #-----------------------------------...
# Copyright (C) 2017 Verizon. All Rights Reserved. # # File: raid.py # Author: <NAME> # Date: 2017-02-17 # # 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 # # htt...
# Sublime modelines - https://github.com/SublimeText/Modelines # sublime: translate_tabs_to_spaces false; rulers [100,120] from sgosubl import about from subprocess import Popen, PIPE import copy import datetime import json import locale import os import re import string import sublime import subprocess import sys imp...
from flask import Flask, request, render_template, send_from_directory, Response, current_app, Blueprint from flask.ext.login import LoginManager, UserMixin, login_required, current_user from bson.objectid import ObjectId from collections import OrderedDict from html.parser import HTMLParser import threading import epu...