#NEWLINE# @ staticmethod #NEWLINE# def cf_dictionary_from_pairs( pairs ) : #NEWLINE# #INDENT# '\n        Creates a CFDictionaryRef object from a list of 2-element tuples\n        representing the key and value. Each key should be a CFStringRef and each\n        value some sort of CF* type.\n\n        :param pairs:\n            A list of 2-element tuples\n\n        :return:\n            A CFDictionaryRef\n        ' #NEWLINE# length = len ( pair ) #NEWLINE# keys = [ ] #NEWLINE# values = [ ] #NEWLINE# for pair in pairs : #NEWLINE# #INDENT# ( key , value ) = pair #NEWLINE# keys . append ( key ) #NEWLINE# values . append ( value ) #NEWLINE# #UNINDENT# return CoreFoundation . CFDictionaryCreate ( CoreFoundation . kCFAllocatorDefault , keys , values , length , ffi . addressof ( CoreFoundation . kCFTypeDictionaryKeyCallBacks ) , ffi . addressof ( CoreFoundation . kCFTypeDictionaryValueCallBacks ) )