code: def cf_dictionary_from_pairs(pairs):
          
  
          length = len(pairs)
          keys = []
          values = []
          for pair in pairs:
              key, value = pair
              keys.append(key)
              values.append(value)
          return CoreFoundation.CFDictionaryCreate(
              CoreFoundation.kCFAllocatorDefault,
              keys,
              values,
              length,
              ffi.addressof(CoreFoundation.kCFTypeDictionaryKeyCallBacks),
              ffi.addressof(CoreFoundation.kCFTypeDictionaryValueCallBacks)
          )
docs: 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