Project

General

Profile

Bug #49968

Updated by Kefu Chai about 3 years ago

<pre><code class="python"> 
          def __get_diff_attrs(disk_days: Sequence[DevSmartT]) -> Tuple[AttrNamesT, AttrDiffsT]: 
         """ 
         Get 5 days differential attributes. 
         Args: 
             disk_days: Refer to function predict(...). 
         Returns: 
             attr_list: All S.M.A.R.T. attributes used in given disk. Here we 
                        use intersection set of all disk days. 
             diff_disk_days: A list struct comprises 5 dictionaries, each 
                             dictionary contains differential attributes. 
         Raises: 
             Exceptions of wrong list/dict operations. 
         """ 

         all_attrs = [set(disk_day.keys()) for disk_day in disk_days] 
         attr_list = list(set.intersection(*all_attrs)) 
         attr_list = list(disk_days[0].keys())     #      ----> According to the above document description, this line is redundant  
 </code></pre> 
    

Back