def snapshot_in_progress(client, repository=None, snapshot=None):
 allsnaps = get_snapshot_data(client, repository=repository)
 inprogress = [snap['snapshot'] for snap in allsnaps if (('state' in snap.keys()) and (snap['state'] == 'IN_PROGRESS'))]
 if snapshot:
  return (snapshot if (snapshot in inprogress) else False)
 elif (len(inprogress) == 0):
  return False
 elif (len(inprogress) == 1):
  return inprogress[0]
 else:
  raise CuratorException('More than 1 snapshot in progress: {0}'.format(inprogress))

def snapshot_in_progress ( client , repository = None , snapshot = None ) : allsnaps = get_snapshot_data ( client , repository = repository ) inprogress = [ snap [ 'snapshot' ] for snap in allsnaps if ( ( 'state' in snap . keys ( ) ) and ( snap [ 'state' ] == 'IN_PROGRESS' ) ) ] if snapshot : return ( snapshot if ( snapshot in inprogress ) else False ) elif ( len ( inprogress ) == 0 ) : return False elif ( len ( inprogress ) == 1 ) : return inprogress [ 0 ] else : raise CuratorException ( 'More than 1 snapshot in progress: {0}' . format ( inprogress ) )
determine whether the provided snapshot in repository is in_progress .