MCPcopy Create free account
hub / github.com/chinawithfrank/ChatBotCourse / Primes

Class Primes

lstm_code/nicodjimenez/test2.py:20–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 return diff
19
20class Primes:
21 def __init__(self):
22 self.primes = list()
23 for i in range(2, 100):
24 is_prime = True
25 for j in range(2, i-1):
26 if i % j == 0:
27 is_prime = False
28 if is_prime:
29 self.primes.append(i)
30 self.primes_count = len(self.primes)
31 def get_sample(self, x_dim, y_dim, index):
32 result = np.zeros((x_dim+y_dim))
33 for i in range(index, index + x_dim + y_dim):
34 result[i-index] = self.primes[i%self.primes_count]/100.0
35 return result
36
37
38def example_0():

Callers 1

example_0Function · 0.70

Calls

no outgoing calls

Tested by 1

example_0Function · 0.56