<commit_before>from project import Project
from workspace import Workspace

class WorkspacesAPI:
    """ Represents the Toggl Workspaces API """
    baseUrl = 'workspaces'
    
    def __init__(self, requestHelper):
        """ Initialize the Workspaces API """
        self.requestHelper = requestHelper
        
    def getAll(self):
        """ Return all the workspaces """
        response = self.requestHelper.get(self.baseUrl)
        workspaces = []
        if response.status_code == 200:
            for workspaceJSON in response.json():
                workspaces.append(Workspace(workspaceJSON))
            
        return workspaces
        
    def getProjects(self, workspace):
        """ Return all projects for the given workspace """
        url = "{0}/{1}/projects".format(self.baseUrl, workspace.id)
        response = self.requestHelper.get(url)
        
        projects = []
        if response.status_code == 200:
            for projectJSON in response.json():
                projects.append(Project(projectJSON))
            
        return projects<commit_msg>Now explicitly set the JSON optional parameter<commit_after>from project import Project
from workspace import Workspace

class WorkspacesAPI:
    """ Represents the Toggl Workspaces API """
    baseUrl = 'workspaces'
    
    def __init__(self, requestHelper):
        """ Initialize the Workspaces API """
        self.requestHelper = requestHelper
        
    def getAll(self):
        """ Return all the workspaces """
        response = self.requestHelper.get(self.baseUrl)
        workspaces = []
        if response.status_code == 200:
            for workspaceJSON in response.json():
                workspaces.append(Workspace(json=workspaceJSON))
            
        return workspaces
        
    def getProjects(self, workspace):
        """ Return all projects for the given workspace """
        url = "{0}/{1}/projects".format(self.baseUrl, workspace.id)
        response = self.requestHelper.get(url)
        
        projects = []
        if response.status_code == 200:
            for projectJSON in response.json():
                projects.append(Project(json=projectJSON))
            
        return projects
{'fraction_non_alphanumeric': 0.09266756635177688, 'fraction_numerical': 0.007197480881691408, 'mean_word_length': 2.1908177905308466, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1174381', 'n_tokens_mistral': 573, 'n_tokens_neox': 542, 'n_words': 147}