## mega_function()


Perform a mega computation combining all docstring features.


Usage


``` python
mega_function(
    data,
    mode="default",
    threshold=0.5,
)
```


Applies a configurable analysis pipeline to the input data, returning detailed results. Uses [other_func()](other_func.md#gdtest_stress_all_docstr.other_func) for element-wise transformations and [DataHolder](DataHolder.md#gdtest_stress_all_docstr.DataHolder) for result storage.

> **Note: Added in version 3.0**

> **Note: Note**
>
> This replaces the old API.


## Parameters


`data: list`  
A list of numeric values to process. Must contain at least one element.

`mode: str = ``"default"`  
The processing mode. One of `"default"` or `"strict"`. Defaults to `"default"`.

`threshold: float = ``0.5`  
The minimum threshold for filtering values. Values below this threshold are excluded. Defaults to `0.5`.


## Returns


`dict`  
A dictionary with the following keys:

- `"result"` -- the computed aggregate value (float).
- `"filtered"` -- data points above threshold (list).
- `"mode"` -- the mode that was used (str).
- `"count"` -- number of points processed (int).


## Raises


`ValueError`  
If `data` is empty or `mode` is not recognized.


## Notes

The `"default"` mode applies a simple mean calculation:

.. math::

    R = \frac{1}{n} \sum_{i=1}^{n} f(x_i)

where :math:`f` is the [other_func()](other_func.md#gdtest_stress_all_docstr.other_func) transformation.

The `"strict"` mode additionally filters values below the `threshold` before computing the mean. This can significantly reduce the number of data points in the output.

The time complexity is `O(n)` for both modes. Memory usage is proportional to the size of the input data.


## Warnings

Input is modified in-place when `mode="strict"` is used. Make a copy of the data before calling if you need to preserve the original values.


## See Also

[other_func()](other_func.md#gdtest_stress_all_docstr.other_func)  
Element-wise transformation used internally.

[DataHolder](DataHolder.md#gdtest_stress_all_docstr.DataHolder)  
Class for storing computation results.


## References

1.  <span style="font-weight: 600; color: #6c757d;">\[1\]</span> Smith et al. (2020). "Advanced Data Processing Techniques." Journal of Computation, 15(3), 42-58.


## Examples

Basic usage with default mode:

``` python
>>> result = mega_function([1.0, 2.0, 3.0])
>>> result["mode"]
```

'default'

``` python
>>> result["count"]
```

3

Using strict mode with a threshold:

``` python
>>> result = mega_function([0.1, 0.6, 0.9], mode="strict", threshold=0.5)
>>> result["filtered"]
```

\[0.6, 0.9\]

The transformation uses [other_func()](other_func.md#gdtest_stress_all_docstr.other_func) internally:

``` python
>>> result = mega_function([4.0])
>>> result["result"]
```

2.0
