MCPcopy Create free account
hub / github.com/brain-workshop/brainworkshop / load_set

Method load_set

brainworkshop.py:2515–2525  ·  view source on GitHub ↗
(self, index=None)

Source from the content-addressed store, hash-verified

2513 self.load_set()
2514
2515 def load_set(self, index=None):
2516 if type(index) == int:
2517 index = cfg.IMAGE_SETS[index]
2518 if index == None:
2519 index = random.choice(cfg.IMAGE_SETS)
2520 if hasattr(self, 'image_set_index') and index == self.image_set_index:
2521 return
2522 self.image_set_index = index
2523 self.image_set = [pyglet.sprite.Sprite(pyglet.image.load(path))
2524 for path in resourcepaths['sprites'][index]]
2525 self.image_set_size = self.image_set[0].width
2526
2527 def choose_random_images(self, number):
2528 self.image_indices = random.sample(range(len(self.image_set)), number)

Callers 2

__init__Method · 0.95
new_sessionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected