semvec/pypi-packages huggingface dataset:
PrivateCode 1.0.0
PrivateCode is a Python library that provides a decorator to make a function, method, or class private.
Requires Python: >=3.6

# PrivateCode

[![Downloads](https://img.shields.io/pepy/dt/PrivateCode)](https://pypi.org/project/PrivateCode/)
[![Version](https://img.shields.io/pypi/v/PrivateCode)](https://pypi.org/project/PrivateCode/)
[![Python Version](https://img.shields.io/pypi/pyversions/PrivateCode)](https://pypi.org/project/PrivateCode/)

PrivateCode is a Python library that provides a decorator to make a function, method, or class private. 
This allows the function, method, or class to be accessed only from its own module and raises an exception if called from another module.
**WARNING** : Functions are not private at the memory level, but only at the call level.

## Set up
----
### Install

~~~python
pip install PrivateCode
~~~

### Upgrade
~~~~python
pip install --upgrade PrivateCode
~~~~

## Support

If you want to contact me for questions, bugs, or problems or other: lixnew2@gmail.com

## Python version

PrivateCode was written for Python 3.

## Decorator

### Make a function, method, or class private
~~~python
@private
~~~

## Decorator Documentation

### `private`
A decorator that makes a function, method, or class private, allowing it to be called only from its own module.

#### Arguments:
- `target`: The function, method, or class to be decorated.

#### Returns:
- The decorated function, method, or class.

#### Raises:
- `ValueError`: If the decorated function, method, or class is called from a different module.

#### Example:
~~~python
@private
def my_private_function():
    # This function can only be called from its own module.
    pass

class MyClass:
    @private
    def my_private_method(self):
        # This method can only be called from its own module.
        pass

@private
class MyPrivateClass:
    # This class can only be instantiated from its own module.
    pass
~~~
plot-diagram-eye 0.1.0
A library designed to generate and visualize eye diagrams for digital communication signals.
Requires Python: >=3.6

# plot_diagram_eye

`plot_diagram_eye` is a Python library designed to generate and visualize eye diagrams for digital communication signals. The library provides functions to create various types of filters, generate signals, and plot eye diagrams to analyze the quality of the signal transmission.

>>> It mainly comes with three functions. get_filter() , get_signal(),  drawFullEyeDiagram()

>>> get_filter(name,T,rolloff= None): 

    Generate a filter function.

    Parameters:
    name (str): The type of filter to generate ('rect', 'rc', 'rrc').
    T (float): Symbol period.
    rolloff (float, optional): Roll-off factor for 'rc' and 'rrc' filters.

    Returns:
    function: A function representing the specified filter.

    Available Filters:
    - 'rect': Rectangular filter.
    - 'rc': Raised cosine filter.
    - 'rrc': Root raised cosine filter.
    

>>>get_signal(data,g,T,Fs):


    Generate a signal by convolving the data with the provided filter.

    Parameters:
    data (array-like): Input binary data stream.
    g (function): Filter function.
    T(int): Symbol period. 
    Fs(int): Sampling frequency.

    Returns:
    tuple:
        t (numpy.ndarray): Time vector.
        x (numpy.ndarray): Generated signal.

>>>def drawFullEyeDiagram(x,T,Fs):

    Generate and plot the eye diagram of the signal.

    Parameters:
    x (numpy.ndarray): Input signal.
    T(int): Symbol period. 
    Fs(int): Sampling frequency.

    Returns:
    None. The function plots the eye diagram.




## Features

- Generate Rectangular, Raised Cosine, and Root Raised Cosine filters.
- Convolve input binary data streams with specified filters to create modulated signals.
- Visualize eye diagrams for analyzing signal integrity and performance.

## Sample usage:

  >>>import plot_diagram_eye as eye
  >>>import numpy as np
  >>>Fs=10
  >>>T=1
  >>>N=10
  >>>b=np.random.randint(0,2,N)
  >>>data=2*b-1
  >>>t=np.arange(-3*T,3*T,1/Fs)
  >>>g=eye.get_filter('rc',T,rolloff=0.2)
  >>>t,x=eye.get_signal(data,g,T,Fs)
  >>>eye.drawFullEyeDiagram(x,T,Fs)

  

## Installation

You can install `plot_diagram_eye` via pip:

```bash
pip install plot-diagram-eye
python-k8s-pod-fatal 0.0.1
A Python exception that provides metadata to Kubernetes Pods when they have a catastrophic failure
Requires Python: >=3.8

# python-k8s-pod-fatal

A Python exception that provides metadata to Kubernetes Pods when they have a
catastrophic failure.

## Description

Your Pod requires environment variables, but one of them is missing and you're
tired to go over the logs from the respective container just to figured that
out?

The package `python_k8s_pod_fatal` provides a customized Python exception that
can help developers to provide an appropriated error message to be logged when
the application inside a Kubernetes Pod (one or more Docker containers) has a
error which is impossible to recover, thus the Pod must be terminated.

This error message will be available when you describe the Pod with a
`kubectl describe` or `kubectl get`, which greatly helps with troubleshooting.

Usage of this module with a microsservice external dependencies failures is
even more interesting.

## How to use

Install the module from Pypi:

```
pip install --upgrade python_k8s_pod_fatal
```

Then, anywhere some module from your application:

```python
import requests
from kubernetes.pod.exceptions import Fatal

r = requests.get('https://api.github.com/user', auth=('user', 'pass'))

if r.status_code != 200:
    raise Fatal('HTTP request to GitHub failed')

```

When the exception is raised, the error message will be available not only in
the respective container log, but also in the `pod.status.message` from the
Kubernetes API.

### Customized log file

You can also use a customized log file (see References), but in order to do
you will need to pass an additional parameter to the `Fatal` constructor, which
defaults to `/dev/termination-log`. If this file is not available (the default
file does exist), the instance won't try to write to it.

In this case, you probably want to change the configuration of the Pod and also
pass the same value as an environment variable to your code, better defined in
a single place.

See the `tests` of this module for an example.

## References

- [Determine the reason of a Pod failure](https://kubernetes.io/docs/tasks/debug/debug-application/determine-reason-pod-failure/#customizing-the-termination-message)
- [Python3 concrete exceptions](https://docs.python.org/3/library/exceptions.html#concrete-exceptions)