title: How to write many and similar python scripts at once?
body: <p>I need to have 100 of those similar python scripts that have <code>MyData</code> class from <code>MyData_1</code> to <code>MyData_100</code>.</p>
  <pre><code>import torch
  import numpy as np
  from torch_geometric.data import InMemoryDataset, Data
  from torch_geometric.utils import to_undirected
  
  class MyData_1(InMemoryDataset):
      def __init__(self, root, transform=None):
          super(MyData_1, self).__init__(root, transform)
          self.data, self.slices = torch.load(self.processed_paths[0])
  
      @property
      def raw_file_names(self):
          return &quot;mydata_1.npz&quot;
  
      @property
      def processed_file_names(self):
          return &quot;data_1.pt&quot;
  
      def process(self):
          raw_data = np.load(self.raw_paths[0])
          cluster_data = torch.load('./raw/total_clusters.pt')
          x = torch.from_numpy(raw_data['x'])
          y = torch.from_numpy(raw_data['y'])
          
          pos = torch.stack([x,y], dim=-1)
          cp = torch.from_numpy(raw_data['cp'])
  
          data_list = []
          for i in range(cp.size(0)):
              data = Data(x=cp[i].view(-1,1),pos=pos.view(-1,2),  cluster=cluster_data[0])
              data_list.append(data)
  
          torch.save(self.collate(data_list), self.processed_paths[0])
  </code></pre>
  <p>I'm trying to do this because each <code>MyData</code> class calls different <code>mydata_1,2,...100.npz</code> to generate dataset.
  Is there any way to make this fast?</p>
  <p>Thanks in advance!</p>