<commit_before>#!/usr/bin/python3

"""
=== PREREQUISITES ===
Run in Python 3.6+

Install Meraki Python library: pip[3] install --upgrade meraki

=== DESCRIPTION ===
This script reports the org-wide appliances' uplink and devices's statuses.

=== USAGE ===
python[3] report_statuses.py -k <api_key> -o <org_id>

Use "-o /all" to iterate through all organizations
"""


import argparse
import csv
import meraki


def parse_arguments(parser):
    parser.add_argument('-k', '--key', help='Dashboard API key')
    parser.add_argument('-o', '--org', help='Organization ID. Use "-o /all" to iterate through all organizations')
    parser.exit
    args = parser.parse_args()
    return args.key, args.org


def main():
    # Check if all required parameters have been specified
    parser = argparse.ArgumentParser()
    api_key, arg_org_id = parse_arguments(parser)

    if not(api_key and arg_org_id):
        parser.exit(2, parser.print_help())

    # Make API calls to retrieve data
    dashboard = meraki.DashboardAPI(api_key)
    
    org_id_list = []<commit_msg>report_statuses: Added support for env var API key<commit_after>#!/usr/bin/python3

"""
=== PREREQUISITES ===
Run in Python 3.6+

Install Meraki Python library: pip[3] install --upgrade meraki

=== DESCRIPTION ===
This script reports the org-wide appliances' uplink and devices's statuses.

=== USAGE ===
python[3] report_statuses.py -k <api_key> -o <org_id>

Use "-o /all" to iterate through all organizations
"""


import argparse
import csv
import meraki
import os


def parse_arguments(parser):
    parser.add_argument('-k', '--key', help='Dashboard API key. If omitted, will use environment variable MERAKI_DASHBOARD_API_KEY')
    parser.add_argument('-o', '--org', help='Organization ID. Use "-o /all" to iterate through all organizations')
    parser.exit
    args = parser.parse_args()
    return args.key, args.org

def getApiKey(argument):
    if not argument is None:
        return str(argument)
    return os.environ.get("MERAKI_DASHBOARD_API_KEY", None)  

def main():
    # Check if all required parameters have been specified
    parser = argparse.ArgumentParser()
    tmp_api_key, arg_org_id = parse_arguments(parser)

    api_key = getApiKey(tmp_api_key)

    if not(api_key and arg_org_id):
        parser.exit(2, parser.print_help())

    # Make API calls to retrieve data
    dashboard = meraki.DashboardAPI(api_key)
    
    org_id_list = []
{'fraction_non_alphanumeric': 0.11674917491749175, 'fraction_numerical': 0.0049504950495049506, 'mean_word_length': 3.8306772908366535, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '465292', 'n_tokens_mistral': 806, 'n_tokens_neox': 772, 'n_words': 232}