Method chaining

Hi everyone- this is my first post here :slight_smile:

I don’t know if I am asking in correct category because I think its rather python understanding problem.
I’ve read https://docs.fast.ai/data_block.html but still I’m still not so sure. Going into the problem: I was doing lesson 3 and I have some problems understanding how does this line of code works:

data = (PointsItemList.from_folder(path)
        .split_by_valid_func(lambda o: o.parent.name=='13')
        .label_from_func(get_ctr)
        .transform(get_transforms(), tfm_y=True, size=(120,160))
        .databunch().normalize(imagenet_stats)
       )

I was looking in the source code and found the fallowing:
PointsItemList inherits from ImageList #fastai/vision/data.py line 410
ImageList has classmethod from_folder #fastai/vision/data.py line 103

ImageListinherits from ItemList #fastai/vision/data.py line 256
Then method split_by_valid_func is called #fastai/data_block.py line 235
and method label_from_func #fastai/data_block.py line 295

After that method transform is used but I can’t find source of that method… Some code is in ItemLists #/fastai/data_block.py line 499 but I don’t see any inheritance from PointsItemList, ImageList and ItemList.
Dose it comes from torchvision import transforms as tvt? # from torchvision import transforms as tvt in fastai/vision/data.py line 9

Then methods databunch and normalize are called but i don’t know where theirs source is.

Besides, are those parenthesis needed? “(” and “)” at the beginning and end? or are they just decorative?

Is

data = (PointsItemList.from_folder(path)
        .split_by_valid_func(lambda o: o.parent.name=='13')
        .label_from_func(get_ctr)
        .transform(get_transforms(), tfm_y=True, size=(120,160))
        .databunch().normalize(imagenet_stats)
       )

equiwalent to writting:

data = PointsItemList.from_folder(path)
data = data.split_by_valid_func(lambda o: o.parent.name==‘13’)
data = data.label_from_func(get_ctr)
data = data.transform(get_transforms(), tfm_y=True, size=(120,160))
data = data.databunch()
data = data.normalize(imagenet_stats)

By method chaining? So data is overwritten after performing each step?
In that case are transform, databunch and normalize some global methods?