Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
str(object='') -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

src/z/a/zato-HEAD/code/zato-common/src/zato/common/component_info.py   zato(Download)
 
# psutil
from psutil import CONN_LISTEN, Process
 
# PyYAML

src/z/a/zato-HEAD/code/zato-common/src/zato/common/util.py   zato(Download)
def is_port_taken(port):
    for conn in psutil.net_connections(kind='tcp'):
        if conn.laddr[1] == port and conn.status == psutil.CONN_LISTEN:
            return True
    return False

src/p/s/psutil-2.1.1/test/test_psutil.py   psutil(Download)
                if p.pid == tcp4_proc.pid:
                    check_conn(p, conn, AF_INET, SOCK_STREAM, "127.0.0.1", (),
                               psutil.CONN_LISTEN,
                               ("all", "inet", "inet4", "tcp", "tcp4"))
                # UDP v4
                elif p.pid == getattr(tcp6_proc, "pid", None):
                    check_conn(p, conn, AF_INET6, SOCK_STREAM, ("::", "::1"),
                               (), psutil.CONN_LISTEN,
                               ("all", "inet", "inet6", "tcp", "tcp6"))
                # UDP v6