Generally, you look in the python standard library reference, or on the Python Package Index for a module that contains methods you want to use. Then you import them.
A module in python is essentially a way of doing namespaces, same as most other languages. Generally, googling "how to do ______ in python" will provide some result of someone using the module you're aiming for. Then you can look up the documentation for that module to determine what methodsfunctions and classes it provides (or alternatively, import modulename the module in a python console and then do help(modulename).