INNER CODE UNIT · Python
marge_feature_switch
fa0311/TwitterInternalAPIDocument · lib/graphql.py:102
def marge_feature_switch(initial_output: dict) -> dict:
featureSwitches = {}
for k in initial_output["featureSwitch"].keys():
if k == "debug":
for k in initial_output["featureSwitch"]["debug"].keys():
featureSwitches[k] = initial_output["featureSwitch"]["debug"][k]
if k == "defaultConfig":
for k in initial_output["featureSwitch"]["defaultConfig"].keys():
featureSwitches[k] = initial_output["featureSwitch"]["defaultConfig"][k]
if k == "user":
for k in initial_output["featureSwitch"]["user"]["config"].keys():
featureSwitches[k] = initial_output["featureSwitch"]["user"]["config"][
k
]
return featureSwitches
def marge_metadata(graphql_output: list, feature_switch: dict) -> list: