Did I find the right examples for you? yes no

# sympy.physics.units.find_unit

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
```Return a list of matching units names.
if quantity is a string -- units containing the string `quantity`
if quantity is a unit -- units having matching base units

Examples
========

>>> from sympy.physics import units as u
>>> u.find_unit('charge')
['charge'](more...)
```

```        def find_unit(quantity):
"""
Return a list of matching units names.
if quantity is a string -- units containing the string `quantity`
if quantity is a unit -- units having matching base units

Examples
========

>>> from sympy.physics import units as u
>>> u.find_unit('charge')
['charge']
>>> u.find_unit(u.charge)
['C', 'charge', 'coulomb', 'coulombs']
>>> u.find_unit('volt')
['volt', 'volts', 'voltage']
>>> u.find_unit(u.inch**3)[:5]
['l', 'cl', 'dl', 'ml', 'liter']
"""
import sympy.physics.units as u
rv = []
if isinstance(quantity, str):
rv = [i for i in dir(u) if quantity in i]
else:
units = quantity.as_coeff_Mul()[1]
for i in dir(u):
try:
if units == eval('u.' + i).as_coeff_Mul()[1]:
rv.append(str(i))
except:
pass
return sorted(rv, key=len)
```

```from sympy import integrate, Rational, sqrt, Symbol
```def test_find_unit():