MCPcopy Create free account
hub / github.com/ml-explore/mlx / is_zip_file

Function is_zip_file

python/src/load.cpp:44–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44bool is_zip_file(const nb::module_& zipfile, const nb::object& file) {
45 if (is_istream_object(file)) {
46 auto st_pos = file.attr("tell")();
47 bool r = nb::cast<bool>(zipfile.attr("is_zipfile")(file));
48 file.attr("seek")(st_pos, 0);
49 return r;
50 }
51 return nb::cast<bool>(zipfile.attr("is_zipfile")(file));
52}
53
54class ZipFileWrapper {
55 public:

Callers 1

mlx_load_npz_helperFunction · 0.85

Calls 1

is_istream_objectFunction · 0.85

Tested by

no test coverage detected