code: def removeDepartment(self, dep):
          
          if api.is_uid(dep):
              dep = api.get_object_by_uid(dep)
          deps = self.getDepartments()
          if dep not in deps:
              return False
          deps.remove(dep)
          self.setDepartments(deps)
          return True
docs: Removes a department
  
          :param dep: UID or department object
          :returns: True when the department was removed