Code Duplication    Length = 23-23 lines in 2 locations

mandos/entries/entries.py 2 locations

@@ 502-524 (lines=23) @@
499
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
500
501
502
class EntryGeneralFunction(Entry[DrugbankGeneralFunctionSearch]):
503
    @classmethod
504
    def run(
505
        cls,
506
        path: Path = CommonArgs.compounds,
507
        key: str = EntryArgs.key("inter.drugbank:targ-fn"),
508
        as_of: Optional[str] = CommonArgs.as_of,
509
        to: Optional[Path] = CommonArgs.to_single,
510
        check: bool = EntryArgs.check,
511
        log: Optional[Path] = CommonArgs.log_path,
512
        quiet: bool = CommonArgs.quiet,
513
        verbose: bool = CommonArgs.verbose,
514
        no_setup: bool = CommonArgs.no_setup,
515
    ) -> Searcher:
516
        """
517
        General functions from DrugBank targets.
518
519
        OBJECT: Name of the general function (e.g. "Toxic substance binding")
520
521
        PREDICATE: "<target_type>:<action>"
522
        """
523
        built = DrugbankGeneralFunctionSearch(key, Apis.Pubchem, {DrugbankTargetType.target})
524
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
525
526
527
class EntryDrugbankTransporter(Entry[DrugbankTargetSearch]):
@@ 477-499 (lines=23) @@
474
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
475
476
477
class EntryDrugbankTarget(Entry[DrugbankTargetSearch]):
478
    @classmethod
479
    def run(
480
        cls,
481
        path: Path = CommonArgs.compounds,
482
        key: str = EntryArgs.key("inter.drugbank:targ"),
483
        as_of: Optional[str] = CommonArgs.as_of,
484
        to: Optional[Path] = CommonArgs.to_single,
485
        check: bool = EntryArgs.check,
486
        log: Optional[Path] = CommonArgs.log_path,
487
        quiet: bool = CommonArgs.quiet,
488
        verbose: bool = CommonArgs.verbose,
489
        no_setup: bool = CommonArgs.no_setup,
490
    ) -> Searcher:
491
        """
492
        Protein targets from DrugBank.
493
494
        OBJECT: Target name (e.g. "Solute carrier family 22 member 11") from DrugBank
495
496
        PREDICATE: "<target_type>:<action>"
497
        """
498
        built = DrugbankTargetSearch(key, Apis.Pubchem, {DrugbankTargetType.target})
499
        return cls._run(built, path, to, check, log, quiet, verbose, no_setup)
500
501
502
class EntryGeneralFunction(Entry[DrugbankGeneralFunctionSearch]):