Any bucket created through cloudformation will have `"LocationConstraint": null`, implying us-east-1, although in AWS CloudFormation the bucket's region will always match the template's region.
try:
        out = to_str(subprocess.check_output('uname -a', shell=True))
        return 'Linux' in out
    except subprocess.CalledProcessError:
        return False
def short_uid():
    return str(uuid.uuid4())[0:8]
def json_safe(item):
    """ return a copy of the given object (e.g., dict) that is safe for JSON dumping """
    try:
        return json.loads(json.dumps(item, cls=CustomEncoder))
    except Exception:
        item = fix_json_keys(item)
        return json.loads(json.dumps(item, cls=CustomEncoder))
def fix_json_keys(item):
    """ make sure the keys of a JSON are strings (not binary type or other) """
    item_copy = item
    if isinstance(item, list):
        item_copy = []
        for i in item:
            item_copy.append(fix_json_keys(i))
    if isinstance(item, dict):
        item_copy = {}
        for k, v in item.items():
            item_copy[to_str(k)] = fix_json_keys(v)
    return item_copy
def save_file(file, content, append=False):