Examples
========

API Usage Examples
------------------

Backend Setup
~~~~~~~~~~~~~

.. literalinclude:: ../../../examples/api_usage/backend_setup.py
   :language: python
   :linenos:


Partitioning API
~~~~~~~~~~~~~~~~

`all_arguments`
^^^^^^^^^^^^^^^

.. literalinclude:: ../../../examples/api_usage/all_arguments.py
   :language: python
   :linenos:


`per_argument`
^^^^^^^^^^^^^^

.. literalinclude:: ../../../examples/api_usage/per_argument.py
   :language: python
   :linenos:


Custom Partition Function
^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../examples/api_usage/custom_generators.py
   :language: python
   :linenos:


Enforced Partition Size
^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../examples/api_usage/partition_size.py
   :language: python
   :linenos:


Profiling
~~~~~~~~~

.. literalinclude:: ../../../examples/api_usage/profiling.py
   :language: python
   :linenos:


Nested Parfun Calls
~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../../../examples/api_usage/nested_functions.py
   :language: python
   :linenos:


Application Examples
--------------------

Count Bigrams In A Text Parallelly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../../../examples/count_bigrams/main.py
   :language: python
   :linenos:


Parallel Training Random-Forest On Californian Housing Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../../../examples/california_housing/main.py
   :language: python
   :linenos:


Compute Electricity Production Statistics Parallelly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../../../examples/europe_electricity/main.py
   :language: python
   :linenos:


Compute Portfolio Metrics Parallelly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../../../examples/portfolio_metrics/main.py
   :language: python
   :linenos:
