human
Give me a the Python program you requested given the following:
I am working on the file "Section 2 - Advance Python/Chapter S2.01 - Functional Programming/02_01_Functions_as_First_Class_citizens.ipynb".
The first task is:
Following DRY (Don't Repeat Yourself)
This type can be used if you have a section of code base in function is repeated in numerous places. For example, you might write a function which processes a file, and you want to accept either an open file object or a file name:
Can you write Python program for it?
assistant
#Here is the Python program you requested.

# Keepin’ it DRY
import os

def process(file_name):

    if isinstance(file_name, str):
        with open(file_name, 'r') as f:
            for line in f.readlines():
                print(line)
    else:
        for line in file_name:
            print(line)
        
process(["test", "test3", "t33"])
process(os.path.join("files", "process_me.txt"))

# Keepin’ it DRY
import os

def process(data):
    def do_stuff(file_process):
        for line in file_process:
            print(line)

    if isinstance(data, str):
        with open(data, 'r') as f:
            do_stuff(f)
    else:
        do_stuff(data)
        
process(["test", "test3", "t33"])
process(os.path.join("files", "process_me.txt"))