# ncs.util Module

Utility module, low level abstrations

## Functions

### get\_callpoint\_model

```python
get_callpoint_model()
```

Get configured callpoint model

### get\_self\_assign\_warning

```python
get_self_assign_warning()
```

Return current self assign warning type.

### get\_setattr\_fun

```python
get_setattr_fun(obj, parent)
```

Return setattr fun to use for setting attributes, will use return a wrapped setattr function with sanity checks if enabled.

### is\_multiprocessing

```python
is_multiprocessing()
```

Return True if the configured callpoint model is multiprocessing

### mk\_yang\_date\_and\_time

```python
mk_yang_date_and_time(dt=None)
```

Create a timezone aware datetime object in ISO8601 string format.

This method is used to convert a datetime object to its timezone aware counterpart and return a string useful for a 'yang:date-and-time' leaf. If 'dt' is None the current time will be used.

Arguments: dt -- a datetime object to be converted (optional)

### set\_callpoint\_model

```python
set_callpoint_model(model)
```

Update environment with provided callpoint model

### set\_kill\_child\_on\_parent\_exit

```python
set_kill_child_on_parent_exit()
```

Multi OS variant of \_ncs.set\_kill\_child\_on\_parent\_exit falling back to kqueue if the OS supports it.

### set\_self\_assign\_warning

```python
set_self_assign_warning(warning)
```

Set self assign warning type.

### with\_setattr\_check

```python
with_setattr_check(path)
```

Use as context manager enabling set attribute check for the current thread while in the manager.
