pip3 install pipenv
pipenv shell
import uuid | |
import hashlib | |
def hashText(secret, uri): | |
""" | |
Basic hashing function for a text using unique secret from the user. | |
""" | |
return hashlib.sha256(secret.encode() + text.encode()).hexdigest() + ':' + secret | |
def matchHashedText(hashedUri, Uri): |
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.8.4; | |
import "hardhat/console.sol"; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "./RewardToken.sol"; | |
contract StakingManager is Ownable{ |
#importing the required packages | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
import statsmodels.api as sm | |
def normalize_z(dfin): | |
dfout = (dfin - dfin.mean(axis=0))/dfin.std(axis=0) | |
return dfout |
#confusionmatrix | |
from sklearn.metrics import confusion_matrix | |
import numpy as np | |
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14, normalize=False): | |
if normalize: | |
confusion_matrix = confusion_matrix.astype('float') / confusion_matrix.sum(axis=1)[:, np.newaxis] | |
fmt = '.2f' | |
title = 'Normalized Confusion Matrix' |