<commit_before>:mod:`os` -- basic "operating system" services
==============================================

.. module:: os
   :synopsis: basic "operating system" services

The ``os`` module contains functions for filesystem access and ``urandom``.

Pyboard specifics
-----------------

The filesystem on the pyboard has ``/`` as the root directory and the
available physical drives are accessible from here.  They are currently:

    ``/flash``      -- the internal flash filesystem

    ``/sd``         -- the SD card (if it exists)

On boot up, the current directory is ``/flash`` if no SD card is inserted,
otherwise it is ``/sd``.

Functions
---------

.. function:: chdir(path)

   Change current directory.

.. function:: getcwd()

   Get the current directory.

.. function:: listdir([dir])

   With no argument, list the current directory.  Otherwise list the given directory.

.. function:: mkdir(path)

   Create a new directory.

.. function:: remove(path)

   Remove a file.

.. function:: rmdir(path)

   Remove a directory.

.. function:: stat(path)

   Get the status of a file or directory.
<commit_msg>Added rename to docs<commit_after>:mod:`os` -- basic "operating system" services
==============================================

.. module:: os
   :synopsis: basic "operating system" services

The ``os`` module contains functions for filesystem access and ``urandom``.

Pyboard specifics
-----------------

The filesystem on the pyboard has ``/`` as the root directory and the
available physical drives are accessible from here.  They are currently:

    ``/flash``      -- the internal flash filesystem

    ``/sd``         -- the SD card (if it exists)

On boot up, the current directory is ``/flash`` if no SD card is inserted,
otherwise it is ``/sd``.

Functions
---------

.. function:: chdir(path)

   Change current directory.

.. function:: getcwd()

   Get the current directory.

.. function:: listdir([dir])

   With no argument, list the current directory.  Otherwise list the given directory.

.. function:: mkdir(path)

   Create a new directory.

.. function:: remove(path)

   Remove a file.

.. function:: rmdir(path)

   Remove a directory.

.. function:: rename(old_path, new_path)

   Rename a file.

.. function:: stat(path)

   Get the status of a file or directory.

{'fraction_non_alphanumeric': 0.1670995670995671, 'fraction_numerical': 0.0, 'mean_word_length': 3.0472854640980738, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4076520', 'n_tokens_mistral': 646, 'n_tokens_neox': 609, 'n_words': 265}