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
| Quality | Split | Alcohol | Malic acid | Ash | Alcalinity of ash | Magnesium | Total phenols | Flavanoids | Nonflavanoid phenols | Proanthocyanins | Color intensity | Hue | OD280/OD315 of diluted wines | Proline | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | train | 13.16 | 2.36 | 2.67 | 18.6 | 101 | 2.8 | 3.24 | 0.3 | 2.81 | 5.68 | 1.03 | 3.17 | 1185 | |
| 1 | train | 14.37 | 1.95 | 2.5 | 16.8 | 113 | 3.85 | 3.49 | 0.24 | 2.18 | 7.8 | 0.86 | 3.45 | 1480 | |
| 1 | train | 14.2 | 1.76 | 2.45 | 15.2 | 112 | 3.27 | 3.39 | 0.34 | 1.97 | 6.75 | 1.05 | 2.85 | 1450 | |
| 1 | train | 14.83 | 1.64 | 2.17 | 14.0 | 97 | 2.8 | 2.98 | 0.29 | 1.98 | 5.2 | 1.08 | 2.85 | 1045 | |
| 1 | train | 13.86 | 1.35 | 2.27 | 16.0 | 98 | 2.98 | 3.15 | 0.22 | 1.85 | 7.22 | 1.01 | 3.55 | 1045 | |
| 1 | train | 14.12 | 1.48 | 2.32 | 16.8 | 95 | 2.2 | 2.43 | 0.26 | 1.57 | 5.0 | 1.17 | 2.82 | 1280 | |
| 1 | train | 13.75 | 1.73 | 2.41 | 16.0 | 89 | 2.6 | 2.76 | 0.29 | 1.81 | 5.6 | 1.15 | 2.9 | 1320 | |
| 1 | train | 13.63 | 1.81 | 2.7 | 17.2 | 112 | 2.85 | 2.91 | 0.3 | 1.46 | 7.3 | 1.28 | 2.88 | 1310 | |
| 1 | train | 14.3 | 1.92 | 2.72 | 20.0 | 120 | 2.8 | 3.14 | 0.33 | 1.97 | 6.2 | 1.07 | 2.65 | 1280 |
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.abc import MutableMapping | |
| from typing import Any, Dict | |
| def _flatten_dict_gen(d: MutableMapping, parent_key: str, sep: str): | |
| for k, v in d.items(): | |
| new_key = parent_key + sep + k if parent_key else k | |
| if isinstance(v, MutableMapping): | |
| yield from flatten_dict(v, new_key, sep).items() | |
| elif isinstance(v, list) or isinstance(v, list): |
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
| def get_1_to_n_combinations(lst): | |
| return list(itertools.chain([ | |
| c | |
| for r in range(1, len(lst) + 1) | |
| for c in itertools.combinations(sorted(lst), r) | |
| ])) |
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 re | |
| log_regex = re.compile(r"""(?P<remote_addr>[0-9a-f\.:]+)\s+-\s+""" + | |
| r"""(?P<remote_user>\S+)\s+""" + | |
| r"""\[(?P<date_day>\d{2})\/(?P<date_month>[a-zA-Z]{3})\/(?P<date_year>\d{4}):""" + | |
| r"""(?P<time_hour>\d{2}):(?P<time_minutes>\d{2}):(?P<time_seconds>\d{2})\s+""" + | |
| r"""(?P<time_offset>(?:\-|\+)\d{4})\]\s+""" + | |
| r"""\"(?P<http_action>[a-zA-Z]+)\s+(?P<http_path>\S+)\s+(?P<http_protocol>\S+)\"\s+""" + | |
| r"""(?P<status_code>\d+)\s+""" + | |
| r"""(?P<bytes_sent>\d+)\s+""" + |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from __future__ import absolute_import, print_function, unicode_literals | |
| import datetime | |
| import smtplib | |
| import subprocess | |
| import sys |
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
| #!/bin/bash | |
| ### Lines "#SBATCH" configure the job resources | |
| ### (even though they look like bash comments) | |
| ### Job queue to use (options: batch) | |
| #SBATCH --partition=batch | |
| ### Amount of nodes to use | |
| #SBATCH --nodes=1 |
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
| #!/usr/bin/env bash | |
| set -e | |
| maxcores=${1:-6} | |
| sleeptime=${2:-5} | |
| function maxjobs { | |
| while [ $(jobs | wc -l) -ge $maxcores ] | |
| do | |
| sleep $sleeptime |
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
| # -*- coding: utf-8 -*- | |
| from __future__ import absolute_import, print_function, unicode_literals | |
| import fnmatch | |
| import os | |
| def traverse_directory(path, file_pattern='*'): | |
| for root, _, filenames in os.walk(path): | |
| for filename in fnmatch.filter(filenames, file_pattern): |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from __future__ import absolute_import, print_function, unicode_literals | |
| import argparse | |
| import os | |
| import smtplib | |
| import subprocess | |
| import sys |