# Path: glanceclient/common/utils.py
# SENSITIVE_HEADERS = ('X-Auth-Token', )
# REQUIRED_FIELDS_ON_DATA = ('disk_format', 'container_format')
# def arg(*args, **kwargs):
#     def _decorator(func):
# def on_data_require_fields(data_fields, required=REQUIRED_FIELDS_ON_DATA):
#     def args_decorator(func):
#         def prepare_fields(fields):
#         def func_wrapper(gc, args):
# def schema_args(schema_getter, omit=None):
#     def _decorator(func):
# def pretty_choice_list(l):
# def has_version(client, version):
# def print_cached_images(cached_images):
# def print_dict_list(objects, fields):
# def print_list(objs, fields, formatters=None, field_settings=None):
# def _encode(src):
# def unicode_key_value_to_string(src):
# def print_dict(d, max_column_width=80):
# def find_resource(manager, name_or_id):
# def env(*vars, **kwargs):
# def exit(msg='', exit_code=1):
# def print_err(msg):
# def save_image(data, path):
# def make_size_human_readable(size):
# def get_file_size(file_obj):
# def get_data_file(args):
# def strip_version(endpoint):
# def print_image(image_obj, human_readable=False, max_col_width=None):
# def integrity_iter(iter, checksum):
# def serious_integrity_iter(iter, hasher, hash_value):
# def memoized_property(fn):
#     def _memoized_property(self):
# def safe_header(name, value):
# def endpoint_version_from_url(endpoint, default_version=None):
# def debug_enabled(argv):
#     def __init__(self, iterable, length):
#     def __iter__(self):
#     def next(self):
#     def __len__(self):
#     def __init__(self, wrapped):
#     def request_ids(self):
#     def wrapped(self):
#     def next(self):
#     def __init__(self, wrapped):
#     def _set_request_ids(self, resp):
#     def _next(self):
#     def next(self):
#     def __next__(self):
#     def __iter__(self):
#     def request_ids(self):
#     def wrapped(self):
# def add_req_id_to_object():
#     def inner(wrapped, instance, args, kwargs):
# def add_req_id_to_generator():
#     def inner(wrapped, instance, args, kwargs):
# def _extract_request_id(resp):
# class IterableWithLength(object):
# class RequestIdProxy(wrapt.ObjectProxy):
# class GeneratorProxy(wrapt.ObjectProxy):
# 
# Path: glanceclient/v1/apiclient/base.py
# def getid(obj):
#     def add_hook(cls, hook_type, hook_func):
#     def run_hooks(cls, hook_type, *args, **kwargs):
#     def __init__(self, client):
#     def _list(self, url, response_key=None, obj_class=None, json=None):
#     def _get(self, url, response_key=None):
#     def _head(self, url):
#     def _post(self, url, json, response_key=None, return_raw=False):
#     def _put(self, url, json=None, response_key=None):
#     def _patch(self, url, json=None, response_key=None):
#     def _delete(self, url):
#     def list(self):
#     def find(self, **kwargs):
#     def findall(self, **kwargs):
#     def build_url(self, base_url=None, **kwargs):
#     def _filter_kwargs(self, kwargs):
#     def create(self, **kwargs):
#     def get(self, **kwargs):
#     def head(self, **kwargs):
#     def list(self, base_url=None, **kwargs):
#     def put(self, base_url=None, **kwargs):
#     def update(self, **kwargs):
#     def delete(self, **kwargs):
#     def find(self, base_url=None, **kwargs):
#     def __init__(self, name, module):
#     def _parse_extension_module(self):
#     def __repr__(self):
#     def __init__(self, manager, info, loaded=False):
#     def __repr__(self):
#     def human_id(self):
#     def _add_details(self, info):
#     def __getattr__(self, k):
#     def get(self):
#     def __eq__(self, other):
#     def is_loaded(self):
#     def set_loaded(self, val):
#     def to_dict(self):
# class HookableMixin(object):
# class BaseManager(HookableMixin):
# class ManagerWithFind(BaseManager, metaclass=abc.ABCMeta):
# class CrudManager(BaseManager):
# class Extension(HookableMixin):
# class Resource(object):
#     SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')
#     HUMAN_ID = False
#     NAME_ATTR = 'name'


import copy
import urllib.parse
from oslo_utils import encodeutils
from oslo_utils import strutils
from glanceclient.common import utils
from glanceclient.v1.apiclient import base
        # that are not instance of basestring. All
        # headers will be encoded later, before the
        # request is sent.
        def to_str(value):
            if not isinstance(value, str):
                return str(value)
            return value

        for key, value in fields_copy.pop('properties', {}).items():
            headers['x-image-meta-property-%s' % key] = to_str(value)
        for key, value in fields_copy.items():
            headers['x-image-meta-%s' % key] = to_str(value)
        return headers

    @staticmethod
    def _format_image_meta_for_user(meta):
        for key in ['size', 'min_ram', 'min_disk']:
            if key in meta:
                try:
                    meta[key] = int(meta[key]) if meta[key] else 0
                except ValueError:
                    pass
        return meta

    def get(self, image, **kwargs):
        """Get the metadata for a specific image.

        :param image: image object or id to look up
        :rtype: :class:`Image`
        """

