<commit_before># EggRoll API Document


* 1. **[General API] (#1)**
* 2. **[Storage API] (#2)**
* 3. **[Computing API] (#3)**

---

## <a name="1">General API: eggroll object</a>

>``` python
>init(job_id=None, mode=WorkMode.STANDALONE, naming_policy=NamingPolicy.DEFAULT)
>```

Initializes EggRoll runtime. This API should always be called before other API calls.

**Parameters:**

+ **job\_id** (string): Job id and default table namespace of this runtime.
+ **mode** (WorkMode): Set runtime naming policy, `WorkMode.STANDALONE` or `WorkMode.CLUSTER`.
+ **naming\_policy** (NamingPolicy): Set runtime naming policy, `NamingPolicy.DEFAULT` or `NamingPolicy.ITER_AWARE`.

**Returns:**

+ None

**Example:**

``` python
>>> from arch import eggroll
>>> from eggroll.api import WorkMode
>>> from eggroll.api import NamingPolicy
>>> eggroll.init('a', WorkMode.CLUSTER, NamingPolicy.ITER_AWARE)
```

--

>``` python<commit_msg>fix eggroll init error<commit_after># EggRoll API Document


* 1. **[General API] (#1)**
* 2. **[Storage API] (#2)**
* 3. **[Computing API] (#3)**

---

## <a name="1">General API: eggroll object</a>

>``` python
>init(job_id=None, mode=WorkMode.STANDALONE, naming_policy=NamingPolicy.DEFAULT)
>```

Initializes EggRoll runtime. This API should always be called before other API calls.

**Parameters:**

+ **job\_id** (string): Job id and default table namespace of this runtime.
+ **mode** (WorkMode): Set runtime naming policy, `WorkMode.STANDALONE` or `WorkMode.CLUSTER`.
+ **naming\_policy** (NamingPolicy): Set runtime naming policy, `NamingPolicy.DEFAULT` or `NamingPolicy.ITER_AWARE`.

**Returns:**

+ None

**Example:**

``` python
>>> from arch.api import eggroll
>>> from arch.api.eggroll import WorkMode
>>> from arch.api.eggroll import NamingPolicy
>>> eggroll.init('a', WorkMode.CLUSTER, NamingPolicy.ITER_AWARE)
```

--

>``` python
{'fraction_non_alphanumeric': 0.1781701444622793, 'fraction_numerical': 0.00749063670411985, 'mean_word_length': 5.212624584717608, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 39, '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': '1512531', 'n_tokens_mistral': 655, 'n_tokens_neox': 608, 'n_words': 178}