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 | |
from sklearn.model_selection import KFold | |
from sklearn.model_selection._split import _BaseKFold, indexable, _num_samples | |
from sklearn.utils.validation import _deprecate_positional_args | |
# modified code for group gaps; source | |
# https://github.com/getgaurav2/scikit-learn/blob/d4a3af5cc9da3a76f0266932644b884c99724c57/sklearn/model_selection/_split.py#L2243 | |
class PurgedGroupTimeSeriesSplit(_BaseKFold): | |
"""Time Series cross-validator variant with non-overlapping groups. |
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
Add-Type -AssemblyName System.Windows.Forms | |
Add-Type -AssemblyName System.Drawing | |
# start creating UI | |
$form = New-Object System.Windows.Forms.Form | |
$form.Text = 'Keep Screen Active' | |
$form.Size = New-Object System.Drawing.Size(300, 150) | |
$form.StartPosition = 'CenterScreen' | |
# add OK button |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from collections import defaultdict | |
class Graph: | |
def __init__(self, vertices): | |
''' | |
@vertices: number of vertices | |
''' | |
self.graph = defaultdict(list) # adjacency list | |
self.V = vertices |
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 logging | |
import requests | |
from requests.adapters import HTTPAdapter, Retry | |
logging.basicConfig(level=logging.DEBUG) | |
session = requests.Session() | |
retries = Retry(total=5, backoff_factor=1, status_forcelist=[502, 503, 504]) | |
session.mount('http://', HTTPAdapter(max_retries=retries)) |