code: def test_overfit_basic(tmpdir, overfit_batches):
      """Tests that only training_step can be used when overfitting."""
      model = BoringModel()
      model.validation_step = None
      total_train_samples = len(BoringModel().train_dataloader())
  
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=1,
          overfit_batches=overfit_batches,
          enable_model_summary=False,
      )
      trainer.fit(model)
  
      assert trainer.num_val_batches == []
      assert trainer.num_training_batches == int(
          overfit_batches
          * (
              1
              if isinstance(overfit_batches, int)
              else total_train_samples
          )
      )
  
file_path: pytorch-lightning/tests/tests_pytorch/trainer/flags/test_overfit_batches.py
imports: import os
  from unittest import mock
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset
  from lightning.pytorch.trainer.states import RunningStage
  from torch.utils.data import DataLoader, DistributedSampler, RandomSampler, Sampler, SequentialSampler
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.datasets import SklearnDataset
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
label_desc: Use image node_id 1 for calling a global function with example usage: test_overfit_basic(tmpdir, overfit_batches) without return types