<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def initialize(self, module_name, location=None, basename=None, standalone_path=''):
 """Initialize the module for a project. module-name is the name of the project module. location is the location (directory) of the project to initialize. If not specified, standalone project will be initialized standalone_path is the path to the source-location. this should only be called from the python side. """

        assert isinstance(module_name, basestring)
        assert isinstance(location, basestring) or location is None
        assert isinstance(basename, basestring) or basename is None
        jamroot = False
        parent_module = None
        if module_name == "test-config":
            # No parent
            pass
        elif module_name == "site-config":
            parent_module = "test-config"
        elif module_name == "user-config":
            parent_module = "site-config"
        elif module_name == "project-config":
            parent_module = "user-config"
        elif location and not self.is_jamroot(basename):
            # We search for parent/project-root only if jamfile was specified
            # --- i.e
            # if the project is not standalone.
            parent_module = self.load_parent(location)
        elif location:
            # It's either jamroot, or standalone project.
            # If it's jamroot, inherit from user-config.
            # If project-config module exist, inherit from it.
            parent_module = 'user-config'
            if 'project-config' in self.module2attributes:
                parent_module = 'project-config'
            jamroot = True

        # TODO: need to consider if standalone projects can do anything but defining
        # prebuilt targets. If so, we need to give more sensible "location", so that
        # source paths are correct.
        if not location:
            location = ""

        # the call to load_parent() above can end up loading this module again
        # make sure we don't reinitialize the module's attributes
        if module_name not in self.module2attributes:
            if "--debug-loading" in self.manager.argv():
                print "Initializing project '%s'" % module_name
            attributes = ProjectAttributes(self.manager, location, module_name)
            self.module2attributes[module_name] = attributes

            python_standalone = False
            if location:
                attributes.set("source-location", [location], exact=1)
            elif not module_name in ["test-config", "site-config", "user-config", "project-config"]:
                # This is a standalone project with known location. Set source location
                # so that it can declare targets. This is intended so that you can put
                # a .jam file in your sources and use it via 'using'. Standard modules
                # (in 'tools' subdir) may not assume source dir is set.
                source_location = standalone_path
                if not source_location:
                    source_location = self.loaded_tool_module_path_.get(module_name)
                if not source_location:
                    self.manager.errors()('Standalone module path not found for "{}"'
                                          .format(module_name))
                attributes.set("source-location", [source_location], exact=1)
                python_standalone = True

            attributes.set("requirements", property_set.empty(), exact=True)
            attributes.set("usage-requirements", property_set.empty(), exact=True)
            attributes.set("default-build", property_set.empty(), exact=True)
            attributes.set("projects-to-build", [], exact=True)
            attributes.set("project-root", None, exact=True)
            attributes.set("build-dir", None, exact=True)

            self.project_rules_.init_project(module_name, python_standalone)

            if parent_module:
                self.inherit_attributes(module_name, parent_module)
                attributes.set("parent-module", parent_module, exact=1)

            if jamroot:
                attributes.set("project-root", location, exact=1)

            parent = None
            if parent_module:
                parent = self.target(parent_module)

            if module_name not in self.module2target:
                target = b2.build.targets.ProjectTarget(self.manager,
                    module_name, module_name, parent,
                    self.attribute(module_name, "requirements"),
                    # FIXME: why we need to pass this? It's not
                    # passed in jam code.
                    self.attribute(module_name, "default-build"))
                self.module2target[module_name] = target

        self.current_project = self.target(module_name)