def _string_or_path(code_str, code_path):
    """Return either code_str if it is not None, or the contents in 
    code_path.
    """
    if code_str is not None:
        return code_str
    if code_path is not None:
        with open(code_path, 'rb') as f:
            return f.read()
    return ''
