CloneSet51


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
30230.967stmt_list[5]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
13084
Bio/Pathway/Rep/Graph.py
23079
Bio/Pathway/Rep/MultiGraph.py
Clone Instance
1
Line Count
30
Source Line
84
Source File
Bio/Pathway/Rep/Graph.py

    def edges(self,label): 
        "Returns a list of all the edges with this label." 
        if label not in self.__label_map: 
             raise ValueError("Unknown label: "+str(label)) 
        return self.__label_map[label].list( ) 

    def labels(self): 
         "Returns a list of all the edge labels in this graph." 
         return self.__label_map.keys( ) 

    def nodes(self): 
         "Returns a list of the nodes in this graph." 
         return self.__adjacency_list.keys( ) 

    def parent_edges(self,child): 
        "Returns a list of (parent, label) pairs for child." 
        if child not in self.__adjacency_list: 
             raise ValueError("Unknown <child> node: "+str(child)) 
        parents = [ ] 
        for parent in self.__adjacency_list.keys( ):
                                                   
            children = self.__adjacency_list[parent] 
            for x in children.list( ):
                                     
                if x is child: 
                     parents.append((parent,self.__edge_map[(parent,child)])) 
                
        return parents 

    def parents(self,child): 
        "Returns a list of unique parents for child." 
        s = HashSet([x[0] for x in self.parent_edges(child)]) 
        return s.list( ) 


Clone Instance
2
Line Count
30
Source Line
79
Source File
Bio/Pathway/Rep/MultiGraph.py

    def edges(self,label): 
        "Returns a list of all the edges with this label." 
        if label not in self.__label_map: 
             raise ValueError("Unknown label: "+str(label)) 
        return self.__label_map[label].list( ) 

    def labels(self): 
         "Returns a list of all the edge labels in this graph." 
         return self.__label_map.keys( ) 

    def nodes(self): 
         "Returns a list of the nodes in this graph." 
         return self.__adjacency_list.keys( ) 

    def parent_edges(self,child): 
        "Returns a list of (parent, label) pairs for child." 
        if child not in self.__adjacency_list: 
             raise ValueError("Unknown <child> node: "+str(child)) 
        parents = [ ] 
        for parent in self.__adjacency_list.keys( ):
                                                   
            children = self.__adjacency_list[parent] 
            for x in children.list( ):
                                     
                if x[0] is child: 
                     parents.append((parent,x[1])) 
                
        return parents 

    def parents(self,child): 
        "Returns a list of unique parents for child." 
        s = HashSet([x[0] for x in self.parent_edges(child)]) 
        return s.list( ) 


Clone AbstractionParameter Count: 3Parameter Bindings

def edges(self,label):
  "Returns a list of all the edges with this label." 
  if label not in self.__label_map:
  
    raise ValueError("Unknown label: "+str(label)) 
  return self.__label_map[label].list( ) 

def labels(self):
  "Returns a list of all the edge labels in this graph." 
  return self.__label_map.keys( ) 

def nodes(self):
  "Returns a list of the nodes in this graph." 
  return self.__adjacency_list.keys( ) 

def parent_edges(self,child):
  "Returns a list of (parent, label) pairs for child." 
  if child not in self.__adjacency_list:
  
    raise ValueError("Unknown <child> node: "+str(child)) 
  parents = [ ] 
  for parent in self.__adjacency_list.keys( ):
  
    children = self.__adjacency_list[parent] 
    for x in children.list( ):
    
      if [[#variable315a8ea0]]is child:
      
        parents.append((parent, [[#variable5f9edde0]][ [[#variable19dc6ea0]]])) 
      
  return parents 

def parents(self,child):
  "Returns a list of unique parents for child." 
  s = HashSet([x[0] for x in self.parent_edges(child)]) 
  return s.list( ) 
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#315a8ea0]]
x[0] 
12[[#315a8ea0]]
x 
21[[#5f9edde0]]
x 
22[[#5f9edde0]]
self.__edge_map 
31[[#19dc6ea0]]
1 
32[[#19dc6ea0]]
(parent,child)