body_hash
stringlengths 64
64
| body
stringlengths 23
109k
| docstring
stringlengths 1
57k
| path
stringlengths 4
198
| name
stringlengths 1
115
| repository_name
stringlengths 7
111
| repository_stars
float64 0
191k
| lang
stringclasses 1
value | body_without_docstring
stringlengths 14
108k
| unified
stringlengths 45
133k
|
---|---|---|---|---|---|---|---|---|---|
dc0e86f2d29bdb3752654cc493c3bef27d4c16375db8a0b263d601cb2725b8c9 | def create_journal(self):
' Create the journal (the record is automatically created in the process of calling this method) and reprocess the statement '
statement_import_transient = self.env['account.bank.statement.import'].browse(self.env.context['statement_import_transient_id'])
return statement_import_transient.with_context(journal_id=self.journal_id.id).import_file() | Create the journal (the record is automatically created in the process of calling this method) and reprocess the statement | odoo-13.0/addons/account_bank_statement_import/wizard/journal_creation.py | create_journal | VaibhavBhujade/Blockchain-ERP-interoperability | 1 | python | def create_journal(self):
' '
statement_import_transient = self.env['account.bank.statement.import'].browse(self.env.context['statement_import_transient_id'])
return statement_import_transient.with_context(journal_id=self.journal_id.id).import_file() | def create_journal(self):
' '
statement_import_transient = self.env['account.bank.statement.import'].browse(self.env.context['statement_import_transient_id'])
return statement_import_transient.with_context(journal_id=self.journal_id.id).import_file()<|docstring|>Create the journal (the record is automatically created in the process of calling this method) and reprocess the statement<|endoftext|> |
de2a5a9858e8c004c4ea8e5436dc19e27e2de334310318a9bbd54577f1d953da | @property
def _cloudpath(self) -> str:
'\n Returns the `__fspath__` string representation without the uri_scheme\n '
return None | Returns the `__fspath__` string representation without the uri_scheme | lazy/io/pathz_v2/base.py | _cloudpath | trisongz/lazycls | 2 | python | @property
def _cloudpath(self) -> str:
'\n \n '
return None | @property
def _cloudpath(self) -> str:
'\n \n '
return None<|docstring|>Returns the `__fspath__` string representation without the uri_scheme<|endoftext|> |
837865a06cf71c711027695c6d6c1e67b4cc824d34a5570b15c55e62e4a741d6 | @property
def _bucket(self) -> str:
'\n Returns the `__fspath__` string representation without the uri_scheme\n '
return None | Returns the `__fspath__` string representation without the uri_scheme | lazy/io/pathz_v2/base.py | _bucket | trisongz/lazycls | 2 | python | @property
def _bucket(self) -> str:
'\n \n '
return None | @property
def _bucket(self) -> str:
'\n \n '
return None<|docstring|>Returns the `__fspath__` string representation without the uri_scheme<|endoftext|> |
f847c9596241cbcb5c8435e4b5d1d1350afef84c632d26651690f52e5b5bb74c | @property
def _bucketstr(self) -> Optional[str]:
'\n Returns the `__fspath__` string representation without the uri_scheme\n '
return None | Returns the `__fspath__` string representation without the uri_scheme | lazy/io/pathz_v2/base.py | _bucketstr | trisongz/lazycls | 2 | python | @property
def _bucketstr(self) -> Optional[str]:
'\n \n '
return None | @property
def _bucketstr(self) -> Optional[str]:
'\n \n '
return None<|docstring|>Returns the `__fspath__` string representation without the uri_scheme<|endoftext|> |
17b25f550d7b3bc85a645cc65be70ea7deffdce77114fd5f725d8663bcdccf8b | @property
def _pathkeys(self) -> Optional[str]:
'\n Returns the `__fspath__` string representation without the uri_scheme\n '
return None | Returns the `__fspath__` string representation without the uri_scheme | lazy/io/pathz_v2/base.py | _pathkeys | trisongz/lazycls | 2 | python | @property
def _pathkeys(self) -> Optional[str]:
'\n \n '
return None | @property
def _pathkeys(self) -> Optional[str]:
'\n \n '
return None<|docstring|>Returns the `__fspath__` string representation without the uri_scheme<|endoftext|> |
5d9b631f8e2d63b556704970769186a3e8aa5863b0a683a50584d2d21236273a | @property
def _cloudstr(self) -> Optional[str]:
'\n Reconstructs the proper cloud URI\n '
return None | Reconstructs the proper cloud URI | lazy/io/pathz_v2/base.py | _cloudstr | trisongz/lazycls | 2 | python | @property
def _cloudstr(self) -> Optional[str]:
'\n \n '
return None | @property
def _cloudstr(self) -> Optional[str]:
'\n \n '
return None<|docstring|>Reconstructs the proper cloud URI<|endoftext|> |
45fda3d70cba4223bd3264430d190414d2ca7c5db55d38d460fec8caf5838e31 | @property
def posix_(self):
'Return the string representation of the path with forward (/)\n slashes.'
f = self._flavour
return str(self).replace(f.sep, '/') | Return the string representation of the path with forward (/)
slashes. | lazy/io/pathz_v2/base.py | posix_ | trisongz/lazycls | 2 | python | @property
def posix_(self):
'Return the string representation of the path with forward (/)\n slashes.'
f = self._flavour
return str(self).replace(f.sep, '/') | @property
def posix_(self):
'Return the string representation of the path with forward (/)\n slashes.'
f = self._flavour
return str(self).replace(f.sep, '/')<|docstring|>Return the string representation of the path with forward (/)
slashes.<|endoftext|> |
e018072b329f1b761cab38920f888da5df91736787a7dbdd760549695793dfd1 | @property
def filename_(self) -> str:
"\n Returns the filename if is file, else ''\n "
if self.is_file():
return self.parts[(- 1)]
return '' | Returns the filename if is file, else '' | lazy/io/pathz_v2/base.py | filename_ | trisongz/lazycls | 2 | python | @property
def filename_(self) -> str:
"\n \n "
if self.is_file():
return self.parts[(- 1)]
return | @property
def filename_(self) -> str:
"\n \n "
if self.is_file():
return self.parts[(- 1)]
return <|docstring|>Returns the filename if is file, else ''<|endoftext|> |
e04081a2316b28ff09f832f3a19899bd2b4c7ae4bcf833957b233a2c1c9ff783 | @property
def ext_(self) -> str:
'\n Returns the extension for a file\n '
return self.suffix | Returns the extension for a file | lazy/io/pathz_v2/base.py | ext_ | trisongz/lazycls | 2 | python | @property
def ext_(self) -> str:
'\n \n '
return self.suffix | @property
def ext_(self) -> str:
'\n \n '
return self.suffix<|docstring|>Returns the extension for a file<|endoftext|> |
34ebc8acd56985310de0877bc66e907e1b8da8df3a138f45e0db7a39b226bab8 | @property
def extension(self) -> str:
'\n Returns the extension for a file\n '
return self.suffix | Returns the extension for a file | lazy/io/pathz_v2/base.py | extension | trisongz/lazycls | 2 | python | @property
def extension(self) -> str:
'\n \n '
return self.suffix | @property
def extension(self) -> str:
'\n \n '
return self.suffix<|docstring|>Returns the extension for a file<|endoftext|> |
4bd6d2f0c345b43e3f118bb53d1ca0e090b9ce26122f4a87665c814582378a5c | @staticmethod
def _get_pathlike(path: PathLike):
'\n Returns the path of the file.\n '
from lazy.io.pathz_v2 import get_path
return get_path(path) | Returns the path of the file. | lazy/io/pathz_v2/base.py | _get_pathlike | trisongz/lazycls | 2 | python | @staticmethod
def _get_pathlike(path: PathLike):
'\n \n '
from lazy.io.pathz_v2 import get_path
return get_path(path) | @staticmethod
def _get_pathlike(path: PathLike):
'\n \n '
from lazy.io.pathz_v2 import get_path
return get_path(path)<|docstring|>Returns the path of the file.<|endoftext|> |
40eda2103e44f247569472f60b0a58dff86d8537121760f8a0cd3b2215d37348 | def open(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
if ('b' in mode):
return io.open(self, mode=mode, buffering=buffering, opener=self._opener)
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) | Open the file pointed by this path and return a file object, as
the built-in open() function does. | lazy/io/pathz_v2/base.py | open | trisongz/lazycls | 2 | python | def open(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
if ('b' in mode):
return io.open(self, mode=mode, buffering=buffering, opener=self._opener)
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) | def open(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
if ('b' in mode):
return io.open(self, mode=mode, buffering=buffering, opener=self._opener)
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener)<|docstring|>Open the file pointed by this path and return a file object, as
the built-in open() function does.<|endoftext|> |
97ab13f7d6d4b4266e5ce3d919323938a36a83c4e817f96661b77bdec0f0a001 | def async_open(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if ('b' in mode):
return get_handle(self._path, mode=mode, buffering=buffering)
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline) | Asyncronously Open the file pointed by this path and return a file object, as
the built-in open() function does. | lazy/io/pathz_v2/base.py | async_open | trisongz/lazycls | 2 | python | def async_open(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if ('b' in mode):
return get_handle(self._path, mode=mode, buffering=buffering)
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline) | def async_open(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if ('b' in mode):
return get_handle(self._path, mode=mode, buffering=buffering)
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline)<|docstring|>Asyncronously Open the file pointed by this path and return a file object, as
the built-in open() function does.<|endoftext|> |
b2cc218fca2a6e668b23afd48142734b54c726ec7fb38feb2433081b0552648b | def reader(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) | Open the file pointed by this path and return a file object, as
the built-in open() function does. | lazy/io/pathz_v2/base.py | reader | trisongz/lazycls | 2 | python | def reader(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) | def reader(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener)<|docstring|>Open the file pointed by this path and return a file object, as
the built-in open() function does.<|endoftext|> |
b3f60c255b6e7de575508fc1d647ec3a6f0e4c3423af40b17993b448f8962d91 | def async_reader(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline) | Asyncronously Open the file pointed by this path and return a file object, as
the built-in open() function does. | lazy/io/pathz_v2/base.py | async_reader | trisongz/lazycls | 2 | python | def async_reader(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline) | def async_reader(self, mode: FileMode='r', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline)<|docstring|>Asyncronously Open the file pointed by this path and return a file object, as
the built-in open() function does.<|endoftext|> |
db9fbec0faa214c8cf9fd2c6bacfb5ed9f0bd53a879c31b4dc5870888371ee74 | def appender(self, mode: FileMode='a', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) | Open the file pointed by this path and return a file object, as
the built-in open() function does. | lazy/io/pathz_v2/base.py | appender | trisongz/lazycls | 2 | python | def appender(self, mode: FileMode='a', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) | def appender(self, mode: FileMode='a', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener)<|docstring|>Open the file pointed by this path and return a file object, as
the built-in open() function does.<|endoftext|> |
f7d7de26c1f436d4bcf133239d635551ff2878a852ccf0b7aedd2cefcefe3cb5 | def async_appender(self, mode: FileMode='a', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline) | Asyncronously Open the file pointed by this path and return a file object, as
the built-in open() function does. | lazy/io/pathz_v2/base.py | async_appender | trisongz/lazycls | 2 | python | def async_appender(self, mode: FileMode='a', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline) | def async_appender(self, mode: FileMode='a', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline)<|docstring|>Asyncronously Open the file pointed by this path and return a file object, as
the built-in open() function does.<|endoftext|> |
5fccff9a6969e1558e9d4406ccd57168b639e3fd7fa305c436ba57828e946fb4 | def writer(self, mode: FileMode='w', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) | Open the file pointed by this path and return a file object, as
the built-in open() function does. | lazy/io/pathz_v2/base.py | writer | trisongz/lazycls | 2 | python | def writer(self, mode: FileMode='w', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) | def writer(self, mode: FileMode='w', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IO[Union[(str, bytes)]]:
'\n Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
if self._closed:
self._raise_closed()
return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener)<|docstring|>Open the file pointed by this path and return a file object, as
the built-in open() function does.<|endoftext|> |
7effeabc8c11006dfa0f9a23ad57b9fe72a60247462cb123d49749f2bf5a6906 | def async_writer(self, mode: FileMode='w', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline) | Asyncronously Open the file pointed by this path and return a file object, as
the built-in open() function does. | lazy/io/pathz_v2/base.py | async_writer | trisongz/lazycls | 2 | python | def async_writer(self, mode: FileMode='w', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline) | def async_writer(self, mode: FileMode='w', buffering: int=(- 1), encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE, **kwargs) -> IterableAIOFile:
'\n Asyncronously Open the file pointed by this path and return a file object, as\n the built-in open() function does.\n '
return get_handle(self._path, mode, encoding=encoding, errors=errors, newline=newline)<|docstring|>Asyncronously Open the file pointed by this path and return a file object, as
the built-in open() function does.<|endoftext|> |
5295d95b9802fb2397cced8dbf1c3981e74faf5dc5212441d32f0c2e47014d76 | def write_bytes(self, data: bytes) -> int:
'\n Open the file in bytes mode, write to it, and close the file.\n '
view = memoryview(data)
with self.open(mode='wb') as f:
return f.write(data) | Open the file in bytes mode, write to it, and close the file. | lazy/io/pathz_v2/base.py | write_bytes | trisongz/lazycls | 2 | python | def write_bytes(self, data: bytes) -> int:
'\n \n '
view = memoryview(data)
with self.open(mode='wb') as f:
return f.write(data) | def write_bytes(self, data: bytes) -> int:
'\n \n '
view = memoryview(data)
with self.open(mode='wb') as f:
return f.write(data)<|docstring|>Open the file in bytes mode, write to it, and close the file.<|endoftext|> |
1b11b8286ed953cdf84a0738efa31f36fc563f4b451d58a43e2beae0f1b5eec4 | async def async_write_bytes(self, data: bytes) -> int:
'\n Open the file in bytes mode, write to it, and close the file.\n '
view = memoryview(data)
async with self.async_open(mode='wb') as f:
return (await f.write(data)) | Open the file in bytes mode, write to it, and close the file. | lazy/io/pathz_v2/base.py | async_write_bytes | trisongz/lazycls | 2 | python | async def async_write_bytes(self, data: bytes) -> int:
'\n \n '
view = memoryview(data)
async with self.async_open(mode='wb') as f:
return (await f.write(data)) | async def async_write_bytes(self, data: bytes) -> int:
'\n \n '
view = memoryview(data)
async with self.async_open(mode='wb') as f:
return (await f.write(data))<|docstring|>Open the file in bytes mode, write to it, and close the file.<|endoftext|> |
008bfe5a40ebf21106c1eae491952466541c7515593e8d681c3df6b248c374cc | def append_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n Open the file in text mode, write to it, and close the file.\n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
with self.open(mode='a', encoding=encoding, errors=errors, newline=newline) as f:
n = f.write(data)
n += f.write(newline)
return n | Open the file in text mode, write to it, and close the file. | lazy/io/pathz_v2/base.py | append_text | trisongz/lazycls | 2 | python | def append_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n \n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
with self.open(mode='a', encoding=encoding, errors=errors, newline=newline) as f:
n = f.write(data)
n += f.write(newline)
return n | def append_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n \n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
with self.open(mode='a', encoding=encoding, errors=errors, newline=newline) as f:
n = f.write(data)
n += f.write(newline)
return n<|docstring|>Open the file in text mode, write to it, and close the file.<|endoftext|> |
682c508c91ffc924a44dd32bff1ba1194dfe207164406f1da3cd348ceeb9c784 | async def async_append_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n Open the file in text mode, write to it, and close the file.\n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
async with self.async_open(mode='a', encoding=encoding, errors=errors, newline=newline) as f:
n = (await f.write(data))
n += (await f.write(newline))
return n | Open the file in text mode, write to it, and close the file. | lazy/io/pathz_v2/base.py | async_append_text | trisongz/lazycls | 2 | python | async def async_append_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n \n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
async with self.async_open(mode='a', encoding=encoding, errors=errors, newline=newline) as f:
n = (await f.write(data))
n += (await f.write(newline))
return n | async def async_append_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n \n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
async with self.async_open(mode='a', encoding=encoding, errors=errors, newline=newline) as f:
n = (await f.write(data))
n += (await f.write(newline))
return n<|docstring|>Open the file in text mode, write to it, and close the file.<|endoftext|> |
e70dd1e76ed288fc82b72cac74b62f7e23ee4e0f277aa5a42eb0435d0f9c54f7 | def write_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n Open the file in text mode, write to it, and close the file.\n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
return f.write(data) | Open the file in text mode, write to it, and close the file. | lazy/io/pathz_v2/base.py | write_text | trisongz/lazycls | 2 | python | def write_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n \n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
return f.write(data) | def write_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n \n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
return f.write(data)<|docstring|>Open the file in text mode, write to it, and close the file.<|endoftext|> |
49d59c25940124e59f62ceddbe7e09d3eaf991e4909cd185004ec7f3d5f25cfc | async def async_write_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n Open the file in text mode, write to it, and close the file.\n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
async with self.async_open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
return (await f.write(data)) | Open the file in text mode, write to it, and close the file. | lazy/io/pathz_v2/base.py | async_write_text | trisongz/lazycls | 2 | python | async def async_write_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n \n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
async with self.async_open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
return (await f.write(data)) | async def async_write_text(self, data: str, encoding: Optional[str]=DEFAULT_ENCODING, errors: Optional[str]=ON_ERRORS, newline: Optional[str]=NEWLINE) -> int:
'\n \n '
if (not isinstance(data, str)):
raise TypeError(f'data must be str, not {type(data).__name__}')
async with self.async_open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
return (await f.write(data))<|docstring|>Open the file in text mode, write to it, and close the file.<|endoftext|> |
32f24a7dcf58e77a81e7724b1e0f80bc57f89bd4af33ffb7fb7f75ce95ad2140 | def readlink(self) -> PathzPath:
'\n Return the path to which the symbolic link points.\n '
path: str = self._accessor.readlink(self)
obj = self._from_parts((path,), init=False)
obj._init(template=self)
return obj | Return the path to which the symbolic link points. | lazy/io/pathz_v2/base.py | readlink | trisongz/lazycls | 2 | python | def readlink(self) -> PathzPath:
'\n \n '
path: str = self._accessor.readlink(self)
obj = self._from_parts((path,), init=False)
obj._init(template=self)
return obj | def readlink(self) -> PathzPath:
'\n \n '
path: str = self._accessor.readlink(self)
obj = self._from_parts((path,), init=False)
obj._init(template=self)
return obj<|docstring|>Return the path to which the symbolic link points.<|endoftext|> |
7887e70902ab4e45d972c703996f254622b3bca148241c423c3fed33eda2c233 | async def async_readlink(self) -> PathzPath:
'\n Return the path to which the symbolic link points.\n '
path: str = (await self._accessor.async_readlink(self))
obj = self._from_parts((path,), init=False)
obj._init(template=self)
return obj | Return the path to which the symbolic link points. | lazy/io/pathz_v2/base.py | async_readlink | trisongz/lazycls | 2 | python | async def async_readlink(self) -> PathzPath:
'\n \n '
path: str = (await self._accessor.async_readlink(self))
obj = self._from_parts((path,), init=False)
obj._init(template=self)
return obj | async def async_readlink(self) -> PathzPath:
'\n \n '
path: str = (await self._accessor.async_readlink(self))
obj = self._from_parts((path,), init=False)
obj._init(template=self)
return obj<|docstring|>Return the path to which the symbolic link points.<|endoftext|> |
6cf924d7dd92062caea136ba120bcc0109c9817bab30859eb230353b4d169f0b | def _raw_open(self, flags: int, mode: int=511) -> int:
'\n Open the file pointed by this path and return a file descriptor,\n as os.open() does.\n '
if self._closed:
self._raise_closed()
return self._accessor.open(self, flags, mode) | Open the file pointed by this path and return a file descriptor,
as os.open() does. | lazy/io/pathz_v2/base.py | _raw_open | trisongz/lazycls | 2 | python | def _raw_open(self, flags: int, mode: int=511) -> int:
'\n Open the file pointed by this path and return a file descriptor,\n as os.open() does.\n '
if self._closed:
self._raise_closed()
return self._accessor.open(self, flags, mode) | def _raw_open(self, flags: int, mode: int=511) -> int:
'\n Open the file pointed by this path and return a file descriptor,\n as os.open() does.\n '
if self._closed:
self._raise_closed()
return self._accessor.open(self, flags, mode)<|docstring|>Open the file pointed by this path and return a file descriptor,
as os.open() does.<|endoftext|> |
285ec87d947abc6e1f0130f73f42c20dc348f8c737d6a800bb54a48173d8e845 | async def _async_raw_open(self, flags: int, mode: int=511) -> int:
'\n Open the file pointed by this path and return a file descriptor,\n as os.open() does.\n '
return (await self._accessor.async_open(self, flags, mode)) | Open the file pointed by this path and return a file descriptor,
as os.open() does. | lazy/io/pathz_v2/base.py | _async_raw_open | trisongz/lazycls | 2 | python | async def _async_raw_open(self, flags: int, mode: int=511) -> int:
'\n Open the file pointed by this path and return a file descriptor,\n as os.open() does.\n '
return (await self._accessor.async_open(self, flags, mode)) | async def _async_raw_open(self, flags: int, mode: int=511) -> int:
'\n Open the file pointed by this path and return a file descriptor,\n as os.open() does.\n '
return (await self._accessor.async_open(self, flags, mode))<|docstring|>Open the file pointed by this path and return a file descriptor,
as os.open() does.<|endoftext|> |
1320ee7e60383dcd3b80aad931d5accaf16a5268db665c8af573cffb59f3d7f6 | def touch(self, mode: int=438, exist_ok: bool=True):
"\n Create this file with the given access mode, if it doesn't exist.\n "
if exist_ok:
try:
self._accessor.utime(self, None)
except OSError:
pass
else:
return
flags: int = (os.O_CREAT | os.O_WRONLY)
if (not exist_ok):
flags |= os.O_EXCL
fd = self._raw_open(flags, mode)
sync_close(fd) | Create this file with the given access mode, if it doesn't exist. | lazy/io/pathz_v2/base.py | touch | trisongz/lazycls | 2 | python | def touch(self, mode: int=438, exist_ok: bool=True):
"\n \n "
if exist_ok:
try:
self._accessor.utime(self, None)
except OSError:
pass
else:
return
flags: int = (os.O_CREAT | os.O_WRONLY)
if (not exist_ok):
flags |= os.O_EXCL
fd = self._raw_open(flags, mode)
sync_close(fd) | def touch(self, mode: int=438, exist_ok: bool=True):
"\n \n "
if exist_ok:
try:
self._accessor.utime(self, None)
except OSError:
pass
else:
return
flags: int = (os.O_CREAT | os.O_WRONLY)
if (not exist_ok):
flags |= os.O_EXCL
fd = self._raw_open(flags, mode)
sync_close(fd)<|docstring|>Create this file with the given access mode, if it doesn't exist.<|endoftext|> |
95777979518ae209298c0fc6955dc227fd494d37b31285849f59ea7eb1f70153 | async def async_touch(self, mode: int=438, exist_ok: bool=True):
"\n Create this file with the given access mode, if it doesn't exist.\n "
if exist_ok:
try:
(await self._accessor.async_utime(self, None))
except OSError:
pass
else:
return
flags: int = (os.O_CREAT | os.O_WRONLY)
if (not exist_ok):
flags |= os.O_EXCL
fd = (await self._async_raw_open(flags, mode))
(await close(fd)) | Create this file with the given access mode, if it doesn't exist. | lazy/io/pathz_v2/base.py | async_touch | trisongz/lazycls | 2 | python | async def async_touch(self, mode: int=438, exist_ok: bool=True):
"\n \n "
if exist_ok:
try:
(await self._accessor.async_utime(self, None))
except OSError:
pass
else:
return
flags: int = (os.O_CREAT | os.O_WRONLY)
if (not exist_ok):
flags |= os.O_EXCL
fd = (await self._async_raw_open(flags, mode))
(await close(fd)) | async def async_touch(self, mode: int=438, exist_ok: bool=True):
"\n \n "
if exist_ok:
try:
(await self._accessor.async_utime(self, None))
except OSError:
pass
else:
return
flags: int = (os.O_CREAT | os.O_WRONLY)
if (not exist_ok):
flags |= os.O_EXCL
fd = (await self._async_raw_open(flags, mode))
(await close(fd))<|docstring|>Create this file with the given access mode, if it doesn't exist.<|endoftext|> |
6b482db2ad9ba892f9dc3f324e33ba9b073cc25984fe2cbfc602dbd78705d587 | def mkdir(self, mode: int=511, parents: bool=True, exist_ok: bool=True):
'\n Create a new directory at this given path.\n '
try:
self._accessor.mkdir(self, mode)
except FileNotFoundError:
if ((not parents) or (self.parent == self)):
raise
self.parent.mkdir(parents=True, exist_ok=True)
self.mkdir(mode, parents=False, exist_ok=exist_ok)
except OSError:
if ((not exist_ok) or (not self.is_dir())):
raise | Create a new directory at this given path. | lazy/io/pathz_v2/base.py | mkdir | trisongz/lazycls | 2 | python | def mkdir(self, mode: int=511, parents: bool=True, exist_ok: bool=True):
'\n \n '
try:
self._accessor.mkdir(self, mode)
except FileNotFoundError:
if ((not parents) or (self.parent == self)):
raise
self.parent.mkdir(parents=True, exist_ok=True)
self.mkdir(mode, parents=False, exist_ok=exist_ok)
except OSError:
if ((not exist_ok) or (not self.is_dir())):
raise | def mkdir(self, mode: int=511, parents: bool=True, exist_ok: bool=True):
'\n \n '
try:
self._accessor.mkdir(self, mode)
except FileNotFoundError:
if ((not parents) or (self.parent == self)):
raise
self.parent.mkdir(parents=True, exist_ok=True)
self.mkdir(mode, parents=False, exist_ok=exist_ok)
except OSError:
if ((not exist_ok) or (not self.is_dir())):
raise<|docstring|>Create a new directory at this given path.<|endoftext|> |
dd86f9fb61c0f9f8cc3b17e4da51db473583e814bd2be7cfa24fd4a49c164793 | async def async_mkdir(self, mode: int=511, parents: bool=True, exist_ok: bool=True):
'\n Create a new directory at this given path.\n '
try:
(await self._accessor.async_mkdir(self, mode))
except FileNotFoundError:
if ((not parents) or (self.parent == self)):
raise
(await self.parent.async_mkdir(parents=True, exist_ok=True))
(await self.async_mkdir(mode, parents=False, exist_ok=exist_ok))
except OSError:
if ((not exist_ok) or (not (await self.async_is_dir()))):
raise | Create a new directory at this given path. | lazy/io/pathz_v2/base.py | async_mkdir | trisongz/lazycls | 2 | python | async def async_mkdir(self, mode: int=511, parents: bool=True, exist_ok: bool=True):
'\n \n '
try:
(await self._accessor.async_mkdir(self, mode))
except FileNotFoundError:
if ((not parents) or (self.parent == self)):
raise
(await self.parent.async_mkdir(parents=True, exist_ok=True))
(await self.async_mkdir(mode, parents=False, exist_ok=exist_ok))
except OSError:
if ((not exist_ok) or (not (await self.async_is_dir()))):
raise | async def async_mkdir(self, mode: int=511, parents: bool=True, exist_ok: bool=True):
'\n \n '
try:
(await self._accessor.async_mkdir(self, mode))
except FileNotFoundError:
if ((not parents) or (self.parent == self)):
raise
(await self.parent.async_mkdir(parents=True, exist_ok=True))
(await self.async_mkdir(mode, parents=False, exist_ok=exist_ok))
except OSError:
if ((not exist_ok) or (not (await self.async_is_dir()))):
raise<|docstring|>Create a new directory at this given path.<|endoftext|> |
4c4a52c18d2f5bb6449a4a8adb5cf30126a2c20ffcffa1da7cfbcf2a9b9d7789 | async def chmod(self, mode: int):
'\n Change the permissions of the path, like os.chmod().\n '
self._accessor.chmod(self, mode) | Change the permissions of the path, like os.chmod(). | lazy/io/pathz_v2/base.py | chmod | trisongz/lazycls | 2 | python | async def chmod(self, mode: int):
'\n \n '
self._accessor.chmod(self, mode) | async def chmod(self, mode: int):
'\n \n '
self._accessor.chmod(self, mode)<|docstring|>Change the permissions of the path, like os.chmod().<|endoftext|> |
cc634dcffe5398c953887f917a24893d4a78d1a3207c7859b11bd578e1765731 | async def async_chmod(self, mode: int):
'\n Change the permissions of the path, like os.chmod().\n '
(await self._accessor.async_chmod(self, mode)) | Change the permissions of the path, like os.chmod(). | lazy/io/pathz_v2/base.py | async_chmod | trisongz/lazycls | 2 | python | async def async_chmod(self, mode: int):
'\n \n '
(await self._accessor.async_chmod(self, mode)) | async def async_chmod(self, mode: int):
'\n \n '
(await self._accessor.async_chmod(self, mode))<|docstring|>Change the permissions of the path, like os.chmod().<|endoftext|> |
078708417da9a6dc685176460a2e9b295fdd0290dd65e908ccec76e7833c23eb | def lchmod(self, mode: int):
"\n Like chmod(), except if the path points to a symlink, the symlink's\n permissions are changed, rather than its target's.\n "
self._accessor.lchmod(self, mode) | Like chmod(), except if the path points to a symlink, the symlink's
permissions are changed, rather than its target's. | lazy/io/pathz_v2/base.py | lchmod | trisongz/lazycls | 2 | python | def lchmod(self, mode: int):
"\n Like chmod(), except if the path points to a symlink, the symlink's\n permissions are changed, rather than its target's.\n "
self._accessor.lchmod(self, mode) | def lchmod(self, mode: int):
"\n Like chmod(), except if the path points to a symlink, the symlink's\n permissions are changed, rather than its target's.\n "
self._accessor.lchmod(self, mode)<|docstring|>Like chmod(), except if the path points to a symlink, the symlink's
permissions are changed, rather than its target's.<|endoftext|> |
a2302a356390e74c11715a6d845302b78dd13090b4bcbd30b8e34bb5cd7e3f59 | async def async_lchmod(self, mode: int):
"\n Like chmod(), except if the path points to a symlink, the symlink's\n permissions are changed, rather than its target's.\n "
(await self._accessor.async_lchmod(self, mode)) | Like chmod(), except if the path points to a symlink, the symlink's
permissions are changed, rather than its target's. | lazy/io/pathz_v2/base.py | async_lchmod | trisongz/lazycls | 2 | python | async def async_lchmod(self, mode: int):
"\n Like chmod(), except if the path points to a symlink, the symlink's\n permissions are changed, rather than its target's.\n "
(await self._accessor.async_lchmod(self, mode)) | async def async_lchmod(self, mode: int):
"\n Like chmod(), except if the path points to a symlink, the symlink's\n permissions are changed, rather than its target's.\n "
(await self._accessor.async_lchmod(self, mode))<|docstring|>Like chmod(), except if the path points to a symlink, the symlink's
permissions are changed, rather than its target's.<|endoftext|> |
10812b88fb1f4704885c09b28dc797897f130957798d1a6c6271aada13e79ce2 | def unlink(self, missing_ok: bool=False):
'\n Remove this file or link.\n If the path is a directory, use rmdir() instead.\n '
try:
self._accessor.unlink(self)
except FileNotFoundError:
if (not missing_ok):
raise | Remove this file or link.
If the path is a directory, use rmdir() instead. | lazy/io/pathz_v2/base.py | unlink | trisongz/lazycls | 2 | python | def unlink(self, missing_ok: bool=False):
'\n Remove this file or link.\n If the path is a directory, use rmdir() instead.\n '
try:
self._accessor.unlink(self)
except FileNotFoundError:
if (not missing_ok):
raise | def unlink(self, missing_ok: bool=False):
'\n Remove this file or link.\n If the path is a directory, use rmdir() instead.\n '
try:
self._accessor.unlink(self)
except FileNotFoundError:
if (not missing_ok):
raise<|docstring|>Remove this file or link.
If the path is a directory, use rmdir() instead.<|endoftext|> |
c348137db81172681637487b314d7d9115844ab9999f213e953b555de17c4d81 | async def async_unlink(self, missing_ok: bool=False):
'\n Remove this file or link.\n If the path is a directory, use rmdir() instead.\n '
try:
(await self._accessor.async_unlink(self))
except FileNotFoundError:
if (not missing_ok):
raise | Remove this file or link.
If the path is a directory, use rmdir() instead. | lazy/io/pathz_v2/base.py | async_unlink | trisongz/lazycls | 2 | python | async def async_unlink(self, missing_ok: bool=False):
'\n Remove this file or link.\n If the path is a directory, use rmdir() instead.\n '
try:
(await self._accessor.async_unlink(self))
except FileNotFoundError:
if (not missing_ok):
raise | async def async_unlink(self, missing_ok: bool=False):
'\n Remove this file or link.\n If the path is a directory, use rmdir() instead.\n '
try:
(await self._accessor.async_unlink(self))
except FileNotFoundError:
if (not missing_ok):
raise<|docstring|>Remove this file or link.
If the path is a directory, use rmdir() instead.<|endoftext|> |
168b699643eabbc31686a1504314d0315491cbb1b0d19e6508114560cb8560f3 | def copy(self, dest: PathLike, recursive: bool=False, overwrite: bool=False, skip_errors: bool=False, **kwargs):
'\n Copies the File to the Dir/File.\n '
dest: 'PathzPath' = self._get_pathlike(dest)
if (dest.is_dir() and self.is_file()):
dest = dest.joinpath(self.filename_)
if (dest.exists() and (not overwrite) and dest.is_file()):
if skip_errors:
return dest
raise Exception(f'File {dest._path} exists')
if (not dest.is_cloud):
self._accessor.copy(self._path, dest._path, **kwargs)
return dest
dest._accessor.put(self._path, dest._path, recursive)
return dest | Copies the File to the Dir/File. | lazy/io/pathz_v2/base.py | copy | trisongz/lazycls | 2 | python | def copy(self, dest: PathLike, recursive: bool=False, overwrite: bool=False, skip_errors: bool=False, **kwargs):
'\n \n '
dest: 'PathzPath' = self._get_pathlike(dest)
if (dest.is_dir() and self.is_file()):
dest = dest.joinpath(self.filename_)
if (dest.exists() and (not overwrite) and dest.is_file()):
if skip_errors:
return dest
raise Exception(f'File {dest._path} exists')
if (not dest.is_cloud):
self._accessor.copy(self._path, dest._path, **kwargs)
return dest
dest._accessor.put(self._path, dest._path, recursive)
return dest | def copy(self, dest: PathLike, recursive: bool=False, overwrite: bool=False, skip_errors: bool=False, **kwargs):
'\n \n '
dest: 'PathzPath' = self._get_pathlike(dest)
if (dest.is_dir() and self.is_file()):
dest = dest.joinpath(self.filename_)
if (dest.exists() and (not overwrite) and dest.is_file()):
if skip_errors:
return dest
raise Exception(f'File {dest._path} exists')
if (not dest.is_cloud):
self._accessor.copy(self._path, dest._path, **kwargs)
return dest
dest._accessor.put(self._path, dest._path, recursive)
return dest<|docstring|>Copies the File to the Dir/File.<|endoftext|> |
55db5021c45b807b26ed7db1cb2e9b49ea6103e818bf8a6400eaab45977d4504 | def rm(self, **kwargs):
'\n Remove this file or dir\n '
if self.is_dir:
return self.rmdir(**kwargs)
return self._accessor.remove(self) | Remove this file or dir | lazy/io/pathz_v2/base.py | rm | trisongz/lazycls | 2 | python | def rm(self, **kwargs):
'\n \n '
if self.is_dir:
return self.rmdir(**kwargs)
return self._accessor.remove(self) | def rm(self, **kwargs):
'\n \n '
if self.is_dir:
return self.rmdir(**kwargs)
return self._accessor.remove(self)<|docstring|>Remove this file or dir<|endoftext|> |
d65963ffbc65d362e207a70c5c83dc8f3825f14ac7bd74dae2a83b8315c38132 | async def async_rm(self, **kwargs):
'\n Remove this file or dir\n '
if self.is_dir:
return (await self.async_rmdir(**kwargs))
(await self._accessor.async_remove(self)) | Remove this file or dir | lazy/io/pathz_v2/base.py | async_rm | trisongz/lazycls | 2 | python | async def async_rm(self, **kwargs):
'\n \n '
if self.is_dir:
return (await self.async_rmdir(**kwargs))
(await self._accessor.async_remove(self)) | async def async_rm(self, **kwargs):
'\n \n '
if self.is_dir:
return (await self.async_rmdir(**kwargs))
(await self._accessor.async_remove(self))<|docstring|>Remove this file or dir<|endoftext|> |
2d0a001d8dadbe19275f2d7a589cba057bdad70b3a09d31bb5bb82dc65b2f831 | def rm_file(self, **kwargs):
'\n Remove this file \n '
self._accessor.remove(self) | Remove this file | lazy/io/pathz_v2/base.py | rm_file | trisongz/lazycls | 2 | python | def rm_file(self, **kwargs):
'\n \n '
self._accessor.remove(self) | def rm_file(self, **kwargs):
'\n \n '
self._accessor.remove(self)<|docstring|>Remove this file<|endoftext|> |
6b7ce259f22eeccf79100e297af21855a57d8233f2296541826abc2b79600d61 | async def async_rm_file(self, **kwargs):
'\n Remove this file \n '
return (await self._accessor.async_remove(self)) | Remove this file | lazy/io/pathz_v2/base.py | async_rm_file | trisongz/lazycls | 2 | python | async def async_rm_file(self, **kwargs):
'\n \n '
return (await self._accessor.async_remove(self)) | async def async_rm_file(self, **kwargs):
'\n \n '
return (await self._accessor.async_remove(self))<|docstring|>Remove this file<|endoftext|> |
952b0fc375572a857235f8b30c105a39b3f50661282f0bb4ad5115ec475a404a | def rmdir(self, force: bool=False, recursive: bool=True, skip_errors: bool=True):
'\n Remove this directory. The directory must be empty.\n '
self._accessor.rmdir(self) | Remove this directory. The directory must be empty. | lazy/io/pathz_v2/base.py | rmdir | trisongz/lazycls | 2 | python | def rmdir(self, force: bool=False, recursive: bool=True, skip_errors: bool=True):
'\n \n '
self._accessor.rmdir(self) | def rmdir(self, force: bool=False, recursive: bool=True, skip_errors: bool=True):
'\n \n '
self._accessor.rmdir(self)<|docstring|>Remove this directory. The directory must be empty.<|endoftext|> |
f8011da3eef00edee855ad12edbebc7ae4937fde38d54f3450a28cf81019a130 | async def async_rmdir(self):
'\n Remove this directory. The directory must be empty.\n '
(await self._accessor.async_rmdir(self)) | Remove this directory. The directory must be empty. | lazy/io/pathz_v2/base.py | async_rmdir | trisongz/lazycls | 2 | python | async def async_rmdir(self):
'\n \n '
(await self._accessor.async_rmdir(self)) | async def async_rmdir(self):
'\n \n '
(await self._accessor.async_rmdir(self))<|docstring|>Remove this directory. The directory must be empty.<|endoftext|> |
9ab3b22aa29e66400382baf9d2bb13b113aaa313911019e80ce41c98c9e45033 | def cat(self, as_bytes: bool=False, **kwargs):
'\n Fetch paths’ contents\n '
return (self.read_bytes() if as_bytes else self.read_text()) | Fetch paths’ contents | lazy/io/pathz_v2/base.py | cat | trisongz/lazycls | 2 | python | def cat(self, as_bytes: bool=False, **kwargs):
'\n \n '
return (self.read_bytes() if as_bytes else self.read_text()) | def cat(self, as_bytes: bool=False, **kwargs):
'\n \n '
return (self.read_bytes() if as_bytes else self.read_text())<|docstring|>Fetch paths’ contents<|endoftext|> |
22c8d73a480d5a09727d856f283661cb3bf6d60e55a1faa02cb494e8fccc65e2 | async def async_cat(self, as_bytes: bool=False, **kwargs):
'\n Fetch paths’ contents\n '
if as_bytes:
return (await self.async_read_bytes())
return (await self.async_read_text()) | Fetch paths’ contents | lazy/io/pathz_v2/base.py | async_cat | trisongz/lazycls | 2 | python | async def async_cat(self, as_bytes: bool=False, **kwargs):
'\n \n '
if as_bytes:
return (await self.async_read_bytes())
return (await self.async_read_text()) | async def async_cat(self, as_bytes: bool=False, **kwargs):
'\n \n '
if as_bytes:
return (await self.async_read_bytes())
return (await self.async_read_text())<|docstring|>Fetch paths’ contents<|endoftext|> |
6516e5264d5ce3225887b902701b7bd8af4c376c5abea2a46e830324683de18f | async def async_cat_file(self, as_bytes: bool=False, **kwargs):
'\n Parameters\n start, end: int\n Bytes limits of the read. If negative, backwards from end, like usual python slices. Either can be None for start or end of file, respectively\n\n kwargs: passed to ``open()``.\n '
return (await self.async_cat(as_bytes, **kwargs)) | Parameters
start, end: int
Bytes limits of the read. If negative, backwards from end, like usual python slices. Either can be None for start or end of file, respectively
kwargs: passed to ``open()``. | lazy/io/pathz_v2/base.py | async_cat_file | trisongz/lazycls | 2 | python | async def async_cat_file(self, as_bytes: bool=False, **kwargs):
'\n Parameters\n start, end: int\n Bytes limits of the read. If negative, backwards from end, like usual python slices. Either can be None for start or end of file, respectively\n\n kwargs: passed to ``open()``.\n '
return (await self.async_cat(as_bytes, **kwargs)) | async def async_cat_file(self, as_bytes: bool=False, **kwargs):
'\n Parameters\n start, end: int\n Bytes limits of the read. If negative, backwards from end, like usual python slices. Either can be None for start or end of file, respectively\n\n kwargs: passed to ``open()``.\n '
return (await self.async_cat(as_bytes, **kwargs))<|docstring|>Parameters
start, end: int
Bytes limits of the read. If negative, backwards from end, like usual python slices. Either can be None for start or end of file, respectively
kwargs: passed to ``open()``.<|endoftext|> |
60fa9d7165ac7939f4381d38822593949e278add788d64990ab497bc0cd969a7 | def pipe(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return self.write_bytes(value, **kwargs) | Put value into path
(counterpart to cat) | lazy/io/pathz_v2/base.py | pipe | trisongz/lazycls | 2 | python | def pipe(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return self.write_bytes(value, **kwargs) | def pipe(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return self.write_bytes(value, **kwargs)<|docstring|>Put value into path
(counterpart to cat)<|endoftext|> |
31648eeacdfd7f8a781993a17d56446ee2956f1b501435b13a69bff05a4abf28 | async def async_pipe(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return (await self.async_write_bytes(value, **kwargs)) | Put value into path
(counterpart to cat) | lazy/io/pathz_v2/base.py | async_pipe | trisongz/lazycls | 2 | python | async def async_pipe(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return (await self.async_write_bytes(value, **kwargs)) | async def async_pipe(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return (await self.async_write_bytes(value, **kwargs))<|docstring|>Put value into path
(counterpart to cat)<|endoftext|> |
73025789e3aa78fe160728ed723f7ad3da869605b991cd4048582a5ed71d211c | def pipe_file(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return self.write_bytes(value, **kwargs) | Put value into path
(counterpart to cat) | lazy/io/pathz_v2/base.py | pipe_file | trisongz/lazycls | 2 | python | def pipe_file(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return self.write_bytes(value, **kwargs) | def pipe_file(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return self.write_bytes(value, **kwargs)<|docstring|>Put value into path
(counterpart to cat)<|endoftext|> |
a4817f3eed36a1279d99aca5861d4a1c105cf49422ec3464611a4a4207cd3c97 | async def async_pipe_file(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return (await self.async_write_bytes(value, **kwargs)) | Put value into path
(counterpart to cat) | lazy/io/pathz_v2/base.py | async_pipe_file | trisongz/lazycls | 2 | python | async def async_pipe_file(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return (await self.async_write_bytes(value, **kwargs)) | async def async_pipe_file(self, value: Union[(bytes, str)], **kwargs):
'\n Put value into path\n\n (counterpart to cat)\n '
if (not isinstance(value, bytes)):
value = value.encode('UTF-8')
return (await self.async_write_bytes(value, **kwargs))<|docstring|>Put value into path
(counterpart to cat)<|endoftext|> |
90c098d542eab3cc4c1018b4ea95f44df26141c0f3041d71f1826e910bd9c087 | def link_to(self, target: str):
'\n Create a hard link pointing to a path named target.\n '
self._accessor.link_to(self, target) | Create a hard link pointing to a path named target. | lazy/io/pathz_v2/base.py | link_to | trisongz/lazycls | 2 | python | def link_to(self, target: str):
'\n \n '
self._accessor.link_to(self, target) | def link_to(self, target: str):
'\n \n '
self._accessor.link_to(self, target)<|docstring|>Create a hard link pointing to a path named target.<|endoftext|> |
6964dc4e0f06191eecf16289c503f47f59397d6dd863d586c7db06360cd71641 | async def async_link_to(self, target: str):
'\n Create a hard link pointing to a path named target.\n '
(await self._accessor.async_link_to(self, target)) | Create a hard link pointing to a path named target. | lazy/io/pathz_v2/base.py | async_link_to | trisongz/lazycls | 2 | python | async def async_link_to(self, target: str):
'\n \n '
(await self._accessor.async_link_to(self, target)) | async def async_link_to(self, target: str):
'\n \n '
(await self._accessor.async_link_to(self, target))<|docstring|>Create a hard link pointing to a path named target.<|endoftext|> |
678022f46731ab5b4e8d7ce4aab85073df859da978b925d476d69004cb7f92a7 | def rename(self, target: Union[(str, PathzPath)]) -> PathzPath:
'\n Rename this path to the target path.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
self._accessor.rename(self, target)
return type(self)(target) | Rename this path to the target path.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.
Returns the new Path instance pointing to the target path. | lazy/io/pathz_v2/base.py | rename | trisongz/lazycls | 2 | python | def rename(self, target: Union[(str, PathzPath)]) -> PathzPath:
'\n Rename this path to the target path.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
self._accessor.rename(self, target)
return type(self)(target) | def rename(self, target: Union[(str, PathzPath)]) -> PathzPath:
'\n Rename this path to the target path.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
self._accessor.rename(self, target)
return type(self)(target)<|docstring|>Rename this path to the target path.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.
Returns the new Path instance pointing to the target path.<|endoftext|> |
9c1ec71f1ece630dd355feb8f95522b90d07306c851bbd6656d2923704f02364 | async def async_rename(self, target: Union[(str, PathzPath)]) -> PathzPath:
'\n Rename this path to the target path.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
(await self._accessor.async_rename(self, target))
return type(self)(target) | Rename this path to the target path.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.
Returns the new Path instance pointing to the target path. | lazy/io/pathz_v2/base.py | async_rename | trisongz/lazycls | 2 | python | async def async_rename(self, target: Union[(str, PathzPath)]) -> PathzPath:
'\n Rename this path to the target path.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
(await self._accessor.async_rename(self, target))
return type(self)(target) | async def async_rename(self, target: Union[(str, PathzPath)]) -> PathzPath:
'\n Rename this path to the target path.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
(await self._accessor.async_rename(self, target))
return type(self)(target)<|docstring|>Rename this path to the target path.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.
Returns the new Path instance pointing to the target path.<|endoftext|> |
d5498bf44e89c7b5009192b730f944ee23046a95c57f87a8a66bea40150e30d4 | def replace(self, target: str) -> PathzPath:
'\n Rename this path to the target path, overwriting if that path exists.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
self._accessor.replace(self, target)
return type(self)(target) | Rename this path to the target path, overwriting if that path exists.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.
Returns the new Path instance pointing to the target path. | lazy/io/pathz_v2/base.py | replace | trisongz/lazycls | 2 | python | def replace(self, target: str) -> PathzPath:
'\n Rename this path to the target path, overwriting if that path exists.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
self._accessor.replace(self, target)
return type(self)(target) | def replace(self, target: str) -> PathzPath:
'\n Rename this path to the target path, overwriting if that path exists.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
self._accessor.replace(self, target)
return type(self)(target)<|docstring|>Rename this path to the target path, overwriting if that path exists.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.
Returns the new Path instance pointing to the target path.<|endoftext|> |
7d83d9262c92b554c3b47fceef13072c3714e63e63d57e428cdcaf719b4d0631 | async def async_replace(self, target: str) -> PathzPath:
'\n Rename this path to the target path, overwriting if that path exists.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
(await self._accessor.async_replace(self, target))
return type(self)(target) | Rename this path to the target path, overwriting if that path exists.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.
Returns the new Path instance pointing to the target path. | lazy/io/pathz_v2/base.py | async_replace | trisongz/lazycls | 2 | python | async def async_replace(self, target: str) -> PathzPath:
'\n Rename this path to the target path, overwriting if that path exists.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
(await self._accessor.async_replace(self, target))
return type(self)(target) | async def async_replace(self, target: str) -> PathzPath:
'\n Rename this path to the target path, overwriting if that path exists.\n The target path may be absolute or relative. Relative paths are\n interpreted relative to the current working directory, *not* the\n directory of the Path object.\n Returns the new Path instance pointing to the target path.\n '
(await self._accessor.async_replace(self, target))
return type(self)(target)<|docstring|>Rename this path to the target path, overwriting if that path exists.
The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.
Returns the new Path instance pointing to the target path.<|endoftext|> |
74b47b3531dab2b292d32e5e6aebd4b6da490b2d5457da4662340b2db2be4b56 | def symlink_to(self, target: str, target_is_directory: bool=False):
"\n Make this path a symlink pointing to the given path.\n Note the order of arguments (self, target) is the reverse of os.symlink's.\n "
self._accessor.symlink(target, self, target_is_directory) | Make this path a symlink pointing to the given path.
Note the order of arguments (self, target) is the reverse of os.symlink's. | lazy/io/pathz_v2/base.py | symlink_to | trisongz/lazycls | 2 | python | def symlink_to(self, target: str, target_is_directory: bool=False):
"\n Make this path a symlink pointing to the given path.\n Note the order of arguments (self, target) is the reverse of os.symlink's.\n "
self._accessor.symlink(target, self, target_is_directory) | def symlink_to(self, target: str, target_is_directory: bool=False):
"\n Make this path a symlink pointing to the given path.\n Note the order of arguments (self, target) is the reverse of os.symlink's.\n "
self._accessor.symlink(target, self, target_is_directory)<|docstring|>Make this path a symlink pointing to the given path.
Note the order of arguments (self, target) is the reverse of os.symlink's.<|endoftext|> |
a035605370f4b954a1c00d2a215e28b1b08f644e440e4243a1ea061b8d53e1c2 | async def async_symlink_to(self, target: str, target_is_directory: bool=False):
"\n Make this path a symlink pointing to the given path.\n Note the order of arguments (self, target) is the reverse of os.symlink's.\n "
(await self._accessor.async_symlink(target, self, target_is_directory)) | Make this path a symlink pointing to the given path.
Note the order of arguments (self, target) is the reverse of os.symlink's. | lazy/io/pathz_v2/base.py | async_symlink_to | trisongz/lazycls | 2 | python | async def async_symlink_to(self, target: str, target_is_directory: bool=False):
"\n Make this path a symlink pointing to the given path.\n Note the order of arguments (self, target) is the reverse of os.symlink's.\n "
(await self._accessor.async_symlink(target, self, target_is_directory)) | async def async_symlink_to(self, target: str, target_is_directory: bool=False):
"\n Make this path a symlink pointing to the given path.\n Note the order of arguments (self, target) is the reverse of os.symlink's.\n "
(await self._accessor.async_symlink(target, self, target_is_directory))<|docstring|>Make this path a symlink pointing to the given path.
Note the order of arguments (self, target) is the reverse of os.symlink's.<|endoftext|> |
06dbf0814e88466e6cc8d72d0888032bbe371be6103e4525d0d7c0fe8162ff1c | def exists(self) -> bool:
'\n Whether this path exists.\n '
try:
self.stat()
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False
return True | Whether this path exists. | lazy/io/pathz_v2/base.py | exists | trisongz/lazycls | 2 | python | def exists(self) -> bool:
'\n \n '
try:
self.stat()
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False
return True | def exists(self) -> bool:
'\n \n '
try:
self.stat()
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False
return True<|docstring|>Whether this path exists.<|endoftext|> |
a4e2b19b8305bb7efc6a4eaef5fd0a9677f2da3b86ee7eb882ad7ef7afb4737e | async def async_exists(self) -> bool:
'\n Whether this path exists.\n '
try:
(await self.async_stat())
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False
return True | Whether this path exists. | lazy/io/pathz_v2/base.py | async_exists | trisongz/lazycls | 2 | python | async def async_exists(self) -> bool:
'\n \n '
try:
(await self.async_stat())
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False
return True | async def async_exists(self) -> bool:
'\n \n '
try:
(await self.async_stat())
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False
return True<|docstring|>Whether this path exists.<|endoftext|> |
0717ca13aad051d6599dc61f9098890423ea14e87c64c083b0e20c09cc715d88 | @classmethod
def cwd(cls: type) -> str:
'Return a new path pointing to the current working directory\n (as returned by os.getcwd()).\n '
cwd: str = os.getcwd()
return cls(cwd) | Return a new path pointing to the current working directory
(as returned by os.getcwd()). | lazy/io/pathz_v2/base.py | cwd | trisongz/lazycls | 2 | python | @classmethod
def cwd(cls: type) -> str:
'Return a new path pointing to the current working directory\n (as returned by os.getcwd()).\n '
cwd: str = os.getcwd()
return cls(cwd) | @classmethod
def cwd(cls: type) -> str:
'Return a new path pointing to the current working directory\n (as returned by os.getcwd()).\n '
cwd: str = os.getcwd()
return cls(cwd)<|docstring|>Return a new path pointing to the current working directory
(as returned by os.getcwd()).<|endoftext|> |
acc436a5360ca293abf8586952cc421842ed9b8804177c54a30f6bc4b520e8eb | @classmethod
def home(cls: type) -> PathzPath:
"Return a new path pointing to the user's home directory (as\n returned by os.path.expanduser('~')).\n "
homedir: str = cls()._flavour.gethomedir(None)
return cls(homedir) | Return a new path pointing to the user's home directory (as
returned by os.path.expanduser('~')). | lazy/io/pathz_v2/base.py | home | trisongz/lazycls | 2 | python | @classmethod
def home(cls: type) -> PathzPath:
"Return a new path pointing to the user's home directory (as\n returned by os.path.expanduser('~')).\n "
homedir: str = cls()._flavour.gethomedir(None)
return cls(homedir) | @classmethod
def home(cls: type) -> PathzPath:
"Return a new path pointing to the user's home directory (as\n returned by os.path.expanduser('~')).\n "
homedir: str = cls()._flavour.gethomedir(None)
return cls(homedir)<|docstring|>Return a new path pointing to the user's home directory (as
returned by os.path.expanduser('~')).<|endoftext|> |
e903e74fb6b0f521a0f9e3972ef025c0b8db8ffeb94f41fcf2f5e07ea72ad913 | @classmethod
async def async_home(cls: type) -> PathzPath:
"Return a new path pointing to the user's home directory (as\n returned by os.path.expanduser('~')).\n "
coro = cls()._flavour.async_gethomedir(None)
homedir: str = (await coro)
return cls(homedir) | Return a new path pointing to the user's home directory (as
returned by os.path.expanduser('~')). | lazy/io/pathz_v2/base.py | async_home | trisongz/lazycls | 2 | python | @classmethod
async def async_home(cls: type) -> PathzPath:
"Return a new path pointing to the user's home directory (as\n returned by os.path.expanduser('~')).\n "
coro = cls()._flavour.async_gethomedir(None)
homedir: str = (await coro)
return cls(homedir) | @classmethod
async def async_home(cls: type) -> PathzPath:
"Return a new path pointing to the user's home directory (as\n returned by os.path.expanduser('~')).\n "
coro = cls()._flavour.async_gethomedir(None)
homedir: str = (await coro)
return cls(homedir)<|docstring|>Return a new path pointing to the user's home directory (as
returned by os.path.expanduser('~')).<|endoftext|> |
0715bc6ff680cfe2ce85ef17114338acf891fe9f18cbb88aedb1469d0520b486 | def samefile(self, other_path: Union[(PathzPath, Paths)]) -> bool:
'Return whether other_path is the same or not as this file\n (as returned by os.path.samefile()).\n '
if isinstance(other_path, Paths.__args__):
other_path = PathzPath(other_path)
if isinstance(other_path, PathzPath):
try:
other_st = other_path.stat()
except AttributeError:
other_st = self._accessor.stat(other_path)
else:
try:
other_st = other_path.stat()
except AttributeError:
other_st = other_path._accessor.stat(other_path)
return os.path.samestat(self.stat(), other_st) | Return whether other_path is the same or not as this file
(as returned by os.path.samefile()). | lazy/io/pathz_v2/base.py | samefile | trisongz/lazycls | 2 | python | def samefile(self, other_path: Union[(PathzPath, Paths)]) -> bool:
'Return whether other_path is the same or not as this file\n (as returned by os.path.samefile()).\n '
if isinstance(other_path, Paths.__args__):
other_path = PathzPath(other_path)
if isinstance(other_path, PathzPath):
try:
other_st = other_path.stat()
except AttributeError:
other_st = self._accessor.stat(other_path)
else:
try:
other_st = other_path.stat()
except AttributeError:
other_st = other_path._accessor.stat(other_path)
return os.path.samestat(self.stat(), other_st) | def samefile(self, other_path: Union[(PathzPath, Paths)]) -> bool:
'Return whether other_path is the same or not as this file\n (as returned by os.path.samefile()).\n '
if isinstance(other_path, Paths.__args__):
other_path = PathzPath(other_path)
if isinstance(other_path, PathzPath):
try:
other_st = other_path.stat()
except AttributeError:
other_st = self._accessor.stat(other_path)
else:
try:
other_st = other_path.stat()
except AttributeError:
other_st = other_path._accessor.stat(other_path)
return os.path.samestat(self.stat(), other_st)<|docstring|>Return whether other_path is the same or not as this file
(as returned by os.path.samefile()).<|endoftext|> |
8f7608249d94df21f1cb407c061fa63def997ff4c0351143b22eb8e73179f60f | async def async_samefile(self, other_path: Union[(PathzPath, Paths)]) -> bool:
'Return whether other_path is the same or not as this file\n (as returned by os.path.samefile()).\n '
if isinstance(other_path, Paths.__args__):
other_path = PathzPath(other_path)
if isinstance(other_path, PathzPath):
try:
other_st = (await other_path.async_stat())
except AttributeError:
other_st = (await self._accessor.async_stat(other_path))
else:
try:
other_st = (await to_thread(other_path.stat))
except AttributeError:
other_st = (await to_thread(other_path._accessor.stat, other_path))
return os.path.samestat((await self.async_stat()), other_st) | Return whether other_path is the same or not as this file
(as returned by os.path.samefile()). | lazy/io/pathz_v2/base.py | async_samefile | trisongz/lazycls | 2 | python | async def async_samefile(self, other_path: Union[(PathzPath, Paths)]) -> bool:
'Return whether other_path is the same or not as this file\n (as returned by os.path.samefile()).\n '
if isinstance(other_path, Paths.__args__):
other_path = PathzPath(other_path)
if isinstance(other_path, PathzPath):
try:
other_st = (await other_path.async_stat())
except AttributeError:
other_st = (await self._accessor.async_stat(other_path))
else:
try:
other_st = (await to_thread(other_path.stat))
except AttributeError:
other_st = (await to_thread(other_path._accessor.stat, other_path))
return os.path.samestat((await self.async_stat()), other_st) | async def async_samefile(self, other_path: Union[(PathzPath, Paths)]) -> bool:
'Return whether other_path is the same or not as this file\n (as returned by os.path.samefile()).\n '
if isinstance(other_path, Paths.__args__):
other_path = PathzPath(other_path)
if isinstance(other_path, PathzPath):
try:
other_st = (await other_path.async_stat())
except AttributeError:
other_st = (await self._accessor.async_stat(other_path))
else:
try:
other_st = (await to_thread(other_path.stat))
except AttributeError:
other_st = (await to_thread(other_path._accessor.stat, other_path))
return os.path.samestat((await self.async_stat()), other_st)<|docstring|>Return whether other_path is the same or not as this file
(as returned by os.path.samefile()).<|endoftext|> |
f3512e2e45651c84c4b8472197a03ca1b867c386040a4848addb3a956c56b67d | def iterdir(self) -> Iterable[PathzPath]:
"Iterate over the files in this directory. Does not yield any\n result for the special paths '.' and '..'.\n "
for name in self._accessor.listdir(self):
if (name in {'.', '..'}):
continue
(yield self._make_child_relpath(name)) | Iterate over the files in this directory. Does not yield any
result for the special paths '.' and '..'. | lazy/io/pathz_v2/base.py | iterdir | trisongz/lazycls | 2 | python | def iterdir(self) -> Iterable[PathzPath]:
"Iterate over the files in this directory. Does not yield any\n result for the special paths '.' and '..'.\n "
for name in self._accessor.listdir(self):
if (name in {'.', '..'}):
continue
(yield self._make_child_relpath(name)) | def iterdir(self) -> Iterable[PathzPath]:
"Iterate over the files in this directory. Does not yield any\n result for the special paths '.' and '..'.\n "
for name in self._accessor.listdir(self):
if (name in {'.', '..'}):
continue
(yield self._make_child_relpath(name))<|docstring|>Iterate over the files in this directory. Does not yield any
result for the special paths '.' and '..'.<|endoftext|> |
dc730e06d18c0a966c9b27877a6d170ee9db025aec428057236a3d1e2f96a40b | async def async_iterdir(self) -> AsyncIterable[PathzPath]:
"Iterate over the files in this directory. Does not yield any\n result for the special paths '.' and '..'.\n "
for name in (await self._accessor.async_listdir(self)):
if (name in {'.', '..'}):
continue
(yield self._make_child_relpath(name)) | Iterate over the files in this directory. Does not yield any
result for the special paths '.' and '..'. | lazy/io/pathz_v2/base.py | async_iterdir | trisongz/lazycls | 2 | python | async def async_iterdir(self) -> AsyncIterable[PathzPath]:
"Iterate over the files in this directory. Does not yield any\n result for the special paths '.' and '..'.\n "
for name in (await self._accessor.async_listdir(self)):
if (name in {'.', '..'}):
continue
(yield self._make_child_relpath(name)) | async def async_iterdir(self) -> AsyncIterable[PathzPath]:
"Iterate over the files in this directory. Does not yield any\n result for the special paths '.' and '..'.\n "
for name in (await self._accessor.async_listdir(self)):
if (name in {'.', '..'}):
continue
(yield self._make_child_relpath(name))<|docstring|>Iterate over the files in this directory. Does not yield any
result for the special paths '.' and '..'.<|endoftext|> |
cbe33897caa77e12c8f98caf924e39a9d9a3387d405cf6ad1c922a8e340ec4e2 | def glob(self, pattern: str) -> Iterable[PathzPath]:
'Iterate over this subtree and yield all existing files (of any\n kind, including directories) matching the given relative pattern.\n '
if (not pattern):
raise ValueError('Unacceptable pattern: {!r}'.format(pattern))
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
selector = _sync_make_selector(tuple(pattern_parts), self._flavour)
(yield from selector.select_from(self)) | Iterate over this subtree and yield all existing files (of any
kind, including directories) matching the given relative pattern. | lazy/io/pathz_v2/base.py | glob | trisongz/lazycls | 2 | python | def glob(self, pattern: str) -> Iterable[PathzPath]:
'Iterate over this subtree and yield all existing files (of any\n kind, including directories) matching the given relative pattern.\n '
if (not pattern):
raise ValueError('Unacceptable pattern: {!r}'.format(pattern))
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
selector = _sync_make_selector(tuple(pattern_parts), self._flavour)
(yield from selector.select_from(self)) | def glob(self, pattern: str) -> Iterable[PathzPath]:
'Iterate over this subtree and yield all existing files (of any\n kind, including directories) matching the given relative pattern.\n '
if (not pattern):
raise ValueError('Unacceptable pattern: {!r}'.format(pattern))
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
selector = _sync_make_selector(tuple(pattern_parts), self._flavour)
(yield from selector.select_from(self))<|docstring|>Iterate over this subtree and yield all existing files (of any
kind, including directories) matching the given relative pattern.<|endoftext|> |
7d753825ff286190d724ca7f4623b60ad4131aef0fa67f701e2265946aa0aeed | async def async_glob(self, pattern: str) -> AsyncIterable[PathzPath]:
'Iterate over this subtree and yield all existing files (of any\n kind, including directories) matching the given relative pattern.\n '
if (not pattern):
raise ValueError('Unacceptable pattern: {!r}'.format(pattern))
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
selector = _make_selector(tuple(pattern_parts), self._flavour)
async for p in selector.select_from(self):
(yield p) | Iterate over this subtree and yield all existing files (of any
kind, including directories) matching the given relative pattern. | lazy/io/pathz_v2/base.py | async_glob | trisongz/lazycls | 2 | python | async def async_glob(self, pattern: str) -> AsyncIterable[PathzPath]:
'Iterate over this subtree and yield all existing files (of any\n kind, including directories) matching the given relative pattern.\n '
if (not pattern):
raise ValueError('Unacceptable pattern: {!r}'.format(pattern))
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
selector = _make_selector(tuple(pattern_parts), self._flavour)
async for p in selector.select_from(self):
(yield p) | async def async_glob(self, pattern: str) -> AsyncIterable[PathzPath]:
'Iterate over this subtree and yield all existing files (of any\n kind, including directories) matching the given relative pattern.\n '
if (not pattern):
raise ValueError('Unacceptable pattern: {!r}'.format(pattern))
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
selector = _make_selector(tuple(pattern_parts), self._flavour)
async for p in selector.select_from(self):
(yield p)<|docstring|>Iterate over this subtree and yield all existing files (of any
kind, including directories) matching the given relative pattern.<|endoftext|> |
31d6b05a1619081877afccb234162d4c3b38b8814061962989a78684f84499be | def rglob(self, pattern: str) -> Iterable[PathzPath]:
'Recursively yield all existing files (of any kind, including\n directories) matching the given relative pattern, anywhere in\n this subtree.\n '
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
parts = ('**', *pattern_parts)
selector = _sync_make_selector(parts, self._flavour)
(yield from selector.select_from(self)) | Recursively yield all existing files (of any kind, including
directories) matching the given relative pattern, anywhere in
this subtree. | lazy/io/pathz_v2/base.py | rglob | trisongz/lazycls | 2 | python | def rglob(self, pattern: str) -> Iterable[PathzPath]:
'Recursively yield all existing files (of any kind, including\n directories) matching the given relative pattern, anywhere in\n this subtree.\n '
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
parts = ('**', *pattern_parts)
selector = _sync_make_selector(parts, self._flavour)
(yield from selector.select_from(self)) | def rglob(self, pattern: str) -> Iterable[PathzPath]:
'Recursively yield all existing files (of any kind, including\n directories) matching the given relative pattern, anywhere in\n this subtree.\n '
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
parts = ('**', *pattern_parts)
selector = _sync_make_selector(parts, self._flavour)
(yield from selector.select_from(self))<|docstring|>Recursively yield all existing files (of any kind, including
directories) matching the given relative pattern, anywhere in
this subtree.<|endoftext|> |
c03a4d480f3f2b2703cc76645e56f34a33128d812007e05b1fcc5e9509d1aae6 | async def async_rglob(self, pattern: str) -> AsyncIterable[PathzPath]:
'Recursively yield all existing files (of any kind, including\n directories) matching the given relative pattern, anywhere in\n this subtree.\n '
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
parts = ('**', *pattern_parts)
selector = _make_selector(parts, self._flavour)
async for p in selector.select_from(self):
(yield p) | Recursively yield all existing files (of any kind, including
directories) matching the given relative pattern, anywhere in
this subtree. | lazy/io/pathz_v2/base.py | async_rglob | trisongz/lazycls | 2 | python | async def async_rglob(self, pattern: str) -> AsyncIterable[PathzPath]:
'Recursively yield all existing files (of any kind, including\n directories) matching the given relative pattern, anywhere in\n this subtree.\n '
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
parts = ('**', *pattern_parts)
selector = _make_selector(parts, self._flavour)
async for p in selector.select_from(self):
(yield p) | async def async_rglob(self, pattern: str) -> AsyncIterable[PathzPath]:
'Recursively yield all existing files (of any kind, including\n directories) matching the given relative pattern, anywhere in\n this subtree.\n '
(drv, root, pattern_parts) = self._flavour.parse_parts((pattern,))
if (drv or root):
raise NotImplementedError('Non-relative patterns are unsupported')
parts = ('**', *pattern_parts)
selector = _make_selector(parts, self._flavour)
async for p in selector.select_from(self):
(yield p)<|docstring|>Recursively yield all existing files (of any kind, including
directories) matching the given relative pattern, anywhere in
this subtree.<|endoftext|> |
8bac0a37adbb61970e85de05ceb39ac510939bbb66d4c2822cc9d921c2198a29 | def absolute(self) -> PathzPath:
"Return an absolute version of this path. This function works\n even if the path doesn't point to anything.\n No normalization is done, i.e. all '.' and '..' will be kept along.\n Use resolve() to get the canonical path to a file.\n "
if self.is_absolute():
return self
obj = self._from_parts(([os.getcwd()] + self._parts), init=False)
obj._init(template=self)
return obj | Return an absolute version of this path. This function works
even if the path doesn't point to anything.
No normalization is done, i.e. all '.' and '..' will be kept along.
Use resolve() to get the canonical path to a file. | lazy/io/pathz_v2/base.py | absolute | trisongz/lazycls | 2 | python | def absolute(self) -> PathzPath:
"Return an absolute version of this path. This function works\n even if the path doesn't point to anything.\n No normalization is done, i.e. all '.' and '..' will be kept along.\n Use resolve() to get the canonical path to a file.\n "
if self.is_absolute():
return self
obj = self._from_parts(([os.getcwd()] + self._parts), init=False)
obj._init(template=self)
return obj | def absolute(self) -> PathzPath:
"Return an absolute version of this path. This function works\n even if the path doesn't point to anything.\n No normalization is done, i.e. all '.' and '..' will be kept along.\n Use resolve() to get the canonical path to a file.\n "
if self.is_absolute():
return self
obj = self._from_parts(([os.getcwd()] + self._parts), init=False)
obj._init(template=self)
return obj<|docstring|>Return an absolute version of this path. This function works
even if the path doesn't point to anything.
No normalization is done, i.e. all '.' and '..' will be kept along.
Use resolve() to get the canonical path to a file.<|endoftext|> |
36ec5a7c4527475908872a30184b44831db79cbaa453c73f88e45138774ef172 | def resolve(self, strict: bool=False) -> PathzPath:
'\n Make the path absolute, resolving all symlinks on the way and also\n normalizing it (for example turning slashes into backslashes under\n Windows).\n '
s: Optional[str] = self._flavour.resolve(self, strict=strict)
if (s is None):
self.stat()
path = self.absolute()
s = str(path)
normed: str = self._flavour.pathmod.normpath(s)
obj = self._from_parts((normed,), init=False)
obj._init(template=self)
return obj | Make the path absolute, resolving all symlinks on the way and also
normalizing it (for example turning slashes into backslashes under
Windows). | lazy/io/pathz_v2/base.py | resolve | trisongz/lazycls | 2 | python | def resolve(self, strict: bool=False) -> PathzPath:
'\n Make the path absolute, resolving all symlinks on the way and also\n normalizing it (for example turning slashes into backslashes under\n Windows).\n '
s: Optional[str] = self._flavour.resolve(self, strict=strict)
if (s is None):
self.stat()
path = self.absolute()
s = str(path)
normed: str = self._flavour.pathmod.normpath(s)
obj = self._from_parts((normed,), init=False)
obj._init(template=self)
return obj | def resolve(self, strict: bool=False) -> PathzPath:
'\n Make the path absolute, resolving all symlinks on the way and also\n normalizing it (for example turning slashes into backslashes under\n Windows).\n '
s: Optional[str] = self._flavour.resolve(self, strict=strict)
if (s is None):
self.stat()
path = self.absolute()
s = str(path)
normed: str = self._flavour.pathmod.normpath(s)
obj = self._from_parts((normed,), init=False)
obj._init(template=self)
return obj<|docstring|>Make the path absolute, resolving all symlinks on the way and also
normalizing it (for example turning slashes into backslashes under
Windows).<|endoftext|> |
b2cbba1be15c59551bc2d7250731ff7497592a2ba98c90a6119b557ef394d953 | async def async_resolve(self, strict: bool=False) -> PathzPath:
'\n Make the path absolute, resolving all symlinks on the way and also\n normalizing it (for example turning slashes into backslashes under\n Windows).\n '
s: Optional[str] = (await self._flavour.async_resolve(self, strict=strict))
if (s is None):
(await self.async_stat())
path = (await self.absolute())
s = str(path)
normed: str = self._flavour.pathmod.normpath(s)
obj = self._from_parts((normed,), init=False)
obj._init(template=self)
return obj | Make the path absolute, resolving all symlinks on the way and also
normalizing it (for example turning slashes into backslashes under
Windows). | lazy/io/pathz_v2/base.py | async_resolve | trisongz/lazycls | 2 | python | async def async_resolve(self, strict: bool=False) -> PathzPath:
'\n Make the path absolute, resolving all symlinks on the way and also\n normalizing it (for example turning slashes into backslashes under\n Windows).\n '
s: Optional[str] = (await self._flavour.async_resolve(self, strict=strict))
if (s is None):
(await self.async_stat())
path = (await self.absolute())
s = str(path)
normed: str = self._flavour.pathmod.normpath(s)
obj = self._from_parts((normed,), init=False)
obj._init(template=self)
return obj | async def async_resolve(self, strict: bool=False) -> PathzPath:
'\n Make the path absolute, resolving all symlinks on the way and also\n normalizing it (for example turning slashes into backslashes under\n Windows).\n '
s: Optional[str] = (await self._flavour.async_resolve(self, strict=strict))
if (s is None):
(await self.async_stat())
path = (await self.absolute())
s = str(path)
normed: str = self._flavour.pathmod.normpath(s)
obj = self._from_parts((normed,), init=False)
obj._init(template=self)
return obj<|docstring|>Make the path absolute, resolving all symlinks on the way and also
normalizing it (for example turning slashes into backslashes under
Windows).<|endoftext|> |
c42e2102357faf7869d1c0d7a137891ae896b3d4ca6506bb51d5f6bfcf19fd96 | def stat(self) -> stat_result:
'\n Return the result of the stat() system call on this path, like\n os.stat() does.\n '
return self._accessor.stat(self) | Return the result of the stat() system call on this path, like
os.stat() does. | lazy/io/pathz_v2/base.py | stat | trisongz/lazycls | 2 | python | def stat(self) -> stat_result:
'\n Return the result of the stat() system call on this path, like\n os.stat() does.\n '
return self._accessor.stat(self) | def stat(self) -> stat_result:
'\n Return the result of the stat() system call on this path, like\n os.stat() does.\n '
return self._accessor.stat(self)<|docstring|>Return the result of the stat() system call on this path, like
os.stat() does.<|endoftext|> |
269a04f6bfdb3523773cfd7a4df89401fa3de571fab504426e8c70eea62857b7 | async def async_stat(self) -> stat_result:
'\n Return the result of the stat() system call on this path, like\n os.stat() does.\n '
return (await self._accessor.async_stat(self)) | Return the result of the stat() system call on this path, like
os.stat() does. | lazy/io/pathz_v2/base.py | async_stat | trisongz/lazycls | 2 | python | async def async_stat(self) -> stat_result:
'\n Return the result of the stat() system call on this path, like\n os.stat() does.\n '
return (await self._accessor.async_stat(self)) | async def async_stat(self) -> stat_result:
'\n Return the result of the stat() system call on this path, like\n os.stat() does.\n '
return (await self._accessor.async_stat(self))<|docstring|>Return the result of the stat() system call on this path, like
os.stat() does.<|endoftext|> |
2fb377e69c0eb41cb9502c0fae0b44b2dc230b199538568aeb29dd89328a2fe8 | def lstat(self) -> stat_result:
"\n Like stat(), except if the path points to a symlink, the symlink's\n status information is returned, rather than its target's.\n "
return self._accessor.lstat(self) | Like stat(), except if the path points to a symlink, the symlink's
status information is returned, rather than its target's. | lazy/io/pathz_v2/base.py | lstat | trisongz/lazycls | 2 | python | def lstat(self) -> stat_result:
"\n Like stat(), except if the path points to a symlink, the symlink's\n status information is returned, rather than its target's.\n "
return self._accessor.lstat(self) | def lstat(self) -> stat_result:
"\n Like stat(), except if the path points to a symlink, the symlink's\n status information is returned, rather than its target's.\n "
return self._accessor.lstat(self)<|docstring|>Like stat(), except if the path points to a symlink, the symlink's
status information is returned, rather than its target's.<|endoftext|> |
304fd4fd5013b20f5708a7f489bbcf082552e0a31ea4fbdf942fb05d818d0118 | async def async_lstat(self) -> stat_result:
"\n Like stat(), except if the path points to a symlink, the symlink's\n status information is returned, rather than its target's.\n "
return (await self._accessor.async_lstat(self)) | Like stat(), except if the path points to a symlink, the symlink's
status information is returned, rather than its target's. | lazy/io/pathz_v2/base.py | async_lstat | trisongz/lazycls | 2 | python | async def async_lstat(self) -> stat_result:
"\n Like stat(), except if the path points to a symlink, the symlink's\n status information is returned, rather than its target's.\n "
return (await self._accessor.async_lstat(self)) | async def async_lstat(self) -> stat_result:
"\n Like stat(), except if the path points to a symlink, the symlink's\n status information is returned, rather than its target's.\n "
return (await self._accessor.async_lstat(self))<|docstring|>Like stat(), except if the path points to a symlink, the symlink's
status information is returned, rather than its target's.<|endoftext|> |
6e400a1818d4804fb9b7efde35ee60d9a03da22977d64bb5f2c177ea78160e54 | def owner(self) -> str:
'\n Return the login name of the file owner.\n '
return self._accessor.owner(self) | Return the login name of the file owner. | lazy/io/pathz_v2/base.py | owner | trisongz/lazycls | 2 | python | def owner(self) -> str:
'\n \n '
return self._accessor.owner(self) | def owner(self) -> str:
'\n \n '
return self._accessor.owner(self)<|docstring|>Return the login name of the file owner.<|endoftext|> |
aba1ab8e0d6c85a99aa3d6b8aafc1c45ce815cf7476422a85e2ddb5675ca5139 | async def async_owner(self) -> str:
'\n Return the login name of the file owner.\n '
return (await self._accessor.async_owner(self)) | Return the login name of the file owner. | lazy/io/pathz_v2/base.py | async_owner | trisongz/lazycls | 2 | python | async def async_owner(self) -> str:
'\n \n '
return (await self._accessor.async_owner(self)) | async def async_owner(self) -> str:
'\n \n '
return (await self._accessor.async_owner(self))<|docstring|>Return the login name of the file owner.<|endoftext|> |
fc8de597406e52d5d10185a001691359d704a569e18472db6ba08c4ebf1a676b | def group(self) -> str:
'\n Return the group name of the file gid.\n '
return self._accessor.group(self) | Return the group name of the file gid. | lazy/io/pathz_v2/base.py | group | trisongz/lazycls | 2 | python | def group(self) -> str:
'\n \n '
return self._accessor.group(self) | def group(self) -> str:
'\n \n '
return self._accessor.group(self)<|docstring|>Return the group name of the file gid.<|endoftext|> |
b675c799c6883ae0cb38cdeb9ffa006ea521e9af81c84588636d49ce4d8b0697 | async def async_group(self) -> str:
'\n Return the group name of the file gid.\n '
return (await self._accessor.async_group(self)) | Return the group name of the file gid. | lazy/io/pathz_v2/base.py | async_group | trisongz/lazycls | 2 | python | async def async_group(self) -> str:
'\n \n '
return (await self._accessor.async_group(self)) | async def async_group(self) -> str:
'\n \n '
return (await self._accessor.async_group(self))<|docstring|>Return the group name of the file gid.<|endoftext|> |
51415876c53263ff4f8ceb4626427e85058800bfcd062b52949e1643128594ca | def is_dir(self) -> bool:
'\n Whether this path is a directory.\n '
try:
stat = self.stat()
return S_ISDIR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a directory. | lazy/io/pathz_v2/base.py | is_dir | trisongz/lazycls | 2 | python | def is_dir(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISDIR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | def is_dir(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISDIR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a directory.<|endoftext|> |
58962812a7382abd870e86b53b787671f0d09c88b25fd4a549f9d80c92f622ff | async def async_is_dir(self) -> bool:
'\n Whether this path is a directory.\n '
try:
stat = (await self.async_stat())
return S_ISDIR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a directory. | lazy/io/pathz_v2/base.py | async_is_dir | trisongz/lazycls | 2 | python | async def async_is_dir(self) -> bool:
'\n \n '
try:
stat = (await self.async_stat())
return S_ISDIR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | async def async_is_dir(self) -> bool:
'\n \n '
try:
stat = (await self.async_stat())
return S_ISDIR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a directory.<|endoftext|> |
3c944f9b1250c86397fddb65c995549932c12cf122e505a4e3127583d330bdf1 | def is_symlink(self) -> bool:
'\n Whether this path is a symbolic link.\n '
try:
lstat = self.lstat()
return S_ISLNK(lstat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a symbolic link. | lazy/io/pathz_v2/base.py | is_symlink | trisongz/lazycls | 2 | python | def is_symlink(self) -> bool:
'\n \n '
try:
lstat = self.lstat()
return S_ISLNK(lstat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | def is_symlink(self) -> bool:
'\n \n '
try:
lstat = self.lstat()
return S_ISLNK(lstat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a symbolic link.<|endoftext|> |
898167c679dba1256730da9bcd5cd930409ffe60558c27014ce3cc9949aed6b6 | async def async_is_symlink(self) -> bool:
'\n Whether this path is a symbolic link.\n '
try:
lstat = (await self.async_lstat())
return S_ISLNK(lstat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a symbolic link. | lazy/io/pathz_v2/base.py | async_is_symlink | trisongz/lazycls | 2 | python | async def async_is_symlink(self) -> bool:
'\n \n '
try:
lstat = (await self.async_lstat())
return S_ISLNK(lstat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | async def async_is_symlink(self) -> bool:
'\n \n '
try:
lstat = (await self.async_lstat())
return S_ISLNK(lstat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a symbolic link.<|endoftext|> |
7743ff7fef8ddbdebfab7353b31baf31a7f7254da6a7f6d580def127c43baf8e | def is_file(self) -> bool:
'\n Whether this path is a regular file (also True for symlinks pointing\n to regular files).\n '
try:
stat = self.stat()
return S_ISREG(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a regular file (also True for symlinks pointing
to regular files). | lazy/io/pathz_v2/base.py | is_file | trisongz/lazycls | 2 | python | def is_file(self) -> bool:
'\n Whether this path is a regular file (also True for symlinks pointing\n to regular files).\n '
try:
stat = self.stat()
return S_ISREG(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | def is_file(self) -> bool:
'\n Whether this path is a regular file (also True for symlinks pointing\n to regular files).\n '
try:
stat = self.stat()
return S_ISREG(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a regular file (also True for symlinks pointing
to regular files).<|endoftext|> |
588d913e03aefc05f5fc7019fff67410f12389ca98d8d5598dd7c909ab0a439e | async def async_is_file(self) -> bool:
'\n Whether this path is a regular file (also True for symlinks pointing\n to regular files).\n '
try:
stat = (await self.async_stat())
return S_ISREG(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a regular file (also True for symlinks pointing
to regular files). | lazy/io/pathz_v2/base.py | async_is_file | trisongz/lazycls | 2 | python | async def async_is_file(self) -> bool:
'\n Whether this path is a regular file (also True for symlinks pointing\n to regular files).\n '
try:
stat = (await self.async_stat())
return S_ISREG(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | async def async_is_file(self) -> bool:
'\n Whether this path is a regular file (also True for symlinks pointing\n to regular files).\n '
try:
stat = (await self.async_stat())
return S_ISREG(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a regular file (also True for symlinks pointing
to regular files).<|endoftext|> |
afa7b1ca4a3cf6667ff3b5dbe952ad4aa9441515ad4f6eada426b6d2382862fd | def is_mount(self) -> bool:
'\n Check if this path is a POSIX mount point\n '
if ((not self.exists()) or (not self.is_dir())):
return False
try:
parent_stat = self.parent.stat()
parent_dev = parent_stat.st_dev
except OSError:
return False
stat = self.stat()
dev = stat.st_dev
if (dev != parent_dev):
return True
ino = stat.st_ino
parent_ino = parent_stat.st_ino
return (ino == parent_ino) | Check if this path is a POSIX mount point | lazy/io/pathz_v2/base.py | is_mount | trisongz/lazycls | 2 | python | def is_mount(self) -> bool:
'\n \n '
if ((not self.exists()) or (not self.is_dir())):
return False
try:
parent_stat = self.parent.stat()
parent_dev = parent_stat.st_dev
except OSError:
return False
stat = self.stat()
dev = stat.st_dev
if (dev != parent_dev):
return True
ino = stat.st_ino
parent_ino = parent_stat.st_ino
return (ino == parent_ino) | def is_mount(self) -> bool:
'\n \n '
if ((not self.exists()) or (not self.is_dir())):
return False
try:
parent_stat = self.parent.stat()
parent_dev = parent_stat.st_dev
except OSError:
return False
stat = self.stat()
dev = stat.st_dev
if (dev != parent_dev):
return True
ino = stat.st_ino
parent_ino = parent_stat.st_ino
return (ino == parent_ino)<|docstring|>Check if this path is a POSIX mount point<|endoftext|> |
0b8769f8eea3514c2e88a44fba0f4c3892a9827289b5fe2746fedf7e53fa2e4b | async def async_is_mount(self) -> bool:
'\n Check if this path is a POSIX mount point\n '
if ((not (await self.async_exists())) or (not (await self.async_is_dir()))):
return False
try:
parent_stat = (await self.parent.async_stat())
parent_dev = parent_stat.st_dev
except OSError:
return False
stat = (await self.async_stat())
dev = stat.st_dev
if (dev != parent_dev):
return True
ino = stat.st_ino
parent_ino = parent_stat.st_ino
return (ino == parent_ino) | Check if this path is a POSIX mount point | lazy/io/pathz_v2/base.py | async_is_mount | trisongz/lazycls | 2 | python | async def async_is_mount(self) -> bool:
'\n \n '
if ((not (await self.async_exists())) or (not (await self.async_is_dir()))):
return False
try:
parent_stat = (await self.parent.async_stat())
parent_dev = parent_stat.st_dev
except OSError:
return False
stat = (await self.async_stat())
dev = stat.st_dev
if (dev != parent_dev):
return True
ino = stat.st_ino
parent_ino = parent_stat.st_ino
return (ino == parent_ino) | async def async_is_mount(self) -> bool:
'\n \n '
if ((not (await self.async_exists())) or (not (await self.async_is_dir()))):
return False
try:
parent_stat = (await self.parent.async_stat())
parent_dev = parent_stat.st_dev
except OSError:
return False
stat = (await self.async_stat())
dev = stat.st_dev
if (dev != parent_dev):
return True
ino = stat.st_ino
parent_ino = parent_stat.st_ino
return (ino == parent_ino)<|docstring|>Check if this path is a POSIX mount point<|endoftext|> |
55467944f57a6479182faa7cb164a5b634179a386203c30665a67babbb697bdb | def is_block_device(self) -> bool:
'\n Whether this path is a block device.\n '
try:
stat = self.stat()
return S_ISBLK(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a block device. | lazy/io/pathz_v2/base.py | is_block_device | trisongz/lazycls | 2 | python | def is_block_device(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISBLK(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | def is_block_device(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISBLK(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a block device.<|endoftext|> |
19e1d0c4bbf2097261f63892e28c73d65a84cb29525f4875df3becc3c62f5498 | async def async_is_block_device(self) -> bool:
'\n Whether this path is a block device.\n '
try:
stat = (await self.async_stat())
return S_ISBLK(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a block device. | lazy/io/pathz_v2/base.py | async_is_block_device | trisongz/lazycls | 2 | python | async def async_is_block_device(self) -> bool:
'\n \n '
try:
stat = (await self.async_stat())
return S_ISBLK(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | async def async_is_block_device(self) -> bool:
'\n \n '
try:
stat = (await self.async_stat())
return S_ISBLK(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a block device.<|endoftext|> |
0296e8c281c3721b4f652915d3f9064b680314ea20776a5b6410d5bf3e068428 | def is_char_device(self) -> bool:
'\n Whether this path is a character device.\n '
try:
stat = self.stat()
return S_ISCHR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a character device. | lazy/io/pathz_v2/base.py | is_char_device | trisongz/lazycls | 2 | python | def is_char_device(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISCHR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | def is_char_device(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISCHR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a character device.<|endoftext|> |
bf426c088d4e810f1d1206950a388450faf9d238a151ec7d459232dec9d0718c | async def async_is_char_device(self) -> bool:
'\n Whether this path is a character device.\n '
try:
stat = (await self.stat())
return S_ISCHR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a character device. | lazy/io/pathz_v2/base.py | async_is_char_device | trisongz/lazycls | 2 | python | async def async_is_char_device(self) -> bool:
'\n \n '
try:
stat = (await self.stat())
return S_ISCHR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | async def async_is_char_device(self) -> bool:
'\n \n '
try:
stat = (await self.stat())
return S_ISCHR(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a character device.<|endoftext|> |
e944322a179b9a1ee0fc6362b47e286b2929d405cca22bce6bf17961f64bcc25 | def is_fifo(self) -> bool:
'\n Whether this path is a FIFO.\n '
try:
stat = self.stat()
return S_ISFIFO(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a FIFO. | lazy/io/pathz_v2/base.py | is_fifo | trisongz/lazycls | 2 | python | def is_fifo(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISFIFO(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | def is_fifo(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISFIFO(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a FIFO.<|endoftext|> |
d67144837b31d16224c40eac21b909d79b8bed4ffdd96d56701fd60e7a78c1e8 | async def async_is_fifo(self) -> bool:
'\n Whether this path is a FIFO.\n '
try:
stat = (await self.async_stat())
return S_ISFIFO(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a FIFO. | lazy/io/pathz_v2/base.py | async_is_fifo | trisongz/lazycls | 2 | python | async def async_is_fifo(self) -> bool:
'\n \n '
try:
stat = (await self.async_stat())
return S_ISFIFO(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | async def async_is_fifo(self) -> bool:
'\n \n '
try:
stat = (await self.async_stat())
return S_ISFIFO(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a FIFO.<|endoftext|> |
f519f1962d540c3033f537d6fb6cf8fc89e0485910b967d3dc69ce113dfe0647 | def is_socket(self) -> bool:
'\n Whether this path is a socket.\n '
try:
stat = self.stat()
return S_ISSOCK(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | Whether this path is a socket. | lazy/io/pathz_v2/base.py | is_socket | trisongz/lazycls | 2 | python | def is_socket(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISSOCK(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False | def is_socket(self) -> bool:
'\n \n '
try:
stat = self.stat()
return S_ISSOCK(stat.st_mode)
except OSError as e:
if (not _ignore_error(e)):
raise
return False
except ValueError:
return False<|docstring|>Whether this path is a socket.<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.