<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_component(self, name, project, description=None, leadUserName=None, assigneeType=None, isAssigneeTypeValid=False, ):
 """Create a component inside a project and return a Resource for it. :param name: name of the component :type name: str :param project: key of the project to create the component in :type project: str :param description: a description of the component :type description: str :param leadUserName: the username of the user responsible for this component :type leadUserName: Optional[str] :param assigneeType: see the ComponentBean.AssigneeType class for valid values :type assigneeType: Optional[str] :param isAssigneeTypeValid: boolean specifying whether the assignee type is acceptable (Default: False) :type isAssigneeTypeValid: bool :rtype: Component """

        data = {
            'name': name,
            'project': project,
            'isAssigneeTypeValid': isAssigneeTypeValid}
        if description is not None:
            data['description'] = description
        if leadUserName is not None:
            data['leadUserName'] = leadUserName
        if assigneeType is not None:
            data['assigneeType'] = assigneeType

        url = self._get_url('component')
        r = self._session.post(
            url, data=json.dumps(data))

        component = Component(self._options, self._session, raw=json_loads(r))
        return component