def convert2dbus(value, signature):
if len(signature) == <NUM_LIT:2> and signature.startswith('<STR_LIT:a>'):<EOL><INDENT>return dbus.Array(value, signature=signature[-<NUM_LIT:1>])<EOL><DEDENT>dbus_string_type = dbus.String if PY3 else dbus.UTF8String<EOL>type_map = {<EOL>'<STR_LIT:b>': dbus.Boolean, '<STR_LIT:y>': dbus.Byte, '<STR_LIT:n>': dbus.Int16,<EOL>'<STR_LIT:i>': dbus.Int32, '<STR_LIT:x>': dbus.Int64, '<STR_LIT:q>': dbus.UInt16, '<STR_LIT:u>': dbus.UInt32,<EOL>'<STR_LIT:t>': dbus.UInt64, '<STR_LIT:d>': dbus.Double, '<STR_LIT:o>': dbus.ObjectPath,<EOL>'<STR_LIT:g>': dbus.Signature, '<STR_LIT:s>': dbus_string_type}<EOL>return type_map[signature](value)<EOL>
Converts `value` type from python to dbus according signature.

    :param value: value to convert to dbus object
    :param str signature: dbus type signature.
    :returns: value in dbus type.