def get_scheduler_lock(get=None, collection=None):
 actual_get = effective_get(get, collection)
 if (actual_get == multiprocessing.get):
  return mp.Manager().Lock()
 return SerializableLock()

def get_scheduler_lock ( get = None , collection = None ) : actual_get = effective_get ( get , collection ) if ( actual_get == multiprocessing . get ) : return mp . Manager ( ) . Lock ( ) return SerializableLock ( )
get an instance of the appropriate lock for a certain situation based on scheduler used .