This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from typing import Optional, Union, Tuple, NamedTuple | |
| import hashlib | |
| import logging | |
| import os | |
| import boto3 | |
| import requests | |
| from bs4 import BeautifulSoup, NavigableString, Tag | |
| logger = logging.getLogger("scrapper_logger") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Prevents customer from cancelling the Woocommerce subscription until after a duration. | |
| * For example a period of 2 months after the subscription got active before enabling the user to be able to cancel it. | |
| * This code will remove the subscription cancel button until that grace period has been used. | |
| */ | |
| function eg_remove_my_subscriptions_button( $actions, $subscription ) { | |
| // Get the current active user | |
| $user_id = wp_get_current_user(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pandas as pd | |
| # Fisher Index Calculation Helper Function - Can calculate for any number of features and classes. | |
| # Input parameter is Training Set and Label Set. | |
| # The training input set should be a 2D array | |
| # i.e (Examples by Features) - Examples on rows, features on colms E.g (400 by 30) | |
| # Label set should be a 2D array of size - (examples by 1). i.e 1 column. | |
| # The function will return a vector of the fisher ratios. | |
| # Requirements Library - Pandas and Numpy |