Source code for common.converter

import json
from typing import List, Dict

[docs]class Converter: """Most common conversion operations"""
[docs] @staticmethod def json_to_dict(data)->Dict: """Takes json file and return python dictionary""" print(data) print(type(data))
[docs] @staticmethod def flatten_list(l:List)->List: """Python trick to make the list flat""" return sum(l, [])
[docs] @staticmethod def dict_sort(d:Dict)->Dict: pass
[docs] @staticmethod def remove_duplicates(l:List)->List: """Removes duplicates and sort list""" s = set(l) l = list(s) l.sort() return l