def valid_context(ctx): # type: (ApiCtx) -> ... sl = user.state_login(ctx) if sl["type"] == "response" and sl["response"]["State"] != -1: return True return False
def valid_context(ctx: ApiCtx): sl = user.state_login(ctx) if sl['type'] == 'response' and sl['response']['State'] != -1: return True return False