<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def binarize(netin, threshold_type, threshold_level, sign='pos', axis='time'):
 """ Binarizes a network, returning the network. General wrapper function for different binarization functions. Parameters netin : array or dict Network (graphlet or contact representation), threshold_type : str What type of thresholds to make binarization. Options: 'rdp', 'percent', 'magnitude'. threshold_level : str Paramter dependent on threshold type. If 'rdp', it is the delta (i.e. error allowed in compression). If 'percent', it is the percentage to keep (e.g. 0.1, means keep 10% of signal). If 'magnitude', it is the amplitude of signal to keep. sign : str, default='pos' States the sign of the thresholding. Can be 'pos', 'neg' or 'both'. If "neg", only negative values are thresholded and vice versa. axis : str Threshold over specfied axis. Valid for percent and rdp. Can be time or graphlet. Returns ------- netout : array or dict (depending on input) Binarized network """

    if threshold_type == 'percent':
        netout = binarize_percent(netin, threshold_level, sign, axis)
    elif threshold_type == 'magnitude':
        netout = binarize_magnitude(netin, threshold_level, sign)
    elif threshold_type == 'rdp':
        netout = binarize_rdp(netin, threshold_level, sign, axis)
    else:
        raise ValueError('Unknown value to parameter: threshold_type.')
    return netout