text
stringlengths
8.04k
46.5k
#!/usr/bin/env python3 import toml import sys, re, itertools, inspect import pandas as pd from pathlib import Path from inform import plural from copy import deepcopy from .util import * # Data Structures # =============== # `config` # A direct reflection of the TOML input file, with all the [meta] fields # reso...
# -*- coding: utf-8 -*- from SkinningTools.py23 import * from SkinningTools.UI.qt_util import * from SkinningTools.ThirdParty.kdtree import KDTree from SkinningTools.ThirdParty import requests import re, difflib, math, tempfile, base64, os, json, warnings from functools import partial UIDIRECTORY = os.path.d...
# Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
import sys import json import boto3 import time import pyspark.sql.functions as F from datetime import datetime, timedelta from collections import OrderedDict from awsglue.transforms import * from pyspark.sql.window import Window from awsglue.utils import getResolvedOptions from pyspark.context import SparkContext from...
# GPLv3 License # # Copyright (C) 2020 Ubisoft # # 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 dis...
""" econ_platform_core - Glue code for a unified work environment. The center-piece of the package is *fetch()* a function which dynamically loads a pandas time series (Series object) from any supported provider or database interface. The fetch command will determine whether the series exists in the local database, or...
# -*- coding: utf-8 -*- """ @file @brief Conversion from tree to neural network. """ from io import BytesIO import pickle import numpy from ._neural_tree_api import _TrainingAPI from ._neural_tree_node import NeuralTreeNode def label_class_to_softmax_output(y_label): """ Converts a binary class label into a m...
""" Examples I think will break things: 1. start_date = 1/1, end_date = 1/31 2. Instances use 7 days of allocation from 1/1 to 1/8 3. User has his monthly allocation on 1/8 (14 days) 4. Instances use 7 days of allocation from 1/8 to 1/15 Questions: 2. What "AllocationIncreases" are valid if the date...
import copy import re import collections import json import sys from abc import abstractmethod ordered_dict_version = (3, 6) HAS_DEFAULT_ORDERED_DICT = sys.version_info > ordered_dict_version ############################################################################# class FactureRefObj: @abstractmethod ...
#!/usr/bin/env python # Copyright (c) 2005-2010 ActiveState Software Inc. """eol -- a tool for working with EOLs in text files Usage: eol FILE... # list EOL-style of file(s) eol -c NAME FILE... # convert file(s) to given EOL-style eol -f NAME FILE... # find files with the given EOL-style...
from __future__ import annotations import keyword import operator from functools import partial from math import ceil from numbers import Number from typing import TYPE_CHECKING, Any, Callable, Mapping import awkward._v2 as ak import numpy as np from awkward._v2._connect.numpy import NDArrayOperatorsMixin from awkwar...
#!/usr/bin/env python from flask import Flask, render_template, Response, request, redirect, url_for, jsonify import play_video import subprocess import os import sys import time import socket import urllib2 import calendar import logging import base64 import importlib import py_compile import io from datetime import d...
# Copyright 2012 OpenStack Foundation # # 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...
""" Market data import and transformation functions """ import calendar from collections import Counter import copy from datetime import date import time from urllib.request import FancyURLopener import warnings import datetime as dt from bs4 import BeautifulSoup from lxml import html import numpy as np import pandas ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # *****************************************************************************/ # * Authors: <NAME>, <NAME> # *****************************************************************************/ # @package simularityProfile # Based on https://www.cs.ucr.edu/~eamonn/MatrixProf...
#!/usr/bin/env python3 import sys import argparse import os import configparser import json import math import logging import subprocess import datetime import urllib from pajbot.bot import Bot from pajbot.web.models import api from pajbot.web.routes import admin from pajbot.web.models import errors from pajbot.model...
from campy.graphics.gwindow import GWindow from campy.graphics.gobjects import GOval, GRect, GLabel, GLine from campy.gui.events.timer import pause from campy.gui.events.mouse import onmouseclicked, onmousemoved import time import random COLUMNS = 10 # columns of the bricks ROWS = 5 # rows of the br...
""" Tools and utilities for computing spike-triggered averages (filters), finding spatial and temporal components of spatiotemporal filters, and basic filter signal processing. """ import numpy as np import scipy from skimage.measure import label, regionprops from functools import reduce from pyret.stimulustools imp...
#section capacity check I-Section import Rhino.Geometry as rg import math """ input: Depth (h)-mm top flange width (b_top)-mm bottom flange width (b_bottom)-mm Web thickness (tw)-mm Top Flange thickness (tf_top)-mm Bottom flange Thickness (tf_bottom)-mm material properties gamma_M0 ou...
from ...._common import open_file from .._common import getval, write_ffrecord from ._helpers import section __all__ = [ "write", ] def write(filename, parameters, verbose=True): """ Write TOUGHREACT chemical input file. Parameters ---------- filename : str Input file name. param...
import torch import torch.nn as nn import numpy as np from tqdm import tqdm from pathlib import Path from sklearn.neighbors import KDTree from .base_model import BaseModel from ..dataloaders import DefaultBatcher from ...datasets.augment import SemsegAugmentation from ..modules.losses import filter_valid_label from ....
import json import os import tkinter import tkinter.filedialog import tkinter.messagebox import random from randomizer.iogr_rom import generate_filename from randomizer.models.enums.difficulty import Difficulty #from randomizer.models.enums.level import Level from randomizer.models.enums.enemizer import Enemizer from ...
from datetime import datetime from importlib import reload from scipy import misc from slm_lab import ROOT_DIR import cv2 import json import math import numpy as np import os import pandas as pd import pydash as ps import regex as re import scipy as sp import subprocess import sys import torch import torch.multiprocess...
#! /usr/bin/env python3 __author__ = '<NAME> (<EMAIL>)' __copyright__ = 'Copyright 2011-2020 Axiomatic Systems, LLC.' ### # NOTE: this script needs Bento4 command line binaries to run # You must place the 'mp4info' 'mp4dump', and 'mp42hls' binaries # in a directory named 'bin/<platform>' at the same level as where...
import numpy as np import copy import torch import matplotlib.pyplot as plt import os from skimage import io import matplotlib as mpl import scipy def normalize(arr, amin=0, amax=1): arr01=(arr-np.min(arr))/(np.max(arr)-np.min(arr)) return arr01*(amax-amin)+amin def plot_1D_histogram(data, bins=100, fig_ex...
#!/usr/bin/env python3 # # HIS: HIS source code metric checkers # # Example usage of this addon (scan a sourcefile main.c) # cppcheck --dump main.c # python his.py main.c.dump # import argparse import cppcheckdata import sys import re import json # Formatted printf like function usable by Python 2.7.x and 3.x code. ...
import numpy as np import yaml from lvmspec.io import findfile import os,sys from lvmspec.quicklook import qlexceptions,qllogger class Config(object): """ A class to generate Quicklook configurations for a given desi exposure. expand_config will expand out to full format as needed by quicklook.setup ""...
import copy from functools import partial import torch import torch.nn as nn from .graph_parser import get_pruning_layers import numpy from sklearn.cluster import KMeans import matplotlib.pyplot as plt MIN_SCALING_FACTOR = 1e-18 OT_DISCARD_PERCENT = 0.0001 OUT_CHANNEL_DIM = 0 IN_CHANNEL_DIM = 1 WEIGHT_POSTFIX = ".wei...
import collections import copy import functools import operator import numpy import minpy.array import minpy.tape import minpy.core import minpy.nn.init import minpy.nn.layers import minpy.nn.model import minpy.nn.optim _module_counter = {} def _module_prefix(module_name): index = _module_counter.setdefault(m...
import abc import dataclasses import datetime as dt import enum import hmac import secrets import struct import weakref from typing import * FSENTRY = Union["File", "Directory", "SymLink", "BaseFSEntry", "FSEntryProxy"] # 2x total path length for Linux REASONABLE_NAME_LIMIT = 8192 # Mostly a copy of NFS2's error co...
import threading import time import datetime import pandas as pd from functools import reduce, wraps from datetime import datetime, timedelta import numpy as np from scipy.stats import zscore import model.queries as qrs from model.NodesMetaData import NodesMetaData import utils.helpers as hp from utils.helpers import...
import gzip import io import os import random import shutil import time from builtins import str as text import msgpack from CYLGame.Utils import hash_stream def write_json(o, filename): with gzip.open(filename, "w") as fp: msgpack.dump(o, fp) def read_json(filename): with gzip.open(filename, "r")...
""" Firebird database backend for Django. """ import sys try: import fdb as Database except ImportError as e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading fdb module: %s" % e) from fdb.ibase import charset_map from django.db import utils from django.d...
"""Utilities for working with HTTP. This isn't WebOb http://www.webob.org/ or Werkzeug http://werkzeug.pocoo.org but often it's enough and you should be able to upgrade easily to an alternative once you do need it. There are classes for standard HTTP responses, such as :py:class:`HTTPNotFound` for 404. These classes ...
import sys import os sys.path.append('..') # append parent folder to make import configs work import configs from DYME.src.dataset import Dataset from DYME.src.models.dyme import DYME from DYME.src.models.baseline import Baseline import neptune import pickle from tqdm import tqdm import torch from torch import nn f...
import os import sys import argparse import shutil import time import random import gc import json from distutils.version import LooseVersion import scipy.misc import logging import matplotlib as mpl mpl.use('Agg') from matplotlib import pyplot as plt import pickle from PIL import Image import numpy a...
#! /usr/bin/env python import logging import sys import os sys.path.append(os.path.abspath(os.path.dirname(__file__))) from objparser import * from jsonhdl import * from objparser import * from elfparser import * from coffparser import * from peparser import * ##extractcode_start def format_ob_patch_func_xors(objpa...
"""Generated message classes for logging version v1beta3. Google Cloud Logging API lets you manage logs, ingest and retrieve log entries within a log, and manage log sinks and metrics. """ # NOTE: This file is autogenerated and should not be edited by hand. from protorpc import messages from googlecloudapis.apitools...
"""The reconciler for auto deployed blueprints. The reconciler is responsible for launching Tekton PipelineRuns to deploy the blueprint and garbage collecting old instances Thid is the legacy versions which: 1. Doesn't support blueprints (i.e. uses Deployment Manager) 2. Uses K8s jobs not Tekton PipelineRuns. """...
from flask import current_app, request, Blueprint from flask_discoverer import advertise from .models import User, Profile from datetime import datetime from dateutil import parser from sqlalchemy import exc, and_ from sqlalchemy.orm import load_only import json import logging import pytz import adsmutils import reques...
import pyxtal.symmetry as sym from pyxtal.lattice import Lattice from pyxtal.wyckoff_site import atom_site from pyxtal.operations import apply_ops, get_inverse from pyxtal.wyckoff_split import wyckoff_split import pymatgen.analysis.structure_matcher as sm import numpy as np from copy import deepcopy from random import ...
import util.game_info as gi import math from util.data_processor_v3 import scs_to_array, array_to_scs from Networks.legacy.data_processor_v3 import nn_to_rlbot_controls, rlbot_to_nn_controls, xbox_to_nn_controls from Networks.legacy.XInputReader import get_xbox_output as get_controller_output from Networks.legacy.data_...
# Copyright © 2012-2021 <NAME> <<EMAIL>> # # 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,...
# -*- coding: utf-8 -*- r""" Group algebras and beyond: the Algebra functorial construction Introduction: group algebras ============================ Let `G` be a group and `R` be a ring. For example:: sage: G = DihedralGroup(3) sage: R = QQ The *group algebra* `A = RG` of `G` over `R` is the space of form...
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2017-2018 <NAME> 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, ...
# # Copyright (c) 2014, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright notice, # this list of condit...
# 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...
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets 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 appl...
from DAQTasks_2flippers import * # pylint: disable=W0614 from flippr_3 import * # pylint: disable=W0614 from PyQt5 import QtWidgets, QtCore, QtNetwork import numpy as np from QPlot import QPlot import sys import socket import threading import re from time import time, sleep class SignalServer(object): """Si...
# 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 clang.cindex import TypeKind import inspect import re import textwrap class Declaration(object): def __init__(self, name, docstring=None): self.name = name self.docstring = docstring def __str__(self): return f'{self.name}' class FunctionBase(Declaration): def __init__(self...
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. """This module extends the TensorFlowOnSpark API to support Spark ML Pipelines. It provides a TFEstimator class to fit a TFModel using TensorFlow. The TFEstimator will actually sp...
#coding=utf8 import sys import re import logging import threading import time import webbrowser import locale import urwid import utils import config from hn import HnData, HnClient, HnAnalyze, HnSearch, HnSort from react import React, ReactConsole, Component logger = utils.get_logger() # FIXME: run in docker can...
# batmanpfp and thorpfp by @Nihinivi import asyncio import base64 import os import random import re import shutil import time import urllib from datetime import datetime import requests from PIL import Image, ImageDraw, ImageFont from pySmartDL import SmartDL from telethon.errors import FloodWaitError from telethon.t...
# pylint: disable=C0326 """ Defines the faces for representing the PBARL/PBEAML cards as 3D objects instead of just 1D elements. These functions intentionally do not handle offsets. Node 1/2 should be the offset/actual coordinates. The following shapes are fully supported: - ROD - TUBE - BAR - BOX - L - H - I1...
import numpy as np import progressbar import pdb import os, sys, inspect current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parent_dir = os.path.abspath(os.path.join(current_dir, os.pardir)) sys.path.append(parent_dir) # FIX THIS! - import init from parent directory MAIN = parent_...
#!/usr/bin/env python3 # Copyright (c) 2012, <NAME> (<EMAIL>) # 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, # th...
# 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...
# # Project Sketch2CAD # # Author: <NAME> (<EMAIL>), # Copyright (c) 2020. All Rights Reserved. # # ============================================================================== """Bevel operator parameters regression network. """ from __future__ import absolute_import from __future__ import division from __futur...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import logging import collections.abc import copy from os.path import split import yaml import numpy as np import astropy.units as u from astropy.table import Table from astropy.coordinates import SkyCoord from regions import PointSkyRegion from gammapy.m...
import hashlib import json import os # import shutil import tempfile import zipfile from wsgiref.util import FileWrapper from django.conf import settings from django.db import transaction from django.db.models import Q from django.http import StreamingHttpResponse, FileResponse from account.decorators import problem_...
# -*- coding: utf-8 -*- # in this version we add other functional utilities import copy as cp import matplotlib.pyplot as plt import math as m import numpy as np import tensorflow as tf import random as r import gc # define cross entropy loss function def compute_loss(labels, logits): return tf.reduce_mean(tf.nn.s...
from migen import log2_int def get_sdram_phy_init_sequence(phy_settings, timing_settings): # init sequence cmds = { "PRECHARGE_ALL": "DFII_COMMAND_RAS|DFII_COMMAND_WE|DFII_COMMAND_CS", "MODE_REGISTER": "DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS", "AUTO_REFRESH":...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import re from dataclasses import dataclass from functools import partial from typing import ( TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Pattern, Type, Union, ) from semver import VersionInfo from l...
# Natural Language Toolkit: IBM Model 5 # # Copyright (C) 2001-2021 NLTK Project # Author: <NAME> <<EMAIL>> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Translation model that keeps track of vacant positions in the target sentence to decide where to place translated words. Translation can ...
# Copyright 2015 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...
import numpy as np import thalesians.tsa.checks as checks import thalesians.tsa.numpychecks as npc import thalesians.tsa.numpyutils as npu import thalesians.tsa.randomness as rnd import thalesians.tsa.stats as stats from thalesians.tsa.strings import ToStringHelper class Distr(object): def __init__(self...
import os import torch import copy import logging import random import numpy as np from tqdm import tqdm, trange import torch.nn.functional as F try: from torch.utils.tensorboard import SummaryWriter except: from tensorboardX import SummaryWriter from torch.utils.data import (DataLoader, RandomSampler, Sequenti...
from __future__ import print_function from amuse.support.exceptions import AmuseException from amuse.units import units from amuse.units.quantities import is_quantity try: import scipy.ndimage as ndimage import scipy.interpolate as interpolate import scipy.spatial as spatial except: raise Exception("Ed...
import copy import glob import math import pickle import random from typing import Any, Optional, Dict, List, Union, Tuple, Collection from ai2thor.fifo_server import FifoServer import ai2thor.server import numpy as np from ai2thor.controller import Controller from ai2thor.util import metrics from allenact.utils.cach...
import base64 import os import shutil import tempfile from collections import OrderedDict from datetime import datetime from os import path from attrdict import AttrDict import magic import xxhash from PIL import Image # from Pillow package from basehash import base62 from flask import Blueprint, render_template, fl...
# creatJSON.py # parameters: ## input file: either: url to github repository OR markdown documentation file path ## output file: json with each excerpt marked with all four classification scores import argparse import json import base64 from urllib.parse import urlparse import sys import os from os import path from pa...
# Copyright 2014 OpenStack Foundation # # 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 ...
import asyncio import fcntl import logging import os import sys import threading import time import uvloop import unittest import weakref from unittest import mock from uvloop._testbase import UVTestCase, AIOTestCase class _TestBase: def test_close(self): self.assertFalse(self.loop._closed) self...
from liegroups import SE3, SO3 from scipy.io import loadmat from math import cos, sin, sqrt import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d from scipy.linalg import block_diag D = np.array( [ [1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 0, 0], ...
"""This file contains code for use with "Think Stats", by <NAME>, available from greenteapress.com Copyright 2014 <NAME> License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import math import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as ...
from __future__ import print_function import sys from optparse import OptionParser import numpy from matplotlib import pylab as plt from glue.lal import Cache import lalsimutils """ test_like_and_samp.py: Testing the likelihood evaluation and sampler, working in conjunction """ __author__ = "<NAME> <<EMAIL>>, <N...
import json import hashlib import json import os import pickle import re import subprocess import uuid from collections import OrderedDict from io import BytesIO from zipfile import ZipFile import redis from PIL import Image from django.conf import settings from django.contrib.auth.decorators import login_required fro...
# -*- coding: utf-8 -*- """ pygments.lexers.ruby ~~~~~~~~~~~~~~~~~~~~ Lexers for Ruby and related languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, ...
import os import asyncio import gzip import time import re from datetime import datetime from functools import partial from botocore import UNSIGNED from botocore.config import Config import boto3 import codecs from google.cloud import bigquery from etl import base from utils.async_file_helper import AsyncFileHelper ...
# -*- coding: utf-8 -*- # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 th...
# -*- coding: utf-8 -*- """ Contains code to do live plotting """ # %% import time import datetime import threading import numpy as np import warnings import logging from scipy import ndimage from colorama import Fore import pyqtgraph import qtt from qcodes.instrument.parameter import Parameter from qcodes.utils.val...
""" A background process that averages your tensors with peers """ from __future__ import annotations import asyncio import contextlib import ctypes import multiprocessing as mp import os import threading import uuid import weakref from concurrent.futures.thread import ThreadPoolExecutor from dataclasses import asdic...
from __future__ import unicode_literals import json import re import os import subprocess from collections import OrderedDict from distutils.spawn import find_executable from functools import partial from itertools import chain from typing import Text, Iterable, Union, Dict, Set, Sequence, Any import six import yaml ...
import numpy as np import networkx as nx import math import scipy from os import path from datetime import datetime import pickle import json import pandas as pd import torch from torch.optim import Adam, AdamW from deep_learning.deep_utils import FocalLoss from tqdm import tqdm import sys import copy def balance_data...
#!/usr/bin/python # imports import os import sys import signal import argparse import fileinput import numpy as np import tensorflow as tf from utils import * from copy import deepcopy from glob import glob from shutil import rmtree from pprint import pprint from setproctitle import setproctitle from model import RGNM...
# -*- coding: utf-8 -*- u"""Cliches are cliché.""" from proselint.tools import memoize, existence_check @memoize def check_cliches_garner(text): """Check the text. source: Garner's Modern American Usage source_url: http://bit.ly/1T4alrY """ err = "cliches.garner" msg = u"'{}' is cliché....
"""Periodic pattern mining with a MDL criterion""" # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD 3 clause import warnings from itertools import groupby import numpy as np import pandas as pd from ..base import BaseMiner, DiscovererMixin, MDLOptimizer from ..bitmaps import Bitmap from ..uti...
"""awspds_mosaic.templates: HTML and XML templates.""" def landsatlive(endpoint: str, token: str = "") -> str: """Landsatlive LIVE.""" return f"""<!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <title></title> <meta name='viewport' content='initial-scale=1,maximum-scal...
# pip install streamlit plotly #pip install psx-data-reader from typing import ClassVar from psx import stocks, tickers import streamlit as st from prophet import Prophet from prophet.plot import plot_plotly from prophet.plot import plot_plotly from plotly import graph_objs as go #START = "2015-01-01" #...
#!/usr/bin/env python # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # ''' Hartree-Fock for periodic systems with k-point sampling See Also: hf.py : Hartree-Fock for periodic systems at a single k-point ''' import sys import time from functools import reduce import numpy as...
""" The main usage of this module is to configure jpy with respect to a given Java version and Python version. The module can also be used as tool. For usage, type: python jpyutil.py --help The function being invoked here is `write_config_files()` which may also be directly used from your Python code. It will cre...
""" An adapter for executing Arkane. """ import os import shutil from typing import Optional, Type from rmgpy.species import Species import arkane.input from arkane.input import (reaction as arkane_reaction, species as arkane_input_species, transitionState as arkan...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
import os import argparse import datetime """Main python reports script. Used to generate reports from log files""" __author__ = "<NAME> <<EMAIL>>" parser = argparse.ArgumentParser() parser.add_argument('--project', help='project to run report on', required=True) parser.add_argument('--sha', help='sha of defined proj...
#!/usr/bin/env python3 """ BSD 3-Clause License Copyright (c) 2018, <NAME>, Aalto University, Finland 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 a...
import itertools import copy import math import numpy as np import pandas as pd from tqdm import tqdm import basicDeltaOperations as op ''' This code calculates a dictionary giving all possible isotopologues of a molecule and their concentrations, based on input infor...
import types import pytest import numpy as np import discretisedfield as df def check_mesh(mesh): assert isinstance(mesh.p1, tuple) assert len(mesh.p1) == 3 assert isinstance(mesh.p2, tuple) assert len(mesh.p2) == 3 assert isinstance(mesh.cell, tuple) assert len(mesh.cell) == 3 assert isin...
from PIL import Image from math import floor, log2 import numpy as np from random import random import os from tensorflow.keras.layers import * from tensorflow.keras.models import * from tensorflow.keras.optimizers import * from tensorflow.keras.initializers import * import tensorflow as tf import tensorflow.keras.bac...
import functools import torch import torch.nn as nn import numpy as np import torch.nn.functional as F ngpu =1 device = torch.device("cuda:0" if (torch.cuda.is_available() and ngpu > 0)else "cpu") def make_layer(block, n_layers): layers = [] for _ in range(n_layers): layers.append(block()) return n...