Use the Python client elasticsearch
.
from elasticsearch import Elasticsearch
es_client = Elasticsearch() # local
# Imports | |
import pandas as pd | |
import numpy as np | |
from scipy.stats import entropy | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import classification_report | |
from matplotlib import pyplot as plt |
# Copyright (C) 2016 Martina Pugliese | |
from boto3 import resource | |
from boto3.dynamodb.conditions import Key | |
# The boto3 dynamoDB resource | |
dynamodb_resource = resource('dynamodb') | |
def get_table_metadata(table_name): |
# Copyright (C) 2016 Martina Pugliese | |
# Imports | |
from datetime import datetime | |
# #################### ANSI Escape codes for terminal ######################### | |
codes_dict = { |
# Copyright (C) 2016 Martina Pugliese | |
def run_methods(): | |
print '\n' | |
print '* Count occurrences of substring in string' | |
print 'Martina'.count('art') | |
print 'Martina'.count('a') |
vm_stat
is the command, this makes output user friendly, thanks to this.
vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages\s+([^:]+)[^\d]+(\d+)/ and printf("%-16s % 16.2f Mi\n", "$1:", $2 * $size / 1048576);'
for key in d.keys()
and for key in d