human
Complete the below
def get_op_or_tensor_by_name(name):

    ''''Get either tf.Operation of tf.Tensor from names.
    Args:
    name (list[str] or str): names of operations or tensors.'
    '''

=====
Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.
    G = tf.get_default_graph()
    def f(n):
        if ((len(n) >= 3) and (n[(-2)] == ':')):
            return G.get_tensor_by_name(n)
        else:
            return G.get_operation_by_name(n)
    if (not isinstance(name, list)):
        return f(name)
    else:
        return list(map(f, name))