---
title: imports
---
## is\_iter

```python
def is_iter(
    o
):
```

*Test whether `o` can be used in a `for` loop*

## is\_coll

```python
def is_coll(
    o
):
```

*Test whether `o` is a collection (i.e. has a usable `len`)*

## all\_equal

```python
def all_equal(
    a, b
):
```

*Compares whether `a` and `b` are the same length and have the same contents*

## noop

```python
def noop(
    x=None, *args, **kwargs
):
```

*Do nothing*

## noops

```python
def noops(
    x=None, *args, **kwargs
):
```

*Do nothing (method)*

## any\_is\_instance

```python
def any_is_instance(
    t, *args
):
```

## isinstance\_str

```python
def isinstance_str(
    x, cls_name
):
```

*Like `isinstance`, except takes a type name instead of a type*

## array\_equal

```python
def array_equal(
    a, b
):
```

## df\_equal

```python
def df_equal(
    a, b
):
```

## equals

```python
def equals(
    a, b
):
```

*Compares `a` and `b` for equality; supports sublists, tensors and arrays too*

## ipython\_shell

```python
def ipython_shell():
```

*Same as `get_ipython` but returns `False` if not in IPython*

## in\_ipython

```python
def in_ipython():
```

*Check if code is running in some kind of IPython environment*

## in\_colab

```python
def in_colab():
```

*Check if the code is running in Google Colaboratory*

## in\_jupyter

```python
def in_jupyter():
```

*Check if the code is running in a jupyter notebook*

## in\_notebook

```python
def in_notebook():
```

*Check if the code is running in a jupyter notebook*

## remove\_prefix

```python
def remove_prefix(
    text, prefix
):
```

*Temporary until py39 is a prereq*

## remove\_suffix

```python
def remove_suffix(
    text, suffix
):
```

*Temporary until py39 is a prereq*

## is\_usable\_tool

```python
def is_usable_tool(
    func:<built-in function callable>
):
```

*True if the function has a docstring and all parameters have types, meaning that it can be used as an LLM tool.*

## llmtool

```python
def llmtool(
    f=None, **tmpls
):
```

*Decorator to mark a function as an LLM tool. Pass `**tmpls` to format the docstring.*
