def to_haystack(unit):
    '\n    Some parsing tweaks to fit pint units / handling of edge cases.\n    '
    global HAYSTACK_CONVERSION
    global PINT_CONVERSION
    if ((unit == u'per_minute') or (unit == u'/min') or (unit == u'per_second') or (unit == u'/s') or (unit == u'per_hour') or (unit == u'/h') or (unit == None)):
        return u''
    for (pint_value, haystack_value) in PINT_CONVERSION:
        unit = unit.replace(pint_value, haystack_value)
    for (haystack_value, pint_value) in HAYSTACK_CONVERSION:
        if (pint_value == u''):
            continue
        unit = unit.replace(pint_value, haystack_value)
    return unit
Some parsing tweaks to fit pint units / handling of edge cases.
def to_haystack(unit):
    '\n    \n    '
    global HAYSTACK_CONVERSION
    global PINT_CONVERSION
    if ((unit == u'per_minute') or (unit == u'/min') or (unit == u'per_second') or (unit == u'/s') or (unit == u'per_hour') or (unit == u'/h') or (unit == None)):
        return u
    for (pint_value, haystack_value) in PINT_CONVERSION:
        unit = unit.replace(pint_value, haystack_value)
    for (haystack_value, pint_value) in HAYSTACK_CONVERSION:
        if (pint_value == u):
            continue
        unit = unit.replace(pint_value, haystack_value)
    return unit