<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_nk_object(filename, path=""):
 """ Read a pickled file. Parameters filename : str Full file's name (with extension). path : str File's path. Example Notes *Authors* - `Dominique Makowski <https://dominiquemakowski.github.io/>`_ *Dependencies* - pickle - gzip """

    filename = path + filename
    
    try:
        with open(filename, 'rb') as name:
            file = pickle.load(name)
    except pickle.UnpicklingError:
        with gzip.open(filename, 'rb') as name:
            file = pickle.load(name)
    except ModuleNotFoundError:  # In case you're trying to unpickle a dataframe made with pandas < 0.17
        try:
            file = pd.read_pickle(filename)
        except:
            pass
    return(file)