<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init(directory=None):
 """ Initializes a new site in the `directory` Current working dir if directory is None. """

    if directory is not None and not path.exists(directory):
        makedirs(directory)
    else:
        print('%s already exists, populating with template files' % (directory))
        directory = ''

    if not path.isfile(path.join(directory,'style.css')):
        grab('style.css', directory)
        print('Added sample style')
    if not path.isfile(path.join(directory,'template.jinja')):
        grab('template.jinja', directory)
        print('Added sample template.jinja')
    if not path.isfile(path.join(directory,'content.rst')):
        grab('content.rst', directory)
        print('Added sample content.rst')