MCPcopy Create free account
hub / github.com/catboost/catboost / push

Method push

catboost/python-package/catboost/core.py:144–169  ·  view source on GitHub ↗
(self, log_cout=None, log_cerr=None)

Source from the content-addressed store, hash-verified

142 )
143
144 def push(self, log_cout=None, log_cerr=None):
145 with self._lock:
146 if not self._stack:
147 self._owning_thread_id = threading.current_thread().ident
148 elif self._owning_thread_id != threading.current_thread().ident:
149 if (log_cout is not None) or (log_cerr is not None):
150 raise CatBoostError(
151 'CatBoost custom loggers have been already set in another thread. '
152 + ' Setting custom loggers from different threads is not currently supported'
153 )
154 return
155
156 def init_log(log, default, index_in_stack):
157 if log is None:
158 if not self._stack:
159 return default
160 else:
161 return self._stack[-1][index_in_stack]
162 return _CustomLoggersStack._get_stream_like_object(log)
163
164 cout = init_log(log_cout, sys.stdout, 0)
165 cerr = init_log(log_cerr, sys.stderr, 1)
166
167 _reset_logger()
168 _set_logger(cout, cerr)
169 self._stack.append((cout, cerr))
170
171 def pop(self):
172 with self._lock:

Callers 10

createConfigForVersionFunction · 0.45
downloadFileFunction · 0.45
log_fixupFunction · 0.45
CatboostIpython.jsFile · 0.45
process_rowMethod · 0.45
mainFunction · 0.45
TXmlOutputContextClass · 0.45
StartElementMethod · 0.45
AddTaskMethod · 0.45

Calls 2

CatBoostErrorClass · 0.50
appendMethod · 0.45

Tested by

no test coverage detected