def _set_k8s_attribute(obj, attribute, value):
current_value = None<EOL>attribute_name = None<EOL>for python_attribute, json_attribute in obj.attribute_map.items():<EOL><INDENT>if json_attribute == attribute:<EOL><INDENT>attribute_name = python_attribute<EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(obj.attribute_map.values()))<EOL><DEDENT>if hasattr(obj, attribute_name):<EOL><INDENT>current_value = getattr(obj, attribute_name)<EOL><DEDENT>if current_value is not None:<EOL><INDENT>current_value = SERIALIZATION_API_CLIENT.sanitize_for_serialization(<EOL>current_value<EOL>)<EOL><DEDENT>if isinstance(current_value, dict):<EOL><INDENT>setattr(obj, attribute_name, merge_dictionaries(current_value, value))<EOL><DEDENT>elif isinstance(current_value, list):<EOL><INDENT>setattr(obj, attribute_name, current_value + value)<EOL><DEDENT>else:<EOL><INDENT>setattr(obj, attribute_name, value)<EOL><DEDENT>
Set a specific value on a kubernetes object's attribute

obj
    an object from Kubernetes Python API client
attribute
    Should be a Kubernetes API style attribute (with camelCase)
value
    Can be anything (string, list, dict, k8s objects) that can be
    accepted by the k8s python client