@staticmethod<EOL><INDENT>def cf_dictionary_from_pairs(pairs):<DEDENT>
length = len(pairs)<EOL>keys = []<EOL>values = []<EOL>for pair in pairs:<EOL><INDENT>key, value = pair<EOL>keys.append(key)<EOL>values.append(value)<EOL><DEDENT>keys = (CFStringRef * length)(*keys)<EOL>values = (CFTypeRef * length)(*values)<EOL>return CoreFoundation.CFDictionaryCreate(<EOL>CoreFoundation.kCFAllocatorDefault,<EOL>_cast_pointer_p(byref(keys)),<EOL>_cast_pointer_p(byref(values)),<EOL>length,<EOL>kCFTypeDictionaryKeyCallBacks,<EOL>kCFTypeDictionaryValueCallBacks<EOL>)<EOL>
Creates a CFDictionaryRef object from a list of 2-element tuples
representing the key and value. Each key should be a CFStringRef and each
value some sort of CF* type.

:param pairs:
    A list of 2-element tuples

:return:
    A CFDictionaryRef