original_docstring: set max atom number equals to 100
docstring: set max atom number equals to 100
docstring_tokens: set max atom number equals to 100
code: def smile_to_graph(smile):
      """set max atom number equals to 100"""
      mol = Chem.MolFromSmiles(smile)
      c_size = mol.GetNumAtoms()
      #features = np.empty([c_size, 78])
      mask = [0] * 100
      features = np.zeros([100, 78])
      for i, atom in enumerate(mol.GetAtoms()):
          if atom.GetAtomicNum == 0:
              return None
          
          feature = atom_features(atom)
          features[i, :] = feature / sum(feature)
          mask[i] = 1
          
      edges = []
      for bond in mol.GetBonds():
          i = bond.GetBeginAtomIdx()
          j = bond.GetEndAtomIdx()
          edges.append((i, j))
          edges.append((j, i))
      #g = nx.Graph(edges).to_directed()
      
      
      g = pgl.Graph(num_nodes=100,
                edges=edges,
                node_feat={'node_feat':features})
      
      return g, mask
code_tokens: def smile_to_graph ( smile ) : mol = Chem . MolFromSmiles ( smile ) c_size = mol . GetNumAtoms ( ) mask = [ 0 ] * 100 features = np . zeros ( [ 100 , 78 ] ) for i , atom in enumerate ( mol . GetAtoms ( ) ) : if atom . GetAtomicNum == 0 : return None feature = atom_features ( atom ) features [ i , : ] = feature / sum ( feature ) mask [ i ] = 1 edges = [ ] for bond in mol . GetBonds ( ) : i = bond . GetBeginAtomIdx ( ) j = bond . GetEndAtomIdx ( ) edges . append ( ( i , j ) ) edges . append ( ( j , i ) ) g = pgl . Graph ( num_nodes = 100 , edges = edges , node_feat = { 'node_feat' : features } ) return g , mask
short_docstring: set max atom number equals to 100
short_docstring_tokens: set max atom number equals to 100
comment: """set max atom number equals to 100"""$SEP$#features = np.empty([c_size, 78])$SEP$#g = nx.Graph(edges).to_directed()