Focusing
Pinned Loading
-
Describe nested datastructure
Describe nested datastructure 1from collections import defaultdict
23class Structure(object):
4"""
5Usage:
-
Abstract REST Api Helper
Abstract REST Api Helper 1import logging
23import requests
45 -
Singleton metaclass
Singleton metaclass 1import logging
234logger = logging.getLogger(__name__)
5 -
Faltten List/Dict of any depth
Faltten List/Dict of any depth 1def flatten(obj): # to flatten multi level list and dict
2if isinstance(obj, dict):
3flat_obj = {}
4for k, v in obj.items():
5fv = flatten(v)
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.