def remove_trace(stream, component=None):
    """ Removes given component from stream
    """
    try:
        trace = stream.select(component=component)[0]
        stream.remove(trace)
    except:
        return stream