Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
requests.packages.urllib3.disable_warnings()
verify = False
elif os.path.isfile(cafile):
#
# User specified a cafile for trusted certificate
#
verify = cafile
except:
verify = True
args = {"base_url": url,
"verify": verify,
"org_name": org}
resilient_client = resilient.SimpleClient(**args)
session = resilient_client.connect(email, password)
max_count = None
if opt_parser.getopt(MACHINE_LEARNING_SECTION, "max_count"):
max_count = int(opt_parser.getopt(MACHINE_LEARNING_SECTION, "max_count"))
time_start = opt_parser.getopt(MACHINE_LEARNING_SECTION, "time_start")
time_end = opt_parser.getopt(MACHINE_LEARNING_SECTION, "time_end")
res_filter = IncidentTimeFilter(time_start=time_start,
time_end=time_end,
in_log=LOG)
# get_incidents is going to download all the incidents using this resilient_client
# The optional max_count controls how many samples to process. The conversion from
# json to CSV will stop once reaches this limit.
num_inc = resilient_utils.get_incidents(res_client=resilient_client,
filename=csv_file,