Human: read file and covert to int. Assistant: 
Here is a Python code to read a file and covert to int

import sys

def read_file(filename):
    """Reads a file and returns its contents as an integer.

    If the file does not exist, returns -1.
    """
    try:
        with open(filename, 'r') as f:
            return int(f.read())
    except IOError:
        return -1

# Enter the function name
function_name = "memory_used"

# Calling the function
print((read_file(function_name)))

#Example Output
# -1

#Remember to inspect code for bugs.