MCPcopy Create free account
hub / github.com/ccxt/ccxt / safe_bool_2

Method safe_bool_2

python/ccxt/base/exchange.py:2943–2955  ·  view source on GitHub ↗

@ignore safely extract boolean value from dictionary or list :returns bool | None:

(self, dictionaryOrList, key1: IndexType, key2: IndexType, defaultValue: bool = None)

Source from the content-addressed store, hash-verified

2941 return defaultValue
2942
2943 def safe_bool_2(self, dictionaryOrList, key1: IndexType, key2: IndexType, defaultValue: bool = None):
2944 """
2945 @ignore
2946 safely extract boolean value from dictionary or list
2947 :returns bool | None:
2948 """
2949 value = self.safe_value(dictionaryOrList, key1)
2950 if isinstance(value, bool):
2951 return value
2952 value2 = self.safe_value(dictionaryOrList, key2)
2953 if isinstance(value2, bool):
2954 return value2
2955 return defaultValue
2956
2957 def safe_bool(self, dictionaryOrList, key: IndexType, defaultValue: bool = None):
2958 """

Callers 15

test_safe_methodsFunction · 0.95
after_constructMethod · 0.95
handle_param_bool_2Method · 0.95
is_post_onlyMethod · 0.95
cancel_order_requestMethod · 0.80
cancel_all_ordersMethod · 0.80
fetch_open_ordersMethod · 0.80
parse_tradeMethod · 0.80
create_orderMethod · 0.80
cancel_spot_orderMethod · 0.80

Calls 1

safe_valueMethod · 0.95

Tested by 1

test_safe_methodsFunction · 0.76