# Path: trappy/utils.py
# def listify(to_select):
#     """Utitlity function to handle both single and
#     list inputs
#     """
# 
#     if not isinstance(to_select, list):
#         to_select = [to_select]
# 
#     return to_select


import collections
import warnings
from trappy.utils import listify


def normalize_list(val, lst):
    """Normalize a unitary list"""

    if len(lst) != 1:
        raise RuntimeError("Cannot Normalize a non-unitary list")

    return lst * val


def decolonize(val):
    """Remove the colon at the end of the word
    This will be used by the unique word of
    template class to sanitize attr accesses
    """

    return val.strip(":")


def get_trace_event_data(trace, execnames=None, pids=None):
    """Create a list of objects that can be consumed by EventPlot to plot
    task residency like kernelshark

    """

    if execnames:
        execnames = listify(execnames)

    if pids:

# Path: trappy/utils.py
# def listify(to_select):
#     """Utitlity function to handle both single and
#     list inputs
#     """
# 
#     if not isinstance(to_select, list):
#         to_select = [to_select]
# 
#     return to_select


# Path: trappy/plotter/Utils.py
import collections
import warnings
from trappy.utils import listify



def normalize_list(val, lst):
    """Normalize a unitary list"""

    if len(lst) != 1:
        raise RuntimeError("Cannot Normalize a non-unitary list")

    return lst * val


def decolonize(val):
    """Remove the colon at the end of the word
    This will be used by the unique word of
    template class to sanitize attr accesses
    """

    return val.strip(":")


def get_trace_event_data(trace, execnames=None, pids=None):
    """Create a list of objects that can be consumed by EventPlot to plot
    task residency like kernelshark

    """

    if execnames:
        execnames = listify(execnames)

    if pids:

        pids = listify(pids)