MCPcopy
hub / github.com/JDAI-CV/fast-reid / open

Method open

fastreid/utils/file_io.py:339–358  ·  view source on GitHub ↗

Open a stream to a URI, similar to the built-in `open`. Args: path (str): A URI supported by this PathHandler mode (str): Specifies the mode in which the file is opened. It defaults to 'r'. buffering (int): An optional integer used

(
            path: str, mode: str = "r", buffering: int = -1, **kwargs: Any
    )

Source from the content-addressed store, hash-verified

337
338 @staticmethod
339 def open(
340 path: str, mode: str = "r", buffering: int = -1, **kwargs: Any
341 ) -> Union[IO[str], IO[bytes]]:
342 """
343 Open a stream to a URI, similar to the built-in `open`.
344 Args:
345 path (str): A URI supported by this PathHandler
346 mode (str): Specifies the mode in which the file is opened. It defaults
347 to 'r'.
348 buffering (int): An optional integer used to set the buffering policy.
349 Pass 0 to switch buffering off and an integer >= 1 to indicate the
350 size in bytes of a fixed-size chunk buffer. When no buffering
351 argument is given, the default buffering policy depends on the
352 underlying I/O implementation.
353 Returns:
354 file: a file-like object.
355 """
356 return PathManager.__get_path_handler(path)._open( # type: ignore
357 path, mode, buffering=buffering, **kwargs
358 )
359
360 @staticmethod
361 def copy(

Callers 15

__init__Method · 0.80
saveMethod · 0.80
get_checkpoint_fileMethod · 0.80
tag_last_checkpointMethod · 0.80
evaluateMethod · 0.80
__getitem__Method · 0.80
mainFunction · 0.80
mainFunction · 0.80
__init__Method · 0.80
saveMethod · 0.80
get_checkpoint_fileMethod · 0.80

Calls 2

__get_path_handlerMethod · 0.80
_openMethod · 0.45

Tested by

no test coverage detected