# Path: glanceclient/common/utils.py
# SENSITIVE_HEADERS = ('X-Auth-Token', )
# REQUIRED_FIELDS_ON_DATA = ('disk_format', 'container_format')
# def arg(*args, **kwargs):
#     def _decorator(func):
# def on_data_require_fields(data_fields, required=REQUIRED_FIELDS_ON_DATA):
#     def args_decorator(func):
#         def prepare_fields(fields):
#         def func_wrapper(gc, args):
# def schema_args(schema_getter, omit=None):
#     def _decorator(func):
# def pretty_choice_list(l):
# def has_version(client, version):
# def print_cached_images(cached_images):
# def print_dict_list(objects, fields):
# def print_list(objs, fields, formatters=None, field_settings=None):
# def _encode(src):
# def unicode_key_value_to_string(src):
# def print_dict(d, max_column_width=80):
# def find_resource(manager, name_or_id):
# def env(*vars, **kwargs):
# def exit(msg='', exit_code=1):
# def print_err(msg):
# def save_image(data, path):
# def make_size_human_readable(size):
# def get_file_size(file_obj):
# def get_data_file(args):
# def strip_version(endpoint):
# def print_image(image_obj, human_readable=False, max_col_width=None):
# def integrity_iter(iter, checksum):
# def serious_integrity_iter(iter, hasher, hash_value):
# def memoized_property(fn):
#     def _memoized_property(self):
# def safe_header(name, value):
# def endpoint_version_from_url(endpoint, default_version=None):
# def debug_enabled(argv):
#     def __init__(self, iterable, length):
#     def __iter__(self):
#     def next(self):
#     def __len__(self):
#     def __init__(self, wrapped):
#     def request_ids(self):
#     def wrapped(self):
#     def next(self):
#     def __init__(self, wrapped):
#     def _set_request_ids(self, resp):
#     def _next(self):
#     def next(self):
#     def __next__(self):
#     def __iter__(self):
#     def request_ids(self):
#     def wrapped(self):
# def add_req_id_to_object():
#     def inner(wrapped, instance, args, kwargs):
# def add_req_id_to_generator():
#     def inner(wrapped, instance, args, kwargs):
# def _extract_request_id(resp):
# class IterableWithLength(object):
# class RequestIdProxy(wrapt.ObjectProxy):
# class GeneratorProxy(wrapt.ObjectProxy):
# 
# Path: glanceclient/v1/apiclient/base.py
# def getid(obj):
#     def add_hook(cls, hook_type, hook_func):
#     def run_hooks(cls, hook_type, *args, **kwargs):
#     def __init__(self, client):
#     def _list(self, url, response_key=None, obj_class=None, json=None):
#     def _get(self, url, response_key=None):
#     def _head(self, url):
#     def _post(self, url, json, response_key=None, return_raw=False):
#     def _put(self, url, json=None, response_key=None):
#     def _patch(self, url, json=None, response_key=None):
#     def _delete(self, url):
#     def list(self):
#     def find(self, **kwargs):
#     def findall(self, **kwargs):
#     def build_url(self, base_url=None, **kwargs):
#     def _filter_kwargs(self, kwargs):
#     def create(self, **kwargs):
#     def get(self, **kwargs):
#     def head(self, **kwargs):
#     def list(self, base_url=None, **kwargs):
#     def put(self, base_url=None, **kwargs):
#     def update(self, **kwargs):
#     def delete(self, **kwargs):
#     def find(self, base_url=None, **kwargs):
#     def __init__(self, name, module):
#     def _parse_extension_module(self):
#     def __repr__(self):
#     def __init__(self, manager, info, loaded=False):
#     def __repr__(self):
#     def human_id(self):
#     def _add_details(self, info):
#     def __getattr__(self, k):
#     def get(self):
#     def __eq__(self, other):
#     def is_loaded(self):
#     def set_loaded(self, val):
#     def to_dict(self):
# class HookableMixin(object):
# class BaseManager(HookableMixin):
# class ManagerWithFind(BaseManager, metaclass=abc.ABCMeta):
# class CrudManager(BaseManager):
# class Extension(HookableMixin):
# class Resource(object):
#     SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')
#     HUMAN_ID = False
#     NAME_ATTR = 'name'


# Path: glanceclient/v1/images.py
import copy
import urllib.parse
from oslo_utils import encodeutils
from oslo_utils import strutils
from glanceclient.common import utils
from glanceclient.v1.apiclient import base

        # that are not instance of basestring. All
        # headers will be encoded later, before the
        # request is sent.
        def to_str(value):
            if not isinstance(value, str):
                return str(value)
            return value

        for key, value in fields_copy.pop('properties', {}).items():
            headers['x-image-meta-property-%s' % key] = to_str(value)
        for key, value in fields_copy.items():
            headers['x-image-meta-%s' % key] = to_str(value)
        return headers

    @staticmethod
    def _format_image_meta_for_user(meta):
        for key in ['size', 'min_ram', 'min_disk']:
            if key in meta:
                try:
                    meta[key] = int(meta[key]) if meta[key] else 0
                except ValueError:
                    pass
        return meta

    def get(self, image, **kwargs):
        """Get the metadata for a specific image.

        :param image: image object or id to look up
        :rtype: :class:`Image`
        """

        image_id = base.getid(image)