<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_to_generate_or_run(argv, sim):
 """ Useful method for calling in main method after network and simulation are generated, to handle some standard export options like -jnml, -graph etc. """

    
    print_v("Checking arguments: %s to see whether anything should be run in simulation %s (net: %s)..." % 
               (argv, sim.id, sim.network))
    
    if len(argv)==1:
        print_v("No arguments found. Currently supported export formats:")
        print_v("   -nml |  -nmlh5 | -jnml | -jnmlnrn | -jnmlnetpyne | -netpyne | -pynnnrn "+\
                "| -pynnnest | -pynnbrian | -pynnneuroml | -sonata | -matrix[1-2] | -graph[1-6 n/d/f/c]")
        
    if '-pynnnest' in argv:
        generate_and_run(sim, simulator='PyNN_NEST')

    elif '-pynnnrn' in argv:
        generate_and_run(sim, simulator='PyNN_NEURON')

    elif '-pynnbrian' in argv:
        generate_and_run(sim, simulator='PyNN_Brian')

    elif '-jnml' in argv:
        generate_and_run(sim, simulator='jNeuroML')

    elif '-jnmlnrn' in argv:
        generate_and_run(sim, simulator='jNeuroML_NEURON')

    elif '-netpyne' in argv:
        generate_and_run(sim, simulator='NetPyNE')

    elif '-pynnneuroml' in argv:
        generate_and_run(sim, simulator='PyNN_NeuroML')

    elif '-sonata' in argv:
        generate_and_run(sim, simulator='sonata')
        
    elif '-nml' in argv or '-neuroml' in argv:
        
        network = load_network_json(sim.network)
        generate_neuroml2_from_network(network, validate=True)
        
    elif '-nmlh5' in argv or '-neuromlh5' in argv:
        
        network = load_network_json(sim.network)
        generate_neuroml2_from_network(network, validate=True, format='hdf5')
        
    else:
        for a in argv:
            
            if '-jnmlnetpyne' in a:
                num_processors = 1
                if len(a)>len('-jnmlnetpyne'):
                    num_processors = int(a[12:])
                generate_and_run(sim, simulator='jNeuroML_NetPyNE',num_processors=num_processors)
            elif 'graph' in a: # e.g. -graph3c
                generate_and_run(sim, simulator=a[1:]) # Will not "run" obviously...
            elif 'matrix' in a: # e.g. -matrix2
                generate_and_run(sim, simulator=a[1:])