input: Write a python function to replace the placeholder "$username" with the actual username attribute of the input object.
  assert substitute_username(type('obj', (object,), {'username': 'Alice', 'replace': lambda self, old, new: new})('$username')) == 'Alice'
  assert substitute_username(type('obj', (object,), {'username': 'Bob', 'replace': lambda self, old, new: new})('$username')) == 'Bob'
  assert substitute_username(type('obj', (object,), {'username': 'Charlie', 'replace': lambda self, old, new: new})('$username')) == 'Charlie'
output: def substitute_username(obj):
      return obj.replace('$username', obj.username)