This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netdb.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <cstring> | |
#include <iostream> | |
#include <stdint.h> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/50578581/pymongo-dict-to-dotted-notation-automatically | |
# Converts a dict/iterable object (instance of Meta) to a dotted notation. | |
# Supports objects of classes defined with namedtuple (_asdict()). | |
# Doesn't process array elements. | |
# Instances of Meta can implement __call__(). | |
class Meta: | |
def __setitem__(self, k, v): | |
self.__dict__[k] = v |