Пример #1
0
"""Combine multiple popular python security tools...

and generate reports or output into different formats.
"""
from __future__ import annotations

import argparse
from sys import exit as sysexit, stdout
from typing import Any

import simplesecurity.filter as secfilter
import simplesecurity.formatter as formatter
import simplesecurity.plugins as plugins
from simplesecurity.types import Finding

stdout.reconfigure(encoding="utf-8")
FORMAT_HELP = "Output format. One of ansi, json, markdown, csv. default=ansi"
PLUGIN_HELP = "Plugin to use. One of bandit, safety, dodgy, dlint, semgrep, all, default=all"


def runAllPlugins(pluginMap: dict[str, Any], severity: int, confidence: int,
                  fast: bool) -> list[Finding]:
    """Run each plugin. Optimise as much as we can.

	Args:
		pluginMap (dict[str, Any]): the plugin map
		severity (int): the minimum severity to report on
		confidence (int): the minimum confidence to report on
		fast (bool): runAllPlugins with optimisations

	Returns:
Пример #2
0
    def Time(self):
        a = Application.Validate(self)
        tz = a[1]
        t = a[0].split('T')
        t = t[1].split('.')
        t = t[0].split(':')
        hour, minn = t[0], t[1]
        print(
              f'{chr(9193)*3} "{self.region}" right now{chr(9200)} {chr(9194)*3}\n',
              sep='\n',
              end='\n'
              )
        return f'{hour}:{minn}'

from sys import stdout
stdout.reconfigure(encoding='utf-16')

app = Application(inp)

timey = app.Time()

zero,one,two,three,four,five,six,seven,eight,nine,m,a,p,sep = [[0,1,1,1,0],[1,0,0,0,1],[1,0,0,0,1],[1,0,0,0,1],[1,0,0,0,1],[0,1,1,1,0]],[[0,0,1,0,0],[0,1,1,0,0],[1,0,1,0,0],[0,0,1,0,0],[0,0,1,0,0],[1,1,1,1,1]],[[0,1,1,1,0],[1,0,0,0,1],[0,0,0,1,0],[0,0,1,0,0],[0,1,0,0,0],[1,1,1,1,1]],[[1,1,1,1,0],[0,0,0,0,1],[1,1,1,1,1],[0,0,0,0,1],[0,0,0,0,1],[1,1,1,1,0]],[[1,0,0,0,0],[1,0,0,0,0],[1,0,1,0,0],[1,1,1,1,1],[0,0,1,0,0],[0,0,1,0,0]],[[1,1,1,1,1],[1,0,0,0,0],[1,0,0,0,0],[1,1,1,1,1],[0,0,0,0,1],[1,1,1,1,1]],[[0,1,1,1,0],[1,0,0,0,0],[1,0,0,0,0],[1,1,1,1,0],[1,0,0,0,1],[0,1,1,1,0]],[[1,1,1,1,0],[0,0,0,0,1],[0,0,0,0,1],[0,0,0,0,1],[0,0,0,0,1],[0,0,0,0,1]],[[0,1,1,1,0],[1,0,0,0,1],[1,1,1,1,1],[1,0,0,0,1],[1,0,0,0,1],[0,1,1,1,0]],[[0,1,1,1,0],[1,0,0,0,1],[0,1,1,1,1],[0,0,0,0,1],[0,0,0,0,1],[0,1,1,1,0]],[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[1,1,0,1,1],[1,0,1,0,1],[1,0,0,0,1],[1,0,0,0,1]],[[0,0,0,0,0],[0,0,0,0,0],[0,1,1,0,0],[1,0,0,1,0],[1,1,1,1,0],[1,0,0,1,0]],[[0,0,0,0,0],[1,1,1,1,0],[1,0,0,1,0],[1,1,1,1,0],[1,0,0,0,0],[1,0,0,0,0]],[[0,0,0,0,0],[0,0,2,0,0],[0,0,2,0,0],[0,0,0,0,0],[0,0,2,0,0],[0,0,2,0,0]]

digdict_ = {str(i):v for i,v in enumerate([zero,one,two,three,four,five,six,seven,eight,nine])}
alpdict_ = {'a':a,'m':m,'p':p,':':sep}
all_dict = {**digdict_,**alpdict_}

for i in range(6):
    for time in timey:
        for col in all_dict[time][i]:
           if col == 0: