def random_func(lib, opts, args):
 query = decargs(args)
 if opts.album:
  objs = list(lib.albums(query))
 else:
  objs = list(lib.items(query))
 objs = random_objs(objs, opts.album, opts.number, opts.time, opts.equal_chance)
 for obj in objs:
  print_(format(obj))

def random_func ( lib , opts , args ) : query = decargs ( args ) if opts . album : objs = list ( lib . albums ( query ) ) else : objs = list ( lib . items ( query ) ) objs = random_objs ( objs , opts . album , opts . number , opts . time , opts . equal_chance ) for obj in objs : print_ ( format ( obj ) )
select some random items or albums and print the results .