9685df29213e5943d2774f80e21564f4204823ec,secuml/core/data/annotations.py,Annotations,get_annotated_ids,#Annotations#Any#Any#,155

Before Change


        return families_prop

    def get_annotated_ids(self, label="all", family=None):
        annotated_ids = [i for i in self.ids.get_ids() if self.is_annotated(i)]
        if label == MALICIOUS:
            annotated_ids = [i for i in annotated_ids if self.get_label(i)]
        elif label == BENIGN:
            annotated_ids = [i for i in annotated_ids if not self.get_label(i)]
        if family is not None:
            return [i for i in annotated_ids if self.get_family(i) == family]
        else:
            return annotated_ids

    def get_unlabeled_ids(self):

After Change



    def get_annotated_ids(self, label="all", family=None):
        if label == "all":
            mask = self.labels != None  // NOQA: 711
        else:
            mask = self.labels == label_str_to_bool(label)
        if family is not None:
            family_mask = self.families == family
            mask = np.logical_and(mask, family_mask)
        return self.ids.ids[mask]

    def get_unlabeled_ids(self):
        return self.ids.ids[self.labels == None]  // NOQA: 711
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: ANSSI-FR/SecuML
Commit Name: 9685df29213e5943d2774f80e21564f4204823ec
Time: 2019-09-03
Author: anael.beaugnon@ssi.gouv.fr
File Name: secuml/core/data/annotations.py
Class Name: Annotations
Method Name: get_annotated_ids


Project Name: ANSSI-FR/SecuML
Commit Name: 9685df29213e5943d2774f80e21564f4204823ec
Time: 2019-09-03
Author: anael.beaugnon@ssi.gouv.fr
File Name: secuml/core/data/annotations.py
Class Name: Annotations
Method Name: get_family_ids


Project Name: ANSSI-FR/SecuML
Commit Name: 9685df29213e5943d2774f80e21564f4204823ec
Time: 2019-09-03
Author: anael.beaugnon@ssi.gouv.fr
File Name: secuml/core/data/annotations.py
Class Name: Annotations
Method Name: get_unlabeled_ids