
from pymisp import PyMISP
from keys import misp_url, misp_key, misp_verifycert
import argparse
import tools

def init(url, key):
    return PyMISP(url, key, misp_verifycert, 'json')

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Create a given number of event containing a given number of attributes eachh.')
    parser.add_argument("-l", "--limit", type=int, help="Number of events to create (default 1)")
    parser.add_argument("-a", "--attribute", type=int, help="Number of attributes per event (default 3000)")
    args = parser.parse_args()

    misp = init(misp_url, misp_key)

    if args.limit is None:
        args.limit = 1
    if args.attribute is None:
        args.attribute = 3000

    for i in range(args.limit):
        tools.create_massive_dummy_events(misp, args.attribute)


from pymisp import PyMISP
from keys import url, key
import argparse
import tools


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Create a given number of event containing a given number of attributes eachh.')
    parser.add_argument("-l", "--limit", type=int, help="Number of events to create (default 1)")
    parser.add_argument("-a", "--attribute", type=int, help="Number of attributes per event (default 3000)")
    args = parser.parse_args()

    misp = PyMISP(url, key, True, 'json')

    if args.limit is None:
        args.limit = 1
    if args.attribute is None:
        args.attribute = 3000

    for i in range(args.limit):
        tools.create_massive_dummy_events(misp, args.attribute)

Use same variable names as testing environment
Use same variable names as testing environment

  
  from pymisp import PyMISP
- from keys import misp_url, misp_key, misp_verifycert
+ from keys import url, key
  import argparse
  import tools
  
- def init(url, key):
-     return PyMISP(url, key, misp_verifycert, 'json')
  
  if __name__ == '__main__':
      parser = argparse.ArgumentParser(description='Create a given number of event containing a given number of attributes eachh.')
      parser.add_argument("-l", "--limit", type=int, help="Number of events to create (default 1)")
      parser.add_argument("-a", "--attribute", type=int, help="Number of attributes per event (default 3000)")
      args = parser.parse_args()
  
-     misp = init(misp_url, misp_key)
+     misp = PyMISP(url, key, True, 'json')
  
      if args.limit is None:
          args.limit = 1
      if args.attribute is None:
          args.attribute = 3000
  
      for i in range(args.limit):
          tools.create_massive_dummy_events(misp, args.attribute)
  
Use same variable names as testing environment
## Code Before:

from pymisp import PyMISP
from keys import misp_url, misp_key, misp_verifycert
import argparse
import tools

def init(url, key):
    return PyMISP(url, key, misp_verifycert, 'json')

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Create a given number of event containing a given number of attributes eachh.')
    parser.add_argument("-l", "--limit", type=int, help="Number of events to create (default 1)")
    parser.add_argument("-a", "--attribute", type=int, help="Number of attributes per event (default 3000)")
    args = parser.parse_args()

    misp = init(misp_url, misp_key)

    if args.limit is None:
        args.limit = 1
    if args.attribute is None:
        args.attribute = 3000

    for i in range(args.limit):
        tools.create_massive_dummy_events(misp, args.attribute)

## Instruction:
Use same variable names as testing environment
## Code After:

from pymisp import PyMISP
from keys import url, key
import argparse
import tools


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Create a given number of event containing a given number of attributes eachh.')
    parser.add_argument("-l", "--limit", type=int, help="Number of events to create (default 1)")
    parser.add_argument("-a", "--attribute", type=int, help="Number of attributes per event (default 3000)")
    args = parser.parse_args()

    misp = PyMISP(url, key, True, 'json')

    if args.limit is None:
        args.limit = 1
    if args.attribute is None:
        args.attribute = 3000

    for i in range(args.limit):
        tools.create_massive_dummy_events(misp, args.attribute)
