Beispiel #1
0
    def init_argparse(cls, ap) -> None:

        ap.add_argument(
            "content_type",
            choices=[t.get_name() for t in meta.get_all_content_types()],
            help="what kind of content to hash",
        )

        ap.add_argument(
            "--signal-type",
            "-S",
            choices=[t.get_name() for t in meta.get_all_signal_types()],
            help="only generate these signal types",
        )

        ap.add_argument(
            "--as-text",
            "-T",
            action="store_true",
            help=
            "force input to be interpreted as text instead of as filenames",
        )

        ap.add_argument(
            "content",
            nargs="+",
            help=("what to match against. Accepts filenames, "
                  "quoted strings, or '-' to read newline-separated stdin"),
        )
Beispiel #2
0
 def _apply_transformers(self, features: Features) -> Features:
     transformed = features
     for t in self.transformers:
         transformed = t.transform(transformed)
         transformed.validate()
         logging.info("Applied %s", t.get_name())
     return transformed
Beispiel #3
0
    def init_argparse(cls, ap) -> None:

        ap.add_argument(
            "content_type",
            choices=[t.get_name() for t in meta.get_all_content_types()],
            help="what kind of content to match",
        )

        ap.add_argument(
            "--hashes",
            "-H",
            action="store_true",
            help=(
                "instead of content (i.e. videos), "
                "input contains intermediate representations (i.e. video MD5s)"
            ),
        )

        ap.add_argument(
            "--as-text",
            "-T",
            action="store_true",
            help="force input to be interpreted as text instead of as filenames",
        )

        ap.add_argument(
            "content",
            nargs="+",
            help=(
                "what to match against. Accepts filenames, "
                "quoted strings, or '-' to read newline-separated stdin"
            ),
        )

        ap.add_argument(
            "--show-false-positives",
            action="store_true",
            help="show matches even if you've marked them false_positive",
        )

        ap.add_argument(
            "--hide-disputed",
            action="store_true",
            help="hide matches if someone has disputed them",
        )
Beispiel #4
0
 def _fit_transform(self, features: Features):
     transformed = features
     for t in self.transformers:
         transformed = t.fit_transform(transformed)
         logging.info("Trained %s", t.get_name())
     return transformed