__ss_bool samestat(__os__::__cstat *s1, __os__::__cstat *s2) { /** Test whether two stat buffers reference the same file */ __ss_int __18; return __mbool(__AND((s1->st_ino==s2->st_ino), (s1->st_dev==s2->st_dev), 18)); }
__ss_bool isabs(str *s) { /** Test whether a path is absolute */ return __mbool(s->startswith(const_4)); }
__ss_bool str::__eq__(pyobj *p) { str *q = (str *)p; size_t len = unit.size(); if(len != q->unit.size() or (hash != -1 and q->hash != -1 and hash != q->hash)) return False; return __mbool(memcmp(unit.data(), q->unit.data(), len) == 0); }
tuple2<__ss_bool, str *> *long_has_args(str *opt, pyiter<str *> *longopts) { list<str *> *possibilities; str *unique_match; __ss_bool has_arg; possibilities = list_comp_0(opt, longopts); if ((!___bool(possibilities))) { throw ((new GetoptError(__modct(const_8, 1, opt),opt))); } if (possibilities->__contains__(opt)) { return (new tuple2<__ss_bool, str *>(2, False, opt)); } else if (possibilities->__contains__(opt->__add__(const_5))) { return (new tuple2<__ss_bool, str *>(2, True, opt)); } if ((len(possibilities)>1)) { throw ((new GetoptError(__modct(const_9, 1, opt),opt))); } ASSERT((len(possibilities)==1), 0); unique_match = possibilities->__getfast__(0); has_arg = __mbool(unique_match->endswith(const_5)); if (has_arg) { unique_match = unique_match->__slice__(2, 0, -1, 0); } return (new tuple2<__ss_bool, str *>(2, has_arg, unique_match)); }
__ss_bool isabs(str *s) { /** Test whether a path is absolute */ __ss_int __0, __1; s = (splitdrive(s))->__getsecond__(); return __mbool(__AND(__ne(s, const_1), (const_18)->__contains__(s->__slice__(2, 0, 1, 0)), 0)); }
__ss_bool mmap::__contains__(str *string) { __raise_if_closed_or_not_readable(); if (string == 0 or string->size() != 1) { throw new ValueError(const_8); } return __mbool(find(string, 0) != -1); }
__ss_bool str::startswith(str *s, __ss_int start, __ss_int end) { __ss_int i, j, one = 1; slicenr(7, start, end, one, __len__()); for(i = start, j = 0; i < end && j < len(s); ) if (unit[i++] != s->unit[j++]) return False; return __mbool(j == len(s)); }
__ss_bool samefile(str *f1, str *f2) { /** Test whether two pathnames reference the same actual file */ __os__::__cstat *s1, *s2; s1 = __os__::stat(f1); s2 = __os__::stat(f2); return __mbool(samestat(s1, s2)); }
__ss_bool isdir(str *path) { /** Test whether a path is a directory */ __os__::__cstat *st; try { st = __os__::stat(path); } catch (__os__::error *) { return False; } return __mbool(__stat__::__ss_S_ISDIR(st->st_mode)); }
__ss_bool isfile(str *path) { /** Test whether a path is a regular file */ __os__::__cstat *st; try { st = __os__::stat(path); } catch (__os__::error *) { return False; } return __mbool(__stat__::__ss_S_ISREG(st->st_mode)); }
__ss_bool islink(str *path) { /** Test whether a path is a symbolic link */ __os__::__cstat *st; try { st = __os__::lstat(path); } catch (__os__::error *) { return False; } return __mbool(__stat__::__ss_S_ISLNK(st->st_mode)); }
__ss_bool short_has_arg(str *opt, str *shortopts) { str *__26; __ss_int __24, __25, i; FAST_FOR(i,0,len(shortopts),1,24,25) if ((__eq(opt, (__26=shortopts->__getitem__(i)))&&__ne(__26, const_11))) { return __mbool(shortopts->startswith(const_11, (i+1))); } END_FOR throw ((new GetoptError(__modct(const_12, 1, opt),opt))); }
template<> inline __ss_bool __le(complex a, complex b) { return __mbool(true); }
template<> inline __ss_int __cmp(complex a, complex b) { return __mbool(true); } /* unused, satisfy templates */
__ss_bool pyobj::__eq__(pyobj *p) { return __mbool(this == p); }
template<class A, class B> __ss_bool tuple2<A, B>::__eq__(pyobj *p) { tuple2<A,B> *b = (tuple2<A,B> *)p; return __mbool(__eq(first, b->__getfirst__()) & __eq(second, b->__getsecond__())); }
__ss_bool complex_::__nonzero__() { return __mbool(unit.real == 0 and unit.imag == 0); }
inline __ss_bool __ss_is_integer(double d) { return __mbool((long long)d == d); }
__ss_bool pyobj::__le__(pyobj *p) { return __mbool(__cmp__(p) != 1); }
inline __ss_bool complex::operator!=(complex b) { return __mbool(real!=b.real or imag!=b.imag); }
template<> inline __ss_bool ___bool(complex c) { return __mbool(c.real != 0.0 or c.imag != 0); }
template<> __ss_bool __to_ss(PyObject *p) { return (p==Py_True)?(__mbool(true)):(__mbool(false)); }
__ss_bool pyobj::__lt__(pyobj *p) { return __mbool(__cmp__(p) == -1); }
__ss_bool str::__contains__(str *s) { return __mbool(unit.find(s->unit) != std::string::npos); }
__ss_bool str::isspace() { return __mbool(unit.size() && (unit.find_first_not_of(ws) == std::string::npos)); }
inline __ss_bool complex::operator==(complex b) { return __mbool(real==b.real and imag==b.imag); }
__ss_bool pyobj::__ne__(pyobj *p) { return __mbool(!__eq__(p)); }
__ss_bool class_::__eq__(pyobj *c) { return __mbool(c == this); }
__ss_bool pyobj::__nonzero__() { return __mbool(__len__() != 0); }