max_stars_repo_path
stringlengths 4
237
| max_stars_repo_name
stringlengths 6
117
| max_stars_count
int64 0
95.2k
| id
stringlengths 1
7
| content
stringlengths 12
593k
| input_ids
sequencelengths 7
549k
|
---|---|---|---|---|---|
src/classes.py | gartunius/PygameSnakeOOP | 0 | 125029 | #!/pygame_snake_oop/bin python
import pygame
from random import randint
from time import sleep
class Snake():
def __init__(self, screen_width, screen_height):
self.snake_ate = 0
self.snake_life = 'alive'
self.snake_direction = 'rigth'
self.snake_body = [[10, 30], [10, 20], [10, 10]]
self.snake_color = (255, 255, 255)
# [y, x]
self.screen_width = screen_width
self.screen_height = screen_height
def snake_walk(self, new_direction, speed, foodx, foody):
snake_head = self.snake_body[0]
old_snake_head = snake_head
def pop_snake():
if self.snake_ate == 0:
self.snake_body.pop()
new_direction == self.snake_direction
if new_direction == 'rigth' and self.snake_direction != 'left':
self.snake_direction = 'rigth'
if snake_head[1] == self.screen_width:
self.snake_body.insert(0, [snake_head[0], 0])
else:
self.snake_body.insert(0, [snake_head[0], snake_head[1] + 10])
pop_snake()
elif new_direction == 'left' and self.snake_direction != 'rigth':
self.snake_direction = 'left'
if snake_head[1] == 0:
self.snake_body.insert(0, [snake_head[0], self.screen_width])
else:
self.snake_body.insert(0, [snake_head[0], snake_head[1] - 10])
pop_snake()
elif new_direction == 'up' and self.snake_direction != 'down':
self.snake_direction = 'up'
if snake_head[0] == 0:
self.snake_body.insert(0, [self.screen_height, snake_head[1]])
else:
self.snake_body.insert(0, [snake_head[0] - 10, snake_head[1]])
pop_snake()
elif new_direction == 'down' and self.snake_direction != 'up':
self.snake_direction = 'down'
if snake_head[0] == self.screen_height:
self.snake_body.insert(0, [0, snake_head[1]])
else:
self.snake_body.insert(0, [snake_head[0] + 10, snake_head[1]])
pop_snake()
self.snake_ate = 0
print('\nfood:x={}y={}\nspeed:{}\nsnake:{}\nlength:{}\nmoving {}\nfrom:{}\nto:{}\n'.format(
foodx, foody, speed, self.snake_body, len(self.snake_body), new_direction, old_snake_head, self.snake_body[0]))
def is_snake_dead(self):
body = self.snake_body
if body[len(body) - 1] in body[:len(body) - 2]:
self.snake_life = 'dead'
def did_snake_ate(self, food_coords):
if self.snake_body[0][0] == food_coords[0] and self.snake_body[0][1] == food_coords[1]:
self.snake_ate = 1
class Food():
def __init__(self, screen_width, screen_height):
self.screen_width = screen_width
self.screen_height = screen_height
self.food_color = (255, 0, 0)
self.x_coord = 20
self.y_coord = 20
def generate_new_food(self):
tmp_x_coord = randint(1, self.screen_height / 10)
tmp_y_coord = randint(1, self.screen_width / 10)
tmp_x_coord = str(tmp_x_coord) + '0'
tmp_y_coord = str(tmp_y_coord) + '0'
self.x_coord = int(tmp_x_coord)
self.y_coord = int(tmp_y_coord)
class Screen():
def __init__(self, display_width, display_heigth):
self.display_width = display_width
self.display_heigth = display_heigth
pygame.init()
self.screen = pygame.display.set_mode((display_width, display_heigth))
self.clock = pygame.time.Clock()
self.game_speed = .3
self.snake = Snake(display_width, display_heigth)
self.food = Food(display_width, display_heigth)
self.finished = False
def bootstrap(self):
def snake_movement(pygame_events):
for event in pygame_events:
if event.type == pygame.QUIT or self.snake.snake_life == 'dead':
self.finished = True
pygame.quit()
break
if event.type == pygame.KEYDOWN:
print(self.snake.snake_body)
if event.key == pygame.K_LEFT:
self.snake.snake_walk('left', self.game_speed, self.food.x_coord, self.food.y_coord)
elif event.key == pygame.K_RIGHT:
self.snake.snake_walk('rigth', self.game_speed, self.food.x_coord, self.food.y_coord)
elif event.key == pygame.K_UP:
self.snake.snake_walk('up', self.game_speed, self.food.x_coord, self.food.y_coord)
elif event.key == pygame.K_DOWN:
self.snake.snake_walk('down', self.game_speed, self.food.x_coord, self.food.y_coord)
else:
self.snake.snake_walk(self.snake.snake_direction, self.game_speed, self.food.x_coord, self.food.y_coord)
while not self.finished:
self.clock.tick(60)
self.screen.fill((0, 0, 0))
self.draw_snake()
self.draw_food()
self.snake.did_snake_ate([self.food.y_coord, self.food.x_coord])
self.snake.is_snake_dead()
if self.snake.snake_ate == 1:
self.game_speed -= 0.001
self.food.generate_new_food()
snake_movement(pygame.event.get())
pygame.display.update()
sleep(self.game_speed)
def draw_snake(self):
for snake_body_part in self.snake.snake_body:
y_coord = snake_body_part[0]
x_coord = snake_body_part[1]
pygame.draw.rect(self.screen, self.snake.snake_color, pygame.Rect(x_coord, y_coord, 10, 10))
def draw_food(self):
pygame.draw.rect(self.screen, self.food.food_color, pygame.Rect(self.food.x_coord, self.food.y_coord, 10, 10))
| [
1,
18787,
2272,
11802,
29918,
29879,
21040,
29918,
26793,
29914,
2109,
3017,
13,
13,
5215,
22028,
13,
13,
3166,
4036,
1053,
20088,
524,
13,
3166,
931,
1053,
8709,
13,
13,
13,
1990,
317,
21040,
7295,
13,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
4315,
29918,
2103,
29892,
4315,
29918,
3545,
1125,
13,
12,
12,
1311,
29889,
29879,
21040,
29918,
403,
353,
29871,
29900,
13,
12,
12,
1311,
29889,
29879,
21040,
29918,
19264,
353,
525,
284,
573,
29915,
13,
12,
12,
1311,
29889,
29879,
21040,
29918,
20845,
353,
525,
8966,
386,
29915,
13,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
353,
5519,
29896,
29900,
29892,
29871,
29941,
29900,
1402,
518,
29896,
29900,
29892,
29871,
29906,
29900,
1402,
518,
29896,
29900,
29892,
29871,
29896,
29900,
5262,
13,
12,
12,
1311,
29889,
29879,
21040,
29918,
2780,
353,
313,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
29897,
13,
12,
12,
29937,
518,
29891,
29892,
921,
29962,
13,
13,
12,
12,
1311,
29889,
10525,
29918,
2103,
353,
4315,
29918,
2103,
13,
12,
12,
1311,
29889,
10525,
29918,
3545,
353,
4315,
29918,
3545,
13,
13,
12,
1753,
269,
21040,
29918,
20919,
29898,
1311,
29892,
716,
29918,
20845,
29892,
6210,
29892,
9687,
29916,
29892,
1701,
1486,
1125,
13,
12,
12,
29879,
21040,
29918,
2813,
353,
1583,
29889,
29879,
21040,
29918,
2587,
29961,
29900,
29962,
13,
12,
12,
1025,
29918,
29879,
21040,
29918,
2813,
353,
269,
21040,
29918,
2813,
13,
13,
12,
12,
1753,
1835,
29918,
29879,
21040,
7295,
13,
12,
12,
12,
361,
1583,
29889,
29879,
21040,
29918,
403,
1275,
29871,
29900,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
29889,
7323,
580,
13,
12,
12,
12,
12,
1482,
29918,
20845,
1275,
1583,
29889,
29879,
21040,
29918,
20845,
13,
13,
12,
12,
361,
716,
29918,
20845,
1275,
525,
8966,
386,
29915,
322,
1583,
29889,
29879,
21040,
29918,
20845,
2804,
525,
1563,
2396,
13,
13,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
20845,
353,
525,
8966,
386,
29915,
13,
13,
12,
12,
12,
361,
269,
21040,
29918,
2813,
29961,
29896,
29962,
1275,
1583,
29889,
10525,
29918,
2103,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
29889,
7851,
29898,
29900,
29892,
518,
29879,
21040,
29918,
2813,
29961,
29900,
1402,
29871,
29900,
2314,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
29889,
7851,
29898,
29900,
29892,
518,
29879,
21040,
29918,
2813,
29961,
29900,
1402,
269,
21040,
29918,
2813,
29961,
29896,
29962,
718,
29871,
29896,
29900,
2314,
13,
13,
12,
12,
12,
7323,
29918,
29879,
21040,
580,
13,
13,
12,
12,
23681,
716,
29918,
20845,
1275,
525,
1563,
29915,
322,
1583,
29889,
29879,
21040,
29918,
20845,
2804,
525,
8966,
386,
2396,
13,
13,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
20845,
353,
525,
1563,
29915,
13,
13,
12,
12,
12,
361,
269,
21040,
29918,
2813,
29961,
29896,
29962,
1275,
29871,
29900,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
29889,
7851,
29898,
29900,
29892,
518,
29879,
21040,
29918,
2813,
29961,
29900,
1402,
1583,
29889,
10525,
29918,
2103,
2314,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
29889,
7851,
29898,
29900,
29892,
518,
29879,
21040,
29918,
2813,
29961,
29900,
1402,
269,
21040,
29918,
2813,
29961,
29896,
29962,
448,
29871,
29896,
29900,
2314,
13,
13,
12,
12,
12,
7323,
29918,
29879,
21040,
580,
13,
13,
12,
12,
23681,
716,
29918,
20845,
1275,
525,
786,
29915,
322,
1583,
29889,
29879,
21040,
29918,
20845,
2804,
525,
3204,
2396,
13,
13,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
20845,
353,
525,
786,
29915,
13,
13,
12,
12,
12,
361,
269,
21040,
29918,
2813,
29961,
29900,
29962,
1275,
29871,
29900,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
29889,
7851,
29898,
29900,
29892,
518,
1311,
29889,
10525,
29918,
3545,
29892,
269,
21040,
29918,
2813,
29961,
29896,
24960,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
29889,
7851,
29898,
29900,
29892,
518,
29879,
21040,
29918,
2813,
29961,
29900,
29962,
448,
29871,
29896,
29900,
29892,
269,
21040,
29918,
2813,
29961,
29896,
24960,
13,
13,
12,
12,
12,
7323,
29918,
29879,
21040,
580,
13,
13,
12,
12,
23681,
716,
29918,
20845,
1275,
525,
3204,
29915,
322,
1583,
29889,
29879,
21040,
29918,
20845,
2804,
525,
786,
2396,
13,
13,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
20845,
353,
525,
3204,
29915,
13,
13,
12,
12,
12,
361,
269,
21040,
29918,
2813,
29961,
29900,
29962,
1275,
1583,
29889,
10525,
29918,
3545,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
29889,
7851,
29898,
29900,
29892,
518,
29900,
29892,
269,
21040,
29918,
2813,
29961,
29896,
24960,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
2587,
29889,
7851,
29898,
29900,
29892,
518,
29879,
21040,
29918,
2813,
29961,
29900,
29962,
718,
29871,
29896,
29900,
29892,
269,
21040,
29918,
2813,
29961,
29896,
24960,
13,
13,
12,
12,
12,
7323,
29918,
29879,
21040,
580,
13,
13,
12,
12,
1311,
29889,
29879,
21040,
29918,
403,
353,
29871,
29900,
13,
13,
12,
12,
2158,
28909,
29876,
1181,
397,
29901,
29916,
3790,
29913,
29891,
3790,
1012,
1983,
412,
287,
26254,
1012,
1983,
21040,
26254,
1012,
29876,
2848,
26254,
1012,
29876,
13529,
292,
426,
1012,
29876,
3166,
26254,
1012,
29876,
517,
26254,
1012,
29876,
4286,
4830,
29898,
13,
12,
12,
12,
1181,
397,
29916,
29892,
1701,
1486,
29892,
6210,
29892,
1583,
29889,
29879,
21040,
29918,
2587,
29892,
7431,
29898,
1311,
29889,
29879,
21040,
29918,
2587,
511,
716,
29918,
20845,
29892,
2030,
29918,
29879,
21040,
29918,
2813,
29892,
1583,
29889,
29879,
21040,
29918,
2587,
29961,
29900,
12622,
13,
13,
12,
1753,
338,
29918,
29879,
21040,
29918,
311,
328,
29898,
1311,
1125,
13,
12,
12,
2587,
353,
1583,
29889,
29879,
21040,
29918,
2587,
13,
12,
12,
361,
3573,
29961,
2435,
29898,
2587,
29897,
448,
29871,
29896,
29962,
297,
3573,
7503,
2435,
29898,
2587,
29897,
448,
29871,
29906,
5387,
13,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
19264,
353,
525,
311,
328,
29915,
13,
13,
12,
1753,
1258,
29918,
29879,
21040,
29918,
403,
29898,
1311,
29892,
9687,
29918,
1111,
4339,
1125,
13,
12,
12,
361,
1583,
29889,
29879,
21040,
29918,
2587,
29961,
29900,
3816,
29900,
29962,
1275,
9687,
29918,
1111,
4339,
29961,
29900,
29962,
322,
1583,
29889,
29879,
21040,
29918,
2587,
29961,
29900,
3816,
29896,
29962,
1275,
9687,
29918,
1111,
4339,
29961,
29896,
5387,
13,
12,
12,
12,
1311,
29889,
29879,
21040,
29918,
403,
353,
29871,
29896,
13,
13,
13,
1990,
25453,
7295,
13,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
4315,
29918,
2103,
29892,
4315,
29918,
3545,
1125,
13,
12,
12,
1311,
29889,
10525,
29918,
2103,
353,
4315,
29918,
2103,
13,
12,
12,
1311,
29889,
10525,
29918,
3545,
353,
4315,
29918,
3545,
13,
12,
12,
1311,
29889,
1181,
397,
29918,
2780,
353,
313,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
12,
12,
1311,
29889,
29916,
29918,
1111,
536,
353,
29871,
29906,
29900,
13,
12,
12,
1311,
29889,
29891,
29918,
1111,
536,
353,
29871,
29906,
29900,
13,
13,
12,
1753,
5706,
29918,
1482,
29918,
1181,
397,
29898,
1311,
1125,
13,
12,
12,
7050,
29918,
29916,
29918,
1111,
536,
353,
20088,
524,
29898,
29896,
29892,
1583,
29889,
10525,
29918,
3545,
847,
29871,
29896,
29900,
29897,
13,
12,
12,
7050,
29918,
29891,
29918,
1111,
536,
353,
20088,
524,
29898,
29896,
29892,
1583,
29889,
10525,
29918,
2103,
847,
29871,
29896,
29900,
29897,
13,
13,
12,
12,
7050,
29918,
29916,
29918,
1111,
536,
353,
851,
29898,
7050,
29918,
29916,
29918,
1111,
536,
29897,
718,
525,
29900,
29915,
13,
12,
12,
7050,
29918,
29891,
29918,
1111,
536,
353,
851,
29898,
7050,
29918,
29891,
29918,
1111,
536,
29897,
718,
525,
29900,
29915,
13,
13,
12,
12,
1311,
29889,
29916,
29918,
1111,
536,
353,
938,
29898,
7050,
29918,
29916,
29918,
1111,
536,
29897,
13,
12,
12,
1311,
29889,
29891,
29918,
1111,
536,
353,
938,
29898,
7050,
29918,
29891,
29918,
1111,
536,
29897,
13,
13,
13,
1990,
22666,
7295,
13,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
2479,
29918,
2103,
29892,
2479,
29918,
354,
335,
386,
1125,
13,
12,
12,
1311,
29889,
4990,
29918,
2103,
353,
2479,
29918,
2103,
13,
12,
12,
1311,
29889,
4990,
29918,
354,
335,
386,
353,
2479,
29918,
354,
335,
386,
13,
13,
12,
12,
2272,
11802,
29889,
2344,
580,
13,
13,
12,
12,
1311,
29889,
10525,
353,
22028,
29889,
4990,
29889,
842,
29918,
8513,
3552,
4990,
29918,
2103,
29892,
2479,
29918,
354,
335,
386,
876,
13,
12,
12,
1311,
29889,
13058,
353,
22028,
29889,
2230,
29889,
29907,
908,
580,
13,
13,
12,
12,
1311,
29889,
11802,
29918,
19322,
353,
869,
29941,
13,
13,
12,
12,
1311,
29889,
29879,
21040,
353,
317,
21040,
29898,
4990,
29918,
2103,
29892,
2479,
29918,
354,
335,
386,
29897,
13,
12,
12,
1311,
29889,
1181,
397,
353,
25453,
29898,
4990,
29918,
2103,
29892,
2479,
29918,
354,
335,
386,
29897,
13,
13,
12,
12,
1311,
29889,
4951,
3276,
353,
7700,
13,
13,
12,
1753,
16087,
29898,
1311,
1125,
13,
13,
12,
12,
1753,
269,
21040,
29918,
13529,
882,
29898,
2272,
11802,
29918,
13604,
1125,
13,
12,
12,
12,
1454,
1741,
297,
22028,
29918,
13604,
29901,
13,
12,
12,
12,
12,
361,
1741,
29889,
1853,
1275,
22028,
29889,
13356,
1806,
470,
1583,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
19264,
1275,
525,
311,
328,
2396,
13,
12,
12,
12,
12,
12,
1311,
29889,
4951,
3276,
353,
5852,
13,
12,
12,
12,
12,
12,
2272,
11802,
29889,
28358,
580,
13,
12,
12,
12,
12,
12,
8690,
13,
13,
12,
12,
12,
12,
361,
1741,
29889,
1853,
1275,
22028,
29889,
10818,
3970,
16048,
29901,
13,
13,
12,
12,
12,
12,
12,
2158,
29898,
1311,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
2587,
29897,
13,
13,
12,
12,
12,
12,
12,
361,
1741,
29889,
1989,
1275,
22028,
29889,
29968,
29918,
28024,
29901,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
20919,
877,
1563,
742,
1583,
29889,
11802,
29918,
19322,
29892,
1583,
29889,
1181,
397,
29889,
29916,
29918,
1111,
536,
29892,
1583,
29889,
1181,
397,
29889,
29891,
29918,
1111,
536,
29897,
13,
12,
12,
12,
12,
12,
23681,
1741,
29889,
1989,
1275,
22028,
29889,
29968,
29918,
22789,
3912,
29901,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
20919,
877,
8966,
386,
742,
1583,
29889,
11802,
29918,
19322,
29892,
1583,
29889,
1181,
397,
29889,
29916,
29918,
1111,
536,
29892,
1583,
29889,
1181,
397,
29889,
29891,
29918,
1111,
536,
29897,
13,
12,
12,
12,
12,
12,
23681,
1741,
29889,
1989,
1275,
22028,
29889,
29968,
29918,
4897,
29901,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
20919,
877,
786,
742,
1583,
29889,
11802,
29918,
19322,
29892,
1583,
29889,
1181,
397,
29889,
29916,
29918,
1111,
536,
29892,
1583,
29889,
1181,
397,
29889,
29891,
29918,
1111,
536,
29897,
13,
12,
12,
12,
12,
12,
23681,
1741,
29889,
1989,
1275,
22028,
29889,
29968,
29918,
3970,
16048,
29901,
13,
12,
12,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
20919,
877,
3204,
742,
1583,
29889,
11802,
29918,
19322,
29892,
1583,
29889,
1181,
397,
29889,
29916,
29918,
1111,
536,
29892,
1583,
29889,
1181,
397,
29889,
29891,
29918,
1111,
536,
29897,
13,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
1311,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
20919,
29898,
1311,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
20845,
29892,
1583,
29889,
11802,
29918,
19322,
29892,
1583,
29889,
1181,
397,
29889,
29916,
29918,
1111,
536,
29892,
1583,
29889,
1181,
397,
29889,
29891,
29918,
1111,
536,
29897,
13,
13,
12,
12,
8000,
451,
1583,
29889,
4951,
3276,
29901,
13,
13,
12,
12,
12,
1311,
29889,
13058,
29889,
24667,
29898,
29953,
29900,
29897,
13,
13,
12,
12,
12,
1311,
29889,
10525,
29889,
5589,
3552,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
876,
13,
12,
12,
12,
1311,
29889,
4012,
29918,
29879,
21040,
580,
13,
12,
12,
12,
1311,
29889,
4012,
29918,
1181,
397,
580,
13,
13,
12,
12,
12,
1311,
29889,
29879,
21040,
29889,
18361,
29918,
29879,
21040,
29918,
403,
4197,
1311,
29889,
1181,
397,
29889,
29891,
29918,
1111,
536,
29892,
1583,
29889,
1181,
397,
29889,
29916,
29918,
1111,
536,
2314,
13,
12,
12,
12,
1311,
29889,
29879,
21040,
29889,
275,
29918,
29879,
21040,
29918,
311,
328,
580,
13,
13,
12,
12,
12,
361,
1583,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
403,
1275,
29871,
29896,
29901,
13,
12,
12,
12,
12,
1311,
29889,
11802,
29918,
19322,
22361,
29871,
29900,
29889,
29900,
29900,
29896,
13,
12,
12,
12,
12,
1311,
29889,
1181,
397,
29889,
17158,
29918,
1482,
29918,
1181,
397,
580,
13,
13,
12,
12,
12,
29879,
21040,
29918,
13529,
882,
29898,
2272,
11802,
29889,
3696,
29889,
657,
3101,
13,
13,
12,
12,
12,
2272,
11802,
29889,
4990,
29889,
5504,
580,
13,
13,
12,
12,
12,
17059,
29898,
1311,
29889,
11802,
29918,
19322,
29897,
13,
13,
12,
1753,
4216,
29918,
29879,
21040,
29898,
1311,
1125,
13,
12,
12,
1454,
269,
21040,
29918,
2587,
29918,
1595,
297,
1583,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
2587,
29901,
13,
12,
12,
12,
29891,
29918,
1111,
536,
353,
269,
21040,
29918,
2587,
29918,
1595,
29961,
29900,
29962,
13,
12,
12,
12,
29916,
29918,
1111,
536,
353,
269,
21040,
29918,
2587,
29918,
1595,
29961,
29896,
29962,
13,
13,
12,
12,
12,
2272,
11802,
29889,
4012,
29889,
1621,
29898,
1311,
29889,
10525,
29892,
1583,
29889,
29879,
21040,
29889,
29879,
21040,
29918,
2780,
29892,
22028,
29889,
7364,
29898,
29916,
29918,
1111,
536,
29892,
343,
29918,
1111,
536,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
876,
13,
13,
12,
1753,
4216,
29918,
1181,
397,
29898,
1311,
1125,
13,
12,
12,
12,
2272,
11802,
29889,
4012,
29889,
1621,
29898,
1311,
29889,
10525,
29892,
1583,
29889,
1181,
397,
29889,
1181,
397,
29918,
2780,
29892,
22028,
29889,
7364,
29898,
1311,
29889,
1181,
397,
29889,
29916,
29918,
1111,
536,
29892,
1583,
29889,
1181,
397,
29889,
29891,
29918,
1111,
536,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
876,
13,
2
] |
mathipy/functions/linearithmic.py | BatiDyDx/maths-tools-python | 1 | 17272 | <reponame>BatiDyDx/maths-tools-python<filename>mathipy/functions/linearithmic.py<gh_stars>1-10
import math
import numpy as np
from mathipy.math import calculus
class Linearithmic(calculus.Function):
"""
f(x) = (mx + h)log_b(kx + a)
"""
function_type = 'Linearithmic'
def __init__(self, m = 1, h = 0, b = 10, a = 0, k = 1):
self.m = m
self.h = h
self.b = b
self.a = a
self.k = k
def find_roots(self) -> tuple:
x1 = - self.h / self.m
x2 = (1 - self.a) / self.k
x1 = x1 if self(x1) == 0 else np.nan
x2 = x2 if self(x2) == 0 else np.nan
return (x1, x2)
def plot_func(self, ax):
ax.scatter(self.find_roots(), (0,0), color=calculus.Function.function_part['roots'])
ax.scatter(0, self.get_yint(), color=calculus.Function.function_part['y-intercept'])
def calculate_values(self, x):
return (self.m * x + self.h) * math.log(self.k * x + self.a, self.b)
def __str__(self):
representation = ''
representation += f'({self.m}x + {self.h})'
representation += f'log_{self.b}({self.k}x + {self.a})'
return representation | [
1,
529,
276,
1112,
420,
29958,
29933,
2219,
29928,
29891,
29928,
29916,
29914,
755,
29879,
29899,
8504,
29899,
4691,
29966,
9507,
29958,
755,
666,
29891,
29914,
12171,
29914,
10660,
389,
13076,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
5844,
13,
5215,
12655,
408,
7442,
13,
3166,
5844,
666,
29891,
29889,
755,
1053,
24282,
13,
13,
1990,
22985,
389,
13076,
29898,
15807,
375,
29889,
6678,
1125,
13,
1678,
9995,
13,
1678,
285,
29898,
29916,
29897,
353,
313,
16838,
718,
298,
29897,
1188,
29918,
29890,
29898,
29895,
29916,
718,
263,
29897,
13,
1678,
9995,
13,
1678,
740,
29918,
1853,
353,
525,
12697,
389,
13076,
29915,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
286,
353,
29871,
29896,
29892,
298,
353,
29871,
29900,
29892,
289,
353,
29871,
29896,
29900,
29892,
263,
353,
29871,
29900,
29892,
413,
353,
29871,
29896,
1125,
13,
4706,
1583,
29889,
29885,
353,
286,
13,
4706,
1583,
29889,
29882,
353,
298,
13,
4706,
1583,
29889,
29890,
353,
289,
13,
4706,
1583,
29889,
29874,
353,
263,
13,
4706,
1583,
29889,
29895,
353,
413,
13,
13,
1678,
822,
1284,
29918,
307,
1862,
29898,
1311,
29897,
1599,
18761,
29901,
13,
4706,
921,
29896,
353,
448,
1583,
29889,
29882,
847,
1583,
29889,
29885,
13,
4706,
921,
29906,
353,
313,
29896,
448,
1583,
29889,
29874,
29897,
847,
1583,
29889,
29895,
13,
4706,
921,
29896,
353,
921,
29896,
565,
1583,
29898,
29916,
29896,
29897,
1275,
29871,
29900,
1683,
7442,
29889,
13707,
13,
4706,
921,
29906,
353,
921,
29906,
565,
1583,
29898,
29916,
29906,
29897,
1275,
29871,
29900,
1683,
7442,
29889,
13707,
13,
4706,
736,
313,
29916,
29896,
29892,
921,
29906,
29897,
13,
13,
1678,
822,
6492,
29918,
9891,
29898,
1311,
29892,
4853,
1125,
13,
4706,
4853,
29889,
1557,
2620,
29898,
1311,
29889,
2886,
29918,
307,
1862,
3285,
313,
29900,
29892,
29900,
511,
2927,
29922,
15807,
375,
29889,
6678,
29889,
2220,
29918,
1595,
1839,
307,
1862,
11287,
13,
4706,
4853,
29889,
1557,
2620,
29898,
29900,
29892,
1583,
29889,
657,
29918,
29891,
524,
3285,
2927,
29922,
15807,
375,
29889,
6678,
29889,
2220,
29918,
1595,
1839,
29891,
29899,
1639,
1547,
11287,
13,
13,
1678,
822,
8147,
29918,
5975,
29898,
1311,
29892,
921,
1125,
13,
4706,
736,
313,
1311,
29889,
29885,
334,
921,
718,
1583,
29889,
29882,
29897,
334,
5844,
29889,
1188,
29898,
1311,
29889,
29895,
334,
921,
718,
1583,
29889,
29874,
29892,
1583,
29889,
29890,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
8954,
353,
6629,
13,
4706,
8954,
4619,
285,
29915,
3319,
1311,
29889,
29885,
29913,
29916,
718,
426,
1311,
29889,
29882,
1800,
29915,
13,
4706,
8954,
4619,
285,
29915,
1188,
648,
1311,
29889,
29890,
2119,
29912,
1311,
29889,
29895,
29913,
29916,
718,
426,
1311,
29889,
29874,
1800,
29915,
13,
4706,
736,
8954,
2
] |
stylegan/sampling/legacy/visualize_neighbors.py | VITA-Group/BlackBoxGANCollapse | 3 | 1602897 | import pickle
import itertools
import os
import math
from sklearn.preprocessing import normalize
import re
from operator import add
import matplotlib.pyplot as plt
import numpy as np
import argparse
import pylab as pl
from utils import compute_embds_matrix
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Visualize nearest neighbors')
parser.add_argument('--start', required=True, help='Start of the distance threshold for neighbors', type=float)
parser.add_argument('--end', required=True, help='End of the distance threshold for neighbors', type=float)
parser.add_argument('--step_size', required=True, help='Step size of the epsilon', type=float)
#parser.add_argument('--resolution', help='resolution of the trained model', type=int)
parser.add_argument('--path', required=True, help='The path for reading embeddings', type=str)
args, other_args = parser.parse_known_args()
M = 10000
N = 10
#path = os.path.join(args.path, str(args.resolution))
path = args.path
A_lst = compute_embds_matrix(os.path.join(path, 'embds'), M, N)
for epsilon in list(np.arange(args.start, args.end, args.step_size)):
print(epsilon)
with open(os.path.join(path, 'neighbors', 'final_neighbors_count_lstoflst_{}.pkl'.format(epsilon)), 'rb') as fp:
final_neighbors_count_lstoflst = pickle.load(fp)
# final_neighbors_count_lst = final_neighbors_count_lstoflst[0]
final_neighbors_count_lst = final_neighbors_count_lstoflst[N-1]
print(max(final_neighbors_count_lst))
final_neighbors_count_lst = np.asarray(final_neighbors_count_lst)
indices = np.argpartition(final_neighbors_count_lst, -1)[-1:]
print(indices)
indices = np.asarray(indices)
with open(os.path.join(args.path, 'neighbors', 'clustered_indices.pkl'), 'wb') as handle:
pickle.dump(list(indices),handle)
print(final_neighbors_count_lst[indices])
# A = np.concatenate(A_lst, axis=0)
# AT = np.transpose(A)
from shutil import copyfile
# k = 0
# embds_lst = []
# for ind in indices:
# # vec = A[ind]
# # dist_arr = np.matmul(vec, AT)
# # dist_arr = np.arccos(dist_arr) / math.pi
# # index_lst = list(np.nonzero(dist_arr <= epsilon)[0])
# # pair_lst = [(index, dist_arr[index]) for index in index_lst]
# # pair_lst = sorted(pair_lst, key=lambda x: x[1])
# # i = 0
# # for index, _ in pair_lst:
# # latents_dir = os.path.join('latents', '{}_{}'.format((index // 10000) * 10000, (index // 10000 + 1) * 10000))
# # src = os.path.join(path, latents_dir, '{}_{}.npy'.format((index // 10000) * 10000, (index // 10000 + 1) * 10000))
# # dst = os.path.join(path, 'neighbors', str(epsilon), str(ind), 'collision', 'neighbors_latents')
# # if not os.path.exists(dst):
# # os.makedirs(dst)
# # dst = os.path.join(dst, '{}_{}.npy'.format(index, i))
# # latents = np.load(src)
# # np.save(dst, latents[index-(index // 10000) * 10000])
# # i += 1
#
# # cluster
# #latents_dir = os.path.join('latents', '{}_{}'.format((ind // 10000) * 10000, (ind // 100000 + 1) * 10000))
# latents_dir = os.path.join('latents', '0_1000000')
# src = os.path.join(path, latents_dir, '{}_{}.npy'.format((ind // 10000) * 10000, (ind // 10000 + 1) * 10000))
# dst = os.path.join(path, 'neighbors', str(epsilon), 'clustered_latents')
# if not os.path.exists(dst):
# os.makedirs(dst)
# dst = os.path.join(dst, '{}_{}.npy'.format(ind, k))
# latents = np.load(src)
# np.save(dst, latents[ind % 10000])
#
# # # cluster
# # embds_dir = os.path.join('embds', '0_1000000')
# # src = os.path.join(path, embds_dir, '{}_{}.pkl'.format((ind // 10000) * 10000, (ind // 10000 + 1) * 10000))
# # dst = os.path.join(path, 'neighbors', str(epsilon), 'clustered_embds')
# # if not os.path.exists(dst):
# # os.makedirs(dst)
# # dst = os.path.join(dst, '{}_{}.pkl'.format(ind, k))
# # embd = pickle.load(open(src, 'rb'))
# # embds_lst.append(embd[ind % 10000])
# # pickle.dump(embd[ind % 10000], open(dst, 'wb'))
#
# # # cluster
# # images_dir = os.path.join('images', '{}_{}'.format((ind // 10000) * 10000, (ind // 10000 + 1) * 10000))
# # src = os.path.join(home_dir, images_dir, '{}.png'.format(ind))
# # dst = os.path.join(home_dir, 'neighbors', str(epsilon), 'clustered_images')
# # if not os.path.exists(dst):
# # os.makedirs(dst)
# # dst = os.path.join(dst, '{}_{}.png'.format(ind, k))
# # copyfile(src, dst)
# k += 1
# pickle.dump(np.asarray(embds_lst), open(os.path.join(path, 'neighbors', str(epsilon), 'clustered_embds.pkl'), 'wb')) | [
1,
1053,
5839,
280,
13,
5215,
4256,
8504,
13,
5215,
2897,
13,
5215,
5844,
13,
3166,
2071,
19668,
29889,
1457,
19170,
1053,
4226,
675,
13,
5215,
337,
13,
3166,
5455,
1053,
788,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
12655,
408,
7442,
13,
5215,
1852,
5510,
13,
5215,
282,
2904,
370,
408,
715,
13,
13,
3166,
3667,
29879,
1053,
10272,
29918,
1590,
6289,
29918,
5344,
13,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
16227,
675,
20471,
22092,
943,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
2962,
742,
3734,
29922,
5574,
29892,
1371,
2433,
4763,
310,
278,
5418,
16897,
363,
22092,
943,
742,
1134,
29922,
7411,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
355,
742,
3734,
29922,
5574,
29892,
1371,
2433,
5044,
310,
278,
5418,
16897,
363,
22092,
943,
742,
1134,
29922,
7411,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
10568,
29918,
2311,
742,
3734,
29922,
5574,
29892,
1371,
2433,
14448,
2159,
310,
278,
321,
3232,
742,
1134,
29922,
7411,
29897,
13,
1678,
396,
16680,
29889,
1202,
29918,
23516,
877,
489,
9778,
918,
742,
1371,
2433,
9778,
918,
310,
278,
16370,
1904,
742,
1134,
29922,
524,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
2084,
742,
3734,
29922,
5574,
29892,
1371,
2433,
1576,
2224,
363,
5183,
8297,
29881,
886,
742,
1134,
29922,
710,
29897,
13,
13,
1678,
6389,
29892,
916,
29918,
5085,
353,
13812,
29889,
5510,
29918,
5203,
29918,
5085,
580,
13,
13,
1678,
341,
353,
29871,
29896,
29900,
29900,
29900,
29900,
13,
1678,
405,
353,
29871,
29896,
29900,
13,
1678,
396,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
5085,
29889,
2084,
29892,
851,
29898,
5085,
29889,
9778,
918,
876,
13,
1678,
2224,
353,
6389,
29889,
2084,
13,
1678,
319,
29918,
20155,
353,
10272,
29918,
1590,
6289,
29918,
5344,
29898,
359,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
525,
1590,
6289,
5477,
341,
29892,
405,
29897,
13,
13,
1678,
363,
321,
3232,
297,
1051,
29898,
9302,
29889,
279,
927,
29898,
5085,
29889,
2962,
29892,
6389,
29889,
355,
29892,
6389,
29889,
10568,
29918,
2311,
22164,
13,
4706,
1596,
29898,
5463,
29897,
13,
4706,
411,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
525,
484,
1141,
29890,
943,
742,
525,
8394,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
974,
20155,
648,
1836,
29886,
6321,
4286,
4830,
29898,
5463,
8243,
525,
6050,
1495,
408,
285,
29886,
29901,
13,
9651,
2186,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
974,
20155,
353,
5839,
280,
29889,
1359,
29898,
18091,
29897,
13,
13,
4706,
396,
2186,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
353,
2186,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
974,
20155,
29961,
29900,
29962,
13,
4706,
2186,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
353,
2186,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
974,
20155,
29961,
29940,
29899,
29896,
29962,
13,
4706,
1596,
29898,
3317,
29898,
8394,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
876,
13,
4706,
2186,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
353,
7442,
29889,
294,
2378,
29898,
8394,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
29897,
13,
4706,
16285,
353,
7442,
29889,
1191,
16707,
29898,
8394,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
29892,
448,
29896,
9601,
29899,
29896,
17531,
13,
4706,
1596,
29898,
513,
1575,
29897,
13,
4706,
16285,
353,
7442,
29889,
294,
2378,
29898,
513,
1575,
29897,
13,
4706,
411,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
5085,
29889,
2084,
29892,
525,
484,
1141,
29890,
943,
742,
525,
19594,
287,
29918,
513,
1575,
29889,
29886,
6321,
5477,
525,
29893,
29890,
1495,
408,
4386,
29901,
13,
9651,
5839,
280,
29889,
15070,
29898,
1761,
29898,
513,
1575,
511,
8411,
29897,
13,
4706,
1596,
29898,
8394,
29918,
484,
1141,
29890,
943,
29918,
2798,
29918,
20155,
29961,
513,
1575,
2314,
13,
4706,
396,
319,
353,
7442,
29889,
535,
29883,
2579,
403,
29898,
29909,
29918,
20155,
29892,
9685,
29922,
29900,
29897,
13,
4706,
396,
15531,
353,
7442,
29889,
3286,
4220,
29898,
29909,
29897,
13,
4706,
515,
528,
4422,
1053,
3509,
1445,
13,
13,
4706,
396,
413,
353,
29871,
29900,
13,
4706,
396,
7232,
6289,
29918,
20155,
353,
5159,
13,
4706,
396,
363,
1399,
297,
16285,
29901,
13,
4706,
396,
268,
396,
9649,
353,
319,
29961,
513,
29962,
13,
4706,
396,
268,
396,
1320,
29918,
2749,
353,
7442,
29889,
2922,
16109,
29898,
2003,
29892,
15531,
29897,
13,
4706,
396,
268,
396,
1320,
29918,
2749,
353,
7442,
29889,
279,
617,
359,
29898,
5721,
29918,
2749,
29897,
847,
5844,
29889,
1631,
13,
4706,
396,
268,
396,
2380,
29918,
20155,
353,
1051,
29898,
9302,
29889,
5464,
9171,
29898,
5721,
29918,
2749,
5277,
321,
3232,
9601,
29900,
2314,
13,
4706,
396,
268,
396,
5101,
29918,
20155,
353,
17288,
2248,
29892,
1320,
29918,
2749,
29961,
2248,
2314,
363,
2380,
297,
2380,
29918,
20155,
29962,
13,
4706,
396,
268,
396,
5101,
29918,
20155,
353,
12705,
29898,
18784,
29918,
20155,
29892,
1820,
29922,
2892,
921,
29901,
921,
29961,
29896,
2314,
13,
4706,
396,
268,
396,
474,
353,
29871,
29900,
13,
4706,
396,
268,
396,
363,
2380,
29892,
903,
297,
5101,
29918,
20155,
29901,
13,
4706,
396,
268,
396,
268,
3405,
1237,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
877,
5066,
1237,
742,
22372,
3227,
29913,
4286,
4830,
3552,
2248,
849,
29871,
29896,
29900,
29900,
29900,
29900,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
29892,
313,
2248,
849,
29871,
29896,
29900,
29900,
29900,
29900,
718,
29871,
29896,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
876,
13,
4706,
396,
268,
396,
268,
4765,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
3405,
1237,
29918,
3972,
29892,
22372,
3227,
1836,
29876,
2272,
4286,
4830,
3552,
2248,
849,
29871,
29896,
29900,
29900,
29900,
29900,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
29892,
313,
2248,
849,
29871,
29896,
29900,
29900,
29900,
29900,
718,
29871,
29896,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
876,
13,
4706,
396,
268,
396,
268,
29743,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
525,
484,
1141,
29890,
943,
742,
851,
29898,
5463,
511,
851,
29898,
513,
511,
525,
22017,
2459,
742,
525,
484,
1141,
29890,
943,
29918,
5066,
1237,
1495,
13,
4706,
396,
268,
396,
268,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
22992,
1125,
13,
4706,
396,
268,
396,
308,
2897,
29889,
29885,
12535,
12935,
29898,
22992,
29897,
13,
4706,
396,
268,
396,
268,
29743,
353,
2897,
29889,
2084,
29889,
7122,
29898,
22992,
29892,
22372,
3227,
1836,
29876,
2272,
4286,
4830,
29898,
2248,
29892,
474,
876,
13,
4706,
396,
268,
396,
268,
3405,
1237,
353,
7442,
29889,
1359,
29898,
4351,
29897,
13,
4706,
396,
268,
396,
268,
7442,
29889,
7620,
29898,
22992,
29892,
3405,
1237,
29961,
2248,
17722,
2248,
849,
29871,
29896,
29900,
29900,
29900,
29900,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
2314,
13,
4706,
396,
268,
396,
268,
474,
4619,
29871,
29896,
13,
4706,
396,
13,
4706,
396,
268,
396,
9867,
13,
4706,
396,
268,
396,
5066,
1237,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
877,
5066,
1237,
742,
22372,
3227,
29913,
4286,
4830,
3552,
513,
849,
29871,
29896,
29900,
29900,
29900,
29900,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
29892,
313,
513,
849,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
718,
29871,
29896,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
876,
13,
4706,
396,
268,
3405,
1237,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
877,
5066,
1237,
742,
525,
29900,
29918,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
1495,
13,
4706,
396,
268,
4765,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
3405,
1237,
29918,
3972,
29892,
22372,
3227,
1836,
29876,
2272,
4286,
4830,
3552,
513,
849,
29871,
29896,
29900,
29900,
29900,
29900,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
29892,
313,
513,
849,
29871,
29896,
29900,
29900,
29900,
29900,
718,
29871,
29896,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
876,
13,
4706,
396,
268,
29743,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
525,
484,
1141,
29890,
943,
742,
851,
29898,
5463,
511,
525,
19594,
287,
29918,
5066,
1237,
1495,
13,
4706,
396,
268,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
22992,
1125,
13,
4706,
396,
308,
2897,
29889,
29885,
12535,
12935,
29898,
22992,
29897,
13,
4706,
396,
268,
29743,
353,
2897,
29889,
2084,
29889,
7122,
29898,
22992,
29892,
22372,
3227,
1836,
29876,
2272,
4286,
4830,
29898,
513,
29892,
413,
876,
13,
4706,
396,
268,
3405,
1237,
353,
7442,
29889,
1359,
29898,
4351,
29897,
13,
4706,
396,
268,
7442,
29889,
7620,
29898,
22992,
29892,
3405,
1237,
29961,
513,
1273,
29871,
29896,
29900,
29900,
29900,
29900,
2314,
13,
4706,
396,
13,
4706,
396,
268,
396,
396,
9867,
13,
4706,
396,
268,
396,
7232,
6289,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
877,
1590,
6289,
742,
525,
29900,
29918,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
1495,
13,
4706,
396,
268,
396,
4765,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
7232,
6289,
29918,
3972,
29892,
22372,
3227,
1836,
29886,
6321,
4286,
4830,
3552,
513,
849,
29871,
29896,
29900,
29900,
29900,
29900,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
29892,
313,
513,
849,
29871,
29896,
29900,
29900,
29900,
29900,
718,
29871,
29896,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
876,
13,
4706,
396,
268,
396,
29743,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
525,
484,
1141,
29890,
943,
742,
851,
29898,
5463,
511,
525,
19594,
287,
29918,
1590,
6289,
1495,
13,
4706,
396,
268,
396,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
22992,
1125,
13,
4706,
396,
268,
396,
268,
2897,
29889,
29885,
12535,
12935,
29898,
22992,
29897,
13,
4706,
396,
268,
396,
29743,
353,
2897,
29889,
2084,
29889,
7122,
29898,
22992,
29892,
22372,
3227,
1836,
29886,
6321,
4286,
4830,
29898,
513,
29892,
413,
876,
13,
4706,
396,
268,
396,
953,
6448,
353,
5839,
280,
29889,
1359,
29898,
3150,
29898,
4351,
29892,
525,
6050,
8785,
13,
4706,
396,
268,
396,
7232,
6289,
29918,
20155,
29889,
4397,
29898,
1590,
29881,
29961,
513,
1273,
29871,
29896,
29900,
29900,
29900,
29900,
2314,
13,
4706,
396,
268,
396,
5839,
280,
29889,
15070,
29898,
1590,
29881,
29961,
513,
1273,
29871,
29896,
29900,
29900,
29900,
29900,
1402,
1722,
29898,
22992,
29892,
525,
29893,
29890,
8785,
13,
4706,
396,
13,
4706,
396,
268,
396,
396,
9867,
13,
4706,
396,
268,
396,
4558,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
877,
8346,
742,
22372,
3227,
29913,
4286,
4830,
3552,
513,
849,
29871,
29896,
29900,
29900,
29900,
29900,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
29892,
313,
513,
849,
29871,
29896,
29900,
29900,
29900,
29900,
718,
29871,
29896,
29897,
334,
29871,
29896,
29900,
29900,
29900,
29900,
876,
13,
4706,
396,
268,
396,
4765,
353,
2897,
29889,
2084,
29889,
7122,
29898,
5184,
29918,
3972,
29892,
4558,
29918,
3972,
29892,
22372,
1836,
2732,
4286,
4830,
29898,
513,
876,
13,
4706,
396,
268,
396,
29743,
353,
2897,
29889,
2084,
29889,
7122,
29898,
5184,
29918,
3972,
29892,
525,
484,
1141,
29890,
943,
742,
851,
29898,
5463,
511,
525,
19594,
287,
29918,
8346,
1495,
13,
4706,
396,
268,
396,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
22992,
1125,
13,
4706,
396,
268,
396,
268,
2897,
29889,
29885,
12535,
12935,
29898,
22992,
29897,
13,
4706,
396,
268,
396,
29743,
353,
2897,
29889,
2084,
29889,
7122,
29898,
22992,
29892,
22372,
3227,
1836,
2732,
4286,
4830,
29898,
513,
29892,
413,
876,
13,
4706,
396,
268,
396,
3509,
1445,
29898,
4351,
29892,
29743,
29897,
13,
4706,
396,
268,
413,
4619,
29871,
29896,
13,
4706,
396,
5839,
280,
29889,
15070,
29898,
9302,
29889,
294,
2378,
29898,
1590,
6289,
29918,
20155,
511,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
525,
484,
1141,
29890,
943,
742,
851,
29898,
5463,
511,
525,
19594,
287,
29918,
1590,
6289,
29889,
29886,
6321,
5477,
525,
29893,
29890,
8785,
2
] |
fast_rcnn/test.py | GraphaQL-Neo4J/orientation-aware-firearm-detection | 38 | 97536 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
# Modified by CVML group @ITU- Punjab
"""Test a Fast R-CNN network on an imdb (image database)."""
from fast_rcnn.config import cfg, get_output_dir
from fast_rcnn.bbox_transform import clip_boxes, bbox_transform_inv
#from fast_rcnn.ftmap_transform import transformer_layer as trans_layer
import argparse
from utils.timer import Timer
import numpy as np
import cv2
from numpy.linalg import inv
import caffe
from fast_rcnn.nms_wrapper import nms
import cPickle
from utils.blob import im_list_to_blob
import os
import matplotlib.pyplot as plt
import xml.etree.ElementTree as ET
import gc
#from nms.py_cpu_nms_rotated import py_cpu_nms
def _get_image_blob(im):
"""Converts an image into a network input.
Arguments:
im (ndarray): a color image in BGR order
Returns:
blob (ndarray): a data blob holding an image pyramid
im_scale_factors (list): list of image scales (relative to im) used
in the image pyramid
"""
im_orig = im.astype(np.float32, copy=True)
im_orig -= cfg.PIXEL_MEANS
im_shape = im_orig.shape
im_size_min = np.min(im_shape[0:2])
im_size_max = np.max(im_shape[0:2])
processed_ims = []
im_scale_factors = []
for target_size in cfg.TEST.SCALES:
im_scale = float(target_size) / float(im_size_min)
# Prevent the biggest axis from being more than MAX_SIZE
if np.round(im_scale * im_size_max) > cfg.TEST.MAX_SIZE:
im_scale = float(cfg.TEST.MAX_SIZE) / float(im_size_max)
im = cv2.resize(im_orig, None, None, fx=im_scale, fy=im_scale,
interpolation=cv2.INTER_LINEAR)
im_scale_factors.append(im_scale)
processed_ims.append(im)
# Create a blob to hold the input images
blob = im_list_to_blob(processed_ims)
return blob, np.array(im_scale_factors)
def _get_rois_blob(im_rois, im_scale_factors):
"""Converts RoIs into network inputs.
Arguments:
im_rois (ndarray): R x 4 matrix of RoIs in original image coordinates
im_scale_factors (list): scale factors as returned by _get_image_blob
Returns:
blob (ndarray): R x 5 matrix of RoIs in the image pyramid
"""
rois, levels = _project_im_rois(im_rois, im_scale_factors)
rois_blob = np.hstack((levels, rois))
return rois_blob.astype(np.float32, copy=False)
def _project_im_rois(im_rois, scales):
"""Project image RoIs into the image pyramid built by _get_image_blob.
Arguments:
im_rois (ndarray): R x 4 matrix of RoIs in original image coordinates
scales (list): scale factors as returned by _get_image_blob
Returns:
rois (ndarray): R x 4 matrix of projected RoI coordinates
levels (list): image pyramid levels used by each projected RoI
"""
im_rois = im_rois.astype(np.float, copy=False)
if len(scales) > 1:
widths = im_rois[:, 2] - im_rois[:, 0] + 1
heights = im_rois[:, 3] - im_rois[:, 1] + 1
areas = widths * heights
scaled_areas = areas[:, np.newaxis] * (scales[np.newaxis, :] ** 2)
diff_areas = np.abs(scaled_areas - 224 * 224)
levels = diff_areas.argmin(axis=1)[:, np.newaxis]
else:
levels = np.zeros((im_rois.shape[0], 1), dtype=np.int)
rois = im_rois * scales[levels]
return rois, levels
def _get_blobs(im, rois):
"""Convert an image and RoIs within that image into network inputs."""
blobs = {'data' : None, 'rois' : None}
blobs['data'], im_scale_factors = _get_image_blob(im)
if not cfg.TEST.HAS_RPN:
blobs['rois'] = _get_rois_blob(rois, im_scale_factors)
#print ('lll: ', blobs['rois'])
return blobs, im_scale_factors
def im_detect(net, im, boxes=None, extract_feat=False):
"""Detect object classes in an image given object proposals.
Arguments:
net (caffe.Net): Fast R-CNN network to use
im (ndarray): color image to test (in BGR order)
boxes (ndarray): R x 4 array of object proposals or None (for RPN)
Returns:
scores (ndarray): R x K array of object class scores (K includes
background as object category 0)
boxes (ndarray): R x (4*K) array of predicted bounding boxes
"""
blobs, im_scales = _get_blobs(im, boxes)
#print 'blobs: ', blobs
# When mapping from image ROIs to feature map ROIs, there's some aliasing
# (some distinct image ROIs get mapped to the same feature ROI).
# Here, we identify duplicate feature ROIs, so we only compute features
# on the unique subset.
if cfg.DEDUP_BOXES > 0 and not cfg.TEST.HAS_RPN:
v = np.array([1, 1e3, 1e6, 1e9, 1e12])
hashes = np.round(blobs['rois'] * cfg.DEDUP_BOXES).dot(v)
_, index, inv_index = np.unique(hashes, return_index=True,
return_inverse=True)
blobs['rois'] = blobs['rois'][index, :]
boxes = boxes[index, :]
#print ('lll: ', not cfg.TEST.HAS_RPN)
if cfg.TEST.HAS_RPN:
im_blob = blobs['data']
permanent_shape = im_blob.shape
#print ('lll: ', permanent_shape)
blobs['im_info'] = np.array(
[[im_blob.shape[2], im_blob.shape[3], im_scales[0]]],
dtype=np.float32)
print blobs['im_info']
# reshape network inputs
net.blobs['data'].reshape(*(blobs['data'].shape))
if cfg.TEST.HAS_RPN:
net.blobs['im_info'].reshape(*(blobs['im_info'].shape))
else:
net.blobs['rois'].reshape(*(blobs['rois'].shape))
# do forward
forward_kwargs = {'data': blobs['data'].astype(np.float32, copy=False)}
if cfg.TEST.HAS_RPN:
forward_kwargs['im_info'] = blobs['im_info'].astype(np.float32, copy=False)
else:
forward_kwargs['rois'] = blobs['rois'].astype(np.float32, copy=False)
#print('going to net forward')
blobs_out = net.forward(**forward_kwargs)
#print('blobs[rois] : ', blobs_out)
#print ('start_ind: ', list(net._layer_names))
li = list(net._layer_names).index('roi_pool5')
tops = [(net._blob_names[bi], net.blobs[net._blob_names[bi]].data.shape) for bi in list(net._top_ids(li))]
#for bi in range(len(list(net._layer_names))):
#print ('hello: ', net._blob_names[bi] ,net.blobs[net._blob_names[bi]].data.shape)
'''print li
print list(net._top_ids(li)), net._blob_names[28]
print net.blobs['rois'].data.shape
for ip in range (35):
print ip, net._blob_names[ip]'''
if cfg.TEST.HAS_RPN:
assert len(im_scales) == 1, "Only single-image batch implemented"
rois = net.blobs['rois'].data.copy()
#print('rois :', rois[0,:])
# unscale back to raw image space
rpn_boxes = rois[:, 1:5] / im_scales[0]
#print ('shape: ', rpn_boxes.shape)
rpn_scores = net.blobs['scores'].data.copy()
pred_scores = net.blobs['cls_prob'].data.copy()
box_deltas = net.blobs['bbox_pred'].data.copy()
#box_deltas = blobs_out['bbox_pred1']
pred_boxes = bbox_transform_inv(rpn_boxes, box_deltas)
#pred_boxes = np.hstack((rpn_boxes, rpn_boxes, rpn_boxes))
pred_boxes = clip_boxes(pred_boxes, im.shape)
#print('comp :', rpn_boxes[:50,:], pred_boxes[:50,:])
orient_prob = net.blobs['orient_prob'].data.copy()
warpedrois = net.blobs['warpedrois'].data.copy()
transApplied = net.blobs['transApplied'].data.copy()
rpn_boxes1 = warpedrois[:, 1:5] / im_scales[0]
# use softmax estimated probabilities
pred_scores1 = blobs_out['cls_prob1']
#print 'im_detect'
#print (pred_scores.shape)
# Apply bounding-box regression deltas by accessing blob with name bbox_pred
box_deltas1 = blobs_out['bbox_pred1']
pred_boxes1 = bbox_transform_inv(rpn_boxes1, box_deltas1)
#pred_boxes1 = np.hstack((rpn_boxes1, rpn_boxes1, rpn_boxes1))
#pred_boxes1 = clip_boxes(pred_boxes1, im.shape)
#orient_prob = blobs_out['orient_prob']
#orient_prob = np.zeros((len(pred_scores),4), dtype='float')
# unscale back to raw image space
'''rpn_boxes = rois[:, 1:5] / im_scales[0]
#print ('shape: ', rpn_boxes[45:60,:])
rpn_scores = net.blobs['scores'].data.copy()
# use softmax estimated probabilities
pred_scores = blobs_out['cls_prob']
#print 'im_detect'
#print (pred_scores.shape)
# Apply bounding-box regression deltas by accessing blob with name bbox_pred
box_deltas = blobs_out['bbox_pred']
pred_boxes = bbox_transform_inv(rpn_boxes, box_deltas)
pred_boxes = clip_boxes(pred_boxes, im.shape)
orient_prob = blobs_out['orient_prob']
#orient_prob = np.zeros((len(pred_scores),4), dtype='float')
if extract_feat == True:
conv_feat = net.blobs['conv5_3'].data.copy()
#print conv_feat.shape
return rpn_boxes, rpn_scores, pred_boxes, pred_scores, orient_prob, conv_feat, permanent_shape'''
return rpn_boxes, rpn_scores, pred_boxes, pred_scores, orient_prob, pred_boxes1, pred_scores1, transApplied
def im_detect_new(net, im, perm_shape, blobs, ross,im_scales, boxes=None, extract_feat=False):
"""Detect object classes in an image given object proposals.
Arguments:
net (caffe.Net): Fast R-CNN network to use
im (ndarray): color image to test (in BGR order)
boxes (ndarray): R x 4 array of object proposals or None (for RPN)
Returns:
scores (ndarray): R x K array of object class scores (K includes
background as object category 0)
boxes (ndarray): R x (4*K) array of predicted bounding boxes
"""
#blobs, im_scales = _get_blobs(im, boxes)
# When mapping from image ROIs to feature map ROIs, there's some aliasing
# (some distinct image ROIs get mapped to the same feature ROI).
# Here, we identify duplicate feature ROIs, so we only compute features
# on the unique subset.
if cfg.DEDUP_BOXES > 0 and not cfg.TEST.HAS_RPN:
v = np.array([1, 1e3, 1e6, 1e9, 1e12])
hashes = np.round(blobs['rois'] * cfg.DEDUP_BOXES).dot(v)
_, index, inv_index = np.unique(hashes, return_index=True,
return_inverse=True)
blobs['rois'] = blobs['rois'][index, :]
boxes = boxes[index, :]
if cfg.TEST.HAS_RPN:
im_blob = blobs['data']
#print 'change me'
#print im_blob.shape
blobs['im_info'] = np.array(
[[perm_shape[2], perm_shape[3], im_scales[0]]],
dtype=np.float32)
blobs['rois'] = np.array(ross)
# reshape network inputs
net.blobs['data'].reshape(*(blobs['data'].shape))
if cfg.TEST.HAS_RPN:
net.blobs['im_info'].reshape(*(blobs['im_info'].shape))
#print 'rois shape', net.blobs['rois']
net.blobs['rois'].reshape(*(blobs['rois'].shape))
#print 'rois shape', net.blobs['rois'].shape
else:
net.blobs['rois'].reshape(*(blobs['rois'].shape))
# do forward
forward_kwargs = {'data': blobs['data'].astype(np.float32, copy=False)}
if cfg.TEST.HAS_RPN:
forward_kwargs['im_info'] = blobs['im_info'].astype(np.float32, copy=False)
forward_kwargs['rois'] = blobs['rois'].astype(np.float32, copy=False)
else:
forward_kwargs['rois'] = blobs['rois'].astype(np.float32, copy=False)
blobs_out = net.forward(**forward_kwargs)
if cfg.TEST.HAS_RPN:
assert len(im_scales) == 1, "Only single-image batch implemented"
rois = net.blobs['rois'].data.copy()
# unscale back to raw image space
#print 'in'
rpn_boxes = rois[:, 1:5] / im_scales[0]
#rpn_boxes = rois[:, 1:5]
#print ('shape: ', rpn_boxes)
#rpn_boxes = rois / im_scales[0]
#rpn_scores = net.blobs['scores'].data.copy()
rpn_scores = np.array([[0.7]])
#print ('shape1: ', rpn_scores)
# use softmax estimated probabilities
pred_scores = blobs_out['cls_prob']
#print ('shape2: ', pred_scores)
# Apply bounding-box regression deltas by accessing blob with name bbox_pred
box_deltas = blobs_out['bbox_pred']
#print 'box_deltas: ', (box_deltas.max())*16
pred_boxes = bbox_transform_inv(rpn_boxes, box_deltas)
pred_boxes = clip_boxes(pred_boxes, im.shape)
#print ('pred_boxes: ', pred_boxes)
orient_prob = blobs_out['orient_prob']
#orient_prob = np.zeros((len(pred_scores),4), dtype='float')
if extract_feat == True:
conv_feat = net.blobs['conv5_3'].data.copy()
#print conv_feat.shape
return rpn_boxes, rpn_scores, pred_boxes, pred_scores, orient_prob, conv_feat
return rpn_boxes, rpn_scores, pred_boxes, pred_scores, orient_prob
#return rpn_boxes, rpn_scores, pred_boxes
def vis_detections(im, class_name, dets, thresh=0.3):
"""Visual debugging of detections."""
import matplotlib.pyplot as plt
im = im[:, :, (2, 1, 0)]
for i in xrange(np.minimum(10, dets.shape[0])):
bbox = dets[i, :4]
score = dets[i, -1]
if score > thresh:
plt.cla()
plt.imshow(im)
plt.gca().add_patch(
plt.Rectangle((bbox[0], bbox[1]),
bbox[2] - bbox[0],
bbox[3] - bbox[1], fill=False,
edgecolor='g', linewidth=3)
)
plt.title('{} {:.3f}'.format(class_name, score))
plt.show()
def apply_nms(all_boxes, thresh):
"""Apply non-maximum suppression to all predicted boxes output by the
test_net method.
"""
num_classes = len(all_boxes)
num_images = len(all_boxes[0])
nms_boxes = [[[] for _ in xrange(num_images)]
for _ in xrange(num_classes)]
for cls_ind in xrange(num_classes):
for im_ind in xrange(num_images):
dets = all_boxes[cls_ind][im_ind]
if dets == []:
continue
# CPU NMS is much faster than GPU NMS when the number of boxes
# is relative small (e.g., < 10k)
# TODO(rbg): autotune NMS dispatch
keep = nms(dets, thresh, force_cpu=True)
if len(keep) == 0:
continue
nms_boxes[cls_ind][im_ind] = dets[keep, :].copy()
return nms_boxes
def vis_detections_rpn(fname, class_name, dets, scores, im_name):
"""Visual debugging of detections."""
for i in xrange(np.minimum(len(scores), dets.shape[0])):
#print im_name
im = cv2.imread(fname)
bbox = map(int, dets[i, :])
score = scores[i]
txt = str(score)
cv2.rectangle(im, (bbox[0], bbox[1]), (bbox[2], bbox[3]), [0,0,255], 2, 16)
ret, baseline = cv2.getTextSize(txt, cv2.FONT_HERSHEY_SIMPLEX, 0.6, 1)
cv2.rectangle(im, (bbox[0], bbox[1] - ret[1] - baseline),(bbox[0] + ret[0], bbox[1]), (255, 0, 0), -1)
cv2.putText(im, txt, (bbox[0], bbox[1] - baseline),
cv2.FONT_HERSHEY_SIMPLEX, 0.6, (255, 255, 255), 1, 16)
foldername = '/home/javed/1070/Projects/py-faster-rcnn-full_shift/data/output_rpn/' + im_name + '/'
if not os.path.isdir(foldername):
os.makedirs(foldername)
filename = foldername + str(i) + '.jpg'
#print filename
cv2.imwrite(filename, im)
#def vis_detections_final(im, class_name, all_final_boxes, im_name,thresh):
def vis_detections_final(im, class_name, all_final_boxes, im_name,thresh, cntG,cntR, cG, cR, rpn_sscores, rpn_bo, all_final_boxes_rotated):
"""Visual debugging of detections."""
#print 'i am in visualizer'
#print len(all_final_boxes)
boxes = all_final_boxes[:,:4]
scores = all_final_boxes[:,4]
scor = all_final_boxes[:,10]
rpnns = all_final_boxes[:,6:10]
xAll = all_final_boxes_rotated[:,:4]
yAll = all_final_boxes_rotated[:,4:8]
orient_class = all_final_boxes[:,5]
s=[]
for i in xrange(len(scores)):
bbox = map(int, boxes[i,:])
#rpn_bo = map(int, rpnns[i,:])
score = scores[i]
orient_cls = orient_class[i]
rpn_s = scor[i]
if score > thresh:
#print 'greater than thresh'
#print bbox
txt = class_name + ': ' + str(orient_cls) + ': ' + str(score)
#txt = class_name + ': ' + str(orient_cls) + ': ' + str(rpn_s)
#print rpn_sscores
s.append(score)
#cv2.rectangle(im, (bbox[0], bbox[1]), (bbox[2], bbox[3]), [0,0,255], 2, 16)
#cv2.rectangle(im, (rpn_bo[0], rpn_bo[1]), (rpn_bo[2], rpn_bo[3]), [255,0,255], 2, 16)
#print('writing done')
#ret, baseline = cv2.getTextSize(txt, cv2.FONT_HERSHEY_SIMPLEX, 0.6, 1)
#cv2.rectangle(im, (bbox[0], bbox[1] + ret[1] + baseline),
# (bbox[0] + ret[0], bbox[1]), (255, 0, 0), -1)
#cv2.putText(im, txt, (bbox[0], bbox[1] + ret[1]+ baseline),
# cv2.FONT_HERSHEY_SIMPLEX, 0.6, (255, 255, 255), 1, 16)
pts = np.array([[xAll[i,0],yAll[i,0]],[xAll[i,1],yAll[i,1]],[xAll[i,3],yAll[i,3]],[xAll[i,2],yAll[i,2]]], np.int32)
#cv2.polylines(im, [pts],True,(0,255,255), 2)
#cv2.polylines(im, [pts],True,(128,0,255), 2) #voilet like
cv2.polylines(im, [pts],True,(147, 20,255), 6) # pink like
if s:
# print type(scores)
# print 'max: ', max(scores)
if (class_name == 'Gun'):
cntG = max(s)+cntG
cG=cG+1
if (class_name == 'Riffle'):
cntR = max(s)+cntR
cR=cR+1
#print (cntG,cntR)
#print (cG,cR)
return im,cntG,cntR, cG, cR
#return im
def test_net(net, imdb, max_per_image=100, thresh=0.05, vis=False):
"""Test a Fast R-CNN network on an image database."""
num_images = len(imdb.image_index)
'''foldername = '/home/javed/1070/Projects/py-faster-rcnn-master/data/output_images_detected/'
foldername_all = '/home/javed/1070/Projects/py-faster-rcnn-master/data/output_images_all/'
net2 = caffe.Net('/home/javed/1070/Projects/py-faster-rcnn-master/models/pascal_voc/VGG16/faster_rcnn_alt_opt/faster_rcnn_test_2.pt', '/home/javed/1070/Projects/py-faster-rcnn-master/output/faster_rcnn_alt_opt/voc_2007_trainval/VGG16_faster_rcnn_final.caffemodel', caffe.TEST) '''
foldername = '/media/akhtar/6D2C8F896B2F79E0/Projects/py-faster-rcnn-master/data/output_images_detected/'
foldername_all = '/home/itu/faster-rcnn-1070/data/output_images_all/'
'''net2 = caffe.Net('/home/itu/faster-rcnn-1070/models/pascal_voc/VGG16/faster_rcnn_alt_opt/faster_rcnn_test_3.pt', '/home/itu/faster-rcnn-1070/output/faster_rcnn_alt_opt/voc_2007_trainval/VGG16_faster_rcnn_final.caffemodel', caffe.TEST) '''
all_boxes = [[] for _ in xrange(num_images)]
ntopProp = [1,4,50,100,300]
ntopProp = [300]
#ntopProp = [50]
theta = [0, 90, 135, 45, 157.5, 112.5, 67.5, 22.5]
#theta = [45,90,135,45, 157.5, 112.5,67.5, 22.5]
for t in xrange(0,len(ntopProp)):
output_dir = get_output_dir(imdb, net)
# timers
_t = {'im_detect' : Timer(), 'misc' : Timer()}
if not cfg.TEST.HAS_RPN:
roidb = imdb.roidb
all_final_boxes = [[[] for _ in xrange(num_images)]
for _ in xrange(imdb.num_classes)]
all_final_boxes_rotated = [[[] for _ in xrange(num_images)]
for _ in xrange(imdb.num_classes)]
all_rpn_boxes = [[[] for _ in xrange(num_images)]
for _ in xrange(1)]
#print('all_final_boxes_rotated :', all_final_boxes_rotated)
cntG = 0
cntR = 0
cG = 0
cR = 0
for i in xrange(num_images):
# filter out any ground truth boxes
if cfg.TEST.HAS_RPN:
box_proposals = None
else:
# The roidb may contain ground-truth rois (for example, if the roidb
# comes from the training or val split). We only want to evaluate
# detection on the *non*-ground-truth rois. We select those the rois
# that have the gt_classes field set to 0, which means there's no
# ground truth.
box_proposals = roidb[i]['boxes'][roidb[i]['gt_classes'] == 0]
fname = imdb.image_path_at(i)
ind = fname.rindex('/')
ind_end = fname.rindex('.')
filename = fname[ind+1:ind_end]
print filename
im = cv2.imread(imdb.image_path_at(i))
fname = foldername + filename + '.jpg'
'''rpn_boxes_rot = np.zeros((1,4))
rpn_scores_rot = np.zeros((1))
final_boxes_rot = np.zeros((1,12))
final_scores_rot = np.zeros((1,3))
orient_prob_rot = np.zeros((1,8))'''
_t['im_detect'].tic()
#print 'first pass'
#rpn_boxes, rpn_scores, final_boxes, final_scores, orient_score, conv_feat, f_shape = im_detect(net, im, box_proposals, True)
rpn_boxes, rpn_scores, final_boxes, final_scores, orient_score, final_boxes1, final_scores1, transApplied = im_detect(net, im, box_proposals, True)
#print('orient_scores: ', orient_score.shape)
#print conv_feat.shape
#in_feat = np.rollaxis(conv_feat, 1, 4)
#print in_feat.sum()
if ntopProp[t] == 300:
if len(rpn_scores) > 299:
rpn_boxes = rpn_boxes[0:ntopProp[t],:]
rpn_scores = rpn_scores[0:ntopProp[t],:]
final_boxes = final_boxes[0:ntopProp[t],:]
final_scores = final_scores[0:ntopProp[t],:]
orient_scores = orient_score[0:ntopProp[t],:]
final_boxes1 = final_boxes1[0:ntopProp[t],:]
final_scores1 = final_scores1[0:ntopProp[t],:]
transApplied = transApplied[0:ntopProp[t],:,:,:]
else:
rpn_boxes = rpn_boxes[0:ntopProp[t],:]
rpn_scores = rpn_scores[0:ntopProp[t],:]
final_boxes = final_boxes[0:ntopProp[t],:]
final_scores = final_scores[0:ntopProp[t],:]
orient_scores = orient_score[0:ntopProp[t],:]
final_boxes1 = final_boxes1[0:ntopProp[t],:]
final_scores1 = final_scores1[0:ntopProp[t],:]
transApplied = transApplied[0:ntopProp[t],:,:,:]
#print('orient_scores: ', orient_scores.shape)
#top_proposals_pass_2 = 50
temp_boxes = None
blobs, im_scales = _get_blobs(im, temp_boxes)
#print len(rpn_boxes)
rotatedBoxesAll = np.zeros((len(rpn_boxes), 3,2,4))
for iii in range(0, len(rpn_boxes)):
final_boxes_tr = final_boxes1[iii,:]
#print('final_boxes_tr :', final_boxes_tr)
final_boxes_tr = ((final_boxes_tr * im_scales[0]) / 16)
final_boxes_tr = trans_box1(final_boxes_tr,transApplied[iii,0,:,:],transApplied[iii,1,:,:])
final_boxes_tr = ((final_boxes_tr * 16) / im_scales[0])
rotatedBoxesAll[iii, :,:,:] = final_boxes_tr[0,:,:,:]
#print('rotatedBoxesAll :', rotatedBoxesAll.shape)
#vis_detections_rpn(fname, 'fireArm', rpn_boxes, rpn_scores, filename)
#print hi
rpn_dets = np.hstack((rpn_boxes, rpn_scores)) \
.astype(np.float32, copy=False)
all_rpn_boxes[0][i] = rpn_dets
_t['misc'].tic()
# skip j = 0, because it's the background class
#maxScore = np.maximum(final_scores1, final_scores)
maxScore = final_scores1
for j in xrange(1, imdb.num_classes):
#inds = np.where(final_scores1[:, j] > thresh)[0]
#cls_scores = final_scores1[inds, j]
inds = np.where(maxScore[:, j] > thresh)[0]
cls_scores = maxScore[inds, j]
cls_boxes = final_boxes[inds, j*4:(j+1)*4]
cls_orient = np.argmax(orient_score[inds, :], axis = 1)
rpn_bboxes = rpn_boxes[inds,:]
rpn_sscores = rpn_scores[inds]
cls_scores1 = final_scores[inds, j]
rotatedBoxesClass = np.hstack((rotatedBoxesAll[inds,j,0,:], rotatedBoxesAll[inds,j,1,:])).astype(np.float32, copy=False)
#print('rotatedBoxesClass :', rotatedBoxesClass.shape)
cls_dets_temp_rotated = np.hstack((rotatedBoxesAll[inds,j,0,:], rotatedBoxesAll[inds,j,1,:], cls_scores[:, np.newaxis])) \
.astype(np.float32, copy=False)
cls_dets_temp = np.hstack((cls_boxes, cls_scores[:, np.newaxis])) \
.astype(np.float32, copy=False)
#print('cls_dets_temp', cls_dets_temp.shape)
cls_dets = np.hstack((cls_boxes, cls_scores[:, np.newaxis], cls_orient[:, np.newaxis], rpn_bboxes, rpn_sscores)) \
.astype(np.float32, copy=False)
'''keep = py_cpu_nms(cls_dets_temp_rotated, 0.4)
cls_dets = cls_dets[keep, :]
rotatedBoxesClass = rotatedBoxesClass[keep, :]
cls_dets_temp = cls_dets_temp[keep,:]'''
keep = nms(cls_dets_temp, cfg.TEST.NMS)
#keep = nms(cls_dets_temp, 0.3)
cls_dets = cls_dets[keep, :]
rotatedBoxesClass = rotatedBoxesClass[keep, :]
'''cls_dets_temp_rotated = cls_dets_temp_rotated[keep,:]
keep = py_cpu_nms(cls_dets_temp_rotated, 0.4)
#print('keep :', keep)
cls_dets = cls_dets[keep, :]
rotatedBoxesClass = rotatedBoxesClass[keep, :]'''
all_final_boxes[j][i] = cls_dets
all_final_boxes_rotated[j][i] = rotatedBoxesClass
#print('rotatedBoxesClass :', rotatedBoxesClass.shape, cls_dets.shape)
#print('all_final_boxes_rotated :', all_final_boxes_rotated)
#print('all_final_boxes :', all_final_boxes)
# Limit to max_per_image detections *over all classes*
if max_per_image > 0:
image_scores = np.hstack([all_final_boxes[j][i][:, 4]
for j in xrange(1, imdb.num_classes)])
if len(image_scores) > max_per_image:
image_thresh = np.sort(image_scores)[-max_per_image]
for j in xrange(1, imdb.num_classes):
keep = np.where(all_final_boxes[j][i][:, -1] >= image_thresh)[0]
all_final_boxes[j][i] = all_final_boxes[j][i][keep, :]
all_final_boxes_rotated[j][i] = all_final_boxes_rotated[j][i][keep, :]
for j in xrange(1, imdb.num_classes):
#rpn_bo = np.array([616, 405, 825, 556])
#rpn_bo = np.array([231,129,621,939])
rpn_bo = np.array([208, 58, 2243, 1094])
#im = vis_detections_final(im, imdb.classes[j], all_final_boxes[j][i], filename, 0.65)
im,cntG,cntR, cG, cR = vis_detections_final(im, imdb.classes[j], all_final_boxes[j][i], filename, 0.75, cntG,cntR, cG, cR, rpn_sscores, rpn_bo, all_final_boxes_rotated[j][i])
#print hi
fname = foldername_all + filename + '.jpg'
print fname
cv2.imwrite(fname, im)
_t['misc'].toc()
print 'im_detect: {:d}/{:d} {:.3f}s {:.3f}s' \
.format(i + 1, num_images, _t['im_detect'].average_time,
_t['misc'].average_time)
#print('all_rpn_boxes', len(all_rpn_boxes), len(all_final_boxes), output_dir)
#print ('Evaluating RPN detections for top Proposals: ' + str(ntopProp[t]) )
#imdb.evaluate_rpn(all_rpn_boxes, output_dir, ntopProp[t])
#print ('Evaluating detections for top Proposals: ' + str(ntopProp[t]) )
#imdb.evaluate_detections(all_final_boxes, output_dir,ntopProp[t])
def trans_box1(final_boxes,T_final, T11):
final_boxes = final_boxes.reshape(1,12)
final_boxes_final = np.zeros((len(final_boxes),3, 2,4))
#print('final_boxes :', final_boxes.shape, final_boxes_final.shape)
for k in range(0, len(final_boxes)):
#print('k :', k)
class1 = final_boxes[k,0:4]
class2 = final_boxes[k,4:8]
class3 = final_boxes[k,8:12]
box1 = [ class1[0] , class1[1] , class1[2] , class1[3] ]
box2 = [ class2[0] , class2[1] , class2[2] , class2[3] ]
box3 = [ class3[0] , class3[1] , class3[2] , class3[3] ]
class1_out = trans_layer1(T_final, T11, box1)
class2_out = trans_layer1(T_final, T11, box2)
class3_out = trans_layer1(T_final, T11, box3)
final_boxes_final[k,0,:,:] = class1_out
final_boxes_final[k,1,:,:] = class2_out
final_boxes_final[k,2,:,:] = class2_out
#final_boxes_final[k,:] = [ class1_out[0], class1_out[1], class1_out[2], class1_out[3], class2_out[0], class2_out[1], class2_out[2], class2_out[3], class3_out[0], class3_out[1], class3_out[2], class3_out[3]]
return final_boxes_final
def trans_layer1(T_final,T11, final_b):
nT0 = inv(T11)
ncorner_pts = [[final_b[0],final_b[2],final_b[0],final_b[2]],[final_b[1],final_b[1],final_b[3],final_b[3]],[1,1,1,1]]
nboxx = np.dot(nT0[0:2,:],ncorner_pts)
rxymin_nb = nboxx.min(1)
rxymax_nb = nboxx.max(1)
T2 = inv(T_final)
boxx2 = np.dot(T2[0:2,:],[nboxx[0], nboxx[1],[1,1,1,1]])
#print('nboxx', nboxx.shape, boxx2.shape)
#fin_cropped_box = [rxymin_nb[0], rxymin_nb[1], rxymin_nb[0], rxymin_nb[1]]
return boxx2
| [
1,
396,
448,
2683,
2683,
2683,
26589,
13,
29937,
23786,
390,
29899,
29907,
10262,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29945,
7783,
13,
29937,
10413,
21144,
1090,
450,
341,
1806,
19245,
518,
4149,
365,
2965,
1430,
1660,
363,
4902,
29962,
13,
29937,
16849,
841,
491,
529,
5813,
29958,
13,
29937,
448,
2683,
2683,
2683,
26589,
13,
13,
29937,
3382,
2164,
491,
25778,
1988,
2318,
732,
1806,
29965,
29899,
349,
348,
29926,
370,
13,
13,
15945,
29908,
3057,
263,
23786,
390,
29899,
29907,
10262,
3564,
373,
385,
527,
2585,
313,
3027,
2566,
467,
15945,
29908,
13,
13,
3166,
5172,
29918,
2214,
15755,
29889,
2917,
1053,
274,
16434,
29892,
679,
29918,
4905,
29918,
3972,
13,
3166,
5172,
29918,
2214,
15755,
29889,
29890,
1884,
29918,
9067,
1053,
20102,
29918,
1884,
267,
29892,
289,
1884,
29918,
9067,
29918,
11569,
13,
29937,
3166,
5172,
29918,
2214,
15755,
29889,
615,
1958,
29918,
9067,
1053,
4327,
261,
29918,
13148,
408,
1301,
29918,
13148,
13,
5215,
1852,
5510,
13,
3166,
3667,
29879,
29889,
20404,
1053,
29168,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
13,
3166,
12655,
29889,
29880,
979,
29887,
1053,
2437,
13,
5215,
274,
3470,
29872,
13,
3166,
5172,
29918,
2214,
15755,
29889,
29876,
1516,
29918,
17699,
1053,
302,
1516,
13,
5215,
274,
29925,
860,
280,
13,
3166,
3667,
29879,
29889,
10054,
1053,
527,
29918,
1761,
29918,
517,
29918,
10054,
13,
5215,
2897,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
4903,
29889,
300,
929,
29889,
2642,
9643,
408,
382,
29911,
13,
5215,
330,
29883,
13,
13,
29937,
3166,
302,
1516,
29889,
2272,
29918,
21970,
29918,
29876,
1516,
29918,
5450,
630,
1053,
11451,
29918,
21970,
29918,
29876,
1516,
13,
13,
1753,
903,
657,
29918,
3027,
29918,
10054,
29898,
326,
1125,
13,
1678,
9995,
1168,
369,
1372,
385,
1967,
964,
263,
3564,
1881,
29889,
13,
13,
1678,
11842,
9331,
29901,
13,
4706,
527,
313,
299,
2378,
1125,
263,
2927,
1967,
297,
350,
14345,
1797,
13,
13,
1678,
16969,
29901,
13,
4706,
23755,
313,
299,
2378,
1125,
263,
848,
23755,
13587,
385,
1967,
11451,
2572,
333,
13,
4706,
527,
29918,
7052,
29918,
17028,
943,
313,
1761,
1125,
1051,
310,
1967,
23431,
313,
22925,
304,
527,
29897,
1304,
13,
9651,
297,
278,
1967,
11451,
2572,
333,
13,
1678,
9995,
13,
1678,
527,
29918,
12683,
353,
527,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
5574,
29897,
13,
1678,
527,
29918,
12683,
22361,
274,
16434,
29889,
2227,
29990,
6670,
29918,
2303,
2190,
29903,
13,
13,
1678,
527,
29918,
12181,
353,
527,
29918,
12683,
29889,
12181,
13,
1678,
527,
29918,
2311,
29918,
1195,
353,
7442,
29889,
1195,
29898,
326,
29918,
12181,
29961,
29900,
29901,
29906,
2314,
13,
1678,
527,
29918,
2311,
29918,
3317,
353,
7442,
29889,
3317,
29898,
326,
29918,
12181,
29961,
29900,
29901,
29906,
2314,
13,
13,
1678,
19356,
29918,
9893,
353,
5159,
13,
1678,
527,
29918,
7052,
29918,
17028,
943,
353,
5159,
13,
13,
1678,
363,
3646,
29918,
2311,
297,
274,
16434,
29889,
18267,
29889,
29903,
5454,
17101,
29901,
13,
4706,
527,
29918,
7052,
353,
5785,
29898,
5182,
29918,
2311,
29897,
847,
5785,
29898,
326,
29918,
2311,
29918,
1195,
29897,
13,
4706,
396,
4721,
794,
278,
24842,
9685,
515,
1641,
901,
1135,
18134,
29918,
14226,
13,
4706,
565,
7442,
29889,
14486,
29898,
326,
29918,
7052,
334,
527,
29918,
2311,
29918,
3317,
29897,
1405,
274,
16434,
29889,
18267,
29889,
12648,
29918,
14226,
29901,
13,
9651,
527,
29918,
7052,
353,
5785,
29898,
16859,
29889,
18267,
29889,
12648,
29918,
14226,
29897,
847,
5785,
29898,
326,
29918,
2311,
29918,
3317,
29897,
13,
4706,
527,
353,
13850,
29906,
29889,
21476,
29898,
326,
29918,
12683,
29892,
6213,
29892,
6213,
29892,
285,
29916,
29922,
326,
29918,
7052,
29892,
285,
29891,
29922,
326,
29918,
7052,
29892,
13,
462,
4706,
29694,
29922,
11023,
29906,
29889,
23845,
29918,
18521,
1718,
29897,
13,
4706,
527,
29918,
7052,
29918,
17028,
943,
29889,
4397,
29898,
326,
29918,
7052,
29897,
13,
4706,
19356,
29918,
9893,
29889,
4397,
29898,
326,
29897,
13,
13,
1678,
396,
6204,
263,
23755,
304,
4808,
278,
1881,
4558,
13,
1678,
23755,
353,
527,
29918,
1761,
29918,
517,
29918,
10054,
29898,
5014,
287,
29918,
9893,
29897,
13,
13,
1678,
736,
23755,
29892,
7442,
29889,
2378,
29898,
326,
29918,
7052,
29918,
17028,
943,
29897,
13,
13,
1753,
903,
657,
29918,
307,
275,
29918,
10054,
29898,
326,
29918,
307,
275,
29892,
527,
29918,
7052,
29918,
17028,
943,
1125,
13,
1678,
9995,
1168,
369,
1372,
1528,
3624,
964,
3564,
10970,
29889,
13,
13,
1678,
11842,
9331,
29901,
13,
4706,
527,
29918,
307,
275,
313,
299,
2378,
1125,
390,
921,
29871,
29946,
4636,
310,
1528,
3624,
297,
2441,
1967,
10350,
13,
4706,
527,
29918,
7052,
29918,
17028,
943,
313,
1761,
1125,
6287,
13879,
408,
4133,
491,
903,
657,
29918,
3027,
29918,
10054,
13,
13,
1678,
16969,
29901,
13,
4706,
23755,
313,
299,
2378,
1125,
390,
921,
29871,
29945,
4636,
310,
1528,
3624,
297,
278,
1967,
11451,
2572,
333,
13,
1678,
9995,
13,
1678,
696,
275,
29892,
11174,
353,
903,
4836,
29918,
326,
29918,
307,
275,
29898,
326,
29918,
307,
275,
29892,
527,
29918,
7052,
29918,
17028,
943,
29897,
13,
1678,
696,
275,
29918,
10054,
353,
7442,
29889,
29882,
1429,
3552,
5563,
29879,
29892,
696,
275,
876,
13,
1678,
736,
696,
275,
29918,
10054,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
13,
1753,
903,
4836,
29918,
326,
29918,
307,
275,
29898,
326,
29918,
307,
275,
29892,
23431,
1125,
13,
1678,
9995,
7653,
1967,
1528,
3624,
964,
278,
1967,
11451,
2572,
333,
4240,
491,
903,
657,
29918,
3027,
29918,
10054,
29889,
13,
13,
1678,
11842,
9331,
29901,
13,
4706,
527,
29918,
307,
275,
313,
299,
2378,
1125,
390,
921,
29871,
29946,
4636,
310,
1528,
3624,
297,
2441,
1967,
10350,
13,
4706,
23431,
313,
1761,
1125,
6287,
13879,
408,
4133,
491,
903,
657,
29918,
3027,
29918,
10054,
13,
13,
1678,
16969,
29901,
13,
4706,
696,
275,
313,
299,
2378,
1125,
390,
921,
29871,
29946,
4636,
310,
2060,
287,
1528,
29902,
10350,
13,
4706,
11174,
313,
1761,
1125,
1967,
11451,
2572,
333,
11174,
1304,
491,
1269,
2060,
287,
1528,
29902,
13,
1678,
9995,
13,
1678,
527,
29918,
307,
275,
353,
527,
29918,
307,
275,
29889,
579,
668,
29898,
9302,
29889,
7411,
29892,
3509,
29922,
8824,
29897,
13,
13,
1678,
565,
7431,
29898,
19529,
267,
29897,
1405,
29871,
29896,
29901,
13,
4706,
2920,
29879,
353,
527,
29918,
307,
275,
7503,
29892,
29871,
29906,
29962,
448,
527,
29918,
307,
275,
7503,
29892,
29871,
29900,
29962,
718,
29871,
29896,
13,
4706,
3171,
29879,
353,
527,
29918,
307,
275,
7503,
29892,
29871,
29941,
29962,
448,
527,
29918,
307,
275,
7503,
29892,
29871,
29896,
29962,
718,
29871,
29896,
13,
13,
4706,
10161,
353,
2920,
29879,
334,
3171,
29879,
13,
4706,
6287,
29881,
29918,
598,
294,
353,
10161,
7503,
29892,
7442,
29889,
1482,
8990,
29962,
334,
313,
19529,
267,
29961,
9302,
29889,
1482,
8990,
29892,
584,
29962,
3579,
29871,
29906,
29897,
13,
4706,
2923,
29918,
598,
294,
353,
7442,
29889,
6897,
29898,
7052,
29881,
29918,
598,
294,
448,
29871,
29906,
29906,
29946,
334,
29871,
29906,
29906,
29946,
29897,
13,
4706,
11174,
353,
2923,
29918,
598,
294,
29889,
1191,
1195,
29898,
8990,
29922,
29896,
29897,
7503,
29892,
7442,
29889,
1482,
8990,
29962,
13,
1678,
1683,
29901,
13,
4706,
11174,
353,
7442,
29889,
3298,
359,
3552,
326,
29918,
307,
275,
29889,
12181,
29961,
29900,
1402,
29871,
29896,
511,
26688,
29922,
9302,
29889,
524,
29897,
13,
13,
1678,
696,
275,
353,
527,
29918,
307,
275,
334,
23431,
29961,
5563,
29879,
29962,
13,
13,
1678,
736,
696,
275,
29892,
11174,
13,
13,
1753,
903,
657,
29918,
10054,
29879,
29898,
326,
29892,
696,
275,
1125,
13,
1678,
9995,
18455,
385,
1967,
322,
1528,
3624,
2629,
393,
1967,
964,
3564,
10970,
1213,
15945,
13,
1678,
23755,
29879,
353,
11117,
1272,
29915,
584,
6213,
29892,
525,
307,
275,
29915,
584,
6213,
29913,
13,
1678,
23755,
29879,
1839,
1272,
7464,
527,
29918,
7052,
29918,
17028,
943,
353,
903,
657,
29918,
3027,
29918,
10054,
29898,
326,
29897,
13,
1678,
565,
451,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
23755,
29879,
1839,
307,
275,
2033,
353,
903,
657,
29918,
307,
275,
29918,
10054,
29898,
307,
275,
29892,
527,
29918,
7052,
29918,
17028,
943,
29897,
13,
12,
29937,
2158,
6702,
645,
29880,
29901,
13420,
23755,
29879,
1839,
307,
275,
11287,
13,
1678,
736,
23755,
29879,
29892,
527,
29918,
7052,
29918,
17028,
943,
13,
13,
1753,
527,
29918,
4801,
522,
29898,
1212,
29892,
527,
29892,
16273,
29922,
8516,
29892,
6597,
29918,
1725,
271,
29922,
8824,
1125,
13,
1678,
9995,
6362,
522,
1203,
4413,
297,
385,
1967,
2183,
1203,
9551,
1338,
29889,
13,
13,
1678,
11842,
9331,
29901,
13,
4706,
7787,
313,
1113,
17615,
29889,
6779,
1125,
23786,
390,
29899,
29907,
10262,
3564,
304,
671,
13,
4706,
527,
313,
299,
2378,
1125,
2927,
1967,
304,
1243,
313,
262,
350,
14345,
1797,
29897,
13,
4706,
16273,
313,
299,
2378,
1125,
390,
921,
29871,
29946,
1409,
310,
1203,
9551,
1338,
470,
6213,
313,
1454,
390,
15695,
29897,
13,
13,
1678,
16969,
29901,
13,
4706,
19435,
313,
299,
2378,
1125,
390,
921,
476,
1409,
310,
1203,
770,
19435,
313,
29968,
7805,
13,
9651,
3239,
408,
1203,
7663,
29871,
29900,
29897,
13,
4706,
16273,
313,
299,
2378,
1125,
390,
921,
313,
29946,
29930,
29968,
29897,
1409,
310,
25383,
3216,
292,
16273,
13,
1678,
9995,
13,
1678,
23755,
29879,
29892,
527,
29918,
19529,
267,
353,
903,
657,
29918,
10054,
29879,
29898,
326,
29892,
16273,
29897,
13,
1678,
396,
2158,
525,
10054,
29879,
29901,
13420,
23755,
29879,
13,
13,
1678,
396,
1932,
10417,
515,
1967,
16641,
3624,
304,
4682,
2910,
16641,
3624,
29892,
727,
29915,
29879,
777,
13995,
292,
13,
1678,
396,
313,
5372,
8359,
1967,
16641,
3624,
679,
20545,
304,
278,
1021,
4682,
16641,
29902,
467,
13,
1678,
396,
2266,
29892,
591,
12439,
7929,
4682,
16641,
3624,
29892,
577,
591,
871,
10272,
5680,
13,
1678,
396,
373,
278,
5412,
11306,
29889,
13,
1678,
565,
274,
16434,
29889,
2287,
29928,
4897,
29918,
8456,
29990,
2890,
1405,
29871,
29900,
322,
451,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
325,
353,
7442,
29889,
2378,
4197,
29896,
29892,
29871,
29896,
29872,
29941,
29892,
29871,
29896,
29872,
29953,
29892,
29871,
29896,
29872,
29929,
29892,
29871,
29896,
29872,
29896,
29906,
2314,
13,
4706,
6608,
267,
353,
7442,
29889,
14486,
29898,
10054,
29879,
1839,
307,
275,
2033,
334,
274,
16434,
29889,
2287,
29928,
4897,
29918,
8456,
29990,
2890,
467,
6333,
29898,
29894,
29897,
13,
4706,
17117,
2380,
29892,
2437,
29918,
2248,
353,
7442,
29889,
13092,
29898,
8568,
267,
29892,
736,
29918,
2248,
29922,
5574,
29892,
13,
462,
462,
4706,
736,
29918,
262,
3901,
29922,
5574,
29897,
13,
4706,
23755,
29879,
1839,
307,
275,
2033,
353,
23755,
29879,
1839,
307,
275,
2033,
29961,
2248,
29892,
584,
29962,
13,
4706,
16273,
353,
16273,
29961,
2248,
29892,
584,
29962,
13,
12,
29937,
2158,
6702,
645,
29880,
29901,
13420,
451,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29897,
13,
13,
1678,
565,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
527,
29918,
10054,
353,
23755,
29879,
1839,
1272,
2033,
13,
4706,
17667,
29918,
12181,
353,
527,
29918,
10054,
29889,
12181,
13,
12,
29937,
2158,
6702,
645,
29880,
29901,
13420,
17667,
29918,
12181,
29897,
13,
4706,
23755,
29879,
1839,
326,
29918,
3888,
2033,
353,
7442,
29889,
2378,
29898,
13,
9651,
5519,
326,
29918,
10054,
29889,
12181,
29961,
29906,
1402,
527,
29918,
10054,
29889,
12181,
29961,
29941,
1402,
527,
29918,
19529,
267,
29961,
29900,
5262,
1402,
13,
9651,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
4706,
1596,
23755,
29879,
1839,
326,
29918,
3888,
2033,
13,
13,
13,
1678,
396,
620,
14443,
3564,
10970,
13,
13,
1678,
7787,
29889,
10054,
29879,
1839,
1272,
13359,
690,
14443,
10456,
29898,
10054,
29879,
1839,
1272,
13359,
12181,
876,
13,
13,
1678,
565,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
7787,
29889,
10054,
29879,
1839,
326,
29918,
3888,
13359,
690,
14443,
10456,
29898,
10054,
29879,
1839,
326,
29918,
3888,
13359,
12181,
876,
13,
1678,
1683,
29901,
13,
4706,
7787,
29889,
10054,
29879,
1839,
307,
275,
13359,
690,
14443,
10456,
29898,
10054,
29879,
1839,
307,
275,
13359,
12181,
876,
13,
13,
1678,
396,
437,
6375,
13,
1678,
6375,
29918,
19290,
353,
11117,
1272,
2396,
23755,
29879,
1839,
1272,
13359,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
2915,
13,
1678,
565,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
6375,
29918,
19290,
1839,
326,
29918,
3888,
2033,
353,
23755,
29879,
1839,
326,
29918,
3888,
13359,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
1678,
1683,
29901,
13,
4706,
6375,
29918,
19290,
1839,
307,
275,
2033,
353,
23755,
29879,
1839,
307,
275,
13359,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
13,
308,
13,
1678,
396,
2158,
877,
17696,
304,
7787,
6375,
1495,
13,
1678,
23755,
29879,
29918,
449,
353,
7787,
29889,
11333,
29898,
1068,
11333,
29918,
19290,
29897,
13,
1678,
396,
2158,
877,
10054,
29879,
29961,
307,
275,
29962,
29871,
584,
13420,
23755,
29879,
29918,
449,
29897,
13,
13,
1678,
396,
2158,
6702,
2962,
29918,
513,
29901,
13420,
1051,
29898,
1212,
3032,
13148,
29918,
7039,
876,
13,
1678,
619,
353,
1051,
29898,
1212,
3032,
13148,
29918,
7039,
467,
2248,
877,
307,
29875,
29918,
10109,
29945,
1495,
13,
1678,
304,
567,
353,
17288,
1212,
3032,
10054,
29918,
7039,
29961,
5365,
1402,
7787,
29889,
10054,
29879,
29961,
1212,
3032,
10054,
29918,
7039,
29961,
5365,
29962,
1822,
1272,
29889,
12181,
29897,
363,
4768,
297,
1051,
29898,
1212,
3032,
3332,
29918,
4841,
29898,
492,
28166,
13,
1678,
396,
1454,
4768,
297,
3464,
29898,
2435,
29898,
1761,
29898,
1212,
3032,
13148,
29918,
7039,
876,
1125,
13,
12,
29937,
2158,
6702,
12199,
29901,
13420,
7787,
3032,
10054,
29918,
7039,
29961,
5365,
29962,
1919,
1212,
29889,
10054,
29879,
29961,
1212,
3032,
10054,
29918,
7039,
29961,
5365,
29962,
1822,
1272,
29889,
12181,
29897,
13,
1678,
14550,
2158,
619,
13,
1678,
1596,
1051,
29898,
1212,
3032,
3332,
29918,
4841,
29898,
492,
8243,
7787,
3032,
10054,
29918,
7039,
29961,
29906,
29947,
29962,
13,
1678,
1596,
7787,
29889,
10054,
29879,
1839,
307,
275,
13359,
1272,
29889,
12181,
13,
1678,
363,
10377,
297,
3464,
313,
29941,
29945,
1125,
13,
12,
2158,
10377,
29892,
7787,
3032,
10054,
29918,
7039,
29961,
666,
29962,
12008,
13,
13,
1678,
565,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
4974,
7431,
29898,
326,
29918,
19529,
267,
29897,
1275,
29871,
29896,
29892,
376,
11730,
2323,
29899,
3027,
9853,
8762,
29908,
13,
4706,
696,
275,
353,
7787,
29889,
10054,
29879,
1839,
307,
275,
13359,
1272,
29889,
8552,
580,
13,
12,
13,
12,
29937,
2158,
877,
307,
275,
584,
742,
696,
275,
29961,
29900,
29892,
29901,
2314,
13,
13,
12,
29937,
443,
7052,
1250,
304,
10650,
1967,
2913,
13,
4706,
364,
21257,
29918,
1884,
267,
353,
696,
275,
7503,
29892,
29871,
29896,
29901,
29945,
29962,
847,
527,
29918,
19529,
267,
29961,
29900,
29962,
13,
12,
29937,
2158,
6702,
12181,
29901,
13420,
364,
21257,
29918,
1884,
267,
29889,
12181,
29897,
13,
12,
19080,
29876,
29918,
1557,
2361,
353,
7787,
29889,
10054,
29879,
1839,
1557,
2361,
13359,
1272,
29889,
8552,
580,
13,
13,
12,
11965,
29918,
1557,
2361,
353,
7787,
29889,
10054,
29879,
1839,
25932,
29918,
22795,
13359,
1272,
29889,
8552,
580,
13,
12,
1884,
29918,
29881,
2152,
294,
353,
7787,
29889,
10054,
29879,
1839,
29890,
1884,
29918,
11965,
13359,
1272,
29889,
8552,
580,
13,
12,
29937,
1884,
29918,
29881,
2152,
294,
353,
23755,
29879,
29918,
449,
1839,
29890,
1884,
29918,
11965,
29896,
2033,
13,
4706,
4450,
29918,
1884,
267,
353,
289,
1884,
29918,
9067,
29918,
11569,
29898,
19080,
29876,
29918,
1884,
267,
29892,
3800,
29918,
29881,
2152,
294,
29897,
13,
12,
29937,
11965,
29918,
1884,
267,
353,
7442,
29889,
29882,
1429,
3552,
19080,
29876,
29918,
1884,
267,
29892,
364,
21257,
29918,
1884,
267,
29892,
364,
21257,
29918,
1884,
267,
876,
13,
4706,
4450,
29918,
1884,
267,
353,
20102,
29918,
1884,
267,
29898,
11965,
29918,
1884,
267,
29892,
527,
29889,
12181,
29897,
13,
13,
12,
29937,
2158,
877,
2388,
584,
742,
364,
21257,
29918,
1884,
267,
7503,
29945,
29900,
29892,
29901,
1402,
4450,
29918,
1884,
267,
7503,
29945,
29900,
29892,
29901,
2314,
13,
12,
12236,
29918,
22795,
353,
7787,
29889,
10054,
29879,
1839,
12236,
29918,
22795,
13359,
1272,
29889,
8552,
580,
13,
13,
12,
4495,
9795,
307,
275,
353,
7787,
29889,
10054,
29879,
1839,
4495,
9795,
307,
275,
13359,
1272,
29889,
8552,
580,
13,
12,
3286,
2052,
2957,
353,
7787,
29889,
10054,
29879,
1839,
3286,
2052,
2957,
13359,
1272,
29889,
8552,
580,
13,
12,
19080,
29876,
29918,
1884,
267,
29896,
353,
1370,
9795,
307,
275,
7503,
29892,
29871,
29896,
29901,
29945,
29962,
847,
527,
29918,
19529,
267,
29961,
29900,
29962,
13,
13,
4706,
396,
671,
4964,
3317,
15899,
2070,
11614,
13,
4706,
4450,
29918,
1557,
2361,
29896,
353,
23755,
29879,
29918,
449,
1839,
25932,
29918,
22795,
29896,
2033,
13,
12,
29937,
2158,
525,
326,
29918,
4801,
522,
29915,
13,
12,
29937,
2158,
313,
11965,
29918,
1557,
2361,
29889,
12181,
29897,
13,
4706,
396,
2401,
368,
3216,
292,
29899,
1884,
17855,
628,
29873,
294,
491,
17378,
23755,
411,
1024,
289,
1884,
29918,
11965,
13,
4706,
3800,
29918,
29881,
2152,
294,
29896,
353,
23755,
29879,
29918,
449,
1839,
29890,
1884,
29918,
11965,
29896,
2033,
13,
4706,
4450,
29918,
1884,
267,
29896,
353,
289,
1884,
29918,
9067,
29918,
11569,
29898,
19080,
29876,
29918,
1884,
267,
29896,
29892,
3800,
29918,
29881,
2152,
294,
29896,
29897,
13,
12,
29937,
11965,
29918,
1884,
267,
29896,
353,
7442,
29889,
29882,
1429,
3552,
19080,
29876,
29918,
1884,
267,
29896,
29892,
364,
21257,
29918,
1884,
267,
29896,
29892,
364,
21257,
29918,
1884,
267,
29896,
876,
13,
4706,
396,
11965,
29918,
1884,
267,
29896,
353,
20102,
29918,
1884,
267,
29898,
11965,
29918,
1884,
267,
29896,
29892,
527,
29889,
12181,
29897,
13,
13,
4706,
396,
12236,
29918,
22795,
353,
23755,
29879,
29918,
449,
1839,
12236,
29918,
22795,
2033,
13,
12,
29937,
12236,
29918,
22795,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
11965,
29918,
1557,
2361,
511,
29946,
511,
26688,
2433,
7411,
1495,
13,
308,
13,
12,
29937,
443,
7052,
1250,
304,
10650,
1967,
2913,
13,
4706,
14550,
19080,
29876,
29918,
1884,
267,
353,
696,
275,
7503,
29892,
29871,
29896,
29901,
29945,
29962,
847,
527,
29918,
19529,
267,
29961,
29900,
29962,
13,
12,
29937,
2158,
6702,
12181,
29901,
13420,
364,
21257,
29918,
1884,
267,
29961,
29946,
29945,
29901,
29953,
29900,
29892,
29901,
2314,
13,
12,
19080,
29876,
29918,
1557,
2361,
353,
7787,
29889,
10054,
29879,
1839,
1557,
2361,
13359,
1272,
29889,
8552,
580,
13,
13,
4706,
396,
671,
4964,
3317,
15899,
2070,
11614,
13,
4706,
4450,
29918,
1557,
2361,
353,
23755,
29879,
29918,
449,
1839,
25932,
29918,
22795,
2033,
13,
12,
29937,
2158,
525,
326,
29918,
4801,
522,
29915,
13,
12,
29937,
2158,
313,
11965,
29918,
1557,
2361,
29889,
12181,
29897,
13,
4706,
396,
2401,
368,
3216,
292,
29899,
1884,
17855,
628,
29873,
294,
491,
17378,
23755,
411,
1024,
289,
1884,
29918,
11965,
13,
4706,
3800,
29918,
29881,
2152,
294,
353,
23755,
29879,
29918,
449,
1839,
29890,
1884,
29918,
11965,
2033,
13,
4706,
4450,
29918,
1884,
267,
353,
289,
1884,
29918,
9067,
29918,
11569,
29898,
19080,
29876,
29918,
1884,
267,
29892,
3800,
29918,
29881,
2152,
294,
29897,
13,
4706,
4450,
29918,
1884,
267,
353,
20102,
29918,
1884,
267,
29898,
11965,
29918,
1884,
267,
29892,
527,
29889,
12181,
29897,
13,
13,
4706,
7769,
29918,
22795,
353,
23755,
29879,
29918,
449,
1839,
12236,
29918,
22795,
2033,
13,
12,
29937,
12236,
29918,
22795,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
11965,
29918,
1557,
2361,
511,
29946,
511,
26688,
2433,
7411,
1495,
13,
13,
4706,
565,
6597,
29918,
1725,
271,
1275,
5852,
29901,
13,
308,
12,
20580,
29918,
1725,
271,
353,
7787,
29889,
10054,
29879,
1839,
20580,
29945,
29918,
29941,
13359,
1272,
29889,
8552,
580,
13,
18884,
396,
2158,
7602,
29918,
1725,
271,
29889,
12181,
13,
12,
12,
2457,
364,
21257,
29918,
1884,
267,
29892,
364,
21257,
29918,
1557,
2361,
29892,
4450,
29918,
1884,
267,
29892,
4450,
29918,
1557,
2361,
29892,
7769,
29918,
22795,
29892,
7602,
29918,
1725,
271,
29892,
17667,
29918,
12181,
12008,
13,
13,
13,
13,
1678,
736,
364,
21257,
29918,
1884,
267,
29892,
364,
21257,
29918,
1557,
2361,
29892,
4450,
29918,
1884,
267,
29892,
4450,
29918,
1557,
2361,
29892,
7769,
29918,
22795,
29892,
4450,
29918,
1884,
267,
29896,
29892,
4450,
29918,
1557,
2361,
29896,
29892,
1301,
2052,
2957,
13,
13,
13,
1753,
527,
29918,
4801,
522,
29918,
1482,
29898,
1212,
29892,
527,
29892,
29871,
3635,
29918,
12181,
29892,
23755,
29879,
29892,
696,
893,
29892,
326,
29918,
19529,
267,
29892,
16273,
29922,
8516,
29892,
6597,
29918,
1725,
271,
29922,
8824,
1125,
13,
1678,
9995,
6362,
522,
1203,
4413,
297,
385,
1967,
2183,
1203,
9551,
1338,
29889,
13,
13,
1678,
11842,
9331,
29901,
13,
4706,
7787,
313,
1113,
17615,
29889,
6779,
1125,
23786,
390,
29899,
29907,
10262,
3564,
304,
671,
13,
4706,
527,
313,
299,
2378,
1125,
2927,
1967,
304,
1243,
313,
262,
350,
14345,
1797,
29897,
13,
4706,
16273,
313,
299,
2378,
1125,
390,
921,
29871,
29946,
1409,
310,
1203,
9551,
1338,
470,
6213,
313,
1454,
390,
15695,
29897,
13,
13,
1678,
16969,
29901,
13,
4706,
19435,
313,
299,
2378,
1125,
390,
921,
476,
1409,
310,
1203,
770,
19435,
313,
29968,
7805,
13,
9651,
3239,
408,
1203,
7663,
29871,
29900,
29897,
13,
4706,
16273,
313,
299,
2378,
1125,
390,
921,
313,
29946,
29930,
29968,
29897,
1409,
310,
25383,
3216,
292,
16273,
13,
1678,
9995,
13,
13,
1678,
396,
10054,
29879,
29892,
527,
29918,
19529,
267,
353,
903,
657,
29918,
10054,
29879,
29898,
326,
29892,
16273,
29897,
13,
1678,
396,
1932,
10417,
515,
1967,
16641,
3624,
304,
4682,
2910,
16641,
3624,
29892,
727,
29915,
29879,
777,
13995,
292,
13,
1678,
396,
313,
5372,
8359,
1967,
16641,
3624,
679,
20545,
304,
278,
1021,
4682,
16641,
29902,
467,
13,
1678,
396,
2266,
29892,
591,
12439,
7929,
4682,
16641,
3624,
29892,
577,
591,
871,
10272,
5680,
13,
1678,
396,
373,
278,
5412,
11306,
29889,
13,
1678,
565,
274,
16434,
29889,
2287,
29928,
4897,
29918,
8456,
29990,
2890,
1405,
29871,
29900,
322,
451,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
325,
353,
7442,
29889,
2378,
4197,
29896,
29892,
29871,
29896,
29872,
29941,
29892,
29871,
29896,
29872,
29953,
29892,
29871,
29896,
29872,
29929,
29892,
29871,
29896,
29872,
29896,
29906,
2314,
13,
4706,
6608,
267,
353,
7442,
29889,
14486,
29898,
10054,
29879,
1839,
307,
275,
2033,
334,
274,
16434,
29889,
2287,
29928,
4897,
29918,
8456,
29990,
2890,
467,
6333,
29898,
29894,
29897,
13,
4706,
17117,
2380,
29892,
2437,
29918,
2248,
353,
7442,
29889,
13092,
29898,
8568,
267,
29892,
736,
29918,
2248,
29922,
5574,
29892,
13,
462,
462,
4706,
736,
29918,
262,
3901,
29922,
5574,
29897,
13,
4706,
23755,
29879,
1839,
307,
275,
2033,
353,
23755,
29879,
1839,
307,
275,
2033,
29961,
2248,
29892,
584,
29962,
13,
4706,
16273,
353,
16273,
29961,
2248,
29892,
584,
29962,
13,
13,
1678,
565,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
527,
29918,
10054,
353,
23755,
29879,
1839,
1272,
2033,
13,
4706,
396,
2158,
525,
3167,
592,
29915,
13,
4706,
396,
2158,
527,
29918,
10054,
29889,
12181,
13,
4706,
23755,
29879,
1839,
326,
29918,
3888,
2033,
353,
7442,
29889,
2378,
29898,
13,
9651,
5519,
17858,
29918,
12181,
29961,
29906,
1402,
3635,
29918,
12181,
29961,
29941,
1402,
527,
29918,
19529,
267,
29961,
29900,
5262,
1402,
13,
9651,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
13,
12,
10054,
29879,
1839,
307,
275,
2033,
353,
7442,
29889,
2378,
29898,
2124,
29897,
13,
13,
13,
1678,
396,
620,
14443,
3564,
10970,
13,
1678,
7787,
29889,
10054,
29879,
1839,
1272,
13359,
690,
14443,
10456,
29898,
10054,
29879,
1839,
1272,
13359,
12181,
876,
13,
1678,
565,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
7787,
29889,
10054,
29879,
1839,
326,
29918,
3888,
13359,
690,
14443,
10456,
29898,
10054,
29879,
1839,
326,
29918,
3888,
13359,
12181,
876,
13,
12,
29937,
2158,
525,
307,
275,
8267,
742,
7787,
29889,
10054,
29879,
1839,
307,
275,
2033,
13,
4706,
7787,
29889,
10054,
29879,
1839,
307,
275,
13359,
690,
14443,
10456,
29898,
10054,
29879,
1839,
307,
275,
13359,
12181,
876,
13,
12,
29937,
2158,
525,
307,
275,
8267,
742,
7787,
29889,
10054,
29879,
1839,
307,
275,
13359,
12181,
13,
1678,
1683,
29901,
13,
4706,
7787,
29889,
10054,
29879,
1839,
307,
275,
13359,
690,
14443,
10456,
29898,
10054,
29879,
1839,
307,
275,
13359,
12181,
876,
13,
13,
1678,
396,
437,
6375,
13,
1678,
6375,
29918,
19290,
353,
11117,
1272,
2396,
23755,
29879,
1839,
1272,
13359,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
2915,
13,
13,
1678,
565,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
6375,
29918,
19290,
1839,
326,
29918,
3888,
2033,
353,
23755,
29879,
1839,
326,
29918,
3888,
13359,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
12,
11333,
29918,
19290,
1839,
307,
275,
2033,
353,
23755,
29879,
1839,
307,
275,
13359,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
1678,
1683,
29901,
13,
4706,
6375,
29918,
19290,
1839,
307,
275,
2033,
353,
23755,
29879,
1839,
307,
275,
13359,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
13,
13,
1678,
23755,
29879,
29918,
449,
353,
7787,
29889,
11333,
29898,
1068,
11333,
29918,
19290,
29897,
13,
13,
13,
1678,
565,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
4706,
4974,
7431,
29898,
326,
29918,
19529,
267,
29897,
1275,
29871,
29896,
29892,
376,
11730,
2323,
29899,
3027,
9853,
8762,
29908,
13,
4706,
696,
275,
353,
7787,
29889,
10054,
29879,
1839,
307,
275,
13359,
1272,
29889,
8552,
580,
13,
12,
29937,
443,
7052,
1250,
304,
10650,
1967,
2913,
13,
12,
29937,
2158,
525,
262,
29915,
13,
4706,
364,
21257,
29918,
1884,
267,
353,
696,
275,
7503,
29892,
29871,
29896,
29901,
29945,
29962,
847,
527,
29918,
19529,
267,
29961,
29900,
29962,
13,
12,
29937,
19080,
29876,
29918,
1884,
267,
353,
696,
275,
7503,
29892,
29871,
29896,
29901,
29945,
29962,
268,
13,
12,
29937,
2158,
6702,
12181,
29901,
13420,
364,
21257,
29918,
1884,
267,
29897,
965,
13,
4706,
396,
19080,
29876,
29918,
1884,
267,
353,
696,
275,
847,
527,
29918,
19529,
267,
29961,
29900,
29962,
3986,
13,
12,
29937,
19080,
29876,
29918,
1557,
2361,
353,
7787,
29889,
10054,
29879,
1839,
1557,
2361,
13359,
1272,
29889,
8552,
580,
13,
12,
19080,
29876,
29918,
1557,
2361,
353,
7442,
29889,
2378,
4197,
29961,
29900,
29889,
29955,
24960,
13,
12,
29937,
2158,
6702,
12181,
29896,
29901,
13420,
364,
21257,
29918,
1557,
2361,
29897,
965,
13,
13,
4706,
396,
671,
4964,
3317,
15899,
2070,
11614,
13,
4706,
4450,
29918,
1557,
2361,
353,
23755,
29879,
29918,
449,
1839,
25932,
29918,
22795,
2033,
13,
13,
12,
29937,
2158,
6702,
12181,
29906,
29901,
13420,
4450,
29918,
1557,
2361,
29897,
965,
13,
13,
4706,
396,
2401,
368,
3216,
292,
29899,
1884,
17855,
628,
29873,
294,
491,
17378,
23755,
411,
1024,
289,
1884,
29918,
11965,
13,
4706,
3800,
29918,
29881,
2152,
294,
353,
23755,
29879,
29918,
449,
1839,
29890,
1884,
29918,
11965,
2033,
13,
12,
29937,
2158,
525,
1884,
29918,
29881,
2152,
294,
29901,
13420,
313,
1884,
29918,
29881,
2152,
294,
29889,
3317,
3101,
29930,
29896,
29953,
13,
4706,
4450,
29918,
1884,
267,
353,
289,
1884,
29918,
9067,
29918,
11569,
29898,
19080,
29876,
29918,
1884,
267,
29892,
3800,
29918,
29881,
2152,
294,
29897,
13,
4706,
4450,
29918,
1884,
267,
353,
20102,
29918,
1884,
267,
29898,
11965,
29918,
1884,
267,
29892,
527,
29889,
12181,
29897,
13,
12,
29937,
2158,
6702,
11965,
29918,
1884,
267,
29901,
13420,
4450,
29918,
1884,
267,
29897,
965,
13,
13,
4706,
7769,
29918,
22795,
353,
23755,
29879,
29918,
449,
1839,
12236,
29918,
22795,
2033,
13,
12,
29937,
12236,
29918,
22795,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
11965,
29918,
1557,
2361,
511,
29946,
511,
26688,
2433,
7411,
1495,
13,
13,
268,
12,
361,
6597,
29918,
1725,
271,
1275,
5852,
29901,
13,
308,
12,
20580,
29918,
1725,
271,
353,
7787,
29889,
10054,
29879,
1839,
20580,
29945,
29918,
29941,
13359,
1272,
29889,
8552,
580,
13,
18884,
396,
2158,
7602,
29918,
1725,
271,
29889,
12181,
13,
12,
12,
2457,
364,
21257,
29918,
1884,
267,
29892,
364,
21257,
29918,
1557,
2361,
29892,
4450,
29918,
1884,
267,
29892,
4450,
29918,
1557,
2361,
29892,
7769,
29918,
22795,
29892,
7602,
29918,
1725,
271,
13,
308,
13,
13,
1678,
736,
364,
21257,
29918,
1884,
267,
29892,
364,
21257,
29918,
1557,
2361,
29892,
4450,
29918,
1884,
267,
29892,
4450,
29918,
1557,
2361,
29892,
7769,
29918,
22795,
13,
1678,
396,
2457,
364,
21257,
29918,
1884,
267,
29892,
364,
21257,
29918,
1557,
2361,
29892,
4450,
29918,
1884,
267,
13,
13,
1753,
1998,
29918,
29881,
2650,
1953,
29898,
326,
29892,
770,
29918,
978,
29892,
1439,
29879,
29892,
266,
3781,
29922,
29900,
29889,
29941,
1125,
13,
1678,
9995,
16227,
13490,
310,
1439,
29872,
1953,
1213,
15945,
13,
1678,
1053,
22889,
29889,
2272,
5317,
408,
14770,
13,
1678,
527,
353,
527,
7503,
29892,
584,
29892,
313,
29906,
29892,
29871,
29896,
29892,
29871,
29900,
4638,
13,
1678,
363,
474,
297,
921,
3881,
29898,
9302,
29889,
1195,
12539,
29898,
29896,
29900,
29892,
1439,
29879,
29889,
12181,
29961,
29900,
12622,
29901,
13,
4706,
289,
1884,
353,
1439,
29879,
29961,
29875,
29892,
584,
29946,
29962,
13,
4706,
8158,
353,
1439,
29879,
29961,
29875,
29892,
448,
29896,
29962,
13,
4706,
565,
8158,
1405,
266,
3781,
29901,
13,
9651,
14770,
29889,
16398,
580,
13,
9651,
14770,
29889,
326,
4294,
29898,
326,
29897,
13,
9651,
14770,
29889,
29887,
1113,
2141,
1202,
29918,
5041,
29898,
13,
18884,
14770,
29889,
7364,
2521,
3552,
29890,
1884,
29961,
29900,
1402,
289,
1884,
29961,
29896,
11724,
13,
462,
795,
289,
1884,
29961,
29906,
29962,
448,
289,
1884,
29961,
29900,
1402,
13,
462,
795,
289,
1884,
29961,
29941,
29962,
448,
289,
1884,
29961,
29896,
1402,
5445,
29922,
8824,
29892,
13,
462,
795,
7636,
2780,
2433,
29887,
742,
1196,
2103,
29922,
29941,
29897,
13,
18884,
1723,
13,
9651,
14770,
29889,
3257,
877,
8875,
29871,
12365,
29889,
29941,
29888,
29913,
4286,
4830,
29898,
1990,
29918,
978,
29892,
8158,
876,
13,
9651,
14770,
29889,
4294,
580,
13,
13,
1753,
3394,
29918,
29876,
1516,
29898,
497,
29918,
1884,
267,
29892,
266,
3781,
1125,
13,
1678,
9995,
2052,
368,
1661,
29899,
27525,
398,
1462,
23881,
304,
599,
25383,
16273,
1962,
491,
278,
13,
1678,
1243,
29918,
1212,
1158,
29889,
13,
1678,
9995,
13,
1678,
954,
29918,
13203,
353,
7431,
29898,
497,
29918,
1884,
267,
29897,
13,
1678,
954,
29918,
8346,
353,
7431,
29898,
497,
29918,
1884,
267,
29961,
29900,
2314,
13,
1678,
302,
1516,
29918,
1884,
267,
353,
5519,
2636,
363,
903,
297,
921,
3881,
29898,
1949,
29918,
8346,
4638,
13,
462,
363,
903,
297,
921,
3881,
29898,
1949,
29918,
13203,
4638,
13,
1678,
363,
1067,
29879,
29918,
513,
297,
921,
3881,
29898,
1949,
29918,
13203,
1125,
13,
4706,
363,
527,
29918,
513,
297,
921,
3881,
29898,
1949,
29918,
8346,
1125,
13,
9651,
1439,
29879,
353,
599,
29918,
1884,
267,
29961,
25932,
29918,
513,
3816,
326,
29918,
513,
29962,
13,
9651,
565,
1439,
29879,
1275,
5159,
29901,
13,
18884,
6773,
13,
9651,
396,
10808,
405,
4345,
338,
1568,
8473,
1135,
22796,
405,
4345,
746,
278,
1353,
310,
16273,
13,
9651,
396,
338,
6198,
2319,
313,
29872,
29889,
29887,
1696,
529,
29871,
29896,
29900,
29895,
29897,
13,
9651,
396,
14402,
29898,
6050,
29887,
1125,
1120,
327,
1540,
405,
4345,
13916,
13,
9651,
3013,
353,
302,
1516,
29898,
29881,
1691,
29892,
266,
3781,
29892,
4889,
29918,
21970,
29922,
5574,
29897,
13,
9651,
565,
7431,
29898,
17462,
29897,
1275,
29871,
29900,
29901,
13,
18884,
6773,
13,
9651,
302,
1516,
29918,
1884,
267,
29961,
25932,
29918,
513,
3816,
326,
29918,
513,
29962,
353,
1439,
29879,
29961,
17462,
29892,
584,
1822,
8552,
580,
13,
1678,
736,
302,
1516,
29918,
1884,
267,
13,
13,
1753,
1998,
29918,
29881,
2650,
1953,
29918,
19080,
29876,
29898,
29888,
978,
29892,
770,
29918,
978,
29892,
1439,
29879,
29892,
19435,
29892,
527,
29918,
978,
1125,
13,
1678,
9995,
16227,
13490,
310,
1439,
29872,
1953,
1213,
15945,
13,
13,
1678,
363,
474,
297,
921,
3881,
29898,
9302,
29889,
1195,
12539,
29898,
2435,
29898,
1557,
2361,
511,
1439,
29879,
29889,
12181,
29961,
29900,
12622,
29901,
13,
4706,
396,
2158,
527,
29918,
978,
13,
12,
326,
353,
13850,
29906,
29889,
326,
949,
29898,
29888,
978,
29897,
13,
4706,
289,
1884,
353,
2910,
29898,
524,
29892,
1439,
29879,
29961,
29875,
29892,
584,
2314,
13,
12,
13628,
353,
19435,
29961,
29875,
29962,
13,
13,
268,
12,
3945,
353,
851,
29898,
13628,
29897,
13,
965,
13,
4706,
13850,
29906,
29889,
1621,
2521,
29898,
326,
29892,
313,
29890,
1884,
29961,
29900,
1402,
289,
1884,
29961,
29896,
11724,
313,
29890,
1884,
29961,
29906,
1402,
289,
1884,
29961,
29941,
11724,
518,
29900,
29892,
29900,
29892,
29906,
29945,
29945,
1402,
29871,
29906,
29892,
29871,
29896,
29953,
29897,
13,
268,
12,
2267,
29892,
2362,
5570,
353,
13850,
29906,
29889,
18516,
3505,
29898,
3945,
29892,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
5425,
3580,
1307,
29990,
29892,
29871,
29900,
29889,
29953,
29892,
29871,
29896,
29897,
13,
268,
12,
11023,
29906,
29889,
1621,
2521,
29898,
326,
29892,
313,
29890,
1884,
29961,
29900,
1402,
289,
1884,
29961,
29896,
29962,
448,
3240,
29961,
29896,
29962,
448,
2362,
5570,
21336,
29890,
1884,
29961,
29900,
29962,
718,
3240,
29961,
29900,
1402,
289,
1884,
29961,
29896,
11724,
313,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
511,
448,
29896,
29897,
13,
308,
13,
268,
12,
11023,
29906,
29889,
649,
1626,
29898,
326,
29892,
13872,
29892,
313,
29890,
1884,
29961,
29900,
1402,
289,
1884,
29961,
29896,
29962,
448,
2362,
5570,
511,
13,
18884,
12,
11023,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
5425,
3580,
1307,
29990,
29892,
29871,
29900,
29889,
29953,
29892,
313,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
511,
29871,
29896,
29892,
29871,
29896,
29953,
29897,
13,
13,
13,
12,
12083,
978,
353,
8207,
5184,
29914,
9494,
287,
29914,
29896,
29900,
29955,
29900,
29914,
25119,
29914,
2272,
29899,
29888,
1901,
29899,
2214,
15755,
29899,
8159,
29918,
10889,
29914,
1272,
29914,
4905,
29918,
19080,
29876,
22208,
718,
527,
29918,
978,
718,
8207,
29915,
29871,
13,
12,
361,
451,
2897,
29889,
2084,
29889,
275,
3972,
29898,
12083,
978,
1125,
29871,
13,
268,
12,
12,
359,
29889,
29885,
12535,
12935,
29898,
12083,
978,
29897,
13,
12,
9507,
353,
4138,
978,
718,
851,
29898,
29875,
29897,
718,
15300,
6173,
29915,
13,
4706,
396,
2158,
10422,
13,
4706,
13850,
29906,
29889,
326,
3539,
29898,
9507,
29892,
527,
29897,
13,
13,
29937,
1753,
1998,
29918,
29881,
2650,
1953,
29918,
8394,
29898,
326,
29892,
770,
29918,
978,
29892,
599,
29918,
8394,
29918,
1884,
267,
29892,
527,
29918,
978,
29892,
386,
3781,
1125,
13,
1753,
1998,
29918,
29881,
2650,
1953,
29918,
8394,
29898,
326,
29892,
770,
29918,
978,
29892,
599,
29918,
8394,
29918,
1884,
267,
29892,
527,
29918,
978,
29892,
386,
3781,
29892,
274,
593,
29954,
29892,
20047,
29934,
29892,
274,
29954,
29892,
274,
29934,
29892,
364,
21257,
29918,
893,
29883,
2361,
29892,
364,
21257,
29918,
833,
29892,
599,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
1125,
13,
1678,
9995,
16227,
13490,
310,
1439,
29872,
1953,
1213,
15945,
13,
1678,
396,
2158,
525,
29875,
626,
297,
7604,
3950,
29915,
13,
1678,
396,
2158,
7431,
29898,
497,
29918,
8394,
29918,
1884,
267,
29897,
13,
1678,
16273,
353,
599,
29918,
8394,
29918,
1884,
267,
7503,
29892,
29901,
29946,
29962,
13,
1678,
19435,
353,
599,
29918,
8394,
29918,
1884,
267,
7503,
29892,
29946,
29962,
13,
1678,
885,
272,
353,
599,
29918,
8394,
29918,
1884,
267,
7503,
29892,
29896,
29900,
29962,
259,
13,
1678,
364,
21257,
1983,
353,
259,
599,
29918,
8394,
29918,
1884,
267,
7503,
29892,
29953,
29901,
29896,
29900,
29962,
29871,
13,
13,
1678,
921,
3596,
353,
599,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
7503,
29892,
29901,
29946,
29962,
13,
1678,
343,
3596,
353,
599,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
7503,
29892,
29946,
29901,
29947,
29962,
13,
13,
1678,
7769,
29918,
1990,
353,
599,
29918,
8394,
29918,
1884,
267,
7503,
29892,
29945,
29962,
13,
1678,
269,
29922,
2636,
13,
1678,
363,
474,
297,
921,
3881,
29898,
2435,
29898,
1557,
2361,
22164,
13,
268,
12,
13,
12,
29890,
1884,
353,
2910,
29898,
524,
29892,
16273,
29961,
29875,
29892,
29901,
2314,
13,
12,
29937,
19080,
29876,
29918,
833,
353,
2910,
29898,
524,
29892,
364,
21257,
1983,
29961,
29875,
29892,
29901,
2314,
13,
12,
13628,
353,
19435,
29961,
29875,
29962,
13,
12,
12236,
29918,
25932,
353,
7769,
29918,
1990,
29961,
29875,
29962,
13,
12,
19080,
29876,
29918,
29879,
353,
885,
272,
29961,
29875,
29962,
13,
13,
13,
12,
361,
8158,
1405,
266,
3781,
29901,
13,
18884,
396,
2158,
525,
7979,
1008,
1135,
266,
3781,
29915,
13,
18884,
396,
2158,
289,
1884,
13,
268,
12,
12,
3945,
353,
770,
29918,
978,
718,
525,
29901,
525,
718,
851,
29898,
12236,
29918,
25932,
29897,
718,
525,
29901,
525,
718,
851,
29898,
13628,
29897,
13,
12,
12,
29937,
3945,
353,
770,
29918,
978,
718,
525,
29901,
525,
718,
851,
29898,
12236,
29918,
25932,
29897,
718,
525,
29901,
525,
718,
851,
29898,
19080,
29876,
29918,
29879,
29897,
13,
12,
12,
29937,
2158,
364,
21257,
29918,
893,
29883,
2361,
13,
12,
12,
29879,
29889,
4397,
29898,
13628,
29897,
13,
268,
12,
12,
29937,
11023,
29906,
29889,
1621,
2521,
29898,
326,
29892,
313,
29890,
1884,
29961,
29900,
1402,
289,
1884,
29961,
29896,
11724,
313,
29890,
1884,
29961,
29906,
1402,
289,
1884,
29961,
29941,
11724,
518,
29900,
29892,
29900,
29892,
29906,
29945,
29945,
1402,
29871,
29906,
29892,
29871,
29896,
29953,
29897,
13,
268,
12,
12,
29937,
11023,
29906,
29889,
1621,
2521,
29898,
326,
29892,
313,
19080,
29876,
29918,
833,
29961,
29900,
1402,
364,
21257,
29918,
833,
29961,
29896,
11724,
313,
19080,
29876,
29918,
833,
29961,
29906,
1402,
364,
21257,
29918,
833,
29961,
29941,
11724,
518,
29906,
29945,
29945,
29892,
29900,
29892,
29906,
29945,
29945,
1402,
29871,
29906,
29892,
29871,
29896,
29953,
29897,
13,
12,
12,
29937,
2158,
877,
16554,
2309,
1495,
13,
268,
12,
12,
29937,
2267,
29892,
2362,
5570,
353,
13850,
29906,
29889,
18516,
3505,
29898,
3945,
29892,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
5425,
3580,
1307,
29990,
29892,
29871,
29900,
29889,
29953,
29892,
29871,
29896,
29897,
13,
268,
12,
12,
29937,
11023,
29906,
29889,
1621,
2521,
29898,
326,
29892,
313,
29890,
1884,
29961,
29900,
1402,
289,
1884,
29961,
29896,
29962,
718,
3240,
29961,
29896,
29962,
718,
2362,
5570,
511,
13,
18884,
396,
29871,
12,
12,
29898,
29890,
1884,
29961,
29900,
29962,
718,
3240,
29961,
29900,
1402,
289,
1884,
29961,
29896,
11724,
313,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
511,
448,
29896,
29897,
13,
308,
13,
268,
12,
12,
29937,
11023,
29906,
29889,
649,
1626,
29898,
326,
29892,
13872,
29892,
313,
29890,
1884,
29961,
29900,
1402,
289,
1884,
29961,
29896,
29962,
718,
3240,
29961,
29896,
10062,
2362,
5570,
511,
13,
18884,
12,
29937,
12,
11023,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
5425,
3580,
1307,
29990,
29892,
29871,
29900,
29889,
29953,
29892,
313,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
511,
29871,
29896,
29892,
29871,
29896,
29953,
29897,
13,
13,
12,
12,
16485,
353,
7442,
29889,
2378,
4197,
29961,
29916,
3596,
29961,
29875,
29892,
29900,
1402,
29891,
3596,
29961,
29875,
29892,
29900,
29962,
16272,
29916,
3596,
29961,
29875,
29892,
29896,
1402,
29891,
3596,
29961,
29875,
29892,
29896,
29962,
16272,
29916,
3596,
29961,
29875,
29892,
29941,
1402,
29891,
3596,
29961,
29875,
29892,
29941,
29962,
16272,
29916,
3596,
29961,
29875,
29892,
29906,
1402,
29891,
3596,
29961,
29875,
29892,
29906,
5262,
1402,
7442,
29889,
524,
29941,
29906,
29897,
13,
12,
12,
29937,
11023,
29906,
29889,
3733,
2904,
1475,
29898,
326,
29892,
518,
16485,
1402,
5574,
22657,
29900,
29892,
29906,
29945,
29945,
29892,
29906,
29945,
29945,
511,
29871,
29906,
29897,
13,
12,
12,
29937,
11023,
29906,
29889,
3733,
2904,
1475,
29898,
326,
29892,
518,
16485,
1402,
5574,
22657,
29896,
29906,
29947,
29892,
29900,
29892,
29906,
29945,
29945,
511,
29871,
29906,
29897,
396,
1365,
488,
29873,
763,
13,
12,
12,
11023,
29906,
29889,
3733,
2904,
1475,
29898,
326,
29892,
518,
16485,
1402,
5574,
22657,
29896,
29946,
29955,
29892,
29871,
29906,
29900,
29892,
29906,
29945,
29945,
511,
29871,
29953,
29897,
396,
282,
682,
763,
13,
13,
1678,
565,
269,
29901,
13,
29937,
12,
2158,
1134,
29898,
1557,
2361,
29897,
13,
29937,
12,
2158,
525,
3317,
29901,
13420,
4236,
29898,
1557,
2361,
29897,
13,
13,
12,
1678,
565,
313,
1990,
29918,
978,
1275,
525,
29954,
348,
29374,
13,
12,
12,
20047,
29954,
353,
4236,
29898,
29879,
7240,
20047,
29954,
13,
12,
12,
29883,
29954,
29922,
29883,
29954,
29974,
29896,
13,
13,
12,
1678,
565,
313,
1990,
29918,
978,
1275,
525,
29934,
2593,
280,
29374,
13,
12,
12,
20047,
29934,
353,
4236,
29898,
29879,
7240,
20047,
29934,
13,
12,
12,
29883,
29934,
29922,
29883,
29934,
29974,
29896,
13,
13,
1678,
396,
2158,
313,
20047,
29954,
29892,
20047,
29934,
29897,
13,
1678,
396,
2158,
313,
29883,
29954,
29892,
29883,
29934,
29897,
13,
13,
1678,
736,
527,
29892,
20047,
29954,
29892,
20047,
29934,
29892,
274,
29954,
29892,
274,
29934,
13,
1678,
396,
2457,
527,
13,
13,
1753,
1243,
29918,
1212,
29898,
1212,
29892,
527,
2585,
29892,
4236,
29918,
546,
29918,
3027,
29922,
29896,
29900,
29900,
29892,
266,
3781,
29922,
29900,
29889,
29900,
29945,
29892,
1998,
29922,
8824,
1125,
13,
1678,
9995,
3057,
263,
23786,
390,
29899,
29907,
10262,
3564,
373,
385,
1967,
2566,
1213,
15945,
13,
1678,
954,
29918,
8346,
353,
7431,
29898,
326,
2585,
29889,
3027,
29918,
2248,
29897,
13,
1678,
14550,
12083,
978,
353,
8207,
5184,
29914,
9494,
287,
29914,
29896,
29900,
29955,
29900,
29914,
25119,
29914,
2272,
29899,
29888,
1901,
29899,
2214,
15755,
29899,
6207,
29914,
1272,
29914,
4905,
29918,
8346,
29918,
4801,
26458,
22208,
29871,
13,
1678,
4138,
978,
29918,
497,
353,
8207,
5184,
29914,
9494,
287,
29914,
29896,
29900,
29955,
29900,
29914,
25119,
29914,
2272,
29899,
29888,
1901,
29899,
2214,
15755,
29899,
6207,
29914,
1272,
29914,
4905,
29918,
8346,
29918,
497,
22208,
13,
13,
1678,
7787,
29906,
353,
274,
3470,
29872,
29889,
6779,
11219,
5184,
29914,
9494,
287,
29914,
29896,
29900,
29955,
29900,
29914,
25119,
29914,
2272,
29899,
29888,
1901,
29899,
2214,
15755,
29899,
6207,
29914,
9794,
29914,
18182,
1052,
29918,
29894,
542,
29914,
29963,
26788,
29896,
29953,
29914,
29888,
1901,
29918,
2214,
15755,
29918,
1997,
29918,
3670,
29914,
29888,
1901,
29918,
2214,
15755,
29918,
1688,
29918,
29906,
29889,
415,
742,
8207,
5184,
29914,
9494,
287,
29914,
29896,
29900,
29955,
29900,
29914,
25119,
29914,
2272,
29899,
29888,
1901,
29899,
2214,
15755,
29899,
6207,
29914,
4905,
29914,
29888,
1901,
29918,
2214,
15755,
29918,
1997,
29918,
3670,
29914,
29894,
542,
29918,
29906,
29900,
29900,
29955,
29918,
14968,
791,
29914,
29963,
26788,
29896,
29953,
29918,
29888,
1901,
29918,
2214,
15755,
29918,
8394,
29889,
1113,
600,
331,
27224,
742,
274,
3470,
29872,
29889,
18267,
29897,
14550,
13,
13,
1678,
4138,
978,
353,
8207,
9799,
29914,
557,
400,
279,
29914,
29953,
29928,
29906,
29907,
29947,
29943,
29947,
29929,
29953,
29933,
29906,
29943,
29955,
29929,
29923,
29900,
29914,
25119,
29914,
2272,
29899,
29888,
1901,
29899,
2214,
15755,
29899,
6207,
29914,
1272,
29914,
4905,
29918,
8346,
29918,
4801,
26458,
22208,
29871,
13,
1678,
4138,
978,
29918,
497,
353,
8207,
5184,
29914,
1981,
29914,
29888,
1901,
29899,
2214,
15755,
29899,
29896,
29900,
29955,
29900,
29914,
1272,
29914,
4905,
29918,
8346,
29918,
497,
22208,
13,
13,
1678,
14550,
1212,
29906,
353,
274,
3470,
29872,
29889,
6779,
11219,
5184,
29914,
1981,
29914,
29888,
1901,
29899,
2214,
15755,
29899,
29896,
29900,
29955,
29900,
29914,
9794,
29914,
18182,
1052,
29918,
29894,
542,
29914,
29963,
26788,
29896,
29953,
29914,
29888,
1901,
29918,
2214,
15755,
29918,
1997,
29918,
3670,
29914,
29888,
1901,
29918,
2214,
15755,
29918,
1688,
29918,
29941,
29889,
415,
742,
8207,
5184,
29914,
1981,
29914,
29888,
1901,
29899,
2214,
15755,
29899,
29896,
29900,
29955,
29900,
29914,
4905,
29914,
29888,
1901,
29918,
2214,
15755,
29918,
1997,
29918,
3670,
29914,
29894,
542,
29918,
29906,
29900,
29900,
29955,
29918,
14968,
791,
29914,
29963,
26788,
29896,
29953,
29918,
29888,
1901,
29918,
2214,
15755,
29918,
8394,
29889,
1113,
600,
331,
27224,
742,
274,
3470,
29872,
29889,
18267,
29897,
14550,
13,
13,
1678,
599,
29918,
1884,
267,
353,
518,
2636,
363,
903,
297,
921,
3881,
29898,
1949,
29918,
8346,
4638,
13,
13,
1678,
302,
3332,
20420,
353,
518,
29896,
29892,
29946,
29892,
29945,
29900,
29892,
29896,
29900,
29900,
29892,
29941,
29900,
29900,
29962,
13,
1678,
302,
3332,
20420,
353,
518,
29941,
29900,
29900,
29962,
13,
1678,
396,
593,
459,
20420,
353,
518,
29945,
29900,
29962,
13,
1678,
278,
941,
353,
518,
29900,
29892,
29871,
29929,
29900,
29892,
29871,
29896,
29941,
29945,
29892,
29871,
29946,
29945,
29892,
29871,
29896,
29945,
29955,
29889,
29945,
29892,
29871,
29896,
29896,
29906,
29889,
29945,
29892,
29871,
29953,
29955,
29889,
29945,
29892,
29871,
29906,
29906,
29889,
29945,
29962,
13,
1678,
396,
3416,
353,
518,
29946,
29945,
29892,
29929,
29900,
29892,
29896,
29941,
29945,
29892,
29946,
29945,
29892,
29871,
29896,
29945,
29955,
29889,
29945,
29892,
29871,
29896,
29896,
29906,
29889,
29945,
29892,
29953,
29955,
29889,
29945,
29892,
29871,
29906,
29906,
29889,
29945,
29962,
13,
13,
1678,
363,
260,
297,
921,
3881,
29898,
29900,
29892,
2435,
29898,
593,
459,
20420,
22164,
13,
268,
12,
4905,
29918,
3972,
353,
679,
29918,
4905,
29918,
3972,
29898,
326,
2585,
29892,
7787,
29897,
13,
13,
268,
12,
29937,
5335,
414,
13,
268,
12,
29918,
29873,
353,
11117,
326,
29918,
4801,
522,
29915,
584,
29168,
3285,
525,
29885,
10669,
29915,
584,
29168,
28296,
13,
13,
268,
12,
361,
451,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
308,
12,
1007,
29890,
353,
527,
2585,
29889,
1007,
29890,
13,
13,
268,
12,
497,
29918,
8394,
29918,
1884,
267,
353,
5519,
2636,
363,
903,
297,
921,
3881,
29898,
1949,
29918,
8346,
4638,
13,
462,
29871,
12,
1454,
903,
297,
921,
3881,
29898,
326,
2585,
29889,
1949,
29918,
13203,
4638,
13,
13,
12,
497,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
353,
5519,
2636,
363,
903,
297,
921,
3881,
29898,
1949,
29918,
8346,
4638,
13,
462,
29871,
12,
1454,
903,
297,
921,
3881,
29898,
326,
2585,
29889,
1949,
29918,
13203,
4638,
13,
13,
268,
12,
497,
29918,
19080,
29876,
29918,
1884,
267,
353,
5519,
2636,
363,
903,
297,
921,
3881,
29898,
1949,
29918,
8346,
4638,
13,
462,
29871,
12,
1454,
903,
297,
921,
3881,
29898,
29896,
4638,
13,
13,
12,
29937,
2158,
877,
497,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
584,
742,
599,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
29897,
13,
12,
20047,
29954,
353,
29871,
29900,
13,
12,
20047,
29934,
353,
29871,
29900,
13,
12,
29883,
29954,
353,
29871,
29900,
13,
12,
29883,
29934,
353,
29871,
29900,
13,
13,
268,
12,
1454,
474,
297,
921,
3881,
29898,
1949,
29918,
8346,
1125,
13,
308,
12,
29937,
4175,
714,
738,
5962,
8760,
16273,
13,
308,
12,
361,
274,
16434,
29889,
18267,
29889,
29950,
3289,
29918,
29934,
15695,
29901,
13,
632,
12,
12,
1884,
29918,
771,
1066,
1338,
353,
6213,
13,
308,
12,
2870,
29901,
13,
632,
12,
29937,
450,
696,
333,
29890,
1122,
1712,
5962,
29899,
509,
2806,
696,
275,
313,
1454,
1342,
29892,
565,
278,
696,
333,
29890,
13,
632,
12,
29937,
5304,
515,
278,
6694,
470,
659,
6219,
467,
1334,
871,
864,
304,
14707,
13,
632,
12,
29937,
15326,
373,
278,
334,
5464,
29930,
29899,
2057,
29899,
509,
2806,
696,
275,
29889,
1334,
1831,
1906,
278,
696,
275,
13,
632,
12,
29937,
393,
505,
278,
330,
29873,
29918,
13203,
1746,
731,
304,
29871,
29900,
29892,
607,
2794,
727,
29915,
29879,
694,
13,
632,
12,
29937,
5962,
8760,
29889,
13,
632,
12,
12,
1884,
29918,
771,
1066,
1338,
353,
696,
333,
29890,
29961,
29875,
22322,
1884,
267,
2033,
29961,
1007,
29890,
29961,
29875,
22322,
4141,
29918,
13203,
2033,
1275,
29871,
29900,
29962,
13,
29871,
13,
12,
12,
29888,
978,
353,
527,
2585,
29889,
3027,
29918,
2084,
29918,
271,
29898,
29875,
29897,
13,
12,
12,
513,
353,
285,
978,
29889,
29878,
2248,
11219,
1495,
13,
12,
12,
513,
29918,
355,
353,
285,
978,
29889,
29878,
2248,
12839,
1495,
13,
12,
12,
9507,
353,
285,
978,
29961,
513,
29974,
29896,
29901,
513,
29918,
355,
29962,
13,
18884,
1596,
10422,
13,
13,
308,
12,
326,
353,
13850,
29906,
29889,
326,
949,
29898,
326,
2585,
29889,
3027,
29918,
2084,
29918,
271,
29898,
29875,
876,
13,
13,
12,
12,
29888,
978,
353,
4138,
978,
718,
10422,
718,
15300,
6173,
29915,
13,
13,
12,
12,
12008,
19080,
29876,
29918,
1884,
267,
29918,
5450,
353,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29946,
876,
13,
18884,
364,
21257,
29918,
1557,
2361,
29918,
5450,
353,
7442,
29889,
3298,
359,
3552,
29896,
876,
13,
18884,
2186,
29918,
1884,
267,
29918,
5450,
353,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29896,
29906,
876,
13,
18884,
2186,
29918,
1557,
2361,
29918,
5450,
353,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29941,
876,
13,
18884,
7769,
29918,
22795,
29918,
5450,
353,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29947,
876,
12008,
13,
13,
308,
12,
29918,
29873,
1839,
326,
29918,
4801,
522,
13359,
29873,
293,
580,
13,
18884,
396,
2158,
525,
4102,
1209,
29915,
13,
308,
12,
13,
18884,
396,
19080,
29876,
29918,
1884,
267,
29892,
364,
21257,
29918,
1557,
2361,
29892,
2186,
29918,
1884,
267,
29892,
2186,
29918,
1557,
2361,
29892,
7769,
29918,
13628,
29892,
7602,
29918,
1725,
271,
29892,
285,
29918,
12181,
353,
527,
29918,
4801,
522,
29898,
1212,
29892,
527,
29892,
3800,
29918,
771,
1066,
1338,
29892,
5852,
29897,
13,
18884,
364,
21257,
29918,
1884,
267,
29892,
364,
21257,
29918,
1557,
2361,
29892,
2186,
29918,
1884,
267,
29892,
2186,
29918,
1557,
2361,
29892,
7769,
29918,
13628,
29892,
2186,
29918,
1884,
267,
29896,
29892,
2186,
29918,
1557,
2361,
29896,
29892,
1301,
2052,
2957,
353,
527,
29918,
4801,
522,
29898,
1212,
29892,
527,
29892,
3800,
29918,
771,
1066,
1338,
29892,
5852,
29897,
13,
462,
13,
13,
12,
12,
29937,
2158,
877,
12236,
29918,
1557,
2361,
29901,
29871,
13420,
7769,
29918,
13628,
29889,
12181,
29897,
13,
18884,
396,
2158,
7602,
29918,
1725,
271,
29889,
12181,
13,
18884,
396,
262,
29918,
1725,
271,
353,
7442,
29889,
1467,
433,
11497,
29898,
20580,
29918,
1725,
271,
29892,
29871,
29896,
29892,
29871,
29946,
29897,
259,
13,
18884,
396,
2158,
297,
29918,
1725,
271,
29889,
2083,
580,
13,
13,
18884,
565,
302,
3332,
20420,
29961,
29873,
29962,
1275,
29871,
29941,
29900,
29900,
29901,
13,
12,
12,
12,
361,
7431,
29898,
19080,
29876,
29918,
1557,
2361,
29897,
1405,
29871,
29906,
29929,
29929,
29901,
13,
12,
12,
12,
12,
19080,
29876,
29918,
1884,
267,
353,
364,
21257,
29918,
1884,
267,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
12,
19080,
29876,
29918,
1557,
2361,
353,
364,
21257,
29918,
1557,
2361,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
12,
8394,
29918,
1884,
267,
353,
2186,
29918,
1884,
267,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
12,
8394,
29918,
1557,
2361,
353,
2186,
29918,
1557,
2361,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
462,
18884,
7769,
29918,
1557,
2361,
353,
7769,
29918,
13628,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
12,
8394,
29918,
1884,
267,
29896,
353,
2186,
29918,
1884,
267,
29896,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
12,
8394,
29918,
1557,
2361,
29896,
353,
2186,
29918,
1557,
2361,
29896,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
12,
3286,
2052,
2957,
353,
1301,
2052,
2957,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
29901,
29892,
29901,
29892,
17531,
13,
12,
12,
2870,
29901,
12,
13,
12,
12,
12,
19080,
29876,
29918,
1884,
267,
353,
364,
21257,
29918,
1884,
267,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
19080,
29876,
29918,
1557,
2361,
353,
364,
21257,
29918,
1557,
2361,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
8394,
29918,
1884,
267,
353,
2186,
29918,
1884,
267,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
8394,
29918,
1557,
2361,
353,
2186,
29918,
1557,
2361,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
462,
4706,
7769,
29918,
1557,
2361,
353,
7769,
29918,
13628,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
8394,
29918,
1884,
267,
29896,
353,
2186,
29918,
1884,
267,
29896,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
8394,
29918,
1557,
2361,
29896,
353,
2186,
29918,
1557,
2361,
29896,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
17531,
13,
12,
12,
12,
3286,
2052,
2957,
353,
1301,
2052,
2957,
29961,
29900,
29901,
593,
459,
20420,
29961,
29873,
1402,
29901,
29892,
29901,
29892,
17531,
13,
13,
12,
12,
29937,
2158,
877,
12236,
29918,
1557,
2361,
29901,
29871,
13420,
7769,
29918,
1557,
2361,
29889,
12181,
29897,
13,
12,
12,
29937,
3332,
29918,
771,
1066,
1338,
29918,
3364,
29918,
29906,
353,
29871,
29945,
29900,
13,
18884,
5694,
29918,
1884,
267,
353,
6213,
13,
18884,
23755,
29879,
29892,
527,
29918,
19529,
267,
353,
903,
657,
29918,
10054,
29879,
29898,
326,
29892,
5694,
29918,
1884,
267,
29897,
13,
18884,
396,
2158,
7431,
29898,
19080,
29876,
29918,
1884,
267,
29897,
13,
13,
12,
12,
5450,
630,
3313,
267,
3596,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
19080,
29876,
29918,
1884,
267,
511,
29871,
29941,
29892,
29906,
29892,
29946,
876,
13,
12,
12,
1454,
474,
2236,
297,
3464,
29898,
29900,
29892,
7431,
29898,
19080,
29876,
29918,
1884,
267,
22164,
13,
12,
12,
12,
8394,
29918,
1884,
267,
29918,
509,
353,
2186,
29918,
1884,
267,
29896,
29961,
25609,
29892,
17531,
13,
12,
12,
12,
29937,
2158,
877,
8394,
29918,
1884,
267,
29918,
509,
584,
742,
2186,
29918,
1884,
267,
29918,
509,
29897,
13,
12,
12,
12,
8394,
29918,
1884,
267,
29918,
509,
353,
5135,
8394,
29918,
1884,
267,
29918,
509,
334,
527,
29918,
19529,
267,
29961,
29900,
2314,
847,
29871,
29896,
29953,
29897,
13,
13,
12,
12,
12,
8394,
29918,
1884,
267,
29918,
509,
353,
1301,
29918,
1884,
29896,
29898,
8394,
29918,
1884,
267,
29918,
509,
29892,
3286,
2052,
2957,
29961,
25609,
29892,
29900,
29892,
29901,
29892,
29901,
1402,
3286,
2052,
2957,
29961,
25609,
29892,
29896,
29892,
29901,
29892,
29901,
2314,
13,
12,
12,
12,
13,
12,
12,
12,
8394,
29918,
1884,
267,
29918,
509,
353,
5135,
8394,
29918,
1884,
267,
29918,
509,
334,
29871,
29896,
29953,
29897,
847,
527,
29918,
19529,
267,
29961,
29900,
2314,
13,
13,
12,
12,
12,
5450,
630,
3313,
267,
3596,
29961,
25609,
29892,
584,
29892,
29901,
29892,
17531,
353,
2186,
29918,
1884,
267,
29918,
509,
29961,
29900,
29892,
29901,
29892,
29901,
29892,
17531,
13,
12,
12,
12,
13,
13,
12,
12,
13,
13,
18884,
396,
2158,
877,
5450,
630,
3313,
267,
3596,
584,
742,
5731,
630,
3313,
267,
3596,
29889,
12181,
29897,
259,
13,
308,
12,
29937,
1730,
29918,
29881,
2650,
1953,
29918,
19080,
29876,
29898,
29888,
978,
29892,
525,
8696,
27429,
742,
364,
21257,
29918,
1884,
267,
29892,
364,
21257,
29918,
1557,
2361,
29892,
10422,
29897,
13,
18884,
396,
2158,
7251,
13,
13,
1678,
12,
12,
19080,
29876,
29918,
29881,
1691,
353,
7442,
29889,
29882,
1429,
3552,
19080,
29876,
29918,
1884,
267,
29892,
364,
21257,
29918,
1557,
2361,
876,
320,
13,
462,
12,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
12,
12,
497,
29918,
19080,
29876,
29918,
1884,
267,
29961,
29900,
3816,
29875,
29962,
353,
364,
21257,
29918,
29881,
1691,
13,
13,
13,
308,
12,
29918,
29873,
1839,
29885,
10669,
13359,
29873,
293,
580,
13,
13,
308,
12,
29937,
14383,
432,
353,
29871,
29900,
29892,
1363,
372,
29915,
29879,
278,
3239,
770,
13,
12,
12,
29937,
3317,
20097,
353,
7442,
29889,
27525,
398,
29898,
8394,
29918,
1557,
2361,
29896,
29892,
2186,
29918,
1557,
2361,
29897,
13,
12,
12,
3317,
20097,
353,
2186,
29918,
1557,
2361,
29896,
13,
308,
12,
1454,
432,
297,
921,
3881,
29898,
29896,
29892,
527,
2585,
29889,
1949,
29918,
13203,
1125,
13,
12,
12,
12,
29937,
12772,
353,
7442,
29889,
3062,
29898,
8394,
29918,
1557,
2361,
29896,
7503,
29892,
432,
29962,
1405,
266,
3781,
9601,
29900,
29962,
13,
12,
12,
12,
29937,
25932,
29918,
1557,
2361,
353,
2186,
29918,
1557,
2361,
29896,
29961,
12772,
29892,
432,
29962,
13,
12,
12,
12,
12772,
353,
7442,
29889,
3062,
29898,
3317,
20097,
7503,
29892,
432,
29962,
1405,
266,
3781,
9601,
29900,
29962,
13,
12,
12,
12,
25932,
29918,
1557,
2361,
353,
4236,
20097,
29961,
12772,
29892,
432,
29962,
13,
12,
12,
12,
25932,
29918,
1884,
267,
353,
2186,
29918,
1884,
267,
29961,
12772,
29892,
432,
29930,
29946,
5919,
29926,
29974,
29896,
11877,
29946,
29962,
13,
12,
12,
12,
25932,
29918,
12236,
353,
7442,
29889,
1191,
3317,
29898,
12236,
29918,
13628,
29961,
12772,
29892,
584,
1402,
9685,
353,
29871,
29896,
29897,
13,
12,
12,
12,
19080,
29876,
29918,
29890,
1884,
267,
353,
364,
21257,
29918,
1884,
267,
29961,
12772,
29892,
17531,
13,
12,
12,
12,
19080,
29876,
29918,
893,
29883,
2361,
353,
364,
21257,
29918,
1557,
2361,
29961,
12772,
29962,
13,
12,
12,
12,
13,
12,
12,
12,
25932,
29918,
1557,
2361,
29896,
353,
2186,
29918,
1557,
2361,
29961,
12772,
29892,
432,
29962,
13,
13,
12,
12,
12,
5450,
630,
3313,
267,
2385,
353,
7442,
29889,
29882,
1429,
3552,
5450,
630,
3313,
267,
3596,
29961,
12772,
29892,
29926,
29892,
29900,
29892,
29901,
1402,
5731,
630,
3313,
267,
3596,
29961,
12772,
29892,
29926,
29892,
29896,
29892,
29901,
2314,
467,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
12,
12,
12,
29937,
2158,
877,
5450,
630,
3313,
267,
2385,
584,
742,
5731,
630,
3313,
267,
2385,
29889,
12181,
29897,
13,
13,
12,
12,
12,
25932,
29918,
29881,
1691,
29918,
7382,
29918,
5450,
630,
353,
7442,
29889,
29882,
1429,
3552,
5450,
630,
3313,
267,
3596,
29961,
12772,
29892,
29926,
29892,
29900,
29892,
29901,
1402,
5731,
630,
3313,
267,
3596,
29961,
12772,
29892,
29926,
29892,
29896,
29892,
29901,
1402,
1067,
29879,
29918,
1557,
2361,
7503,
29892,
7442,
29889,
1482,
8990,
12622,
320,
13,
462,
12,
12,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
13,
13,
632,
12,
12,
25932,
29918,
29881,
1691,
29918,
7382,
353,
7442,
29889,
29882,
1429,
3552,
25932,
29918,
1884,
267,
29892,
1067,
29879,
29918,
1557,
2361,
7503,
29892,
7442,
29889,
1482,
8990,
12622,
320,
13,
462,
12,
12,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
13,
462,
4706,
396,
2158,
877,
25932,
29918,
29881,
1691,
29918,
7382,
742,
1067,
29879,
29918,
29881,
1691,
29918,
7382,
29889,
12181,
29897,
13,
13,
9651,
12,
12,
25932,
29918,
29881,
1691,
353,
7442,
29889,
29882,
1429,
3552,
25932,
29918,
1884,
267,
29892,
1067,
29879,
29918,
1557,
2361,
7503,
29892,
7442,
29889,
1482,
8990,
1402,
1067,
29879,
29918,
12236,
7503,
29892,
7442,
29889,
1482,
8990,
1402,
364,
21257,
29918,
29890,
1884,
267,
29892,
364,
21257,
29918,
893,
29883,
2361,
876,
320,
13,
462,
12,
12,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29892,
3509,
29922,
8824,
29897,
13,
13,
12,
12,
12,
12008,
17462,
353,
11451,
29918,
21970,
29918,
29876,
1516,
29898,
25932,
29918,
29881,
1691,
29918,
7382,
29918,
5450,
630,
29892,
29871,
29900,
29889,
29946,
29897,
13,
12,
12,
12,
25932,
29918,
29881,
1691,
353,
1067,
29879,
29918,
29881,
1691,
29961,
17462,
29892,
584,
29962,
13,
12,
12,
12,
5450,
630,
3313,
267,
2385,
353,
5731,
630,
3313,
267,
2385,
29961,
17462,
29892,
584,
29962,
13,
12,
12,
12,
25932,
29918,
29881,
1691,
29918,
7382,
353,
1067,
29879,
29918,
29881,
1691,
29918,
7382,
29961,
17462,
29892,
17531,
12008,
13,
13,
632,
12,
12,
17462,
353,
302,
1516,
29898,
25932,
29918,
29881,
1691,
29918,
7382,
29892,
274,
16434,
29889,
18267,
29889,
29940,
4345,
29897,
13,
12,
12,
12,
29937,
17462,
353,
302,
1516,
29898,
25932,
29918,
29881,
1691,
29918,
7382,
29892,
29871,
29900,
29889,
29941,
29897,
13,
12,
12,
12,
13,
12,
12,
12,
25932,
29918,
29881,
1691,
353,
1067,
29879,
29918,
29881,
1691,
29961,
17462,
29892,
584,
29962,
13,
12,
12,
12,
5450,
630,
3313,
267,
2385,
353,
5731,
630,
3313,
267,
2385,
29961,
17462,
29892,
584,
29962,
13,
12,
12,
12,
13,
12,
12,
12,
12008,
25932,
29918,
29881,
1691,
29918,
7382,
29918,
5450,
630,
353,
1067,
29879,
29918,
29881,
1691,
29918,
7382,
29918,
5450,
630,
29961,
17462,
29892,
17531,
13,
12,
12,
12,
17462,
353,
11451,
29918,
21970,
29918,
29876,
1516,
29898,
25932,
29918,
29881,
1691,
29918,
7382,
29918,
5450,
630,
29892,
29871,
29900,
29889,
29946,
29897,
13,
12,
12,
12,
29937,
2158,
877,
17462,
584,
742,
3013,
29897,
13,
632,
12,
12,
25932,
29918,
29881,
1691,
353,
1067,
29879,
29918,
29881,
1691,
29961,
17462,
29892,
584,
29962,
13,
12,
12,
12,
5450,
630,
3313,
267,
2385,
353,
5731,
630,
3313,
267,
2385,
29961,
17462,
29892,
584,
29962,
12008,
13,
13,
632,
12,
12,
497,
29918,
8394,
29918,
1884,
267,
29961,
29926,
3816,
29875,
29962,
353,
1067,
29879,
29918,
29881,
1691,
13,
12,
12,
12,
497,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
29961,
29926,
3816,
29875,
29962,
353,
5731,
630,
3313,
267,
2385,
13,
12,
12,
12,
29937,
2158,
877,
5450,
630,
3313,
267,
2385,
584,
742,
5731,
630,
3313,
267,
2385,
29889,
12181,
29892,
1067,
29879,
29918,
29881,
1691,
29889,
12181,
29897,
13,
13,
12,
12,
29937,
2158,
877,
497,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
584,
742,
599,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
29897,
13,
12,
12,
29937,
2158,
877,
497,
29918,
8394,
29918,
1884,
267,
584,
742,
599,
29918,
8394,
29918,
1884,
267,
29897,
13,
308,
12,
29937,
9628,
277,
304,
4236,
29918,
546,
29918,
3027,
1439,
29872,
1953,
334,
957,
599,
4413,
29930,
13,
13,
308,
12,
361,
4236,
29918,
546,
29918,
3027,
1405,
29871,
29900,
29901,
13,
632,
12,
12,
3027,
29918,
1557,
2361,
353,
7442,
29889,
29882,
1429,
4197,
497,
29918,
8394,
29918,
1884,
267,
29961,
29926,
3816,
29875,
3816,
29901,
29892,
29871,
29946,
29962,
13,
462,
965,
12,
12,
9651,
363,
432,
297,
921,
3881,
29898,
29896,
29892,
527,
2585,
29889,
1949,
29918,
13203,
29897,
2314,
13,
13,
632,
12,
12,
361,
7431,
29898,
3027,
29918,
1557,
2361,
29897,
1405,
4236,
29918,
546,
29918,
3027,
29901,
13,
462,
12,
12,
3027,
29918,
386,
3781,
353,
7442,
29889,
6605,
29898,
3027,
29918,
1557,
2361,
9601,
29899,
3317,
29918,
546,
29918,
3027,
29962,
13,
462,
12,
12,
1454,
432,
297,
921,
3881,
29898,
29896,
29892,
527,
2585,
29889,
1949,
29918,
13203,
1125,
13,
462,
1678,
12,
12,
12,
17462,
353,
7442,
29889,
3062,
29898,
497,
29918,
8394,
29918,
1884,
267,
29961,
29926,
3816,
29875,
3816,
29901,
29892,
448,
29896,
29962,
6736,
1967,
29918,
386,
3781,
9601,
29900,
29962,
13,
462,
268,
12,
12,
12,
497,
29918,
8394,
29918,
1884,
267,
29961,
29926,
3816,
29875,
29962,
353,
599,
29918,
8394,
29918,
1884,
267,
29961,
29926,
3816,
29875,
3816,
17462,
29892,
584,
29962,
13,
12,
12,
12,
12,
12,
497,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
29961,
29926,
3816,
29875,
29962,
353,
599,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
29961,
29926,
3816,
29875,
3816,
17462,
29892,
584,
29962,
13,
13,
462,
13,
18884,
363,
432,
297,
921,
3881,
29898,
29896,
29892,
527,
2585,
29889,
1949,
29918,
13203,
1125,
13,
12,
12,
12,
29937,
19080,
29876,
29918,
833,
353,
7442,
29889,
2378,
4197,
29953,
29896,
29953,
29892,
29871,
29946,
29900,
29945,
29892,
29871,
29947,
29906,
29945,
29892,
29871,
29945,
29945,
29953,
2314,
13,
12,
12,
12,
29937,
19080,
29876,
29918,
833,
353,
7442,
29889,
2378,
4197,
29906,
29941,
29896,
29892,
29896,
29906,
29929,
29892,
29953,
29906,
29896,
29892,
29929,
29941,
29929,
2314,
13,
12,
12,
12,
19080,
29876,
29918,
833,
353,
7442,
29889,
2378,
4197,
29906,
29900,
29947,
29892,
29871,
29945,
29947,
29892,
29871,
29906,
29906,
29946,
29941,
29892,
29871,
29896,
29900,
29929,
29946,
2314,
13,
12,
12,
12,
29937,
326,
353,
1998,
29918,
29881,
2650,
1953,
29918,
8394,
29898,
326,
29892,
527,
2585,
29889,
13203,
29961,
29926,
1402,
599,
29918,
8394,
29918,
1884,
267,
29961,
29926,
3816,
29875,
1402,
10422,
29892,
29871,
29900,
29889,
29953,
29945,
29897,
13,
12,
12,
12,
326,
29892,
20047,
29954,
29892,
20047,
29934,
29892,
274,
29954,
29892,
274,
29934,
353,
1998,
29918,
29881,
2650,
1953,
29918,
8394,
29898,
326,
29892,
527,
2585,
29889,
13203,
29961,
29926,
1402,
599,
29918,
8394,
29918,
1884,
267,
29961,
29926,
3816,
29875,
1402,
10422,
29892,
29871,
29900,
29889,
29955,
29945,
29892,
274,
593,
29954,
29892,
20047,
29934,
29892,
274,
29954,
29892,
274,
29934,
29892,
364,
21257,
29918,
893,
29883,
2361,
29892,
364,
21257,
29918,
833,
29892,
599,
29918,
8394,
29918,
1884,
267,
29918,
5450,
630,
29961,
29926,
3816,
29875,
2314,
13,
462,
4706,
396,
2158,
7251,
13,
13,
12,
12,
29888,
978,
353,
4138,
978,
29918,
497,
718,
10422,
718,
15300,
6173,
29915,
13,
18884,
1596,
285,
978,
13,
12,
12,
11023,
29906,
29889,
326,
3539,
29898,
29888,
978,
29892,
527,
29897,
13,
462,
268,
13,
13,
308,
12,
29918,
29873,
1839,
29885,
10669,
13359,
517,
29883,
580,
13,
308,
12,
2158,
525,
326,
29918,
4801,
522,
29901,
12365,
29881,
6822,
25641,
29881,
29913,
12365,
29889,
29941,
29888,
29913,
29879,
12365,
29889,
29941,
29888,
29913,
29879,
29915,
320,
13,
1669,
12,
29889,
4830,
29898,
29875,
718,
29871,
29896,
29892,
954,
29918,
8346,
29892,
903,
29873,
1839,
326,
29918,
4801,
522,
13359,
12483,
482,
29918,
2230,
29892,
13,
462,
539,
12,
29918,
29873,
1839,
29885,
10669,
13359,
12483,
482,
29918,
2230,
29897,
13,
13,
13,
12,
12,
29937,
2158,
877,
497,
29918,
19080,
29876,
29918,
1884,
267,
742,
7431,
29898,
497,
29918,
19080,
29876,
29918,
1884,
267,
511,
7431,
29898,
497,
29918,
8394,
29918,
1884,
267,
511,
1962,
29918,
3972,
29897,
13,
268,
12,
29937,
2158,
6702,
29923,
4387,
1218,
390,
15695,
1439,
29872,
1953,
363,
2246,
1019,
1066,
1338,
29901,
525,
718,
851,
29898,
593,
459,
20420,
29961,
29873,
2314,
1723,
13,
268,
12,
29937,
326,
2585,
29889,
24219,
403,
29918,
19080,
29876,
29898,
497,
29918,
19080,
29876,
29918,
1884,
267,
29892,
1962,
29918,
3972,
29892,
302,
3332,
20420,
29961,
29873,
2314,
13,
13,
268,
12,
29937,
2158,
6702,
29923,
4387,
1218,
1439,
29872,
1953,
363,
2246,
1019,
1066,
1338,
29901,
525,
718,
851,
29898,
593,
459,
20420,
29961,
29873,
2314,
1723,
13,
268,
12,
29937,
326,
2585,
29889,
24219,
403,
29918,
29881,
2650,
1953,
29898,
497,
29918,
8394,
29918,
1884,
267,
29892,
1962,
29918,
3972,
29892,
593,
459,
20420,
29961,
29873,
2314,
13,
13,
13,
1753,
1301,
29918,
1884,
29896,
29898,
8394,
29918,
1884,
267,
29892,
29911,
29918,
8394,
29892,
323,
29896,
29896,
1125,
13,
1678,
2186,
29918,
1884,
267,
353,
2186,
29918,
1884,
267,
29889,
690,
14443,
29898,
29896,
29892,
29896,
29906,
29897,
13,
1678,
2186,
29918,
1884,
267,
29918,
8394,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
8394,
29918,
1884,
267,
511,
29941,
29892,
29871,
29906,
29892,
29946,
876,
13,
1678,
396,
2158,
877,
8394,
29918,
1884,
267,
584,
742,
2186,
29918,
1884,
267,
29889,
12181,
29892,
2186,
29918,
1884,
267,
29918,
8394,
29889,
12181,
29897,
13,
13,
1678,
363,
413,
297,
3464,
29898,
29900,
29892,
7431,
29898,
8394,
29918,
1884,
267,
22164,
13,
4706,
396,
2158,
877,
29895,
584,
742,
413,
29897,
13,
12,
13,
4706,
770,
29896,
353,
2186,
29918,
1884,
267,
29961,
29895,
29892,
29900,
29901,
29946,
29962,
13,
4706,
770,
29906,
353,
2186,
29918,
1884,
267,
29961,
29895,
29892,
29946,
29901,
29947,
29962,
13,
4706,
770,
29941,
353,
2186,
29918,
1884,
267,
29961,
29895,
29892,
29947,
29901,
29896,
29906,
29962,
13,
13,
4706,
3800,
29896,
353,
518,
770,
29896,
29961,
29900,
29962,
1919,
770,
29896,
29961,
29896,
29962,
1919,
770,
29896,
29961,
29906,
29962,
1919,
770,
29896,
29961,
29941,
29962,
4514,
13,
4706,
3800,
29906,
353,
518,
770,
29906,
29961,
29900,
29962,
1919,
770,
29906,
29961,
29896,
29962,
1919,
770,
29906,
29961,
29906,
29962,
1919,
770,
29906,
29961,
29941,
29962,
4514,
29871,
13,
4706,
3800,
29941,
353,
518,
770,
29941,
29961,
29900,
29962,
1919,
770,
29941,
29961,
29896,
29962,
1919,
770,
29941,
29961,
29906,
29962,
1919,
770,
29941,
29961,
29941,
29962,
4514,
13,
13,
4706,
770,
29896,
29918,
449,
353,
1301,
29918,
13148,
29896,
29898,
29911,
29918,
8394,
29892,
323,
29896,
29896,
29892,
3800,
29896,
29897,
13,
4706,
770,
29906,
29918,
449,
353,
1301,
29918,
13148,
29896,
29898,
29911,
29918,
8394,
29892,
323,
29896,
29896,
29892,
3800,
29906,
29897,
13,
4706,
770,
29941,
29918,
449,
353,
1301,
29918,
13148,
29896,
29898,
29911,
29918,
8394,
29892,
323,
29896,
29896,
29892,
3800,
29941,
29897,
13,
13,
12,
8394,
29918,
1884,
267,
29918,
8394,
29961,
29895,
29892,
29900,
29892,
29901,
29892,
17531,
353,
770,
29896,
29918,
449,
13,
12,
8394,
29918,
1884,
267,
29918,
8394,
29961,
29895,
29892,
29896,
29892,
29901,
29892,
17531,
353,
770,
29906,
29918,
449,
13,
12,
8394,
29918,
1884,
267,
29918,
8394,
29961,
29895,
29892,
29906,
29892,
29901,
29892,
17531,
353,
770,
29906,
29918,
449,
13,
4706,
396,
8394,
29918,
1884,
267,
29918,
8394,
29961,
29895,
29892,
17531,
353,
518,
770,
29896,
29918,
449,
29961,
29900,
1402,
770,
29896,
29918,
449,
29961,
29896,
1402,
770,
29896,
29918,
449,
29961,
29906,
1402,
770,
29896,
29918,
449,
29961,
29941,
1402,
770,
29906,
29918,
449,
29961,
29900,
1402,
770,
29906,
29918,
449,
29961,
29896,
1402,
770,
29906,
29918,
449,
29961,
29906,
1402,
770,
29906,
29918,
449,
29961,
29941,
1402,
770,
29941,
29918,
449,
29961,
29900,
1402,
770,
29941,
29918,
449,
29961,
29896,
1402,
770,
29941,
29918,
449,
29961,
29906,
1402,
770,
29941,
29918,
449,
29961,
29941,
5262,
13,
13,
1678,
736,
2186,
29918,
1884,
267,
29918,
8394,
13,
13,
1753,
1301,
29918,
13148,
29896,
29898,
29911,
29918,
8394,
29892,
29911,
29896,
29896,
29892,
2186,
29918,
29890,
1125,
13,
13,
12,
29876,
29911,
29900,
353,
2437,
29898,
29911,
29896,
29896,
29897,
13,
12,
29876,
2616,
1089,
29918,
16485,
353,
5519,
8394,
29918,
29890,
29961,
29900,
1402,
8394,
29918,
29890,
29961,
29906,
1402,
8394,
29918,
29890,
29961,
29900,
1402,
8394,
29918,
29890,
29961,
29906,
29962,
16272,
8394,
29918,
29890,
29961,
29896,
1402,
8394,
29918,
29890,
29961,
29896,
1402,
8394,
29918,
29890,
29961,
29941,
1402,
8394,
29918,
29890,
29961,
29941,
29962,
16272,
29896,
29892,
29896,
29892,
29896,
29892,
29896,
5262,
13,
12,
29876,
1884,
29916,
353,
7442,
29889,
6333,
29898,
29876,
29911,
29900,
29961,
29900,
29901,
29906,
29892,
29901,
1402,
29876,
2616,
1089,
29918,
16485,
29897,
13,
12,
17697,
962,
262,
29918,
9877,
353,
302,
1884,
29916,
29889,
1195,
29898,
29896,
29897,
13,
12,
29878,
3594,
3317,
29918,
9877,
353,
302,
1884,
29916,
29889,
3317,
29898,
29896,
29897,
13,
13,
12,
29911,
29906,
353,
2437,
29898,
29911,
29918,
8394,
29897,
13,
12,
1884,
29916,
29906,
353,
7442,
29889,
6333,
29898,
29911,
29906,
29961,
29900,
29901,
29906,
29892,
29901,
16272,
29876,
1884,
29916,
29961,
29900,
1402,
302,
1884,
29916,
29961,
29896,
16272,
29896,
29892,
29896,
29892,
29896,
29892,
29896,
24960,
13,
13,
12,
29937,
2158,
877,
29876,
1884,
29916,
742,
302,
1884,
29916,
29889,
12181,
29892,
3800,
29916,
29906,
29889,
12181,
29897,
13,
12,
13,
12,
29937,
4951,
29918,
24077,
2986,
29918,
1884,
353,
29871,
518,
17697,
962,
262,
29918,
9877,
29961,
29900,
1402,
364,
29916,
962,
262,
29918,
9877,
29961,
29896,
1402,
364,
29916,
962,
262,
29918,
9877,
29961,
29900,
1402,
364,
29916,
962,
262,
29918,
9877,
29961,
29896,
5262,
13,
13,
13,
268,
12,
13,
12,
2457,
3800,
29916,
29906,
13,
2
] |
tests/test_utils.py | mk-fg/aetcd | 2 | 117401 | import aetcd.utils
def test_prefix_range_end():
assert aetcd.utils.prefix_range_end(b'foo') == b'fop'
assert aetcd.utils.prefix_range_end(b'ab\xff') == b'ac\xff'
assert aetcd.utils.prefix_range_end(
b'a\xff\xff\xff\xff\xff') == b'b\xff\xff\xff\xff\xff'
def test_to_bytes():
assert isinstance(aetcd.utils.to_bytes(b'key'), bytes) is True
assert isinstance(aetcd.utils.to_bytes('key'), bytes) is True
assert aetcd.utils.to_bytes(b'key') == b'key'
assert aetcd.utils.to_bytes('key') == b'key'
| [
1,
1053,
263,
300,
2252,
29889,
13239,
13,
13,
13,
1753,
1243,
29918,
13506,
29918,
3881,
29918,
355,
7295,
13,
1678,
4974,
263,
300,
2252,
29889,
13239,
29889,
13506,
29918,
3881,
29918,
355,
29898,
29890,
29915,
5431,
1495,
1275,
289,
29915,
29888,
459,
29915,
13,
1678,
4974,
263,
300,
2252,
29889,
13239,
29889,
13506,
29918,
3881,
29918,
355,
29898,
29890,
29915,
370,
29905,
29916,
600,
1495,
1275,
289,
29915,
562,
29905,
29916,
600,
29915,
13,
1678,
4974,
263,
300,
2252,
29889,
13239,
29889,
13506,
29918,
3881,
29918,
355,
29898,
13,
4706,
289,
29915,
29874,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
1495,
1275,
289,
29915,
29890,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29915,
13,
13,
13,
1753,
1243,
29918,
517,
29918,
13193,
7295,
13,
1678,
4974,
338,
8758,
29898,
29874,
300,
2252,
29889,
13239,
29889,
517,
29918,
13193,
29898,
29890,
29915,
1989,
5477,
6262,
29897,
338,
5852,
13,
1678,
4974,
338,
8758,
29898,
29874,
300,
2252,
29889,
13239,
29889,
517,
29918,
13193,
877,
1989,
5477,
6262,
29897,
338,
5852,
13,
1678,
4974,
263,
300,
2252,
29889,
13239,
29889,
517,
29918,
13193,
29898,
29890,
29915,
1989,
1495,
1275,
289,
29915,
1989,
29915,
13,
1678,
4974,
263,
300,
2252,
29889,
13239,
29889,
517,
29918,
13193,
877,
1989,
1495,
1275,
289,
29915,
1989,
29915,
13,
2
] |
robot_overlord/program.py | PurpleMyst/robot_overlord | 0 | 61481 | #!/usr/bin/env python3
import os
import shlex
import subprocess
class Program:
def __init__(self, name, requires, location, setup, start):
self.name = name
self.requires = requires
self.location = location
self.setup_commands = setup
self.start = start
self._fetched = False
self._directory = None
def _run_command(self, command):
if isinstance(command, str):
command = shlex.split(command)
return subprocess.run(command, check=True)
def install_requirements(self):
for item in self.requires:
if item == "python3":
self._run_command("sudo apt-get install -y -q "
"python3 python3-pip")
elif item == "python2":
self._run_command("sudo apt-get install -y -q "
"python2")
else:
raise ValueError("Unsupported requirement %r" % item)
def fetch(self):
if self.location["type"] == "local":
self._directory = self.location["directory"]
else:
raise ValueError("Unsupported location %r" % self.location)
self._fetched = True
def setup(self):
for command in self.setup_commands:
self._run_command(command)
def run(self):
if not self._fetched:
print(self.name, "was run without being fetched")
print("Starting", self.name)
os.chdir(self._directory)
self._run_command(self.start)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
5215,
2897,
13,
5215,
528,
2506,
13,
5215,
1014,
5014,
13,
13,
13,
1990,
7835,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29892,
6858,
29892,
4423,
29892,
6230,
29892,
1369,
1125,
13,
4706,
1583,
29889,
978,
353,
1024,
13,
4706,
1583,
29889,
276,
339,
2658,
353,
6858,
13,
4706,
1583,
29889,
5479,
353,
4423,
13,
4706,
1583,
29889,
14669,
29918,
26381,
353,
6230,
13,
4706,
1583,
29889,
2962,
353,
1369,
13,
13,
4706,
1583,
3032,
9155,
287,
353,
7700,
13,
4706,
1583,
3032,
12322,
353,
6213,
13,
13,
1678,
822,
903,
3389,
29918,
6519,
29898,
1311,
29892,
1899,
1125,
13,
4706,
565,
338,
8758,
29898,
6519,
29892,
851,
1125,
13,
9651,
1899,
353,
528,
2506,
29889,
5451,
29898,
6519,
29897,
13,
13,
4706,
736,
1014,
5014,
29889,
3389,
29898,
6519,
29892,
1423,
29922,
5574,
29897,
13,
13,
1678,
822,
2601,
29918,
12277,
1860,
29898,
1311,
1125,
13,
4706,
363,
2944,
297,
1583,
29889,
276,
339,
2658,
29901,
13,
9651,
565,
2944,
1275,
376,
4691,
29941,
1115,
13,
18884,
1583,
3032,
3389,
29918,
6519,
703,
15360,
10882,
29899,
657,
2601,
448,
29891,
448,
29939,
376,
13,
462,
462,
29871,
376,
4691,
29941,
3017,
29941,
29899,
13096,
1159,
13,
9651,
25342,
2944,
1275,
376,
4691,
29906,
1115,
13,
18884,
1583,
3032,
3389,
29918,
6519,
703,
15360,
10882,
29899,
657,
2601,
448,
29891,
448,
29939,
376,
13,
462,
462,
29871,
376,
4691,
29906,
1159,
13,
9651,
1683,
29901,
13,
18884,
12020,
7865,
2392,
703,
25807,
29884,
3016,
287,
11809,
1273,
29878,
29908,
1273,
2944,
29897,
13,
13,
1678,
822,
6699,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
5479,
3366,
1853,
3108,
1275,
376,
2997,
1115,
13,
9651,
1583,
3032,
12322,
353,
1583,
29889,
5479,
3366,
12322,
3108,
13,
4706,
1683,
29901,
13,
9651,
12020,
7865,
2392,
703,
25807,
29884,
3016,
287,
4423,
1273,
29878,
29908,
1273,
1583,
29889,
5479,
29897,
13,
13,
4706,
1583,
3032,
9155,
287,
353,
5852,
13,
13,
1678,
822,
6230,
29898,
1311,
1125,
13,
4706,
363,
1899,
297,
1583,
29889,
14669,
29918,
26381,
29901,
13,
9651,
1583,
3032,
3389,
29918,
6519,
29898,
6519,
29897,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
565,
451,
1583,
3032,
9155,
287,
29901,
13,
9651,
1596,
29898,
1311,
29889,
978,
29892,
376,
11102,
1065,
1728,
1641,
6699,
287,
1159,
13,
13,
4706,
1596,
703,
4763,
292,
613,
1583,
29889,
978,
29897,
13,
4706,
2897,
29889,
305,
3972,
29898,
1311,
3032,
12322,
29897,
13,
4706,
1583,
3032,
3389,
29918,
6519,
29898,
1311,
29889,
2962,
29897,
13,
2
] |
dags/mailsdag.py | rvacaru/airflow-training-skeleton | 0 | 6848 | <filename>dags/mailsdag.py
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""Example DAG demonstrating the usage of the BashOperator."""
from datetime import timedelta
import datetime
import airflow
from airflow.models import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
from airflow.operators.python_operator import BranchPythonOperator
args = {
'owner': 'Airflow',
'start_date': airflow.utils.dates.days_ago(14),
}
dag = DAG(
dag_id='exercise_weekday',
default_args=args,
schedule_interval='0 0 * * *',
dagrun_timeout=timedelta(minutes=60),
)
dummy_last = DummyOperator(
task_id='run_this_last',
dag=dag,
trigger_rule='one_success',
)
def print_weekday(**context):
day = context["execution_date"].strftime('%a')
print(day)
return day
weekday_task = PythonOperator(
task_id='weekday_task',
python_callable=print_weekday,
provide_context=True,
dag=dag,
)
# optimize with try exept
weekday_person = {
"Mon": "bob",
"Tue": "joe",
"Thu": "joe",
}
def define_oncall(**context):
day = print_weekday(**context)
try:
task_id = weekday_person[day]
except KeyError:
return "ali"
return task_id
branch_task = BranchPythonOperator(
task_id='branch_task',
python_callable=define_oncall,
provide_context=True,
dag=dag,
)
tasks = ["bob", "joe", "ali"]
for p in tasks:
taski = DummyOperator(
task_id=p,
dag=dag,
)
branch_task >> taski
taski >> dummy_last
weekday_task >> branch_task
| [
1,
529,
9507,
29958,
29881,
810,
29914,
2549,
4928,
351,
29889,
2272,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
13,
29937,
10413,
21144,
304,
278,
13380,
18540,
10606,
313,
3289,
29943,
29897,
1090,
697,
13,
29937,
470,
901,
17737,
3406,
19405,
8571,
4110,
29889,
29871,
2823,
278,
6058,
12107,
934,
13,
29937,
13235,
411,
445,
664,
363,
5684,
2472,
13,
29937,
11211,
3509,
1266,
27428,
29889,
29871,
450,
3339,
29943,
7794,
11259,
445,
934,
13,
29937,
304,
366,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
13,
29937,
376,
29931,
293,
1947,
1496,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
13,
29937,
411,
278,
19245,
29889,
29871,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
259,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
13,
29937,
7047,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
13,
29937,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
13,
29937,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
29871,
2823,
278,
19245,
363,
278,
13,
29937,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1090,
278,
19245,
29889,
13,
13,
15945,
29908,
14023,
360,
10051,
9004,
1218,
278,
8744,
310,
278,
29677,
26486,
1213,
15945,
13,
13,
3166,
12865,
1053,
5335,
287,
2554,
13,
13,
5215,
12865,
13,
5215,
4799,
1731,
13,
3166,
4799,
1731,
29889,
9794,
1053,
360,
10051,
13,
3166,
4799,
1731,
29889,
3372,
4097,
29889,
13067,
29918,
6891,
1053,
29677,
26486,
13,
3166,
4799,
1731,
29889,
3372,
4097,
29889,
29881,
11770,
29918,
6891,
1053,
360,
11770,
26486,
13,
3166,
4799,
1731,
29889,
3372,
4097,
29889,
4691,
29918,
6891,
1053,
5132,
26486,
13,
3166,
4799,
1731,
29889,
3372,
4097,
29889,
4691,
29918,
6891,
1053,
25889,
11980,
26486,
13,
13,
5085,
353,
426,
13,
1678,
525,
20348,
2396,
525,
29909,
381,
1731,
742,
13,
1678,
525,
2962,
29918,
1256,
2396,
4799,
1731,
29889,
13239,
29889,
15190,
29889,
16700,
29918,
4425,
29898,
29896,
29946,
511,
13,
29913,
13,
13,
24157,
353,
360,
10051,
29898,
13,
1678,
12136,
29918,
333,
2433,
735,
6269,
895,
29918,
18448,
3250,
742,
13,
1678,
2322,
29918,
5085,
29922,
5085,
29892,
13,
1678,
20410,
29918,
19207,
2433,
29900,
29871,
29900,
334,
334,
334,
742,
13,
1678,
12136,
3389,
29918,
15619,
29922,
9346,
287,
2554,
29898,
1195,
2667,
29922,
29953,
29900,
511,
13,
29897,
13,
13,
29881,
11770,
29918,
4230,
353,
360,
11770,
26486,
29898,
13,
1678,
3414,
29918,
333,
2433,
3389,
29918,
1366,
29918,
4230,
742,
13,
1678,
12136,
29922,
24157,
29892,
13,
1678,
7135,
29918,
7491,
2433,
650,
29918,
8698,
742,
13,
29897,
13,
13,
1753,
1596,
29918,
18448,
3250,
29898,
1068,
4703,
1125,
13,
1678,
2462,
353,
3030,
3366,
22256,
29918,
1256,
16862,
710,
615,
603,
877,
29995,
29874,
1495,
13,
1678,
1596,
29898,
3250,
29897,
13,
1678,
736,
2462,
13,
13,
18448,
3250,
29918,
7662,
353,
5132,
26486,
29898,
13,
1678,
3414,
29918,
333,
2433,
18448,
3250,
29918,
7662,
742,
13,
1678,
3017,
29918,
4804,
519,
29922,
2158,
29918,
18448,
3250,
29892,
13,
1678,
3867,
29918,
4703,
29922,
5574,
29892,
13,
1678,
12136,
29922,
24157,
29892,
13,
29897,
13,
13,
29937,
24656,
411,
1018,
429,
29872,
415,
13,
18448,
3250,
29918,
10532,
353,
426,
13,
1678,
376,
7185,
1115,
376,
29890,
711,
613,
13,
1678,
376,
29911,
434,
1115,
376,
2212,
29872,
613,
13,
1678,
376,
1349,
29884,
1115,
376,
2212,
29872,
613,
13,
29913,
13,
13,
1753,
4529,
29918,
265,
4804,
29898,
1068,
4703,
1125,
13,
1678,
2462,
353,
1596,
29918,
18448,
3250,
29898,
1068,
4703,
29897,
13,
1678,
1018,
29901,
13,
4706,
3414,
29918,
333,
353,
4723,
3250,
29918,
10532,
29961,
3250,
29962,
13,
1678,
5174,
7670,
2392,
29901,
13,
4706,
736,
376,
2606,
29908,
13,
13,
1678,
736,
3414,
29918,
333,
13,
13,
17519,
29918,
7662,
353,
25889,
11980,
26486,
29898,
13,
1678,
3414,
29918,
333,
2433,
17519,
29918,
7662,
742,
13,
1678,
3017,
29918,
4804,
519,
29922,
7922,
29918,
265,
4804,
29892,
13,
1678,
3867,
29918,
4703,
29922,
5574,
29892,
13,
1678,
12136,
29922,
24157,
29892,
13,
29897,
13,
13,
20673,
353,
6796,
29890,
711,
613,
376,
2212,
29872,
613,
376,
2606,
3108,
13,
13,
1454,
282,
297,
9595,
29901,
13,
1678,
3414,
29875,
353,
360,
11770,
26486,
29898,
13,
4706,
3414,
29918,
333,
29922,
29886,
29892,
13,
4706,
12136,
29922,
24157,
29892,
13,
1678,
1723,
13,
1678,
5443,
29918,
7662,
5099,
3414,
29875,
13,
1678,
3414,
29875,
5099,
20254,
29918,
4230,
13,
13,
18448,
3250,
29918,
7662,
5099,
5443,
29918,
7662,
13,
2
] |
python/pohuAPI.py | aiwarrior-23/revised_serps | 0 | 75096 | <gh_stars>0
import json
from pymongo import MongoClient
from flask import jsonify, request, Flask
from flask_cors import CORS
import flask
from utils.utils import *
from bson import ObjectId
import copy
import requests
import datetime
app = Flask(__name__)
CORS(app)
@app.route("/login",methods=['POST'])
def loginUser():
details=request.get_json()["userDetails"]
userName=details["userName"]
password=details["password"]
isParent=details["isParent"]
response, uName, mailId,stdId,role,designation =checkforLogin(userName,password,isParent)
if(response=="Teacher"):
return jsonify({"message": "Congratualtion for Login",
"uName": uName,
"mailID": mailId,
"role": role,
"stdId":"none",
"designation": designation} )
if(response=="Parent"):
return jsonify({"message": "Congratualtion for Login",
"uName": uName,
"stdId": stdId,
})
# @app.route("/login", methods=['POST'])
# def loginTest():
# details = request.get_json()["userDetails"]
# userName, uName, mailID, designation = userNameCheck(details["userName"])
# passwordN = passwordCheck(details["password"])
# role = fetchrole(mailID[0])
# if userName == "Success":
# if passwordN == "Success":
# return jsonify({"message": "Congratualtion for Login",
# "uName": uName[-1],
# "mailID": mailID,
# "role": role,
# "designation": designation})
# else:
# return jsonify({"message": "UserName or Password is Incorrect",
# "uName": "Not Defined",
# "mailID": "Not Defined",
# "role": "Not Defined"})
# else:
# return jsonify({"message": "UserName or Password is Incorrect",
# "uName": "Not Defined",
# "mailID": "Not Defined",
# "role": "Not Defined"})
@app.route("/createuser", methods=['POST'])
def insert_document():
req_data = request.get_json()["UserDetails"]
config.userDetailsTemplate["primaryEmail"] = req_data["email"]
config.userDetailsTemplate["name"]["givenName"] = req_data["firstName"]
config.userDetailsTemplate["name"]["familyName"] = req_data["lastName"]
config.userDetailsTemplate["password"] = sha(req_data["password"])
config.userDetailsTemplate["addresses"][0]["streetAddress"] = req_data["address"]
config.userDetailsTemplate["phones"][0]["value"] = req_data["phone"]
config.userDetailsTemplate["organizations"][0]["title"] = req_data["title"]
config.userDetailsTemplate["organizations"][0]["name"] = req_data["college"]
# url = "https://admin.googleapis.com/admin/directory/v1/users"
# payload = json.dumps(config.userDetailsTemplate)
# headers = {
# 'Authorization': 'Bearer <KEY>',
# 'Content-Type': 'application/json'
# }
# response = requests.request("POST", url, headers=headers, data=payload)
config.collection.insert_one(config.userDetailsTemplate).inserted_id
return jsonify({"message": "Congratualtions user inserted Sucessfully..."})
@app.route("/creattask", methods=['POST'])
def task():
req_data = request.get_json()
config.collection1.insert_one(req_data).inserted_id
message = createCalendarEvent(req_data)
return jsonify({"message": "Task created Sucessfully..."})
@app.route("/createMeeting", methods=['POST'])
def meeting():
data= []
req_data = request.get_json()
print(req_data)
req_data = req_data["data"]
for i in req_data["attendees"]:
data.append(getEmail(i))
data1 = createMeeting(req_data,data)
config.collectionMeetings.insert_one(data1).inserted_id
return jsonify({"message": "Meeting created Sucessfully..."})
@app.route("/taskassign", methods=['POST'])
def task_assign():
assignee = request.get_json()
activeTask, urgentTask, futureTask, completedTask, backlogTask, activeTaskID, urgentTaskID, futureTaskID, completedTaskID, backlogTaskID = task_assigned(assignee["assigned"])
data = {}
populator = {}
populator["activeTaskID"]=[{'Nothing To Display':"message"}] if len(activeTaskID)==0 else activeTaskID
populator["urgentTaskID"]=[{'Nothing To Display':"message"}] if len(urgentTaskID)==0 else urgentTaskID
populator["futureTaskID"]=[{'Nothing To Display':"message"}] if len(futureTaskID)==0 else futureTaskID
populator["completedTaskID"]=[{'Nothing To Display':"message"}] if len(completedTaskID)==0 else completedTaskID
populator["backlogTaskID"]=[{'Nothing To Display':"message"}] if len(backlogTaskID)==0 else backlogTaskID
return jsonify({"message": "tasks are assigned", "data": data, "ass":assignee["assigned"], "populator":populator})
@app.route("/taskToBeApproved", methods=['POST'])
def task_to_be_approved():
assignee = request.get_json()
toBeApprovedTasks, toBeApprovedTaskID= task_approved(assignee["assigned"])
data = {}
populator = {}
data["toBeApprovedTask"]=[{'Nothing To Display':"message"}] if len(toBeApprovedTasks)==0 else toBeApprovedTasks
populator["toBeApprovedTaskID"]=[{'Nothing To Display':"message"}] if len(toBeApprovedTaskID)==0 else toBeApprovedTaskID
return jsonify({"message": "tasks are assigned", "data": data, "ass":assignee["assigned"], "populator":populator})
@app.route("/taskapprove", methods=['POST'])
def taskapproved():
approver = request.get_json()
approve, data1 = task_approver(approver["assigned"])
if approve == "Success":
return jsonify({"message": "tasks are assigned", "data": data1})
else:
return jsonify({"message": "tasks are not assigned"})
@app.route("/staffDetails", methods=['POST'])
def getStaffDetails():
staffType = request.get_json()["staffType"]
staffList = getStaffType(staffType)
return jsonify({"staffList": staffList})
@app.route("/department", methods=['POST'])
def getDepartment():
department = request.get_json()["department"]
responsibilities = getResponsibilities(department)
return jsonify({"responsibilities": responsibilities})
@app.route("/taskstatus", methods=['POST'])
def updateTasks():
taskID = request.get_json("taskID")
status, data = getstatus(ObjectId(taskID["taskID"]))
return jsonify({"status":status, "data":data})
@app.route("/getjson", methods=['POST'])
def gets():
objid = request.get_json("objid")
reqJson = getJson(ObjectId(objid["objid"]))
return jsonify({"message":"json retrived","json":eval(str(reqJson))})
@app.route("/edit", methods=["POST"])
def ej():
response = request.get_json()
key = response["key"]
oid = response["objid"]
msg = response["message"]
print(oid)
editj = editjson(oid, msg, key)
jsoni = getJson(ObjectId(oid))
return(jsonify({"message":"task updated sucessfully","json":jsoni}))
@app.route("/delete_collec", methods=['POST'])
def delete_collection():
req_data = request.get_json()
temp = deletecollection(req_data)
return jsonify({"message":"Collection Deleted"})
#task_Assign using Object id
@app.route("/taskassign1", methods=['POST'])
def task_assign1():
objid = request.get_json("obji")
jsoni = getJson(ObjectId(objid["obji"]))
print(jsoni)
return jsonify({"message":"json retrived","json":jsoni})
@app.route("/updateComments", methods=['POST'])
def checkmailfortaskupdate():
x = request.get_json()
js = x["data"]
objid = x["objid"]
key1 = x["key"]
print(objid)
temp = {}
ct = str(datetime.datetime.now().date())
js["timeStamp"]=ct
for a in config.collection1.find():
if ObjectId(objid) == a["_id"]:
for key, value in a.items():
if key not in ["_id"]:
temp[key]=value
old = copy.deepcopy(temp);
new = copy.deepcopy(temp)
new[key1].append(js)
edit = config.collection1.replace_one(old,new)
return ("Success")
@app.route("/classInfo", methods=['GET'])
def class_info():
classes = getClassInfo()
subjects = getSubjectInfo()
return jsonify({"xx":list(classes), "yy":list(subjects)})
@app.route("/sectionInfo", methods=['POST'])
def section_info():
x = request.get_json()
cls = x["class"]
section = getSectionInfo(cls)
return jsonify({"xx":section})
@app.route("/getTeachersList", methods=['GET'])
def get_teachers_list():
teachers, nonTeachers, test , test1= getTeachersList()
return jsonify({"teachers":list(teachers), "nonTeachers":list(nonTeachers), "test":test, "test1": test1})
@app.route("/teacherRS", methods=['POST'])
def teacherResponsibilitySubmission():
req_data = request.get_json()
config.collectionTeacherAssignments.insert_one(req_data).inserted_id
return jsonify({"message": "Task created Sucessfully..."})
@app.route("/getComments", methods=['POST'])
def getComments():
req_data = request.get_json()
req_data = req_data["id"]
comments = getAllComments(ObjectId(req_data))
return jsonify({"comments": comments})
@app.route("/getProfileInfo", methods=['POST'])
def getProfileInfo():
req_data = request.get_json()
req_data = req_data["mail"]
ct, subjects, repMgr, reprMgrName = getInfo(req_data)
return jsonify({"classTeacher": ct, "subjects":subjects, "reportingManagerEmail":repMgr, "reportingManagerName":reprMgrName})
@app.route("/student_list", methods=["POST"])
def s_list():
data = request.get_json()
slist = student_list(data["data"])
return jsonify({"message":"milgaya", "data":slist})
@app.route("/qrcode", methods=["POST"])
def qr():
data = request.get_json()
getqr = qrsearch(data["data"])
return jsonify({"data":getqr})
@app.route("/attendace",methods=["POST"])
def attendace():
req_data = request.get_json()
c = req_data['class']
if c == "1a" or c== "1b" or c== "1c" or c== "1d":
config.db4.class1.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class1 collection."})
elif c== "2a" or c== "2b" or c=="2c" or c=="2d":
config.db4.class2.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class2 collection."})
elif c== "3a" or c=="3b" or c=="3c" or c=="3d":
config.db4.class3.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class3 collection."})
elif c== "4a" or c=="4b" or c=="4c" or c=="4d":
config.db4.class4.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class4 collection."})
elif c== "5a" or c=="5b" or c=="5c" or c=="5d":
config.db4.class5.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class5 collection."})
elif c== "6a" or c=="6b" or c=="6c" or c=="6d":
config.db4.class6.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class6 collection."})
elif c== "7a" or c=="7b" or c=="7c" or c=="7d":
config.db4.class7.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class7 collection."})
elif c== "8a" or c=="8b" or c=="8c" or c=="8d":
config.db4.class8.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class8 collection."})
elif c== "9a" or c=="9b" or c=="9c" or c=="9d":
config.db4.class9.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class9 collection."})
elif c== "10a" or c=="10b" or c=="10c" or c=="10d":
config.db4.class10.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class10 collection."})
elif c== "nursery":
config.db4.nursery.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into nursey collection."})
elif c== "L.K.G":
config.db4.lkg.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into L.K.G collection."})
elif c== "U.K.G":
config.db4.ukg.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into U.K.G collection."})
else:
config.db4.garbage.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Garbage collection."})
@app.route("/filter", methods=["POST"])
def a_filter():
req_data = request.get_json()
cc=req_data["data"]["cc"]
date=req_data["data"]["date"]
st=req_data["data"]["st"]
et=req_data["data"]["et"]
sub=req_data["data"]["sub"]
data1 = attendacne_filter(cc, date, st, et, sub)
return jsonify({"message":"Data Retrived Sucessfully","data" : repr(data1)})
@app.route("/teacherAttendance",methods=["POST"])
def teacherLogin():
req_data = request.get_json()
print(req_data)
insertStatus=[]
mail=req_data["data"]["mail"]
date=req_data["data"]["date"]
sub=req_data["data"]["sub"]
cls=req_data["data"]["cls"]
data1=getLoginJson(mail,date,sub,cls)
jsoni=jsonify({"message":"Data Insereted Sucessfully","data" : "Success"})
print (data1)
if data1==None:
config.teachers.insert_one(req_data).inserted_id
final=jsoni
else:
js = req_data["data"]["logoutTime"]
temp = {}
for key, value in data1.items():
if key not in ["_id"]:
temp[key]=value
old = copy.deepcopy(temp)
new = copy.deepcopy(temp)
new["data"]["logoutTime"]=js
config.teachers.replace_one(old,new)
final=jsonify({"message":"Logout Sucessfully","data" : "Success"})
return final
@app.route("/teachersJson", methods=["POST"])
def teachersJson():
req_data = request.get_json()
mail=req_data["data"]["mail"]
date=req_data["data"]["date"]
sub=req_data["data"]["sub"]
cls=req_data["data"]["cls"]
data1 = getLoginJson(mail, date,sub,cls)
print(data1)
jsoni=jsonify({"message":"Data Retrived Sucessfully","data" : "hello"})
if data1==None:
final=jsoni
else:
final=jsonify({"message":"Data Retrived Sucessfully","data" : data1})
return final
@app.route("/studyCentral",methods=["POST"])
def SC():
req_data = request.get_json()
config.collectionSC.insert_one(req_data).inserted_id
return jsonify({"message":"data inserted into Class1 collection."})
@app.route("/broadcast", methods=["POST"])
def broadcast_notice():
data = request.get_json()
print(data)
config.broadcast.insert_one(data).inserted_id
return jsonify({"message":"data inserted into broadcast collection.","data":repr(data)})
@app.route("/getBroadcast", methods=["GET"])
def get():
l1 = []
for i in config.broadcast.find():
data = i
data["_id"] = str(data["_id"])
l1.append(data)
return jsonify({"message":"broadcast Data Retrived Successfully","data":l1})
@app.route("/employeeProfile",methods=["POST"])
def ep():
data = request.get_json()
print(data)
mail,designation,staffType = taskProfile(data["obj"])
ct, subjects, repMgr, reprMgrName= getInfo(mail)
return jsonify({"message":"Employee Information Retrived","MailID":mail,"Reporting Manager Name":reprMgrName,"Designation":designation,"Staff Type":staffType})
@app.route("/filter2", methods=["POST"])
def a_filter2():
req_data = request.get_json()
cc=req_data["data"]["cc"]
date=req_data["data"]["date"]
sub=req_data["data"]["sub"]
data1 = attendacne_filter(cc, sub, date)
print(data1)
return jsonify({"message":"Data Retrived Sucessfully","data" : data1})
# @app.route("/marksfilter", methods=["POST"])
# def m_filter():
# req_data = request.get_json()
# cc=req_data["data"]["cc"]
# date=req_data["data"]["date"]
# sub=req_data["data"]["sub"]
# data1 = marks_filter(cc, sub, date)
# print(data1)
# return jsonify({"message":"Data Retrived Sucessfully","data" : data1})
@app.route("/marksfilter", methods=["POST"])
def m_filter():
req_data = request.get_json()
classes=req_data["class"]
exam_type=req_data["exam_type"]
data1 = marks_filter(classes,exam_type)
return jsonify({"message":"Data Retrived","data" : data1})
@app.route("/studentwork", methods=["GET","POST"])
def studenttask():
task_details = request.get_json()
class_name = task_details["class_name"]
subject_name = task_details["subject_name"]
st = student_task(class_name,subject_name)
print(st)
return jsonify({"message":st})
@app.route("/insertmarks" ,methods=["POST"])
def IM():
marks=request.get_json()
config.collectionMark.insert_one(marks).inserted_id
return jsonify({"message": "Success"})
app.run(debug=True, port=5001, host="0.0.0.0") | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
13,
5215,
4390,
13,
3166,
282,
962,
7443,
1053,
18294,
4032,
13,
3166,
29784,
1053,
4390,
1598,
29892,
2009,
29892,
2379,
1278,
13,
3166,
29784,
29918,
29883,
943,
1053,
315,
24125,
13,
5215,
29784,
13,
3166,
3667,
29879,
29889,
13239,
1053,
334,
13,
3166,
289,
1100,
1053,
4669,
1204,
13,
5215,
3509,
13,
5215,
7274,
13,
5215,
12865,
13,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
29907,
24125,
29898,
932,
29897,
13,
13,
29992,
932,
29889,
13134,
11974,
7507,
613,
23515,
29922,
1839,
5438,
11287,
13,
1753,
6464,
2659,
7295,
13,
1678,
4902,
29922,
3827,
29889,
657,
29918,
3126,
580,
3366,
1792,
10602,
3108,
13,
1678,
1404,
1170,
29922,
14144,
3366,
1792,
1170,
3108,
13,
1678,
4800,
29922,
14144,
3366,
5630,
3108,
13,
1678,
338,
9780,
29922,
14144,
3366,
275,
9780,
3108,
13,
1678,
2933,
29892,
318,
1170,
29892,
10524,
1204,
29892,
4172,
1204,
29892,
12154,
29892,
13892,
362,
29871,
353,
3198,
1454,
11049,
29898,
1792,
1170,
29892,
5630,
29892,
275,
9780,
29897,
13,
1678,
565,
29898,
5327,
26359,
29911,
4204,
261,
29908,
1125,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
29907,
549,
3605,
950,
12757,
363,
19130,
613,
13,
462,
3986,
376,
29884,
1170,
1115,
318,
1170,
29892,
13,
462,
3986,
376,
2549,
1367,
1115,
10524,
1204,
29892,
13,
462,
965,
376,
12154,
1115,
6297,
29892,
13,
462,
965,
376,
4172,
1204,
4710,
9290,
613,
13,
462,
965,
376,
13892,
362,
1115,
2874,
362,
29913,
29871,
1723,
13,
1678,
565,
29898,
5327,
26359,
9780,
29908,
1125,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
29907,
549,
3605,
950,
12757,
363,
19130,
613,
13,
462,
3986,
376,
29884,
1170,
1115,
318,
1170,
29892,
13,
462,
3986,
376,
4172,
1204,
1115,
3659,
1204,
29892,
13,
462,
965,
5615,
13,
13,
29937,
732,
932,
29889,
13134,
11974,
7507,
613,
3519,
29922,
1839,
5438,
11287,
13,
29937,
822,
6464,
3057,
7295,
13,
29937,
268,
4902,
353,
2009,
29889,
657,
29918,
3126,
580,
3366,
1792,
10602,
3108,
13,
29937,
268,
1404,
1170,
29892,
318,
1170,
29892,
10524,
1367,
29892,
2874,
362,
353,
1404,
1170,
5596,
29898,
14144,
3366,
1792,
1170,
20068,
13,
29937,
268,
4800,
29940,
353,
4800,
5596,
29898,
14144,
3366,
5630,
20068,
13,
29937,
268,
6297,
353,
6699,
12154,
29898,
2549,
1367,
29961,
29900,
2314,
13,
29937,
268,
565,
1404,
1170,
1275,
376,
14191,
1115,
13,
29937,
308,
565,
4800,
29940,
1275,
376,
14191,
1115,
13,
29937,
632,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
29907,
549,
3605,
950,
12757,
363,
19130,
613,
13,
29937,
462,
632,
376,
29884,
1170,
1115,
318,
1170,
14352,
29896,
1402,
13,
29937,
462,
632,
376,
2549,
1367,
1115,
10524,
1367,
29892,
13,
29937,
462,
632,
376,
12154,
1115,
6297,
29892,
13,
29937,
462,
632,
376,
13892,
362,
1115,
2874,
362,
1800,
13,
29937,
308,
1683,
29901,
13,
29937,
632,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
28129,
470,
25280,
338,
512,
15728,
613,
13,
29937,
462,
632,
376,
29884,
1170,
1115,
376,
3664,
5282,
1312,
613,
13,
29937,
462,
632,
376,
2549,
1367,
1115,
376,
3664,
5282,
1312,
613,
13,
29937,
462,
632,
376,
12154,
1115,
376,
3664,
5282,
1312,
29908,
1800,
13,
29937,
268,
1683,
29901,
13,
29937,
308,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
28129,
470,
25280,
338,
512,
15728,
613,
13,
29937,
462,
308,
376,
29884,
1170,
1115,
376,
3664,
5282,
1312,
613,
13,
29937,
462,
308,
376,
2549,
1367,
1115,
376,
3664,
5282,
1312,
613,
13,
29937,
462,
308,
376,
12154,
1115,
376,
3664,
5282,
1312,
29908,
1800,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
3258,
1792,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
4635,
29918,
3225,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
3366,
2659,
10602,
3108,
13,
1678,
2295,
29889,
1792,
10602,
6733,
3366,
16072,
9823,
3108,
353,
12428,
29918,
1272,
3366,
5269,
3108,
13,
1678,
2295,
29889,
1792,
10602,
6733,
3366,
978,
3108,
3366,
29887,
5428,
1170,
3108,
353,
12428,
29918,
1272,
3366,
4102,
1170,
3108,
13,
1678,
2295,
29889,
1792,
10602,
6733,
3366,
978,
3108,
3366,
11922,
1170,
3108,
353,
12428,
29918,
1272,
3366,
4230,
1170,
3108,
13,
1678,
2295,
29889,
1792,
10602,
6733,
3366,
5630,
3108,
353,
528,
29874,
29898,
7971,
29918,
1272,
3366,
5630,
20068,
13,
1678,
2295,
29889,
1792,
10602,
6733,
3366,
7328,
267,
3108,
29961,
29900,
29962,
3366,
29352,
7061,
3108,
353,
12428,
29918,
1272,
3366,
7328,
3108,
13,
1678,
2295,
29889,
1792,
10602,
6733,
3366,
561,
2873,
3108,
29961,
29900,
29962,
3366,
1767,
3108,
353,
12428,
29918,
1272,
3366,
6710,
3108,
13,
1678,
2295,
29889,
1792,
10602,
6733,
3366,
6388,
17063,
3108,
29961,
29900,
29962,
3366,
3257,
3108,
353,
12428,
29918,
1272,
3366,
3257,
3108,
13,
1678,
2295,
29889,
1792,
10602,
6733,
3366,
6388,
17063,
3108,
29961,
29900,
29962,
3366,
978,
3108,
353,
12428,
29918,
1272,
3366,
1054,
4424,
3108,
13,
13,
1678,
396,
3142,
353,
376,
991,
597,
6406,
29889,
15947,
29889,
510,
29914,
6406,
29914,
12322,
29914,
29894,
29896,
29914,
7193,
29908,
13,
13,
1678,
396,
20092,
353,
4390,
29889,
29881,
17204,
29898,
2917,
29889,
1792,
10602,
6733,
29897,
13,
1678,
396,
9066,
353,
426,
13,
1678,
396,
268,
525,
25471,
2396,
525,
29933,
799,
261,
529,
10818,
29958,
742,
13,
1678,
396,
268,
525,
3916,
29899,
1542,
2396,
525,
6214,
29914,
3126,
29915,
13,
1678,
396,
500,
13,
13,
1678,
396,
2933,
353,
7274,
29889,
3827,
703,
5438,
613,
3142,
29892,
9066,
29922,
13662,
29892,
848,
29922,
23813,
29897,
13,
13,
1678,
2295,
29889,
10855,
29889,
7851,
29918,
650,
29898,
2917,
29889,
1792,
10602,
6733,
467,
7851,
287,
29918,
333,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
29907,
549,
3605,
950,
29873,
1080,
1404,
15478,
2166,
985,
3730,
17794,
1800,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
1037,
1131,
1278,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
3414,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
2295,
29889,
10855,
29896,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
1678,
2643,
353,
1653,
17447,
2624,
29898,
7971,
29918,
1272,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
5398,
2825,
2166,
985,
3730,
17794,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
3258,
6816,
15133,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
11781,
7295,
13,
1678,
848,
29922,
5159,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
1596,
29898,
7971,
29918,
1272,
29897,
13,
1678,
12428,
29918,
1272,
353,
12428,
29918,
1272,
3366,
1272,
3108,
13,
1678,
363,
474,
297,
12428,
29918,
1272,
3366,
8606,
311,
267,
3108,
29901,
13,
4706,
848,
29889,
4397,
29898,
657,
9823,
29898,
29875,
876,
13,
1678,
848,
29896,
353,
1653,
6816,
15133,
29898,
7971,
29918,
1272,
29892,
1272,
29897,
13,
1678,
2295,
29889,
10855,
6816,
300,
886,
29889,
7851,
29918,
650,
29898,
1272,
29896,
467,
7851,
287,
29918,
333,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
6816,
15133,
2825,
2166,
985,
3730,
17794,
1800,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
7662,
16645,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
3414,
29918,
16645,
7295,
13,
1678,
1223,
4895,
29872,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
6136,
5398,
29892,
5065,
5362,
5398,
29892,
5434,
5398,
29892,
8676,
5398,
29892,
1250,
1188,
5398,
29892,
6136,
5398,
1367,
29892,
5065,
5362,
5398,
1367,
29892,
5434,
5398,
1367,
29892,
8676,
5398,
1367,
29892,
1250,
1188,
5398,
1367,
353,
3414,
29918,
465,
12961,
29898,
465,
4895,
29872,
3366,
465,
12961,
20068,
13,
1678,
848,
353,
6571,
13,
1678,
1835,
9183,
353,
6571,
13,
1678,
1835,
9183,
3366,
4925,
5398,
1367,
3108,
11759,
10998,
26521,
1763,
17440,
2396,
29908,
4906,
29908,
6525,
565,
7431,
29898,
4925,
5398,
1367,
29897,
1360,
29900,
1683,
6136,
5398,
1367,
13,
1678,
1835,
9183,
3366,
2007,
296,
5398,
1367,
3108,
11759,
10998,
26521,
1763,
17440,
2396,
29908,
4906,
29908,
6525,
565,
7431,
29898,
2007,
296,
5398,
1367,
29897,
1360,
29900,
1683,
5065,
5362,
5398,
1367,
13,
1678,
1835,
9183,
3366,
29888,
9130,
5398,
1367,
3108,
11759,
10998,
26521,
1763,
17440,
2396,
29908,
4906,
29908,
6525,
565,
7431,
29898,
29888,
9130,
5398,
1367,
29897,
1360,
29900,
1683,
5434,
5398,
1367,
13,
1678,
1835,
9183,
3366,
5729,
9446,
5398,
1367,
3108,
11759,
10998,
26521,
1763,
17440,
2396,
29908,
4906,
29908,
6525,
565,
7431,
29898,
5729,
9446,
5398,
1367,
29897,
1360,
29900,
1683,
8676,
5398,
1367,
13,
1678,
1835,
9183,
3366,
1627,
1188,
5398,
1367,
3108,
11759,
10998,
26521,
1763,
17440,
2396,
29908,
4906,
29908,
6525,
565,
7431,
29898,
1627,
1188,
5398,
1367,
29897,
1360,
29900,
1683,
1250,
1188,
5398,
1367,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
20673,
526,
9859,
613,
376,
1272,
1115,
848,
29892,
376,
465,
1115,
465,
4895,
29872,
3366,
465,
12961,
12436,
376,
7323,
9183,
1115,
7323,
9183,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
7662,
1762,
3629,
2052,
307,
1490,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
3414,
29918,
517,
29918,
915,
29918,
9961,
1490,
7295,
13,
1678,
1223,
4895,
29872,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
304,
3629,
2052,
307,
1490,
26249,
29892,
304,
3629,
2052,
307,
1490,
5398,
1367,
29922,
3414,
29918,
9961,
1490,
29898,
465,
4895,
29872,
3366,
465,
12961,
20068,
13,
1678,
848,
353,
6571,
13,
1678,
1835,
9183,
353,
6571,
13,
1678,
848,
3366,
517,
3629,
2052,
307,
1490,
5398,
3108,
11759,
10998,
26521,
1763,
17440,
2396,
29908,
4906,
29908,
6525,
565,
7431,
29898,
517,
3629,
2052,
307,
1490,
26249,
29897,
1360,
29900,
1683,
304,
3629,
2052,
307,
1490,
26249,
13,
1678,
1835,
9183,
3366,
517,
3629,
2052,
307,
1490,
5398,
1367,
3108,
11759,
10998,
26521,
1763,
17440,
2396,
29908,
4906,
29908,
6525,
565,
7431,
29898,
517,
3629,
2052,
307,
1490,
5398,
1367,
29897,
1360,
29900,
1683,
304,
3629,
2052,
307,
1490,
5398,
1367,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
20673,
526,
9859,
613,
376,
1272,
1115,
848,
29892,
376,
465,
1115,
465,
4895,
29872,
3366,
465,
12961,
12436,
376,
7323,
9183,
1115,
7323,
9183,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
7662,
9961,
345,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
3414,
9961,
1490,
7295,
13,
1678,
2134,
369,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
2134,
345,
29892,
848,
29896,
353,
3414,
29918,
9961,
369,
29898,
9961,
369,
3366,
465,
12961,
20068,
13,
1678,
565,
2134,
345,
1275,
376,
14191,
1115,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
20673,
526,
9859,
613,
376,
1272,
1115,
848,
29896,
1800,
13,
1678,
1683,
29901,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
20673,
526,
451,
9859,
29908,
1800,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
303,
3470,
10602,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
679,
855,
3470,
10602,
7295,
13,
1678,
13925,
1542,
353,
2009,
29889,
657,
29918,
3126,
580,
3366,
303,
3470,
1542,
3108,
13,
1678,
13925,
1293,
353,
679,
855,
3470,
1542,
29898,
303,
3470,
1542,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
303,
3470,
1293,
1115,
13925,
1293,
1800,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
311,
8076,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
679,
8498,
442,
358,
7295,
13,
1678,
14311,
353,
2009,
29889,
657,
29918,
3126,
580,
3366,
311,
8076,
3108,
13,
1678,
5544,
747,
9770,
353,
679,
1666,
29886,
787,
747,
9770,
29898,
311,
8076,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
26679,
747,
9770,
1115,
5544,
747,
9770,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
7662,
4882,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
2767,
26249,
7295,
13,
1678,
3414,
1367,
353,
2009,
29889,
657,
29918,
3126,
703,
7662,
1367,
1159,
13,
1678,
4660,
29892,
848,
353,
679,
4882,
29898,
2061,
1204,
29898,
7662,
1367,
3366,
7662,
1367,
3108,
876,
13,
1678,
736,
4390,
1598,
3319,
29908,
4882,
1115,
4882,
29892,
376,
1272,
1115,
1272,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
657,
3126,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
4947,
7295,
13,
1678,
5446,
333,
353,
2009,
29889,
657,
29918,
3126,
703,
5415,
333,
1159,
13,
1678,
12428,
8148,
353,
679,
8148,
29898,
2061,
1204,
29898,
5415,
333,
3366,
5415,
333,
3108,
876,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
3126,
3240,
1150,
287,
3284,
3126,
1115,
14513,
29898,
710,
29898,
7971,
8148,
876,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
5628,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
8574,
7295,
13,
1678,
2933,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
1820,
353,
2933,
3366,
1989,
3108,
13,
1678,
288,
333,
353,
2933,
3366,
5415,
333,
3108,
13,
1678,
10191,
353,
2933,
3366,
4906,
3108,
13,
1678,
1596,
29898,
3398,
29897,
13,
1678,
3863,
29926,
353,
3863,
3126,
29898,
3398,
29892,
10191,
29892,
1820,
29897,
13,
1678,
4390,
29875,
353,
679,
8148,
29898,
2061,
1204,
29898,
3398,
876,
13,
1678,
736,
29898,
3126,
1598,
3319,
29908,
4906,
4710,
7662,
4784,
480,
985,
3730,
3284,
3126,
1115,
3126,
29875,
20073,
13,
13,
29992,
932,
29889,
13134,
11974,
8143,
29918,
1054,
280,
29883,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
5217,
29918,
10855,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
5694,
353,
5217,
10855,
29898,
7971,
29918,
1272,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
7196,
897,
22742,
29908,
1800,
13,
13,
29937,
7662,
29918,
7900,
647,
773,
4669,
1178,
13,
29992,
932,
29889,
13134,
11974,
7662,
16645,
29896,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
3414,
29918,
16645,
29896,
7295,
13,
1678,
5446,
333,
353,
2009,
29889,
657,
29918,
3126,
703,
711,
2397,
1159,
13,
1678,
4390,
29875,
353,
679,
8148,
29898,
2061,
1204,
29898,
5415,
333,
3366,
711,
2397,
3108,
876,
13,
1678,
1596,
29898,
3126,
29875,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
3126,
3240,
1150,
287,
3284,
3126,
1115,
3126,
29875,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
5504,
1523,
1860,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
1423,
2549,
3921,
1278,
5504,
7295,
13,
1678,
921,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
6965,
353,
921,
3366,
1272,
3108,
13,
1678,
5446,
333,
353,
921,
3366,
5415,
333,
3108,
13,
1678,
1820,
29896,
353,
921,
3366,
1989,
3108,
13,
1678,
1596,
29898,
5415,
333,
29897,
13,
1678,
5694,
353,
6571,
13,
1678,
274,
29873,
353,
851,
29898,
12673,
29889,
12673,
29889,
3707,
2141,
1256,
3101,
13,
1678,
6965,
3366,
2230,
855,
1160,
3108,
29922,
312,
13,
1678,
363,
263,
297,
2295,
29889,
10855,
29896,
29889,
2886,
7295,
13,
4706,
565,
4669,
1204,
29898,
5415,
333,
29897,
1275,
263,
3366,
29918,
333,
3108,
29901,
13,
9651,
363,
1820,
29892,
995,
297,
263,
29889,
7076,
7295,
13,
18884,
565,
1820,
451,
297,
6796,
29918,
333,
3108,
29901,
13,
462,
1678,
5694,
29961,
1989,
13192,
1767,
13,
9651,
2030,
353,
3509,
29889,
24535,
8552,
29898,
7382,
416,
13,
9651,
716,
353,
3509,
29889,
24535,
8552,
29898,
7382,
29897,
13,
9651,
716,
29961,
1989,
29896,
1822,
4397,
29898,
1315,
29897,
13,
9651,
3863,
353,
2295,
29889,
10855,
29896,
29889,
6506,
29918,
650,
29898,
1025,
29892,
1482,
29897,
13,
9651,
736,
4852,
14191,
1159,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
1990,
3401,
613,
3519,
29922,
1839,
7194,
11287,
13,
1753,
770,
29918,
3888,
7295,
13,
1678,
4413,
353,
679,
2385,
3401,
580,
13,
1678,
17800,
353,
679,
20622,
3401,
580,
13,
1678,
736,
4390,
1598,
3319,
29908,
4419,
1115,
1761,
29898,
13203,
511,
376,
8071,
1115,
1761,
29898,
16009,
29879,
26972,
13,
13,
29992,
932,
29889,
13134,
11974,
2042,
3401,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
4004,
29918,
3888,
7295,
13,
1678,
921,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
1067,
29879,
353,
921,
3366,
1990,
3108,
13,
1678,
4004,
353,
679,
13438,
3401,
29898,
25932,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4419,
1115,
2042,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
657,
29911,
4204,
414,
1293,
613,
3519,
29922,
1839,
7194,
11287,
13,
1753,
679,
29918,
371,
496,
414,
29918,
1761,
7295,
13,
1678,
27335,
29892,
1661,
29911,
4204,
414,
29892,
1243,
1919,
1243,
29896,
29922,
679,
29911,
4204,
414,
1293,
580,
13,
1678,
736,
4390,
1598,
3319,
29908,
371,
496,
414,
1115,
1761,
29898,
371,
496,
414,
511,
376,
5464,
29911,
4204,
414,
1115,
1761,
29898,
5464,
29911,
4204,
414,
511,
376,
1688,
1115,
1688,
29892,
376,
1688,
29896,
1115,
1243,
29896,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
371,
11665,
12445,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
15703,
1666,
29886,
787,
4127,
4035,
6737,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
2295,
29889,
10855,
29911,
4204,
261,
7900,
647,
1860,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
5398,
2825,
2166,
985,
3730,
17794,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
657,
1523,
1860,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
679,
1523,
1860,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
12428,
29918,
1272,
353,
12428,
29918,
1272,
3366,
333,
3108,
13,
1678,
6589,
353,
679,
3596,
1523,
1860,
29898,
2061,
1204,
29898,
7971,
29918,
1272,
876,
13,
1678,
736,
4390,
1598,
3319,
29908,
21032,
1115,
6589,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
657,
13909,
3401,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
679,
13909,
3401,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
12428,
29918,
1272,
353,
12428,
29918,
1272,
3366,
2549,
3108,
13,
1678,
274,
29873,
29892,
17800,
29892,
1634,
29924,
629,
29892,
2062,
29924,
629,
1170,
353,
679,
3401,
29898,
7971,
29918,
1272,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
1990,
29911,
4204,
261,
1115,
274,
29873,
29892,
376,
16009,
29879,
1115,
16009,
29879,
29892,
376,
12276,
292,
3260,
9823,
1115,
3445,
29924,
629,
29892,
376,
12276,
292,
3260,
1170,
1115,
276,
558,
29924,
629,
1170,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
18945,
29918,
1761,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
269,
29918,
1761,
7295,
13,
1678,
848,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
269,
1761,
353,
8368,
29918,
1761,
29898,
1272,
3366,
1272,
20068,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
23853,
29887,
9010,
613,
376,
1272,
1115,
29879,
1761,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
29939,
29878,
401,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
3855,
29878,
7295,
13,
1678,
848,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
679,
29939,
29878,
353,
3855,
29878,
4478,
29898,
1272,
3366,
1272,
20068,
13,
1678,
736,
4390,
1598,
3319,
29908,
1272,
1115,
657,
29939,
29878,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
27601,
815,
613,
23515,
29922,
3366,
5438,
20068,
13,
1753,
14333,
815,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
274,
353,
12428,
29918,
1272,
1839,
1990,
2033,
13,
1678,
565,
274,
1275,
376,
29896,
29874,
29908,
470,
274,
1360,
376,
29896,
29890,
29908,
470,
274,
1360,
376,
29896,
29883,
29908,
470,
274,
1360,
376,
29896,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29896,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29896,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29906,
29874,
29908,
470,
274,
1360,
376,
29906,
29890,
29908,
470,
274,
26359,
29906,
29883,
29908,
470,
274,
26359,
29906,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29906,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29906,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29941,
29874,
29908,
470,
274,
26359,
29941,
29890,
29908,
470,
274,
26359,
29941,
29883,
29908,
470,
274,
26359,
29941,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29941,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29941,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29946,
29874,
29908,
470,
274,
26359,
29946,
29890,
29908,
470,
274,
26359,
29946,
29883,
29908,
470,
274,
26359,
29946,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29946,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29946,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29945,
29874,
29908,
470,
274,
26359,
29945,
29890,
29908,
470,
274,
26359,
29945,
29883,
29908,
470,
274,
26359,
29945,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29945,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29945,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29953,
29874,
29908,
470,
274,
26359,
29953,
29890,
29908,
470,
274,
26359,
29953,
29883,
29908,
470,
274,
26359,
29953,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29953,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29953,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29955,
29874,
29908,
470,
274,
26359,
29955,
29890,
29908,
470,
274,
26359,
29955,
29883,
29908,
470,
274,
26359,
29955,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29955,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29955,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29947,
29874,
29908,
470,
274,
26359,
29947,
29890,
29908,
470,
274,
26359,
29947,
29883,
29908,
470,
274,
26359,
29947,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29947,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29947,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29929,
29874,
29908,
470,
274,
26359,
29929,
29890,
29908,
470,
274,
26359,
29929,
29883,
29908,
470,
274,
26359,
29929,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29929,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29929,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29896,
29900,
29874,
29908,
470,
274,
26359,
29896,
29900,
29890,
29908,
470,
274,
26359,
29896,
29900,
29883,
29908,
470,
274,
26359,
29896,
29900,
29881,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
1990,
29896,
29900,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29896,
29900,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29876,
332,
643,
29891,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
29876,
332,
643,
29891,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
5595,
7759,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29931,
29889,
29968,
29889,
29954,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
29880,
9415,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
365,
29889,
29968,
29889,
29954,
4333,
1213,
1800,
13,
1678,
25342,
274,
1360,
376,
29965,
29889,
29968,
29889,
29954,
1115,
13,
4706,
2295,
29889,
2585,
29946,
29889,
2679,
29887,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
501,
29889,
29968,
29889,
29954,
4333,
1213,
1800,
13,
1678,
1683,
29901,
13,
4706,
2295,
29889,
2585,
29946,
29889,
5397,
17807,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
7455,
17807,
4333,
1213,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
4572,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
263,
29918,
4572,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
21759,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
617,
3108,
13,
1678,
2635,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1256,
3108,
13,
1678,
380,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
303,
3108,
13,
1678,
634,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
300,
3108,
13,
1678,
1014,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1491,
3108,
13,
1678,
848,
29896,
353,
14333,
562,
484,
29918,
4572,
29898,
617,
29892,
2635,
29892,
380,
29892,
634,
29892,
1014,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1469,
4649,
1150,
287,
2166,
985,
3730,
3284,
1272,
29908,
584,
2062,
29898,
1272,
29896,
26972,
13,
13,
29992,
932,
29889,
13134,
11974,
371,
11665,
4165,
21642,
613,
23515,
29922,
3366,
5438,
20068,
13,
1753,
15703,
11049,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
1596,
29898,
7971,
29918,
1272,
29897,
13,
1678,
4635,
5709,
29922,
2636,
13,
1678,
10524,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
2549,
3108,
13,
1678,
2635,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1256,
3108,
13,
1678,
1014,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1491,
3108,
13,
1678,
1067,
29879,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
25932,
3108,
13,
1678,
848,
29896,
29922,
657,
11049,
8148,
29898,
2549,
29892,
1256,
29892,
1491,
29892,
25932,
29897,
13,
1678,
4390,
29875,
29922,
3126,
1598,
3319,
29908,
4906,
4710,
1469,
512,
643,
300,
287,
2166,
985,
3730,
3284,
1272,
29908,
584,
376,
14191,
29908,
1800,
13,
1678,
1596,
313,
1272,
29896,
29897,
13,
1678,
565,
848,
29896,
1360,
8516,
29901,
13,
4706,
2295,
29889,
371,
496,
414,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
4706,
2186,
29922,
3126,
29875,
13,
1678,
1683,
29901,
13,
4706,
6965,
353,
12428,
29918,
1272,
3366,
1272,
3108,
3366,
1188,
449,
2481,
3108,
13,
4706,
5694,
353,
6571,
13,
4706,
363,
1820,
29892,
995,
297,
848,
29896,
29889,
7076,
7295,
13,
9651,
565,
1820,
451,
297,
6796,
29918,
333,
3108,
29901,
13,
18884,
5694,
29961,
1989,
13192,
1767,
13,
4706,
2030,
353,
3509,
29889,
24535,
8552,
29898,
7382,
29897,
13,
4706,
716,
353,
3509,
29889,
24535,
8552,
29898,
7382,
29897,
13,
4706,
716,
3366,
1272,
3108,
3366,
1188,
449,
2481,
3108,
29922,
1315,
13,
4706,
2295,
29889,
371,
496,
414,
29889,
6506,
29918,
650,
29898,
1025,
29892,
1482,
29897,
13,
4706,
2186,
29922,
3126,
1598,
3319,
29908,
4906,
4710,
3403,
449,
2166,
985,
3730,
3284,
1272,
29908,
584,
376,
14191,
29908,
1800,
13,
1678,
736,
2186,
13,
13,
29992,
932,
29889,
13134,
11974,
371,
496,
414,
8148,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
27335,
8148,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
10524,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
2549,
3108,
13,
1678,
2635,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1256,
3108,
13,
1678,
1014,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1491,
3108,
13,
1678,
1067,
29879,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
25932,
3108,
13,
1678,
848,
29896,
353,
679,
11049,
8148,
29898,
2549,
29892,
2635,
29892,
1491,
29892,
25932,
29897,
13,
1678,
1596,
29898,
1272,
29896,
29897,
13,
1678,
4390,
29875,
29922,
3126,
1598,
3319,
29908,
4906,
4710,
1469,
4649,
1150,
287,
2166,
985,
3730,
3284,
1272,
29908,
584,
376,
12199,
29908,
1800,
13,
1678,
565,
848,
29896,
1360,
8516,
29901,
13,
4706,
2186,
29922,
3126,
29875,
13,
1678,
1683,
29901,
13,
4706,
2186,
29922,
3126,
1598,
3319,
29908,
4906,
4710,
1469,
4649,
1150,
287,
2166,
985,
3730,
3284,
1272,
29908,
584,
848,
29896,
1800,
13,
1678,
736,
2186,
13,
13,
29992,
932,
29889,
13134,
11974,
18082,
29891,
23369,
1705,
613,
23515,
29922,
3366,
5438,
20068,
13,
1753,
12314,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
2295,
29889,
10855,
7187,
29889,
7851,
29918,
650,
29898,
7971,
29918,
1272,
467,
7851,
287,
29918,
333,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
4134,
29896,
4333,
1213,
1800,
29871,
13,
13,
29992,
932,
29889,
13134,
11974,
6729,
328,
4384,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
12672,
29918,
1333,
625,
7295,
13,
1678,
848,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
1596,
29898,
1272,
29897,
13,
1678,
2295,
29889,
6729,
328,
4384,
29889,
7851,
29918,
650,
29898,
1272,
467,
7851,
287,
29918,
333,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1272,
15478,
964,
12672,
4333,
29889,
3284,
1272,
1115,
276,
558,
29898,
1272,
26972,
13,
13,
29992,
932,
29889,
13134,
11974,
657,
29933,
9972,
4384,
613,
3519,
29922,
3366,
7194,
20068,
13,
1753,
679,
7295,
13,
1678,
301,
29896,
353,
5159,
13,
1678,
363,
474,
297,
2295,
29889,
6729,
328,
4384,
29889,
2886,
7295,
13,
4706,
848,
353,
474,
13,
4706,
848,
3366,
29918,
333,
3108,
353,
851,
29898,
1272,
3366,
29918,
333,
20068,
13,
4706,
301,
29896,
29889,
4397,
29898,
1272,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
6729,
328,
4384,
29871,
3630,
4649,
1150,
287,
21397,
3730,
3284,
1272,
1115,
29880,
29896,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
26143,
13909,
613,
23515,
29922,
3366,
5438,
20068,
13,
1753,
9358,
7295,
13,
1678,
848,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
1596,
29898,
1272,
29897,
13,
1678,
10524,
29892,
13892,
362,
29892,
303,
3470,
1542,
353,
3414,
13909,
29898,
1272,
3366,
5415,
20068,
13,
1678,
274,
29873,
29892,
17800,
29892,
1634,
29924,
629,
29892,
2062,
29924,
629,
1170,
29922,
679,
3401,
29898,
2549,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
19461,
10343,
4649,
1150,
287,
3284,
14925,
1367,
1115,
2549,
1699,
13020,
292,
15629,
4408,
1115,
276,
558,
29924,
629,
1170,
1699,
4002,
25072,
1115,
13892,
362,
1699,
855,
3470,
5167,
1115,
303,
3470,
1542,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
4572,
29906,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
263,
29918,
4572,
29906,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
21759,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
617,
3108,
13,
1678,
2635,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1256,
3108,
13,
1678,
1014,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1491,
3108,
13,
1678,
848,
29896,
353,
14333,
562,
484,
29918,
4572,
29898,
617,
29892,
1014,
29892,
2635,
29897,
13,
1678,
1596,
29898,
1272,
29896,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1469,
4649,
1150,
287,
2166,
985,
3730,
3284,
1272,
29908,
584,
848,
29896,
1800,
13,
13,
29937,
732,
932,
29889,
13134,
11974,
22848,
4572,
613,
3519,
29922,
3366,
5438,
20068,
13,
29937,
822,
286,
29918,
4572,
7295,
13,
29937,
268,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
29937,
268,
21759,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
617,
3108,
13,
29937,
268,
2635,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1256,
3108,
13,
29937,
268,
1014,
29922,
7971,
29918,
1272,
3366,
1272,
3108,
3366,
1491,
3108,
13,
29937,
268,
848,
29896,
353,
17997,
29918,
4572,
29898,
617,
29892,
1014,
29892,
2635,
29897,
13,
29937,
268,
1596,
29898,
1272,
29896,
29897,
13,
29937,
268,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1469,
4649,
1150,
287,
2166,
985,
3730,
3284,
1272,
29908,
584,
848,
29896,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
22848,
4572,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
286,
29918,
4572,
7295,
13,
1678,
12428,
29918,
1272,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
4413,
29922,
7971,
29918,
1272,
3366,
1990,
3108,
13,
1678,
4392,
29918,
1853,
29922,
7971,
29918,
1272,
3366,
735,
314,
29918,
1853,
3108,
13,
1678,
848,
29896,
353,
17997,
29918,
4572,
29898,
13203,
29892,
735,
314,
29918,
1853,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
4710,
1469,
4649,
1150,
287,
3284,
1272,
29908,
584,
848,
29896,
1800,
13,
13,
29992,
932,
29889,
13134,
11974,
18945,
1287,
613,
3519,
29922,
3366,
7194,
3284,
5438,
20068,
13,
1753,
8368,
7662,
7295,
13,
1678,
3414,
29918,
14144,
353,
2009,
29889,
657,
29918,
3126,
580,
13,
1678,
770,
29918,
978,
353,
3414,
29918,
14144,
3366,
1990,
29918,
978,
3108,
13,
1678,
4967,
29918,
978,
353,
3414,
29918,
14144,
3366,
16009,
29918,
978,
3108,
13,
1678,
380,
353,
8368,
29918,
7662,
29898,
1990,
29918,
978,
29892,
16009,
29918,
978,
29897,
13,
1678,
1596,
29898,
303,
29897,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
1115,
303,
1800,
13,
29992,
932,
29889,
13134,
11974,
7851,
22848,
29908,
1919,
23515,
29922,
3366,
5438,
20068,
13,
1753,
22313,
7295,
13,
1678,
17997,
29922,
3827,
29889,
657,
29918,
3126,
580,
13,
1678,
2295,
29889,
10855,
9802,
29889,
7851,
29918,
650,
29898,
22848,
467,
7851,
287,
29918,
333,
13,
1678,
736,
4390,
1598,
3319,
29908,
4906,
1115,
376,
14191,
29908,
1800,
13,
932,
29889,
3389,
29898,
8382,
29922,
5574,
29892,
2011,
29922,
29945,
29900,
29900,
29896,
29892,
3495,
543,
29900,
29889,
29900,
29889,
29900,
29889,
29900,
1159,
2
] |
tiles/test_deactivate.py | MiroK/tieler | 1 | 1608682 | <filename>tiles/test_deactivate.py
from dolfin import *
import sys
mesh_file = 'tile_1_hein_GMSH307_4_4_noBdry.h5'
parameters['ghost_mode'] = 'shared_facet'
comm = MPI.comm_world # FIXME!
h5 = HDF5File(comm, mesh_file, 'r')
mesh = Mesh()
h5.read(mesh, 'mesh', False)
surfaces = MeshFunction('size_t', mesh, mesh.topology().dim()-1, 0)
h5.read(surfaces, 'surfaces')
volumes = MeshFunction('size_t', mesh, mesh.topology().dim(), 0)
h5.read(volumes, 'volumes')
# Volume of the remaining cells
print(assemble(Constant(1)*dx(domain=mesh, subdomain_data=volumes, subdomain_id=1)))
dS = dS(domain=mesh, subdomain_data=surfaces)
ds = ds(domain=mesh, subdomain_data=surfaces)
# Surface area of all the surfaces
print(1, assemble(Constant(1)*dS(1) + Constant(1)*ds(1)))
| [
1,
529,
9507,
29958,
1376,
267,
29914,
1688,
29918,
311,
11236,
403,
29889,
2272,
13,
3166,
270,
4369,
262,
1053,
334,
13,
5215,
10876,
13,
13,
13,
4467,
29882,
29918,
1445,
353,
525,
29873,
488,
29918,
29896,
29918,
12880,
29918,
29954,
4345,
29950,
29941,
29900,
29955,
29918,
29946,
29918,
29946,
29918,
1217,
29933,
29881,
719,
29889,
29882,
29945,
29915,
13,
13,
16744,
1839,
29887,
3069,
29918,
8513,
2033,
353,
525,
12366,
29918,
17470,
300,
29915,
13,
13,
2055,
353,
341,
2227,
29889,
2055,
29918,
11526,
29871,
396,
383,
6415,
2303,
29991,
13,
29882,
29945,
353,
379,
4037,
29945,
2283,
29898,
2055,
29892,
27716,
29918,
1445,
29892,
525,
29878,
1495,
13,
4467,
29882,
353,
341,
12094,
580,
13,
29882,
29945,
29889,
949,
29898,
4467,
29882,
29892,
525,
4467,
29882,
742,
7700,
29897,
13,
13,
7610,
8726,
353,
341,
12094,
6678,
877,
2311,
29918,
29873,
742,
27716,
29892,
27716,
29889,
3332,
3002,
2141,
6229,
580,
29899,
29896,
29892,
29871,
29900,
29897,
13,
29882,
29945,
29889,
949,
29898,
7610,
8726,
29892,
525,
7610,
8726,
1495,
13,
13,
1555,
9351,
353,
341,
12094,
6678,
877,
2311,
29918,
29873,
742,
27716,
29892,
27716,
29889,
3332,
3002,
2141,
6229,
3285,
29871,
29900,
29897,
13,
29882,
29945,
29889,
949,
29898,
1555,
9351,
29892,
525,
1555,
9351,
1495,
13,
13,
29937,
16934,
310,
278,
9886,
9101,
13,
2158,
29898,
465,
6967,
29898,
12075,
424,
29898,
29896,
11877,
8235,
29898,
7247,
29922,
4467,
29882,
29892,
1014,
7247,
29918,
1272,
29922,
1555,
9351,
29892,
1014,
7247,
29918,
333,
29922,
29896,
4961,
13,
13,
29881,
29903,
353,
270,
29903,
29898,
7247,
29922,
4467,
29882,
29892,
1014,
7247,
29918,
1272,
29922,
7610,
8726,
29897,
13,
6289,
353,
18031,
29898,
7247,
29922,
4467,
29882,
29892,
1014,
7247,
29918,
1272,
29922,
7610,
8726,
29897,
13,
13,
29937,
6298,
2161,
4038,
310,
599,
278,
28001,
13,
2158,
29898,
29896,
29892,
24940,
29898,
12075,
424,
29898,
29896,
11877,
29881,
29903,
29898,
29896,
29897,
718,
28601,
29898,
29896,
11877,
6289,
29898,
29896,
4961,
13,
2
] |
tests/test_supervised/test_algorithms/test_optimization_algorithms/test_services/test_optimizers.py | j2slab/MLStudio | 1 | 179124 | # -*- coding:utf-8 -*-
# =========================================================================== #
# Project : MLStudio #
# File : \test_optimizers copy.py #
# Python : 3.8.3 #
# --------------------------------------------------------------------------- #
# Author : <NAME> #
# Company : nov8.ai #
# Email : <EMAIL> #
# URL : https://github.com/nov8ai/MLStudio #
# --------------------------------------------------------------------------- #
# Created : Thursday, July 9th 2020, 8:23:30 am #
# Last Modified : Thursday, July 9th 2020, 8:23:30 am #
# Modified By : <NAME> (<EMAIL>) #
# --------------------------------------------------------------------------- #
# License : BSD #
# Copyright (c) 2020 nov8.ai #
# =========================================================================== #
#%%
import math
import os
from pathlib import Path
import sys
import glob
import numpy as np
import pandas as pd
import pytest
from pytest import mark
from sklearn.metrics import mean_squared_error
from sklearn.datasets import make_regression, make_classification
from sklearn.datasets import make_multilabel_classification
homedir = str(Path(__file__).parents[3])
datadir = os.path.join(homedir, "tests\\test_data")
sys.path.append(homedir)
sys.path.append(datadir)
from mlstudio.supervised.algorithms.optimization.services.optimizers import GradientDescentOptimizer
from mlstudio.supervised.algorithms.optimization.services.optimizers import Momentum, Nesterov
from mlstudio.supervised.algorithms.optimization.services.optimizers import Adagrad, Adadelta
from mlstudio.supervised.algorithms.optimization.services.optimizers import RMSprop, Adam, AdaMax
from mlstudio.supervised.algorithms.optimization.services.optimizers import Nadam, AMSGrad, AdamW
from mlstudio.supervised.algorithms.optimization.services.optimizers import AggMo, QuasiHyperbolicMomentum
# -------------------------------------------------------------------------- #
# Mock gradient function
def gradient(theta):
theta = theta * 0.95
return theta
@mark.optimizers
@mark.momentum
def test_optimizer_momentum(get_optimization_momentum_test_package):
p = get_optimization_momentum_test_package
theta = p['theta_init']
alpha = p['alpha']
optimizer = Momentum()
for i in range(10):
assert np.allclose(theta, p['theta'][i]), \
"Momentum not working, Iteration {i} expected {e}, actual {a}".format(
i = str(i),
e=str(p['theta'][i]), a=str(theta)
)
theta, grad = optimizer(gradient, alpha, theta)
@mark.optimizers
@mark.nesterov
def test_optimizer_nesterov(get_optimization_nesterov_test_package):
p = get_optimization_nesterov_test_package
theta = p['theta_init']
alpha = p['alpha']
optimizer = Nesterov()
for i in range(10):
assert np.allclose(theta, p['theta'][i]), \
"Nesterov not working, Iteration {i} expected {e}, actual {a}".format(
i = str(i),
e=str(p['theta'][i]), a=str(theta)
)
theta, grad = optimizer(gradient, alpha, theta)
@mark.optimizers
@mark.adagrad
def test_optimizer_adagrad(get_optimization_adagrad_test_package):
p = get_optimization_adagrad_test_package
theta = p['theta_init']
alpha = p['alpha']
optimizer = Adagrad()
for i in range(4):
assert np.allclose(theta, p['theta'][i]), \
"Adagrad not working, Iteration {i} expected {e}, actual {a}".format(
i = str(i),
e=str(p['theta'][i]), a=str(theta)
)
theta, grad = optimizer(gradient, alpha, theta) | [
1,
396,
448,
29930,
29899,
14137,
29901,
9420,
29899,
29947,
448,
29930,
29899,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
29922,
396,
13,
29937,
8010,
584,
23158,
28867,
462,
462,
462,
3986,
396,
13,
29937,
3497,
1678,
584,
320,
1688,
29918,
20640,
19427,
3509,
29889,
2272,
462,
462,
3986,
396,
13,
29937,
5132,
29871,
584,
29871,
29941,
29889,
29947,
29889,
29941,
462,
462,
462,
632,
396,
13,
29937,
448,
2683,
2683,
2683,
2683,
28400,
396,
13,
29937,
13361,
29871,
584,
529,
5813,
29958,
462,
462,
462,
4706,
396,
13,
29937,
6938,
584,
2420,
29947,
29889,
1794,
462,
462,
462,
965,
396,
13,
29937,
22608,
259,
584,
529,
26862,
6227,
29958,
462,
462,
462,
1678,
396,
13,
29937,
3988,
268,
584,
2045,
597,
3292,
29889,
510,
29914,
13715,
29947,
1794,
29914,
1988,
28867,
462,
18884,
396,
13,
29937,
448,
2683,
2683,
2683,
2683,
28400,
396,
13,
29937,
6760,
630,
539,
584,
498,
1295,
3250,
29892,
5468,
29871,
29929,
386,
29871,
29906,
29900,
29906,
29900,
29892,
29871,
29947,
29901,
29906,
29941,
29901,
29941,
29900,
626,
462,
308,
396,
13,
29937,
9208,
3382,
2164,
584,
498,
1295,
3250,
29892,
5468,
29871,
29929,
386,
29871,
29906,
29900,
29906,
29900,
29892,
29871,
29947,
29901,
29906,
29941,
29901,
29941,
29900,
626,
462,
308,
396,
13,
29937,
3382,
2164,
2648,
259,
584,
529,
5813,
29958,
313,
29966,
26862,
6227,
12948,
462,
462,
396,
13,
29937,
448,
2683,
2683,
2683,
2683,
28400,
396,
13,
29937,
19245,
584,
350,
7230,
462,
462,
462,
1669,
396,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29900,
2420,
29947,
29889,
1794,
462,
462,
462,
29871,
396,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
29922,
396,
13,
29937,
7686,
13,
5215,
5844,
13,
5215,
2897,
13,
3166,
2224,
1982,
1053,
10802,
13,
5215,
10876,
13,
13,
5215,
13149,
13,
5215,
12655,
408,
7442,
13,
5215,
11701,
408,
10518,
13,
5215,
11451,
1688,
13,
3166,
11451,
1688,
1053,
2791,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
2099,
29918,
26613,
1965,
29918,
2704,
13,
3166,
2071,
19668,
29889,
14538,
1691,
1053,
1207,
29918,
276,
11476,
29892,
1207,
29918,
1990,
2450,
13,
3166,
2071,
19668,
29889,
14538,
1691,
1053,
1207,
29918,
4713,
309,
1107,
29918,
1990,
2450,
13,
13,
9706,
287,
381,
353,
851,
29898,
2605,
22168,
1445,
1649,
467,
862,
1237,
29961,
29941,
2314,
13,
4130,
328,
381,
353,
2897,
29889,
2084,
29889,
7122,
29898,
9706,
287,
381,
29892,
376,
21150,
1966,
1688,
29918,
1272,
1159,
13,
9675,
29889,
2084,
29889,
4397,
29898,
9706,
287,
381,
29897,
13,
9675,
29889,
2084,
29889,
4397,
29898,
4130,
328,
381,
29897,
13,
13,
3166,
286,
29880,
12073,
29889,
9136,
11292,
29889,
9564,
12404,
29889,
20640,
2133,
29889,
9916,
29889,
20640,
19427,
1053,
19295,
993,
4002,
1760,
20624,
326,
3950,
13,
3166,
286,
29880,
12073,
29889,
9136,
11292,
29889,
9564,
12404,
29889,
20640,
2133,
29889,
9916,
29889,
20640,
19427,
1053,
341,
2932,
398,
29892,
405,
4156,
586,
13,
3166,
286,
29880,
12073,
29889,
9136,
11292,
29889,
9564,
12404,
29889,
20640,
2133,
29889,
9916,
29889,
20640,
19427,
1053,
2087,
351,
3665,
29892,
2087,
328,
2554,
418,
13,
3166,
286,
29880,
12073,
29889,
9136,
11292,
29889,
9564,
12404,
29889,
20640,
2133,
29889,
9916,
29889,
20640,
19427,
1053,
390,
4345,
7728,
29892,
11783,
29892,
23255,
7976,
13,
3166,
286,
29880,
12073,
29889,
9136,
11292,
29889,
9564,
12404,
29889,
20640,
2133,
29889,
9916,
29889,
20640,
19427,
1053,
18496,
314,
29892,
319,
4345,
25584,
29892,
11783,
29956,
13,
3166,
286,
29880,
12073,
29889,
9136,
11292,
29889,
9564,
12404,
29889,
20640,
2133,
29889,
9916,
29889,
20640,
19427,
1053,
319,
1505,
22638,
29892,
751,
6840,
26322,
546,
2095,
293,
29924,
2932,
398,
13,
29937,
448,
2683,
2683,
2683,
2683,
1378,
29899,
29871,
396,
13,
29937,
26297,
16030,
740,
13,
1753,
16030,
29898,
3416,
1125,
13,
1678,
278,
941,
353,
278,
941,
334,
29871,
29900,
29889,
29929,
29945,
13,
1678,
736,
278,
941,
13,
13,
29992,
3502,
29889,
20640,
19427,
13,
29992,
3502,
29889,
29885,
2932,
398,
13,
1753,
1243,
29918,
20640,
3950,
29918,
29885,
2932,
398,
29898,
657,
29918,
20640,
2133,
29918,
29885,
2932,
398,
29918,
1688,
29918,
5113,
1125,
13,
1678,
282,
353,
679,
29918,
20640,
2133,
29918,
29885,
2932,
398,
29918,
1688,
29918,
5113,
13,
1678,
278,
941,
353,
282,
1839,
3416,
29918,
2344,
2033,
13,
1678,
15595,
353,
282,
1839,
2312,
2033,
13,
1678,
5994,
3950,
353,
341,
2932,
398,
580,
13,
1678,
363,
474,
297,
3464,
29898,
29896,
29900,
1125,
13,
4706,
4974,
7442,
29889,
497,
5358,
29898,
3416,
29892,
282,
1839,
3416,
2033,
29961,
29875,
11724,
320,
13,
9651,
376,
29924,
2932,
398,
451,
1985,
29892,
20504,
362,
426,
29875,
29913,
3806,
426,
29872,
1118,
3935,
426,
29874,
29913,
1642,
4830,
29898,
13,
18884,
474,
353,
851,
29898,
29875,
511,
13,
18884,
321,
29922,
710,
29898,
29886,
1839,
3416,
2033,
29961,
29875,
11724,
263,
29922,
710,
29898,
3416,
29897,
13,
4706,
1723,
13,
4706,
278,
941,
29892,
4656,
353,
5994,
3950,
29898,
24970,
29892,
15595,
29892,
278,
941,
29897,
268,
13,
268,
13,
29992,
3502,
29889,
20640,
19427,
13,
29992,
3502,
29889,
29876,
4156,
586,
13,
1753,
1243,
29918,
20640,
3950,
29918,
29876,
4156,
586,
29898,
657,
29918,
20640,
2133,
29918,
29876,
4156,
586,
29918,
1688,
29918,
5113,
1125,
13,
1678,
282,
353,
679,
29918,
20640,
2133,
29918,
29876,
4156,
586,
29918,
1688,
29918,
5113,
13,
1678,
278,
941,
353,
282,
1839,
3416,
29918,
2344,
2033,
13,
1678,
15595,
353,
282,
1839,
2312,
2033,
13,
1678,
5994,
3950,
353,
405,
4156,
586,
580,
13,
1678,
363,
474,
297,
3464,
29898,
29896,
29900,
1125,
13,
4706,
4974,
7442,
29889,
497,
5358,
29898,
3416,
29892,
282,
1839,
3416,
2033,
29961,
29875,
11724,
320,
13,
9651,
376,
29940,
4156,
586,
451,
1985,
29892,
20504,
362,
426,
29875,
29913,
3806,
426,
29872,
1118,
3935,
426,
29874,
29913,
1642,
4830,
29898,
13,
18884,
474,
353,
851,
29898,
29875,
511,
13,
18884,
321,
29922,
710,
29898,
29886,
1839,
3416,
2033,
29961,
29875,
11724,
263,
29922,
710,
29898,
3416,
29897,
13,
4706,
1723,
13,
4706,
278,
941,
29892,
4656,
353,
5994,
3950,
29898,
24970,
29892,
15595,
29892,
278,
941,
29897,
259,
13,
13,
13,
29992,
3502,
29889,
20640,
19427,
13,
29992,
3502,
29889,
328,
351,
3665,
13,
1753,
1243,
29918,
20640,
3950,
29918,
328,
351,
3665,
29898,
657,
29918,
20640,
2133,
29918,
328,
351,
3665,
29918,
1688,
29918,
5113,
1125,
13,
1678,
282,
353,
679,
29918,
20640,
2133,
29918,
328,
351,
3665,
29918,
1688,
29918,
5113,
13,
1678,
278,
941,
353,
282,
1839,
3416,
29918,
2344,
2033,
13,
1678,
15595,
353,
282,
1839,
2312,
2033,
13,
1678,
5994,
3950,
353,
2087,
351,
3665,
580,
13,
1678,
363,
474,
297,
3464,
29898,
29946,
1125,
13,
4706,
4974,
7442,
29889,
497,
5358,
29898,
3416,
29892,
282,
1839,
3416,
2033,
29961,
29875,
11724,
320,
13,
9651,
376,
3253,
351,
3665,
451,
1985,
29892,
20504,
362,
426,
29875,
29913,
3806,
426,
29872,
1118,
3935,
426,
29874,
29913,
1642,
4830,
29898,
13,
18884,
474,
353,
851,
29898,
29875,
511,
13,
18884,
321,
29922,
710,
29898,
29886,
1839,
3416,
2033,
29961,
29875,
11724,
263,
29922,
710,
29898,
3416,
29897,
13,
4706,
1723,
13,
4706,
278,
941,
29892,
4656,
353,
5994,
3950,
29898,
24970,
29892,
15595,
29892,
278,
941,
29897,
965,
2
] |
scripts/study_case/ID_5/matchzoo/auto/tuner/tune.py | kzbnb/numerical_bugs | 8 | 1749 | import typing
import numpy as np
import scripts.study_case.ID_5.matchzoo as mz
from scripts.study_case.ID_5.matchzoo.engine.base_metric import BaseMetric
from .tuner import Tuner
def tune(
params: 'mz.ParamTable',
optimizer: str = 'adam',
trainloader: mz.dataloader.DataLoader = None,
validloader: mz.dataloader.DataLoader = None,
embedding: np.ndarray = None,
fit_kwargs: dict = None,
metric: typing.Union[str, BaseMetric] = None,
mode: str = 'maximize',
num_runs: int = 10,
verbose=1
):
"""
Tune model hyper-parameters.
A simple shorthand for using :class:`matchzoo.auto.Tuner`.
`model.params.hyper_space` reprensents the model's hyper-parameters
search space, which is the cross-product of individual hyper parameter's
hyper space. When a `Tuner` builds a model, for each hyper parameter in
`model.params`, if the hyper-parameter has a hyper-space, then a sample
will be taken in the space. However, if the hyper-parameter does not
have a hyper-space, then the default value of the hyper-parameter will
be used.
See `tutorials/model_tuning.ipynb` for a detailed walkthrough on usage.
:param params: A completed parameter table to tune. Usually `model.params`
of the desired model to tune. `params.completed()` should be `True`.
:param optimizer: Str or `Optimizer` class. Optimizer for optimizing model.
:param trainloader: Training data to use. Should be a `DataLoader`.
:param validloader: Testing data to use. Should be a `DataLoader`.
:param embedding: Embedding used by model.
:param fit_kwargs: Extra keyword arguments to pass to `fit`.
(default: `dict(epochs=10, verbose=0)`)
:param metric: Metric to tune upon. Must be one of the metrics in
`model.params['task'].metrics`. (default: the first metric in
`params.['task'].metrics`.
:param mode: Either `maximize` the metric or `minimize` the metric.
(default: 'maximize')
:param num_runs: Number of runs. Each run takes a sample in
`params.hyper_space` and build a model based on the sample.
(default: 10)
:param callbacks: A list of callbacks to handle. Handled sequentially
at every callback point.
:param verbose: Verbosity. (default: 1)
Example:
>>> import scripts.study_case.ID_5.matchzoo as mz
>>> import numpy as np
>>> train = mz.datasets.toy.load_data('train')
>>> valid = mz.datasets.toy.load_data('dev')
>>> prpr = mz.models.DenseBaseline.get_default_preprocessor()
>>> train = prpr.fit_transform(train, verbose=0)
>>> valid = prpr.transform(valid, verbose=0)
>>> trainset = mz.dataloader.Dataset(train)
>>> validset = mz.dataloader.Dataset(valid)
>>> padding = mz.models.DenseBaseline.get_default_padding_callback()
>>> trainloader = mz.dataloader.DataLoader(trainset, callback=padding)
>>> validloader = mz.dataloader.DataLoader(validset, callback=padding)
>>> model = mz.models.DenseBaseline()
>>> model.params['task'] = mz.tasks.Ranking()
>>> optimizer = 'adam'
>>> embedding = np.random.uniform(-0.2, 0.2,
... (prpr.context['vocab_size'], 100))
>>> tuner = mz.auto.Tuner(
... params=model.params,
... optimizer=optimizer,
... trainloader=trainloader,
... validloader=validloader,
... embedding=embedding,
... num_runs=1,
... verbose=0
... )
>>> results = tuner.tune()
>>> sorted(results['best'].keys())
['#', 'params', 'sample', 'score']
"""
tuner = Tuner(
params=params,
optimizer=optimizer,
trainloader=trainloader,
validloader=validloader,
embedding=embedding,
fit_kwargs=fit_kwargs,
metric=metric,
mode=mode,
num_runs=num_runs,
verbose=verbose
)
return tuner.tune()
| [
1,
1053,
19229,
13,
13,
5215,
12655,
408,
7442,
13,
13,
5215,
12078,
29889,
18082,
29891,
29918,
4878,
29889,
1367,
29918,
29945,
29889,
4352,
2502,
29877,
408,
286,
29920,
13,
3166,
12078,
29889,
18082,
29891,
29918,
4878,
29889,
1367,
29918,
29945,
29889,
4352,
2502,
29877,
29889,
10599,
29889,
3188,
29918,
16414,
1053,
7399,
10095,
2200,
13,
3166,
869,
29873,
348,
261,
1053,
21072,
261,
13,
13,
13,
1753,
260,
1540,
29898,
13,
1678,
8636,
29901,
525,
29885,
29920,
29889,
4736,
3562,
742,
13,
1678,
5994,
3950,
29901,
851,
353,
525,
328,
314,
742,
13,
1678,
7945,
12657,
29901,
286,
29920,
29889,
29881,
2075,
29877,
1664,
29889,
1469,
10036,
353,
6213,
29892,
13,
1678,
2854,
12657,
29901,
286,
29920,
29889,
29881,
2075,
29877,
1664,
29889,
1469,
10036,
353,
6213,
29892,
13,
1678,
23655,
29901,
7442,
29889,
299,
2378,
353,
6213,
29892,
13,
1678,
6216,
29918,
19290,
29901,
9657,
353,
6213,
29892,
13,
1678,
12714,
29901,
19229,
29889,
19986,
29961,
710,
29892,
7399,
10095,
2200,
29962,
353,
6213,
29892,
13,
1678,
4464,
29901,
851,
353,
525,
27525,
675,
742,
13,
1678,
954,
29918,
3389,
29879,
29901,
938,
353,
29871,
29896,
29900,
29892,
13,
1678,
26952,
29922,
29896,
13,
1125,
13,
1678,
9995,
13,
1678,
323,
1540,
1904,
11266,
29899,
16744,
29889,
13,
13,
1678,
319,
2560,
528,
2072,
392,
363,
773,
584,
1990,
18078,
4352,
2502,
29877,
29889,
6921,
29889,
29911,
348,
261,
1412,
13,
13,
1678,
421,
4299,
29889,
7529,
29889,
24947,
29918,
3493,
29952,
2062,
575,
1237,
278,
1904,
29915,
29879,
11266,
29899,
16744,
13,
1678,
2740,
2913,
29892,
607,
338,
278,
4891,
29899,
4704,
310,
5375,
11266,
3443,
29915,
29879,
13,
1678,
11266,
2913,
29889,
1932,
263,
421,
29911,
348,
261,
29952,
23315,
263,
1904,
29892,
363,
1269,
11266,
3443,
297,
13,
1678,
421,
4299,
29889,
7529,
1673,
565,
278,
11266,
29899,
15501,
756,
263,
11266,
29899,
3493,
29892,
769,
263,
4559,
13,
1678,
674,
367,
4586,
297,
278,
2913,
29889,
2398,
29892,
565,
278,
11266,
29899,
15501,
947,
451,
13,
1678,
505,
263,
11266,
29899,
3493,
29892,
769,
278,
2322,
995,
310,
278,
11266,
29899,
15501,
674,
13,
1678,
367,
1304,
29889,
13,
13,
1678,
2823,
421,
12631,
29879,
29914,
4299,
29918,
29873,
27964,
29889,
666,
948,
29890,
29952,
363,
263,
13173,
6686,
20678,
373,
8744,
29889,
13,
13,
1678,
584,
3207,
8636,
29901,
319,
8676,
3443,
1591,
304,
260,
1540,
29889,
26991,
421,
4299,
29889,
7529,
29952,
13,
4706,
310,
278,
7429,
1904,
304,
260,
1540,
29889,
421,
7529,
29889,
5729,
9446,
2555,
881,
367,
421,
5574,
1412,
13,
1678,
584,
3207,
5994,
3950,
29901,
3767,
470,
421,
20624,
326,
3950,
29952,
770,
29889,
20693,
326,
3950,
363,
5994,
5281,
1904,
29889,
13,
1678,
584,
3207,
7945,
12657,
29901,
26101,
848,
304,
671,
29889,
10575,
367,
263,
421,
1469,
10036,
1412,
13,
1678,
584,
3207,
2854,
12657,
29901,
4321,
292,
848,
304,
671,
29889,
10575,
367,
263,
421,
1469,
10036,
1412,
13,
1678,
584,
3207,
23655,
29901,
2812,
2580,
8497,
1304,
491,
1904,
29889,
13,
1678,
584,
3207,
6216,
29918,
19290,
29901,
7338,
336,
13553,
6273,
304,
1209,
304,
421,
9202,
1412,
13,
4706,
313,
4381,
29901,
421,
8977,
29898,
1022,
2878,
29879,
29922,
29896,
29900,
29892,
26952,
29922,
29900,
3569,
29897,
13,
1678,
584,
3207,
12714,
29901,
4737,
2200,
304,
260,
1540,
2501,
29889,
19928,
367,
697,
310,
278,
21556,
297,
13,
4706,
421,
4299,
29889,
7529,
1839,
7662,
13359,
2527,
10817,
1412,
313,
4381,
29901,
278,
937,
12714,
297,
13,
4706,
421,
7529,
29889,
1839,
7662,
13359,
2527,
10817,
1412,
13,
1678,
584,
3207,
4464,
29901,
20370,
421,
27525,
675,
29952,
278,
12714,
470,
421,
1195,
326,
675,
29952,
278,
12714,
29889,
13,
4706,
313,
4381,
29901,
525,
27525,
675,
1495,
13,
1678,
584,
3207,
954,
29918,
3389,
29879,
29901,
9681,
310,
6057,
29889,
7806,
1065,
4893,
263,
4559,
297,
13,
4706,
421,
7529,
29889,
24947,
29918,
3493,
29952,
322,
2048,
263,
1904,
2729,
373,
278,
4559,
29889,
13,
4706,
313,
4381,
29901,
29871,
29896,
29900,
29897,
13,
1678,
584,
3207,
6939,
29879,
29901,
319,
1051,
310,
6939,
29879,
304,
4386,
29889,
5166,
839,
8617,
9247,
13,
4706,
472,
1432,
6939,
1298,
29889,
13,
1678,
584,
3207,
26952,
29901,
26646,
359,
537,
29889,
313,
4381,
29901,
29871,
29896,
29897,
13,
13,
1678,
8741,
29901,
13,
4706,
8653,
1053,
12078,
29889,
18082,
29891,
29918,
4878,
29889,
1367,
29918,
29945,
29889,
4352,
2502,
29877,
408,
286,
29920,
13,
4706,
8653,
1053,
12655,
408,
7442,
13,
4706,
8653,
7945,
353,
286,
29920,
29889,
14538,
1691,
29889,
517,
29891,
29889,
1359,
29918,
1272,
877,
14968,
1495,
13,
4706,
8653,
2854,
353,
286,
29920,
29889,
14538,
1691,
29889,
517,
29891,
29889,
1359,
29918,
1272,
877,
3359,
1495,
13,
4706,
8653,
544,
558,
353,
286,
29920,
29889,
9794,
29889,
29928,
1947,
9496,
5570,
29889,
657,
29918,
4381,
29918,
1457,
26482,
580,
13,
4706,
8653,
7945,
353,
544,
558,
29889,
9202,
29918,
9067,
29898,
14968,
29892,
26952,
29922,
29900,
29897,
13,
4706,
8653,
2854,
353,
544,
558,
29889,
9067,
29898,
3084,
29892,
26952,
29922,
29900,
29897,
13,
4706,
8653,
7945,
842,
353,
286,
29920,
29889,
29881,
2075,
29877,
1664,
29889,
16390,
24541,
29898,
14968,
29897,
13,
4706,
8653,
2854,
842,
353,
286,
29920,
29889,
29881,
2075,
29877,
1664,
29889,
16390,
24541,
29898,
3084,
29897,
13,
4706,
8653,
7164,
353,
286,
29920,
29889,
9794,
29889,
29928,
1947,
9496,
5570,
29889,
657,
29918,
4381,
29918,
12791,
29918,
14035,
580,
13,
4706,
8653,
7945,
12657,
353,
286,
29920,
29889,
29881,
2075,
29877,
1664,
29889,
1469,
10036,
29898,
14968,
842,
29892,
6939,
29922,
12791,
29897,
13,
4706,
8653,
2854,
12657,
353,
286,
29920,
29889,
29881,
2075,
29877,
1664,
29889,
1469,
10036,
29898,
3084,
842,
29892,
6939,
29922,
12791,
29897,
13,
4706,
8653,
1904,
353,
286,
29920,
29889,
9794,
29889,
29928,
1947,
9496,
5570,
580,
13,
4706,
8653,
1904,
29889,
7529,
1839,
7662,
2033,
353,
286,
29920,
29889,
20673,
29889,
29934,
804,
292,
580,
13,
4706,
8653,
5994,
3950,
353,
525,
328,
314,
29915,
13,
4706,
8653,
23655,
353,
7442,
29889,
8172,
29889,
29590,
6278,
29900,
29889,
29906,
29892,
29871,
29900,
29889,
29906,
29892,
13,
4706,
2023,
268,
313,
558,
558,
29889,
4703,
1839,
29894,
542,
370,
29918,
2311,
7464,
29871,
29896,
29900,
29900,
876,
13,
4706,
8653,
18515,
261,
353,
286,
29920,
29889,
6921,
29889,
29911,
348,
261,
29898,
13,
4706,
2023,
268,
8636,
29922,
4299,
29889,
7529,
29892,
13,
4706,
2023,
268,
5994,
3950,
29922,
20640,
3950,
29892,
13,
4706,
2023,
268,
7945,
12657,
29922,
14968,
12657,
29892,
13,
4706,
2023,
268,
2854,
12657,
29922,
3084,
12657,
29892,
13,
4706,
2023,
268,
23655,
29922,
17987,
8497,
29892,
13,
4706,
2023,
268,
954,
29918,
3389,
29879,
29922,
29896,
29892,
13,
4706,
2023,
268,
26952,
29922,
29900,
13,
4706,
2023,
1723,
13,
4706,
8653,
2582,
353,
18515,
261,
29889,
29873,
1540,
580,
13,
4706,
8653,
12705,
29898,
9902,
1839,
13318,
13359,
8149,
3101,
13,
4706,
6024,
29937,
742,
525,
7529,
742,
525,
11249,
742,
525,
13628,
2033,
13,
13,
1678,
9995,
13,
13,
1678,
18515,
261,
353,
21072,
261,
29898,
13,
4706,
8636,
29922,
7529,
29892,
13,
4706,
5994,
3950,
29922,
20640,
3950,
29892,
13,
4706,
7945,
12657,
29922,
14968,
12657,
29892,
13,
4706,
2854,
12657,
29922,
3084,
12657,
29892,
13,
4706,
23655,
29922,
17987,
8497,
29892,
13,
4706,
6216,
29918,
19290,
29922,
9202,
29918,
19290,
29892,
13,
4706,
12714,
29922,
16414,
29892,
13,
4706,
4464,
29922,
8513,
29892,
13,
4706,
954,
29918,
3389,
29879,
29922,
1949,
29918,
3389,
29879,
29892,
13,
4706,
26952,
29922,
369,
15828,
13,
1678,
1723,
13,
1678,
736,
18515,
261,
29889,
29873,
1540,
580,
13,
2
] |
src/bls/python-impl/hkdf.py | chasingkirkjufell/navcoin-core | 103 | 81143 | <reponame>chasingkirkjufell/navcoin-core
from math import ceil
import hmac
import hashlib
BLOCK_SIZE = 32
def extract(salt: bytes, ikm: bytes) -> bytes:
h = hmac.new(salt, ikm, hashlib.sha256)
return h.digest()
def expand(L: int, prk: bytes, info: bytes) -> bytes:
N: int = ceil(L / BLOCK_SIZE)
bytes_written: int = 0
okm: bytes = b""
for i in range(1, N + 1):
if i == 1:
h = hmac.new(prk, info + bytes([1]), hashlib.sha256)
T: bytes = h.digest()
else:
h = hmac.new(prk, T + info + bytes([i]), hashlib.sha256)
T = h.digest()
to_write = L - bytes_written
if to_write > BLOCK_SIZE:
to_write = BLOCK_SIZE
okm += T[:to_write]
bytes_written += to_write
assert bytes_written == L
return okm
def extract_expand(L: int, key: bytes, salt: bytes, info: bytes) -> bytes:
prk = extract(salt, key)
return expand(L, prk, info)
"""
Copyright 2020 Chia Network Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
| [
1,
529,
276,
1112,
420,
29958,
305,
5832,
29895,
6793,
29926,
1137,
514,
29914,
6654,
1111,
262,
29899,
3221,
13,
3166,
5844,
1053,
2257,
309,
13,
5215,
298,
8628,
13,
5215,
6608,
1982,
13,
13,
29933,
21339,
29918,
14226,
353,
29871,
29941,
29906,
13,
13,
13,
1753,
6597,
29898,
29879,
1997,
29901,
6262,
29892,
474,
8848,
29901,
6262,
29897,
1599,
6262,
29901,
13,
1678,
298,
353,
298,
8628,
29889,
1482,
29898,
29879,
1997,
29892,
474,
8848,
29892,
6608,
1982,
29889,
17051,
29906,
29945,
29953,
29897,
13,
1678,
736,
298,
29889,
7501,
342,
580,
13,
13,
13,
1753,
7985,
29898,
29931,
29901,
938,
29892,
544,
29895,
29901,
6262,
29892,
5235,
29901,
6262,
29897,
1599,
6262,
29901,
13,
1678,
405,
29901,
938,
353,
2257,
309,
29898,
29931,
847,
350,
21339,
29918,
14226,
29897,
13,
1678,
6262,
29918,
17625,
29901,
938,
353,
29871,
29900,
13,
1678,
3431,
29885,
29901,
6262,
353,
289,
15945,
13,
13,
1678,
363,
474,
297,
3464,
29898,
29896,
29892,
405,
718,
29871,
29896,
1125,
13,
4706,
565,
474,
1275,
29871,
29896,
29901,
13,
9651,
298,
353,
298,
8628,
29889,
1482,
29898,
558,
29895,
29892,
5235,
718,
6262,
4197,
29896,
11724,
6608,
1982,
29889,
17051,
29906,
29945,
29953,
29897,
13,
9651,
323,
29901,
6262,
353,
298,
29889,
7501,
342,
580,
13,
4706,
1683,
29901,
13,
9651,
298,
353,
298,
8628,
29889,
1482,
29898,
558,
29895,
29892,
323,
718,
5235,
718,
6262,
4197,
29875,
11724,
6608,
1982,
29889,
17051,
29906,
29945,
29953,
29897,
13,
9651,
323,
353,
298,
29889,
7501,
342,
580,
13,
4706,
304,
29918,
3539,
353,
365,
448,
6262,
29918,
17625,
13,
4706,
565,
304,
29918,
3539,
1405,
350,
21339,
29918,
14226,
29901,
13,
9651,
304,
29918,
3539,
353,
350,
21339,
29918,
14226,
13,
4706,
3431,
29885,
4619,
323,
7503,
517,
29918,
3539,
29962,
13,
4706,
6262,
29918,
17625,
4619,
304,
29918,
3539,
13,
1678,
4974,
6262,
29918,
17625,
1275,
365,
13,
1678,
736,
3431,
29885,
13,
13,
13,
1753,
6597,
29918,
18837,
29898,
29931,
29901,
938,
29892,
1820,
29901,
6262,
29892,
15795,
29901,
6262,
29892,
5235,
29901,
6262,
29897,
1599,
6262,
29901,
13,
1678,
544,
29895,
353,
6597,
29898,
29879,
1997,
29892,
1820,
29897,
13,
1678,
736,
7985,
29898,
29931,
29892,
544,
29895,
29892,
5235,
29897,
13,
13,
13,
15945,
29908,
13,
11882,
1266,
29871,
29906,
29900,
29906,
29900,
678,
423,
8527,
9266,
13,
13,
29931,
293,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
6293,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
3492,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
13,
259,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
13,
2525,
2222,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
5721,
7541,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29956,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
13393,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
13400,
800,
1090,
278,
19245,
29889,
13,
15945,
29908,
13,
2
] |
OED/MP.py | adrianomundo/II2202-research-methodology-scientific-writing | 1 | 195598 | import os
import sys
import numpy as np
import time
import matplotlib.pyplot as plt
import pandas as pd
from utils import *
def sliding_dot_product(q, t):
n = t.size
m = q.size
# Append t with n zeros
ta = np.append(t, np.zeros(n))
# Reverse Q
qr = np.flip(q, 0)
# Append qra
qra = np.append(qr, np.zeros(2 * n - m))
# Compute FFTs
qraf = np.fft.fft(qra)
taf = np.fft.fft(ta)
# Compute the inverse FFT to the element-wise multiplication of qraf and taf
qt = np.fft.ifft(np.multiply(qraf, taf))
return qt[m:n]
def sliding_dot_product_stomp(q, t):
n = t.size
m = q.size
# Append t with n zeros
ta = np.append(t, np.zeros(n))
# Reverse Q
qr = np.flip(q, 0)
# Append qra
qra = np.append(qr, np.zeros(2 * n - m))
# Compute FFTs
qraf = np.fft.fft(qra)
taf = np.fft.fft(ta)
# Compute the inverse FFT to the element-wise multiplication of qraf and taf
qt = np.fft.ifft(np.multiply(qraf, taf))
return qt[m - 1:n]
def calculate_distance_profile(q, t, qt, a, sum_q, sum_q2, mean_t, sigma_t):
n = t.size
m = q.size
b = np.zeros(n - m)
dist = np.zeros(n - m)
for i in range(0, n - m):
b[i] = -2 * (qt[i].real - sum_q * mean_t[i]) / sigma_t[i]
dist[i] = a[i] + b[i] + sum_q2
return np.sqrt(np.abs(dist))
# The code below takes O(m) for each subsequence
# you should replace it for MASS
def compute_mean_std_for_query(Q):
# Compute Q stats -- O(n)
sumQ = np.sum(Q)
sumQ2 = np.sum(np.power(Q, 2))
return sumQ, sumQ2
def pre_compute_mean_std_for_TS(ta, m):
na = len(ta)
sum_t = np.zeros(na - m)
sum_t2 = np.zeros(na - m)
# Compute the stats for t
cumulative_sum_t = np.cumsum(ta)
cumulative_sum_t2 = np.cumsum(np.power(ta, 2))
for i in range(na - m):
sum_t[i] = cumulative_sum_t[i + m] - cumulative_sum_t[i]
sum_t2[i] = cumulative_sum_t2[i + m] - cumulative_sum_t2[i]
mean_t = np.divide(sum_t, m)
mean_t2 = np.divide(sum_t2, m)
mean_t_p2 = np.power(mean_t, 2)
sigma_t2 = np.subtract(mean_t2, mean_t_p2)
sigma_t = np.sqrt(sigma_t2)
return sum_t, sum_t2, mean_t, mean_t2, mean_t_p2, sigma_t, sigma_t2
def pre_compute_mean_std_for_TS_stomp(ta, m):
na = len(ta)
# Compute the stats for t
cumulative_sum_t = np.cumsum(ta)
cumulative_sum_t2 = np.cumsum(np.power(ta, 2))
sum_t = (cumulative_sum_t[m - 1:na] - np.concatenate(([0], cumulative_sum_t[0:na - m])))
sum_t2 = (cumulative_sum_t2[m - 1:na] - np.concatenate(([0], cumulative_sum_t2[0:na - m])))
mean_t = np.divide(sum_t, m)
mean_t2 = np.divide(sum_t2, m)
mean_t_p2 = np.power(mean_t, 2)
sigma_t2 = np.subtract(mean_t2, mean_t_p2)
sigma_t = np.sqrt(sigma_t2)
return sum_t, sum_t2, mean_t, mean_t2, mean_t_p2, sigma_t, sigma_t2
# MUEEN’S ALGORITHM FOR SIMILARITY SEARCH (MASS)
def mass(Q, T, a, meanT, sigmaT):
# Z-Normalisation
if np.std(Q) != 0:
Q = (Q - np.mean(Q)) / np.std(Q)
QT = sliding_dot_product(Q, T)
sumQ, sumQ2 = compute_mean_std_for_query(Q)
return calculate_distance_profile(Q, T, QT, a, sumQ, sumQ2, meanT, sigmaT)
def element_wise_min(Pab, Iab, D, idx, ignore_trivial, m):
for i in range(0, len(D)):
if not ignore_trivial or (
np.abs(idx - i) > m / 2.0): # if it's a self-join, ignore trivial matches in [-m/2,m/2]
if D[i] < Pab[i]:
Pab[i] = D[i]
Iab[i] = idx
return Pab, Iab
def stamp(Ta, Tb, m):
"""
Compute the Matrix Profile between time-series Ta and Tb.
If Ta==Tb, the operation is a self-join and trivial matches are ignored.
:param Ta: time-series, np.array
:param Tb: time-series, np.array
:param m: subsequence length
:return: Matrix Profile, Nearest-Neighbor indexes
"""
nb = len(Tb)
na = len(Ta)
Pab = np.ones(na - m) * np.inf
Iab = np.zeros(na - m)
idxes = np.arange(nb - m + 1)
sumT, sumT2, meanT, meanT_2, meanTP2, sigmaT, sigmaT2 = pre_compute_mean_std_for_TS(Ta, m)
a = np.zeros(na - m)
for i in range(0, na - m):
a[i] = (sumT2[i] - 2 * sumT[i] * meanT[i] + m * meanTP2[i]) / sigmaT2[i]
ignore_trivial = np.atleast_1d(Ta == Tb).all()
for idx in idxes:
D = mass(Tb[idx: idx + m], Ta, a, meanT, sigmaT)
if (ignore_trivial):
# ignore trivial minimum and maximum
minIdx = int(np.maximum(idx - m / 2.0, 0))
maxIdx = int(np.minimum(idx + m / 2.0, len(D)))
D[minIdx:maxIdx:1] = np.inf
Iab[Pab > D] = i
Pab = np.minimum(Pab, D)
return Pab, Iab
def stomp(T, m):
"""
Compute the Matrix Profile with self join for T
:param T: time-series, np.array
:param Tb: time-series, np.array
:param m: subsequence length
:return: Matrix Profile, Nearest-Neighbor indexes
"""
epsilon = 1e-10
n = len(T)
seq_l = n - m
_, _, meanT, _, _, sigmaT, _ = pre_compute_mean_std_for_TS_stomp(T, m)
Pab = np.full(seq_l + 1, np.inf)
Iab = np.zeros(n - m + 1)
ignore_trivial = True
for idx in range(0, seq_l):
# There's somthing with normalization
Q_std = sigmaT[idx] if sigmaT[idx] > epsilon else epsilon
if idx == 0:
QT = sliding_dot_product_stomp(T[0:m], T).real
QT_first = np.copy(QT)
else:
QT[1:] = QT[0:-1] - (T[0:seq_l] * T[idx - 1]) + (T[m:n] * T[idx + m - 1])
QT[0] = QT_first[idx]
# Calculate distance profile
D = (2 * (m - (QT - m * meanT * meanT[idx]) / (Q_std * sigmaT)))
D[D < epsilon] = 0
if (ignore_trivial):
# ignore trivial minimum and maximum
minIdx = int(np.maximum(idx - m / 2.0, 0))
maxIdx = int(np.minimum(idx + m / 2.0, len(D)))
D[minIdx:maxIdx:1] = np.inf
Iab[Pab > D] = idx
np.minimum(Pab, D, Pab)
np.sqrt(Pab, Pab)
return Pab, Iab
# Quick Test
# def test_stomp(Ta, m):
# start_time = time.time()
#
# Pab, Iab = stomp(Ta, m)
# print("--- %s seconds ---" % (time.time() - start_time))
# plot_motif(Ta, Pab, Iab, m)
# return Pab, Iab
# Quick Test
# def test_stamp(Ta, Tb, m):
# start_time = time.time()
#
# Pab, Iab = stamp(Ta, Tb, m)
# print("--- %s seconds ---" % (time.time() - start_time))
#
# plot_discord(Ta, Pab, Iab, m, )
# return Pab, Iab
def plot_motif(Ta, values, indexes, m):
from matplotlib import gridspec
plt.figure(figsize=(8, 4))
plt.subplot(211)
plt.plot(Ta, linestyle='--', alpha=0.5)
plt.xlim((0, len(Ta)))
print(np.argmax(values))
plt.plot(range(np.argmin(values), np.argmin(values) + m), Ta[np.argmin(values):np.argmin(values) + m], c='g',
label='Top Motif')
plt.plot(range(np.argmax(values), np.argmax(values) + m), Ta[np.argmax(values):np.argmax(values) + m], c='r',
label='Top Discord')
plt.legend(loc='best')
plt.title('Time-Series')
plt.subplot(212)
plt.title('Matrix Profile')
plt.plot(range(0, len(values)), values, '#ff5722')
plt.plot(np.argmax(values), np.max(values), marker='x', c='r', ms=10)
plt.plot(np.argmin(values), np.min(values), marker='^', c='g', ms=10)
plt.xlim((0, len(Ta)))
plt.xlabel('Index')
plt.ylabel('Value')
plt.show()
def plot_discord(Ta, Tb, values, indexes, m):
from matplotlib import gridspec
plt.figure(figsize=(8, 4))
gs = gridspec.GridSpec(1, 2, width_ratios=[int(len(Ta) / len(Tb)), 1])
plt.subplot(gs[0])
plt.plot(Ta, linestyle='--')
plt.xlim((0, len(Ta)))
plt.plot(range(np.argmin(values), np.argmin(values) + m), Ta[np.argmin(values):np.argmin(values) + m], c='g',
label='Best Match')
plt.legend(loc='best')
plt.title('Time-Series')
plt.ylim((-3, 3))
plt.subplot(gs[1])
plt.plot(Tb)
plt.title('Query')
plt.xlim((0, len(Tb)))
plt.ylim((-3, 3))
plt.figure()
plt.title('Matrix Profile')
plt.plot(range(0, len(values)), values, '#ff5722')
plt.plot(np.argmax(values), np.max(values), marker='x', c='r', ms=10)
plt.plot(np.argmin(values), np.min(values), marker='^', c='g', ms=10)
plt.xlim((0, len(Ta)))
plt.xlabel('Index')
plt.ylabel('Value')
plt.show()
def plot_match(Ta, Tb, values, indexes, m):
from matplotlib import gridspec
plt.figure(figsize=(8, 4))
gs = gridspec.GridSpec(1, 2, width_ratios=[int(len(Ta) / len(Tb)), 1])
plt.subplot(gs[0])
plt.plot(Ta, linestyle='--')
plt.xlim((0, len(Ta)))
print(np.argmax(values))
plt.plot(range(np.argmin(values), np.argmin(values) + m), Ta[np.argmin(values):np.argmin(values) + m], c='g',
label='Best Match')
plt.legend(loc='best')
plt.title('Time-Series')
plt.ylim((-3, 3))
plt.subplot(gs[1])
plt.plot(Tb)
plt.title('Query')
plt.xlim((0, len(Tb)))
plt.ylim((-3, 3))
plt.figure()
plt.title('Matrix Profile')
plt.plot(range(0, len(values)), values, '#ff5722')
plt.plot(np.argmax(values), np.max(values), marker='x', c='r', ms=10)
plt.plot(np.argmin(values), np.min(values), marker='^', c='g', ms=10)
plt.xlim((0, len(Ta)))
plt.xlabel('Index')
plt.ylabel('Value')
plt.show()
def RunModel(_file_name, _choice, _element_num):
pattern_size = 5
if _choice == 1:
abnormal_data, abnormal_label = ReadGDDataset(_file_name)
if _choice == 2:
abnormal_data, abnormal_label = ReadHSSDataset(_file_name)
if _choice == 3:
abnormal_data, abnormal_label = ReadS5Dataset(_file_name)
if _choice == 4:
abnormal_data, abnormal_label = ReadNABDataset(_file_name)
if _choice == 5:
abnormal_data, abnormal_label = Read2DDataset(_file_name)
if _choice == 6:
abnormal_data, abnormal_label = ReadUAHDataset(_file_name)
if _choice == 7:
abnormal_data, abnormal_label = ReadECGDataset(_file_name)
ts = abnormal_data.flatten()
query = abnormal_data.flatten()
Pab, Iab = stamp(ts, query, pattern_size * _element_num)
# plot_discord(ts, query, Pab, Iab, pattern_size * elem_num)
final_zscore = Z_Score(np.sum(np.nan_to_num(Pab).reshape([-1, _element_num]), axis=1))
y_pred = CreateLabelBasedOnZscore(final_zscore, 3, True)
precision, recall, f1 = CalculatePrecisionRecallF1Metrics(abnormal_label[:-pattern_size], y_pred)
# PrintPrecisionRecallF1Metrics(precision, recall, f1)
fpr, tpr, roc_auc = CalculateROCAUCMetrics(abnormal_label[:-pattern_size], np.sum(np.nan_to_num(Pab).reshape([-1, _element_num]), axis=1))
# print('roc_auc=' + str(roc_auc))
precision_curve, recall_curve, average_precision = CalculatePrecisionRecallCurve(abnormal_label[:-pattern_size], np.sum(np.nan_to_num(Pab).reshape([-1, _element_num]), axis=1))
# print('pr_auc=' + str(average_precision))
cks = CalculateCohenKappaMetrics(abnormal_label[:-pattern_size], y_pred)
# print('cohen_kappa=' + str(cks))
return precision, recall, f1, roc_auc, average_precision, cks
if __name__ == '__main__':
try:
sys.argv[1]
except IndexError:
for n in range(1, 7):
dataset = n
if dataset == 1:
file_name = './GD/data/Genesis_AnomalyLabels.csv'
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset)
print('avg_precision=' + str(precision))
print('avg_recall=' + str(recall))
print('avg_f1=' + str(f1))
print('avg_roc_auc=' + str(roc_auc))
print('avg_pr_auc=' + str(pr_auc))
print('avg_cks=' + str(cks))
if dataset == 2:
file_name = './HSS/data/HRSS_anomalous_standard.csv'
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset)
print('avg_precision=' + str(precision))
print('avg_recall=' + str(recall))
print('avg_f1=' + str(f1))
print('avg_roc_auc=' + str(roc_auc))
print('avg_pr_auc=' + str(pr_auc))
print('avg_cks=' + str(cks))
if dataset == 3:
for root, dirs, _ in os.walk('./YAHOO/data'):
for dir in dirs:
k_partition = 10
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for _, _, files in os.walk(root + '/' + dir):
for file in files:
file_name = os.path.join(root, dir, file)
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset, _element_num=1)
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
if dataset == 4:
for root, dirs, _ in os.walk('./NAB/data'):
for dir in dirs:
k_partition = 10
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for _, _, files in os.walk(root + '/' + dir):
for file in files:
file_name = os.path.join(root, dir, file)
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset, _element_num=1)
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
if dataset == 5:
for root, dirs, _ in os.walk('./2D/test'):
for dir in dirs:
k_partition = 3
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for _, _, files in os.walk(root + '/' + dir):
for file in files:
file_name = os.path.join(root, dir, file)
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset, _element_num=2)
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
if dataset == 6:
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for root, dirs, files in os.walk('./UAH/'):
for dir in dirs:
folder_name = os.path.join(root, dir)
print(folder_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(folder_name, dataset, _element_num=4)
print('########################################')
print('precision=' + str(precision))
print('recall=' + str(recall))
print('f1=' + str(f1))
print('roc_auc=' + str(roc_auc))
print('pr_auc=' + str(pr_auc))
print('cks=' + str(cks))
print('########################################')
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
if dataset == 7:
for root, dirs, _ in os.walk('./ECG/'):
for dir in dirs:
k_partition = 3
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for _, _, files in os.walk(root + '/' + dir):
for file in files:
file_name = os.path.join(root, dir, file)
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset, _element_num=3)
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
else:
dataset = int(sys.argv[1])
if dataset == 1:
file_name = './GD/data/Genesis_AnomalyLabels.csv'
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset)
print('avg_precision=' + str(precision))
print('avg_recall=' + str(recall))
print('avg_f1=' + str(f1))
print('avg_roc_auc=' + str(roc_auc))
print('avg_pr_auc=' + str(pr_auc))
print('avg_cks=' + str(cks))
if dataset == 2:
file_name = './HSS/data/HRSS_anomalous_standard.csv'
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset)
print('avg_precision=' + str(precision))
print('avg_recall=' + str(recall))
print('avg_f1=' + str(f1))
print('avg_roc_auc=' + str(roc_auc))
print('avg_pr_auc=' + str(pr_auc))
print('avg_cks=' + str(cks))
if dataset == 3:
for root, dirs, _ in os.walk('./YAHOO/data'):
for dir in dirs:
k_partition = 10
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for _, _, files in os.walk(root + '/' + dir):
for file in files:
file_name = os.path.join(root, dir, file)
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset, _element_num=1)
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
if dataset == 4:
for root, dirs, _ in os.walk('./NAB/data'):
for dir in dirs:
k_partition = 10
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for _, _, files in os.walk(root + '/' + dir):
for file in files:
file_name = os.path.join(root, dir, file)
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset, _element_num=1)
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
if dataset == 5:
for root, dirs, _ in os.walk('./2D/test'):
for dir in dirs:
k_partition = 3
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for _, _, files in os.walk(root + '/' + dir):
for file in files:
file_name = os.path.join(root, dir, file)
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset, _element_num=2)
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
if dataset == 6:
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for root, dirs, files in os.walk('./UAH/'):
for dir in dirs:
folder_name = os.path.join(root, dir)
print(folder_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(folder_name, dataset, _element_num=4)
print('########################################')
print('precision=' + str(precision))
print('recall=' + str(recall))
print('f1=' + str(f1))
print('roc_auc=' + str(roc_auc))
print('pr_auc=' + str(pr_auc))
print('cks=' + str(cks))
print('########################################')
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
if dataset == 7:
for root, dirs, _ in os.walk('./ECG/'):
for dir in dirs:
k_partition = 3
s_precision = []
s_recall = []
s_f1 = []
s_roc_auc = []
s_pr_auc = []
s_cks = []
for _, _, files in os.walk(root + '/' + dir):
for file in files:
file_name = os.path.join(root, dir, file)
print(file_name)
precision, recall, f1, roc_auc, pr_auc, cks = RunModel(file_name, dataset, _element_num=3)
s_precision.append(precision)
s_recall.append(recall)
s_f1.append(f1)
s_roc_auc.append(roc_auc)
s_pr_auc.append(pr_auc)
s_cks.append(cks)
print('########################################')
avg_precision = CalculateAverageMetric(s_precision)
print('avg_precision=' + str(avg_precision))
avg_recall = CalculateAverageMetric(s_recall)
print('avg_recall=' + str(avg_recall))
avg_f1 = CalculateAverageMetric(s_f1)
print('avg_f1=' + str(avg_f1))
avg_roc_auc = CalculateAverageMetric(s_roc_auc)
print('avg_roc_auc=' + str(avg_roc_auc))
avg_pr_auc = CalculateAverageMetric(s_pr_auc)
print('avg_pr_auc=' + str(avg_pr_auc))
avg_cks = CalculateAverageMetric(s_cks)
print('avg_cks=' + str(avg_cks))
print('########################################')
| [
1,
1053,
2897,
13,
5215,
10876,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
931,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
11701,
408,
10518,
13,
3166,
3667,
29879,
1053,
334,
13,
13,
13,
1753,
2243,
4821,
29918,
6333,
29918,
4704,
29898,
29939,
29892,
260,
1125,
13,
1678,
302,
353,
260,
29889,
2311,
13,
1678,
286,
353,
3855,
29889,
2311,
13,
13,
1678,
396,
22871,
260,
411,
302,
24786,
13,
1678,
11062,
353,
7442,
29889,
4397,
29898,
29873,
29892,
7442,
29889,
3298,
359,
29898,
29876,
876,
13,
13,
1678,
396,
830,
3901,
660,
13,
1678,
3855,
29878,
353,
7442,
29889,
29888,
3466,
29898,
29939,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
22871,
3855,
336,
13,
1678,
3855,
336,
353,
7442,
29889,
4397,
29898,
29939,
29878,
29892,
7442,
29889,
3298,
359,
29898,
29906,
334,
302,
448,
286,
876,
13,
13,
1678,
396,
11796,
29872,
383,
7818,
29879,
13,
1678,
3855,
1929,
353,
7442,
29889,
600,
29873,
29889,
600,
29873,
29898,
29939,
336,
29897,
13,
1678,
260,
2142,
353,
7442,
29889,
600,
29873,
29889,
600,
29873,
29898,
941,
29897,
13,
13,
1678,
396,
11796,
29872,
278,
16402,
383,
7818,
304,
278,
1543,
29899,
3538,
21666,
310,
3855,
1929,
322,
260,
2142,
13,
1678,
3855,
29873,
353,
7442,
29889,
600,
29873,
29889,
361,
615,
29898,
9302,
29889,
18056,
368,
29898,
29939,
1929,
29892,
260,
2142,
876,
13,
1678,
736,
3855,
29873,
29961,
29885,
29901,
29876,
29962,
13,
13,
13,
1753,
2243,
4821,
29918,
6333,
29918,
4704,
29918,
303,
21744,
29898,
29939,
29892,
260,
1125,
13,
1678,
302,
353,
260,
29889,
2311,
13,
1678,
286,
353,
3855,
29889,
2311,
13,
13,
1678,
396,
22871,
260,
411,
302,
24786,
13,
1678,
11062,
353,
7442,
29889,
4397,
29898,
29873,
29892,
7442,
29889,
3298,
359,
29898,
29876,
876,
13,
13,
1678,
396,
830,
3901,
660,
13,
1678,
3855,
29878,
353,
7442,
29889,
29888,
3466,
29898,
29939,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
22871,
3855,
336,
13,
1678,
3855,
336,
353,
7442,
29889,
4397,
29898,
29939,
29878,
29892,
7442,
29889,
3298,
359,
29898,
29906,
334,
302,
448,
286,
876,
13,
13,
1678,
396,
11796,
29872,
383,
7818,
29879,
13,
1678,
3855,
1929,
353,
7442,
29889,
600,
29873,
29889,
600,
29873,
29898,
29939,
336,
29897,
13,
1678,
260,
2142,
353,
7442,
29889,
600,
29873,
29889,
600,
29873,
29898,
941,
29897,
13,
13,
1678,
396,
11796,
29872,
278,
16402,
383,
7818,
304,
278,
1543,
29899,
3538,
21666,
310,
3855,
1929,
322,
260,
2142,
13,
1678,
3855,
29873,
353,
7442,
29889,
600,
29873,
29889,
361,
615,
29898,
9302,
29889,
18056,
368,
29898,
29939,
1929,
29892,
260,
2142,
876,
13,
1678,
736,
3855,
29873,
29961,
29885,
448,
29871,
29896,
29901,
29876,
29962,
13,
13,
13,
1753,
8147,
29918,
19244,
29918,
10185,
29898,
29939,
29892,
260,
29892,
3855,
29873,
29892,
263,
29892,
2533,
29918,
29939,
29892,
2533,
29918,
29939,
29906,
29892,
2099,
29918,
29873,
29892,
269,
2934,
29918,
29873,
1125,
13,
1678,
302,
353,
260,
29889,
2311,
13,
1678,
286,
353,
3855,
29889,
2311,
13,
13,
1678,
289,
353,
7442,
29889,
3298,
359,
29898,
29876,
448,
286,
29897,
13,
1678,
1320,
353,
7442,
29889,
3298,
359,
29898,
29876,
448,
286,
29897,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
302,
448,
286,
1125,
13,
4706,
289,
29961,
29875,
29962,
353,
448,
29906,
334,
313,
17915,
29961,
29875,
1822,
6370,
448,
2533,
29918,
29939,
334,
2099,
29918,
29873,
29961,
29875,
2314,
847,
269,
2934,
29918,
29873,
29961,
29875,
29962,
13,
4706,
1320,
29961,
29875,
29962,
353,
263,
29961,
29875,
29962,
718,
289,
29961,
29875,
29962,
718,
2533,
29918,
29939,
29906,
13,
1678,
736,
7442,
29889,
3676,
29898,
9302,
29889,
6897,
29898,
5721,
876,
13,
13,
13,
29937,
450,
775,
2400,
4893,
438,
29898,
29885,
29897,
363,
1269,
1014,
16506,
13,
29937,
366,
881,
5191,
372,
363,
14861,
1799,
13,
1753,
10272,
29918,
12676,
29918,
4172,
29918,
1454,
29918,
1972,
29898,
29984,
1125,
13,
1678,
396,
11796,
29872,
660,
22663,
1192,
438,
29898,
29876,
29897,
13,
1678,
2533,
29984,
353,
7442,
29889,
2083,
29898,
29984,
29897,
13,
1678,
2533,
29984,
29906,
353,
7442,
29889,
2083,
29898,
9302,
29889,
13519,
29898,
29984,
29892,
29871,
29906,
876,
13,
1678,
736,
2533,
29984,
29892,
2533,
29984,
29906,
13,
13,
13,
1753,
758,
29918,
26017,
29918,
12676,
29918,
4172,
29918,
1454,
29918,
9375,
29898,
941,
29892,
286,
1125,
13,
1678,
1055,
353,
7431,
29898,
941,
29897,
13,
1678,
2533,
29918,
29873,
353,
7442,
29889,
3298,
359,
29898,
1056,
448,
286,
29897,
13,
1678,
2533,
29918,
29873,
29906,
353,
7442,
29889,
3298,
359,
29898,
1056,
448,
286,
29897,
13,
13,
1678,
396,
11796,
29872,
278,
22663,
363,
260,
13,
1678,
13299,
28524,
29918,
2083,
29918,
29873,
353,
7442,
29889,
29883,
398,
2083,
29898,
941,
29897,
13,
1678,
13299,
28524,
29918,
2083,
29918,
29873,
29906,
353,
7442,
29889,
29883,
398,
2083,
29898,
9302,
29889,
13519,
29898,
941,
29892,
29871,
29906,
876,
13,
1678,
363,
474,
297,
3464,
29898,
1056,
448,
286,
1125,
13,
4706,
2533,
29918,
29873,
29961,
29875,
29962,
353,
13299,
28524,
29918,
2083,
29918,
29873,
29961,
29875,
718,
286,
29962,
448,
13299,
28524,
29918,
2083,
29918,
29873,
29961,
29875,
29962,
13,
4706,
2533,
29918,
29873,
29906,
29961,
29875,
29962,
353,
13299,
28524,
29918,
2083,
29918,
29873,
29906,
29961,
29875,
718,
286,
29962,
448,
13299,
28524,
29918,
2083,
29918,
29873,
29906,
29961,
29875,
29962,
13,
1678,
2099,
29918,
29873,
353,
7442,
29889,
4563,
680,
29898,
2083,
29918,
29873,
29892,
286,
29897,
13,
1678,
2099,
29918,
29873,
29906,
353,
7442,
29889,
4563,
680,
29898,
2083,
29918,
29873,
29906,
29892,
286,
29897,
13,
1678,
2099,
29918,
29873,
29918,
29886,
29906,
353,
7442,
29889,
13519,
29898,
12676,
29918,
29873,
29892,
29871,
29906,
29897,
13,
1678,
269,
2934,
29918,
29873,
29906,
353,
7442,
29889,
1491,
29873,
1461,
29898,
12676,
29918,
29873,
29906,
29892,
2099,
29918,
29873,
29918,
29886,
29906,
29897,
13,
1678,
269,
2934,
29918,
29873,
353,
7442,
29889,
3676,
29898,
3754,
29918,
29873,
29906,
29897,
13,
1678,
736,
2533,
29918,
29873,
29892,
2533,
29918,
29873,
29906,
29892,
2099,
29918,
29873,
29892,
2099,
29918,
29873,
29906,
29892,
2099,
29918,
29873,
29918,
29886,
29906,
29892,
269,
2934,
29918,
29873,
29892,
269,
2934,
29918,
29873,
29906,
13,
13,
13,
1753,
758,
29918,
26017,
29918,
12676,
29918,
4172,
29918,
1454,
29918,
9375,
29918,
303,
21744,
29898,
941,
29892,
286,
1125,
13,
1678,
1055,
353,
7431,
29898,
941,
29897,
13,
1678,
396,
11796,
29872,
278,
22663,
363,
260,
13,
1678,
13299,
28524,
29918,
2083,
29918,
29873,
353,
7442,
29889,
29883,
398,
2083,
29898,
941,
29897,
13,
1678,
13299,
28524,
29918,
2083,
29918,
29873,
29906,
353,
7442,
29889,
29883,
398,
2083,
29898,
9302,
29889,
13519,
29898,
941,
29892,
29871,
29906,
876,
13,
1678,
2533,
29918,
29873,
353,
313,
29883,
398,
28524,
29918,
2083,
29918,
29873,
29961,
29885,
448,
29871,
29896,
29901,
1056,
29962,
448,
7442,
29889,
535,
29883,
2579,
403,
3552,
29961,
29900,
1402,
13299,
28524,
29918,
2083,
29918,
29873,
29961,
29900,
29901,
1056,
448,
286,
29962,
4961,
13,
1678,
2533,
29918,
29873,
29906,
353,
313,
29883,
398,
28524,
29918,
2083,
29918,
29873,
29906,
29961,
29885,
448,
29871,
29896,
29901,
1056,
29962,
448,
7442,
29889,
535,
29883,
2579,
403,
3552,
29961,
29900,
1402,
13299,
28524,
29918,
2083,
29918,
29873,
29906,
29961,
29900,
29901,
1056,
448,
286,
29962,
4961,
13,
1678,
2099,
29918,
29873,
353,
7442,
29889,
4563,
680,
29898,
2083,
29918,
29873,
29892,
286,
29897,
13,
1678,
2099,
29918,
29873,
29906,
353,
7442,
29889,
4563,
680,
29898,
2083,
29918,
29873,
29906,
29892,
286,
29897,
13,
1678,
2099,
29918,
29873,
29918,
29886,
29906,
353,
7442,
29889,
13519,
29898,
12676,
29918,
29873,
29892,
29871,
29906,
29897,
13,
1678,
269,
2934,
29918,
29873,
29906,
353,
7442,
29889,
1491,
29873,
1461,
29898,
12676,
29918,
29873,
29906,
29892,
2099,
29918,
29873,
29918,
29886,
29906,
29897,
13,
1678,
269,
2934,
29918,
29873,
353,
7442,
29889,
3676,
29898,
3754,
29918,
29873,
29906,
29897,
13,
1678,
736,
2533,
29918,
29873,
29892,
2533,
29918,
29873,
29906,
29892,
2099,
29918,
29873,
29892,
2099,
29918,
29873,
29906,
29892,
2099,
29918,
29873,
29918,
29886,
29906,
29892,
269,
2934,
29918,
29873,
29892,
269,
2934,
29918,
29873,
29906,
13,
13,
13,
29937,
341,
4462,
1430,
30010,
29903,
14445,
29954,
1955,
13054,
29924,
15842,
317,
7833,
6227,
1718,
11937,
3725,
1718,
3210,
313,
1529,
1799,
29897,
13,
1753,
4158,
29898,
29984,
29892,
323,
29892,
263,
29892,
2099,
29911,
29892,
269,
2934,
29911,
1125,
13,
1678,
396,
796,
29899,
19077,
4371,
13,
1678,
565,
7442,
29889,
4172,
29898,
29984,
29897,
2804,
29871,
29900,
29901,
13,
4706,
660,
353,
313,
29984,
448,
7442,
29889,
12676,
29898,
29984,
876,
847,
7442,
29889,
4172,
29898,
29984,
29897,
13,
1678,
660,
29911,
353,
2243,
4821,
29918,
6333,
29918,
4704,
29898,
29984,
29892,
323,
29897,
13,
1678,
2533,
29984,
29892,
2533,
29984,
29906,
353,
10272,
29918,
12676,
29918,
4172,
29918,
1454,
29918,
1972,
29898,
29984,
29897,
13,
1678,
736,
8147,
29918,
19244,
29918,
10185,
29898,
29984,
29892,
323,
29892,
660,
29911,
29892,
263,
29892,
2533,
29984,
29892,
2533,
29984,
29906,
29892,
2099,
29911,
29892,
269,
2934,
29911,
29897,
13,
13,
13,
1753,
1543,
29918,
3538,
29918,
1195,
29898,
29925,
370,
29892,
306,
370,
29892,
360,
29892,
22645,
29892,
11455,
29918,
29873,
9473,
29892,
286,
1125,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
29928,
22164,
13,
4706,
565,
451,
11455,
29918,
29873,
9473,
470,
313,
13,
18884,
7442,
29889,
6897,
29898,
13140,
448,
474,
29897,
1405,
286,
847,
29871,
29906,
29889,
29900,
1125,
29871,
396,
565,
372,
29915,
29879,
263,
1583,
29899,
7122,
29892,
11455,
12604,
7087,
297,
21069,
29885,
29914,
29906,
29892,
29885,
29914,
29906,
29962,
13,
9651,
565,
360,
29961,
29875,
29962,
529,
349,
370,
29961,
29875,
5387,
13,
18884,
349,
370,
29961,
29875,
29962,
353,
360,
29961,
29875,
29962,
13,
18884,
306,
370,
29961,
29875,
29962,
353,
22645,
13,
1678,
736,
349,
370,
29892,
306,
370,
13,
13,
13,
1753,
25214,
29898,
29911,
29874,
29892,
323,
29890,
29892,
286,
1125,
13,
1678,
9995,
13,
1678,
11796,
29872,
278,
22513,
20802,
1546,
931,
29899,
13757,
10523,
322,
323,
29890,
29889,
13,
1678,
960,
10523,
1360,
29911,
29890,
29892,
278,
5858,
338,
263,
1583,
29899,
7122,
322,
12604,
7087,
526,
17262,
29889,
13,
13,
1678,
584,
3207,
10523,
29901,
931,
29899,
13757,
29892,
7442,
29889,
2378,
13,
1678,
584,
3207,
323,
29890,
29901,
931,
29899,
13757,
29892,
7442,
29889,
2378,
13,
1678,
584,
3207,
286,
29901,
1014,
16506,
3309,
13,
1678,
584,
2457,
29901,
22513,
20802,
29892,
26206,
342,
29899,
8139,
1141,
4089,
18111,
13,
1678,
9995,
13,
1678,
302,
29890,
353,
7431,
29898,
29911,
29890,
29897,
13,
1678,
1055,
353,
7431,
29898,
29911,
29874,
29897,
13,
1678,
349,
370,
353,
7442,
29889,
2873,
29898,
1056,
448,
286,
29897,
334,
7442,
29889,
7192,
13,
1678,
306,
370,
353,
7442,
29889,
3298,
359,
29898,
1056,
448,
286,
29897,
13,
1678,
1178,
9100,
353,
7442,
29889,
279,
927,
29898,
9877,
448,
286,
718,
29871,
29896,
29897,
13,
13,
1678,
2533,
29911,
29892,
2533,
29911,
29906,
29892,
2099,
29911,
29892,
2099,
29911,
29918,
29906,
29892,
2099,
3557,
29906,
29892,
269,
2934,
29911,
29892,
269,
2934,
29911,
29906,
353,
758,
29918,
26017,
29918,
12676,
29918,
4172,
29918,
1454,
29918,
9375,
29898,
29911,
29874,
29892,
286,
29897,
13,
13,
1678,
263,
353,
7442,
29889,
3298,
359,
29898,
1056,
448,
286,
29897,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
1055,
448,
286,
1125,
13,
4706,
263,
29961,
29875,
29962,
353,
313,
2083,
29911,
29906,
29961,
29875,
29962,
448,
29871,
29906,
334,
2533,
29911,
29961,
29875,
29962,
334,
2099,
29911,
29961,
29875,
29962,
718,
286,
334,
2099,
3557,
29906,
29961,
29875,
2314,
847,
269,
2934,
29911,
29906,
29961,
29875,
29962,
13,
13,
1678,
11455,
29918,
29873,
9473,
353,
7442,
29889,
271,
280,
579,
29918,
29896,
29881,
29898,
29911,
29874,
1275,
323,
29890,
467,
497,
580,
13,
1678,
363,
22645,
297,
1178,
9100,
29901,
13,
4706,
360,
353,
4158,
29898,
29911,
29890,
29961,
13140,
29901,
22645,
718,
286,
1402,
10523,
29892,
263,
29892,
2099,
29911,
29892,
269,
2934,
29911,
29897,
13,
4706,
565,
313,
17281,
29918,
29873,
9473,
1125,
13,
9651,
396,
11455,
12604,
9212,
322,
29871,
7472,
13,
9651,
1375,
1204,
29916,
353,
938,
29898,
9302,
29889,
27525,
398,
29898,
13140,
448,
286,
847,
29871,
29906,
29889,
29900,
29892,
29871,
29900,
876,
13,
9651,
4236,
1204,
29916,
353,
938,
29898,
9302,
29889,
1195,
12539,
29898,
13140,
718,
286,
847,
29871,
29906,
29889,
29900,
29892,
7431,
29898,
29928,
4961,
13,
9651,
360,
29961,
1195,
1204,
29916,
29901,
3317,
1204,
29916,
29901,
29896,
29962,
353,
7442,
29889,
7192,
13,
13,
4706,
306,
370,
29961,
29925,
370,
1405,
360,
29962,
353,
474,
13,
4706,
349,
370,
353,
7442,
29889,
1195,
12539,
29898,
29925,
370,
29892,
360,
29897,
13,
1678,
736,
349,
370,
29892,
306,
370,
13,
13,
13,
1753,
380,
21744,
29898,
29911,
29892,
286,
1125,
13,
1678,
9995,
13,
1678,
11796,
29872,
278,
22513,
20802,
411,
1583,
5988,
363,
323,
13,
1678,
584,
3207,
323,
29901,
931,
29899,
13757,
29892,
7442,
29889,
2378,
13,
1678,
584,
3207,
323,
29890,
29901,
931,
29899,
13757,
29892,
7442,
29889,
2378,
13,
1678,
584,
3207,
286,
29901,
1014,
16506,
3309,
13,
1678,
584,
2457,
29901,
22513,
20802,
29892,
26206,
342,
29899,
8139,
1141,
4089,
18111,
13,
1678,
9995,
13,
1678,
321,
3232,
353,
29871,
29896,
29872,
29899,
29896,
29900,
13,
13,
1678,
302,
353,
7431,
29898,
29911,
29897,
13,
13,
1678,
19359,
29918,
29880,
353,
302,
448,
286,
13,
1678,
17117,
17117,
2099,
29911,
29892,
17117,
17117,
269,
2934,
29911,
29892,
903,
353,
758,
29918,
26017,
29918,
12676,
29918,
4172,
29918,
1454,
29918,
9375,
29918,
303,
21744,
29898,
29911,
29892,
286,
29897,
13,
13,
1678,
349,
370,
353,
7442,
29889,
8159,
29898,
11762,
29918,
29880,
718,
29871,
29896,
29892,
7442,
29889,
7192,
29897,
13,
1678,
306,
370,
353,
7442,
29889,
3298,
359,
29898,
29876,
448,
286,
718,
29871,
29896,
29897,
13,
1678,
11455,
29918,
29873,
9473,
353,
5852,
13,
1678,
363,
22645,
297,
3464,
29898,
29900,
29892,
19359,
29918,
29880,
1125,
13,
4706,
396,
1670,
29915,
29879,
1047,
1918,
411,
4226,
2133,
13,
4706,
660,
29918,
4172,
353,
269,
2934,
29911,
29961,
13140,
29962,
565,
269,
2934,
29911,
29961,
13140,
29962,
1405,
321,
3232,
1683,
321,
3232,
13,
4706,
565,
22645,
1275,
29871,
29900,
29901,
13,
9651,
660,
29911,
353,
2243,
4821,
29918,
6333,
29918,
4704,
29918,
303,
21744,
29898,
29911,
29961,
29900,
29901,
29885,
1402,
323,
467,
6370,
13,
9651,
660,
29911,
29918,
4102,
353,
7442,
29889,
8552,
29898,
29984,
29911,
29897,
13,
4706,
1683,
29901,
13,
9651,
660,
29911,
29961,
29896,
17531,
353,
660,
29911,
29961,
29900,
13018,
29896,
29962,
448,
313,
29911,
29961,
29900,
29901,
11762,
29918,
29880,
29962,
334,
323,
29961,
13140,
448,
29871,
29896,
2314,
718,
313,
29911,
29961,
29885,
29901,
29876,
29962,
334,
323,
29961,
13140,
718,
286,
448,
29871,
29896,
2314,
13,
9651,
660,
29911,
29961,
29900,
29962,
353,
660,
29911,
29918,
4102,
29961,
13140,
29962,
13,
13,
4706,
396,
20535,
403,
5418,
8722,
13,
4706,
360,
353,
313,
29906,
334,
313,
29885,
448,
313,
29984,
29911,
448,
286,
334,
2099,
29911,
334,
2099,
29911,
29961,
13140,
2314,
847,
313,
29984,
29918,
4172,
334,
269,
2934,
29911,
4961,
13,
4706,
360,
29961,
29928,
529,
321,
3232,
29962,
353,
29871,
29900,
13,
4706,
565,
313,
17281,
29918,
29873,
9473,
1125,
13,
9651,
396,
11455,
12604,
9212,
322,
29871,
7472,
13,
9651,
1375,
1204,
29916,
353,
938,
29898,
9302,
29889,
27525,
398,
29898,
13140,
448,
286,
847,
29871,
29906,
29889,
29900,
29892,
29871,
29900,
876,
13,
9651,
4236,
1204,
29916,
353,
938,
29898,
9302,
29889,
1195,
12539,
29898,
13140,
718,
286,
847,
29871,
29906,
29889,
29900,
29892,
7431,
29898,
29928,
4961,
13,
9651,
360,
29961,
1195,
1204,
29916,
29901,
3317,
1204,
29916,
29901,
29896,
29962,
353,
7442,
29889,
7192,
13,
13,
4706,
306,
370,
29961,
29925,
370,
1405,
360,
29962,
353,
22645,
13,
4706,
7442,
29889,
1195,
12539,
29898,
29925,
370,
29892,
360,
29892,
349,
370,
29897,
13,
13,
1678,
7442,
29889,
3676,
29898,
29925,
370,
29892,
349,
370,
29897,
13,
1678,
736,
349,
370,
29892,
306,
370,
13,
13,
13,
29937,
26141,
4321,
13,
29937,
822,
1243,
29918,
303,
21744,
29898,
29911,
29874,
29892,
286,
1125,
13,
29937,
268,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
29937,
13,
29937,
268,
349,
370,
29892,
306,
370,
353,
380,
21744,
29898,
29911,
29874,
29892,
286,
29897,
13,
29937,
268,
1596,
703,
5634,
1273,
29879,
6923,
11474,
29908,
1273,
313,
2230,
29889,
2230,
580,
448,
1369,
29918,
2230,
876,
13,
29937,
268,
6492,
29918,
14817,
361,
29898,
29911,
29874,
29892,
349,
370,
29892,
306,
370,
29892,
286,
29897,
13,
29937,
268,
736,
349,
370,
29892,
306,
370,
13,
13,
13,
29937,
26141,
4321,
13,
29937,
822,
1243,
29918,
303,
1160,
29898,
29911,
29874,
29892,
323,
29890,
29892,
286,
1125,
13,
29937,
268,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
29937,
13,
29937,
268,
349,
370,
29892,
306,
370,
353,
25214,
29898,
29911,
29874,
29892,
323,
29890,
29892,
286,
29897,
13,
29937,
268,
1596,
703,
5634,
1273,
29879,
6923,
11474,
29908,
1273,
313,
2230,
29889,
2230,
580,
448,
1369,
29918,
2230,
876,
13,
29937,
13,
29937,
268,
6492,
29918,
2218,
16090,
29898,
29911,
29874,
29892,
349,
370,
29892,
306,
370,
29892,
286,
29892,
1723,
13,
29937,
268,
736,
349,
370,
29892,
306,
370,
13,
13,
13,
1753,
6492,
29918,
14817,
361,
29898,
29911,
29874,
29892,
1819,
29892,
18111,
29892,
286,
1125,
13,
1678,
515,
22889,
1053,
867,
4841,
3135,
13,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29947,
29892,
29871,
29946,
876,
13,
1678,
14770,
29889,
1491,
5317,
29898,
29906,
29896,
29896,
29897,
13,
1678,
14770,
29889,
5317,
29898,
29911,
29874,
29892,
6276,
342,
1508,
2433,
489,
742,
15595,
29922,
29900,
29889,
29945,
29897,
13,
1678,
14770,
29889,
29916,
2576,
3552,
29900,
29892,
7431,
29898,
29911,
29874,
4961,
13,
13,
1678,
1596,
29898,
9302,
29889,
1191,
3317,
29898,
5975,
876,
13,
13,
1678,
14770,
29889,
5317,
29898,
3881,
29898,
9302,
29889,
1191,
1195,
29898,
5975,
511,
7442,
29889,
1191,
1195,
29898,
5975,
29897,
718,
286,
511,
10523,
29961,
9302,
29889,
1191,
1195,
29898,
5975,
1125,
9302,
29889,
1191,
1195,
29898,
5975,
29897,
718,
286,
1402,
274,
2433,
29887,
742,
13,
632,
3858,
2433,
7031,
7142,
361,
1495,
13,
1678,
14770,
29889,
5317,
29898,
3881,
29898,
9302,
29889,
1191,
3317,
29898,
5975,
511,
7442,
29889,
1191,
3317,
29898,
5975,
29897,
718,
286,
511,
10523,
29961,
9302,
29889,
1191,
3317,
29898,
5975,
1125,
9302,
29889,
1191,
3317,
29898,
5975,
29897,
718,
286,
1402,
274,
2433,
29878,
742,
13,
632,
3858,
2433,
7031,
8565,
536,
1495,
13,
13,
1678,
14770,
29889,
26172,
29898,
2029,
2433,
13318,
1495,
13,
1678,
14770,
29889,
3257,
877,
2481,
29899,
19204,
1495,
13,
13,
1678,
14770,
29889,
1491,
5317,
29898,
29906,
29896,
29906,
29897,
13,
1678,
14770,
29889,
3257,
877,
14609,
20802,
1495,
13,
1678,
14770,
29889,
5317,
29898,
3881,
29898,
29900,
29892,
7431,
29898,
5975,
8243,
1819,
29892,
16321,
600,
29945,
29955,
29906,
29906,
1495,
13,
1678,
14770,
29889,
5317,
29898,
9302,
29889,
1191,
3317,
29898,
5975,
511,
7442,
29889,
3317,
29898,
5975,
511,
17456,
2433,
29916,
742,
274,
2433,
29878,
742,
10887,
29922,
29896,
29900,
29897,
13,
1678,
14770,
29889,
5317,
29898,
9302,
29889,
1191,
1195,
29898,
5975,
511,
7442,
29889,
1195,
29898,
5975,
511,
17456,
2433,
29985,
742,
274,
2433,
29887,
742,
10887,
29922,
29896,
29900,
29897,
13,
13,
1678,
14770,
29889,
29916,
2576,
3552,
29900,
29892,
7431,
29898,
29911,
29874,
4961,
13,
1678,
14770,
29889,
29916,
1643,
877,
3220,
1495,
13,
1678,
14770,
29889,
29891,
1643,
877,
1917,
1495,
13,
1678,
14770,
29889,
4294,
580,
13,
13,
13,
1753,
6492,
29918,
2218,
16090,
29898,
29911,
29874,
29892,
323,
29890,
29892,
1819,
29892,
18111,
29892,
286,
1125,
13,
1678,
515,
22889,
1053,
867,
4841,
3135,
13,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29947,
29892,
29871,
29946,
876,
13,
1678,
330,
29879,
353,
867,
4841,
3135,
29889,
5756,
10299,
29898,
29896,
29892,
29871,
29906,
29892,
2920,
29918,
29878,
2219,
359,
11759,
524,
29898,
2435,
29898,
29911,
29874,
29897,
847,
7431,
29898,
29911,
29890,
8243,
29871,
29896,
2314,
13,
13,
1678,
14770,
29889,
1491,
5317,
29898,
3174,
29961,
29900,
2314,
13,
1678,
14770,
29889,
5317,
29898,
29911,
29874,
29892,
6276,
342,
1508,
2433,
489,
1495,
13,
1678,
14770,
29889,
29916,
2576,
3552,
29900,
29892,
7431,
29898,
29911,
29874,
4961,
13,
13,
1678,
14770,
29889,
5317,
29898,
3881,
29898,
9302,
29889,
1191,
1195,
29898,
5975,
511,
7442,
29889,
1191,
1195,
29898,
5975,
29897,
718,
286,
511,
10523,
29961,
9302,
29889,
1191,
1195,
29898,
5975,
1125,
9302,
29889,
1191,
1195,
29898,
5975,
29897,
718,
286,
1402,
274,
2433,
29887,
742,
13,
632,
3858,
2433,
25353,
14514,
1495,
13,
1678,
14770,
29889,
26172,
29898,
2029,
2433,
13318,
1495,
13,
1678,
14770,
29889,
3257,
877,
2481,
29899,
19204,
1495,
13,
1678,
14770,
29889,
29891,
2576,
3552,
29899,
29941,
29892,
29871,
29941,
876,
13,
13,
1678,
14770,
29889,
1491,
5317,
29898,
3174,
29961,
29896,
2314,
13,
1678,
14770,
29889,
5317,
29898,
29911,
29890,
29897,
13,
13,
1678,
14770,
29889,
3257,
877,
3010,
1495,
13,
1678,
14770,
29889,
29916,
2576,
3552,
29900,
29892,
7431,
29898,
29911,
29890,
4961,
13,
1678,
14770,
29889,
29891,
2576,
3552,
29899,
29941,
29892,
29871,
29941,
876,
13,
13,
1678,
14770,
29889,
4532,
580,
13,
1678,
14770,
29889,
3257,
877,
14609,
20802,
1495,
13,
1678,
14770,
29889,
5317,
29898,
3881,
29898,
29900,
29892,
7431,
29898,
5975,
8243,
1819,
29892,
16321,
600,
29945,
29955,
29906,
29906,
1495,
13,
1678,
14770,
29889,
5317,
29898,
9302,
29889,
1191,
3317,
29898,
5975,
511,
7442,
29889,
3317,
29898,
5975,
511,
17456,
2433,
29916,
742,
274,
2433,
29878,
742,
10887,
29922,
29896,
29900,
29897,
13,
1678,
14770,
29889,
5317,
29898,
9302,
29889,
1191,
1195,
29898,
5975,
511,
7442,
29889,
1195,
29898,
5975,
511,
17456,
2433,
29985,
742,
274,
2433,
29887,
742,
10887,
29922,
29896,
29900,
29897,
13,
13,
1678,
14770,
29889,
29916,
2576,
3552,
29900,
29892,
7431,
29898,
29911,
29874,
4961,
13,
1678,
14770,
29889,
29916,
1643,
877,
3220,
1495,
13,
1678,
14770,
29889,
29891,
1643,
877,
1917,
1495,
13,
13,
1678,
14770,
29889,
4294,
580,
13,
13,
13,
1753,
6492,
29918,
4352,
29898,
29911,
29874,
29892,
323,
29890,
29892,
1819,
29892,
18111,
29892,
286,
1125,
13,
1678,
515,
22889,
1053,
867,
4841,
3135,
13,
1678,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29947,
29892,
29871,
29946,
876,
13,
1678,
330,
29879,
353,
867,
4841,
3135,
29889,
5756,
10299,
29898,
29896,
29892,
29871,
29906,
29892,
2920,
29918,
29878,
2219,
359,
11759,
524,
29898,
2435,
29898,
29911,
29874,
29897,
847,
7431,
29898,
29911,
29890,
8243,
29871,
29896,
2314,
13,
13,
1678,
14770,
29889,
1491,
5317,
29898,
3174,
29961,
29900,
2314,
13,
1678,
14770,
29889,
5317,
29898,
29911,
29874,
29892,
6276,
342,
1508,
2433,
489,
1495,
13,
1678,
14770,
29889,
29916,
2576,
3552,
29900,
29892,
7431,
29898,
29911,
29874,
4961,
13,
13,
1678,
1596,
29898,
9302,
29889,
1191,
3317,
29898,
5975,
876,
13,
13,
1678,
14770,
29889,
5317,
29898,
3881,
29898,
9302,
29889,
1191,
1195,
29898,
5975,
511,
7442,
29889,
1191,
1195,
29898,
5975,
29897,
718,
286,
511,
10523,
29961,
9302,
29889,
1191,
1195,
29898,
5975,
1125,
9302,
29889,
1191,
1195,
29898,
5975,
29897,
718,
286,
1402,
274,
2433,
29887,
742,
13,
632,
3858,
2433,
25353,
14514,
1495,
13,
1678,
14770,
29889,
26172,
29898,
2029,
2433,
13318,
1495,
13,
1678,
14770,
29889,
3257,
877,
2481,
29899,
19204,
1495,
13,
1678,
14770,
29889,
29891,
2576,
3552,
29899,
29941,
29892,
29871,
29941,
876,
13,
13,
1678,
14770,
29889,
1491,
5317,
29898,
3174,
29961,
29896,
2314,
13,
1678,
14770,
29889,
5317,
29898,
29911,
29890,
29897,
13,
13,
1678,
14770,
29889,
3257,
877,
3010,
1495,
13,
1678,
14770,
29889,
29916,
2576,
3552,
29900,
29892,
7431,
29898,
29911,
29890,
4961,
13,
1678,
14770,
29889,
29891,
2576,
3552,
29899,
29941,
29892,
29871,
29941,
876,
13,
13,
1678,
14770,
29889,
4532,
580,
13,
1678,
14770,
29889,
3257,
877,
14609,
20802,
1495,
13,
1678,
14770,
29889,
5317,
29898,
3881,
29898,
29900,
29892,
7431,
29898,
5975,
8243,
1819,
29892,
16321,
600,
29945,
29955,
29906,
29906,
1495,
13,
1678,
14770,
29889,
5317,
29898,
9302,
29889,
1191,
3317,
29898,
5975,
511,
7442,
29889,
3317,
29898,
5975,
511,
17456,
2433,
29916,
742,
274,
2433,
29878,
742,
10887,
29922,
29896,
29900,
29897,
13,
1678,
14770,
29889,
5317,
29898,
9302,
29889,
1191,
1195,
29898,
5975,
511,
7442,
29889,
1195,
29898,
5975,
511,
17456,
2433,
29985,
742,
274,
2433,
29887,
742,
10887,
29922,
29896,
29900,
29897,
13,
13,
1678,
14770,
29889,
29916,
2576,
3552,
29900,
29892,
7431,
29898,
29911,
29874,
4961,
13,
1678,
14770,
29889,
29916,
1643,
877,
3220,
1495,
13,
1678,
14770,
29889,
29891,
1643,
877,
1917,
1495,
13,
1678,
14770,
29889,
4294,
580,
13,
13,
1753,
7525,
3195,
7373,
1445,
29918,
978,
29892,
903,
16957,
29892,
903,
5029,
29918,
1949,
1125,
13,
1678,
4766,
29918,
2311,
353,
29871,
29945,
13,
1678,
565,
903,
16957,
1275,
29871,
29896,
29901,
13,
4706,
633,
8945,
29918,
1272,
29892,
633,
8945,
29918,
1643,
353,
7523,
29954,
7858,
271,
24541,
7373,
1445,
29918,
978,
29897,
13,
1678,
565,
903,
16957,
1275,
29871,
29906,
29901,
13,
4706,
633,
8945,
29918,
1272,
29892,
633,
8945,
29918,
1643,
353,
7523,
29950,
1799,
16390,
24541,
7373,
1445,
29918,
978,
29897,
13,
1678,
565,
903,
16957,
1275,
29871,
29941,
29901,
13,
4706,
633,
8945,
29918,
1272,
29892,
633,
8945,
29918,
1643,
353,
7523,
29903,
29945,
16390,
24541,
7373,
1445,
29918,
978,
29897,
13,
1678,
565,
903,
16957,
1275,
29871,
29946,
29901,
13,
4706,
633,
8945,
29918,
1272,
29892,
633,
8945,
29918,
1643,
353,
7523,
29940,
2882,
16390,
24541,
7373,
1445,
29918,
978,
29897,
13,
1678,
565,
903,
16957,
1275,
29871,
29945,
29901,
13,
4706,
633,
8945,
29918,
1272,
29892,
633,
8945,
29918,
1643,
353,
7523,
29906,
7858,
271,
24541,
7373,
1445,
29918,
978,
29897,
13,
1678,
565,
903,
16957,
1275,
29871,
29953,
29901,
13,
4706,
633,
8945,
29918,
1272,
29892,
633,
8945,
29918,
1643,
353,
7523,
29965,
29909,
29950,
16390,
24541,
7373,
1445,
29918,
978,
29897,
13,
1678,
565,
903,
16957,
1275,
29871,
29955,
29901,
13,
4706,
633,
8945,
29918,
1272,
29892,
633,
8945,
29918,
1643,
353,
7523,
29923,
11135,
16390,
24541,
7373,
1445,
29918,
978,
29897,
13,
1678,
18696,
353,
633,
8945,
29918,
1272,
29889,
1579,
8606,
580,
13,
1678,
2346,
353,
633,
8945,
29918,
1272,
29889,
1579,
8606,
580,
13,
1678,
349,
370,
29892,
306,
370,
353,
25214,
29898,
1372,
29892,
2346,
29892,
4766,
29918,
2311,
334,
903,
5029,
29918,
1949,
29897,
13,
1678,
396,
6492,
29918,
2218,
16090,
29898,
1372,
29892,
2346,
29892,
349,
370,
29892,
306,
370,
29892,
4766,
29918,
2311,
334,
21268,
29918,
1949,
29897,
13,
1678,
2186,
29918,
29920,
13628,
353,
796,
29918,
20097,
29898,
9302,
29889,
2083,
29898,
9302,
29889,
13707,
29918,
517,
29918,
1949,
29898,
29925,
370,
467,
690,
14443,
4197,
29899,
29896,
29892,
903,
5029,
29918,
1949,
11724,
9685,
29922,
29896,
876,
13,
1678,
343,
29918,
11965,
353,
6204,
4775,
29933,
1463,
2951,
29999,
13628,
29898,
8394,
29918,
29920,
13628,
29892,
29871,
29941,
29892,
5852,
29897,
13,
1678,
16716,
29892,
17386,
29892,
285,
29896,
353,
20535,
403,
29925,
3757,
2459,
4789,
497,
29943,
29896,
10095,
10817,
29898,
370,
8945,
29918,
1643,
7503,
29899,
11037,
29918,
2311,
1402,
343,
29918,
11965,
29897,
13,
1678,
396,
13905,
29925,
3757,
2459,
4789,
497,
29943,
29896,
10095,
10817,
29898,
17990,
2459,
29892,
17386,
29892,
285,
29896,
29897,
13,
1678,
285,
558,
29892,
260,
558,
29892,
696,
29883,
29918,
14766,
353,
20535,
403,
1672,
5454,
23129,
10095,
10817,
29898,
370,
8945,
29918,
1643,
7503,
29899,
11037,
29918,
2311,
1402,
7442,
29889,
2083,
29898,
9302,
29889,
13707,
29918,
517,
29918,
1949,
29898,
29925,
370,
467,
690,
14443,
4197,
29899,
29896,
29892,
903,
5029,
29918,
1949,
11724,
9685,
29922,
29896,
876,
13,
1678,
396,
1596,
877,
10198,
29918,
14766,
2433,
718,
851,
29898,
10198,
29918,
14766,
876,
13,
1678,
16716,
29918,
2764,
345,
29892,
17386,
29918,
2764,
345,
29892,
6588,
29918,
17990,
2459,
353,
20535,
403,
29925,
3757,
2459,
4789,
497,
23902,
345,
29898,
370,
8945,
29918,
1643,
7503,
29899,
11037,
29918,
2311,
1402,
7442,
29889,
2083,
29898,
9302,
29889,
13707,
29918,
517,
29918,
1949,
29898,
29925,
370,
467,
690,
14443,
4197,
29899,
29896,
29892,
903,
5029,
29918,
1949,
11724,
9685,
29922,
29896,
876,
13,
1678,
396,
1596,
877,
558,
29918,
14766,
2433,
718,
851,
29898,
12483,
482,
29918,
17990,
2459,
876,
13,
1678,
274,
2039,
353,
20535,
403,
29907,
14899,
29968,
8055,
10095,
10817,
29898,
370,
8945,
29918,
1643,
7503,
29899,
11037,
29918,
2311,
1402,
343,
29918,
11965,
29897,
13,
1678,
396,
1596,
877,
1111,
3169,
29918,
9876,
2433,
718,
851,
29898,
4684,
876,
13,
13,
1678,
736,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
6588,
29918,
17990,
2459,
29892,
274,
2039,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1018,
29901,
13,
4706,
10876,
29889,
19218,
29961,
29896,
29962,
13,
1678,
5174,
11374,
2392,
29901,
13,
4706,
363,
302,
297,
3464,
29898,
29896,
29892,
29871,
29955,
1125,
13,
9651,
8783,
353,
302,
13,
9651,
565,
8783,
1275,
29871,
29896,
29901,
13,
18884,
934,
29918,
978,
353,
19283,
29954,
29928,
29914,
1272,
29914,
15462,
6656,
29918,
2744,
290,
14997,
4775,
29879,
29889,
7638,
29915,
13,
18884,
1596,
29898,
1445,
29918,
978,
29897,
13,
18884,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29897,
13,
18884,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
17990,
2459,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
3757,
497,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
29888,
29896,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
10198,
29918,
14766,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
558,
29918,
14766,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
4684,
876,
13,
632,
13,
9651,
565,
8783,
1275,
29871,
29906,
29901,
13,
18884,
934,
29918,
978,
353,
19283,
29950,
1799,
29914,
1272,
29914,
20938,
1799,
29918,
273,
290,
20521,
29918,
15770,
29889,
7638,
29915,
13,
18884,
1596,
29898,
1445,
29918,
978,
29897,
13,
18884,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29897,
13,
18884,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
17990,
2459,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
3757,
497,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
29888,
29896,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
10198,
29918,
14766,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
558,
29918,
14766,
876,
13,
18884,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
4684,
876,
13,
13,
9651,
565,
8783,
1275,
29871,
29941,
29901,
13,
18884,
363,
3876,
29892,
4516,
29879,
29892,
903,
297,
2897,
29889,
20919,
877,
6904,
29979,
29909,
8187,
29949,
29914,
1272,
29374,
13,
462,
1678,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
4706,
413,
29918,
16707,
353,
29871,
29896,
29900,
13,
462,
4706,
269,
29918,
17990,
2459,
353,
5159,
13,
462,
4706,
269,
29918,
3757,
497,
353,
5159,
13,
462,
4706,
269,
29918,
29888,
29896,
353,
5159,
13,
462,
4706,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
462,
4706,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
462,
4706,
269,
29918,
4684,
353,
5159,
13,
462,
4706,
363,
17117,
17117,
2066,
297,
2897,
29889,
20919,
29898,
4632,
718,
8207,
29915,
718,
4516,
1125,
13,
462,
9651,
363,
934,
297,
2066,
29901,
13,
462,
18884,
934,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29892,
934,
29897,
13,
462,
18884,
1596,
29898,
1445,
29918,
978,
29897,
13,
462,
18884,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29896,
29897,
13,
462,
18884,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
18884,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
18884,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
18884,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
18884,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
18884,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
4706,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
462,
4706,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
462,
4706,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
462,
4706,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
462,
4706,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
462,
4706,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
13,
9651,
565,
8783,
1275,
29871,
29946,
29901,
13,
18884,
363,
3876,
29892,
4516,
29879,
29892,
903,
297,
2897,
29889,
20919,
877,
6904,
29940,
2882,
29914,
1272,
29374,
13,
462,
1678,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
4706,
413,
29918,
16707,
353,
29871,
29896,
29900,
13,
462,
4706,
269,
29918,
17990,
2459,
353,
5159,
13,
462,
4706,
269,
29918,
3757,
497,
353,
5159,
13,
462,
4706,
269,
29918,
29888,
29896,
353,
5159,
13,
462,
4706,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
462,
4706,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
462,
4706,
269,
29918,
4684,
353,
5159,
13,
462,
4706,
363,
17117,
17117,
2066,
297,
2897,
29889,
20919,
29898,
4632,
718,
8207,
29915,
718,
4516,
1125,
13,
462,
9651,
363,
934,
297,
2066,
29901,
13,
462,
18884,
934,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29892,
934,
29897,
13,
462,
18884,
1596,
29898,
1445,
29918,
978,
29897,
13,
462,
18884,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29896,
29897,
13,
462,
18884,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
18884,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
18884,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
18884,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
18884,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
18884,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
4706,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
462,
4706,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
462,
4706,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
462,
4706,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
462,
4706,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
462,
4706,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
13,
9651,
565,
8783,
1275,
29871,
29945,
29901,
13,
18884,
363,
3876,
29892,
4516,
29879,
29892,
903,
297,
2897,
29889,
20919,
877,
6904,
29906,
29928,
29914,
1688,
29374,
13,
462,
1678,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
4706,
413,
29918,
16707,
353,
29871,
29941,
13,
462,
4706,
269,
29918,
17990,
2459,
353,
5159,
13,
462,
4706,
269,
29918,
3757,
497,
353,
5159,
13,
462,
4706,
269,
29918,
29888,
29896,
353,
5159,
13,
462,
4706,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
462,
4706,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
462,
4706,
269,
29918,
4684,
353,
5159,
13,
462,
4706,
363,
17117,
17117,
2066,
297,
2897,
29889,
20919,
29898,
4632,
718,
8207,
29915,
718,
4516,
1125,
13,
462,
9651,
363,
934,
297,
2066,
29901,
13,
462,
18884,
934,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29892,
934,
29897,
13,
462,
18884,
1596,
29898,
1445,
29918,
978,
29897,
13,
462,
18884,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29906,
29897,
13,
462,
18884,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
18884,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
18884,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
18884,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
18884,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
18884,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
4706,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
462,
4706,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
462,
4706,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
462,
4706,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
462,
4706,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
462,
4706,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
13,
9651,
565,
8783,
1275,
29871,
29953,
29901,
13,
18884,
269,
29918,
17990,
2459,
353,
5159,
13,
18884,
269,
29918,
3757,
497,
353,
5159,
13,
18884,
269,
29918,
29888,
29896,
353,
5159,
13,
18884,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
18884,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
18884,
269,
29918,
4684,
353,
5159,
13,
18884,
363,
3876,
29892,
4516,
29879,
29892,
2066,
297,
2897,
29889,
20919,
877,
6904,
29965,
29909,
29950,
22208,
1125,
13,
462,
1678,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
4706,
4138,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29897,
13,
462,
4706,
1596,
29898,
12083,
29918,
978,
29897,
13,
462,
4706,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
12083,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29946,
29897,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
4706,
1596,
877,
17990,
2459,
2433,
718,
851,
29898,
17990,
2459,
876,
13,
462,
4706,
1596,
877,
3757,
497,
2433,
718,
851,
29898,
3757,
497,
876,
13,
462,
4706,
1596,
877,
29888,
29896,
2433,
718,
851,
29898,
29888,
29896,
876,
13,
462,
4706,
1596,
877,
10198,
29918,
14766,
2433,
718,
851,
29898,
10198,
29918,
14766,
876,
13,
462,
4706,
1596,
877,
558,
29918,
14766,
2433,
718,
851,
29898,
558,
29918,
14766,
876,
13,
462,
4706,
1596,
877,
4684,
2433,
718,
851,
29898,
4684,
876,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
4706,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
4706,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
4706,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
4706,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
4706,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
4706,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
18884,
1596,
877,
13383,
13383,
7346,
1495,
13,
18884,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
18884,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
18884,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
18884,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
18884,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
18884,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
18884,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
18884,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
18884,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
18884,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
18884,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
18884,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
18884,
1596,
877,
13383,
13383,
7346,
1495,
13,
13,
9651,
565,
8783,
1275,
29871,
29955,
29901,
13,
18884,
363,
3876,
29892,
4516,
29879,
29892,
903,
297,
2897,
29889,
20919,
877,
6904,
29923,
11135,
22208,
1125,
13,
462,
1678,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
4706,
413,
29918,
16707,
353,
29871,
29941,
13,
462,
4706,
269,
29918,
17990,
2459,
353,
5159,
13,
462,
4706,
269,
29918,
3757,
497,
353,
5159,
13,
462,
4706,
269,
29918,
29888,
29896,
353,
5159,
13,
462,
4706,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
462,
4706,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
462,
4706,
269,
29918,
4684,
353,
5159,
13,
462,
4706,
363,
17117,
17117,
2066,
297,
2897,
29889,
20919,
29898,
4632,
718,
8207,
29915,
718,
4516,
1125,
13,
462,
9651,
363,
934,
297,
2066,
29901,
13,
462,
18884,
934,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29892,
934,
29897,
13,
462,
18884,
1596,
29898,
1445,
29918,
978,
29897,
13,
462,
18884,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29941,
29897,
13,
462,
18884,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
18884,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
18884,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
18884,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
18884,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
18884,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
4706,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
462,
4706,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
462,
4706,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
462,
4706,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
462,
4706,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
462,
4706,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
462,
4706,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
462,
4706,
1596,
877,
13383,
13383,
7346,
1495,
13,
1678,
1683,
29901,
13,
4706,
8783,
353,
938,
29898,
9675,
29889,
19218,
29961,
29896,
2314,
13,
4706,
565,
8783,
1275,
29871,
29896,
29901,
13,
9651,
934,
29918,
978,
353,
19283,
29954,
29928,
29914,
1272,
29914,
15462,
6656,
29918,
2744,
290,
14997,
4775,
29879,
29889,
7638,
29915,
13,
9651,
1596,
29898,
1445,
29918,
978,
29897,
13,
9651,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29897,
13,
9651,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
17990,
2459,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
3757,
497,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
29888,
29896,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
10198,
29918,
14766,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
558,
29918,
14766,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
4684,
876,
13,
308,
13,
4706,
565,
8783,
1275,
29871,
29906,
29901,
13,
9651,
934,
29918,
978,
353,
19283,
29950,
1799,
29914,
1272,
29914,
20938,
1799,
29918,
273,
290,
20521,
29918,
15770,
29889,
7638,
29915,
13,
9651,
1596,
29898,
1445,
29918,
978,
29897,
13,
9651,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29897,
13,
9651,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
17990,
2459,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
3757,
497,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
29888,
29896,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
10198,
29918,
14766,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
558,
29918,
14766,
876,
13,
9651,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
4684,
876,
13,
13,
4706,
565,
8783,
1275,
29871,
29941,
29901,
13,
9651,
363,
3876,
29892,
4516,
29879,
29892,
903,
297,
2897,
29889,
20919,
877,
6904,
29979,
29909,
8187,
29949,
29914,
1272,
29374,
13,
18884,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
1678,
413,
29918,
16707,
353,
29871,
29896,
29900,
13,
462,
1678,
269,
29918,
17990,
2459,
353,
5159,
13,
462,
1678,
269,
29918,
3757,
497,
353,
5159,
13,
462,
1678,
269,
29918,
29888,
29896,
353,
5159,
13,
462,
1678,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
462,
1678,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
462,
1678,
269,
29918,
4684,
353,
5159,
13,
462,
1678,
363,
17117,
17117,
2066,
297,
2897,
29889,
20919,
29898,
4632,
718,
8207,
29915,
718,
4516,
1125,
13,
462,
4706,
363,
934,
297,
2066,
29901,
13,
462,
9651,
934,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29892,
934,
29897,
13,
462,
9651,
1596,
29898,
1445,
29918,
978,
29897,
13,
462,
9651,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29896,
29897,
13,
462,
9651,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
9651,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
9651,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
9651,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
9651,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
9651,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
1678,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
462,
1678,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
462,
1678,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
462,
1678,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
462,
1678,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
462,
1678,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
13,
4706,
565,
8783,
1275,
29871,
29946,
29901,
13,
9651,
363,
3876,
29892,
4516,
29879,
29892,
903,
297,
2897,
29889,
20919,
877,
6904,
29940,
2882,
29914,
1272,
29374,
13,
18884,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
1678,
413,
29918,
16707,
353,
29871,
29896,
29900,
13,
462,
1678,
269,
29918,
17990,
2459,
353,
5159,
13,
462,
1678,
269,
29918,
3757,
497,
353,
5159,
13,
462,
1678,
269,
29918,
29888,
29896,
353,
5159,
13,
462,
1678,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
462,
1678,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
462,
1678,
269,
29918,
4684,
353,
5159,
13,
462,
1678,
363,
17117,
17117,
2066,
297,
2897,
29889,
20919,
29898,
4632,
718,
8207,
29915,
718,
4516,
1125,
13,
462,
4706,
363,
934,
297,
2066,
29901,
13,
462,
9651,
934,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29892,
934,
29897,
13,
462,
9651,
1596,
29898,
1445,
29918,
978,
29897,
13,
462,
9651,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29896,
29897,
13,
462,
9651,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
9651,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
9651,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
9651,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
9651,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
9651,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
1678,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
462,
1678,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
462,
1678,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
462,
1678,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
462,
1678,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
462,
1678,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
13,
4706,
565,
8783,
1275,
29871,
29945,
29901,
13,
9651,
363,
3876,
29892,
4516,
29879,
29892,
903,
297,
2897,
29889,
20919,
877,
6904,
29906,
29928,
29914,
1688,
29374,
13,
18884,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
1678,
413,
29918,
16707,
353,
29871,
29941,
13,
462,
1678,
269,
29918,
17990,
2459,
353,
5159,
13,
462,
1678,
269,
29918,
3757,
497,
353,
5159,
13,
462,
1678,
269,
29918,
29888,
29896,
353,
5159,
13,
462,
1678,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
462,
1678,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
462,
1678,
269,
29918,
4684,
353,
5159,
13,
462,
1678,
363,
17117,
17117,
2066,
297,
2897,
29889,
20919,
29898,
4632,
718,
8207,
29915,
718,
4516,
1125,
13,
462,
4706,
363,
934,
297,
2066,
29901,
13,
462,
9651,
934,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29892,
934,
29897,
13,
462,
9651,
1596,
29898,
1445,
29918,
978,
29897,
13,
462,
9651,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29906,
29897,
13,
462,
9651,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
9651,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
9651,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
9651,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
9651,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
9651,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
1678,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
462,
1678,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
462,
1678,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
462,
1678,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
462,
1678,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
462,
1678,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
13,
13,
4706,
565,
8783,
1275,
29871,
29953,
29901,
13,
9651,
269,
29918,
17990,
2459,
353,
5159,
13,
9651,
269,
29918,
3757,
497,
353,
5159,
13,
9651,
269,
29918,
29888,
29896,
353,
5159,
13,
9651,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
9651,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
9651,
269,
29918,
4684,
353,
5159,
13,
9651,
363,
3876,
29892,
4516,
29879,
29892,
2066,
297,
2897,
29889,
20919,
877,
6904,
29965,
29909,
29950,
22208,
1125,
13,
18884,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
1678,
4138,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29897,
13,
462,
1678,
1596,
29898,
12083,
29918,
978,
29897,
13,
462,
1678,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
12083,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29946,
29897,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
1678,
1596,
877,
17990,
2459,
2433,
718,
851,
29898,
17990,
2459,
876,
13,
462,
1678,
1596,
877,
3757,
497,
2433,
718,
851,
29898,
3757,
497,
876,
13,
462,
1678,
1596,
877,
29888,
29896,
2433,
718,
851,
29898,
29888,
29896,
876,
13,
462,
1678,
1596,
877,
10198,
29918,
14766,
2433,
718,
851,
29898,
10198,
29918,
14766,
876,
13,
462,
1678,
1596,
877,
558,
29918,
14766,
2433,
718,
851,
29898,
558,
29918,
14766,
876,
13,
462,
1678,
1596,
877,
4684,
2433,
718,
851,
29898,
4684,
876,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
1678,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
1678,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
1678,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
1678,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
1678,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
1678,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
9651,
1596,
877,
13383,
13383,
7346,
1495,
13,
9651,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
9651,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
9651,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
9651,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
9651,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
9651,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
9651,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
9651,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
9651,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
9651,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
9651,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
9651,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
9651,
1596,
877,
13383,
13383,
7346,
1495,
13,
13,
4706,
565,
8783,
1275,
29871,
29955,
29901,
13,
9651,
363,
3876,
29892,
4516,
29879,
29892,
903,
297,
2897,
29889,
20919,
877,
6904,
29923,
11135,
22208,
1125,
13,
18884,
363,
4516,
297,
4516,
29879,
29901,
13,
462,
1678,
413,
29918,
16707,
353,
29871,
29941,
13,
462,
1678,
269,
29918,
17990,
2459,
353,
5159,
13,
462,
1678,
269,
29918,
3757,
497,
353,
5159,
13,
462,
1678,
269,
29918,
29888,
29896,
353,
5159,
13,
462,
1678,
269,
29918,
10198,
29918,
14766,
353,
5159,
13,
462,
1678,
269,
29918,
558,
29918,
14766,
353,
5159,
13,
462,
1678,
269,
29918,
4684,
353,
5159,
13,
462,
1678,
363,
17117,
17117,
2066,
297,
2897,
29889,
20919,
29898,
4632,
718,
8207,
29915,
718,
4516,
1125,
13,
462,
4706,
363,
934,
297,
2066,
29901,
13,
462,
9651,
934,
29918,
978,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
4516,
29892,
934,
29897,
13,
462,
9651,
1596,
29898,
1445,
29918,
978,
29897,
13,
462,
9651,
16716,
29892,
17386,
29892,
285,
29896,
29892,
696,
29883,
29918,
14766,
29892,
544,
29918,
14766,
29892,
274,
2039,
353,
7525,
3195,
29898,
1445,
29918,
978,
29892,
8783,
29892,
903,
5029,
29918,
1949,
29922,
29941,
29897,
13,
462,
9651,
269,
29918,
17990,
2459,
29889,
4397,
29898,
17990,
2459,
29897,
13,
462,
9651,
269,
29918,
3757,
497,
29889,
4397,
29898,
3757,
497,
29897,
13,
462,
9651,
269,
29918,
29888,
29896,
29889,
4397,
29898,
29888,
29896,
29897,
13,
462,
9651,
269,
29918,
10198,
29918,
14766,
29889,
4397,
29898,
10198,
29918,
14766,
29897,
13,
462,
9651,
269,
29918,
558,
29918,
14766,
29889,
4397,
29898,
558,
29918,
14766,
29897,
13,
462,
9651,
269,
29918,
4684,
29889,
4397,
29898,
4684,
29897,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
462,
1678,
1029,
29887,
29918,
17990,
2459,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
17990,
2459,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
17990,
2459,
2433,
718,
851,
29898,
485,
29887,
29918,
17990,
2459,
876,
13,
462,
1678,
1029,
29887,
29918,
3757,
497,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
3757,
497,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
3757,
497,
2433,
718,
851,
29898,
485,
29887,
29918,
3757,
497,
876,
13,
462,
1678,
1029,
29887,
29918,
29888,
29896,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
29888,
29896,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
29888,
29896,
2433,
718,
851,
29898,
485,
29887,
29918,
29888,
29896,
876,
13,
462,
1678,
1029,
29887,
29918,
10198,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
10198,
29918,
14766,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
10198,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
10198,
29918,
14766,
876,
13,
462,
1678,
1029,
29887,
29918,
558,
29918,
14766,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
558,
29918,
14766,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
558,
29918,
14766,
2433,
718,
851,
29898,
485,
29887,
29918,
558,
29918,
14766,
876,
13,
462,
1678,
1029,
29887,
29918,
4684,
353,
20535,
403,
29909,
19698,
10095,
2200,
29898,
29879,
29918,
4684,
29897,
13,
462,
1678,
1596,
877,
485,
29887,
29918,
4684,
2433,
718,
851,
29898,
485,
29887,
29918,
4684,
876,
13,
462,
1678,
1596,
877,
13383,
13383,
7346,
1495,
13,
2
] |
posts/views.py | ionesu/hw05_final | 0 | 64058 | from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404, redirect, render
from django.views.decorators.cache import cache_page
from .forms import CommentForm, PostForm
from .models import Follow, Group, Post, User
@cache_page(20, key_prefix="index_page")
def index(request):
post_list = Post.objects.order_by('-pub_date').all()
paginator = Paginator(post_list, 10)
page_number = request.GET.get('page')
page = paginator.get_page(page_number)
return render(
request,
'index.html',
{'page': page, 'paginator': paginator}
)
def group_posts(request, slug):
group = get_object_or_404(Group, slug=slug)
post_list = group.posts.all()
paginator = Paginator(post_list, 10)
page_number = request.GET.get('page')
page = paginator.get_page(page_number)
return render(request, "group.html", {
"group": group,
'page': page,
'paginator': paginator
})
@login_required
def new_post(request):
form = PostForm(request.POST or None)
if form.is_valid():
instance = form.save(commit=False)
instance.author = request.user
instance.save()
return redirect('index')
return render(request, 'new.html', {'form': form})
def profile(request, username):
author = get_object_or_404(User, username=username)
following = False
if request.user.is_authenticated:
following = Follow.objects.filter(user=request.user.id,
author=author).exists()
post_list = author.author_posts.all()
count_posts = post_list.count()
paginator = Paginator(post_list, 10)
page_number = request.GET.get('page')
page = paginator.get_page(page_number)
return render(request, 'profile.html', {
"author": author,
'page': page,
'paginator': paginator,
'count_posts': count_posts,
'profile': author,
"following": following}
)
def post_view(request, username, post_id):
author = get_object_or_404(User, username=username)
post = get_object_or_404(Post, pk=post_id, author__username=username)
count_posts = author.author_posts.count()
form = CommentForm(request.POST)
comments = post.comments.all()
return render(request, "post_view.html", {
"author": author,
"username": username,
"post": post,
"count_posts": count_posts,
"form": form,
"comments": comments, })
@login_required
def post_edit(request, username, post_id):
profile = get_object_or_404(User, username=username)
post = get_object_or_404(Post, pk=post_id, author=profile)
if request.user != profile:
return redirect('post', username=username, post_id=post_id)
form = PostForm(request.POST or None,
files=request.FILES or None, instance=post)
if request.method == 'POST':
if form.is_valid():
form.save()
return redirect(
"post_view",
username=request.user.username,
post_id=post_id
)
return render(
request, 'new.html', {'form': form, 'post': post},
)
def page_not_found(request, exception):
# Переменная exception содержит отладочную информацию,
# выводить её в шаблон пользователской страницы 404 мы не станем
return render(
request,
"misc/404.html",
{"path": request.path},
status=404
)
def server_error(request):
return render(request, "misc/500.html", status=500)
@login_required
def add_comment(request, username, post_id):
post = get_object_or_404(Post, pk=post_id, author__username=username)
form = CommentForm(request.POST or None)
if not form.is_valid():
return render(request, "comments.html",
{"form": form, "post": post})
comment = form.save(commit=False)
comment.author = request.user
comment.post = post
form.save()
return redirect("post_view", username, post_id)
@login_required
def follow_index(request):
post_list = Post.objects.filter(author__following__user=request.user)
paginator = Paginator(post_list, 10)
page_number = request.GET.get('page')
page = paginator.get_page(page_number)
return render(
request,
'follow.html',
{
'page': page,
'paginator': paginator
}
)
@login_required
def profile_follow(request, username):
author = get_object_or_404(User, username=username)
if request.user != author:
Follow.objects.get_or_create(user=request.user, author=author)
return redirect('profile', username=username)
@login_required
def profile_unfollow(request, username):
author = get_object_or_404(User, username=username)
Follow.objects.filter(user=request.user, author=author).delete()
return redirect("profile", username=username)
| [
1,
515,
9557,
29889,
21570,
29889,
5150,
29889,
19557,
4097,
1053,
6464,
29918,
12403,
13,
3166,
9557,
29889,
3221,
29889,
13573,
262,
1061,
1053,
349,
26584,
1061,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29892,
6684,
29892,
4050,
13,
3166,
9557,
29889,
7406,
29889,
19557,
4097,
29889,
8173,
1053,
7090,
29918,
3488,
13,
3166,
869,
9514,
1053,
461,
2500,
29892,
4918,
2500,
13,
3166,
869,
9794,
1053,
10306,
29892,
6431,
29892,
4918,
29892,
4911,
13,
13,
13,
29992,
8173,
29918,
3488,
29898,
29906,
29900,
29892,
1820,
29918,
13506,
543,
2248,
29918,
3488,
1159,
13,
1753,
2380,
29898,
3827,
1125,
13,
1678,
1400,
29918,
1761,
353,
4918,
29889,
12650,
29889,
2098,
29918,
1609,
877,
29899,
5467,
29918,
1256,
2824,
497,
580,
13,
1678,
10203,
262,
1061,
353,
349,
26584,
1061,
29898,
2490,
29918,
1761,
29892,
29871,
29896,
29900,
29897,
13,
13,
1678,
1813,
29918,
4537,
353,
2009,
29889,
7194,
29889,
657,
877,
3488,
1495,
13,
1678,
1813,
353,
10203,
262,
1061,
29889,
657,
29918,
3488,
29898,
3488,
29918,
4537,
29897,
13,
1678,
736,
4050,
29898,
13,
4706,
2009,
29892,
13,
4706,
525,
2248,
29889,
1420,
742,
13,
4706,
11117,
3488,
2396,
1813,
29892,
525,
13573,
262,
1061,
2396,
10203,
262,
1061,
29913,
13,
1678,
1723,
13,
13,
13,
1753,
2318,
29918,
14080,
29898,
3827,
29892,
2243,
688,
1125,
13,
1678,
2318,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
4782,
29892,
2243,
688,
29922,
29517,
29897,
13,
13,
1678,
1400,
29918,
1761,
353,
2318,
29889,
14080,
29889,
497,
580,
13,
1678,
10203,
262,
1061,
353,
349,
26584,
1061,
29898,
2490,
29918,
1761,
29892,
29871,
29896,
29900,
29897,
13,
1678,
1813,
29918,
4537,
353,
2009,
29889,
7194,
29889,
657,
877,
3488,
1495,
13,
1678,
1813,
353,
10203,
262,
1061,
29889,
657,
29918,
3488,
29898,
3488,
29918,
4537,
29897,
13,
1678,
736,
4050,
29898,
3827,
29892,
376,
2972,
29889,
1420,
613,
426,
13,
4706,
376,
2972,
1115,
2318,
29892,
13,
4706,
525,
3488,
2396,
1813,
29892,
13,
4706,
525,
13573,
262,
1061,
2396,
10203,
262,
1061,
13,
1678,
5615,
13,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
716,
29918,
2490,
29898,
3827,
1125,
13,
1678,
883,
353,
4918,
2500,
29898,
3827,
29889,
5438,
470,
6213,
29897,
13,
13,
1678,
565,
883,
29889,
275,
29918,
3084,
7295,
13,
4706,
2777,
353,
883,
29889,
7620,
29898,
15060,
29922,
8824,
29897,
13,
4706,
2777,
29889,
8921,
353,
2009,
29889,
1792,
13,
4706,
2777,
29889,
7620,
580,
13,
13,
4706,
736,
6684,
877,
2248,
1495,
13,
13,
1678,
736,
4050,
29898,
3827,
29892,
525,
1482,
29889,
1420,
742,
11117,
689,
2396,
883,
1800,
13,
13,
13,
1753,
8722,
29898,
3827,
29892,
8952,
1125,
13,
1678,
4148,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
2659,
29892,
8952,
29922,
6786,
29897,
13,
1678,
1494,
353,
7700,
13,
1678,
565,
2009,
29889,
1792,
29889,
275,
29918,
27218,
630,
29901,
13,
4706,
1494,
353,
10306,
29889,
12650,
29889,
4572,
29898,
1792,
29922,
3827,
29889,
1792,
29889,
333,
29892,
13,
462,
462,
3986,
4148,
29922,
8921,
467,
9933,
580,
13,
1678,
1400,
29918,
1761,
353,
4148,
29889,
8921,
29918,
14080,
29889,
497,
580,
13,
1678,
2302,
29918,
14080,
353,
1400,
29918,
1761,
29889,
2798,
580,
13,
1678,
10203,
262,
1061,
353,
349,
26584,
1061,
29898,
2490,
29918,
1761,
29892,
29871,
29896,
29900,
29897,
13,
1678,
1813,
29918,
4537,
353,
2009,
29889,
7194,
29889,
657,
877,
3488,
1495,
13,
1678,
1813,
353,
10203,
262,
1061,
29889,
657,
29918,
3488,
29898,
3488,
29918,
4537,
29897,
13,
13,
1678,
736,
4050,
29898,
3827,
29892,
525,
10185,
29889,
1420,
742,
426,
13,
4706,
376,
8921,
1115,
4148,
29892,
13,
4706,
525,
3488,
2396,
1813,
29892,
13,
4706,
525,
13573,
262,
1061,
2396,
10203,
262,
1061,
29892,
13,
4706,
525,
2798,
29918,
14080,
2396,
2302,
29918,
14080,
29892,
13,
4706,
525,
10185,
2396,
4148,
29892,
13,
4706,
376,
23031,
292,
1115,
1494,
29913,
13,
1678,
1723,
13,
13,
13,
1753,
1400,
29918,
1493,
29898,
3827,
29892,
8952,
29892,
1400,
29918,
333,
1125,
13,
1678,
4148,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
2659,
29892,
8952,
29922,
6786,
29897,
13,
1678,
1400,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
6747,
29892,
282,
29895,
29922,
2490,
29918,
333,
29892,
4148,
1649,
6786,
29922,
6786,
29897,
13,
1678,
2302,
29918,
14080,
353,
4148,
29889,
8921,
29918,
14080,
29889,
2798,
580,
13,
13,
1678,
883,
353,
461,
2500,
29898,
3827,
29889,
5438,
29897,
13,
1678,
6589,
353,
1400,
29889,
21032,
29889,
497,
580,
13,
13,
1678,
736,
4050,
29898,
3827,
29892,
376,
2490,
29918,
1493,
29889,
1420,
613,
426,
13,
4706,
376,
8921,
1115,
4148,
29892,
13,
4706,
376,
6786,
1115,
8952,
29892,
13,
4706,
376,
2490,
1115,
1400,
29892,
13,
4706,
376,
2798,
29918,
14080,
1115,
2302,
29918,
14080,
29892,
13,
4706,
376,
689,
1115,
883,
29892,
13,
4706,
376,
21032,
1115,
6589,
29892,
5615,
13,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
1400,
29918,
5628,
29898,
3827,
29892,
8952,
29892,
1400,
29918,
333,
1125,
13,
1678,
8722,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
2659,
29892,
8952,
29922,
6786,
29897,
13,
1678,
1400,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
6747,
29892,
282,
29895,
29922,
2490,
29918,
333,
29892,
4148,
29922,
10185,
29897,
13,
1678,
565,
2009,
29889,
1792,
2804,
8722,
29901,
13,
4706,
736,
6684,
877,
2490,
742,
8952,
29922,
6786,
29892,
1400,
29918,
333,
29922,
2490,
29918,
333,
29897,
13,
1678,
883,
353,
4918,
2500,
29898,
3827,
29889,
5438,
470,
6213,
29892,
13,
462,
1678,
2066,
29922,
3827,
29889,
24483,
470,
6213,
29892,
2777,
29922,
2490,
29897,
13,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
565,
883,
29889,
275,
29918,
3084,
7295,
13,
9651,
883,
29889,
7620,
580,
13,
9651,
736,
6684,
29898,
13,
18884,
376,
2490,
29918,
1493,
613,
13,
18884,
8952,
29922,
3827,
29889,
1792,
29889,
6786,
29892,
13,
18884,
1400,
29918,
333,
29922,
2490,
29918,
333,
13,
18884,
1723,
13,
13,
1678,
736,
4050,
29898,
13,
4706,
2009,
29892,
525,
1482,
29889,
1420,
742,
11117,
689,
2396,
883,
29892,
525,
2490,
2396,
1400,
1118,
13,
1678,
1723,
13,
13,
13,
1753,
1813,
29918,
1333,
29918,
11940,
29898,
3827,
29892,
3682,
1125,
13,
1678,
396,
16204,
2387,
3162,
3682,
1778,
6620,
1969,
29932,
1685,
684,
1802,
29981,
6627,
25565,
13603,
29892,
13,
1678,
396,
2771,
17272,
1413,
12131,
490,
16844,
29975,
25851,
18636,
9718,
11186,
2641,
8440,
25213,
29871,
29946,
29900,
29946,
26907,
1538,
5151,
3098,
13,
1678,
736,
4050,
29898,
13,
4706,
2009,
29892,
13,
4706,
376,
29885,
10669,
29914,
29946,
29900,
29946,
29889,
1420,
613,
13,
4706,
8853,
2084,
1115,
2009,
29889,
2084,
1118,
13,
4706,
4660,
29922,
29946,
29900,
29946,
13,
1678,
1723,
13,
13,
13,
1753,
1923,
29918,
2704,
29898,
3827,
1125,
13,
1678,
736,
4050,
29898,
3827,
29892,
376,
29885,
10669,
29914,
29945,
29900,
29900,
29889,
1420,
613,
4660,
29922,
29945,
29900,
29900,
29897,
13,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
788,
29918,
9342,
29898,
3827,
29892,
8952,
29892,
1400,
29918,
333,
1125,
13,
1678,
1400,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
6747,
29892,
282,
29895,
29922,
2490,
29918,
333,
29892,
4148,
1649,
6786,
29922,
6786,
29897,
13,
1678,
883,
353,
461,
2500,
29898,
3827,
29889,
5438,
470,
6213,
29897,
13,
1678,
565,
451,
883,
29889,
275,
29918,
3084,
7295,
13,
4706,
736,
4050,
29898,
3827,
29892,
376,
21032,
29889,
1420,
613,
13,
462,
418,
8853,
689,
1115,
883,
29892,
376,
2490,
1115,
1400,
1800,
13,
1678,
3440,
353,
883,
29889,
7620,
29898,
15060,
29922,
8824,
29897,
13,
1678,
3440,
29889,
8921,
353,
2009,
29889,
1792,
13,
1678,
3440,
29889,
2490,
353,
1400,
13,
1678,
883,
29889,
7620,
580,
13,
1678,
736,
6684,
703,
2490,
29918,
1493,
613,
8952,
29892,
1400,
29918,
333,
29897,
13,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
1101,
29918,
2248,
29898,
3827,
1125,
13,
1678,
1400,
29918,
1761,
353,
4918,
29889,
12650,
29889,
4572,
29898,
8921,
1649,
23031,
292,
1649,
1792,
29922,
3827,
29889,
1792,
29897,
13,
1678,
10203,
262,
1061,
353,
349,
26584,
1061,
29898,
2490,
29918,
1761,
29892,
29871,
29896,
29900,
29897,
13,
1678,
1813,
29918,
4537,
353,
2009,
29889,
7194,
29889,
657,
877,
3488,
1495,
13,
1678,
1813,
353,
10203,
262,
1061,
29889,
657,
29918,
3488,
29898,
3488,
29918,
4537,
29897,
13,
1678,
736,
4050,
29898,
13,
4706,
2009,
29892,
13,
4706,
525,
23031,
29889,
1420,
742,
13,
4706,
426,
13,
9651,
525,
3488,
2396,
1813,
29892,
13,
9651,
525,
13573,
262,
1061,
2396,
10203,
262,
1061,
13,
4706,
500,
13,
1678,
1723,
13,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
8722,
29918,
23031,
29898,
3827,
29892,
8952,
1125,
13,
1678,
4148,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
2659,
29892,
8952,
29922,
6786,
29897,
13,
1678,
565,
2009,
29889,
1792,
2804,
4148,
29901,
13,
4706,
10306,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
1792,
29922,
3827,
29889,
1792,
29892,
4148,
29922,
8921,
29897,
13,
1678,
736,
6684,
877,
10185,
742,
8952,
29922,
6786,
29897,
13,
13,
13,
29992,
7507,
29918,
12403,
13,
1753,
8722,
29918,
348,
23031,
29898,
3827,
29892,
8952,
1125,
13,
1678,
4148,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
2659,
29892,
8952,
29922,
6786,
29897,
13,
1678,
10306,
29889,
12650,
29889,
4572,
29898,
1792,
29922,
3827,
29889,
1792,
29892,
4148,
29922,
8921,
467,
8143,
580,
13,
1678,
736,
6684,
703,
10185,
613,
8952,
29922,
6786,
29897,
13,
2
] |
cryptomon/ascii.py | S0L1DUS/cryptocoinmon | 0 | 9197 | # -*- coding: utf-8 -*-
import sys
from cryptomon.common import Colors
if sys.version_info >= (3, 0):
import io
else:
import StringIO as io
ascii_title = """
/$$$$$$ /$$ /$$ /$$
/$$__ $$ | $$ | $$$ /$$$
| $$ \__/ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ | $$$$ /$$$$ /$$$$$$ /$$$$$$$
| $$ /$$__ $$| $$ | $$ /$$__ $$|_ $$_/ /$$__ $$| $$ $$/$$ $$ /$$__ $$| $$__ $$
| $$ | $$ \__/| $$ | $$| $$ \ $$ | $$ | $$ \ $$| $$ $$$| $$| $$ \ $$| $$ \ $$
| $$ $$| $$ | $$ | $$| $$ | $$ | $$ /$$| $$ | $$| $$\ $ | $$| $$ | $$| $$ | $$
| $$$$$$/| $$ | $$$$$$$| $$$$$$$/ | $$$$/| $$$$$$/| $$ \/ | $$| $$$$$$/| $$ | $$
\______/ |__/ \____ $$| $$____/ \___/ \______/ |__/ |__/ \______/ |__/ |__/
/$$ | $$| $$
| $$$$$$/| $$
\______/ |__/
"""
def process_title(title):
buf = io.StringIO(title)
lines = buf.readlines()
lines = lines[1:-1]
colored_lines = []
colored_title = ""
for line in lines:
colored_lines.append(Colors.BLUE + line[:13] + Colors.YELLOW + line[14:])
for line in colored_lines:
colored_title += line
return colored_title + Colors.ENDLINE
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
5215,
10876,
13,
3166,
24941,
18192,
29889,
9435,
1053,
29183,
13,
361,
10876,
29889,
3259,
29918,
3888,
6736,
313,
29941,
29892,
29871,
29900,
1125,
13,
1678,
1053,
12013,
13,
2870,
29901,
13,
1678,
1053,
1714,
5971,
408,
12013,
13,
13,
13,
294,
18869,
29918,
3257,
353,
9995,
13,
13,
29871,
847,
3997,
3997,
3997,
462,
462,
29871,
847,
3997,
1669,
847,
3997,
418,
847,
3997,
462,
268,
13,
847,
3997,
1649,
29871,
2046,
462,
18884,
891,
2046,
795,
891,
2046,
29938,
1678,
847,
3997,
29938,
462,
268,
13,
29989,
2046,
29871,
320,
1649,
29914,
29871,
847,
3997,
3997,
3997,
29871,
847,
3997,
259,
847,
3997,
29871,
847,
3997,
3997,
3997,
29871,
847,
3997,
3997,
3997,
1678,
847,
3997,
3997,
3997,
891,
2046,
3997,
29871,
847,
3997,
3997,
29871,
847,
3997,
3997,
3997,
29871,
847,
3997,
3997,
3997,
29938,
29871,
13,
29989,
2046,
539,
847,
3997,
1649,
29871,
2046,
29989,
2046,
29871,
891,
2046,
847,
3997,
1649,
29871,
2046,
29989,
29918,
29871,
2046,
29918,
29914,
259,
847,
3997,
1649,
29871,
2046,
29989,
2046,
2046,
29914,
3997,
2046,
847,
3997,
1649,
29871,
2046,
29989,
2046,
1649,
29871,
2046,
13,
29989,
2046,
418,
891,
2046,
29871,
320,
1649,
29914,
29989,
2046,
29871,
891,
2046,
29989,
2046,
29871,
320,
2046,
29871,
891,
2046,
1678,
891,
2046,
29871,
320,
2046,
29989,
2046,
29871,
2046,
29938,
29989,
2046,
29989,
2046,
29871,
320,
2046,
29989,
2046,
29871,
320,
2046,
13,
29989,
2046,
1678,
2046,
29989,
2046,
418,
891,
2046,
29871,
891,
2046,
29989,
2046,
29871,
891,
2046,
29871,
891,
2046,
847,
3997,
29989,
2046,
29871,
891,
2046,
29989,
6118,
29871,
395,
891,
2046,
29989,
2046,
29871,
891,
2046,
29989,
2046,
29871,
891,
2046,
13,
29989,
29871,
2046,
3997,
3997,
29914,
29989,
2046,
418,
891,
29871,
2046,
3997,
3997,
29938,
29989,
2046,
3997,
3997,
29938,
29914,
29871,
891,
29871,
2046,
3997,
29914,
29989,
29871,
2046,
3997,
3997,
29914,
29989,
2046,
320,
29914,
29871,
891,
2046,
29989,
29871,
2046,
3997,
3997,
29914,
29989,
2046,
29871,
891,
2046,
13,
320,
7652,
1649,
29914,
891,
1649,
29914,
539,
320,
7652,
29871,
2046,
29989,
2046,
7652,
29914,
1678,
320,
22359,
29914,
259,
320,
7652,
1649,
29914,
891,
1649,
29914,
268,
891,
1649,
29914,
320,
7652,
1649,
29914,
891,
1649,
29914,
29871,
891,
1649,
29914,
13,
462,
268,
847,
3997,
29871,
891,
2046,
29989,
2046,
462,
462,
462,
9651,
13,
462,
1678,
891,
29871,
2046,
3997,
3997,
29914,
29989,
2046,
462,
462,
462,
9651,
13,
462,
268,
320,
7652,
1649,
29914,
891,
1649,
29914,
462,
462,
462,
9651,
13,
13,
15945,
29908,
13,
13,
13,
1753,
1889,
29918,
3257,
29898,
3257,
1125,
13,
1678,
18392,
353,
12013,
29889,
1231,
5971,
29898,
3257,
29897,
13,
1678,
3454,
353,
18392,
29889,
949,
9012,
580,
13,
1678,
3454,
353,
3454,
29961,
29896,
13018,
29896,
29962,
13,
1678,
28684,
29918,
9012,
353,
5159,
13,
1678,
28684,
29918,
3257,
353,
5124,
13,
13,
1678,
363,
1196,
297,
3454,
29901,
13,
4706,
28684,
29918,
9012,
29889,
4397,
29898,
1625,
943,
29889,
13367,
4462,
718,
1196,
7503,
29896,
29941,
29962,
718,
29183,
29889,
29979,
29923,
2208,
9806,
718,
1196,
29961,
29896,
29946,
29901,
2314,
13,
13,
1678,
363,
1196,
297,
28684,
29918,
9012,
29901,
13,
4706,
28684,
29918,
3257,
4619,
1196,
13,
13,
1678,
736,
28684,
29918,
3257,
718,
29183,
29889,
11794,
18521,
13,
2
] |
src/crawl/unicrawl/spiders/he-ferrer_courses.py | DeLeb86/unicrawl | 5 | 100696 | <reponame>DeLeb86/unicrawl
# -*- coding: utf-8 -*-
from abc import ABC
from pathlib import Path
import pandas as pd
import scrapy
from settings import YEAR, CRAWLING_OUTPUT_FOLDER
from src.crawl.utils import cleanup
BASE_URL = "https://fiches-ue.icampusferrer.eu/etatV2.php?id={}&annee={}"
PROG_DATA_PATH = Path(__file__).parent.absolute().joinpath(
f'../../../../{CRAWLING_OUTPUT_FOLDER}he-ferrer_programs_{YEAR}.json')
LANGUAGES_DICT = {"Français": "fr",
"Anglais": "en"}
class HEFERRERCourseSpider(scrapy.Spider, ABC):
"""
Course crawler for Haute Ecole Francisco Ferrer
"""
name = "he-ferrer-courses"
custom_settings = {
'FEED_URI': Path(__file__).parent.absolute().joinpath(
f'../../../../{CRAWLING_OUTPUT_FOLDER}he-ferrer_courses_{YEAR}.json').as_uri()
}
def start_requests(self):
courses = pd.read_json(open(PROG_DATA_PATH, "r"))["courses"]
courses_list = sorted(list(set(courses.sum())))
for course in courses_list:
yield scrapy.Request(url=BASE_URL.format(course, YEAR),
callback=self.parse_ue,
cb_kwargs={"ue_id": course})
def parse_ue(self, response, ue_id):
ue_name = response.xpath("//h3/text()").get()
year = response.xpath("//h5[1]/text()").get().split(":")[1].strip(" ")
teachers = response.xpath("//td[contains(text(), \"Responsable de l'UE\")]//following::span[1]/text()").getall()
teachers = [" ".join(teacher.split(" ")[1:]) + " " + teacher.split(" ")[0] for teacher in teachers]
ects = response.xpath("//td[contains(text(), 'Crédits ECTS')]//following::strong[1]/text()").get()
ects = int(ects.strip(" "))
languages = response.xpath("//td[contains(text(), \"Langue d'enseignement et d'évaluation\")]"
"//following::strong[1]/text()").getall()
language = [LANGUAGES_DICT[language] for language in languages]
content = cleanup(response.xpath("//h3[contains(text(), '2')]/following::div[@id='ue_objectifs_wrapper'][1]").get())
yield {"id": ue_id,
"name": ue_name,
"year": year,
"teachers": teachers,
"languages": language,
"ects": ects,
"url": response.url,
"content": content}
| [
1,
529,
276,
1112,
420,
29958,
2772,
29931,
774,
29947,
29953,
29914,
2523,
1610,
29880,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
25638,
1053,
16417,
13,
3166,
2224,
1982,
1053,
10802,
13,
13,
5215,
11701,
408,
10518,
13,
13,
5215,
24559,
2272,
13,
13,
3166,
6055,
1053,
612,
26441,
29892,
315,
4717,
29956,
29931,
4214,
29918,
12015,
12336,
29918,
29943,
5607,
8032,
13,
3166,
4765,
29889,
29883,
1610,
29880,
29889,
13239,
1053,
5941,
786,
13,
13,
13,
25416,
29918,
4219,
353,
376,
991,
597,
29888,
436,
267,
29899,
434,
29889,
293,
1160,
375,
3735,
29889,
12932,
29914,
300,
271,
29963,
29906,
29889,
1961,
29973,
333,
3790,
15704,
11276,
29872,
3790,
5038,
13,
8618,
29954,
29918,
14573,
29918,
10145,
353,
10802,
22168,
1445,
1649,
467,
3560,
29889,
23552,
2141,
7122,
2084,
29898,
13,
1678,
285,
29915,
21546,
21546,
29912,
29907,
4717,
29956,
29931,
4214,
29918,
12015,
12336,
29918,
29943,
5607,
8032,
29913,
354,
29899,
3735,
29918,
8860,
29879,
648,
29979,
26441,
1836,
3126,
1495,
13,
29931,
19453,
29965,
10461,
29903,
29918,
4571,
1783,
353,
8853,
7675,
6899,
1115,
376,
1341,
613,
13,
462,
29871,
376,
9928,
11818,
1115,
376,
264,
9092,
13,
13,
13,
1990,
17714,
29943,
21662,
1001,
29907,
10242,
5592,
1241,
29898,
1557,
336,
2272,
29889,
5592,
1241,
29892,
16417,
1125,
13,
1678,
9995,
13,
1678,
6325,
344,
29349,
1358,
363,
5952,
1082,
382,
10936,
8970,
7756,
2872,
13,
1678,
9995,
13,
1678,
1024,
353,
376,
354,
29899,
3735,
29899,
29883,
29781,
29908,
13,
1678,
2888,
29918,
11027,
353,
426,
13,
4706,
525,
16359,
3352,
29918,
15551,
2396,
10802,
22168,
1445,
1649,
467,
3560,
29889,
23552,
2141,
7122,
2084,
29898,
13,
9651,
285,
29915,
21546,
21546,
29912,
29907,
4717,
29956,
29931,
4214,
29918,
12015,
12336,
29918,
29943,
5607,
8032,
29913,
354,
29899,
3735,
29918,
29883,
29781,
648,
29979,
26441,
1836,
3126,
2824,
294,
29918,
5338,
580,
13,
1678,
500,
13,
13,
1678,
822,
1369,
29918,
24830,
29898,
1311,
1125,
13,
13,
4706,
21888,
353,
10518,
29889,
949,
29918,
3126,
29898,
3150,
29898,
8618,
29954,
29918,
14573,
29918,
10145,
29892,
376,
29878,
5783,
3366,
29883,
29781,
3108,
13,
4706,
21888,
29918,
1761,
353,
12705,
29898,
1761,
29898,
842,
29898,
29883,
29781,
29889,
2083,
580,
4961,
13,
13,
4706,
363,
3236,
297,
21888,
29918,
1761,
29901,
13,
9651,
7709,
24559,
2272,
29889,
3089,
29898,
2271,
29922,
25416,
29918,
4219,
29889,
4830,
29898,
15775,
29892,
612,
26441,
511,
13,
462,
462,
6939,
29922,
1311,
29889,
5510,
29918,
434,
29892,
13,
462,
462,
26324,
29918,
19290,
3790,
29908,
434,
29918,
333,
1115,
3236,
1800,
13,
13,
1678,
822,
6088,
29918,
434,
29898,
1311,
29892,
2933,
29892,
318,
29872,
29918,
333,
1125,
13,
4706,
318,
29872,
29918,
978,
353,
2933,
29889,
23635,
703,
458,
29882,
29941,
29914,
726,
580,
2564,
657,
580,
13,
4706,
1629,
353,
2933,
29889,
23635,
703,
458,
29882,
29945,
29961,
29896,
16261,
726,
580,
2564,
657,
2141,
5451,
703,
29901,
1159,
29961,
29896,
1822,
17010,
703,
16521,
13,
4706,
27335,
353,
2933,
29889,
23635,
703,
458,
1594,
29961,
11516,
29898,
726,
3285,
13218,
1666,
29886,
787,
519,
316,
301,
29915,
4462,
29905,
13531,
458,
23031,
292,
1057,
9653,
29961,
29896,
16261,
726,
580,
2564,
657,
497,
580,
13,
4706,
27335,
353,
6796,
11393,
7122,
29898,
371,
11665,
29889,
5451,
703,
376,
9601,
29896,
29901,
2314,
718,
376,
376,
718,
15703,
29889,
5451,
703,
376,
9601,
29900,
29962,
363,
15703,
297,
27335,
29962,
13,
4706,
321,
312,
29879,
353,
2933,
29889,
23635,
703,
458,
1594,
29961,
11516,
29898,
726,
3285,
525,
20647,
2487,
1169,
382,
1783,
29903,
1495,
29962,
458,
23031,
292,
1057,
1110,
29961,
29896,
16261,
726,
580,
2564,
657,
580,
13,
4706,
321,
312,
29879,
353,
938,
29898,
522,
29879,
29889,
17010,
703,
376,
876,
13,
4706,
10276,
353,
2933,
29889,
23635,
703,
458,
1594,
29961,
11516,
29898,
726,
3285,
13218,
29931,
574,
434,
270,
29915,
1947,
647,
882,
634,
270,
29915,
29948,
4387,
362,
29905,
13531,
29908,
13,
462,
462,
259,
376,
458,
23031,
292,
1057,
1110,
29961,
29896,
16261,
726,
580,
2564,
657,
497,
580,
13,
4706,
4086,
353,
518,
29931,
19453,
29965,
10461,
29903,
29918,
4571,
1783,
29961,
11675,
29962,
363,
4086,
297,
10276,
29962,
13,
13,
4706,
2793,
353,
5941,
786,
29898,
5327,
29889,
23635,
703,
458,
29882,
29941,
29961,
11516,
29898,
726,
3285,
525,
29906,
1495,
16261,
23031,
292,
1057,
4563,
17548,
333,
2433,
434,
29918,
3318,
10270,
29918,
17699,
2033,
29961,
29896,
29962,
2564,
657,
3101,
13,
13,
4706,
7709,
8853,
333,
1115,
318,
29872,
29918,
333,
29892,
13,
1669,
376,
978,
1115,
318,
29872,
29918,
978,
29892,
13,
1669,
376,
6360,
1115,
1629,
29892,
13,
1669,
376,
371,
496,
414,
1115,
27335,
29892,
13,
1669,
376,
29880,
8737,
1115,
4086,
29892,
13,
1669,
376,
522,
29879,
1115,
321,
312,
29879,
29892,
13,
1669,
376,
2271,
1115,
2933,
29889,
2271,
29892,
13,
1669,
376,
3051,
1115,
2793,
29913,
13,
2
] |
apps/monitor/views/newsblur_users.py | Paul3MK/NewsBlur | 3,073 | 115326 | <reponame>Paul3MK/NewsBlur
import datetime
from django.contrib.auth.models import User
from django.shortcuts import render
from django.views import View
from apps.profile.models import Profile, RNewUserQueue
class Users(View):
def get(self, request):
last_month = datetime.datetime.utcnow() - datetime.timedelta(days=30)
last_day = datetime.datetime.utcnow() - datetime.timedelta(minutes=60*24)
data = {
'all': User.objects.count(),
'monthly': Profile.objects.filter(last_seen_on__gte=last_month).count(),
'daily': Profile.objects.filter(last_seen_on__gte=last_day).count(),
'premium': Profile.objects.filter(is_premium=True).count(),
'queued': RNewUserQueue.user_count(),
}
chart_name = "users"
chart_type = "counter"
formatted_data = {}
for k, v in data.items():
formatted_data[k] = f'{chart_name}{{category="{k}"}} {v}'
context = {
"data": formatted_data,
"chart_name": chart_name,
"chart_type": chart_type,
}
return render(request, 'monitor/prometheus_data.html', context, content_type="text/plain")
| [
1,
529,
276,
1112,
420,
29958,
18275,
29941,
29924,
29968,
29914,
29328,
10358,
332,
13,
5215,
12865,
13,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
9794,
1053,
4911,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
3166,
9557,
29889,
7406,
1053,
4533,
13,
13,
3166,
11446,
29889,
10185,
29889,
9794,
1053,
20802,
29892,
390,
4373,
2659,
10620,
13,
13,
1990,
23861,
29898,
1043,
1125,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
2009,
1125,
13,
4706,
1833,
29918,
10874,
353,
12865,
29889,
12673,
29889,
329,
29883,
3707,
580,
448,
12865,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29941,
29900,
29897,
13,
4706,
1833,
29918,
3250,
353,
12865,
29889,
12673,
29889,
329,
29883,
3707,
580,
448,
12865,
29889,
9346,
287,
2554,
29898,
1195,
2667,
29922,
29953,
29900,
29930,
29906,
29946,
29897,
13,
13,
4706,
848,
353,
426,
13,
9651,
525,
497,
2396,
4911,
29889,
12650,
29889,
2798,
3285,
13,
9651,
525,
10874,
368,
2396,
20802,
29889,
12650,
29889,
4572,
29898,
4230,
29918,
28026,
29918,
265,
1649,
29887,
371,
29922,
4230,
29918,
10874,
467,
2798,
3285,
13,
9651,
525,
29881,
8683,
2396,
20802,
29889,
12650,
29889,
4572,
29898,
4230,
29918,
28026,
29918,
265,
1649,
29887,
371,
29922,
4230,
29918,
3250,
467,
2798,
3285,
13,
9651,
525,
1457,
29885,
1974,
2396,
20802,
29889,
12650,
29889,
4572,
29898,
275,
29918,
1457,
29885,
1974,
29922,
5574,
467,
2798,
3285,
13,
9651,
525,
802,
6742,
2396,
390,
4373,
2659,
10620,
29889,
1792,
29918,
2798,
3285,
13,
4706,
500,
13,
4706,
8727,
29918,
978,
353,
376,
7193,
29908,
13,
4706,
8727,
29918,
1853,
353,
376,
11808,
29908,
13,
13,
4706,
20917,
29918,
1272,
353,
6571,
13,
4706,
363,
413,
29892,
325,
297,
848,
29889,
7076,
7295,
13,
9651,
20917,
29918,
1272,
29961,
29895,
29962,
353,
285,
29915,
29912,
15425,
29918,
978,
1157,
29912,
7320,
10724,
29895,
5038,
930,
426,
29894,
10162,
13,
4706,
3030,
353,
426,
13,
9651,
376,
1272,
1115,
20917,
29918,
1272,
29892,
13,
9651,
376,
15425,
29918,
978,
1115,
8727,
29918,
978,
29892,
13,
9651,
376,
15425,
29918,
1853,
1115,
8727,
29918,
1853,
29892,
13,
4706,
500,
13,
4706,
736,
4050,
29898,
3827,
29892,
525,
3712,
2105,
29914,
14032,
23043,
375,
29918,
1272,
29889,
1420,
742,
3030,
29892,
2793,
29918,
1853,
543,
726,
29914,
24595,
1159,
13,
13,
2
] |
doc2cube-master/caseolap/utils.py | sustcjudgement/Judgement_information_extraction | 1 | 199045 | from pandas import DataFrame as DF
import codecs
from pandas import to_datetime
class Hierarchy:
def __init__(self):
self.nid = {} # node name -> id
self.ind = {} # node id -> name
self.idd = {} # parent -> [node id]
self.ipd = {} # node id -> [parent id]
def load_data(data_file):
df = DF.from_csv(data_file)
columns = list(df.columns.values)
if 'Date' in columns:
df['Date'] = to_datetime(df['Date'])
return df
def load_simple_hier(hier_file):
hier = Hierarchy()
with open(hier_file) as hf:
for line in hf:
arr = line.strip().split("\t")
hid = int(arr[0])
phid = int(arr[1])
att_value = arr[2]
hier.nid[att_value] = hid
hier.ind[hid] = att_value
if phid not in hier.idd:
hier.idd[phid] = []
hier.ipd[phid] = []
if hid not in hier.idd:
hier.idd[hid] = []
hier.ipd[hid] = []
hier.idd[phid].append(hid)
hier.ipd[hid].append(phid)
return hier
def load_hier(dim_hier_dict):
'''
1. should return a hier relations as a dict
key must be attributes in data table
hier['location'] = hier_dict
2. the values of hier_dict are all the
descendants of the key, including itself.
3. hier_dict should contain all the possible
values of a specific type
hier_dict[101]=[1,2,3..]
'''
hiers = {}
for dim, file_name in dim_hier_dict.items():
hier = load_simple_hier(file_name)
hiers[dim] = hier
return hiers
def get_all_legal_vals(hier, val):
'''
Get all children of current hierarchy node
'''
def helper(cur_val):
if cur_val in all_legal_dict:
return
all_legal_dict[cur_val] = 1
for ch_val in hier.idd[cur_val]:
helper(ch_val)
all_legal_dict = {}
helper(val)
return all_legal_dict
def get_all_ancestors(hier, val):
'''
Get all ancestors of current node
'''
all_legal_list = [val]
while val in hier.ipd and len(hier.ipd[val]) > 0:
val = hier.ipd[val][0]
all_legal_list.append(val)
return all_legal_list
def get_direct_parent(hier, val):
result = None
if len(hier.ipd[val]) > 0:
result = hier.ipd[val][0]
return result
def get_siblings(hier_dict, val):
pass
def load_simple_measure(data_file):
doc_phrase_measure = {}
with codecs.open(data_file, "r", encoding="utf-8") as df:
for line in df:
arr = line.strip().split(':')
doc_index = int(arr[0])
doc_phrase_measure[doc_index] = {}
for phrase_measure in arr[1].strip().split(','):
ph_me_arr = phrase_measure.strip().split('|')
if len(ph_me_arr) < 2:
continue
phrase = ph_me_arr[0]
measure = float(ph_me_arr[1])
doc_phrase_measure[doc_index][phrase] = measure
return doc_phrase_measure
| [
1,
515,
11701,
1053,
3630,
4308,
408,
360,
29943,
13,
5215,
775,
2395,
13,
3166,
11701,
1053,
304,
29918,
12673,
13,
13,
1990,
12433,
12040,
29901,
13,
13,
12,
1753,
4770,
2344,
12035,
1311,
1125,
13,
12,
12,
1311,
29889,
29876,
333,
353,
6571,
12,
12,
29937,
2943,
1024,
1599,
1178,
13,
12,
12,
1311,
29889,
513,
353,
6571,
12,
12,
29937,
2943,
1178,
1599,
1024,
13,
12,
12,
1311,
29889,
2205,
353,
6571,
12,
12,
29937,
3847,
1599,
518,
3177,
1178,
29962,
13,
12,
12,
1311,
29889,
666,
29881,
353,
6571,
12,
12,
29937,
2943,
1178,
1599,
518,
3560,
1178,
29962,
13,
13,
13,
1753,
2254,
29918,
1272,
29898,
1272,
29918,
1445,
1125,
13,
12,
2176,
353,
360,
29943,
29889,
3166,
29918,
7638,
29898,
1272,
29918,
1445,
29897,
13,
12,
13099,
353,
1051,
29898,
2176,
29889,
13099,
29889,
5975,
29897,
13,
12,
361,
525,
2539,
29915,
297,
4341,
29901,
13,
12,
12,
2176,
1839,
2539,
2033,
353,
304,
29918,
12673,
29898,
2176,
1839,
2539,
11287,
13,
13,
12,
2457,
4489,
13,
13,
1753,
2254,
29918,
12857,
29918,
29882,
631,
29898,
29882,
631,
29918,
1445,
1125,
13,
12,
29882,
631,
353,
12433,
12040,
580,
13,
12,
2541,
1722,
29898,
29882,
631,
29918,
1445,
29897,
408,
298,
29888,
29901,
13,
12,
12,
1454,
1196,
297,
298,
29888,
29901,
13,
12,
12,
12,
2749,
353,
1196,
29889,
17010,
2141,
5451,
14182,
29873,
1159,
13,
12,
12,
12,
29882,
333,
353,
938,
29898,
2749,
29961,
29900,
2314,
13,
12,
12,
12,
561,
333,
353,
938,
29898,
2749,
29961,
29896,
2314,
13,
12,
12,
12,
1131,
29918,
1767,
353,
3948,
29961,
29906,
29962,
13,
13,
12,
12,
12,
29882,
631,
29889,
29876,
333,
29961,
1131,
29918,
1767,
29962,
353,
20552,
13,
12,
12,
12,
29882,
631,
29889,
513,
29961,
29882,
333,
29962,
353,
1098,
29918,
1767,
13,
12,
12,
12,
361,
1374,
333,
451,
297,
6128,
29889,
2205,
29901,
13,
12,
12,
12,
12,
29882,
631,
29889,
2205,
29961,
561,
333,
29962,
353,
5159,
13,
12,
12,
12,
12,
29882,
631,
29889,
666,
29881,
29961,
561,
333,
29962,
353,
5159,
13,
12,
12,
12,
361,
20552,
451,
297,
6128,
29889,
2205,
29901,
13,
12,
12,
12,
12,
29882,
631,
29889,
2205,
29961,
29882,
333,
29962,
353,
5159,
13,
12,
12,
12,
12,
29882,
631,
29889,
666,
29881,
29961,
29882,
333,
29962,
353,
5159,
13,
12,
12,
12,
29882,
631,
29889,
2205,
29961,
561,
333,
1822,
4397,
29898,
29882,
333,
29897,
13,
12,
12,
12,
29882,
631,
29889,
666,
29881,
29961,
29882,
333,
1822,
4397,
29898,
561,
333,
29897,
13,
13,
12,
2457,
6128,
13,
13,
13,
1753,
2254,
29918,
29882,
631,
29898,
6229,
29918,
29882,
631,
29918,
8977,
1125,
13,
12,
12008,
13,
12,
29896,
29889,
881,
736,
263,
6128,
5302,
408,
263,
9657,
13,
12,
1989,
1818,
367,
8393,
297,
848,
1591,
13,
12,
29882,
631,
1839,
5479,
2033,
353,
6128,
29918,
8977,
13,
12,
29906,
29889,
278,
1819,
310,
6128,
29918,
8977,
526,
599,
278,
13,
12,
14273,
355,
1934,
310,
278,
1820,
29892,
3704,
3528,
29889,
13,
12,
29941,
29889,
6128,
29918,
8977,
881,
1712,
599,
278,
1950,
13,
12,
5975,
310,
263,
2702,
1134,
13,
12,
29882,
631,
29918,
8977,
29961,
29896,
29900,
29896,
29962,
11759,
29896,
29892,
29906,
29892,
29941,
636,
29962,
13,
12,
12008,
13,
12,
2918,
414,
353,
6571,
13,
12,
1454,
3964,
29892,
934,
29918,
978,
297,
3964,
29918,
29882,
631,
29918,
8977,
29889,
7076,
7295,
13,
12,
12,
29882,
631,
353,
2254,
29918,
12857,
29918,
29882,
631,
29898,
1445,
29918,
978,
29897,
13,
12,
12,
2918,
414,
29961,
6229,
29962,
353,
6128,
13,
13,
12,
2457,
298,
4285,
13,
13,
1753,
679,
29918,
497,
29918,
12018,
29918,
791,
29879,
29898,
29882,
631,
29892,
659,
1125,
13,
12,
12008,
13,
12,
2577,
599,
4344,
310,
1857,
21277,
2943,
13,
12,
12008,
13,
12,
1753,
16876,
29898,
2764,
29918,
791,
1125,
13,
12,
12,
361,
3151,
29918,
791,
297,
599,
29918,
12018,
29918,
8977,
29901,
13,
12,
12,
12,
2457,
13,
12,
12,
497,
29918,
12018,
29918,
8977,
29961,
2764,
29918,
791,
29962,
353,
29871,
29896,
13,
13,
12,
12,
1454,
521,
29918,
791,
297,
6128,
29889,
2205,
29961,
2764,
29918,
791,
5387,
13,
12,
12,
12,
20907,
29898,
305,
29918,
791,
29897,
13,
13,
12,
497,
29918,
12018,
29918,
8977,
353,
6571,
13,
12,
20907,
29898,
791,
29897,
13,
13,
12,
2457,
599,
29918,
12018,
29918,
8977,
13,
13,
13,
1753,
679,
29918,
497,
29918,
4564,
342,
943,
29898,
29882,
631,
29892,
659,
1125,
13,
12,
12008,
13,
12,
2577,
599,
19525,
943,
310,
1857,
2943,
13,
12,
12008,
13,
12,
497,
29918,
12018,
29918,
1761,
353,
518,
791,
29962,
13,
12,
8000,
659,
297,
6128,
29889,
666,
29881,
322,
7431,
29898,
29882,
631,
29889,
666,
29881,
29961,
791,
2314,
1405,
29871,
29900,
29901,
13,
12,
12,
791,
353,
6128,
29889,
666,
29881,
29961,
791,
3816,
29900,
29962,
13,
12,
12,
497,
29918,
12018,
29918,
1761,
29889,
4397,
29898,
791,
29897,
13,
13,
12,
2457,
599,
29918,
12018,
29918,
1761,
13,
13,
1753,
679,
29918,
11851,
29918,
3560,
29898,
29882,
631,
29892,
659,
1125,
13,
12,
2914,
353,
6213,
13,
12,
361,
7431,
29898,
29882,
631,
29889,
666,
29881,
29961,
791,
2314,
1405,
29871,
29900,
29901,
13,
12,
12,
2914,
353,
6128,
29889,
666,
29881,
29961,
791,
3816,
29900,
29962,
13,
12,
2457,
1121,
13,
13,
13,
1753,
679,
29918,
29879,
747,
18964,
29898,
29882,
631,
29918,
8977,
29892,
659,
1125,
13,
12,
3364,
12,
13,
13,
1753,
2254,
29918,
12857,
29918,
26658,
29898,
1272,
29918,
1445,
1125,
13,
12,
1514,
29918,
24588,
559,
29918,
26658,
353,
6571,
13,
12,
2541,
775,
2395,
29889,
3150,
29898,
1272,
29918,
1445,
29892,
376,
29878,
613,
8025,
543,
9420,
29899,
29947,
1159,
408,
4489,
29901,
13,
12,
12,
1454,
1196,
297,
4489,
29901,
13,
12,
12,
12,
2749,
353,
1196,
29889,
17010,
2141,
5451,
877,
29901,
1495,
13,
12,
12,
12,
1514,
29918,
2248,
353,
938,
29898,
2749,
29961,
29900,
2314,
13,
12,
12,
12,
1514,
29918,
24588,
559,
29918,
26658,
29961,
1514,
29918,
2248,
29962,
353,
6571,
13,
12,
12,
12,
1454,
16549,
29918,
26658,
297,
3948,
29961,
29896,
1822,
17010,
2141,
5451,
29898,
3788,
1125,
13,
12,
12,
12,
12,
561,
29918,
1004,
29918,
2749,
353,
16549,
29918,
26658,
29889,
17010,
2141,
5451,
877,
29989,
1495,
13,
12,
12,
12,
12,
361,
7431,
29898,
561,
29918,
1004,
29918,
2749,
29897,
529,
29871,
29906,
29901,
13,
12,
12,
12,
12,
12,
19878,
13,
12,
12,
12,
12,
24588,
559,
353,
1374,
29918,
1004,
29918,
2749,
29961,
29900,
29962,
13,
12,
12,
12,
12,
26658,
353,
5785,
29898,
561,
29918,
1004,
29918,
2749,
29961,
29896,
2314,
13,
13,
12,
12,
12,
12,
1514,
29918,
24588,
559,
29918,
26658,
29961,
1514,
29918,
2248,
3816,
24588,
559,
29962,
353,
5645,
13,
13,
12,
2457,
1574,
29918,
24588,
559,
29918,
26658,
13,
2
] |
BMI Calculator/main.py | mrif449/Python-GUI-Projects | 0 | 135402 | from operator import le
import tkinter as tr
from tkinter import messagebox
default_font = "Arial Rounded MT"
font_size = 12
button_color = "white"
root = tr.Tk()
root.title("BMI Calculator")
def Calculate():
try:
weight = float(entry_weight.get())
height = float(entry_height.get())
result = round(weight/(height**2),2)
label_result["text"] = f"BMI: {result}"
button_calcucate["text"] = "Reset"
button_calcucate["command"] = Reset
button_calcucate["bg"] = "#ed2939"
except:
tr.messagebox.showwarning(title="Failed",message="Entry is blank!!!")
def Reset():
entry_height.delete(0,tr.END)
entry_weight.delete(0,tr.END)
label_result["text"] = "BMI: "
button_calcucate["text"] = "Calculate"
button_calcucate["command"] = Calculate
button_calcucate["bg"] = "#29c5f6"
label_weight = tr.Label(root, text="Weight (KG): ")
label_weight.grid(column=0, row=0)
entry_weight = tr.Entry(root)
entry_weight.grid(column=1, row=0)
label_height = tr.Label(root, text="Height (m): ")
label_height.grid(column=0, row=1)
entry_height = tr.Entry(root)
entry_height.grid(column=1, row=1)
button_calcucate = tr.Button(root,text="Caculate",command=Calculate, bg="#29c5f6", fg=button_color, font=(default_font,font_size))
button_calcucate.grid(column=0, row=2)
label_result = tr.Label(root, text="BMI: ")
label_result.grid(column=1, row=2) | [
1,
515,
5455,
1053,
454,
30004,
13,
5215,
18883,
1639,
408,
534,
30004,
13,
3166,
18883,
1639,
1053,
2643,
1884,
30004,
13,
30004,
13,
4381,
29918,
5657,
353,
376,
29909,
9315,
390,
7261,
341,
29911,
19451,
13,
5657,
29918,
2311,
353,
29871,
29896,
29906,
30004,
13,
3092,
29918,
2780,
353,
376,
10921,
19451,
13,
30004,
13,
4632,
353,
534,
29889,
29911,
29895,
26471,
13,
4632,
29889,
3257,
703,
29933,
10403,
20535,
1061,
1159,
30004,
13,
30004,
13,
1753,
20535,
403,
7295,
30004,
13,
1678,
1018,
29901,
30004,
13,
4706,
7688,
353,
5785,
29898,
8269,
29918,
7915,
29889,
657,
3101,
30004,
13,
4706,
3171,
353,
5785,
29898,
8269,
29918,
3545,
29889,
657,
3101,
30004,
13,
4706,
1121,
353,
4513,
29898,
7915,
14571,
3545,
1068,
29906,
511,
29906,
8443,
13,
4706,
3858,
29918,
2914,
3366,
726,
3108,
353,
285,
29908,
29933,
10403,
29901,
426,
2914,
5038,
30004,
13,
4706,
2826,
29918,
28667,
1682,
403,
3366,
726,
3108,
353,
376,
27175,
19451,
13,
4706,
2826,
29918,
28667,
1682,
403,
3366,
6519,
3108,
353,
2538,
300,
30004,
13,
4706,
2826,
29918,
28667,
1682,
403,
3366,
16264,
3108,
353,
12305,
287,
29906,
29929,
29941,
29929,
19451,
13,
1678,
5174,
29901,
30004,
13,
4706,
534,
29889,
4906,
1884,
29889,
4294,
27392,
29898,
3257,
543,
17776,
613,
4906,
543,
9634,
338,
9654,
21004,
1159,
30004,
13,
1753,
2538,
300,
7295,
30004,
13,
1678,
6251,
29918,
3545,
29889,
8143,
29898,
29900,
29892,
509,
29889,
11794,
8443,
13,
1678,
6251,
29918,
7915,
29889,
8143,
29898,
29900,
29892,
509,
29889,
11794,
8443,
13,
1678,
3858,
29918,
2914,
3366,
726,
3108,
353,
376,
29933,
10403,
29901,
376,
30004,
13,
1678,
2826,
29918,
28667,
1682,
403,
3366,
726,
3108,
353,
376,
27065,
403,
19451,
13,
1678,
2826,
29918,
28667,
1682,
403,
3366,
6519,
3108,
353,
20535,
403,
30004,
13,
1678,
2826,
29918,
28667,
1682,
403,
3366,
16264,
3108,
353,
12305,
29906,
29929,
29883,
29945,
29888,
29953,
19451,
13,
1643,
29918,
7915,
353,
534,
29889,
4775,
29898,
4632,
29892,
1426,
543,
22676,
313,
29968,
29954,
1125,
376,
8443,
13,
1643,
29918,
7915,
29889,
7720,
29898,
4914,
29922,
29900,
29892,
1948,
29922,
29900,
8443,
13,
8269,
29918,
7915,
353,
534,
29889,
9634,
29898,
4632,
8443,
13,
8269,
29918,
7915,
29889,
7720,
29898,
4914,
29922,
29896,
29892,
1948,
29922,
29900,
8443,
13,
1643,
29918,
3545,
353,
534,
29889,
4775,
29898,
4632,
29892,
1426,
543,
7011,
313,
29885,
1125,
376,
8443,
13,
1643,
29918,
3545,
29889,
7720,
29898,
4914,
29922,
29900,
29892,
1948,
29922,
29896,
8443,
13,
8269,
29918,
3545,
353,
534,
29889,
9634,
29898,
4632,
8443,
13,
8269,
29918,
3545,
29889,
7720,
29898,
4914,
29922,
29896,
29892,
1948,
29922,
29896,
8443,
13,
30004,
13,
3092,
29918,
28667,
1682,
403,
353,
534,
29889,
3125,
29898,
4632,
29892,
726,
543,
29907,
562,
5987,
613,
6519,
29922,
27065,
403,
29892,
25989,
9880,
29906,
29929,
29883,
29945,
29888,
29953,
613,
285,
29887,
29922,
3092,
29918,
2780,
29892,
4079,
7607,
4381,
29918,
5657,
29892,
5657,
29918,
2311,
876,
30004,
13,
3092,
29918,
28667,
1682,
403,
29889,
7720,
29898,
4914,
29922,
29900,
29892,
1948,
29922,
29906,
8443,
13,
1643,
29918,
2914,
353,
534,
29889,
4775,
29898,
4632,
29892,
1426,
543,
29933,
10403,
29901,
376,
8443,
13,
1643,
29918,
2914,
29889,
7720,
29898,
4914,
29922,
29896,
29892,
1948,
29922,
29906,
29897,
2
] |
src/morphocut/contrib/ecotaxa.py | ammark100/morphocut | 0 | 54141 | <filename>src/morphocut/contrib/ecotaxa.py
"""
Read and write EcoTaxa archives.
"`EcoTaxa`_ is a web application dedicated to the visual exploration
and the taxonomic annotation of images that illustrate the
beauty of planktonic biodiversity."
.. _EcoTaxa: https://ecotaxa.obs-vlfr.fr/
"""
import fnmatch
import io
import os.path
import zipfile
from typing import Mapping, Tuple, TypeVar, Union, List
import numpy as np
import PIL.Image
from morphocut import Node, Output, RawOrVariable, ReturnOutputs, closing_if_closable
from morphocut._optional import import_optional_dependency
T = TypeVar("T")
MaybeTuple = Union[T, Tuple[T]]
MaybeList = Union[T, List[T]]
def dtype_to_ecotaxa(dtype):
try:
if np.issubdtype(dtype, np.number):
return "[f]"
except TypeError:
print(type(dtype))
raise
return "[t]"
@ReturnOutputs
class EcotaxaWriter(Node):
"""
Create an archive of images and metadata that is importable to EcoTaxa.
Args:
archive_fn (str): Location of the output file.
fnames_images (Tuple, Variable, or a list thereof):
Tuple of ``(filename, image)`` or a list of such tuples.
``filename`` is the name in the archive. ``image`` is a NumPy array.
The file extension has to be one of ``".jpg"``, ``".png"`` or ``".gif"``
to meet the specifications of EcoTaxa.
meta (Mapping or Variable): Metadata to store in the TSV file.
meta_fn (str, optional): TSV file. Must start with ``ecotaxa``.
store_types (bool, optional): Whether to add a row with types after the header.
Defaults to `True`, according to EcoTaxa's specifications.
If multiple images are provided, ``image`` and
``image_name`` must be tuples of the same length.
The TSV file will have the following columns by default:
- ``img_file_name``: Name of the image file (including extension)
- ``img_rank``: Rank of image to be displayed. Starts at 1.
Other columns are read from ``meta``.
Example:
.. code-block:: python
with Pipeline() as pipeline:
image_fn = ...
image = ImageReader(image_fn)
meta = ... # Calculate some meta-data
EcotaxaWriter("path/to/archive.zip", (image_fn, image), meta)
pipeline.transform_stream()
"""
def __init__(
self,
archive_fn: str,
fnames_images: MaybeList[RawOrVariable[Tuple[str, ...]]],
meta: RawOrVariable[Mapping],
meta_fn: str = "ecotaxa_export.tsv",
store_types: bool = True,
):
super().__init__()
self.archive_fn = archive_fn
if isinstance(fnames_images, tuple):
fnames_images = [fnames_images]
if not isinstance(fnames_images, list):
raise ValueError(
"Unexpected type for fnames_images: needs to be a tuple or a list of tuples"
)
self.fnames_images = fnames_images
self.meta = meta
self.meta_fn = meta_fn
self.store_types = store_types
self._pd = import_optional_dependency("pandas")
def transform_stream(self, stream):
pil_extensions = PIL.Image.registered_extensions()
with closing_if_closable(stream), zipfile.ZipFile(
self.archive_fn, mode="w"
) as zip_file:
dataframe = []
i = 0
for obj in stream:
fnames_images, meta = self.prepare_input(obj, ("fnames_images", "meta"))
for img_rank, (fname, img) in enumerate(fnames_images, start=1):
img_ext = os.path.splitext(fname)[1]
pil_format = pil_extensions[img_ext]
img = PIL.Image.fromarray(img)
img_fp = io.BytesIO()
img.save(img_fp, format=pil_format)
zip_file.writestr(fname, img_fp.getvalue())
dataframe.append(
{**meta, "img_file_name": fname, "img_rank": img_rank}
)
yield obj
i += 1
dataframe = self._pd.DataFrame(dataframe)
# Insert types into header
type_header = [dtype_to_ecotaxa(dt) for dt in dataframe.dtypes]
dataframe.columns = self._pd.MultiIndex.from_tuples(
list(zip(dataframe.columns, type_header))
)
zip_file.writestr(
self.meta_fn, dataframe.to_csv(sep="\t", encoding="utf-8", index=False)
)
print("Wrote {:,d} objects to {}.".format(i, self.archive_fn))
@ReturnOutputs
@Output("image")
@Output("meta")
class EcotaxaReader(Node):
"""
|stream| Read an archive of images and metadata that is importable to EcoTaxa.
Args:
archive_fn (str, Variable): Location of the archive file.
img_rank (int, Variable, or a tuple thereof, optional): One or more image ranks.
Returns:
(image, meta): A tuple of image(s) and metadata.
To read multiple image ranks, provide a tuple of ints as ``img_rank``.
The first output will then be a tuple of images.
The TSV file needs at least an ``img_file_name``
column that provides the name of the image file.
Other columns are read from ``meta``.
The TSV file MAY contain a row of types after the header
(``"[f]"`` for numeric columns, ``"[t]"`` else).
Example:
.. code-block:: python
with Pipeline() as p:
image, meta = EcotaxaReader("path/to/archive.zip")
p.transform_stream()
"""
def __init__(
self,
archive_fn: RawOrVariable[str],
img_rank: MaybeTuple[RawOrVariable[int]] = 1,
):
super().__init__()
self.archive_fn = archive_fn
self.img_rank = img_rank
self._pd = import_optional_dependency("pandas")
def transform_stream(self, stream):
with closing_if_closable(stream):
for obj in stream:
archive_fn, img_rank = self.prepare_input(
obj, ("archive_fn", "img_rank")
)
with zipfile.ZipFile(archive_fn, mode="r") as zip_file:
index_names = fnmatch.filter(zip_file.namelist(), "ecotaxa_*")
for index_name in index_names:
index_base = os.path.dirname(index_name)
with zip_file.open(index_name) as index_fp:
dataframe = self._pd.read_csv(index_fp, sep="\t")
dataframe = self._fix_types(dataframe)
for _, row in dataframe.iterrows():
image_fn = os.path.join(
index_base, row["img_file_name"]
)
with zip_file.open(image_fn) as image_fp:
image = np.array(PIL.Image.open(image_fp))
yield self.prepare_output(
obj.copy(), image, row.to_dict()
)
def _fix_types(self, dataframe):
first_row = dataframe.iloc[0]
num_cols = []
for c, v in first_row.items():
if v == "[f]":
num_cols.append(c)
elif v == "[t]":
continue
else:
# If the first row contains other values than [f] or [t],
# it is not a type header and the dataframe doesn't need to be changed.
return dataframe
dataframe = dataframe.iloc[1:].copy()
dataframe[num_cols] = dataframe[num_cols].apply(
self._pd.to_numeric, errors="coerce", axis=1
)
return dataframe
| [
1,
529,
9507,
29958,
4351,
29914,
29885,
5676,
542,
329,
29914,
21570,
29914,
687,
327,
1165,
29874,
29889,
2272,
13,
15945,
29908,
13,
6359,
322,
2436,
382,
1111,
29911,
1165,
29874,
3190,
3145,
29889,
13,
13,
1678,
29724,
29923,
1111,
29911,
1165,
29874,
29952,
29918,
338,
263,
1856,
2280,
16955,
304,
278,
7604,
3902,
12418,
13,
1678,
322,
278,
8818,
4917,
293,
17195,
310,
4558,
393,
28475,
278,
13,
1678,
15409,
310,
715,
804,
880,
293,
289,
2660,
24974,
1213,
13,
13,
636,
903,
29923,
1111,
29911,
1165,
29874,
29901,
2045,
597,
687,
327,
1165,
29874,
29889,
26290,
29899,
20901,
1341,
29889,
1341,
29914,
13,
15945,
29908,
13,
5215,
7876,
4352,
13,
5215,
12013,
13,
5215,
2897,
29889,
2084,
13,
5215,
14319,
1445,
13,
3166,
19229,
1053,
341,
20304,
29892,
12603,
552,
29892,
5167,
9037,
29892,
7761,
29892,
2391,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
349,
6227,
29889,
2940,
13,
13,
3166,
18131,
542,
329,
1053,
9071,
29892,
10604,
29892,
22038,
2816,
16174,
29892,
7106,
6466,
29879,
29892,
14382,
29918,
361,
29918,
11291,
519,
13,
3166,
18131,
542,
329,
3032,
25253,
1053,
1053,
29918,
25253,
29918,
10836,
13,
13,
29911,
353,
5167,
9037,
703,
29911,
1159,
13,
22762,
23215,
552,
353,
7761,
29961,
29911,
29892,
12603,
552,
29961,
29911,
5262,
13,
22762,
1293,
353,
7761,
29961,
29911,
29892,
2391,
29961,
29911,
5262,
13,
13,
13,
1753,
26688,
29918,
517,
29918,
687,
327,
1165,
29874,
29898,
29881,
1853,
1125,
13,
1678,
1018,
29901,
13,
4706,
565,
7442,
29889,
790,
431,
29881,
1853,
29898,
29881,
1853,
29892,
7442,
29889,
4537,
1125,
13,
9651,
736,
14704,
29888,
18017,
13,
1678,
5174,
20948,
29901,
13,
4706,
1596,
29898,
1853,
29898,
29881,
1853,
876,
13,
4706,
12020,
13,
13,
1678,
736,
14704,
29873,
18017,
13,
13,
13,
29992,
11609,
6466,
29879,
13,
1990,
382,
26235,
1165,
29874,
10507,
29898,
4247,
1125,
13,
1678,
9995,
13,
1678,
6204,
385,
18871,
310,
4558,
322,
15562,
393,
338,
1053,
519,
304,
382,
1111,
29911,
1165,
29874,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
18871,
29918,
9144,
313,
710,
1125,
17015,
310,
278,
1962,
934,
29889,
13,
4706,
285,
7039,
29918,
8346,
313,
23215,
552,
29892,
28736,
29892,
470,
263,
1051,
727,
974,
1125,
13,
9651,
12603,
552,
310,
4954,
29898,
9507,
29892,
1967,
3569,
29952,
470,
263,
1051,
310,
1316,
5291,
2701,
29889,
13,
9651,
4954,
9507,
16159,
338,
278,
1024,
297,
278,
18871,
29889,
4954,
3027,
16159,
338,
263,
11848,
19737,
1409,
29889,
13,
9651,
450,
934,
6081,
756,
304,
367,
697,
310,
4954,
1642,
6173,
6937,
1673,
4954,
1642,
2732,
6937,
29952,
470,
4954,
1642,
18660,
6937,
29952,
13,
9651,
304,
5870,
278,
2702,
800,
310,
382,
1111,
29911,
1165,
29874,
29889,
13,
4706,
12700,
313,
15845,
470,
28736,
1125,
4737,
7221,
304,
3787,
297,
278,
323,
7597,
934,
29889,
13,
4706,
12700,
29918,
9144,
313,
710,
29892,
13136,
1125,
323,
7597,
934,
29889,
19928,
1369,
411,
4954,
687,
327,
1165,
29874,
29952,
1412,
13,
4706,
3787,
29918,
8768,
313,
11227,
29892,
13136,
1125,
26460,
304,
788,
263,
1948,
411,
4072,
1156,
278,
4839,
29889,
13,
9651,
13109,
29879,
304,
421,
5574,
1673,
5034,
304,
382,
1111,
29911,
1165,
29874,
29915,
29879,
2702,
800,
29889,
13,
13,
1678,
960,
2999,
4558,
526,
4944,
29892,
4954,
3027,
16159,
322,
13,
1678,
4954,
3027,
29918,
978,
16159,
1818,
367,
5291,
2701,
310,
278,
1021,
3309,
29889,
13,
13,
1678,
450,
323,
7597,
934,
674,
505,
278,
1494,
4341,
491,
2322,
29901,
13,
13,
1678,
448,
4954,
2492,
29918,
1445,
29918,
978,
29952,
6998,
4408,
310,
278,
1967,
934,
313,
18271,
6081,
29897,
13,
1678,
448,
4954,
2492,
29918,
10003,
29952,
6998,
22125,
310,
1967,
304,
367,
8833,
29889,
624,
5708,
472,
29871,
29896,
29889,
13,
13,
1678,
5901,
4341,
526,
1303,
515,
4954,
7299,
29952,
1412,
13,
13,
1678,
8741,
29901,
13,
4706,
6317,
775,
29899,
1271,
1057,
3017,
13,
13,
9651,
411,
349,
23828,
580,
408,
16439,
29901,
13,
18884,
1967,
29918,
9144,
353,
2023,
13,
18884,
1967,
353,
7084,
6982,
29898,
3027,
29918,
9144,
29897,
13,
18884,
12700,
353,
2023,
396,
20535,
403,
777,
12700,
29899,
1272,
13,
18884,
382,
26235,
1165,
29874,
10507,
703,
2084,
29914,
517,
29914,
10867,
29889,
7554,
613,
313,
3027,
29918,
9144,
29892,
1967,
511,
12700,
29897,
13,
9651,
16439,
29889,
9067,
29918,
5461,
580,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
18871,
29918,
9144,
29901,
851,
29892,
13,
4706,
285,
7039,
29918,
8346,
29901,
7198,
1293,
29961,
22131,
2816,
16174,
29961,
23215,
552,
29961,
710,
29892,
2023,
5262,
1402,
13,
4706,
12700,
29901,
22038,
2816,
16174,
29961,
15845,
1402,
13,
4706,
12700,
29918,
9144,
29901,
851,
353,
376,
687,
327,
1165,
29874,
29918,
15843,
29889,
1372,
29894,
613,
13,
4706,
3787,
29918,
8768,
29901,
6120,
353,
5852,
29892,
13,
268,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
10867,
29918,
9144,
353,
18871,
29918,
9144,
13,
13,
4706,
565,
338,
8758,
29898,
29888,
7039,
29918,
8346,
29892,
18761,
1125,
13,
9651,
285,
7039,
29918,
8346,
353,
518,
29888,
7039,
29918,
8346,
29962,
13,
13,
4706,
565,
451,
338,
8758,
29898,
29888,
7039,
29918,
8346,
29892,
1051,
1125,
13,
9651,
12020,
7865,
2392,
29898,
13,
18884,
376,
29965,
13996,
6021,
1134,
363,
285,
7039,
29918,
8346,
29901,
4225,
304,
367,
263,
18761,
470,
263,
1051,
310,
5291,
2701,
29908,
13,
9651,
1723,
13,
13,
4706,
1583,
29889,
29888,
7039,
29918,
8346,
353,
285,
7039,
29918,
8346,
13,
4706,
1583,
29889,
7299,
353,
12700,
13,
4706,
1583,
29889,
7299,
29918,
9144,
353,
12700,
29918,
9144,
13,
4706,
1583,
29889,
8899,
29918,
8768,
353,
3787,
29918,
8768,
13,
13,
4706,
1583,
3032,
15926,
353,
1053,
29918,
25253,
29918,
10836,
703,
15112,
1159,
13,
13,
1678,
822,
4327,
29918,
5461,
29898,
1311,
29892,
4840,
1125,
13,
4706,
8230,
29918,
24299,
353,
349,
6227,
29889,
2940,
29889,
9573,
287,
29918,
24299,
580,
13,
13,
4706,
411,
14382,
29918,
361,
29918,
11291,
519,
29898,
5461,
511,
14319,
1445,
29889,
26264,
2283,
29898,
13,
9651,
1583,
29889,
10867,
29918,
9144,
29892,
4464,
543,
29893,
29908,
13,
4706,
1723,
408,
14319,
29918,
1445,
29901,
13,
9651,
12205,
353,
5159,
13,
9651,
474,
353,
29871,
29900,
13,
9651,
363,
5446,
297,
4840,
29901,
13,
18884,
285,
7039,
29918,
8346,
29892,
12700,
353,
1583,
29889,
19125,
29918,
2080,
29898,
5415,
29892,
4852,
29888,
7039,
29918,
8346,
613,
376,
7299,
5783,
13,
13,
18884,
363,
10153,
29918,
10003,
29892,
313,
29888,
978,
29892,
10153,
29897,
297,
26985,
29898,
29888,
7039,
29918,
8346,
29892,
1369,
29922,
29896,
1125,
13,
462,
1678,
10153,
29918,
1062,
353,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
29888,
978,
9601,
29896,
29962,
13,
462,
1678,
8230,
29918,
4830,
353,
8230,
29918,
24299,
29961,
2492,
29918,
1062,
29962,
13,
13,
462,
1678,
10153,
353,
349,
6227,
29889,
2940,
29889,
3166,
2378,
29898,
2492,
29897,
13,
462,
1678,
10153,
29918,
18091,
353,
12013,
29889,
11207,
5971,
580,
13,
462,
1678,
10153,
29889,
7620,
29898,
2492,
29918,
18091,
29892,
3402,
29922,
29886,
309,
29918,
4830,
29897,
13,
13,
462,
1678,
14319,
29918,
1445,
29889,
8231,
16444,
29898,
29888,
978,
29892,
10153,
29918,
18091,
29889,
657,
1767,
3101,
13,
13,
462,
1678,
12205,
29889,
4397,
29898,
13,
462,
4706,
426,
1068,
7299,
29892,
376,
2492,
29918,
1445,
29918,
978,
1115,
285,
978,
29892,
376,
2492,
29918,
10003,
1115,
10153,
29918,
10003,
29913,
13,
462,
1678,
1723,
13,
13,
18884,
7709,
5446,
13,
13,
18884,
474,
4619,
29871,
29896,
13,
13,
9651,
12205,
353,
1583,
3032,
15926,
29889,
17271,
29898,
1272,
2557,
29897,
13,
13,
9651,
396,
24505,
4072,
964,
4839,
13,
9651,
1134,
29918,
6672,
353,
518,
29881,
1853,
29918,
517,
29918,
687,
327,
1165,
29874,
29898,
6008,
29897,
363,
11636,
297,
12205,
29889,
29881,
8768,
29962,
13,
9651,
12205,
29889,
13099,
353,
1583,
3032,
15926,
29889,
15329,
3220,
29889,
3166,
29918,
9161,
2701,
29898,
13,
18884,
1051,
29898,
7554,
29898,
1272,
2557,
29889,
13099,
29892,
1134,
29918,
6672,
876,
13,
9651,
1723,
13,
13,
9651,
14319,
29918,
1445,
29889,
8231,
16444,
29898,
13,
18884,
1583,
29889,
7299,
29918,
9144,
29892,
12205,
29889,
517,
29918,
7638,
29898,
19570,
543,
29905,
29873,
613,
8025,
543,
9420,
29899,
29947,
613,
2380,
29922,
8824,
29897,
13,
9651,
1723,
13,
13,
9651,
1596,
703,
29956,
4859,
12365,
29892,
29881,
29913,
3618,
304,
6571,
1213,
29889,
4830,
29898,
29875,
29892,
1583,
29889,
10867,
29918,
9144,
876,
13,
13,
13,
29992,
11609,
6466,
29879,
13,
29992,
6466,
703,
3027,
1159,
13,
29992,
6466,
703,
7299,
1159,
13,
1990,
382,
26235,
1165,
29874,
6982,
29898,
4247,
1125,
13,
1678,
9995,
13,
1678,
891,
5461,
29989,
7523,
385,
18871,
310,
4558,
322,
15562,
393,
338,
1053,
519,
304,
382,
1111,
29911,
1165,
29874,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
18871,
29918,
9144,
313,
710,
29892,
28736,
1125,
17015,
310,
278,
18871,
934,
29889,
13,
4706,
10153,
29918,
10003,
313,
524,
29892,
28736,
29892,
470,
263,
18761,
727,
974,
29892,
13136,
1125,
3118,
470,
901,
1967,
27871,
29889,
13,
13,
1678,
16969,
29901,
13,
4706,
313,
3027,
29892,
12700,
1125,
319,
18761,
310,
1967,
29898,
29879,
29897,
322,
15562,
29889,
13,
13,
1678,
1763,
1303,
2999,
1967,
27871,
29892,
3867,
263,
18761,
310,
938,
29879,
408,
4954,
2492,
29918,
10003,
29952,
1412,
13,
1678,
450,
937,
1962,
674,
769,
367,
263,
18761,
310,
4558,
29889,
13,
13,
1678,
450,
323,
7597,
934,
4225,
472,
3203,
385,
4954,
2492,
29918,
1445,
29918,
978,
16159,
13,
1678,
1897,
393,
8128,
278,
1024,
310,
278,
1967,
934,
29889,
13,
1678,
5901,
4341,
526,
1303,
515,
4954,
7299,
29952,
1412,
13,
13,
1678,
450,
323,
7597,
934,
14861,
29979,
1712,
263,
1948,
310,
4072,
1156,
278,
4839,
13,
1678,
6695,
29952,
29908,
29961,
29888,
29962,
6937,
29952,
363,
16985,
4341,
29892,
4954,
29908,
29961,
29873,
29962,
6937,
29952,
1683,
467,
13,
13,
1678,
8741,
29901,
13,
4706,
6317,
775,
29899,
1271,
1057,
3017,
13,
13,
9651,
411,
349,
23828,
580,
408,
282,
29901,
13,
18884,
1967,
29892,
12700,
353,
382,
26235,
1165,
29874,
6982,
703,
2084,
29914,
517,
29914,
10867,
29889,
7554,
1159,
13,
9651,
282,
29889,
9067,
29918,
5461,
580,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
18871,
29918,
9144,
29901,
22038,
2816,
16174,
29961,
710,
1402,
13,
4706,
10153,
29918,
10003,
29901,
7198,
23215,
552,
29961,
22131,
2816,
16174,
29961,
524,
5262,
353,
29871,
29896,
29892,
13,
268,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
10867,
29918,
9144,
353,
18871,
29918,
9144,
13,
4706,
1583,
29889,
2492,
29918,
10003,
353,
10153,
29918,
10003,
13,
4706,
1583,
3032,
15926,
353,
1053,
29918,
25253,
29918,
10836,
703,
15112,
1159,
13,
13,
1678,
822,
4327,
29918,
5461,
29898,
1311,
29892,
4840,
1125,
13,
4706,
411,
14382,
29918,
361,
29918,
11291,
519,
29898,
5461,
1125,
13,
9651,
363,
5446,
297,
4840,
29901,
13,
18884,
18871,
29918,
9144,
29892,
10153,
29918,
10003,
353,
1583,
29889,
19125,
29918,
2080,
29898,
13,
462,
1678,
5446,
29892,
4852,
10867,
29918,
9144,
613,
376,
2492,
29918,
10003,
1159,
13,
18884,
1723,
13,
13,
18884,
411,
14319,
1445,
29889,
26264,
2283,
29898,
10867,
29918,
9144,
29892,
4464,
543,
29878,
1159,
408,
14319,
29918,
1445,
29901,
13,
462,
1678,
2380,
29918,
7039,
353,
7876,
4352,
29889,
4572,
29898,
7554,
29918,
1445,
29889,
8588,
295,
391,
3285,
376,
687,
327,
1165,
29874,
24563,
1159,
13,
13,
462,
1678,
363,
2380,
29918,
978,
297,
2380,
29918,
7039,
29901,
13,
462,
4706,
2380,
29918,
3188,
353,
2897,
29889,
2084,
29889,
25721,
29898,
2248,
29918,
978,
29897,
13,
462,
4706,
411,
14319,
29918,
1445,
29889,
3150,
29898,
2248,
29918,
978,
29897,
408,
2380,
29918,
18091,
29901,
13,
462,
9651,
12205,
353,
1583,
3032,
15926,
29889,
949,
29918,
7638,
29898,
2248,
29918,
18091,
29892,
16345,
543,
29905,
29873,
1159,
13,
462,
9651,
12205,
353,
1583,
3032,
5878,
29918,
8768,
29898,
1272,
2557,
29897,
13,
13,
462,
9651,
363,
17117,
1948,
297,
12205,
29889,
1524,
5727,
7295,
13,
462,
18884,
1967,
29918,
9144,
353,
2897,
29889,
2084,
29889,
7122,
29898,
13,
462,
462,
1678,
2380,
29918,
3188,
29892,
1948,
3366,
2492,
29918,
1445,
29918,
978,
3108,
13,
462,
18884,
1723,
13,
13,
462,
18884,
411,
14319,
29918,
1445,
29889,
3150,
29898,
3027,
29918,
9144,
29897,
408,
1967,
29918,
18091,
29901,
13,
462,
462,
1678,
1967,
353,
7442,
29889,
2378,
29898,
2227,
29931,
29889,
2940,
29889,
3150,
29898,
3027,
29918,
18091,
876,
13,
13,
462,
18884,
7709,
1583,
29889,
19125,
29918,
4905,
29898,
13,
462,
462,
1678,
5446,
29889,
8552,
3285,
1967,
29892,
1948,
29889,
517,
29918,
8977,
580,
13,
462,
18884,
1723,
13,
13,
1678,
822,
903,
5878,
29918,
8768,
29898,
1311,
29892,
12205,
1125,
13,
4706,
937,
29918,
798,
353,
12205,
29889,
309,
542,
29961,
29900,
29962,
13,
13,
4706,
954,
29918,
22724,
353,
5159,
13,
4706,
363,
274,
29892,
325,
297,
937,
29918,
798,
29889,
7076,
7295,
13,
9651,
565,
325,
1275,
14704,
29888,
29962,
1115,
13,
18884,
954,
29918,
22724,
29889,
4397,
29898,
29883,
29897,
13,
9651,
25342,
325,
1275,
14704,
29873,
29962,
1115,
13,
18884,
6773,
13,
9651,
1683,
29901,
13,
18884,
396,
960,
278,
937,
1948,
3743,
916,
1819,
1135,
518,
29888,
29962,
470,
518,
29873,
1402,
13,
18884,
396,
372,
338,
451,
263,
1134,
4839,
322,
278,
12205,
1838,
29915,
29873,
817,
304,
367,
3939,
29889,
13,
18884,
736,
12205,
13,
13,
4706,
12205,
353,
12205,
29889,
309,
542,
29961,
29896,
29901,
1822,
8552,
580,
13,
13,
4706,
12205,
29961,
1949,
29918,
22724,
29962,
353,
12205,
29961,
1949,
29918,
22724,
1822,
7302,
29898,
13,
9651,
1583,
3032,
15926,
29889,
517,
29918,
21574,
29892,
4436,
543,
1111,
261,
346,
613,
9685,
29922,
29896,
13,
4706,
1723,
13,
13,
4706,
736,
12205,
13,
2
] |
src/main/python/apache/aurora/executor/common/resource_manager.py | jeremyvdw/aurora | 479 | 80885 | <gh_stars>100-1000
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import threading
from mesos.interface import mesos_pb2
from twitter.common.metrics import LambdaGauge
from apache.aurora.executor.common.status_checker import (
StatusChecker,
StatusCheckerProvider,
StatusResult
)
from apache.aurora.executor.common.task_info import mesos_task_instance_from_assigned_task
from apache.thermos.monitoring.monitor import TaskMonitor
from apache.thermos.monitoring.resource import TaskResourceMonitor
class ResourceManager(StatusChecker):
""" Manage resources consumed by a Task """
def __init__(self, resources, resource_monitor):
"""
resources: Resources object specifying cpu, ram, disk limits for the task
resource_monitor: The ResourceMonitor to monitor resources
"""
self._resource_monitor = resource_monitor
# TODO(wickman) Remove cpu/ram reporting if MESOS-1458 is resolved.
self._max_cpu = resources.cpu().get()
self._max_ram = resources.ram().get()
self._max_disk = resources.disk().get()
self._kill_reason = None
self._kill_event = threading.Event()
@property
def _num_procs(self):
""" Total number of processes the task consists of (including child processes) """
return self._resource_monitor.sample()[1].num_procs
@property
def _ps_sample(self):
""" ProcessSample representing the aggregate resource consumption of the Task's processes """
return self._resource_monitor.sample()[1].process_sample
@property
def _disk_sample(self):
""" Integer in bytes representing the disk consumption in the Task's sandbox """
return self._resource_monitor.sample()[1].disk_usage
@property
def status(self):
sample = self._disk_sample
if sample > self._max_disk:
self._kill_event.set()
return StatusResult('Disk limit exceeded. Reserved %s bytes vs used %s bytes.' % (
self._max_disk, sample), mesos_pb2.TASK_FAILED)
def name(self):
return 'resource_manager'
def register_metrics(self):
self.metrics.register(LambdaGauge('disk_used', lambda: self._disk_sample))
self.metrics.register(LambdaGauge('disk_reserved', lambda: self._max_disk))
self.metrics.register(LambdaGauge('disk_percent',
lambda: 1.0 * self._disk_sample / self._max_disk))
self.metrics.register(LambdaGauge('cpu_used', lambda: self._ps_sample.rate))
self.metrics.register(LambdaGauge('cpu_reserved', lambda: self._max_cpu))
self.metrics.register(LambdaGauge('cpu_percent',
lambda: 1.0 * self._ps_sample.rate / self._max_cpu))
self.metrics.register(LambdaGauge('ram_used', lambda: self._ps_sample.rss))
self.metrics.register(LambdaGauge('ram_reserved', lambda: self._max_ram))
self.metrics.register(LambdaGauge('ram_percent',
lambda: 1.0 * self._ps_sample.rss / self._max_ram))
def start(self):
super(ResourceManager, self).start()
self.register_metrics()
self._resource_monitor.start()
class ResourceManagerProvider(StatusCheckerProvider):
def __init__(self, checkpoint_root, **resource_monitor_options):
self._checkpoint_root = checkpoint_root
self._resource_monitor_options = resource_monitor_options
def from_assigned_task(self, assigned_task, sandbox):
task_id = assigned_task.taskId
resources = mesos_task_instance_from_assigned_task(assigned_task).task().resources()
task_monitor = TaskMonitor(self._checkpoint_root, task_id)
resource_monitor = TaskResourceMonitor(
task_id,
task_monitor,
**self._resource_monitor_options)
return ResourceManager(resources, resource_monitor)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
29937,
13,
13,
5215,
3244,
292,
13,
13,
3166,
4883,
359,
29889,
13248,
1053,
4883,
359,
29918,
24381,
29906,
13,
3166,
23394,
29889,
9435,
29889,
2527,
10817,
1053,
365,
2269,
29954,
585,
479,
13,
13,
3166,
12641,
29889,
6698,
2207,
29889,
4258,
3406,
29889,
9435,
29889,
4882,
29918,
3198,
261,
1053,
313,
13,
1678,
16034,
5596,
261,
29892,
13,
1678,
16034,
5596,
261,
6980,
29892,
13,
1678,
16034,
3591,
13,
29897,
13,
3166,
12641,
29889,
6698,
2207,
29889,
4258,
3406,
29889,
9435,
29889,
7662,
29918,
3888,
1053,
4883,
359,
29918,
7662,
29918,
8758,
29918,
3166,
29918,
465,
12961,
29918,
7662,
13,
3166,
12641,
29889,
721,
7681,
29889,
3712,
2105,
292,
29889,
3712,
2105,
1053,
9330,
7185,
2105,
13,
3166,
12641,
29889,
721,
7681,
29889,
3712,
2105,
292,
29889,
10314,
1053,
9330,
6848,
7185,
2105,
13,
13,
13,
1990,
18981,
3260,
29898,
5709,
5596,
261,
1125,
13,
29871,
9995,
2315,
482,
7788,
11233,
287,
491,
263,
9330,
9995,
13,
13,
29871,
822,
4770,
2344,
12035,
1311,
29892,
7788,
29892,
6503,
29918,
3712,
2105,
1125,
13,
1678,
9995,
13,
418,
7788,
29901,
27562,
1203,
22146,
26403,
29892,
13472,
29892,
8086,
13071,
363,
278,
3414,
13,
418,
6503,
29918,
3712,
2105,
29901,
450,
18981,
7185,
2105,
304,
11819,
7788,
13,
1678,
9995,
13,
1678,
1583,
3032,
10314,
29918,
3712,
2105,
353,
6503,
29918,
3712,
2105,
13,
1678,
396,
14402,
29898,
6669,
1171,
29897,
15154,
26403,
29914,
2572,
23415,
565,
341,
2890,
3267,
29899,
29896,
29946,
29945,
29947,
338,
11527,
29889,
13,
1678,
1583,
3032,
3317,
29918,
21970,
353,
7788,
29889,
21970,
2141,
657,
580,
13,
1678,
1583,
3032,
3317,
29918,
2572,
353,
7788,
29889,
2572,
2141,
657,
580,
13,
1678,
1583,
3032,
3317,
29918,
20960,
353,
7788,
29889,
20960,
2141,
657,
580,
13,
1678,
1583,
3032,
21174,
29918,
23147,
353,
6213,
13,
1678,
1583,
3032,
21174,
29918,
3696,
353,
3244,
292,
29889,
2624,
580,
13,
13,
29871,
732,
6799,
13,
29871,
822,
903,
1949,
29918,
771,
2395,
29898,
1311,
1125,
13,
1678,
9995,
14990,
1353,
310,
10174,
278,
3414,
11624,
310,
313,
18271,
2278,
10174,
29897,
9995,
13,
1678,
736,
1583,
3032,
10314,
29918,
3712,
2105,
29889,
11249,
580,
29961,
29896,
1822,
1949,
29918,
771,
2395,
13,
13,
29871,
732,
6799,
13,
29871,
822,
903,
567,
29918,
11249,
29898,
1311,
1125,
13,
1678,
9995,
10554,
17708,
15783,
278,
20431,
6503,
27430,
310,
278,
9330,
29915,
29879,
10174,
9995,
13,
1678,
736,
1583,
3032,
10314,
29918,
3712,
2105,
29889,
11249,
580,
29961,
29896,
1822,
5014,
29918,
11249,
13,
13,
29871,
732,
6799,
13,
29871,
822,
903,
20960,
29918,
11249,
29898,
1311,
1125,
13,
1678,
9995,
8102,
297,
6262,
15783,
278,
8086,
27430,
297,
278,
9330,
29915,
29879,
11982,
1884,
9995,
13,
1678,
736,
1583,
3032,
10314,
29918,
3712,
2105,
29889,
11249,
580,
29961,
29896,
1822,
20960,
29918,
21125,
13,
13,
29871,
732,
6799,
13,
29871,
822,
4660,
29898,
1311,
1125,
13,
1678,
4559,
353,
1583,
3032,
20960,
29918,
11249,
13,
1678,
565,
4559,
1405,
1583,
3032,
3317,
29918,
20960,
29901,
13,
418,
1583,
3032,
21174,
29918,
3696,
29889,
842,
580,
13,
418,
736,
16034,
3591,
877,
29928,
3873,
4046,
13461,
287,
29889,
29871,
2538,
9841,
1273,
29879,
6262,
7186,
1304,
1273,
29879,
6262,
6169,
1273,
313,
13,
3986,
1583,
3032,
3317,
29918,
20960,
29892,
4559,
511,
4883,
359,
29918,
24381,
29906,
29889,
29911,
3289,
29968,
29918,
4519,
29902,
20566,
29897,
13,
13,
29871,
822,
1024,
29898,
1311,
1125,
13,
1678,
736,
525,
10314,
29918,
12847,
29915,
13,
13,
29871,
822,
6036,
29918,
2527,
10817,
29898,
1311,
1125,
13,
1678,
1583,
29889,
2527,
10817,
29889,
9573,
29898,
9099,
29954,
585,
479,
877,
20960,
29918,
3880,
742,
14013,
29901,
1583,
3032,
20960,
29918,
11249,
876,
13,
1678,
1583,
29889,
2527,
10817,
29889,
9573,
29898,
9099,
29954,
585,
479,
877,
20960,
29918,
690,
9841,
742,
14013,
29901,
1583,
3032,
3317,
29918,
20960,
876,
13,
1678,
1583,
29889,
2527,
10817,
29889,
9573,
29898,
9099,
29954,
585,
479,
877,
20960,
29918,
25376,
742,
13,
4706,
14013,
29901,
29871,
29896,
29889,
29900,
334,
1583,
3032,
20960,
29918,
11249,
847,
1583,
3032,
3317,
29918,
20960,
876,
13,
1678,
1583,
29889,
2527,
10817,
29889,
9573,
29898,
9099,
29954,
585,
479,
877,
21970,
29918,
3880,
742,
14013,
29901,
1583,
3032,
567,
29918,
11249,
29889,
10492,
876,
13,
1678,
1583,
29889,
2527,
10817,
29889,
9573,
29898,
9099,
29954,
585,
479,
877,
21970,
29918,
690,
9841,
742,
14013,
29901,
1583,
3032,
3317,
29918,
21970,
876,
13,
1678,
1583,
29889,
2527,
10817,
29889,
9573,
29898,
9099,
29954,
585,
479,
877,
21970,
29918,
25376,
742,
13,
4706,
14013,
29901,
29871,
29896,
29889,
29900,
334,
1583,
3032,
567,
29918,
11249,
29889,
10492,
847,
1583,
3032,
3317,
29918,
21970,
876,
13,
1678,
1583,
29889,
2527,
10817,
29889,
9573,
29898,
9099,
29954,
585,
479,
877,
2572,
29918,
3880,
742,
14013,
29901,
1583,
3032,
567,
29918,
11249,
29889,
29878,
893,
876,
13,
1678,
1583,
29889,
2527,
10817,
29889,
9573,
29898,
9099,
29954,
585,
479,
877,
2572,
29918,
690,
9841,
742,
14013,
29901,
1583,
3032,
3317,
29918,
2572,
876,
13,
1678,
1583,
29889,
2527,
10817,
29889,
9573,
29898,
9099,
29954,
585,
479,
877,
2572,
29918,
25376,
742,
13,
4706,
14013,
29901,
29871,
29896,
29889,
29900,
334,
1583,
3032,
567,
29918,
11249,
29889,
29878,
893,
847,
1583,
3032,
3317,
29918,
2572,
876,
13,
13,
29871,
822,
1369,
29898,
1311,
1125,
13,
1678,
2428,
29898,
6848,
3260,
29892,
1583,
467,
2962,
580,
13,
1678,
1583,
29889,
9573,
29918,
2527,
10817,
580,
13,
1678,
1583,
3032,
10314,
29918,
3712,
2105,
29889,
2962,
580,
13,
13,
13,
1990,
18981,
3260,
6980,
29898,
5709,
5596,
261,
6980,
1125,
13,
29871,
822,
4770,
2344,
12035,
1311,
29892,
1423,
3149,
29918,
4632,
29892,
3579,
10314,
29918,
3712,
2105,
29918,
6768,
1125,
13,
1678,
1583,
3032,
3198,
3149,
29918,
4632,
353,
1423,
3149,
29918,
4632,
13,
1678,
1583,
3032,
10314,
29918,
3712,
2105,
29918,
6768,
353,
6503,
29918,
3712,
2105,
29918,
6768,
13,
13,
29871,
822,
515,
29918,
465,
12961,
29918,
7662,
29898,
1311,
29892,
9859,
29918,
7662,
29892,
11982,
1884,
1125,
13,
1678,
3414,
29918,
333,
353,
9859,
29918,
7662,
29889,
7662,
1204,
13,
1678,
7788,
353,
4883,
359,
29918,
7662,
29918,
8758,
29918,
3166,
29918,
465,
12961,
29918,
7662,
29898,
465,
12961,
29918,
7662,
467,
7662,
2141,
13237,
580,
13,
1678,
3414,
29918,
3712,
2105,
353,
9330,
7185,
2105,
29898,
1311,
3032,
3198,
3149,
29918,
4632,
29892,
3414,
29918,
333,
29897,
13,
1678,
6503,
29918,
3712,
2105,
353,
9330,
6848,
7185,
2105,
29898,
13,
4706,
3414,
29918,
333,
29892,
13,
4706,
3414,
29918,
3712,
2105,
29892,
13,
4706,
3579,
1311,
3032,
10314,
29918,
3712,
2105,
29918,
6768,
29897,
13,
1678,
736,
18981,
3260,
29898,
13237,
29892,
6503,
29918,
3712,
2105,
29897,
13,
2
] |
auto_ria_client/search.py | DSAdv/auto-ria-python | 2 | 152593 | <filename>auto_ria_client/search.py
class Search:
def __init__(self):
pass
def execute(self):
pass
def __repr__(self):
pass
def __str__(self):
pass
class QueryBuilder:
pass
class Query:
pass
| [
1,
529,
9507,
29958,
6921,
29918,
2849,
29918,
4645,
29914,
4478,
29889,
2272,
13,
13,
1990,
11856,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1209,
13,
13,
1678,
822,
6222,
29898,
1311,
1125,
13,
4706,
1209,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
1209,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
1209,
13,
13,
13,
1990,
13641,
5627,
29901,
13,
1678,
1209,
13,
13,
13,
1990,
13641,
29901,
13,
1678,
1209,
13,
2
] |
Assignment 1 n 2 Day 8.py | paju3125/LetsUpgrade-Python-B7 | 0 | 1197 | <gh_stars>0
# Assignment 1 Day 8
# write a decorator function for taking input for you
# any kind of function you want to build
def getInput(calculate_arg_fuc):
def wrap_function():
print("Enter two numbers ")
a=int(input("Enter first number = "))
b=int(input("Enter second number = "))
calculate_arg_fuc(a,b)
return wrap_function
@getInput
def addition(num1,num2):
print("Addition = ",num1+num2)
@getInput
def subtraction(num1,num2):
print("Subtraction = ",num1-num2)
@getInput
def multiplication(num1,num2):
print("Multiplication = ",num1*num2)
@getInput
def division(num1,num2):
print("Division = ",num1/num2)
addition()
subtraction()
multiplication()
division()
# Assignment 2 day 8
# you need to develop a python program to open a file in read only mode and
# try writing something to it and handlethe subsequent errorusing Exception Handling
try:
f=open("abc.txt","r");
f.write("Heyy, i am prajval");
f.close();
except:
print("File is in read only mode...")
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
4007,
10194,
29871,
29896,
8373,
29871,
29947,
30004,
13,
30004,
13,
29937,
2436,
263,
10200,
1061,
740,
363,
5622,
1881,
363,
366,
6756,
13,
29937,
738,
2924,
310,
740,
366,
864,
304,
2048,
30004,
13,
30004,
13,
1753,
679,
4290,
29898,
15807,
403,
29918,
1191,
29918,
29888,
1682,
1125,
30004,
13,
1678,
822,
12244,
29918,
2220,
7295,
30004,
13,
4706,
1596,
703,
10399,
1023,
3694,
29871,
376,
8443,
13,
4706,
263,
29922,
524,
29898,
2080,
703,
10399,
937,
1353,
353,
376,
876,
30004,
13,
4706,
289,
29922,
524,
29898,
2080,
703,
10399,
1473,
1353,
353,
376,
876,
30004,
13,
4706,
8147,
29918,
1191,
29918,
29888,
1682,
29898,
29874,
29892,
29890,
8443,
13,
30004,
13,
1678,
736,
12244,
29918,
2220,
30004,
13,
30004,
13,
29992,
657,
4290,
30004,
13,
1753,
6124,
29898,
1949,
29896,
29892,
1949,
29906,
1125,
30004,
13,
1678,
1596,
703,
2528,
654,
353,
9162,
1949,
29896,
29974,
1949,
29906,
8443,
13,
30004,
13,
29992,
657,
4290,
30004,
13,
1753,
1014,
3018,
428,
29898,
1949,
29896,
29892,
1949,
29906,
1125,
30004,
13,
1678,
1596,
703,
4035,
3018,
428,
353,
9162,
1949,
29896,
29899,
1949,
29906,
8443,
13,
30004,
13,
29992,
657,
4290,
30004,
13,
1753,
21666,
29898,
1949,
29896,
29892,
1949,
29906,
1125,
30004,
13,
1678,
1596,
703,
6857,
666,
1414,
353,
9162,
1949,
29896,
29930,
1949,
29906,
8443,
13,
30004,
13,
29992,
657,
4290,
30004,
13,
1753,
8542,
29898,
1949,
29896,
29892,
1949,
29906,
1125,
30004,
13,
1678,
1596,
703,
12596,
2459,
353,
9162,
1949,
29896,
29914,
1949,
29906,
8443,
13,
30004,
13,
1202,
654,
26471,
13,
1491,
3018,
428,
26471,
13,
18056,
1414,
26471,
13,
4563,
2459,
26471,
13,
30004,
13,
30004,
13,
29937,
4007,
10194,
29871,
29906,
29871,
2462,
29871,
29947,
30004,
13,
30004,
13,
29937,
366,
817,
304,
2693,
263,
3017,
1824,
304,
1722,
263,
934,
297,
1303,
871,
4464,
322,
6756,
13,
29937,
1018,
5007,
1554,
304,
372,
322,
1361,
1026,
354,
15352,
1059,
4746,
8960,
5166,
1847,
30004,
13,
30004,
13,
2202,
29901,
30004,
13,
1678,
285,
29922,
3150,
703,
10736,
29889,
3945,
3284,
29878,
18584,
13,
1678,
285,
29889,
3539,
703,
29950,
1032,
29891,
29892,
474,
626,
7213,
29926,
791,
18584,
13,
1678,
285,
29889,
5358,
14078,
13,
30004,
13,
19499,
29901,
30004,
13,
1678,
1596,
703,
2283,
338,
297,
1303,
871,
4464,
856,
1159,
30004,
13,
2
] |
blaze/data/tests/test_open.py | chdoig/blaze | 1 | 1604018 |
import sys
from functools import partial
from blaze.data import CSV, JSON
from blaze.utils import tmpfile, raises
from blaze.data.utils import tuplify
from blaze.compatibility import xfail
import gzip
is_py2_win = sys.platform == 'win32' and sys.version_info[:2] < (3, 0)
@xfail(is_py2_win, reason='Win32 py2.7 unicode/gzip/eol needs sorting out')
def test_gzopen_csv():
with tmpfile('.csv.gz') as filename:
f = gzip.open(filename, 'wt')
f.write('1,1\n2,2')
f.close()
# Not a valid CSV file
assert raises(Exception, lambda: list(CSV(filename, schema='2 * int')))
dd = CSV(filename, schema='2 * int', open=partial(gzip.open, mode='rt'))
assert tuplify(list(dd)) == ((1, 1), (2, 2))
@xfail(is_py2_win, reason='Win32 py2.7 unicode/gzip/eol needs sorting out')
def test_gzopen_json():
with tmpfile('.json.gz') as filename:
f = gzip.open(filename, 'wt')
f.write('[[1, 1], [2, 2]]')
f.close()
# Not a valid JSON file
assert raises(Exception, lambda: list(JSON(filename, schema='2 * int')))
dd = JSON(filename, schema='2 * int', open=gzip.open)
assert tuplify(list(dd)) == ((1, 1), (2, 2))
| [
1,
29871,
13,
5215,
10876,
13,
3166,
2090,
312,
8789,
1053,
7687,
13,
3166,
12995,
911,
29889,
1272,
1053,
16874,
29892,
4663,
13,
13,
3166,
12995,
911,
29889,
13239,
1053,
13128,
1445,
29892,
1153,
4637,
13,
3166,
12995,
911,
29889,
1272,
29889,
13239,
1053,
5291,
572,
1598,
13,
3166,
12995,
911,
29889,
12667,
4127,
1053,
921,
14057,
13,
13,
5215,
330,
7554,
13,
13,
275,
29918,
2272,
29906,
29918,
5080,
353,
10876,
29889,
12120,
1275,
525,
5080,
29941,
29906,
29915,
322,
10876,
29889,
3259,
29918,
3888,
7503,
29906,
29962,
529,
313,
29941,
29892,
29871,
29900,
29897,
13,
13,
29992,
29916,
14057,
29898,
275,
29918,
2272,
29906,
29918,
5080,
29892,
2769,
2433,
17734,
29941,
29906,
11451,
29906,
29889,
29955,
29104,
29914,
29887,
7554,
29914,
29872,
324,
4225,
16548,
714,
1495,
13,
1753,
1243,
29918,
18828,
3150,
29918,
7638,
7295,
13,
1678,
411,
13128,
1445,
12839,
7638,
29889,
18828,
1495,
408,
10422,
29901,
13,
4706,
285,
353,
330,
7554,
29889,
3150,
29898,
9507,
29892,
525,
14554,
1495,
13,
4706,
285,
29889,
3539,
877,
29896,
29892,
29896,
29905,
29876,
29906,
29892,
29906,
1495,
13,
4706,
285,
29889,
5358,
580,
13,
13,
13,
4706,
396,
2216,
263,
2854,
16874,
934,
13,
4706,
4974,
1153,
4637,
29898,
2451,
29892,
14013,
29901,
1051,
29898,
29907,
7597,
29898,
9507,
29892,
10938,
2433,
29906,
334,
938,
29915,
4961,
13,
13,
4706,
24488,
353,
16874,
29898,
9507,
29892,
10938,
2433,
29906,
334,
938,
742,
1722,
29922,
3846,
29898,
29887,
7554,
29889,
3150,
29892,
4464,
2433,
2273,
8785,
13,
13,
4706,
4974,
5291,
572,
1598,
29898,
1761,
29898,
1289,
876,
1275,
5135,
29896,
29892,
29871,
29896,
511,
313,
29906,
29892,
29871,
29906,
876,
13,
13,
13,
29992,
29916,
14057,
29898,
275,
29918,
2272,
29906,
29918,
5080,
29892,
2769,
2433,
17734,
29941,
29906,
11451,
29906,
29889,
29955,
29104,
29914,
29887,
7554,
29914,
29872,
324,
4225,
16548,
714,
1495,
13,
1753,
1243,
29918,
18828,
3150,
29918,
3126,
7295,
13,
1678,
411,
13128,
1445,
12839,
3126,
29889,
18828,
1495,
408,
10422,
29901,
13,
4706,
285,
353,
330,
7554,
29889,
3150,
29898,
9507,
29892,
525,
14554,
1495,
13,
4706,
285,
29889,
3539,
877,
8999,
29896,
29892,
29871,
29896,
1402,
518,
29906,
29892,
29871,
29906,
5262,
1495,
13,
4706,
285,
29889,
5358,
580,
13,
13,
4706,
396,
2216,
263,
2854,
4663,
934,
13,
4706,
4974,
1153,
4637,
29898,
2451,
29892,
14013,
29901,
1051,
29898,
7249,
29898,
9507,
29892,
10938,
2433,
29906,
334,
938,
29915,
4961,
13,
13,
4706,
24488,
353,
4663,
29898,
9507,
29892,
10938,
2433,
29906,
334,
938,
742,
1722,
29922,
29887,
7554,
29889,
3150,
29897,
13,
13,
4706,
4974,
5291,
572,
1598,
29898,
1761,
29898,
1289,
876,
1275,
5135,
29896,
29892,
29871,
29896,
511,
313,
29906,
29892,
29871,
29906,
876,
13,
2
] |
obs-src/build/lib/obs/bulktasks.py | OOXXXXOO/DARTH | 11 | 159651 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Copyright 2019 Huawei Technologies Co.,Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
import threading
from obs import const
from obs import util
if const.IS_PYTHON2:
import Queue as queue
else:
import queue
class ThreadPool(object):
def __init__(self, thread_size=const.DEFAULT_TASK_NUM, queue_size=const.DEFAULT_TASK_QUEUE_SIZE):
self.thread_size = thread_size
self._alive_threads = 0
self._task_queue = queue.Queue(queue_size)
self._threads = []
self._init_threads()
self._shutdown_lock = threading.Lock()
def _init_threads(self):
for i in range(self.thread_size):
self._alive_threads += 1
work_thread = threading.Thread(target = self._run)
self._threads.append(work_thread)
work_thread.start()
def _run(self):
task = self._task_queue.get()
while task is not None:
(func, args, kwargs, future) = task
if future is None:
result = func(*args, **kwargs)
else:
try:
result = func(*args, **kwargs)
except Exception as e:
future.set_exception(e)
else:
future.set_result(result)
del task
task = self._task_queue.get()
def execute(self, func, *args, **kwargs):
task = (func, args, kwargs, None)
self._task_queue.put(task)
def submit(self, func, *args, **kwargs):
future = Future()
task = (func, args, kwargs, future)
self._task_queue.put(task)
return future
def shutdown(self, wait=True):
with self._shutdown_lock:
while self._alive_threads:
self._task_queue.put(None)
self._alive_threads -= 1
if wait:
for t in self._threads:
t.join()
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.shutdown(wait=True)
return False
class TimeoutError(Exception):
pass
PENDING = 'PENDING'
COMPLETED = 'COMPLETED'
class Future(object):
def __init__(self):
self._condition = threading.Condition()
self._state = PENDING
self._result = None
self._exception = None
self._callback = None
def set_result(self, result):
with self._condition:
self._result = result
self._state = COMPLETED
self._condition.notify_all()
if self._callback:
self._callback(self)
def set_exception(self, exception):
with self._condition:
self._exception = exception
self._state = COMPLETED
self._condition.notify_all()
if self._callback:
self._callback(self)
def set_callback(self, callback):
with self._condition:
if self._state is PENDING:
self._callback = callback
return
callback(self)
def _get_result(self):
if self._exception:
raise self._exception
else:
return self._result
def get_result(self, timeout=None):
with self._condition:
if self._state == COMPLETED:
return self._get_result()
self._condition.wait(timeout)
if self._state == COMPLETED:
return self._get_result()
else:
raise TimeoutError()
def get_exception(self, timeout=None):
with self._condition:
if self._state == COMPLETED:
return self._exception
self._condition.wait(timeout)
if self._state == COMPLETED:
return self._exception
else:
raise TimeoutError()
class ExecuteProgress(object):
def __init__(self):
self.successful_tasks = 0
self._successful_lock = threading.Lock()
self.failed_tasks = 0
self._failed_lock = threading.Lock()
self.finished_tasks = 0
self._finished_lock = threading.Lock()
self.total_tasks = 0
def _successful_increment(self):
with self._successful_lock:
self.successful_tasks += 1
return self.successful_tasks
def _failed_increment(self):
with self._failed_lock:
self.failed_tasks += 1
return self.failed_tasks
def _finished_increment(self):
with self._finished_lock:
self.finished_tasks += 1
return self.finished_tasks
def get_successful_tasks(self):
with self._successful_lock:
return self.successful_tasks
def get_failed_tasks(self):
with self._failed_lock:
return self.failed_tasks
def get_finished_tasks(self):
with self._finished_lock:
return self.finished_tasks
def get_total_tasks(self):
return self.total_tasks
def _reportProgress(progress, interval, progressCallback):
finishedTasks = progress._finished_increment()
if finishedTasks % interval == 0 or finishedTasks == progress.get_total_tasks():
successfulTasks = progress.get_successful_tasks()
failedTasks = progress.get_failed_tasks()
progressCallback(successfulTasks, failedTasks, progress.get_total_tasks())
def _checkBulkTasksPara(task_num, task_queue_size, task_interval, threshold):
origine = [task_num, task_queue_size, task_interval, threshold]
default = (const.DEFAULT_TASK_NUM, const.DEFAULT_TASK_QUEUE_SIZE, const.DEFAULT_BYTE_INTTERVAL, const.DEFAULT_MAXIMUM_SIZE)
size = len(origine)
for i in range(size):
origine[i] = util.to_int(origine[i])
if origine[i] is None or origine[i] <= 0:
origine[i] = default[i]
return tuple(origine) | [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
14137,
29901,
9420,
29899,
29947,
448,
29930,
29899,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29929,
379,
3357,
26599,
8364,
11763,
3189,
1696,
29931,
1594,
29889,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
366,
1122,
451,
671,
13,
29937,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
29871,
887,
1122,
4017,
263,
3509,
310,
278,
13,
29937,
19245,
472,
13,
13,
29937,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13235,
13,
29937,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
13,
29937,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
29871,
2823,
278,
19245,
363,
278,
13,
29937,
2702,
4086,
14765,
1076,
11239,
322,
27028,
1090,
278,
19245,
29889,
13,
13,
5215,
3244,
292,
13,
3166,
20881,
1053,
1040,
13,
3166,
20881,
1053,
3667,
13,
361,
1040,
29889,
3235,
29918,
20055,
4690,
1164,
29906,
29901,
13,
1678,
1053,
5462,
434,
408,
9521,
13,
2870,
29901,
13,
1678,
1053,
9521,
13,
13,
13,
13,
1990,
10480,
11426,
29898,
3318,
1125,
13,
268,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3244,
29918,
2311,
29922,
3075,
29889,
23397,
29918,
29911,
3289,
29968,
29918,
13967,
29892,
9521,
29918,
2311,
29922,
3075,
29889,
23397,
29918,
29911,
3289,
29968,
29918,
11144,
4462,
29918,
14226,
1125,
13,
4706,
1583,
29889,
7097,
29918,
2311,
353,
3244,
29918,
2311,
13,
4706,
1583,
3032,
284,
573,
29918,
28993,
353,
29871,
29900,
13,
4706,
1583,
3032,
7662,
29918,
9990,
353,
9521,
29889,
10620,
29898,
9990,
29918,
2311,
29897,
13,
4706,
1583,
3032,
28993,
353,
5159,
13,
4706,
1583,
3032,
2344,
29918,
28993,
580,
13,
4706,
1583,
3032,
845,
329,
3204,
29918,
908,
353,
3244,
292,
29889,
16542,
580,
13,
268,
13,
1678,
822,
903,
2344,
29918,
28993,
29898,
1311,
1125,
13,
4706,
363,
474,
297,
3464,
29898,
1311,
29889,
7097,
29918,
2311,
1125,
13,
9651,
1583,
3032,
284,
573,
29918,
28993,
4619,
29871,
29896,
13,
9651,
664,
29918,
7097,
353,
3244,
292,
29889,
4899,
29898,
5182,
353,
1583,
3032,
3389,
29897,
13,
9651,
1583,
3032,
28993,
29889,
4397,
29898,
1287,
29918,
7097,
29897,
13,
9651,
664,
29918,
7097,
29889,
2962,
580,
13,
268,
13,
1678,
822,
903,
3389,
29898,
1311,
1125,
13,
4706,
3414,
353,
1583,
3032,
7662,
29918,
9990,
29889,
657,
580,
13,
4706,
1550,
3414,
338,
451,
6213,
29901,
13,
9651,
313,
9891,
29892,
6389,
29892,
9049,
5085,
29892,
5434,
29897,
353,
3414,
13,
13,
9651,
565,
5434,
338,
6213,
29901,
13,
18884,
1121,
353,
3653,
10456,
5085,
29892,
3579,
19290,
29897,
13,
9651,
1683,
29901,
13,
18884,
1018,
29901,
13,
462,
1678,
1121,
353,
3653,
10456,
5085,
29892,
3579,
19290,
29897,
13,
18884,
5174,
8960,
408,
321,
29901,
13,
462,
1678,
5434,
29889,
842,
29918,
11739,
29898,
29872,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
5434,
29889,
842,
29918,
2914,
29898,
2914,
29897,
13,
632,
13,
9651,
628,
3414,
13,
632,
13,
9651,
3414,
353,
1583,
3032,
7662,
29918,
9990,
29889,
657,
580,
13,
268,
13,
1678,
822,
6222,
29898,
1311,
29892,
3653,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
3414,
353,
313,
9891,
29892,
6389,
29892,
9049,
5085,
29892,
6213,
29897,
13,
4706,
1583,
3032,
7662,
29918,
9990,
29889,
649,
29898,
7662,
29897,
13,
268,
13,
1678,
822,
9752,
29898,
1311,
29892,
3653,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
5434,
353,
16367,
580,
13,
4706,
3414,
353,
313,
9891,
29892,
6389,
29892,
9049,
5085,
29892,
5434,
29897,
13,
4706,
1583,
3032,
7662,
29918,
9990,
29889,
649,
29898,
7662,
29897,
13,
4706,
736,
5434,
13,
268,
13,
1678,
822,
12522,
3204,
29898,
1311,
29892,
4480,
29922,
5574,
1125,
13,
4706,
411,
1583,
3032,
845,
329,
3204,
29918,
908,
29901,
13,
9651,
1550,
1583,
3032,
284,
573,
29918,
28993,
29901,
13,
18884,
1583,
3032,
7662,
29918,
9990,
29889,
649,
29898,
8516,
29897,
13,
18884,
1583,
3032,
284,
573,
29918,
28993,
22361,
29871,
29896,
13,
9651,
565,
4480,
29901,
13,
18884,
363,
260,
297,
1583,
3032,
28993,
29901,
13,
462,
1678,
260,
29889,
7122,
580,
13,
268,
13,
1678,
822,
4770,
5893,
12035,
1311,
1125,
13,
4706,
736,
1583,
13,
268,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
5566,
29918,
1853,
29892,
5566,
29918,
791,
29892,
5566,
29918,
22625,
1125,
13,
4706,
1583,
29889,
845,
329,
3204,
29898,
10685,
29922,
5574,
29897,
13,
4706,
736,
7700,
13,
13,
13,
1990,
5974,
449,
2392,
29898,
2451,
1125,
13,
1678,
1209,
13,
13,
29925,
11794,
4214,
353,
525,
29925,
11794,
4214,
29915,
13,
21514,
1307,
29911,
3352,
353,
525,
21514,
1307,
29911,
3352,
29915,
13,
13,
1990,
16367,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
3032,
16122,
353,
3244,
292,
29889,
25255,
580,
13,
4706,
1583,
3032,
3859,
353,
349,
11794,
4214,
13,
4706,
1583,
3032,
2914,
353,
6213,
13,
4706,
1583,
3032,
11739,
353,
6213,
13,
4706,
1583,
3032,
14035,
353,
6213,
13,
632,
13,
1678,
822,
731,
29918,
2914,
29898,
1311,
29892,
1121,
1125,
13,
4706,
411,
1583,
3032,
16122,
29901,
13,
9651,
1583,
3032,
2914,
353,
1121,
13,
9651,
1583,
3032,
3859,
353,
4810,
3580,
1307,
29911,
3352,
13,
9651,
1583,
3032,
16122,
29889,
25140,
29918,
497,
580,
13,
308,
13,
4706,
565,
1583,
3032,
14035,
29901,
13,
9651,
1583,
3032,
14035,
29898,
1311,
29897,
13,
13,
1678,
822,
731,
29918,
11739,
29898,
1311,
29892,
3682,
1125,
13,
4706,
411,
1583,
3032,
16122,
29901,
13,
9651,
1583,
3032,
11739,
353,
3682,
13,
9651,
1583,
3032,
3859,
353,
4810,
3580,
1307,
29911,
3352,
13,
9651,
1583,
3032,
16122,
29889,
25140,
29918,
497,
580,
13,
308,
13,
4706,
565,
1583,
3032,
14035,
29901,
13,
9651,
1583,
3032,
14035,
29898,
1311,
29897,
13,
268,
13,
268,
13,
1678,
822,
731,
29918,
14035,
29898,
1311,
29892,
6939,
1125,
13,
4706,
411,
1583,
3032,
16122,
29901,
13,
9651,
565,
1583,
3032,
3859,
338,
349,
11794,
4214,
29901,
13,
18884,
1583,
3032,
14035,
353,
6939,
13,
18884,
736,
13,
4706,
6939,
29898,
1311,
29897,
13,
268,
13,
1678,
822,
903,
657,
29918,
2914,
29898,
1311,
1125,
13,
4706,
565,
1583,
3032,
11739,
29901,
13,
9651,
12020,
1583,
3032,
11739,
13,
4706,
1683,
29901,
13,
9651,
736,
1583,
3032,
2914,
13,
268,
13,
1678,
822,
679,
29918,
2914,
29898,
1311,
29892,
11815,
29922,
8516,
1125,
13,
4706,
411,
1583,
3032,
16122,
29901,
13,
9651,
565,
1583,
3032,
3859,
1275,
4810,
3580,
1307,
29911,
3352,
29901,
13,
18884,
736,
1583,
3032,
657,
29918,
2914,
580,
13,
632,
13,
9651,
1583,
3032,
16122,
29889,
10685,
29898,
15619,
29897,
13,
632,
13,
9651,
565,
1583,
3032,
3859,
1275,
4810,
3580,
1307,
29911,
3352,
29901,
13,
18884,
736,
1583,
3032,
657,
29918,
2914,
580,
13,
9651,
1683,
29901,
13,
18884,
12020,
5974,
449,
2392,
580,
13,
13,
1678,
822,
679,
29918,
11739,
29898,
1311,
29892,
11815,
29922,
8516,
1125,
13,
4706,
411,
1583,
3032,
16122,
29901,
13,
9651,
565,
1583,
3032,
3859,
1275,
4810,
3580,
1307,
29911,
3352,
29901,
13,
18884,
736,
1583,
3032,
11739,
13,
632,
13,
9651,
1583,
3032,
16122,
29889,
10685,
29898,
15619,
29897,
13,
13,
9651,
565,
1583,
3032,
3859,
1275,
4810,
3580,
1307,
29911,
3352,
29901,
13,
18884,
736,
1583,
3032,
11739,
13,
9651,
1683,
29901,
13,
18884,
12020,
5974,
449,
2392,
580,
13,
13,
1990,
11080,
1082,
14470,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
8698,
1319,
29918,
20673,
353,
29871,
29900,
13,
4706,
1583,
3032,
8698,
1319,
29918,
908,
353,
3244,
292,
29889,
16542,
580,
13,
4706,
1583,
29889,
26061,
29918,
20673,
353,
29871,
29900,
13,
4706,
1583,
3032,
26061,
29918,
908,
353,
3244,
292,
29889,
16542,
580,
13,
4706,
1583,
29889,
4951,
3276,
29918,
20673,
353,
29871,
29900,
13,
4706,
1583,
3032,
4951,
3276,
29918,
908,
353,
3244,
292,
29889,
16542,
580,
13,
4706,
1583,
29889,
7827,
29918,
20673,
353,
29871,
29900,
13,
268,
13,
1678,
822,
903,
8698,
1319,
29918,
25629,
29898,
1311,
1125,
13,
4706,
411,
1583,
3032,
8698,
1319,
29918,
908,
29901,
13,
9651,
1583,
29889,
8698,
1319,
29918,
20673,
4619,
29871,
29896,
13,
9651,
736,
1583,
29889,
8698,
1319,
29918,
20673,
13,
632,
13,
1678,
822,
903,
26061,
29918,
25629,
29898,
1311,
1125,
13,
4706,
411,
1583,
3032,
26061,
29918,
908,
29901,
13,
9651,
1583,
29889,
26061,
29918,
20673,
4619,
29871,
29896,
13,
9651,
736,
1583,
29889,
26061,
29918,
20673,
13,
268,
13,
1678,
822,
903,
4951,
3276,
29918,
25629,
29898,
1311,
1125,
13,
4706,
411,
1583,
3032,
4951,
3276,
29918,
908,
29901,
13,
9651,
1583,
29889,
4951,
3276,
29918,
20673,
4619,
29871,
29896,
13,
9651,
736,
1583,
29889,
4951,
3276,
29918,
20673,
13,
268,
13,
1678,
822,
679,
29918,
8698,
1319,
29918,
20673,
29898,
1311,
1125,
13,
4706,
411,
1583,
3032,
8698,
1319,
29918,
908,
29901,
13,
9651,
736,
1583,
29889,
8698,
1319,
29918,
20673,
13,
268,
13,
1678,
822,
679,
29918,
26061,
29918,
20673,
29898,
1311,
1125,
13,
4706,
411,
1583,
3032,
26061,
29918,
908,
29901,
13,
9651,
736,
1583,
29889,
26061,
29918,
20673,
13,
268,
13,
1678,
822,
679,
29918,
4951,
3276,
29918,
20673,
29898,
1311,
1125,
13,
4706,
411,
1583,
3032,
4951,
3276,
29918,
908,
29901,
13,
9651,
736,
1583,
29889,
4951,
3276,
29918,
20673,
13,
268,
13,
1678,
822,
679,
29918,
7827,
29918,
20673,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
7827,
29918,
20673,
632,
13,
13,
1753,
903,
12276,
14470,
29898,
18035,
29892,
7292,
29892,
6728,
10717,
1125,
13,
1678,
7743,
26249,
353,
6728,
3032,
4951,
3276,
29918,
25629,
580,
13,
1678,
565,
7743,
26249,
1273,
7292,
1275,
29871,
29900,
470,
7743,
26249,
1275,
6728,
29889,
657,
29918,
7827,
29918,
20673,
7295,
13,
4706,
9150,
26249,
353,
6728,
29889,
657,
29918,
8698,
1319,
29918,
20673,
580,
13,
4706,
5229,
26249,
353,
6728,
29889,
657,
29918,
26061,
29918,
20673,
580,
13,
4706,
6728,
10717,
29898,
8698,
1319,
26249,
29892,
5229,
26249,
29892,
6728,
29889,
657,
29918,
7827,
29918,
20673,
3101,
13,
1678,
13,
1753,
903,
3198,
29933,
24456,
26249,
2177,
29874,
29898,
7662,
29918,
1949,
29892,
3414,
29918,
9990,
29918,
2311,
29892,
3414,
29918,
19207,
29892,
16897,
1125,
13,
1678,
1677,
457,
353,
518,
7662,
29918,
1949,
29892,
3414,
29918,
9990,
29918,
2311,
29892,
3414,
29918,
19207,
29892,
16897,
29962,
13,
1678,
2322,
353,
313,
3075,
29889,
23397,
29918,
29911,
3289,
29968,
29918,
13967,
29892,
1040,
29889,
23397,
29918,
29911,
3289,
29968,
29918,
11144,
4462,
29918,
14226,
29892,
1040,
29889,
23397,
29918,
22716,
4330,
29918,
10192,
4945,
8932,
29892,
1040,
29889,
23397,
29918,
12648,
7833,
5005,
29918,
14226,
29897,
13,
1678,
2159,
353,
7431,
29898,
17234,
29897,
13,
1678,
363,
474,
297,
3464,
29898,
2311,
1125,
13,
4706,
1677,
457,
29961,
29875,
29962,
353,
3667,
29889,
517,
29918,
524,
29898,
17234,
29961,
29875,
2314,
13,
4706,
565,
1677,
457,
29961,
29875,
29962,
338,
6213,
470,
1677,
457,
29961,
29875,
29962,
5277,
29871,
29900,
29901,
13,
9651,
1677,
457,
29961,
29875,
29962,
353,
2322,
29961,
29875,
29962,
13,
1678,
736,
18761,
29898,
17234,
29897,
2
] |
assignment/sets/max_min_set.py | arc-arnob/256131 | 0 | 70758 | <filename>assignment/sets/max_min_set.py
s = set(map(int, input().split()))
print(s)
print("max is: ",max(s))
print("min is: ",min(s))
| [
1,
529,
9507,
29958,
465,
10194,
29914,
7224,
29914,
3317,
29918,
1195,
29918,
842,
29889,
2272,
13,
29879,
353,
731,
29898,
1958,
29898,
524,
29892,
1881,
2141,
5451,
22130,
13,
2158,
29898,
29879,
29897,
13,
13,
2158,
703,
3317,
338,
29901,
9162,
3317,
29898,
29879,
876,
13,
2158,
703,
1195,
338,
29901,
9162,
1195,
29898,
29879,
876,
13,
13,
2
] |
RLBotPack/BotimusPrime/source/maneuvers/air/fast_recovery.py | DaCoolOne/RLBotPack | 0 | 28263 | <gh_stars>0
from maneuvers.kit import *
from maneuvers.driving.arrive import Arrive
class FastRecovery(Maneuver):
def __init__(self, car: Car):
super().__init__(car)
self.turn = AerialTurn(car, look_at(vec3(0, 0, -1)))
self.landing = False
def step(self, dt):
self.turn.step(dt)
self.controls = self.turn.controls
self.controls.throttle = 1
if self.landing:
self.turn.find_landing_orientation(200)
else:
if angle_between(self.car.forward(), vec3(0, 0, -1)) < 0.5:
self.controls.boost = 1
else:
self.controls.boost = 0
if distance(self.car, self.find_landing_pos()) < clamp(norm(self.car.vel), 600, 2300):
self.landing = True
self.turn = AerialTurn(self.car)
self.finished = self.car.on_ground
def find_landing_pos(self, num_points=200, dt=0.0333) -> vec3:
dummy = Car(self.car)
for i in range(0, num_points):
dummy.step(Input(), dt)
dummy.time += dt
n = dummy.pitch_surface_normal()
if norm(n) > 0.0 and i > 10:
return dummy.pos
return self.car.pos
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
767,
12932,
874,
29889,
7354,
1053,
334,
30004,
13,
30004,
13,
3166,
767,
12932,
874,
29889,
29881,
1150,
292,
29889,
279,
4401,
1053,
826,
4401,
30004,
13,
30004,
13,
1990,
23786,
4789,
22205,
29898,
29924,
1662,
29884,
369,
1125,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1559,
29901,
1704,
1125,
30004,
13,
4706,
2428,
2141,
1649,
2344,
12035,
4287,
8443,
13,
30004,
13,
4706,
1583,
29889,
685,
353,
18682,
616,
27407,
29898,
4287,
29892,
1106,
29918,
271,
29898,
2003,
29941,
29898,
29900,
29892,
29871,
29900,
29892,
448,
29896,
4961,
30004,
13,
4706,
1583,
29889,
1049,
292,
353,
7700,
30004,
13,
30004,
13,
1678,
822,
4331,
29898,
1311,
29892,
11636,
1125,
30004,
13,
4706,
1583,
29889,
685,
29889,
10568,
29898,
6008,
8443,
13,
4706,
1583,
29889,
26255,
353,
1583,
29889,
685,
29889,
26255,
30004,
13,
4706,
1583,
29889,
26255,
29889,
386,
26970,
280,
353,
29871,
29896,
30004,
13,
30004,
13,
4706,
565,
1583,
29889,
1049,
292,
29901,
30004,
13,
9651,
1583,
29889,
685,
29889,
2886,
29918,
1049,
292,
29918,
20659,
29898,
29906,
29900,
29900,
8443,
13,
4706,
1683,
29901,
30004,
13,
9651,
565,
10696,
29918,
14811,
29898,
1311,
29889,
4287,
29889,
11333,
3285,
9649,
29941,
29898,
29900,
29892,
29871,
29900,
29892,
448,
29896,
876,
529,
29871,
29900,
29889,
29945,
29901,
30004,
13,
18884,
1583,
29889,
26255,
29889,
17079,
353,
29871,
29896,
30004,
13,
9651,
1683,
29901,
30004,
13,
18884,
1583,
29889,
26255,
29889,
17079,
353,
29871,
29900,
30004,
13,
30004,
13,
9651,
565,
5418,
29898,
1311,
29889,
4287,
29892,
1583,
29889,
2886,
29918,
1049,
292,
29918,
1066,
3101,
529,
1067,
1160,
29898,
12324,
29898,
1311,
29889,
4287,
29889,
955,
511,
29871,
29953,
29900,
29900,
29892,
29871,
29906,
29941,
29900,
29900,
1125,
30004,
13,
18884,
1583,
29889,
1049,
292,
353,
5852,
30004,
13,
18884,
1583,
29889,
685,
353,
18682,
616,
27407,
29898,
1311,
29889,
4287,
8443,
13,
30004,
13,
4706,
1583,
29889,
4951,
3276,
353,
1583,
29889,
4287,
29889,
265,
29918,
2057,
30004,
13,
30004,
13,
1678,
822,
1284,
29918,
1049,
292,
29918,
1066,
29898,
1311,
29892,
954,
29918,
9748,
29922,
29906,
29900,
29900,
29892,
11636,
29922,
29900,
29889,
29900,
29941,
29941,
29941,
29897,
1599,
9649,
29941,
29901,
30004,
13,
4706,
20254,
353,
1704,
29898,
1311,
29889,
4287,
8443,
13,
4706,
363,
474,
297,
3464,
29898,
29900,
29892,
954,
29918,
9748,
1125,
30004,
13,
9651,
20254,
29889,
10568,
29898,
4290,
3285,
11636,
8443,
13,
9651,
20254,
29889,
2230,
4619,
11636,
30004,
13,
9651,
302,
353,
20254,
29889,
29886,
2335,
29918,
7610,
2161,
29918,
8945,
26471,
13,
9651,
565,
6056,
29898,
29876,
29897,
1405,
29871,
29900,
29889,
29900,
322,
474,
1405,
29871,
29896,
29900,
29901,
30004,
13,
18884,
736,
20254,
29889,
1066,
30004,
13,
4706,
736,
1583,
29889,
4287,
29889,
1066,
30004,
13,
462,
268,
2
] |
jtv2xmltv/main.py | tataranovich/jtv2xmltv | 11 | 114563 | <reponame>tataranovich/jtv2xmltv
from __future__ import print_function
import argparse
import sys
from jtv2xmltv.convert import convert_jtv_to_xmltv
def main():
if int(sys.version[0]) == 2:
# Undefined variable 'reload'
# pylint: disable=E0602
reload(sys)
# Module 'sys' has no 'setdefaultencoding' member
# pylint: disable=E1101
sys.setdefaultencoding('utf8')
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--inputfile', required=True)
parser.add_argument('-o', '--outputfile', default='-')
parser.add_argument('-t', '--timezone')
parser.add_argument('-e', '--encoding', default='cp1251')
args = parser.parse_args()
jtv_filename = args.inputfile
xmltv_filename = args.outputfile
jtv_encoding = args.encoding
if args.timezone is None:
tz_format = 'UTC'
elif args.timezone[0] == '-' or args.timezone[0] == '+':
tz_format = str(args.timezone)
else:
tz_format = '+' + str(args.timezone)
xmltv_content = convert_jtv_to_xmltv(jtv_filename, jtv_encoding=jtv_encoding, xmltv_timezone=tz_format)
if xmltv_filename is None or xmltv_filename == "-":
print(xmltv_content)
else:
xmltv = open(xmltv_filename, 'w')
xmltv.write(xmltv_content)
xmltv.close()
| [
1,
529,
276,
1112,
420,
29958,
8101,
23029,
586,
436,
29914,
29926,
12427,
29906,
3134,
12427,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
5215,
1852,
5510,
13,
5215,
10876,
13,
3166,
432,
12427,
29906,
3134,
12427,
29889,
13441,
1053,
3588,
29918,
29926,
12427,
29918,
517,
29918,
3134,
12427,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
565,
938,
29898,
9675,
29889,
3259,
29961,
29900,
2314,
1275,
29871,
29906,
29901,
13,
4706,
396,
14211,
5598,
2286,
525,
28120,
29915,
13,
4706,
396,
282,
2904,
524,
29901,
11262,
29922,
29923,
29900,
29953,
29900,
29906,
13,
4706,
19763,
29898,
9675,
29897,
13,
4706,
396,
15591,
525,
9675,
29915,
756,
694,
525,
842,
4381,
22331,
29915,
4509,
13,
4706,
396,
282,
2904,
524,
29901,
11262,
29922,
29923,
29896,
29896,
29900,
29896,
13,
4706,
10876,
29889,
842,
4381,
22331,
877,
9420,
29947,
1495,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
29899,
29875,
742,
525,
489,
2080,
1445,
742,
3734,
29922,
5574,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
29899,
29877,
742,
525,
489,
4905,
1445,
742,
2322,
2433,
29899,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
29899,
29873,
742,
525,
489,
2230,
8028,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
29899,
29872,
742,
525,
489,
22331,
742,
2322,
2433,
6814,
29896,
29906,
29945,
29896,
1495,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1678,
432,
12427,
29918,
9507,
353,
6389,
29889,
2080,
1445,
13,
1678,
4903,
12427,
29918,
9507,
353,
6389,
29889,
4905,
1445,
13,
1678,
432,
12427,
29918,
22331,
353,
6389,
29889,
22331,
13,
1678,
565,
6389,
29889,
2230,
8028,
338,
6213,
29901,
13,
4706,
260,
29920,
29918,
4830,
353,
525,
26913,
29915,
13,
1678,
25342,
6389,
29889,
2230,
8028,
29961,
29900,
29962,
1275,
17411,
29915,
470,
6389,
29889,
2230,
8028,
29961,
29900,
29962,
1275,
525,
29974,
2396,
13,
4706,
260,
29920,
29918,
4830,
353,
851,
29898,
5085,
29889,
2230,
8028,
29897,
13,
1678,
1683,
29901,
13,
4706,
260,
29920,
29918,
4830,
353,
525,
23097,
718,
851,
29898,
5085,
29889,
2230,
8028,
29897,
13,
1678,
4903,
12427,
29918,
3051,
353,
3588,
29918,
29926,
12427,
29918,
517,
29918,
3134,
12427,
29898,
29926,
12427,
29918,
9507,
29892,
432,
12427,
29918,
22331,
29922,
29926,
12427,
29918,
22331,
29892,
4903,
12427,
29918,
2230,
8028,
29922,
17559,
29918,
4830,
29897,
13,
1678,
565,
4903,
12427,
29918,
9507,
338,
6213,
470,
4903,
12427,
29918,
9507,
1275,
11663,
1115,
13,
4706,
1596,
29898,
3134,
12427,
29918,
3051,
29897,
13,
1678,
1683,
29901,
13,
4706,
4903,
12427,
353,
1722,
29898,
3134,
12427,
29918,
9507,
29892,
525,
29893,
1495,
13,
4706,
4903,
12427,
29889,
3539,
29898,
3134,
12427,
29918,
3051,
29897,
13,
4706,
4903,
12427,
29889,
5358,
580,
13,
2
] |
crits/notifications/handlers.py | frbapolkosnik/crits | 22 | 70022 | import datetime
import threading
from django.utils.html import escape as html_escape
from mongoengine import EmbeddedDocument
try:
from mongoengine.base import ValidationError
except ImportError:
from mongoengine.errors import ValidationError
from mongoengine.base.datastructures import BaseList
from mongoengine.queryset import Q
from crits.core.class_mapper import class_from_id
from crits.core.form_consts import NotificationType
from crits.core.user import CRITsUser
from crits.core.user_tools import user_sources, get_subscribed_users
from crits.notifications.notification import Notification
from crits.notifications.processor import ChangeParser, MappedMongoFields
from crits.notifications.processor import NotificationHeaderManager
def create_notification(obj, username, message, source_filter=None,
notification_type=NotificationType.ALERT):
"""
Generate a notification -- based on mongo obj.
:param obj: The object.
:type obj: class which inherits from
:class:`crits.core.crits_mongoengine.CritsBaseAttributes`
:param username: The user creating the notification.
:type username: str
:param message: The notification message.
:type message: str
:param source_filter: Filter on who can see this notification.
:type source_filter: list(str)
:param notification_type: The notification type (e.g. alert, error).
:type notification_type: str
"""
n = Notification()
n.analyst = username
obj_type = obj._meta['crits_type']
users = set()
if notification_type not in NotificationType.ALL:
notification_type = NotificationType.ALERT
n.notification_type = notification_type
if obj_type == 'Comment':
n.obj_id = obj.obj_id
n.obj_type = obj.obj_type
n.notification = "%s added a comment: %s" % (username, obj.comment)
users.update(obj.users) # notify mentioned users
# for comments, use the sources from the object that it is linked to
# instead of the comments's sources
obj = class_from_id(n.obj_type, n.obj_id)
else:
n.notification = message
n.obj_id = obj.id
n.obj_type = obj_type
if hasattr(obj, 'source'):
sources = [s.name for s in obj.source]
subscribed_users = get_subscribed_users(n.obj_type, n.obj_id, sources)
# Filter on users that have access to the source of the object
for subscribed_user in subscribed_users:
allowed_sources = user_sources(subscribed_user)
for allowed_source in allowed_sources:
if allowed_source in sources:
if source_filter is None or allowed_source in source_filter:
users.add(subscribed_user)
break
else:
users.update(get_subscribed_users(n.obj_type, n.obj_id, []))
users.discard(username) # don't notify the user creating this notification
n.users = list(users)
if not len(n.users):
return
try:
n.save()
except ValidationError:
pass
# Signal potentially waiting threads that notification information is available
for user in n.users:
notification_lock = NotificationLockManager.get_notification_lock(user)
notification_lock.acquire()
try:
notification_lock.notifyAll()
finally:
notification_lock.release()
def create_general_notification(username, target_users, header, link_url, message,
notification_type=NotificationType.ALERT):
"""
Generate a general notification -- not based on mongo obj.
:param obj: The object.
:type obj: class which inherits from
:class:`crits.core.crits_mongoengine.CritsBaseAttributes`
:param username: The user creating the notification.
:type username: str
:param target_users: The list of users who will get the notification.
:type target_users: list(str)
:param header: The notification header message.
:type header: list(str)
:param link_url: A link URL for the header, specify None if there is no link.
:type link_url: str
:param message: The notification message.
:type message: str
:param notification_type: The notification type (e.g. alert, error).
:type notification_type: str
"""
if notification_type not in NotificationType.ALL:
notification_type = NotificationType.ALERT
n = Notification()
n.analyst = username
n.notification_type = notification_type
n.notification = message
n.header = header
n.link_url = link_url
for target_user in target_users:
# Check to make sure the user actually exists
user = CRITsUser.objects(username=target_user).first()
if user is not None:
n.users.append(target_user)
# don't notify the user creating this notification
n.users = [u for u in n.users if u != username]
if not len(n.users):
return
try:
n.save()
except ValidationError:
pass
# Signal potentially waiting threads that notification information is available
for user in n.users:
notification_lock = NotificationLockManager.get_notification_lock(user)
notification_lock.acquire()
try:
notification_lock.notifyAll()
finally:
notification_lock.release()
def generate_audit_notification(username, operation_type, obj, changed_fields,
what_changed, is_new_doc=False):
"""
Generate an audit notification on the specific change, if applicable.
This is called during an audit of the object, before the actual save
to the database occurs.
:param username: The user creating the notification.
:type username: str
:param operation_type: The type of operation (i.e. save or delete).
:type operation_type: str
:param obj: The object.
:type obj: class which inherits from
:class:`crits.core.crits_mongoengine.CritsBaseAttributes`
:param changed_fields: A list of field names that were changed.
:type changed_fields: list of str
:param message: A message summarizing what changed.
:type message: str
:param is_new_doc: Indicates if the input obj is newly created.
:type is_new_doc: bool
"""
obj_type = obj._meta['crits_type']
supported_notification = __supported_notification_types__.get(obj_type)
# Check if the obj is supported for notifications
if supported_notification is None:
return
if operation_type == "save":
message = "%s updated the following attributes: %s" % (username,
what_changed)
elif operation_type == "delete":
header_description = generate_notification_header(obj)
message = "%s deleted the following: %s" % (username,
header_description)
if is_new_doc:
sources = []
if hasattr(obj, 'source'):
sources = [s.name for s in obj.source]
message = None
target_users = get_subscribed_users(obj_type, obj.id, sources)
header = generate_notification_header(obj)
link_url = None
if hasattr(obj, 'get_details_url'):
link_url = obj.get_details_url()
if header is not None:
header = "New " + header
create_general_notification(username,
target_users,
header,
link_url,
message)
process_result = process_changed_fields(message, changed_fields, obj)
message = process_result.get('message')
source_filter = process_result.get('source_filter')
if message is not None:
message = html_escape(message)
create_notification(obj, username, message, source_filter, NotificationType.ALERT)
def combine_source_filters(current_source_filters, new_source_filters):
"""
Combines sources together in a restrictive way, e.g. combines sources
like a boolean AND operation, e.g. the source must exist in both lists.
The only exception is if current_source_filters == None, in which case the
new_source_filters will act as the new baseline.
:type current_source_filters: list of source names
:param current_source_filters: list(str).
:type new_source_filters: list of source names
:param new_source_filters: list(str).
:returns: str: Returns a list of combined source names.
"""
combined_source_filters = []
if current_source_filters is None:
return new_source_filters
else:
for new_source_filter in new_source_filters:
if new_source_filter in current_source_filters:
combined_source_filters.append(new_source_filter)
return combined_source_filters
def process_changed_fields(initial_message, changed_fields, obj):
"""
Processes the changed fields to determine what actually changed.
:param message: An initial message to include.
:type message: str
:param changed_fields: A list of field names that were changed.
:type changed_fields: list of str
:param obj: The object.
:type obj: class which inherits from
:class:`crits.core.crits_mongoengine.CritsBaseAttributes`
:returns: str: Returns a message indicating what was changed.
"""
obj_type = obj._meta['crits_type']
message = initial_message
if message is None:
message = ''
source_filter = None
for changed_field in changed_fields:
# Fields may be fully qualified, e.g. source.1.instances.0.reference
# So, split on the '.' character and get the root of the changed field
base_changed_field = MappedMongoFields.get_mapped_mongo_field(obj_type, changed_field.split('.')[0])
new_value = getattr(obj, base_changed_field, '')
old_obj = class_from_id(obj_type, obj.id)
old_value = getattr(old_obj, base_changed_field, '')
change_handler = ChangeParser.get_changed_field_handler(obj_type, base_changed_field)
if change_handler is not None:
change_message = change_handler(old_value, new_value, base_changed_field)
if isinstance(change_message, dict):
if change_message.get('source_filter') is not None:
new_source_filter = change_message.get('source_filter')
source_filter = combine_source_filters(source_filter, new_source_filter)
change_message = change_message.get('message')
if change_message is not None:
message += "\n" + change_message[:1].capitalize() + change_message[1:]
else:
change_field_handler = ChangeParser.generic_single_field_change_handler
if isinstance(old_value, BaseList):
list_value = None
if len(old_value) > 0:
list_value = old_value[0]
elif len(new_value) > 0:
list_value = new_value[0]
if isinstance(list_value, basestring):
change_field_handler = ChangeParser.generic_list_change_handler
elif isinstance(list_value, EmbeddedDocument):
change_field_handler = ChangeParser.generic_list_json_change_handler
change_message = change_field_handler(old_value, new_value, base_changed_field)
if isinstance(change_message, dict):
if change_message.get('source_filter') is not None:
new_source_filter = change_message.get('source_filter')
combine_source_filters(source_filter, new_source_filter)
change_message = change_message.get('message')
if change_message is not None:
message += "\n" + change_message[:1].capitalize() + change_message[1:]
return {'message': message, 'source_filter': source_filter}
def get_notification_details(request, newer_than):
"""
Generate the data to render the notification dialogs.
:param request: The Django request.
:type request: :class:`django.http.HttpRequest`
:param newer_than: A filter that specifies that only notifications
newer than this time should be returned.
:type newer_than: str in ISODate format.
:returns: arguments (dict)
"""
username = request.user.username
notifications_list = []
notifications = None
latest_notification_time = None
lock = NotificationLockManager.get_notification_lock(username)
timeout = 0
# Critical section, check if there are notifications to be consumed.
lock.acquire()
try:
notifications = get_user_notifications(username, newer_than=newer_than)
if len(notifications) > 0:
latest_notification_time = str(notifications[0].created)
else:
# no new notifications -- block until time expiration or lock release
lock.wait(60)
# lock was released, check if there is any new information yet
notifications = get_user_notifications(username, newer_than=newer_than)
if len(notifications) > 0:
latest_notification_time = str(notifications[0].created)
finally:
lock.release()
if latest_notification_time is not None:
acknowledgement_type = request.user.get_preference('toast_notifications', 'acknowledgement_type', 'sticky')
if acknowledgement_type == 'timeout':
timeout = request.user.get_preference('toast_notifications', 'timeout', 30) * 1000
for notification in notifications:
obj = class_from_id(notification.obj_type, notification.obj_id)
if obj is not None:
link_url = obj.get_details_url()
header = generate_notification_header(obj)
else:
if notification.header is not None:
header = notification.header
else:
header = "%s %s" % (notification.obj_type, notification.obj_id)
if notification.link_url is not None:
link_url = notification.link_url
else:
link_url = None
notification_type = notification.notification_type
if notification_type is None or notification_type not in NotificationType.ALL:
notification_type = NotificationType.ALERT
notification_data = {
"header": header,
"message": notification.notification,
"date_modified": str(notification.created.strftime("%Y/%m/%d %H:%M:%S")),
"link": link_url,
"modified_by": notification.analyst,
"id": str(notification.id),
"type": notification_type,
}
notifications_list.append(notification_data)
return {
'notifications': notifications_list,
'newest_notification': latest_notification_time,
'server_time': str(datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S")),
'timeout': timeout,
}
def get_notifications_for_id(username, obj_id, obj_type):
"""
Get notifications for a specific top-level object and user.
:param username: The user to search for.
:param obj_id: The ObjectId to search for.
:type obj_id: str
:param obj_type: The top-level object type.
:type obj_type: str
:returns: :class:`crits.core.crits_mongoengine.CritsQuerySet`
"""
return Notification.objects(users=username,
obj_id=obj_id,
obj_type=obj_type)
def remove_notification(obj_id):
"""
Remove an existing notification.
:param obj_id: The top-level ObjectId to find the notification to remove.
:type obj_id: str
:returns: dict with keys "success" (boolean) and "message" (str).
"""
notification = Notification.objects(id=obj_id).first()
if not notification:
message = "Could not find notification to remove!"
result = {'success': False, 'message': message}
else:
notification.delete()
message = "Notification removed successfully!"
result = {'success': True, 'message': message}
return result
def get_new_notifications():
"""
Get any new notifications.
"""
return Notification.objects(status="new")
def remove_user_from_notification(username, obj_id, obj_type):
"""
Remove a user from the list of users for a notification.
:param username: The user to remove.
:type username: str
:param obj_id: The ObjectId of the top-level object for this notification.
:type obj_id: str
:param obj_type: The top-level object type.
:type obj_type: str
:returns: dict with keys "success" (boolean) and "message" (str) if failed.
"""
Notification.objects(obj_id=obj_id,
obj_type=obj_type).update(pull__users=username)
return {'success': True}
def remove_user_from_notification_id(username, id):
"""
Remove a user from the list of users for a notification.
:param username: The user to remove.
:type username: str
:param obj_id: The ObjectId of the top-level object for this notification.
:type obj_id: str
:param obj_type: The top-level object type.
:type obj_type: str
:returns: dict with keys "success" (boolean) and "message" (str) if failed.
"""
Notification.objects(id=id).update(pull__users=username)
return {'success': True}
def remove_user_notifications(username):
"""
Remove a user from all notifications.
:param username: The user to remove.
:type username: str
:returns: dict with keys "success" (boolean) and "message" (str) if failed.
"""
Notification.objects(users=username).update(pull__users=username)
def get_user_notifications(username, count=False, newer_than=None):
"""
Get the notifications for a user.
:param username: The user to get notifications for.
:type username: str
:param count: Only return the count.
:type count:bool
:returns: int, :class:`crits.core.crits_mongoengine.CritsQuerySet`
"""
n = None
if newer_than is None or newer_than == None:
n = Notification.objects(users=username).order_by('-created')
else:
n = Notification.objects(Q(users=username) & Q(created__gt=newer_than)).order_by('-created')
if count:
return len(n)
else:
return n
__supported_notification_types__ = {
'Actor': 'name',
'Campaign': 'name',
'Certificate': 'md5',
'Comment': 'object_id',
'Domain': 'domain',
'Email': 'id',
'Event': 'id',
'Indicator': 'id',
'IP': 'ip',
'PCAP': 'md5',
'RawData': 'title',
'Sample': 'md5',
'Target': 'email_address',
}
class NotificationLockManager(object):
"""
Manager class to handle locks for notifications.
"""
__notification_mutex__ = threading.Lock()
__notification_locks__ = {}
@classmethod
def get_notification_lock(cls, username):
"""
@threadsafe
Gets a notification lock for the specified user, if it doesn't exist
then one is created.
"""
if username not in cls.__notification_locks__:
# notification lock doesn't exist for user, create new lock
cls.__notification_mutex__.acquire()
try:
# safe double checked locking
if username not in cls.__notification_locks__:
cls.__notification_locks__[username] = threading.Condition()
finally:
cls.__notification_mutex__.release()
return cls.__notification_locks__.get(username)
def generate_notification_header(obj):
"""
Generates notification header information based upon the object -- this is
used to preface the notification's context.
Could possibly be used for "Favorites" descriptions as well.
:param obj: The top-level object instantiated class.
:type obj: class which inherits from
:class:`crits.core.crits_mongoengine.CritsBaseAttributes`.
:returns: str with a human readable identification of the object
"""
generate_notification_header_handler = NotificationHeaderManager.get_header_handler(obj._meta['crits_type'])
if generate_notification_header_handler is not None:
return generate_notification_header_handler(obj)
else:
return "%s: %s" % (obj._meta['crits_type'], str(obj.id))
| [
1,
1053,
12865,
13,
5215,
3244,
292,
13,
13,
3166,
9557,
29889,
13239,
29889,
1420,
1053,
10169,
408,
3472,
29918,
21587,
13,
13,
3166,
19476,
10599,
1053,
2812,
2580,
7176,
6268,
13,
2202,
29901,
13,
1678,
515,
19476,
10599,
29889,
3188,
1053,
15758,
362,
2392,
13,
19499,
16032,
2392,
29901,
13,
1678,
515,
19476,
10599,
29889,
12523,
1053,
15758,
362,
2392,
13,
3166,
19476,
10599,
29889,
3188,
29889,
4130,
7614,
5313,
1973,
1053,
7399,
1293,
13,
3166,
19476,
10599,
29889,
1972,
842,
1053,
660,
13,
13,
3166,
3994,
29879,
29889,
3221,
29889,
1990,
29918,
655,
2496,
1053,
770,
29918,
3166,
29918,
333,
13,
3166,
3994,
29879,
29889,
3221,
29889,
689,
29918,
3075,
29879,
1053,
28578,
1542,
13,
3166,
3994,
29879,
29889,
3221,
29889,
1792,
1053,
15600,
1806,
29879,
2659,
13,
3166,
3994,
29879,
29889,
3221,
29889,
1792,
29918,
8504,
1053,
1404,
29918,
29879,
2863,
29892,
679,
29918,
1491,
7588,
2580,
29918,
7193,
13,
3166,
3994,
29879,
29889,
1333,
8232,
29889,
24671,
1053,
28578,
13,
3166,
3994,
29879,
29889,
1333,
8232,
29889,
26482,
1053,
10726,
11726,
29892,
341,
17280,
29924,
7443,
14256,
13,
3166,
3994,
29879,
29889,
1333,
8232,
29889,
26482,
1053,
28578,
7850,
3260,
13,
13,
13,
1753,
1653,
29918,
24671,
29898,
5415,
29892,
8952,
29892,
2643,
29892,
2752,
29918,
4572,
29922,
8516,
29892,
13,
462,
4706,
12519,
29918,
1853,
29922,
12958,
1542,
29889,
1964,
20161,
1125,
13,
1678,
9995,
13,
1678,
3251,
403,
263,
12519,
1192,
2729,
373,
19476,
5446,
29889,
13,
13,
1678,
584,
3207,
5446,
29901,
450,
1203,
29889,
13,
1678,
584,
1853,
5446,
29901,
770,
607,
7846,
1169,
515,
13,
1669,
584,
1990,
18078,
9695,
29879,
29889,
3221,
29889,
9695,
29879,
29918,
29885,
7443,
10599,
29889,
29907,
768,
29879,
5160,
15801,
29952,
13,
1678,
584,
3207,
8952,
29901,
450,
1404,
4969,
278,
12519,
29889,
13,
1678,
584,
1853,
8952,
29901,
851,
13,
1678,
584,
3207,
2643,
29901,
450,
12519,
2643,
29889,
13,
1678,
584,
1853,
2643,
29901,
851,
13,
1678,
584,
3207,
2752,
29918,
4572,
29901,
19916,
373,
1058,
508,
1074,
445,
12519,
29889,
13,
1678,
584,
1853,
2752,
29918,
4572,
29901,
1051,
29898,
710,
29897,
13,
1678,
584,
3207,
12519,
29918,
1853,
29901,
450,
12519,
1134,
313,
29872,
29889,
29887,
29889,
6655,
29892,
1059,
467,
13,
1678,
584,
1853,
12519,
29918,
1853,
29901,
851,
13,
1678,
9995,
13,
13,
1678,
302,
353,
28578,
580,
13,
1678,
302,
29889,
7054,
858,
353,
8952,
13,
1678,
5446,
29918,
1853,
353,
5446,
3032,
7299,
1839,
9695,
29879,
29918,
1853,
2033,
13,
1678,
4160,
353,
731,
580,
13,
13,
1678,
565,
12519,
29918,
1853,
451,
297,
28578,
1542,
29889,
9818,
29901,
13,
4706,
12519,
29918,
1853,
353,
28578,
1542,
29889,
1964,
20161,
13,
13,
1678,
302,
29889,
24671,
29918,
1853,
353,
12519,
29918,
1853,
13,
13,
1678,
565,
5446,
29918,
1853,
1275,
525,
20001,
2396,
13,
4706,
302,
29889,
5415,
29918,
333,
353,
5446,
29889,
5415,
29918,
333,
13,
4706,
302,
29889,
5415,
29918,
1853,
353,
5446,
29889,
5415,
29918,
1853,
13,
4706,
302,
29889,
24671,
353,
11860,
29879,
2715,
263,
3440,
29901,
1273,
29879,
29908,
1273,
313,
6786,
29892,
5446,
29889,
9342,
29897,
13,
4706,
4160,
29889,
5504,
29898,
5415,
29889,
7193,
29897,
396,
26051,
5276,
4160,
13,
13,
4706,
396,
363,
6589,
29892,
671,
278,
8974,
515,
278,
1203,
393,
372,
338,
9024,
304,
13,
4706,
396,
2012,
310,
278,
6589,
29915,
29879,
8974,
13,
4706,
5446,
353,
770,
29918,
3166,
29918,
333,
29898,
29876,
29889,
5415,
29918,
1853,
29892,
302,
29889,
5415,
29918,
333,
29897,
13,
1678,
1683,
29901,
13,
4706,
302,
29889,
24671,
353,
2643,
13,
4706,
302,
29889,
5415,
29918,
333,
353,
5446,
29889,
333,
13,
4706,
302,
29889,
5415,
29918,
1853,
353,
5446,
29918,
1853,
13,
13,
1678,
565,
756,
5552,
29898,
5415,
29892,
525,
4993,
29374,
13,
4706,
8974,
353,
518,
29879,
29889,
978,
363,
269,
297,
5446,
29889,
4993,
29962,
13,
4706,
21696,
2580,
29918,
7193,
353,
679,
29918,
1491,
7588,
2580,
29918,
7193,
29898,
29876,
29889,
5415,
29918,
1853,
29892,
302,
29889,
5415,
29918,
333,
29892,
8974,
29897,
13,
13,
4706,
396,
19916,
373,
4160,
393,
505,
2130,
304,
278,
2752,
310,
278,
1203,
13,
4706,
363,
21696,
2580,
29918,
1792,
297,
21696,
2580,
29918,
7193,
29901,
13,
9651,
6068,
29918,
29879,
2863,
353,
1404,
29918,
29879,
2863,
29898,
1491,
7588,
2580,
29918,
1792,
29897,
13,
13,
9651,
363,
6068,
29918,
4993,
297,
6068,
29918,
29879,
2863,
29901,
13,
18884,
565,
6068,
29918,
4993,
297,
8974,
29901,
13,
462,
1678,
565,
2752,
29918,
4572,
338,
6213,
470,
6068,
29918,
4993,
297,
2752,
29918,
4572,
29901,
13,
462,
4706,
4160,
29889,
1202,
29898,
1491,
7588,
2580,
29918,
1792,
29897,
13,
462,
4706,
2867,
13,
1678,
1683,
29901,
13,
4706,
4160,
29889,
5504,
29898,
657,
29918,
1491,
7588,
2580,
29918,
7193,
29898,
29876,
29889,
5415,
29918,
1853,
29892,
302,
29889,
5415,
29918,
333,
29892,
5159,
876,
13,
13,
1678,
4160,
29889,
2218,
7543,
29898,
6786,
29897,
396,
1016,
29915,
29873,
26051,
278,
1404,
4969,
445,
12519,
13,
1678,
302,
29889,
7193,
353,
1051,
29898,
7193,
29897,
13,
1678,
565,
451,
7431,
29898,
29876,
29889,
7193,
1125,
13,
4706,
736,
13,
1678,
1018,
29901,
13,
4706,
302,
29889,
7620,
580,
13,
1678,
5174,
15758,
362,
2392,
29901,
13,
4706,
1209,
13,
13,
1678,
396,
9954,
284,
19998,
10534,
9717,
393,
12519,
2472,
338,
3625,
13,
1678,
363,
1404,
297,
302,
29889,
7193,
29901,
13,
4706,
12519,
29918,
908,
353,
28578,
16542,
3260,
29889,
657,
29918,
24671,
29918,
908,
29898,
1792,
29897,
13,
4706,
12519,
29918,
908,
29889,
562,
1548,
580,
13,
13,
4706,
1018,
29901,
13,
9651,
12519,
29918,
908,
29889,
25140,
3596,
580,
13,
4706,
7146,
29901,
13,
9651,
12519,
29918,
908,
29889,
14096,
580,
13,
13,
1753,
1653,
29918,
17492,
29918,
24671,
29898,
6786,
29892,
3646,
29918,
7193,
29892,
4839,
29892,
1544,
29918,
2271,
29892,
2643,
29892,
13,
462,
18884,
12519,
29918,
1853,
29922,
12958,
1542,
29889,
1964,
20161,
1125,
13,
1678,
9995,
13,
1678,
3251,
403,
263,
2498,
12519,
1192,
451,
2729,
373,
19476,
5446,
29889,
13,
13,
1678,
584,
3207,
5446,
29901,
450,
1203,
29889,
13,
1678,
584,
1853,
5446,
29901,
770,
607,
7846,
1169,
515,
13,
1669,
584,
1990,
18078,
9695,
29879,
29889,
3221,
29889,
9695,
29879,
29918,
29885,
7443,
10599,
29889,
29907,
768,
29879,
5160,
15801,
29952,
13,
1678,
584,
3207,
8952,
29901,
450,
1404,
4969,
278,
12519,
29889,
13,
1678,
584,
1853,
8952,
29901,
851,
13,
1678,
584,
3207,
3646,
29918,
7193,
29901,
450,
1051,
310,
4160,
1058,
674,
679,
278,
12519,
29889,
13,
1678,
584,
1853,
3646,
29918,
7193,
29901,
1051,
29898,
710,
29897,
13,
1678,
584,
3207,
4839,
29901,
450,
12519,
4839,
2643,
29889,
13,
1678,
584,
1853,
4839,
29901,
1051,
29898,
710,
29897,
13,
1678,
584,
3207,
1544,
29918,
2271,
29901,
319,
1544,
3988,
363,
278,
4839,
29892,
6084,
6213,
565,
727,
338,
694,
1544,
29889,
13,
1678,
584,
1853,
1544,
29918,
2271,
29901,
851,
13,
1678,
584,
3207,
2643,
29901,
450,
12519,
2643,
29889,
13,
1678,
584,
1853,
2643,
29901,
851,
13,
1678,
584,
3207,
12519,
29918,
1853,
29901,
450,
12519,
1134,
313,
29872,
29889,
29887,
29889,
6655,
29892,
1059,
467,
13,
1678,
584,
1853,
12519,
29918,
1853,
29901,
851,
13,
1678,
9995,
13,
13,
1678,
565,
12519,
29918,
1853,
451,
297,
28578,
1542,
29889,
9818,
29901,
13,
4706,
12519,
29918,
1853,
353,
28578,
1542,
29889,
1964,
20161,
13,
13,
1678,
302,
353,
28578,
580,
13,
1678,
302,
29889,
7054,
858,
353,
8952,
13,
1678,
302,
29889,
24671,
29918,
1853,
353,
12519,
29918,
1853,
13,
1678,
302,
29889,
24671,
353,
2643,
13,
1678,
302,
29889,
6672,
353,
4839,
13,
1678,
302,
29889,
2324,
29918,
2271,
353,
1544,
29918,
2271,
13,
13,
1678,
363,
3646,
29918,
1792,
297,
3646,
29918,
7193,
29901,
13,
4706,
396,
5399,
304,
1207,
1854,
278,
1404,
2869,
4864,
13,
4706,
1404,
353,
15600,
1806,
29879,
2659,
29889,
12650,
29898,
6786,
29922,
5182,
29918,
1792,
467,
4102,
580,
13,
4706,
565,
1404,
338,
451,
6213,
29901,
13,
9651,
302,
29889,
7193,
29889,
4397,
29898,
5182,
29918,
1792,
29897,
13,
13,
1678,
396,
1016,
29915,
29873,
26051,
278,
1404,
4969,
445,
12519,
13,
1678,
302,
29889,
7193,
353,
518,
29884,
363,
318,
297,
302,
29889,
7193,
565,
318,
2804,
8952,
29962,
13,
1678,
565,
451,
7431,
29898,
29876,
29889,
7193,
1125,
13,
4706,
736,
13,
1678,
1018,
29901,
13,
4706,
302,
29889,
7620,
580,
13,
1678,
5174,
15758,
362,
2392,
29901,
13,
4706,
1209,
13,
13,
1678,
396,
9954,
284,
19998,
10534,
9717,
393,
12519,
2472,
338,
3625,
13,
1678,
363,
1404,
297,
302,
29889,
7193,
29901,
13,
4706,
12519,
29918,
908,
353,
28578,
16542,
3260,
29889,
657,
29918,
24671,
29918,
908,
29898,
1792,
29897,
13,
4706,
12519,
29918,
908,
29889,
562,
1548,
580,
13,
13,
4706,
1018,
29901,
13,
9651,
12519,
29918,
908,
29889,
25140,
3596,
580,
13,
4706,
7146,
29901,
13,
9651,
12519,
29918,
908,
29889,
14096,
580,
13,
13,
1753,
5706,
29918,
15052,
277,
29918,
24671,
29898,
6786,
29892,
5858,
29918,
1853,
29892,
5446,
29892,
3939,
29918,
9621,
29892,
13,
462,
18884,
825,
29918,
15033,
29892,
338,
29918,
1482,
29918,
1514,
29922,
8824,
1125,
13,
1678,
9995,
13,
1678,
3251,
403,
385,
12990,
277,
12519,
373,
278,
2702,
1735,
29892,
565,
22903,
29889,
13,
1678,
910,
338,
2000,
2645,
385,
12990,
277,
310,
278,
1203,
29892,
1434,
278,
3935,
4078,
13,
1678,
304,
278,
2566,
10008,
29889,
13,
13,
1678,
584,
3207,
8952,
29901,
450,
1404,
4969,
278,
12519,
29889,
13,
1678,
584,
1853,
8952,
29901,
851,
13,
1678,
584,
3207,
5858,
29918,
1853,
29901,
450,
1134,
310,
5858,
313,
29875,
29889,
29872,
29889,
4078,
470,
5217,
467,
13,
1678,
584,
1853,
5858,
29918,
1853,
29901,
851,
13,
1678,
584,
3207,
5446,
29901,
450,
1203,
29889,
13,
1678,
584,
1853,
5446,
29901,
770,
607,
7846,
1169,
515,
13,
1669,
584,
1990,
18078,
9695,
29879,
29889,
3221,
29889,
9695,
29879,
29918,
29885,
7443,
10599,
29889,
29907,
768,
29879,
5160,
15801,
29952,
13,
1678,
584,
3207,
3939,
29918,
9621,
29901,
319,
1051,
310,
1746,
2983,
393,
892,
3939,
29889,
13,
1678,
584,
1853,
3939,
29918,
9621,
29901,
1051,
310,
851,
13,
1678,
584,
3207,
2643,
29901,
319,
2643,
19138,
5281,
825,
3939,
29889,
13,
1678,
584,
1853,
2643,
29901,
851,
13,
1678,
584,
3207,
338,
29918,
1482,
29918,
1514,
29901,
1894,
293,
1078,
565,
278,
1881,
5446,
338,
15141,
2825,
29889,
13,
1678,
584,
1853,
338,
29918,
1482,
29918,
1514,
29901,
6120,
13,
1678,
9995,
13,
13,
1678,
5446,
29918,
1853,
353,
5446,
3032,
7299,
1839,
9695,
29879,
29918,
1853,
2033,
13,
13,
1678,
6969,
29918,
24671,
353,
4770,
23765,
29918,
24671,
29918,
8768,
26914,
657,
29898,
5415,
29918,
1853,
29897,
13,
13,
1678,
396,
5399,
565,
278,
5446,
338,
6969,
363,
25913,
13,
1678,
565,
6969,
29918,
24671,
338,
6213,
29901,
13,
4706,
736,
13,
13,
1678,
565,
5858,
29918,
1853,
1275,
376,
7620,
1115,
13,
4706,
2643,
353,
11860,
29879,
4784,
278,
1494,
8393,
29901,
1273,
29879,
29908,
1273,
313,
6786,
29892,
13,
462,
462,
462,
1669,
825,
29918,
15033,
29897,
13,
1678,
25342,
5858,
29918,
1853,
1275,
376,
8143,
1115,
13,
4706,
4839,
29918,
8216,
353,
5706,
29918,
24671,
29918,
6672,
29898,
5415,
29897,
13,
4706,
2643,
353,
11860,
29879,
11132,
278,
1494,
29901,
1273,
29879,
29908,
1273,
313,
6786,
29892,
13,
462,
462,
462,
1678,
4839,
29918,
8216,
29897,
13,
13,
1678,
565,
338,
29918,
1482,
29918,
1514,
29901,
13,
4706,
8974,
353,
5159,
13,
13,
4706,
565,
756,
5552,
29898,
5415,
29892,
525,
4993,
29374,
13,
9651,
8974,
353,
518,
29879,
29889,
978,
363,
269,
297,
5446,
29889,
4993,
29962,
13,
13,
4706,
2643,
353,
6213,
13,
4706,
3646,
29918,
7193,
353,
679,
29918,
1491,
7588,
2580,
29918,
7193,
29898,
5415,
29918,
1853,
29892,
5446,
29889,
333,
29892,
8974,
29897,
13,
4706,
4839,
353,
5706,
29918,
24671,
29918,
6672,
29898,
5415,
29897,
13,
4706,
1544,
29918,
2271,
353,
6213,
13,
13,
4706,
565,
756,
5552,
29898,
5415,
29892,
525,
657,
29918,
14144,
29918,
2271,
29374,
13,
9651,
1544,
29918,
2271,
353,
5446,
29889,
657,
29918,
14144,
29918,
2271,
580,
13,
13,
4706,
565,
4839,
338,
451,
6213,
29901,
13,
9651,
4839,
353,
376,
4373,
376,
718,
4839,
13,
13,
4706,
1653,
29918,
17492,
29918,
24671,
29898,
6786,
29892,
13,
462,
462,
1678,
3646,
29918,
7193,
29892,
13,
462,
462,
1678,
4839,
29892,
13,
462,
462,
1678,
1544,
29918,
2271,
29892,
13,
462,
462,
1678,
2643,
29897,
13,
13,
1678,
1889,
29918,
2914,
353,
1889,
29918,
15033,
29918,
9621,
29898,
4906,
29892,
3939,
29918,
9621,
29892,
5446,
29897,
13,
13,
1678,
2643,
353,
1889,
29918,
2914,
29889,
657,
877,
4906,
1495,
13,
1678,
2752,
29918,
4572,
353,
1889,
29918,
2914,
29889,
657,
877,
4993,
29918,
4572,
1495,
13,
13,
1678,
565,
2643,
338,
451,
6213,
29901,
13,
4706,
2643,
353,
3472,
29918,
21587,
29898,
4906,
29897,
13,
4706,
1653,
29918,
24671,
29898,
5415,
29892,
8952,
29892,
2643,
29892,
2752,
29918,
4572,
29892,
28578,
1542,
29889,
1964,
20161,
29897,
13,
13,
1753,
14405,
29918,
4993,
29918,
26705,
29898,
3784,
29918,
4993,
29918,
26705,
29892,
716,
29918,
4993,
29918,
26705,
1125,
13,
1678,
9995,
13,
1678,
422,
29890,
1475,
8974,
4208,
297,
263,
9250,
573,
982,
29892,
321,
29889,
29887,
29889,
4145,
1475,
8974,
13,
1678,
763,
263,
7223,
5300,
5858,
29892,
321,
29889,
29887,
29889,
278,
2752,
1818,
1863,
297,
1716,
8857,
29889,
13,
1678,
450,
871,
3682,
338,
565,
1857,
29918,
4993,
29918,
26705,
1275,
6213,
29892,
297,
607,
1206,
278,
13,
1678,
716,
29918,
4993,
29918,
26705,
674,
1044,
408,
278,
716,
2362,
5570,
29889,
13,
13,
1678,
584,
1853,
1857,
29918,
4993,
29918,
26705,
29901,
1051,
310,
2752,
2983,
13,
1678,
584,
3207,
1857,
29918,
4993,
29918,
26705,
29901,
1051,
29898,
710,
467,
13,
1678,
584,
1853,
716,
29918,
4993,
29918,
26705,
29901,
1051,
310,
2752,
2983,
13,
1678,
584,
3207,
716,
29918,
4993,
29918,
26705,
29901,
1051,
29898,
710,
467,
13,
1678,
584,
18280,
29901,
851,
29901,
16969,
263,
1051,
310,
12420,
2752,
2983,
29889,
13,
1678,
9995,
13,
13,
1678,
12420,
29918,
4993,
29918,
26705,
353,
5159,
13,
13,
1678,
565,
1857,
29918,
4993,
29918,
26705,
338,
6213,
29901,
13,
4706,
736,
716,
29918,
4993,
29918,
26705,
13,
1678,
1683,
29901,
13,
4706,
363,
716,
29918,
4993,
29918,
4572,
297,
716,
29918,
4993,
29918,
26705,
29901,
13,
9651,
565,
716,
29918,
4993,
29918,
4572,
297,
1857,
29918,
4993,
29918,
26705,
29901,
13,
18884,
12420,
29918,
4993,
29918,
26705,
29889,
4397,
29898,
1482,
29918,
4993,
29918,
4572,
29897,
13,
13,
1678,
736,
12420,
29918,
4993,
29918,
26705,
13,
13,
1753,
1889,
29918,
15033,
29918,
9621,
29898,
11228,
29918,
4906,
29892,
3939,
29918,
9621,
29892,
5446,
1125,
13,
1678,
9995,
13,
1678,
10554,
267,
278,
3939,
4235,
304,
8161,
825,
2869,
3939,
29889,
13,
13,
1678,
584,
3207,
2643,
29901,
530,
2847,
2643,
304,
3160,
29889,
13,
1678,
584,
1853,
2643,
29901,
851,
13,
1678,
584,
3207,
3939,
29918,
9621,
29901,
319,
1051,
310,
1746,
2983,
393,
892,
3939,
29889,
13,
1678,
584,
1853,
3939,
29918,
9621,
29901,
1051,
310,
851,
13,
1678,
584,
3207,
5446,
29901,
450,
1203,
29889,
13,
1678,
584,
1853,
5446,
29901,
770,
607,
7846,
1169,
515,
13,
1669,
584,
1990,
18078,
9695,
29879,
29889,
3221,
29889,
9695,
29879,
29918,
29885,
7443,
10599,
29889,
29907,
768,
29879,
5160,
15801,
29952,
13,
1678,
584,
18280,
29901,
851,
29901,
16969,
263,
2643,
23941,
825,
471,
3939,
29889,
13,
1678,
9995,
13,
13,
1678,
5446,
29918,
1853,
353,
5446,
3032,
7299,
1839,
9695,
29879,
29918,
1853,
2033,
13,
1678,
2643,
353,
2847,
29918,
4906,
13,
13,
1678,
565,
2643,
338,
6213,
29901,
13,
4706,
2643,
353,
6629,
13,
13,
1678,
2752,
29918,
4572,
353,
6213,
13,
13,
1678,
363,
3939,
29918,
2671,
297,
3939,
29918,
9621,
29901,
13,
13,
4706,
396,
8989,
29879,
1122,
367,
8072,
18698,
29892,
321,
29889,
29887,
29889,
2752,
29889,
29896,
29889,
2611,
2925,
29889,
29900,
29889,
5679,
13,
4706,
396,
1105,
29892,
6219,
373,
278,
525,
6169,
2931,
322,
679,
278,
3876,
310,
278,
3939,
1746,
13,
4706,
2967,
29918,
15033,
29918,
2671,
353,
341,
17280,
29924,
7443,
14256,
29889,
657,
29918,
655,
2986,
29918,
29885,
7443,
29918,
2671,
29898,
5415,
29918,
1853,
29892,
3939,
29918,
2671,
29889,
5451,
12839,
29861,
29900,
2314,
13,
13,
4706,
716,
29918,
1767,
353,
679,
5552,
29898,
5415,
29892,
2967,
29918,
15033,
29918,
2671,
29892,
27255,
13,
4706,
2030,
29918,
5415,
353,
770,
29918,
3166,
29918,
333,
29898,
5415,
29918,
1853,
29892,
5446,
29889,
333,
29897,
13,
4706,
2030,
29918,
1767,
353,
679,
5552,
29898,
1025,
29918,
5415,
29892,
2967,
29918,
15033,
29918,
2671,
29892,
27255,
13,
13,
4706,
1735,
29918,
13789,
353,
10726,
11726,
29889,
657,
29918,
15033,
29918,
2671,
29918,
13789,
29898,
5415,
29918,
1853,
29892,
2967,
29918,
15033,
29918,
2671,
29897,
13,
13,
4706,
565,
1735,
29918,
13789,
338,
451,
6213,
29901,
13,
9651,
1735,
29918,
4906,
353,
1735,
29918,
13789,
29898,
1025,
29918,
1767,
29892,
716,
29918,
1767,
29892,
2967,
29918,
15033,
29918,
2671,
29897,
13,
13,
9651,
565,
338,
8758,
29898,
3167,
29918,
4906,
29892,
9657,
1125,
13,
18884,
565,
1735,
29918,
4906,
29889,
657,
877,
4993,
29918,
4572,
1495,
338,
451,
6213,
29901,
13,
462,
1678,
716,
29918,
4993,
29918,
4572,
353,
1735,
29918,
4906,
29889,
657,
877,
4993,
29918,
4572,
1495,
13,
462,
1678,
2752,
29918,
4572,
353,
14405,
29918,
4993,
29918,
26705,
29898,
4993,
29918,
4572,
29892,
716,
29918,
4993,
29918,
4572,
29897,
13,
13,
18884,
1735,
29918,
4906,
353,
1735,
29918,
4906,
29889,
657,
877,
4906,
1495,
13,
13,
9651,
565,
1735,
29918,
4906,
338,
451,
6213,
29901,
13,
18884,
2643,
4619,
6634,
29876,
29908,
718,
1735,
29918,
4906,
7503,
29896,
1822,
5030,
2410,
675,
580,
718,
1735,
29918,
4906,
29961,
29896,
17531,
13,
4706,
1683,
29901,
13,
9651,
1735,
29918,
2671,
29918,
13789,
353,
10726,
11726,
29889,
19206,
29918,
14369,
29918,
2671,
29918,
3167,
29918,
13789,
13,
13,
9651,
565,
338,
8758,
29898,
1025,
29918,
1767,
29892,
7399,
1293,
1125,
13,
13,
18884,
1051,
29918,
1767,
353,
6213,
13,
13,
18884,
565,
7431,
29898,
1025,
29918,
1767,
29897,
1405,
29871,
29900,
29901,
13,
462,
1678,
1051,
29918,
1767,
353,
2030,
29918,
1767,
29961,
29900,
29962,
13,
18884,
25342,
7431,
29898,
1482,
29918,
1767,
29897,
1405,
29871,
29900,
29901,
13,
462,
1678,
1051,
29918,
1767,
353,
716,
29918,
1767,
29961,
29900,
29962,
13,
13,
18884,
565,
338,
8758,
29898,
1761,
29918,
1767,
29892,
2362,
342,
5393,
1125,
13,
462,
1678,
1735,
29918,
2671,
29918,
13789,
353,
10726,
11726,
29889,
19206,
29918,
1761,
29918,
3167,
29918,
13789,
13,
18884,
25342,
338,
8758,
29898,
1761,
29918,
1767,
29892,
2812,
2580,
7176,
6268,
1125,
13,
462,
1678,
1735,
29918,
2671,
29918,
13789,
353,
10726,
11726,
29889,
19206,
29918,
1761,
29918,
3126,
29918,
3167,
29918,
13789,
13,
13,
9651,
1735,
29918,
4906,
353,
1735,
29918,
2671,
29918,
13789,
29898,
1025,
29918,
1767,
29892,
716,
29918,
1767,
29892,
2967,
29918,
15033,
29918,
2671,
29897,
13,
13,
9651,
565,
338,
8758,
29898,
3167,
29918,
4906,
29892,
9657,
1125,
13,
18884,
565,
1735,
29918,
4906,
29889,
657,
877,
4993,
29918,
4572,
1495,
338,
451,
6213,
29901,
13,
462,
1678,
716,
29918,
4993,
29918,
4572,
353,
1735,
29918,
4906,
29889,
657,
877,
4993,
29918,
4572,
1495,
13,
462,
1678,
14405,
29918,
4993,
29918,
26705,
29898,
4993,
29918,
4572,
29892,
716,
29918,
4993,
29918,
4572,
29897,
13,
13,
18884,
1735,
29918,
4906,
353,
1735,
29918,
4906,
29889,
657,
877,
4906,
1495,
13,
13,
9651,
565,
1735,
29918,
4906,
338,
451,
6213,
29901,
13,
18884,
2643,
4619,
6634,
29876,
29908,
718,
1735,
29918,
4906,
7503,
29896,
1822,
5030,
2410,
675,
580,
718,
1735,
29918,
4906,
29961,
29896,
17531,
13,
13,
1678,
736,
11117,
4906,
2396,
2643,
29892,
525,
4993,
29918,
4572,
2396,
2752,
29918,
4572,
29913,
13,
13,
1753,
679,
29918,
24671,
29918,
14144,
29898,
3827,
29892,
20687,
29918,
27603,
1125,
13,
1678,
9995,
13,
1678,
3251,
403,
278,
848,
304,
4050,
278,
12519,
7928,
29879,
29889,
13,
13,
1678,
584,
3207,
2009,
29901,
450,
15337,
2009,
29889,
13,
1678,
584,
1853,
2009,
29901,
584,
1990,
18078,
14095,
29889,
1124,
29889,
26021,
29952,
13,
1678,
584,
3207,
20687,
29918,
27603,
29901,
319,
4175,
393,
1580,
11057,
393,
871,
25913,
13,
462,
539,
20687,
1135,
445,
931,
881,
367,
4133,
29889,
13,
1678,
584,
1853,
20687,
29918,
27603,
29901,
851,
297,
17723,
2539,
3402,
29889,
13,
1678,
584,
18280,
29901,
6273,
313,
8977,
29897,
13,
1678,
9995,
13,
13,
1678,
8952,
353,
2009,
29889,
1792,
29889,
6786,
13,
1678,
25913,
29918,
1761,
353,
5159,
13,
1678,
25913,
353,
6213,
13,
1678,
9281,
29918,
24671,
29918,
2230,
353,
6213,
13,
1678,
7714,
353,
28578,
16542,
3260,
29889,
657,
29918,
24671,
29918,
908,
29898,
6786,
29897,
13,
1678,
11815,
353,
29871,
29900,
13,
13,
1678,
396,
15976,
936,
4004,
29892,
1423,
565,
727,
526,
25913,
304,
367,
11233,
287,
29889,
13,
1678,
7714,
29889,
562,
1548,
580,
13,
1678,
1018,
29901,
13,
4706,
25913,
353,
679,
29918,
1792,
29918,
1333,
8232,
29898,
6786,
29892,
20687,
29918,
27603,
29922,
484,
556,
29918,
27603,
29897,
13,
13,
4706,
565,
7431,
29898,
1333,
8232,
29897,
1405,
29871,
29900,
29901,
13,
9651,
9281,
29918,
24671,
29918,
2230,
353,
851,
29898,
1333,
8232,
29961,
29900,
1822,
11600,
29897,
13,
4706,
1683,
29901,
13,
9651,
396,
694,
716,
25913,
1192,
2908,
2745,
931,
1518,
12232,
470,
7714,
6507,
13,
9651,
7714,
29889,
10685,
29898,
29953,
29900,
29897,
13,
13,
9651,
396,
7714,
471,
5492,
29892,
1423,
565,
727,
338,
738,
716,
2472,
3447,
13,
9651,
25913,
353,
679,
29918,
1792,
29918,
1333,
8232,
29898,
6786,
29892,
20687,
29918,
27603,
29922,
484,
556,
29918,
27603,
29897,
13,
13,
9651,
565,
7431,
29898,
1333,
8232,
29897,
1405,
29871,
29900,
29901,
13,
18884,
9281,
29918,
24671,
29918,
2230,
353,
851,
29898,
1333,
8232,
29961,
29900,
1822,
11600,
29897,
13,
1678,
7146,
29901,
13,
4706,
7714,
29889,
14096,
580,
13,
13,
1678,
565,
9281,
29918,
24671,
29918,
2230,
338,
451,
6213,
29901,
13,
4706,
24084,
29887,
882,
29918,
1853,
353,
2009,
29889,
1792,
29889,
657,
29918,
1457,
1659,
877,
517,
579,
29918,
1333,
8232,
742,
525,
547,
3707,
839,
29887,
882,
29918,
1853,
742,
525,
303,
18219,
1495,
13,
13,
4706,
565,
24084,
29887,
882,
29918,
1853,
1275,
525,
15619,
2396,
13,
9651,
11815,
353,
2009,
29889,
1792,
29889,
657,
29918,
1457,
1659,
877,
517,
579,
29918,
1333,
8232,
742,
525,
15619,
742,
29871,
29941,
29900,
29897,
334,
29871,
29896,
29900,
29900,
29900,
13,
13,
1678,
363,
12519,
297,
25913,
29901,
13,
4706,
5446,
353,
770,
29918,
3166,
29918,
333,
29898,
24671,
29889,
5415,
29918,
1853,
29892,
12519,
29889,
5415,
29918,
333,
29897,
13,
13,
4706,
565,
5446,
338,
451,
6213,
29901,
13,
9651,
1544,
29918,
2271,
353,
5446,
29889,
657,
29918,
14144,
29918,
2271,
580,
13,
9651,
4839,
353,
5706,
29918,
24671,
29918,
6672,
29898,
5415,
29897,
13,
4706,
1683,
29901,
13,
9651,
565,
12519,
29889,
6672,
338,
451,
6213,
29901,
13,
18884,
4839,
353,
12519,
29889,
6672,
13,
9651,
1683,
29901,
13,
18884,
4839,
353,
11860,
29879,
1273,
29879,
29908,
1273,
313,
24671,
29889,
5415,
29918,
1853,
29892,
12519,
29889,
5415,
29918,
333,
29897,
13,
13,
9651,
565,
12519,
29889,
2324,
29918,
2271,
338,
451,
6213,
29901,
13,
18884,
1544,
29918,
2271,
353,
12519,
29889,
2324,
29918,
2271,
13,
9651,
1683,
29901,
13,
18884,
1544,
29918,
2271,
353,
6213,
13,
13,
4706,
12519,
29918,
1853,
353,
12519,
29889,
24671,
29918,
1853,
13,
13,
4706,
565,
12519,
29918,
1853,
338,
6213,
470,
12519,
29918,
1853,
451,
297,
28578,
1542,
29889,
9818,
29901,
13,
9651,
12519,
29918,
1853,
353,
28578,
1542,
29889,
1964,
20161,
13,
13,
4706,
12519,
29918,
1272,
353,
426,
13,
9651,
376,
6672,
1115,
4839,
29892,
13,
9651,
376,
4906,
1115,
12519,
29889,
24671,
29892,
13,
9651,
376,
1256,
29918,
1545,
2164,
1115,
851,
29898,
24671,
29889,
11600,
29889,
710,
615,
603,
11702,
29979,
22584,
29885,
22584,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
1159,
511,
13,
9651,
376,
2324,
1115,
1544,
29918,
2271,
29892,
13,
9651,
376,
1545,
2164,
29918,
1609,
1115,
12519,
29889,
7054,
858,
29892,
13,
9651,
376,
333,
1115,
851,
29898,
24671,
29889,
333,
511,
13,
9651,
376,
1853,
1115,
12519,
29918,
1853,
29892,
13,
4706,
500,
13,
13,
4706,
25913,
29918,
1761,
29889,
4397,
29898,
24671,
29918,
1272,
29897,
13,
13,
1678,
736,
426,
13,
4706,
525,
1333,
8232,
2396,
25913,
29918,
1761,
29892,
13,
4706,
525,
1482,
342,
29918,
24671,
2396,
9281,
29918,
24671,
29918,
2230,
29892,
13,
4706,
525,
2974,
29918,
2230,
2396,
851,
29898,
12673,
29889,
12673,
29889,
3707,
2141,
710,
615,
603,
11702,
29979,
22584,
29885,
22584,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
1159,
511,
13,
4706,
525,
15619,
2396,
11815,
29892,
13,
1678,
500,
13,
13,
1753,
679,
29918,
1333,
8232,
29918,
1454,
29918,
333,
29898,
6786,
29892,
5446,
29918,
333,
29892,
5446,
29918,
1853,
1125,
13,
1678,
9995,
13,
1678,
3617,
25913,
363,
263,
2702,
2246,
29899,
5563,
1203,
322,
1404,
29889,
13,
13,
1678,
584,
3207,
8952,
29901,
450,
1404,
304,
2740,
363,
29889,
13,
1678,
584,
3207,
5446,
29918,
333,
29901,
450,
4669,
1204,
304,
2740,
363,
29889,
13,
1678,
584,
1853,
5446,
29918,
333,
29901,
851,
13,
1678,
584,
3207,
5446,
29918,
1853,
29901,
450,
2246,
29899,
5563,
1203,
1134,
29889,
13,
1678,
584,
1853,
5446,
29918,
1853,
29901,
851,
13,
1678,
584,
18280,
29901,
584,
1990,
18078,
9695,
29879,
29889,
3221,
29889,
9695,
29879,
29918,
29885,
7443,
10599,
29889,
29907,
768,
29879,
3010,
2697,
29952,
13,
1678,
9995,
13,
13,
1678,
736,
28578,
29889,
12650,
29898,
7193,
29922,
6786,
29892,
13,
462,
18884,
5446,
29918,
333,
29922,
5415,
29918,
333,
29892,
13,
462,
18884,
5446,
29918,
1853,
29922,
5415,
29918,
1853,
29897,
13,
13,
1753,
3349,
29918,
24671,
29898,
5415,
29918,
333,
1125,
13,
1678,
9995,
13,
1678,
15154,
385,
5923,
12519,
29889,
13,
13,
1678,
584,
3207,
5446,
29918,
333,
29901,
450,
2246,
29899,
5563,
4669,
1204,
304,
1284,
278,
12519,
304,
3349,
29889,
13,
1678,
584,
1853,
5446,
29918,
333,
29901,
851,
13,
1678,
584,
18280,
29901,
9657,
411,
6611,
376,
8698,
29908,
313,
20054,
29897,
322,
376,
4906,
29908,
313,
710,
467,
13,
1678,
9995,
13,
13,
1678,
12519,
353,
28578,
29889,
12650,
29898,
333,
29922,
5415,
29918,
333,
467,
4102,
580,
13,
1678,
565,
451,
12519,
29901,
13,
4706,
2643,
353,
376,
23323,
451,
1284,
12519,
304,
3349,
3850,
13,
4706,
1121,
353,
11117,
8698,
2396,
7700,
29892,
525,
4906,
2396,
2643,
29913,
13,
1678,
1683,
29901,
13,
4706,
12519,
29889,
8143,
580,
13,
4706,
2643,
353,
376,
12958,
6206,
8472,
3850,
13,
4706,
1121,
353,
11117,
8698,
2396,
5852,
29892,
525,
4906,
2396,
2643,
29913,
13,
1678,
736,
1121,
13,
13,
1753,
679,
29918,
1482,
29918,
1333,
8232,
7295,
13,
1678,
9995,
13,
1678,
3617,
738,
716,
25913,
29889,
13,
1678,
9995,
13,
13,
1678,
736,
28578,
29889,
12650,
29898,
4882,
543,
1482,
1159,
13,
13,
1753,
3349,
29918,
1792,
29918,
3166,
29918,
24671,
29898,
6786,
29892,
5446,
29918,
333,
29892,
5446,
29918,
1853,
1125,
13,
1678,
9995,
13,
1678,
15154,
263,
1404,
515,
278,
1051,
310,
4160,
363,
263,
12519,
29889,
13,
13,
1678,
584,
3207,
8952,
29901,
450,
1404,
304,
3349,
29889,
13,
1678,
584,
1853,
8952,
29901,
851,
13,
1678,
584,
3207,
5446,
29918,
333,
29901,
450,
4669,
1204,
310,
278,
2246,
29899,
5563,
1203,
363,
445,
12519,
29889,
13,
1678,
584,
1853,
5446,
29918,
333,
29901,
851,
13,
1678,
584,
3207,
5446,
29918,
1853,
29901,
450,
2246,
29899,
5563,
1203,
1134,
29889,
13,
1678,
584,
1853,
5446,
29918,
1853,
29901,
851,
13,
1678,
584,
18280,
29901,
9657,
411,
6611,
376,
8698,
29908,
313,
20054,
29897,
322,
376,
4906,
29908,
313,
710,
29897,
565,
5229,
29889,
13,
1678,
9995,
13,
13,
1678,
28578,
29889,
12650,
29898,
5415,
29918,
333,
29922,
5415,
29918,
333,
29892,
13,
462,
308,
5446,
29918,
1853,
29922,
5415,
29918,
1853,
467,
5504,
29898,
26746,
1649,
7193,
29922,
6786,
29897,
13,
1678,
736,
11117,
8698,
2396,
5852,
29913,
13,
13,
1753,
3349,
29918,
1792,
29918,
3166,
29918,
24671,
29918,
333,
29898,
6786,
29892,
1178,
1125,
13,
1678,
9995,
13,
1678,
15154,
263,
1404,
515,
278,
1051,
310,
4160,
363,
263,
12519,
29889,
13,
13,
1678,
584,
3207,
8952,
29901,
450,
1404,
304,
3349,
29889,
13,
1678,
584,
1853,
8952,
29901,
851,
13,
1678,
584,
3207,
5446,
29918,
333,
29901,
450,
4669,
1204,
310,
278,
2246,
29899,
5563,
1203,
363,
445,
12519,
29889,
13,
1678,
584,
1853,
5446,
29918,
333,
29901,
851,
13,
1678,
584,
3207,
5446,
29918,
1853,
29901,
450,
2246,
29899,
5563,
1203,
1134,
29889,
13,
1678,
584,
1853,
5446,
29918,
1853,
29901,
851,
13,
1678,
584,
18280,
29901,
9657,
411,
6611,
376,
8698,
29908,
313,
20054,
29897,
322,
376,
4906,
29908,
313,
710,
29897,
565,
5229,
29889,
13,
1678,
9995,
13,
13,
1678,
28578,
29889,
12650,
29898,
333,
29922,
333,
467,
5504,
29898,
26746,
1649,
7193,
29922,
6786,
29897,
13,
1678,
736,
11117,
8698,
2396,
5852,
29913,
13,
13,
1753,
3349,
29918,
1792,
29918,
1333,
8232,
29898,
6786,
1125,
13,
1678,
9995,
13,
1678,
15154,
263,
1404,
515,
599,
25913,
29889,
13,
13,
1678,
584,
3207,
8952,
29901,
450,
1404,
304,
3349,
29889,
13,
1678,
584,
1853,
8952,
29901,
851,
13,
1678,
584,
18280,
29901,
9657,
411,
6611,
376,
8698,
29908,
313,
20054,
29897,
322,
376,
4906,
29908,
313,
710,
29897,
565,
5229,
29889,
13,
1678,
9995,
13,
13,
1678,
28578,
29889,
12650,
29898,
7193,
29922,
6786,
467,
5504,
29898,
26746,
1649,
7193,
29922,
6786,
29897,
13,
13,
13,
1753,
679,
29918,
1792,
29918,
1333,
8232,
29898,
6786,
29892,
2302,
29922,
8824,
29892,
20687,
29918,
27603,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
3617,
278,
25913,
363,
263,
1404,
29889,
13,
13,
1678,
584,
3207,
8952,
29901,
450,
1404,
304,
679,
25913,
363,
29889,
13,
1678,
584,
1853,
8952,
29901,
851,
13,
1678,
584,
3207,
2302,
29901,
9333,
736,
278,
2302,
29889,
13,
1678,
584,
1853,
2302,
29901,
11227,
13,
1678,
584,
18280,
29901,
938,
29892,
584,
1990,
18078,
9695,
29879,
29889,
3221,
29889,
9695,
29879,
29918,
29885,
7443,
10599,
29889,
29907,
768,
29879,
3010,
2697,
29952,
13,
1678,
9995,
13,
1678,
302,
353,
6213,
13,
13,
1678,
565,
20687,
29918,
27603,
338,
6213,
470,
20687,
29918,
27603,
1275,
6213,
29901,
13,
4706,
302,
353,
28578,
29889,
12650,
29898,
7193,
29922,
6786,
467,
2098,
29918,
1609,
877,
29899,
11600,
1495,
13,
1678,
1683,
29901,
13,
4706,
302,
353,
28578,
29889,
12650,
29898,
29984,
29898,
7193,
29922,
6786,
29897,
669,
660,
29898,
11600,
1649,
4141,
29922,
484,
556,
29918,
27603,
8106,
2098,
29918,
1609,
877,
29899,
11600,
1495,
13,
13,
1678,
565,
2302,
29901,
13,
4706,
736,
7431,
29898,
29876,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
302,
13,
13,
1649,
23765,
29918,
24671,
29918,
8768,
1649,
353,
426,
13,
1678,
525,
29909,
2801,
2396,
525,
978,
742,
13,
1678,
525,
29907,
1160,
8729,
2396,
525,
978,
742,
13,
1678,
525,
20455,
8021,
2396,
525,
3487,
29945,
742,
13,
1678,
525,
20001,
2396,
525,
3318,
29918,
333,
742,
13,
1678,
525,
15951,
2396,
525,
7247,
742,
13,
1678,
525,
9823,
2396,
525,
333,
742,
13,
1678,
525,
2624,
2396,
525,
333,
742,
13,
1678,
525,
28013,
2396,
525,
333,
742,
13,
1678,
525,
5690,
2396,
525,
666,
742,
13,
1678,
525,
9026,
3301,
2396,
525,
3487,
29945,
742,
13,
1678,
525,
22131,
1469,
2396,
525,
3257,
742,
13,
1678,
525,
17708,
2396,
525,
3487,
29945,
742,
13,
1678,
525,
8667,
2396,
525,
5269,
29918,
7328,
742,
13,
29913,
13,
13,
1990,
28578,
16542,
3260,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
15629,
770,
304,
4386,
658,
4684,
363,
25913,
29889,
13,
1678,
9995,
13,
13,
1678,
4770,
24671,
29918,
6149,
735,
1649,
353,
3244,
292,
29889,
16542,
580,
13,
1678,
4770,
24671,
29918,
908,
29879,
1649,
353,
6571,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
679,
29918,
24671,
29918,
908,
29898,
25932,
29892,
8952,
1125,
13,
4706,
9995,
13,
4706,
732,
7097,
11177,
13,
13,
4706,
402,
1691,
263,
12519,
7714,
363,
278,
6790,
1404,
29892,
565,
372,
1838,
29915,
29873,
1863,
13,
4706,
769,
697,
338,
2825,
29889,
13,
4706,
9995,
13,
13,
4706,
565,
8952,
451,
297,
1067,
29879,
17255,
24671,
29918,
908,
29879,
1649,
29901,
13,
9651,
396,
12519,
7714,
1838,
29915,
29873,
1863,
363,
1404,
29892,
1653,
716,
7714,
13,
9651,
1067,
29879,
17255,
24671,
29918,
6149,
735,
26914,
562,
1548,
580,
13,
9651,
1018,
29901,
13,
18884,
396,
9109,
3765,
7120,
7714,
292,
13,
18884,
565,
8952,
451,
297,
1067,
29879,
17255,
24671,
29918,
908,
29879,
1649,
29901,
13,
462,
1678,
1067,
29879,
17255,
24671,
29918,
908,
29879,
1649,
29961,
6786,
29962,
353,
3244,
292,
29889,
25255,
580,
13,
9651,
7146,
29901,
13,
18884,
1067,
29879,
17255,
24671,
29918,
6149,
735,
26914,
14096,
580,
13,
13,
4706,
736,
1067,
29879,
17255,
24671,
29918,
908,
29879,
26914,
657,
29898,
6786,
29897,
13,
13,
13,
1753,
5706,
29918,
24671,
29918,
6672,
29898,
5415,
1125,
13,
1678,
9995,
13,
1678,
3251,
1078,
12519,
4839,
2472,
2729,
2501,
278,
1203,
1192,
445,
338,
13,
1678,
1304,
304,
758,
2161,
278,
12519,
29915,
29879,
3030,
29889,
13,
13,
1678,
6527,
10075,
367,
1304,
363,
376,
29943,
17118,
3246,
29908,
2342,
1980,
408,
1532,
29889,
13,
13,
1678,
584,
3207,
5446,
29901,
450,
2246,
29899,
5563,
1203,
13213,
630,
770,
29889,
13,
1678,
584,
1853,
5446,
29901,
770,
607,
7846,
1169,
515,
13,
1669,
584,
1990,
18078,
9695,
29879,
29889,
3221,
29889,
9695,
29879,
29918,
29885,
7443,
10599,
29889,
29907,
768,
29879,
5160,
15801,
1412,
13,
1678,
584,
18280,
29901,
851,
411,
263,
5199,
19909,
29769,
310,
278,
1203,
13,
1678,
9995,
13,
13,
1678,
5706,
29918,
24671,
29918,
6672,
29918,
13789,
353,
28578,
7850,
3260,
29889,
657,
29918,
6672,
29918,
13789,
29898,
5415,
3032,
7299,
1839,
9695,
29879,
29918,
1853,
11287,
13,
13,
1678,
565,
5706,
29918,
24671,
29918,
6672,
29918,
13789,
338,
451,
6213,
29901,
13,
4706,
736,
5706,
29918,
24671,
29918,
6672,
29918,
13789,
29898,
5415,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
11860,
29879,
29901,
1273,
29879,
29908,
1273,
313,
5415,
3032,
7299,
1839,
9695,
29879,
29918,
1853,
7464,
851,
29898,
5415,
29889,
333,
876,
13,
2
] |
pydicer/input/web.py | ShuchaoPangUNSW/pydicer | 1 | 160723 | <filename>pydicer/input/web.py
import zipfile
import urllib.request
import tempfile
from pathlib import Path
from pydicer.input.base import InputBase
def download_and_extract_zip_file(zip_url, output_directory):
"""Downloads a zip file from the URL specified and extracts the contents to the output
directory.
Args:
zip_url (str): The URL of the zip file.
output_directory (str|pathlib.Path): The path in which to extract the contents.
"""
with tempfile.TemporaryDirectory() as temp_dir:
temp_file = Path(temp_dir).joinpath("tmp.zip")
with urllib.request.urlopen(zip_url) as dl_file:
with open(temp_file, "wb") as out_file:
out_file.write(dl_file.read())
with zipfile.ZipFile(temp_file, "r") as zip_ref:
zip_ref.extractall(output_directory)
class WebInput(InputBase):
def __init__(self, data_url, working_directory=None):
"""
Class for downloading and saving input data off the internet
Args:
data_url (str): The URL of where the data is stored. For now, it must be a link to a
zip file
working_directory (str|pathlib.Path, optional): The working directory in which to
store the data fetched. Defaults to a temp directory.
"""
super().__init__(working_directory)
self.data_url = data_url
def fetch_data(self):
"""Download the data."""
files_in_directory = list(self.working_directory.glob("*"))
if len(files_in_directory) > 0:
print("Warning: Directory not empty, won't download files")
return
download_and_extract_zip_file(self.data_url, self.working_directory)
| [
1,
529,
9507,
29958,
2272,
27774,
261,
29914,
2080,
29914,
2676,
29889,
2272,
13,
5215,
14319,
1445,
13,
5215,
3142,
1982,
29889,
3827,
13,
5215,
5694,
1445,
13,
13,
3166,
2224,
1982,
1053,
10802,
13,
13,
3166,
282,
2941,
293,
261,
29889,
2080,
29889,
3188,
1053,
10567,
5160,
13,
13,
13,
1753,
5142,
29918,
392,
29918,
21111,
29918,
7554,
29918,
1445,
29898,
7554,
29918,
2271,
29892,
1962,
29918,
12322,
1125,
13,
1678,
9995,
6767,
18132,
263,
14319,
934,
515,
278,
3988,
6790,
322,
6597,
29879,
278,
8118,
304,
278,
1962,
13,
1678,
3884,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
14319,
29918,
2271,
313,
710,
1125,
450,
3988,
310,
278,
14319,
934,
29889,
13,
4706,
1962,
29918,
12322,
313,
710,
29989,
2084,
1982,
29889,
2605,
1125,
450,
2224,
297,
607,
304,
6597,
278,
8118,
29889,
13,
1678,
9995,
13,
13,
1678,
411,
5694,
1445,
29889,
5776,
1971,
653,
9882,
580,
408,
5694,
29918,
3972,
29901,
13,
4706,
5694,
29918,
1445,
353,
10802,
29898,
7382,
29918,
3972,
467,
7122,
2084,
703,
7050,
29889,
7554,
1159,
13,
13,
4706,
411,
3142,
1982,
29889,
3827,
29889,
332,
417,
2238,
29898,
7554,
29918,
2271,
29897,
408,
270,
29880,
29918,
1445,
29901,
13,
13,
9651,
411,
1722,
29898,
7382,
29918,
1445,
29892,
376,
29893,
29890,
1159,
408,
714,
29918,
1445,
29901,
13,
13,
18884,
714,
29918,
1445,
29889,
3539,
29898,
11671,
29918,
1445,
29889,
949,
3101,
13,
13,
4706,
411,
14319,
1445,
29889,
26264,
2283,
29898,
7382,
29918,
1445,
29892,
376,
29878,
1159,
408,
14319,
29918,
999,
29901,
13,
9651,
14319,
29918,
999,
29889,
21111,
497,
29898,
4905,
29918,
12322,
29897,
13,
13,
13,
1990,
2563,
4290,
29898,
4290,
5160,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
848,
29918,
2271,
29892,
1985,
29918,
12322,
29922,
8516,
1125,
13,
4706,
9995,
13,
4706,
4134,
363,
28536,
322,
14238,
1881,
848,
1283,
278,
8986,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
848,
29918,
2271,
313,
710,
1125,
450,
3988,
310,
988,
278,
848,
338,
6087,
29889,
1152,
1286,
29892,
372,
1818,
367,
263,
1544,
304,
263,
13,
9651,
14319,
934,
13,
9651,
1985,
29918,
12322,
313,
710,
29989,
2084,
1982,
29889,
2605,
29892,
13136,
1125,
450,
1985,
3884,
297,
607,
304,
13,
9651,
3787,
278,
848,
6699,
287,
29889,
13109,
29879,
304,
263,
5694,
3884,
29889,
13,
4706,
9995,
13,
4706,
2428,
2141,
1649,
2344,
12035,
22899,
29918,
12322,
29897,
13,
4706,
1583,
29889,
1272,
29918,
2271,
353,
848,
29918,
2271,
13,
13,
1678,
822,
6699,
29918,
1272,
29898,
1311,
1125,
13,
4706,
9995,
22954,
278,
848,
1213,
15945,
13,
13,
4706,
2066,
29918,
262,
29918,
12322,
353,
1051,
29898,
1311,
29889,
22899,
29918,
12322,
29889,
23705,
703,
29930,
5783,
13,
4706,
565,
7431,
29898,
5325,
29918,
262,
29918,
12322,
29897,
1405,
29871,
29900,
29901,
13,
9651,
1596,
703,
22709,
29901,
18862,
451,
4069,
29892,
2113,
29915,
29873,
5142,
2066,
1159,
13,
9651,
736,
13,
13,
4706,
5142,
29918,
392,
29918,
21111,
29918,
7554,
29918,
1445,
29898,
1311,
29889,
1272,
29918,
2271,
29892,
1583,
29889,
22899,
29918,
12322,
29897,
13,
2
] |
code/preprocess/data_process.py | hms-dbmi/VarPPUD | 0 | 34223 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 9 15:38:54 2020
@author: rayin
"""
# pic-sure api lib
import PicSureHpdsLib
import PicSureClient
# python_lib for pic-sure
# https://github.com/hms-dbmi/Access-to-Data-using-PIC-SURE-API/tree/master/NIH_Undiagnosed_Diseases_Network
from python_lib.HPDS_connection_manager import tokenManager
from python_lib.utils import get_multiIndex_variablesDict
# analysis
import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from collections import Counter
os.chdir("/Users/rayin/Google Drive/Harvard/5_data/UDN/work")
#loading raw input patient data extracted by PIC-SURE from UDN
raw_data_all = pd.read_csv("data/raw/raw_data_all.csv")
#inclusion criteria
#exclude the cases with missing values of candidate gene and variant interpretation
case_data_with_gene = []
case_data_without_gene = []
for i in range(0, len(raw_data_all)):
if pd.isna(raw_data_all[raw_data_all.columns.values[21]].iloc[i]) or pd.isna(raw_data_all[raw_data_all.columns.values[26]].iloc[i]):
case_data_without_gene.append(raw_data_all.iloc[i])
else:
case_data_with_gene.append(raw_data_all.iloc[i])
#reformat
case_data_with_gene = pd.DataFrame(case_data_with_gene).reset_index()
case_data_with_gene = case_data_with_gene.iloc[:, 1:39]
case_data_without_gene = pd.DataFrame(case_data_without_gene).reset_index()
case_data_without_gene = case_data_without_gene.iloc[:, 1:39]
#filter the samples by row, axis=0 delete row and by column, axis = 1 delete column
def data_filter(df):
row_list = []
row_count = df.shape[1]
for i in range(0, df.shape[0]):
if df.iloc[i].isna().sum() > row_count/(2/3):
print(i)
row_list.append(i)
df_delete_row = df.drop(labels=row_list, axis=0) #inplace=True
df_delete_row.reset_index(drop=True, inplace=True)
column_count = df_delete_row.shape[0]
column_list = []
for j in range(0, df_delete_row.shape[1]):
if df_delete_row[df_delete_row.columns.values[j]].isna().sum() > column_count/2:
column_list.append(j)
drop_column = []
for i in range(0, len(column_list)):
drop_column.append(df_delete_row.columns.values[column_list[i]])
df_filter = df_delete_row.drop(labels=drop_column, axis=1)
return(df_filter)
case_data_with_gene_filter = data_filter(case_data_with_gene)
#statistics and visualization
column_name = list(case_data_with_gene_filter.columns.values)
case_data_with_gene_filter[column_name[2]].describe()
#Variant interpretation. Remove the rejected and under investigation cases.
Counter(case_data_with_gene_filter[column_name[20]])
case_gene_filter_labeled = case_data_with_gene_filter[case_data_with_gene_filter['\\11_Candidate genes\\Status\\'] != 'rejected']
case_gene_filter_labeled = case_gene_filter_labeled[case_gene_filter_labeled['\\12_Candidate variants\\03 Interpretation\\'] != 'investigation_n']
#define 'benign', 'likely benign' and 'uncertain' as 'less pathogenic', 'likely pathogenic' and 'pathogenic' as pathogenic'.
case_gene_filter_labeled = case_gene_filter_labeled.replace('benign', 'less_pathogenic')
case_gene_filter_labeled = case_gene_filter_labeled.replace('likely_benign', 'less_pathogenic')
case_gene_filter_labeled = case_gene_filter_labeled.replace('variant_u_s', 'less_pathogenic')
#case_gene_filter_labeled = case_gene_filter_labeled.replace('investigation_n', 'less_pathogenic')
case_gene_filter_labeled = case_gene_filter_labeled.replace('likely_pathogenic', 'pathogenic')
case_gene_filter_labeled.to_csv("data/processed/case_gene_filter_labeled.csv") #521 cases
#Manually remove the cases with unknown or incorrect gene names ('Exon-level microarray', '22q11.2 FISH', '20p13 duplication', etc.) and
#6 cases are excluded (index (after index_reset): 4, 55, 334, 408, 422, 496)
#Loading cases after manual curation from file case_gene_update.csv'
case_gene_update = pd.read_csv('data/processed/case_gene_update.csv', index_col=0) #515 cases
column_name = list(case_gene_update.columns.values)
protein_var = case_gene_update['\\12_Candidate variants\\09 Protein\\']
#Manual curation to remove cases with missing candidate variants or complex variants (e.g., long deletion and duplication)
#Export a clean version named 'variant_clean.csv'
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
20399,
373,
15050,
3826,
259,
29929,
29871,
29896,
29945,
29901,
29941,
29947,
29901,
29945,
29946,
29871,
29906,
29900,
29906,
29900,
13,
13,
29992,
8921,
29901,
15570,
262,
13,
15945,
29908,
13,
13,
29937,
11942,
29899,
29879,
545,
7882,
4303,
13,
5215,
14612,
29903,
545,
29950,
29886,
6289,
14868,
13,
5215,
14612,
29903,
545,
4032,
13,
13,
29937,
3017,
29918,
1982,
363,
11942,
29899,
29879,
545,
13,
29937,
2045,
597,
3292,
29889,
510,
29914,
29882,
1516,
29899,
2585,
2460,
29914,
6638,
29899,
517,
29899,
1469,
29899,
4746,
29899,
2227,
29907,
29899,
29903,
11499,
29899,
8787,
29914,
8336,
29914,
6207,
29914,
12916,
29950,
29918,
25263,
29875,
4211,
2662,
29918,
29928,
895,
2129,
29918,
13724,
13,
3166,
3017,
29918,
1982,
29889,
3954,
8452,
29918,
9965,
29918,
12847,
1053,
5993,
3260,
13,
3166,
3017,
29918,
1982,
29889,
13239,
1053,
679,
29918,
9910,
3220,
29918,
20897,
21533,
13,
13,
29937,
7418,
13,
5215,
2897,
13,
5215,
11701,
408,
10518,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
12655,
408,
7442,
13,
3166,
16250,
1053,
315,
5336,
13,
13,
13,
359,
29889,
305,
3972,
11974,
5959,
29914,
764,
262,
29914,
14207,
22850,
29914,
21972,
16927,
29914,
29945,
29918,
1272,
29914,
15789,
29940,
29914,
1287,
1159,
13,
13,
29937,
13234,
10650,
1881,
16500,
848,
23892,
491,
349,
2965,
29899,
29903,
11499,
515,
501,
28307,
29871,
13,
1610,
29918,
1272,
29918,
497,
353,
10518,
29889,
949,
29918,
7638,
703,
1272,
29914,
1610,
29914,
1610,
29918,
1272,
29918,
497,
29889,
7638,
1159,
13,
13,
29937,
262,
10085,
16614,
4706,
13,
29937,
735,
2325,
278,
4251,
411,
4567,
1819,
310,
14020,
18530,
322,
17305,
19854,
13,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
353,
5159,
13,
4878,
29918,
1272,
29918,
14037,
29918,
29887,
1600,
353,
5159,
13,
1454,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
1610,
29918,
1272,
29918,
497,
22164,
13,
1678,
565,
10518,
29889,
275,
1056,
29898,
1610,
29918,
1272,
29918,
497,
29961,
1610,
29918,
1272,
29918,
497,
29889,
13099,
29889,
5975,
29961,
29906,
29896,
29962,
1822,
309,
542,
29961,
29875,
2314,
470,
10518,
29889,
275,
1056,
29898,
1610,
29918,
1272,
29918,
497,
29961,
1610,
29918,
1272,
29918,
497,
29889,
13099,
29889,
5975,
29961,
29906,
29953,
29962,
1822,
309,
542,
29961,
29875,
29962,
1125,
13,
4706,
1206,
29918,
1272,
29918,
14037,
29918,
29887,
1600,
29889,
4397,
29898,
1610,
29918,
1272,
29918,
497,
29889,
309,
542,
29961,
29875,
2314,
13,
1678,
1683,
29901,
13,
4706,
1206,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
29889,
4397,
29898,
1610,
29918,
1272,
29918,
497,
29889,
309,
542,
29961,
29875,
2314,
13,
13,
29937,
276,
4830,
308,
13,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
353,
10518,
29889,
17271,
29898,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
467,
12071,
29918,
2248,
580,
13,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
353,
1206,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
29889,
309,
542,
7503,
29892,
29871,
29896,
29901,
29941,
29929,
29962,
13,
4878,
29918,
1272,
29918,
14037,
29918,
29887,
1600,
353,
10518,
29889,
17271,
29898,
4878,
29918,
1272,
29918,
14037,
29918,
29887,
1600,
467,
12071,
29918,
2248,
580,
13,
4878,
29918,
1272,
29918,
14037,
29918,
29887,
1600,
353,
1206,
29918,
1272,
29918,
14037,
29918,
29887,
1600,
29889,
309,
542,
7503,
29892,
29871,
29896,
29901,
29941,
29929,
29962,
13,
13,
13,
29937,
4572,
278,
11916,
491,
1948,
29892,
9685,
29922,
29900,
5217,
1948,
322,
491,
1897,
29892,
9685,
353,
29871,
29896,
5217,
1897,
13,
1753,
848,
29918,
4572,
29898,
2176,
1125,
13,
1678,
1948,
29918,
1761,
353,
5159,
13,
1678,
1948,
29918,
2798,
353,
4489,
29889,
12181,
29961,
29896,
29962,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
4489,
29889,
12181,
29961,
29900,
29962,
1125,
13,
4706,
565,
4489,
29889,
309,
542,
29961,
29875,
1822,
275,
1056,
2141,
2083,
580,
1405,
1948,
29918,
2798,
14571,
29906,
29914,
29941,
1125,
29871,
13,
9651,
1596,
29898,
29875,
29897,
13,
9651,
1948,
29918,
1761,
29889,
4397,
29898,
29875,
29897,
13,
308,
13,
1678,
4489,
29918,
8143,
29918,
798,
353,
4489,
29889,
8865,
29898,
21134,
29922,
798,
29918,
1761,
29892,
9685,
29922,
29900,
29897,
396,
262,
6689,
29922,
5574,
13,
1678,
4489,
29918,
8143,
29918,
798,
29889,
12071,
29918,
2248,
29898,
8865,
29922,
5574,
29892,
297,
6689,
29922,
5574,
29897,
13,
13,
13,
1678,
1897,
29918,
2798,
353,
4489,
29918,
8143,
29918,
798,
29889,
12181,
29961,
29900,
29962,
13,
1678,
1897,
29918,
1761,
353,
5159,
13,
1678,
363,
432,
297,
3464,
29898,
29900,
29892,
4489,
29918,
8143,
29918,
798,
29889,
12181,
29961,
29896,
29962,
1125,
13,
4706,
565,
4489,
29918,
8143,
29918,
798,
29961,
2176,
29918,
8143,
29918,
798,
29889,
13099,
29889,
5975,
29961,
29926,
29962,
1822,
275,
1056,
2141,
2083,
580,
1405,
1897,
29918,
2798,
29914,
29906,
29901,
13,
9651,
1897,
29918,
1761,
29889,
4397,
29898,
29926,
29897,
13,
13,
1678,
5768,
29918,
4914,
353,
5159,
29871,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
4914,
29918,
1761,
22164,
13,
4706,
5768,
29918,
4914,
29889,
4397,
29898,
2176,
29918,
8143,
29918,
798,
29889,
13099,
29889,
5975,
29961,
4914,
29918,
1761,
29961,
29875,
24960,
13,
268,
13,
1678,
4489,
29918,
4572,
353,
4489,
29918,
8143,
29918,
798,
29889,
8865,
29898,
21134,
29922,
8865,
29918,
4914,
29892,
9685,
29922,
29896,
29897,
13,
1678,
736,
29898,
2176,
29918,
4572,
29897,
13,
13,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
29918,
4572,
353,
848,
29918,
4572,
29898,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
29897,
13,
13,
13,
29937,
6112,
6765,
322,
7604,
2133,
13,
4914,
29918,
978,
353,
1051,
29898,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
29918,
4572,
29889,
13099,
29889,
5975,
29897,
13,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
29918,
4572,
29961,
4914,
29918,
978,
29961,
29906,
29962,
1822,
2783,
29581,
580,
13,
13,
29937,
10444,
424,
19854,
29889,
15154,
278,
22225,
322,
1090,
22522,
4251,
29889,
13,
17779,
29898,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
29918,
4572,
29961,
4914,
29918,
978,
29961,
29906,
29900,
24960,
13,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
353,
1206,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
29918,
4572,
29961,
4878,
29918,
1272,
29918,
2541,
29918,
29887,
1600,
29918,
4572,
1839,
1966,
29896,
29896,
29918,
29907,
5380,
403,
2531,
267,
1966,
5709,
1966,
2033,
2804,
525,
276,
622,
287,
2033,
13,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
353,
1206,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
29961,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
1839,
1966,
29896,
29906,
29918,
29907,
5380,
403,
29161,
1966,
29900,
29941,
4124,
19819,
362,
1966,
2033,
2804,
525,
11569,
5286,
362,
29918,
29876,
2033,
13,
13,
29937,
7922,
525,
1785,
647,
742,
525,
21280,
3856,
647,
29915,
322,
525,
4661,
13946,
29915,
408,
525,
2222,
2224,
6352,
293,
742,
525,
21280,
2224,
6352,
293,
29915,
322,
525,
2084,
6352,
293,
29915,
408,
2224,
6352,
293,
4286,
13,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
353,
1206,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
29889,
6506,
877,
1785,
647,
742,
525,
2222,
29918,
2084,
6352,
293,
1495,
13,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
353,
1206,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
29889,
6506,
877,
21280,
29918,
1785,
647,
742,
525,
2222,
29918,
2084,
6352,
293,
1495,
13,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
353,
1206,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
29889,
6506,
877,
19365,
29918,
29884,
29918,
29879,
742,
525,
2222,
29918,
2084,
6352,
293,
1495,
13,
29937,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
353,
1206,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
29889,
6506,
877,
11569,
5286,
362,
29918,
29876,
742,
525,
2222,
29918,
2084,
6352,
293,
1495,
13,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
353,
1206,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
29889,
6506,
877,
21280,
29918,
2084,
6352,
293,
742,
525,
2084,
6352,
293,
1495,
13,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
29889,
517,
29918,
7638,
703,
1272,
29914,
5014,
287,
29914,
4878,
29918,
29887,
1600,
29918,
4572,
29918,
29880,
24025,
29889,
7638,
1159,
29871,
396,
29945,
29906,
29896,
4251,
13,
13,
29937,
2517,
1474,
3349,
278,
4251,
411,
9815,
470,
10240,
18530,
2983,
6702,
1252,
265,
29899,
5563,
9200,
2378,
742,
525,
29906,
29906,
29939,
29896,
29896,
29889,
29906,
383,
3235,
29950,
742,
525,
29906,
29900,
29886,
29896,
29941,
5141,
1414,
742,
2992,
1846,
322,
29871,
13,
29937,
29953,
4251,
526,
429,
13347,
313,
2248,
313,
7045,
2380,
29918,
12071,
1125,
29871,
29946,
29892,
29871,
29945,
29945,
29892,
29871,
29941,
29941,
29946,
29892,
29871,
29946,
29900,
29947,
29892,
29871,
29946,
29906,
29906,
29892,
29871,
29946,
29929,
29953,
29897,
13,
29937,
23456,
4251,
1156,
12219,
274,
2633,
515,
934,
1206,
29918,
29887,
1600,
29918,
5504,
29889,
7638,
29915,
13,
4878,
29918,
29887,
1600,
29918,
5504,
353,
10518,
29889,
949,
29918,
7638,
877,
1272,
29914,
5014,
287,
29914,
4878,
29918,
29887,
1600,
29918,
5504,
29889,
7638,
742,
2380,
29918,
1054,
29922,
29900,
29897,
396,
29945,
29896,
29945,
4251,
13,
4914,
29918,
978,
353,
1051,
29898,
4878,
29918,
29887,
1600,
29918,
5504,
29889,
13099,
29889,
5975,
29897,
13,
14676,
262,
29918,
1707,
353,
1206,
29918,
29887,
1600,
29918,
5504,
1839,
1966,
29896,
29906,
29918,
29907,
5380,
403,
29161,
1966,
29900,
29929,
14409,
262,
1966,
2033,
13,
13,
29937,
2517,
950,
274,
2633,
304,
3349,
4251,
411,
4567,
14020,
29161,
470,
4280,
29161,
313,
29872,
29889,
29887,
1696,
1472,
7374,
291,
322,
5141,
1414,
29897,
29871,
13,
29937,
26382,
263,
5941,
1873,
4257,
29871,
525,
19365,
29918,
14941,
29889,
7638,
29915,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
13,
2
] |
shop_mollie/modifiers.py | bartpijn/djangoshop-mollie | 0 | 1615795 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import date
from django.utils.translation import ugettext_lazy as _
from shop.payment.modifiers import PaymentModifier
from .payment import MolliePayment
class MolliePaymentModifier(PaymentModifier):
payment_provider = MolliePayment()
commision_percentage = None
def get_choice(self):
return (self.identifier, _("iDeal"))
def is_disabled(self, cart):
return cart.total == 0
def add_extra_cart_row(self, cart, request):
from decimal import Decimal
from shop.serializers.cart import ExtraCartRow
if not self.is_active(cart) or not self.commision_percentage:
return
amount = cart.total * Decimal(self.commision_percentage / 100.0)
instance = {'label': _("+ {}% handling fee").format(self.commision_percentage), 'amount': amount}
cart.extra_rows[self.identifier] = ExtraCartRow(instance)
cart.total += amount
def update_render_context(self, context):
super(MolliePaymentModifier, self).update_render_context(context)
today = date.today()
context['payment_modifiers']['month_range'] = \
[(date(2000, m, 1).strftime('%m'), date(2000, m, 1).strftime('%b')) for m in range(1, 13)]
context['payment_modifiers']['years_range'] = range(today.year, today.year + 11)
context['payment_modifiers']['mollie_payment'] = True
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
3166,
12865,
1053,
2635,
13,
3166,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
318,
657,
726,
29918,
433,
1537,
408,
903,
13,
3166,
18296,
29889,
27825,
29889,
1545,
14903,
1053,
14617,
358,
2111,
3709,
13,
3166,
869,
27825,
1053,
341,
3028,
347,
15467,
358,
13,
13,
13,
1990,
341,
3028,
347,
15467,
358,
2111,
3709,
29898,
15467,
358,
2111,
3709,
1125,
13,
1678,
19179,
29918,
18121,
353,
341,
3028,
347,
15467,
358,
580,
13,
1678,
844,
2459,
29918,
25376,
482,
353,
6213,
13,
13,
1678,
822,
679,
29918,
16957,
29898,
1311,
1125,
13,
4706,
736,
313,
1311,
29889,
25378,
29892,
903,
703,
29875,
2772,
284,
5783,
13,
13,
1678,
822,
338,
29918,
18279,
29898,
1311,
29892,
7774,
1125,
13,
4706,
736,
7774,
29889,
7827,
1275,
29871,
29900,
13,
13,
1678,
822,
788,
29918,
17833,
29918,
13823,
29918,
798,
29898,
1311,
29892,
7774,
29892,
2009,
1125,
13,
4706,
515,
13677,
1053,
3826,
3039,
13,
4706,
515,
18296,
29889,
15550,
19427,
29889,
13823,
1053,
7338,
336,
25233,
4301,
13,
13,
4706,
565,
451,
1583,
29889,
275,
29918,
4925,
29898,
13823,
29897,
470,
451,
1583,
29889,
2055,
2459,
29918,
25376,
482,
29901,
13,
9651,
736,
13,
4706,
5253,
353,
7774,
29889,
7827,
334,
3826,
3039,
29898,
1311,
29889,
2055,
2459,
29918,
25376,
482,
847,
29871,
29896,
29900,
29900,
29889,
29900,
29897,
13,
4706,
2777,
353,
11117,
1643,
2396,
903,
703,
29974,
6571,
29995,
11415,
27684,
2564,
4830,
29898,
1311,
29889,
2055,
2459,
29918,
25376,
482,
511,
525,
14506,
2396,
5253,
29913,
13,
4706,
7774,
29889,
17833,
29918,
5727,
29961,
1311,
29889,
25378,
29962,
353,
7338,
336,
25233,
4301,
29898,
8758,
29897,
13,
4706,
7774,
29889,
7827,
4619,
5253,
13,
13,
1678,
822,
2767,
29918,
9482,
29918,
4703,
29898,
1311,
29892,
3030,
1125,
13,
4706,
2428,
29898,
29924,
3028,
347,
15467,
358,
2111,
3709,
29892,
1583,
467,
5504,
29918,
9482,
29918,
4703,
29898,
4703,
29897,
13,
4706,
9826,
353,
2635,
29889,
27765,
580,
13,
4706,
3030,
1839,
27825,
29918,
1545,
14903,
16215,
10874,
29918,
3881,
2033,
353,
320,
13,
9651,
17288,
1256,
29898,
29906,
29900,
29900,
29900,
29892,
286,
29892,
29871,
29896,
467,
710,
615,
603,
877,
29995,
29885,
5477,
2635,
29898,
29906,
29900,
29900,
29900,
29892,
286,
29892,
29871,
29896,
467,
710,
615,
603,
877,
29995,
29890,
8785,
363,
286,
297,
3464,
29898,
29896,
29892,
29871,
29896,
29941,
4638,
13,
4706,
3030,
1839,
27825,
29918,
1545,
14903,
16215,
6360,
29879,
29918,
3881,
2033,
353,
3464,
29898,
27765,
29889,
6360,
29892,
9826,
29889,
6360,
718,
29871,
29896,
29896,
29897,
13,
4706,
3030,
1839,
27825,
29918,
1545,
14903,
16215,
29885,
3028,
347,
29918,
27825,
2033,
353,
5852,
13,
308,
2
] |
qutebrowser/fkd/tiparoj-vulpo.py | ebzzry/dotfiles | 30 | 167276 | <filename>qutebrowser/fkd/tiparoj-vulpo.py
#---------------------------------------------------------------------------------------------------
# Tiparoj
#---------------------------------------------------------------------------------------------------
c.fonts.completion.category = "bold 8pt monospace"
c.fonts.completion.entry = "8pt monospace"
c.fonts.debug_console = "8pt monospace"
c.fonts.downloads = "8pt monospace"
c.fonts.hints = "bold 8pt monospace"
c.fonts.keyhint = "8pt monospace"
c.fonts.messages.error = "8pt monospace"
c.fonts.messages.info = "8pt monospace"
c.fonts.messages.warning = "8pt monospace"
c.fonts.prompts = "8pt sans-serif"
c.fonts.statusbar = "8pt monospace"
c.fonts.tabs.selected = "8pt sans-serif"
c.fonts.tabs.unselected = "8pt sans-serif"
c.fonts.default_family = "Monospace, DejaVu Sans Mono"
| [
1,
529,
9507,
29958,
29939,
329,
774,
8777,
29914,
29888,
29895,
29881,
29914,
12632,
279,
3848,
29899,
29894,
352,
1129,
29889,
2272,
13,
29937,
2683,
2683,
2683,
2683,
2683,
2683,
5634,
13,
29937,
323,
666,
279,
3848,
13,
29937,
2683,
2683,
2683,
2683,
2683,
2683,
5634,
13,
13,
29883,
29889,
28586,
29889,
5729,
12757,
29889,
7320,
353,
376,
8934,
29871,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
5729,
12757,
29889,
8269,
353,
376,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
8382,
29918,
11058,
353,
376,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
10382,
29879,
353,
376,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
29882,
9466,
353,
376,
8934,
29871,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
1989,
29882,
524,
353,
376,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
19158,
29889,
2704,
353,
376,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
19158,
29889,
3888,
353,
376,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
19158,
29889,
27392,
353,
376,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
14032,
16485,
353,
376,
29947,
415,
7209,
29899,
643,
361,
29908,
13,
29883,
29889,
28586,
29889,
4882,
1646,
353,
376,
29947,
415,
1601,
359,
3535,
29908,
13,
29883,
29889,
28586,
29889,
21175,
29889,
8391,
353,
376,
29947,
415,
7209,
29899,
643,
361,
29908,
13,
29883,
29889,
28586,
29889,
21175,
29889,
348,
8391,
353,
376,
29947,
415,
7209,
29899,
643,
361,
29908,
13,
29883,
29889,
28586,
29889,
4381,
29918,
11922,
353,
376,
7185,
359,
3535,
29892,
897,
1764,
29963,
29884,
27677,
2598,
29877,
29908,
13,
2
] |
jake/test/test_audit.py | lvcarlosja/jake | 0 | 23803 | #
# Copyright 2019-Present Sonatype Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
""" test_audit.py , for all your testing of audit py needs """
import unittest
import json
from pathlib import Path
from ..audit.audit import Audit
from ..types.results_decoder import ResultsDecoder
class TestAudit(unittest.TestCase):
""" TestAudit is responsible for testing the Audit class """
def setUp(self):
self.func = Audit()
def test_call_audit_results_prints_output(self):
""" test_call_audit_results_prints_output ensures that when called with
a valid result, audit_results returns the number of vulnerabilities found """
filename = Path(__file__).parent / "ossindexresponse.txt"
with open(filename, "r") as stdin:
response = json.loads(
stdin.read(),
cls=ResultsDecoder)
self.assertEqual(self.func.audit_results(response),
self.expected_results())
@staticmethod
def expected_results():
""" Weeee, I'm helping! """
return 3
| [
1,
396,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29929,
29899,
13504,
296,
5791,
23179,
9266,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
29937,
13,
13,
15945,
29908,
1243,
29918,
15052,
277,
29889,
2272,
1919,
363,
599,
596,
6724,
310,
12990,
277,
11451,
4225,
9995,
13,
5215,
443,
27958,
13,
5215,
4390,
13,
13,
3166,
2224,
1982,
1053,
10802,
13,
13,
3166,
6317,
15052,
277,
29889,
15052,
277,
1053,
8612,
277,
13,
3166,
6317,
8768,
29889,
9902,
29918,
7099,
6119,
1053,
17212,
6185,
6119,
13,
13,
1990,
4321,
29909,
566,
277,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
29871,
9995,
4321,
29909,
566,
277,
338,
14040,
363,
6724,
278,
8612,
277,
770,
9995,
13,
29871,
822,
731,
3373,
29898,
1311,
1125,
13,
1678,
1583,
29889,
9891,
353,
8612,
277,
580,
13,
13,
29871,
822,
1243,
29918,
4804,
29918,
15052,
277,
29918,
9902,
29918,
2158,
29879,
29918,
4905,
29898,
1311,
1125,
13,
1678,
9995,
1243,
29918,
4804,
29918,
15052,
277,
29918,
9902,
29918,
2158,
29879,
29918,
4905,
5662,
1973,
393,
746,
2000,
411,
13,
1678,
263,
2854,
1121,
29892,
12990,
277,
29918,
9902,
3639,
278,
1353,
310,
23180,
11614,
1476,
9995,
13,
1678,
10422,
353,
10802,
22168,
1445,
1649,
467,
3560,
847,
376,
2209,
2248,
5327,
29889,
3945,
29908,
13,
1678,
411,
1722,
29898,
9507,
29892,
376,
29878,
1159,
408,
3659,
262,
29901,
13,
418,
2933,
353,
4390,
29889,
18132,
29898,
13,
3986,
3659,
262,
29889,
949,
3285,
13,
3986,
1067,
29879,
29922,
12191,
6185,
6119,
29897,
13,
1678,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
9891,
29889,
15052,
277,
29918,
9902,
29898,
5327,
511,
13,
462,
268,
1583,
29889,
9684,
29918,
9902,
3101,
13,
13,
29871,
732,
7959,
5696,
13,
29871,
822,
3806,
29918,
9902,
7295,
13,
1678,
9995,
1334,
3905,
29872,
29892,
306,
29915,
29885,
19912,
29991,
9995,
13,
1678,
736,
29871,
29941,
13,
2
] |
cogs/moderation.py | chenghaoli36/covid-help-bot-bridgehacks | 0 | 102822 | # moderation.py
# houses all the moderation code. very useful other than the fact that 80% of bots have these commands.
import discord
from discord.ext import commands
class Moderation(commands.Cog):
def __init__(self,client):
self.client = client
@commands.command()
@commands.has_permissions(manage_messages=True)
async def clear(self, ctx,amount=10):
await ctx.channel.purge(limit = amount+1)
@commands.command()
@commands.has_permissions(kick_members=True)
async def kick(self, ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)
await ctx.send("Member kicked:"+member.mention)
@commands.command()
@commands.has_permissions(ban_members=True)
async def ban(self, ctx, member : discord.Member, *, reason=None):
await member.ban(reason=reason)
await ctx.send("Member banned:"+member.mention)
@commands.command()
@commands.has_permissions(ban_members=True)
async def unban(self, ctx, *, member):
banned_users = await ctx.guild.bans()
member_name,member_discriminator = member.split('#')
for ban_entry in banned_users:
user = ban_entry.user
if(user.name, user.discriminator)==(member_name,member_discriminator):
await ctx.guild.unban(user)
await ctx.send("Member unbanned:"+user.mention)
return
def setup(client):
client.add_cog(Moderation(client)) | [
1,
396,
17768,
362,
29889,
2272,
13,
13,
29937,
12955,
599,
278,
17768,
362,
775,
29889,
1407,
5407,
916,
1135,
278,
2114,
393,
29871,
29947,
29900,
29995,
310,
289,
1862,
505,
1438,
8260,
29889,
13,
13,
5215,
2313,
536,
13,
3166,
2313,
536,
29889,
1062,
1053,
8260,
13,
13,
1990,
3382,
261,
362,
29898,
26381,
29889,
29907,
468,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4645,
1125,
13,
4706,
1583,
29889,
4645,
353,
3132,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
19158,
29922,
5574,
29897,
13,
1678,
7465,
822,
2821,
29898,
1311,
29892,
12893,
29892,
14506,
29922,
29896,
29900,
1125,
13,
4706,
7272,
12893,
29889,
12719,
29889,
15503,
479,
29898,
13400,
353,
5253,
29974,
29896,
29897,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
29895,
860,
29918,
28109,
29922,
5574,
29897,
13,
1678,
7465,
822,
24817,
29898,
1311,
29892,
12893,
29892,
4509,
584,
2313,
536,
29889,
13404,
29892,
334,
29892,
2769,
29922,
8516,
1125,
13,
4706,
7272,
4509,
29889,
29895,
860,
29898,
23147,
29922,
23147,
29897,
13,
4706,
7272,
12893,
29889,
6717,
703,
13404,
413,
17840,
6160,
29974,
14242,
29889,
358,
291,
29897,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
2571,
29918,
28109,
29922,
5574,
29897,
13,
1678,
7465,
822,
9892,
29898,
1311,
29892,
12893,
29892,
4509,
584,
2313,
536,
29889,
13404,
29892,
334,
29892,
2769,
29922,
8516,
1125,
13,
4706,
7272,
4509,
29889,
2571,
29898,
23147,
29922,
23147,
29897,
13,
4706,
7272,
12893,
29889,
6717,
703,
13404,
289,
11310,
6160,
29974,
14242,
29889,
358,
291,
29897,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
2571,
29918,
28109,
29922,
5574,
29897,
13,
1678,
7465,
822,
443,
2571,
29898,
1311,
29892,
12893,
29892,
334,
29892,
4509,
1125,
13,
4706,
289,
11310,
29918,
7193,
353,
7272,
12893,
29889,
2543,
789,
29889,
29890,
550,
580,
13,
4706,
4509,
29918,
978,
29892,
14242,
29918,
2218,
29883,
20386,
1061,
353,
4509,
29889,
5451,
14237,
1495,
13,
4706,
363,
9892,
29918,
8269,
297,
289,
11310,
29918,
7193,
29901,
13,
9651,
1404,
353,
9892,
29918,
8269,
29889,
1792,
13,
9651,
565,
29898,
1792,
29889,
978,
29892,
1404,
29889,
2218,
29883,
20386,
1061,
29897,
1360,
29898,
14242,
29918,
978,
29892,
14242,
29918,
2218,
29883,
20386,
1061,
1125,
13,
18884,
7272,
12893,
29889,
2543,
789,
29889,
348,
2571,
29898,
1792,
29897,
13,
18884,
7272,
12893,
29889,
6717,
703,
13404,
443,
29890,
11310,
6160,
29974,
1792,
29889,
358,
291,
29897,
13,
18884,
736,
13,
13,
1753,
6230,
29898,
4645,
1125,
13,
1678,
3132,
29889,
1202,
29918,
29883,
468,
29898,
2111,
261,
362,
29898,
4645,
876,
2
] |
tests/L0/run_optimizers/test_lamb.py | Muflhi01/apex | 6,523 | 152101 | import unittest
import os
import torch
from torch.optim import Optimizer
import apex
from apex.multi_tensor_apply import multi_tensor_applier
from itertools import product
class RefLAMB(Optimizer):
r"""Implements Lamb algorithm.
It has been proposed in `Large Batch Optimization for Deep Learning: Training BERT in 76 minutes`_.
Arguments:
params (iterable): iterable of parameters to optimize or dicts defining
parameter groups
lr (float, optional): learning rate (default: 1e-3)
betas (Tuple[float, float], optional): coefficients used for computing
running averages of gradient and its square (default: (0.9, 0.999))
eps (float, optional): term added to the denominator to improve
numerical stability (default: 1e-6)
weight_decay (float, optional): weight decay (L2 penalty) (default: 0.01)
.. _Large Batch Optimization for Deep Learning: Training BERT in 76 minutes:
https://arxiv.org/abs/1904.00962
"""
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-6, weight_decay=0.01):
if not 0.0 <= lr:
raise ValueError("Invalid learning rate: {}".format(lr))
if not 0.0 <= eps:
raise ValueError("Invalid epsilon value: {}".format(eps))
if not 0.0 <= betas[0] < 1.0:
raise ValueError("Invalid beta parameter at index 0: {}".format(betas[0]))
if not 0.0 <= betas[1] < 1.0:
raise ValueError("Invalid beta parameter at index 1: {}".format(betas[1]))
defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay)
super(RefLAMB, self).__init__(params, defaults)
if multi_tensor_applier.available:
import amp_C
self.multi_tensor_l2norm=amp_C.multi_tensor_l2norm
# Skip buffer
self._dummy_overflow_buf = torch.tensor([0], dtype=torch.int, device=self.param_groups[0]["params"][0].device)
self.multi_tensor_lamb = amp_C.multi_tensor_lamb
else:
raise RuntimeError('apex.optimizers.FusedLAMB requires cuda extensions')
def step(self, closure=None):
"""Performs a single optimization step.
Arguments:
closure (callable, optional): A closure that reevaluates the model
and returns the loss.
"""
loss = None
if closure is not None:
loss = closure()
# create separate grad lists for fp32 and fp16 params
g_all_32, g_all_16 = [], []
for group in self.param_groups:
for p in group['params']:
if p.grad is None:
continue
if p.dtype == torch.float32:
g_all_32.append(p.grad.data)
elif p.dtype == torch.float16:
g_all_16.append(p.grad.data)
else:
raise RuntimeError('FusedLAMB only support fp16 and fp32.')
device = self.param_groups[0]["params"][0].device
g_norm_32, g_norm_16 = torch.zeros(1, device=device), torch.zeros(1, device=device)
# compute grad norm for two lists
if len(g_all_32) > 0:
g_norm_32 = multi_tensor_applier(self.multi_tensor_l2norm,
self._dummy_overflow_buf,
[g_all_32], False)[0]
if len(g_all_16) > 0:
g_norm_16 = multi_tensor_applier(self.multi_tensor_l2norm,
self._dummy_overflow_buf,
[g_all_16], False)[0]
# blend two grad norms to get global grad norm
global_grad_norm = multi_tensor_applier(self.multi_tensor_l2norm,
self._dummy_overflow_buf,
[[g_norm_32, g_norm_16]],
False)[0]
max_grad_norm = 1.0
clipped_ratio = max_grad_norm / max(global_grad_norm, max_grad_norm)
for group in self.param_groups:
for p in group['params']:
if p.grad is None:
continue
p.grad.data *= clipped_ratio
grad = p.grad.data
if grad.is_sparse:
raise RuntimeError('Lamb does not support sparse gradients, consider SparseAdam instad.')
state = self.state[p]
# State initialization
if len(state) == 0:
state['step'] = 0
# Exponential moving average of gradient values
state['m'] = torch.zeros_like(p.data)
# Exponential moving average of squared gradient values
state['v'] = torch.zeros_like(p.data)
m_t, v_t = state['m'], state['v']
beta1, beta2 = group['betas']
state['step'] += 1
# m_t = beta1 * m + (1 - beta1) * g_t
m_t.mul_(beta1).add_(grad, alpha=1-beta1)
# v_t = beta2 * v + (1 - beta2) * (g_t * g_t)
v_t.mul_(beta2).addcmul_(grad, grad, value=1-beta2)
# Debiasing
m_t_hat = m_t / (1.0 - beta1 ** state['step'])
v_t_hat = v_t / (1.0 - beta2 ** state['step'])
update = m_t_hat / v_t_hat.sqrt().add(group['eps'])
if group['weight_decay'] != 0:
update.add_(p.data, alpha=group['weight_decay'])
trust_ratio = 1.0
w_norm = p.data.pow(2).sum().sqrt()
g_norm = update.pow(2).sum().sqrt()
if w_norm > 0 and g_norm > 0:
trust_ratio = w_norm / g_norm
state['w_norm'] = w_norm
state['g_norm'] = g_norm
state['trust_ratio'] = trust_ratio
step_size = group['lr']
p.data.add_(update, alpha=-step_size*trust_ratio)
return loss
class TestLamb(unittest.TestCase):
def setUp(self, max_abs_diff=1e-3, max_rel_diff=1, iters=7):
self.max_abs_diff = max_abs_diff
self.max_rel_diff = max_rel_diff
self.iters = iters
torch.cuda.manual_seed(9876)
def tearDown(self):
pass
def gen_param_optim(self, tensors, lamb_option):
ref_param = []
tst_param = []
for tensor in tensors:
ref_param.append(torch.nn.Parameter(tensor.clone()))
tst_param.append(torch.nn.Parameter(tensor.clone()))
ref_optim = self.ref_optim(ref_param, **lamb_option)
tst_optim = self.tst_optim(tst_param, use_nvlamb=True, **lamb_option)
return (ref_param, tst_param, ref_optim, tst_optim)
def gen_grad(self, ref_param, tst_param):
for p_ref, p_tst in zip(ref_param, tst_param):
p_ref.grad = torch.rand_like(p_ref)
p_tst.grad = p_ref.grad
def gen_mixed_grad(self, ref_param, tst_param, scale=1.0):
half_grads = []
for p_ref, _ in zip(ref_param, tst_param):
half_grads.append(torch.rand_like(p_ref).half())
p_ref.grad = half_grads[-1].float() / scale
return half_grads
def get_max_diff(self, ref_param, tst_param):
max_abs_diff = max_rel_diff = 0
for p_ref, p_tst in zip(ref_param, tst_param):
max_abs_diff_p = (p_ref - p_tst).abs().max().item()
max_rel_diff_p = ((p_ref - p_tst) / p_ref).abs().max().item()
if max_abs_diff_p > max_abs_diff: max_abs_diff = max_abs_diff_p
if max_rel_diff_p > max_rel_diff: max_rel_diff = max_rel_diff_p
return max_abs_diff, max_rel_diff
def gen_single_type_test(self, param_type=torch.float, device="cuda"):
nelem = 278011
tensor = torch.rand(nelem, dtype=param_type, device=device)
weight_decay = [0, 0.01]
for wd in weight_decay:
lamb_option = {'lr':5e-4, 'betas':(0.9, 0.999), 'eps':1e-08, 'weight_decay':wd}
ref_param, tst_param, ref_optim, tst_optim = \
self.gen_param_optim([tensor], lamb_option)
for i in range(self.iters):
self.gen_grad(ref_param, tst_param)
ref_optim.step()
torch.cuda.synchronize()
tst_optim.step()
torch.cuda.synchronize()
max_abs_diff, max_rel_diff = self.get_max_diff(ref_param, tst_param)
self.assertLessEqual(max_abs_diff, self.max_abs_diff)
self.assertLessEqual(max_rel_diff, self.max_rel_diff)
class TestFusedLAMB(TestLamb):
def __init__(self, *args, **kwargs):
super(TestLamb, self).__init__(*args, **kwargs)
self.ref_optim = RefLAMB
self.tst_optim = apex.optimizers.FusedLAMB
def test_float(self):
self.gen_single_type_test(param_type=torch.float)
@unittest.skip("PyTorch optimizer is not numerically correct for fp16")
def test_half(self):
self.gen_single_type_test(param_type=torch.float16)
@unittest.skipIf(torch.cuda.device_count()<2, "more than 1 GPU required")
def test_multi_device(self):
devices = ("cuda:0", "cuda:1")
for current_dev, tensor_dev in product(devices, devices):
with torch.cuda.device(current_dev):
self.gen_single_type_test(param_type=torch.float, device=tensor_dev)
def test_multi_params(self):
sizes = [[4096, 1024], [4096], [4096, 2048], [32320, 1024], [1]]
weight_decay = [0, 0.01]
for wd in weight_decay:
lamb_option = {'lr':5e-4, 'betas':(0.9, 0.999), 'eps':1e-08, 'weight_decay':wd}
tensors = []
for size in sizes:
tensors.append(torch.rand(size, dtype=torch.float, device='cuda'))
ref_param, tst_param, ref_optim, tst_optim = \
self.gen_param_optim(tensors, lamb_option)
for i in range(self.iters):
self.gen_grad(ref_param, tst_param)
ref_optim.step()
tst_optim.step()
max_abs_diff, max_rel_diff = self.get_max_diff(ref_param, tst_param)
self.assertLessEqual(max_abs_diff, self.max_abs_diff)
self.assertLessEqual(max_rel_diff, self.max_rel_diff)
def test_lamb_option(self):
nelem = 1
tensor = torch.rand(nelem, dtype=torch.float, device='cuda')
weight_decay = [0, 0.01]
for wd in weight_decay:
lamb_option = {'lr':0.01, 'betas':(0.6, 0.9), 'eps':3e-06, 'weight_decay':wd}
ref_param, tst_param, ref_optim, tst_optim = \
self.gen_param_optim([tensor], lamb_option)
for i in range(self.iters):
self.gen_grad(ref_param, tst_param)
ref_optim.step()
tst_optim.step()
max_abs_diff, max_rel_diff = self.get_max_diff(ref_param, tst_param)
self.assertLessEqual(max_abs_diff, self.max_abs_diff)
self.assertLessEqual(max_rel_diff, self.max_rel_diff)
class TestFusedMixedPrecisionLamb(TestLamb):
def __init__(self, *args, **kwargs):
super(TestLamb, self).__init__(*args, **kwargs)
self.ref_optim = RefLAMB
self.tst_optim = apex.optimizers.FusedMixedPrecisionLamb
def test_float(self):
self.gen_single_type_test(param_type=torch.float)
@unittest.skip("PyTorch optimizer is not numerically correct for fp16")
def test_half(self):
self.gen_single_type_test(param_type=torch.float16)
@unittest.skipIf(torch.cuda.device_count()<2, "more than 1 GPU required")
def test_multi_device(self):
devices = ("cuda:0", "cuda:1")
for current_dev, tensor_dev in product(devices, devices):
with torch.cuda.device(current_dev):
self.gen_single_type_test(param_type=torch.float, device=tensor_dev)
def test_multi_params(self):
sizes = [[4096, 1024], [4096], [4096, 2048], [32320, 1024], [1]]
weight_decay = [0, 0.01]
for wd in weight_decay:
lamb_option = {'lr':5e-4, 'betas':(0.9, 0.999), 'eps':1e-08, 'weight_decay':wd}
tensors = []
for size in sizes:
tensors.append(torch.rand(size, dtype=torch.float, device='cuda'))
ref_param, tst_param, ref_optim, tst_optim = \
self.gen_param_optim(tensors, lamb_option)
for i in range(self.iters):
self.gen_grad(ref_param, tst_param)
ref_optim.step()
tst_optim.step()
max_abs_diff, max_rel_diff = self.get_max_diff(ref_param, tst_param)
self.assertLessEqual(max_abs_diff, self.max_abs_diff)
self.assertLessEqual(max_rel_diff, self.max_rel_diff)
def test_lamb_option(self):
nelem = 1
tensor = torch.rand(nelem, dtype=torch.float, device='cuda')
weight_decay = [0, 0.01]
for wd in weight_decay:
lamb_option = {'lr':0.01, 'betas':(0.6, 0.9), 'eps':3e-06, 'weight_decay':wd}
ref_param, tst_param, ref_optim, tst_optim = \
self.gen_param_optim([tensor], lamb_option)
for i in range(self.iters):
self.gen_grad(ref_param, tst_param)
ref_optim.step()
tst_optim.step()
max_abs_diff, max_rel_diff = self.get_max_diff(ref_param, tst_param)
self.assertLessEqual(max_abs_diff, self.max_abs_diff)
self.assertLessEqual(max_rel_diff, self.max_rel_diff)
if __name__ == '__main__':
script_path = os.path.dirname(os.path.realpath(__file__))
unittest.main()
| [
1,
1053,
443,
27958,
13,
5215,
2897,
13,
13,
5215,
4842,
305,
13,
3166,
4842,
305,
29889,
20640,
1053,
20693,
326,
3950,
13,
5215,
263,
412,
29916,
13,
3166,
263,
412,
29916,
29889,
9910,
29918,
20158,
29918,
7302,
1053,
2473,
29918,
20158,
29918,
932,
4926,
13,
3166,
4256,
8504,
1053,
3234,
13,
13,
1990,
9897,
4375,
9486,
29898,
20624,
326,
3950,
1125,
13,
1678,
364,
15945,
29908,
1888,
9711,
26832,
5687,
29889,
13,
13,
1678,
739,
756,
1063,
7972,
297,
421,
24105,
479,
350,
905,
20693,
326,
2133,
363,
21784,
29257,
29901,
26101,
350,
20161,
297,
29871,
29955,
29953,
6233,
29952,
5396,
13,
13,
1678,
11842,
9331,
29901,
13,
4706,
8636,
313,
1524,
519,
1125,
4256,
519,
310,
4128,
304,
24656,
470,
9657,
29879,
16184,
13,
9651,
3443,
6471,
13,
4706,
301,
29878,
313,
7411,
29892,
13136,
1125,
6509,
6554,
313,
4381,
29901,
29871,
29896,
29872,
29899,
29941,
29897,
13,
4706,
1010,
294,
313,
23215,
552,
29961,
7411,
29892,
5785,
1402,
13136,
1125,
16127,
1304,
363,
20602,
13,
9651,
2734,
4759,
1179,
310,
16030,
322,
967,
6862,
313,
4381,
29901,
313,
29900,
29889,
29929,
29892,
29871,
29900,
29889,
29929,
29929,
29929,
876,
13,
4706,
321,
567,
313,
7411,
29892,
13136,
1125,
1840,
2715,
304,
278,
14267,
1061,
304,
11157,
13,
9651,
16259,
25806,
313,
4381,
29901,
29871,
29896,
29872,
29899,
29953,
29897,
13,
4706,
7688,
29918,
7099,
388,
313,
7411,
29892,
13136,
1125,
7688,
20228,
313,
29931,
29906,
27368,
29897,
313,
4381,
29901,
29871,
29900,
29889,
29900,
29896,
29897,
13,
13,
1678,
6317,
903,
24105,
479,
350,
905,
20693,
326,
2133,
363,
21784,
29257,
29901,
26101,
350,
20161,
297,
29871,
29955,
29953,
6233,
29901,
13,
4706,
2045,
597,
279,
26560,
29889,
990,
29914,
6897,
29914,
29896,
29929,
29900,
29946,
29889,
29900,
29900,
29929,
29953,
29906,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
8636,
29892,
301,
29878,
29922,
29896,
29872,
29899,
29941,
29892,
1010,
294,
7607,
29900,
29889,
29929,
29892,
29871,
29900,
29889,
29929,
29929,
29929,
511,
321,
567,
29922,
29896,
29872,
29899,
29953,
29892,
7688,
29918,
7099,
388,
29922,
29900,
29889,
29900,
29896,
1125,
13,
4706,
565,
451,
29871,
29900,
29889,
29900,
5277,
301,
29878,
29901,
13,
9651,
12020,
7865,
2392,
703,
13919,
6509,
6554,
29901,
6571,
1642,
4830,
29898,
29212,
876,
13,
4706,
565,
451,
29871,
29900,
29889,
29900,
5277,
321,
567,
29901,
13,
9651,
12020,
7865,
2392,
703,
13919,
321,
3232,
995,
29901,
6571,
1642,
4830,
29898,
8961,
876,
13,
4706,
565,
451,
29871,
29900,
29889,
29900,
5277,
1010,
294,
29961,
29900,
29962,
529,
29871,
29896,
29889,
29900,
29901,
13,
9651,
12020,
7865,
2392,
703,
13919,
21762,
3443,
472,
2380,
29871,
29900,
29901,
6571,
1642,
4830,
29898,
6878,
294,
29961,
29900,
12622,
13,
4706,
565,
451,
29871,
29900,
29889,
29900,
5277,
1010,
294,
29961,
29896,
29962,
529,
29871,
29896,
29889,
29900,
29901,
13,
9651,
12020,
7865,
2392,
703,
13919,
21762,
3443,
472,
2380,
29871,
29896,
29901,
6571,
1642,
4830,
29898,
6878,
294,
29961,
29896,
12622,
13,
4706,
21274,
353,
9657,
29898,
29212,
29922,
29212,
29892,
1010,
294,
29922,
6878,
294,
29892,
321,
567,
29922,
8961,
29892,
7688,
29918,
7099,
388,
29922,
7915,
29918,
7099,
388,
29897,
13,
4706,
2428,
29898,
5620,
4375,
9486,
29892,
1583,
467,
1649,
2344,
12035,
7529,
29892,
21274,
29897,
13,
4706,
565,
2473,
29918,
20158,
29918,
932,
4926,
29889,
16515,
29901,
13,
9651,
1053,
21332,
29918,
29907,
13,
9651,
1583,
29889,
9910,
29918,
20158,
29918,
29880,
29906,
12324,
29922,
1160,
29918,
29907,
29889,
9910,
29918,
20158,
29918,
29880,
29906,
12324,
13,
9651,
396,
4971,
666,
6835,
13,
9651,
1583,
3032,
29881,
11770,
29918,
2262,
29918,
9721,
353,
4842,
305,
29889,
20158,
4197,
29900,
1402,
26688,
29922,
7345,
305,
29889,
524,
29892,
4742,
29922,
1311,
29889,
3207,
29918,
13155,
29961,
29900,
29962,
3366,
7529,
3108,
29961,
29900,
1822,
10141,
29897,
13,
9651,
1583,
29889,
9910,
29918,
20158,
29918,
29880,
1117,
353,
21332,
29918,
29907,
29889,
9910,
29918,
20158,
29918,
29880,
1117,
13,
4706,
1683,
29901,
13,
9651,
12020,
24875,
2392,
877,
4085,
29916,
29889,
20640,
19427,
29889,
29943,
3880,
4375,
9486,
6858,
274,
6191,
17752,
1495,
13,
13,
1678,
822,
4331,
29898,
1311,
29892,
18424,
29922,
8516,
1125,
13,
4706,
9995,
5894,
9514,
263,
2323,
13883,
4331,
29889,
13,
4706,
11842,
9331,
29901,
13,
9651,
18424,
313,
4804,
519,
29892,
13136,
1125,
319,
18424,
393,
337,
24219,
1078,
278,
1904,
13,
18884,
322,
3639,
278,
6410,
29889,
13,
4706,
9995,
13,
4706,
6410,
353,
6213,
13,
4706,
565,
18424,
338,
451,
6213,
29901,
13,
9651,
6410,
353,
18424,
580,
13,
13,
4706,
396,
1653,
5004,
4656,
8857,
363,
285,
29886,
29941,
29906,
322,
285,
29886,
29896,
29953,
8636,
13,
4706,
330,
29918,
497,
29918,
29941,
29906,
29892,
330,
29918,
497,
29918,
29896,
29953,
353,
19997,
5159,
13,
4706,
363,
2318,
297,
1583,
29889,
3207,
29918,
13155,
29901,
13,
9651,
363,
282,
297,
2318,
1839,
7529,
2033,
29901,
13,
18884,
565,
282,
29889,
5105,
338,
6213,
29901,
13,
462,
1678,
6773,
13,
18884,
565,
282,
29889,
29881,
1853,
1275,
4842,
305,
29889,
7411,
29941,
29906,
29901,
13,
462,
1678,
330,
29918,
497,
29918,
29941,
29906,
29889,
4397,
29898,
29886,
29889,
5105,
29889,
1272,
29897,
13,
18884,
25342,
282,
29889,
29881,
1853,
1275,
4842,
305,
29889,
7411,
29896,
29953,
29901,
13,
462,
1678,
330,
29918,
497,
29918,
29896,
29953,
29889,
4397,
29898,
29886,
29889,
5105,
29889,
1272,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
12020,
24875,
2392,
877,
29943,
3880,
4375,
9486,
871,
2304,
285,
29886,
29896,
29953,
322,
285,
29886,
29941,
29906,
29889,
1495,
13,
13,
4706,
4742,
353,
1583,
29889,
3207,
29918,
13155,
29961,
29900,
29962,
3366,
7529,
3108,
29961,
29900,
1822,
10141,
13,
4706,
330,
29918,
12324,
29918,
29941,
29906,
29892,
330,
29918,
12324,
29918,
29896,
29953,
353,
4842,
305,
29889,
3298,
359,
29898,
29896,
29892,
4742,
29922,
10141,
511,
4842,
305,
29889,
3298,
359,
29898,
29896,
29892,
4742,
29922,
10141,
29897,
13,
4706,
396,
10272,
4656,
6056,
363,
1023,
8857,
13,
4706,
565,
7431,
29898,
29887,
29918,
497,
29918,
29941,
29906,
29897,
1405,
29871,
29900,
29901,
13,
9651,
330,
29918,
12324,
29918,
29941,
29906,
353,
2473,
29918,
20158,
29918,
932,
4926,
29898,
1311,
29889,
9910,
29918,
20158,
29918,
29880,
29906,
12324,
29892,
13,
462,
462,
632,
1583,
3032,
29881,
11770,
29918,
2262,
29918,
9721,
29892,
13,
462,
462,
632,
518,
29887,
29918,
497,
29918,
29941,
29906,
1402,
7700,
9601,
29900,
29962,
13,
4706,
565,
7431,
29898,
29887,
29918,
497,
29918,
29896,
29953,
29897,
1405,
29871,
29900,
29901,
13,
9651,
330,
29918,
12324,
29918,
29896,
29953,
353,
2473,
29918,
20158,
29918,
932,
4926,
29898,
1311,
29889,
9910,
29918,
20158,
29918,
29880,
29906,
12324,
29892,
13,
462,
462,
632,
1583,
3032,
29881,
11770,
29918,
2262,
29918,
9721,
29892,
13,
462,
462,
632,
518,
29887,
29918,
497,
29918,
29896,
29953,
1402,
7700,
9601,
29900,
29962,
13,
13,
4706,
396,
1999,
355,
1023,
4656,
6056,
29879,
304,
679,
5534,
4656,
6056,
13,
4706,
5534,
29918,
5105,
29918,
12324,
353,
2473,
29918,
20158,
29918,
932,
4926,
29898,
1311,
29889,
9910,
29918,
20158,
29918,
29880,
29906,
12324,
29892,
13,
462,
462,
18884,
1583,
3032,
29881,
11770,
29918,
2262,
29918,
9721,
29892,
13,
462,
462,
18884,
5519,
29887,
29918,
12324,
29918,
29941,
29906,
29892,
330,
29918,
12324,
29918,
29896,
29953,
20526,
13,
462,
462,
18884,
7700,
9601,
29900,
29962,
13,
13,
4706,
4236,
29918,
5105,
29918,
12324,
353,
29871,
29896,
29889,
29900,
13,
4706,
9335,
2986,
29918,
3605,
601,
353,
4236,
29918,
5105,
29918,
12324,
847,
4236,
29898,
10945,
29918,
5105,
29918,
12324,
29892,
4236,
29918,
5105,
29918,
12324,
29897,
13,
13,
4706,
363,
2318,
297,
1583,
29889,
3207,
29918,
13155,
29901,
13,
9651,
363,
282,
297,
2318,
1839,
7529,
2033,
29901,
13,
18884,
565,
282,
29889,
5105,
338,
6213,
29901,
13,
462,
1678,
6773,
13,
18884,
282,
29889,
5105,
29889,
1272,
334,
29922,
9335,
2986,
29918,
3605,
601,
13,
18884,
4656,
353,
282,
29889,
5105,
29889,
1272,
13,
18884,
565,
4656,
29889,
275,
29918,
29879,
5510,
29901,
13,
462,
1678,
12020,
24875,
2392,
877,
29931,
1117,
947,
451,
2304,
29234,
4656,
10070,
29892,
2050,
317,
5510,
3253,
314,
832,
328,
29889,
1495,
13,
13,
18884,
2106,
353,
1583,
29889,
3859,
29961,
29886,
29962,
13,
13,
18884,
396,
4306,
17865,
13,
18884,
565,
7431,
29898,
3859,
29897,
1275,
29871,
29900,
29901,
13,
462,
1678,
2106,
1839,
10568,
2033,
353,
29871,
29900,
13,
462,
1678,
396,
1222,
1112,
2556,
8401,
6588,
310,
16030,
1819,
13,
462,
1678,
2106,
1839,
29885,
2033,
353,
4842,
305,
29889,
3298,
359,
29918,
4561,
29898,
29886,
29889,
1272,
29897,
13,
462,
1678,
396,
1222,
1112,
2556,
8401,
6588,
310,
10674,
1965,
16030,
1819,
13,
462,
1678,
2106,
1839,
29894,
2033,
353,
4842,
305,
29889,
3298,
359,
29918,
4561,
29898,
29886,
29889,
1272,
29897,
13,
13,
18884,
286,
29918,
29873,
29892,
325,
29918,
29873,
353,
2106,
1839,
29885,
7464,
2106,
1839,
29894,
2033,
13,
18884,
21762,
29896,
29892,
21762,
29906,
353,
2318,
1839,
6878,
294,
2033,
13,
13,
18884,
2106,
1839,
10568,
2033,
4619,
29871,
29896,
13,
13,
18884,
396,
286,
29918,
29873,
353,
21762,
29896,
334,
286,
718,
313,
29896,
448,
21762,
29896,
29897,
334,
330,
29918,
29873,
13,
18884,
286,
29918,
29873,
29889,
16109,
23538,
3571,
29896,
467,
1202,
23538,
5105,
29892,
15595,
29922,
29896,
29899,
3571,
29896,
29897,
13,
18884,
396,
325,
29918,
29873,
353,
21762,
29906,
334,
325,
718,
313,
29896,
448,
21762,
29906,
29897,
334,
313,
29887,
29918,
29873,
334,
330,
29918,
29873,
29897,
13,
18884,
325,
29918,
29873,
29889,
16109,
23538,
3571,
29906,
467,
1202,
4912,
352,
23538,
5105,
29892,
4656,
29892,
995,
29922,
29896,
29899,
3571,
29906,
29897,
13,
13,
18884,
396,
7089,
3173,
292,
13,
18884,
286,
29918,
29873,
29918,
2455,
353,
286,
29918,
29873,
847,
313,
29896,
29889,
29900,
448,
21762,
29896,
3579,
2106,
1839,
10568,
11287,
13,
18884,
325,
29918,
29873,
29918,
2455,
353,
325,
29918,
29873,
847,
313,
29896,
29889,
29900,
448,
21762,
29906,
3579,
2106,
1839,
10568,
11287,
13,
13,
18884,
2767,
353,
286,
29918,
29873,
29918,
2455,
847,
325,
29918,
29873,
29918,
2455,
29889,
3676,
2141,
1202,
29898,
2972,
1839,
8961,
11287,
13,
13,
18884,
565,
2318,
1839,
7915,
29918,
7099,
388,
2033,
2804,
29871,
29900,
29901,
13,
462,
1678,
2767,
29889,
1202,
23538,
29886,
29889,
1272,
29892,
15595,
29922,
2972,
1839,
7915,
29918,
7099,
388,
11287,
13,
13,
18884,
9311,
29918,
3605,
601,
353,
29871,
29896,
29889,
29900,
13,
18884,
281,
29918,
12324,
353,
282,
29889,
1272,
29889,
12248,
29898,
29906,
467,
2083,
2141,
3676,
580,
13,
18884,
330,
29918,
12324,
353,
2767,
29889,
12248,
29898,
29906,
467,
2083,
2141,
3676,
580,
13,
18884,
565,
281,
29918,
12324,
1405,
29871,
29900,
322,
330,
29918,
12324,
1405,
29871,
29900,
29901,
13,
462,
1678,
9311,
29918,
3605,
601,
353,
281,
29918,
12324,
847,
330,
29918,
12324,
13,
13,
18884,
2106,
1839,
29893,
29918,
12324,
2033,
353,
281,
29918,
12324,
13,
18884,
2106,
1839,
29887,
29918,
12324,
2033,
353,
330,
29918,
12324,
13,
18884,
2106,
1839,
509,
504,
29918,
3605,
601,
2033,
353,
9311,
29918,
3605,
601,
13,
13,
18884,
4331,
29918,
2311,
353,
2318,
1839,
29212,
2033,
13,
13,
18884,
282,
29889,
1272,
29889,
1202,
23538,
5504,
29892,
15595,
10457,
10568,
29918,
2311,
29930,
509,
504,
29918,
3605,
601,
29897,
13,
13,
4706,
736,
6410,
13,
13,
1990,
4321,
29931,
1117,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
29892,
4236,
29918,
6897,
29918,
12765,
29922,
29896,
29872,
29899,
29941,
29892,
4236,
29918,
2674,
29918,
12765,
29922,
29896,
29892,
372,
414,
29922,
29955,
1125,
13,
4706,
1583,
29889,
3317,
29918,
6897,
29918,
12765,
353,
4236,
29918,
6897,
29918,
12765,
13,
4706,
1583,
29889,
3317,
29918,
2674,
29918,
12765,
353,
4236,
29918,
2674,
29918,
12765,
13,
4706,
1583,
29889,
277,
414,
353,
372,
414,
13,
4706,
4842,
305,
29889,
29883,
6191,
29889,
11288,
29918,
26776,
29898,
29929,
29947,
29955,
29953,
29897,
13,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
1209,
13,
13,
1678,
822,
2531,
29918,
3207,
29918,
20640,
29898,
1311,
29892,
25187,
943,
29892,
301,
1117,
29918,
3385,
1125,
13,
4706,
2143,
29918,
3207,
353,
5159,
13,
4706,
260,
303,
29918,
3207,
353,
5159,
13,
4706,
363,
12489,
297,
25187,
943,
29901,
13,
9651,
2143,
29918,
3207,
29889,
4397,
29898,
7345,
305,
29889,
15755,
29889,
9329,
29898,
20158,
29889,
16513,
22130,
13,
9651,
260,
303,
29918,
3207,
29889,
4397,
29898,
7345,
305,
29889,
15755,
29889,
9329,
29898,
20158,
29889,
16513,
22130,
13,
13,
4706,
2143,
29918,
20640,
353,
1583,
29889,
999,
29918,
20640,
29898,
999,
29918,
3207,
29892,
3579,
29880,
1117,
29918,
3385,
29897,
13,
4706,
260,
303,
29918,
20640,
353,
1583,
29889,
29873,
303,
29918,
20640,
29898,
29873,
303,
29918,
3207,
29892,
671,
29918,
29876,
20901,
1117,
29922,
5574,
29892,
3579,
29880,
1117,
29918,
3385,
29897,
13,
13,
4706,
736,
313,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29892,
2143,
29918,
20640,
29892,
260,
303,
29918,
20640,
29897,
13,
13,
1678,
822,
2531,
29918,
5105,
29898,
1311,
29892,
2143,
29918,
3207,
29892,
260,
303,
29918,
3207,
1125,
13,
4706,
363,
282,
29918,
999,
29892,
282,
29918,
29873,
303,
297,
14319,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
1125,
13,
9651,
282,
29918,
999,
29889,
5105,
353,
4842,
305,
29889,
9502,
29918,
4561,
29898,
29886,
29918,
999,
29897,
13,
9651,
282,
29918,
29873,
303,
29889,
5105,
353,
282,
29918,
999,
29889,
5105,
13,
13,
1678,
822,
2531,
29918,
29885,
11925,
29918,
5105,
29898,
1311,
29892,
2143,
29918,
3207,
29892,
260,
303,
29918,
3207,
29892,
6287,
29922,
29896,
29889,
29900,
1125,
13,
4706,
4203,
29918,
5105,
29879,
353,
5159,
13,
4706,
363,
282,
29918,
999,
29892,
903,
297,
14319,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
1125,
13,
9651,
4203,
29918,
5105,
29879,
29889,
4397,
29898,
7345,
305,
29889,
9502,
29918,
4561,
29898,
29886,
29918,
999,
467,
24498,
3101,
13,
9651,
282,
29918,
999,
29889,
5105,
353,
4203,
29918,
5105,
29879,
14352,
29896,
1822,
7411,
580,
847,
6287,
13,
4706,
736,
4203,
29918,
5105,
29879,
13,
13,
1678,
822,
679,
29918,
3317,
29918,
12765,
29898,
1311,
29892,
2143,
29918,
3207,
29892,
260,
303,
29918,
3207,
1125,
13,
4706,
4236,
29918,
6897,
29918,
12765,
353,
4236,
29918,
2674,
29918,
12765,
353,
29871,
29900,
13,
4706,
363,
282,
29918,
999,
29892,
282,
29918,
29873,
303,
297,
14319,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
1125,
13,
9651,
4236,
29918,
6897,
29918,
12765,
29918,
29886,
353,
313,
29886,
29918,
999,
448,
282,
29918,
29873,
303,
467,
6897,
2141,
3317,
2141,
667,
580,
13,
9651,
4236,
29918,
2674,
29918,
12765,
29918,
29886,
353,
5135,
29886,
29918,
999,
448,
282,
29918,
29873,
303,
29897,
847,
282,
29918,
999,
467,
6897,
2141,
3317,
2141,
667,
580,
13,
13,
9651,
565,
4236,
29918,
6897,
29918,
12765,
29918,
29886,
1405,
4236,
29918,
6897,
29918,
12765,
29901,
29871,
4236,
29918,
6897,
29918,
12765,
353,
4236,
29918,
6897,
29918,
12765,
29918,
29886,
13,
9651,
565,
4236,
29918,
2674,
29918,
12765,
29918,
29886,
1405,
4236,
29918,
2674,
29918,
12765,
29901,
29871,
4236,
29918,
2674,
29918,
12765,
353,
4236,
29918,
2674,
29918,
12765,
29918,
29886,
13,
13,
4706,
736,
4236,
29918,
6897,
29918,
12765,
29892,
4236,
29918,
2674,
29918,
12765,
13,
13,
1678,
822,
2531,
29918,
14369,
29918,
1853,
29918,
1688,
29898,
1311,
29892,
1828,
29918,
1853,
29922,
7345,
305,
29889,
7411,
29892,
4742,
543,
29883,
6191,
29908,
1125,
13,
4706,
452,
2409,
353,
29871,
29906,
29955,
29947,
29900,
29896,
29896,
13,
4706,
12489,
353,
4842,
305,
29889,
9502,
29898,
484,
2409,
29892,
26688,
29922,
3207,
29918,
1853,
29892,
4742,
29922,
10141,
29897,
13,
4706,
7688,
29918,
7099,
388,
353,
518,
29900,
29892,
29871,
29900,
29889,
29900,
29896,
29962,
13,
13,
4706,
363,
281,
29881,
297,
7688,
29918,
7099,
388,
29901,
13,
9651,
301,
1117,
29918,
3385,
353,
11117,
29212,
2396,
29945,
29872,
29899,
29946,
29892,
525,
6878,
294,
2396,
29898,
29900,
29889,
29929,
29892,
29871,
29900,
29889,
29929,
29929,
29929,
511,
525,
8961,
2396,
29896,
29872,
29899,
29900,
29947,
29892,
525,
7915,
29918,
7099,
388,
2396,
9970,
29913,
13,
9651,
2143,
29918,
3207,
29892,
260,
303,
29918,
3207,
29892,
2143,
29918,
20640,
29892,
260,
303,
29918,
20640,
353,
320,
13,
18884,
1583,
29889,
1885,
29918,
3207,
29918,
20640,
4197,
20158,
1402,
301,
1117,
29918,
3385,
29897,
13,
13,
9651,
363,
474,
297,
3464,
29898,
1311,
29889,
277,
414,
1125,
13,
18884,
1583,
29889,
1885,
29918,
5105,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
18884,
2143,
29918,
20640,
29889,
10568,
580,
13,
18884,
4842,
305,
29889,
29883,
6191,
29889,
29879,
9524,
675,
580,
13,
18884,
260,
303,
29918,
20640,
29889,
10568,
580,
13,
18884,
4842,
305,
29889,
29883,
6191,
29889,
29879,
9524,
675,
580,
13,
18884,
4236,
29918,
6897,
29918,
12765,
29892,
4236,
29918,
2674,
29918,
12765,
353,
1583,
29889,
657,
29918,
3317,
29918,
12765,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
6897,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
6897,
29918,
12765,
29897,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
2674,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
2674,
29918,
12765,
29897,
13,
13,
1990,
4321,
29943,
3880,
4375,
9486,
29898,
3057,
29931,
1117,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
2428,
29898,
3057,
29931,
1117,
29892,
1583,
467,
1649,
2344,
1649,
10456,
5085,
29892,
3579,
19290,
29897,
13,
4706,
1583,
29889,
999,
29918,
20640,
353,
9897,
4375,
9486,
13,
4706,
1583,
29889,
29873,
303,
29918,
20640,
353,
263,
412,
29916,
29889,
20640,
19427,
29889,
29943,
3880,
4375,
9486,
13,
13,
13,
1678,
822,
1243,
29918,
7411,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1885,
29918,
14369,
29918,
1853,
29918,
1688,
29898,
3207,
29918,
1853,
29922,
7345,
305,
29889,
7411,
29897,
13,
13,
1678,
732,
348,
27958,
29889,
11014,
703,
19737,
29911,
25350,
5994,
3950,
338,
451,
4825,
1711,
1959,
363,
285,
29886,
29896,
29953,
1159,
13,
1678,
822,
1243,
29918,
24498,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1885,
29918,
14369,
29918,
1853,
29918,
1688,
29898,
3207,
29918,
1853,
29922,
7345,
305,
29889,
7411,
29896,
29953,
29897,
13,
13,
1678,
732,
348,
27958,
29889,
11014,
3644,
29898,
7345,
305,
29889,
29883,
6191,
29889,
10141,
29918,
2798,
580,
29966,
29906,
29892,
376,
5514,
1135,
29871,
29896,
22796,
3734,
1159,
13,
1678,
822,
1243,
29918,
9910,
29918,
10141,
29898,
1311,
1125,
13,
4706,
9224,
353,
4852,
29883,
6191,
29901,
29900,
613,
376,
29883,
6191,
29901,
29896,
1159,
13,
4706,
363,
1857,
29918,
3359,
29892,
12489,
29918,
3359,
297,
3234,
29898,
3359,
1575,
29892,
9224,
1125,
13,
9651,
411,
4842,
305,
29889,
29883,
6191,
29889,
10141,
29898,
3784,
29918,
3359,
1125,
13,
18884,
1583,
29889,
1885,
29918,
14369,
29918,
1853,
29918,
1688,
29898,
3207,
29918,
1853,
29922,
7345,
305,
29889,
7411,
29892,
4742,
29922,
20158,
29918,
3359,
29897,
13,
13,
1678,
822,
1243,
29918,
9910,
29918,
7529,
29898,
1311,
1125,
13,
4706,
15786,
353,
5519,
29946,
29900,
29929,
29953,
29892,
29871,
29896,
29900,
29906,
29946,
1402,
518,
29946,
29900,
29929,
29953,
1402,
518,
29946,
29900,
29929,
29953,
29892,
29871,
29906,
29900,
29946,
29947,
1402,
518,
29941,
29906,
29941,
29906,
29900,
29892,
29871,
29896,
29900,
29906,
29946,
1402,
518,
29896,
5262,
13,
4706,
7688,
29918,
7099,
388,
353,
518,
29900,
29892,
29871,
29900,
29889,
29900,
29896,
29962,
13,
13,
4706,
363,
281,
29881,
297,
7688,
29918,
7099,
388,
29901,
13,
9651,
301,
1117,
29918,
3385,
353,
11117,
29212,
2396,
29945,
29872,
29899,
29946,
29892,
525,
6878,
294,
2396,
29898,
29900,
29889,
29929,
29892,
29871,
29900,
29889,
29929,
29929,
29929,
511,
525,
8961,
2396,
29896,
29872,
29899,
29900,
29947,
29892,
525,
7915,
29918,
7099,
388,
2396,
9970,
29913,
13,
9651,
25187,
943,
353,
5159,
13,
9651,
363,
2159,
297,
15786,
29901,
13,
18884,
25187,
943,
29889,
4397,
29898,
7345,
305,
29889,
9502,
29898,
2311,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29892,
4742,
2433,
29883,
6191,
8785,
13,
9651,
2143,
29918,
3207,
29892,
260,
303,
29918,
3207,
29892,
2143,
29918,
20640,
29892,
260,
303,
29918,
20640,
353,
320,
13,
18884,
1583,
29889,
1885,
29918,
3207,
29918,
20640,
29898,
29873,
575,
943,
29892,
301,
1117,
29918,
3385,
29897,
13,
13,
9651,
363,
474,
297,
3464,
29898,
1311,
29889,
277,
414,
1125,
13,
18884,
1583,
29889,
1885,
29918,
5105,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
18884,
2143,
29918,
20640,
29889,
10568,
580,
13,
18884,
260,
303,
29918,
20640,
29889,
10568,
580,
13,
18884,
4236,
29918,
6897,
29918,
12765,
29892,
4236,
29918,
2674,
29918,
12765,
353,
1583,
29889,
657,
29918,
3317,
29918,
12765,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
6897,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
6897,
29918,
12765,
29897,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
2674,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
2674,
29918,
12765,
29897,
13,
13,
1678,
822,
1243,
29918,
29880,
1117,
29918,
3385,
29898,
1311,
1125,
13,
4706,
452,
2409,
353,
29871,
29896,
13,
4706,
12489,
353,
4842,
305,
29889,
9502,
29898,
484,
2409,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29892,
4742,
2433,
29883,
6191,
1495,
13,
4706,
7688,
29918,
7099,
388,
353,
518,
29900,
29892,
29871,
29900,
29889,
29900,
29896,
29962,
13,
13,
4706,
363,
281,
29881,
297,
7688,
29918,
7099,
388,
29901,
13,
9651,
301,
1117,
29918,
3385,
353,
11117,
29212,
2396,
29900,
29889,
29900,
29896,
29892,
525,
6878,
294,
2396,
29898,
29900,
29889,
29953,
29892,
29871,
29900,
29889,
29929,
511,
525,
8961,
2396,
29941,
29872,
29899,
29900,
29953,
29892,
525,
7915,
29918,
7099,
388,
2396,
9970,
29913,
13,
9651,
2143,
29918,
3207,
29892,
260,
303,
29918,
3207,
29892,
2143,
29918,
20640,
29892,
260,
303,
29918,
20640,
353,
320,
13,
18884,
1583,
29889,
1885,
29918,
3207,
29918,
20640,
4197,
20158,
1402,
301,
1117,
29918,
3385,
29897,
13,
13,
9651,
363,
474,
297,
3464,
29898,
1311,
29889,
277,
414,
1125,
13,
18884,
1583,
29889,
1885,
29918,
5105,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
18884,
2143,
29918,
20640,
29889,
10568,
580,
13,
18884,
260,
303,
29918,
20640,
29889,
10568,
580,
13,
18884,
4236,
29918,
6897,
29918,
12765,
29892,
4236,
29918,
2674,
29918,
12765,
353,
1583,
29889,
657,
29918,
3317,
29918,
12765,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
6897,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
6897,
29918,
12765,
29897,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
2674,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
2674,
29918,
12765,
29897,
13,
13,
1990,
4321,
29943,
3880,
29924,
11925,
29925,
3757,
2459,
29931,
1117,
29898,
3057,
29931,
1117,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
2428,
29898,
3057,
29931,
1117,
29892,
1583,
467,
1649,
2344,
1649,
10456,
5085,
29892,
3579,
19290,
29897,
13,
4706,
1583,
29889,
999,
29918,
20640,
353,
9897,
4375,
9486,
13,
4706,
1583,
29889,
29873,
303,
29918,
20640,
353,
263,
412,
29916,
29889,
20640,
19427,
29889,
29943,
3880,
29924,
11925,
29925,
3757,
2459,
29931,
1117,
13,
13,
13,
1678,
822,
1243,
29918,
7411,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1885,
29918,
14369,
29918,
1853,
29918,
1688,
29898,
3207,
29918,
1853,
29922,
7345,
305,
29889,
7411,
29897,
13,
13,
1678,
732,
348,
27958,
29889,
11014,
703,
19737,
29911,
25350,
5994,
3950,
338,
451,
4825,
1711,
1959,
363,
285,
29886,
29896,
29953,
1159,
13,
1678,
822,
1243,
29918,
24498,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1885,
29918,
14369,
29918,
1853,
29918,
1688,
29898,
3207,
29918,
1853,
29922,
7345,
305,
29889,
7411,
29896,
29953,
29897,
13,
13,
1678,
732,
348,
27958,
29889,
11014,
3644,
29898,
7345,
305,
29889,
29883,
6191,
29889,
10141,
29918,
2798,
580,
29966,
29906,
29892,
376,
5514,
1135,
29871,
29896,
22796,
3734,
1159,
13,
1678,
822,
1243,
29918,
9910,
29918,
10141,
29898,
1311,
1125,
13,
4706,
9224,
353,
4852,
29883,
6191,
29901,
29900,
613,
376,
29883,
6191,
29901,
29896,
1159,
13,
4706,
363,
1857,
29918,
3359,
29892,
12489,
29918,
3359,
297,
3234,
29898,
3359,
1575,
29892,
9224,
1125,
13,
9651,
411,
4842,
305,
29889,
29883,
6191,
29889,
10141,
29898,
3784,
29918,
3359,
1125,
13,
18884,
1583,
29889,
1885,
29918,
14369,
29918,
1853,
29918,
1688,
29898,
3207,
29918,
1853,
29922,
7345,
305,
29889,
7411,
29892,
4742,
29922,
20158,
29918,
3359,
29897,
13,
13,
1678,
822,
1243,
29918,
9910,
29918,
7529,
29898,
1311,
1125,
13,
4706,
15786,
353,
5519,
29946,
29900,
29929,
29953,
29892,
29871,
29896,
29900,
29906,
29946,
1402,
518,
29946,
29900,
29929,
29953,
1402,
518,
29946,
29900,
29929,
29953,
29892,
29871,
29906,
29900,
29946,
29947,
1402,
518,
29941,
29906,
29941,
29906,
29900,
29892,
29871,
29896,
29900,
29906,
29946,
1402,
518,
29896,
5262,
13,
4706,
7688,
29918,
7099,
388,
353,
518,
29900,
29892,
29871,
29900,
29889,
29900,
29896,
29962,
13,
13,
4706,
363,
281,
29881,
297,
7688,
29918,
7099,
388,
29901,
13,
9651,
301,
1117,
29918,
3385,
353,
11117,
29212,
2396,
29945,
29872,
29899,
29946,
29892,
525,
6878,
294,
2396,
29898,
29900,
29889,
29929,
29892,
29871,
29900,
29889,
29929,
29929,
29929,
511,
525,
8961,
2396,
29896,
29872,
29899,
29900,
29947,
29892,
525,
7915,
29918,
7099,
388,
2396,
9970,
29913,
13,
9651,
25187,
943,
353,
5159,
13,
9651,
363,
2159,
297,
15786,
29901,
13,
18884,
25187,
943,
29889,
4397,
29898,
7345,
305,
29889,
9502,
29898,
2311,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29892,
4742,
2433,
29883,
6191,
8785,
13,
9651,
2143,
29918,
3207,
29892,
260,
303,
29918,
3207,
29892,
2143,
29918,
20640,
29892,
260,
303,
29918,
20640,
353,
320,
13,
18884,
1583,
29889,
1885,
29918,
3207,
29918,
20640,
29898,
29873,
575,
943,
29892,
301,
1117,
29918,
3385,
29897,
13,
13,
9651,
363,
474,
297,
3464,
29898,
1311,
29889,
277,
414,
1125,
13,
18884,
1583,
29889,
1885,
29918,
5105,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
18884,
2143,
29918,
20640,
29889,
10568,
580,
13,
18884,
260,
303,
29918,
20640,
29889,
10568,
580,
13,
18884,
4236,
29918,
6897,
29918,
12765,
29892,
4236,
29918,
2674,
29918,
12765,
353,
1583,
29889,
657,
29918,
3317,
29918,
12765,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
6897,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
6897,
29918,
12765,
29897,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
2674,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
2674,
29918,
12765,
29897,
13,
13,
1678,
822,
1243,
29918,
29880,
1117,
29918,
3385,
29898,
1311,
1125,
13,
4706,
452,
2409,
353,
29871,
29896,
13,
4706,
12489,
353,
4842,
305,
29889,
9502,
29898,
484,
2409,
29892,
26688,
29922,
7345,
305,
29889,
7411,
29892,
4742,
2433,
29883,
6191,
1495,
13,
4706,
7688,
29918,
7099,
388,
353,
518,
29900,
29892,
29871,
29900,
29889,
29900,
29896,
29962,
13,
13,
4706,
363,
281,
29881,
297,
7688,
29918,
7099,
388,
29901,
13,
9651,
301,
1117,
29918,
3385,
353,
11117,
29212,
2396,
29900,
29889,
29900,
29896,
29892,
525,
6878,
294,
2396,
29898,
29900,
29889,
29953,
29892,
29871,
29900,
29889,
29929,
511,
525,
8961,
2396,
29941,
29872,
29899,
29900,
29953,
29892,
525,
7915,
29918,
7099,
388,
2396,
9970,
29913,
13,
9651,
2143,
29918,
3207,
29892,
260,
303,
29918,
3207,
29892,
2143,
29918,
20640,
29892,
260,
303,
29918,
20640,
353,
320,
13,
18884,
1583,
29889,
1885,
29918,
3207,
29918,
20640,
4197,
20158,
1402,
301,
1117,
29918,
3385,
29897,
13,
13,
9651,
363,
474,
297,
3464,
29898,
1311,
29889,
277,
414,
1125,
13,
18884,
1583,
29889,
1885,
29918,
5105,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
18884,
2143,
29918,
20640,
29889,
10568,
580,
13,
18884,
260,
303,
29918,
20640,
29889,
10568,
580,
13,
18884,
4236,
29918,
6897,
29918,
12765,
29892,
4236,
29918,
2674,
29918,
12765,
353,
1583,
29889,
657,
29918,
3317,
29918,
12765,
29898,
999,
29918,
3207,
29892,
260,
303,
29918,
3207,
29897,
13,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
6897,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
6897,
29918,
12765,
29897,
13,
18884,
1583,
29889,
9294,
29931,
404,
9843,
29898,
3317,
29918,
2674,
29918,
12765,
29892,
1583,
29889,
3317,
29918,
2674,
29918,
12765,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
2471,
29918,
2084,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
6370,
2084,
22168,
1445,
1649,
876,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
apps/publications/translation.py | remocrevo/celus | 7 | 118232 | from modeltranslation.translator import translator, TranslationOptions
from .models import Platform
class PlatformTranslationOptions(TranslationOptions):
fields = ('name', 'provider')
translator.register(Platform, PlatformTranslationOptions)
| [
1,
515,
1904,
3286,
18411,
29889,
3286,
29880,
1061,
1053,
5578,
1061,
29892,
4103,
18411,
5856,
13,
3166,
869,
9794,
1053,
28096,
13,
13,
13,
1990,
28096,
4300,
18411,
5856,
29898,
4300,
18411,
5856,
1125,
13,
1678,
4235,
353,
6702,
978,
742,
525,
18121,
1495,
13,
13,
13,
3286,
29880,
1061,
29889,
9573,
29898,
21889,
29892,
28096,
4300,
18411,
5856,
29897,
13,
2
] |
intropy/tutorials/week_1/tests.py | ToscaBeijaert/introPy | 1 | 130583 | import numpy as np
def test_list_indexing(todo_list):
try:
assert(todo_list[2] == 'REPLACED')
except AssertionError as e:
print("The element 'TO_REPLACE_1' is not correctly replaced!")
raise(e)
try:
assert(todo_list[-1][-1][-1] == 'REPLACED')
except AssertionError as e:
print("The element 'TO_REPLACE_2' is not correctly replaced!")
raise(e)
print('Well done!')
def test_slicing_1(lst):
c_answer = [2, 3, 4, 5, 6]
try:
assert(lst == c_answer)
except AssertionError:
print('The slice is incorrect!')
raise IncorrectAnswer(lst, c_answer)
else:
print("Well done!")
def test_slicing_2(lst):
c_answer = [5, 7, 9, 11]
try:
assert(lst == c_answer)
except AssertionError:
print('The slice is incorrect!')
raise IncorrectAnswer(lst, c_answer)
else:
print("Well done!")
def test_create_array_with_zeros(arr):
c_answer = np.zeros((2, 3, 5, 3, 7))
try:
assert(np.all(arr.shape == c_answer.shape))
except AssertionError as e:
print("Your array has the wrong shape, namely %r, but I expected %r" % (arr.shape, c_answer.shape,))
raise(e)
try:
assert(np.all(arr == 0.0))
except AssertionError as e:
print("Your array does not contain zeros ... Did you use np.zeros()?")
raise(e)
print("Well done!")
def test_fill_array_with_complement(arr):
c_answer = 1.0 / np.arange(1, 9)
try:
np.testing.assert_array_almost_equal(arr, c_answer, 4)
except AssertionError as e:
print("Your array (%r) does not match the correct answer (%r)!" % (arr, c_answer))
raise(e)
else:
print("AWESOME!")
def test_set_odd_indices_to_zero(arr):
c_answer = np.arange(3, 25)
c_answer[1::2] = 0.0
try:
np.testing.assert_array_almost_equal(arr, c_answer, 4)
except AssertionError as e:
print("Your array (%r) does not match the correct answer (%r)!" % (arr, c_answer))
raise(e)
else:
print("Good job!")
def test_set_lower_right_value_to_one(arr):
c_answer = np.zeros((3, 3))
c_answer[-1, -1] = 1.0
try:
np.testing.assert_array_almost_equal(arr, c_answer, 4)
except AssertionError as e:
print("Your array: \n\n%r\n\ndoes not match the correct answer:\n\n%r!" % (arr, c_answer))
raise(e)
else:
print("Superb!")
def test_bloodpressure_index(arr):
np.random.seed(42)
bp_data = np.random.normal(loc=100, scale=5, size=(20, 24, 30, 2))
c_answer = bp_data[:, :, 17, 1]
try:
assert(arr.shape == (20, 24))
except AssertionError as e:
print("The result of your indexing operation is of shape %r, "
"while it should be %r, namely 20 subjects by 24 hours" % (arr.shape, (20, 24)))
raise(e)
try:
np.testing.assert_array_almost_equal(arr, c_answer, 4)
except AssertionError as e:
print("Your answer is not correct! Did you perhaps forget that Python has zero-based indexing? (First index is 0!)")
raise(e)
print("You're incredible!")
def test_boolean_indexing(arr):
my_array = np.array([[0, 1, -1, -2],
[2, -5, 1, 4],
[10, -2, -4, 20]])
c_answer = my_array[my_array ** 2 > 4]
try:
np.testing.assert_array_equal(arr, c_answer)
except AssertionError as e:
print("Incorrect answer! I expected %r, but I got %r" % (c_answer, arr))
raise(e)
print("EPIC!")
def test_tvalue_computation(arr, h0, tval_ans):
c_tval = (arr.mean() - h0) / (arr.std() / np.sqrt(arr.size - 1))
try:
np.testing.assert_almost_equal(tval_ans, c_tval)
except AssertionError as e:
print("T-value is incorrect! Your t-value is %.3f, while it should be %.3f" % (tval_ans, c_tval))
raise(e)
print("Correct! You stats wizard!")
def test_array_product_and_sum(arr):
arr_A = np.arange(10).reshape((5, 2))
arr_B = np.arange(10, 20).reshape((5, 2))
c_answer = (arr_A * arr_B) + 5
try:
np.testing.assert_array_equal(arr, c_answer)
except AssertionError as e:
print("Your answer is incorrect! I got:\n\n%r\n\nbut I expected:\n\n%r" % (arr, c_answer))
raise(e)
else:
print("Great!")
def test_compute_range_vectorized(arr, ans):
c_answer = arr.max(axis=0) - arr.min(axis=0)
try:
assert(ans.shape == c_answer.shape)
except AssertionError as e:
print("The shape of your answer is incorrect! I got %r, "
"but I expected %r for input-array of shape %r" % (ans.shape, c_answer.shape, arr.shape))
raise(e)
try:
np.testing.assert_array_almost_equal(ans, c_answer, 4)
except AssertionError as e:
print("Your answer is incorrect! Your answer is:\n\n%r/n/n But I expected:\n\n%r" % (ans, c_answer))
raise(e)
print("Easy peasy!") | [
1,
1053,
12655,
408,
7442,
13,
13,
1753,
1243,
29918,
1761,
29918,
2248,
292,
29898,
29873,
8144,
29918,
1761,
1125,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
4974,
29898,
29873,
8144,
29918,
1761,
29961,
29906,
29962,
1275,
525,
1525,
7390,
2477,
3352,
1495,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
1576,
1543,
525,
4986,
29918,
1525,
7390,
11538,
29918,
29896,
29915,
338,
451,
5149,
8611,
29991,
1159,
13,
4706,
12020,
29898,
29872,
29897,
13,
29871,
13,
1678,
1018,
29901,
13,
4706,
4974,
29898,
29873,
8144,
29918,
1761,
14352,
29896,
3816,
29899,
29896,
3816,
29899,
29896,
29962,
1275,
525,
1525,
7390,
2477,
3352,
1495,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
1576,
1543,
525,
4986,
29918,
1525,
7390,
11538,
29918,
29906,
29915,
338,
451,
5149,
8611,
29991,
1159,
13,
4706,
12020,
29898,
29872,
29897,
13,
1678,
13,
1678,
1596,
877,
11284,
2309,
29991,
1495,
13,
13,
13,
1753,
1243,
29918,
29879,
506,
292,
29918,
29896,
29898,
20155,
1125,
13,
268,
13,
1678,
274,
29918,
12011,
353,
518,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29953,
29962,
13,
1678,
1018,
29901,
13,
4706,
4974,
29898,
20155,
1275,
274,
29918,
12011,
29897,
13,
1678,
5174,
16499,
291,
2392,
29901,
13,
4706,
1596,
877,
1576,
22780,
338,
10240,
29991,
1495,
13,
4706,
12020,
512,
15728,
22550,
29898,
20155,
29892,
274,
29918,
12011,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
703,
11284,
2309,
29991,
1159,
13,
13,
13,
1753,
1243,
29918,
29879,
506,
292,
29918,
29906,
29898,
20155,
1125,
13,
268,
13,
1678,
274,
29918,
12011,
353,
518,
29945,
29892,
29871,
29955,
29892,
29871,
29929,
29892,
29871,
29896,
29896,
29962,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
4974,
29898,
20155,
1275,
274,
29918,
12011,
29897,
13,
1678,
5174,
16499,
291,
2392,
29901,
13,
4706,
1596,
877,
1576,
22780,
338,
10240,
29991,
1495,
13,
4706,
12020,
512,
15728,
22550,
29898,
20155,
29892,
274,
29918,
12011,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
703,
11284,
2309,
29991,
1159,
13,
13,
308,
13,
1753,
1243,
29918,
3258,
29918,
2378,
29918,
2541,
29918,
3298,
359,
29898,
2749,
1125,
13,
268,
13,
1678,
274,
29918,
12011,
353,
7442,
29889,
3298,
359,
3552,
29906,
29892,
29871,
29941,
29892,
29871,
29945,
29892,
29871,
29941,
29892,
29871,
29955,
876,
13,
1678,
1018,
29901,
13,
4706,
4974,
29898,
9302,
29889,
497,
29898,
2749,
29889,
12181,
1275,
274,
29918,
12011,
29889,
12181,
876,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
10858,
1409,
756,
278,
2743,
8267,
29892,
18451,
1273,
29878,
29892,
541,
306,
3806,
1273,
29878,
29908,
1273,
313,
2749,
29889,
12181,
29892,
274,
29918,
12011,
29889,
12181,
29892,
876,
13,
4706,
12020,
29898,
29872,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
4974,
29898,
9302,
29889,
497,
29898,
2749,
1275,
29871,
29900,
29889,
29900,
876,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
10858,
1409,
947,
451,
1712,
24786,
2023,
7440,
366,
671,
7442,
29889,
3298,
359,
580,
29973,
1159,
13,
4706,
12020,
29898,
29872,
29897,
13,
13,
1678,
1596,
703,
11284,
2309,
29991,
1159,
13,
13,
268,
13,
1753,
1243,
29918,
5589,
29918,
2378,
29918,
2541,
29918,
510,
2037,
29898,
2749,
1125,
13,
268,
13,
1678,
274,
29918,
12011,
353,
29871,
29896,
29889,
29900,
847,
7442,
29889,
279,
927,
29898,
29896,
29892,
29871,
29929,
29897,
13,
1678,
1018,
29901,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
284,
3242,
29918,
11745,
29898,
2749,
29892,
274,
29918,
12011,
29892,
29871,
29946,
29897,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
10858,
1409,
313,
29995,
29878,
29897,
947,
451,
1993,
278,
1959,
1234,
313,
29995,
29878,
29897,
3850,
1273,
313,
2749,
29892,
274,
29918,
12011,
876,
13,
4706,
12020,
29898,
29872,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
703,
29376,
2890,
29949,
2303,
29991,
1159,
13,
13,
13,
1753,
1243,
29918,
842,
29918,
22861,
29918,
513,
1575,
29918,
517,
29918,
9171,
29898,
2749,
1125,
13,
268,
13,
1678,
274,
29918,
12011,
353,
7442,
29889,
279,
927,
29898,
29941,
29892,
29871,
29906,
29945,
29897,
13,
1678,
274,
29918,
12011,
29961,
29896,
1057,
29906,
29962,
353,
29871,
29900,
29889,
29900,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
284,
3242,
29918,
11745,
29898,
2749,
29892,
274,
29918,
12011,
29892,
29871,
29946,
29897,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
10858,
1409,
313,
29995,
29878,
29897,
947,
451,
1993,
278,
1959,
1234,
313,
29995,
29878,
29897,
3850,
1273,
313,
2749,
29892,
274,
29918,
12011,
876,
13,
4706,
12020,
29898,
29872,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
703,
18420,
4982,
29991,
1159,
13,
13,
13,
1753,
1243,
29918,
842,
29918,
13609,
29918,
1266,
29918,
1767,
29918,
517,
29918,
650,
29898,
2749,
1125,
13,
268,
13,
1678,
274,
29918,
12011,
353,
7442,
29889,
3298,
359,
3552,
29941,
29892,
29871,
29941,
876,
13,
1678,
274,
29918,
12011,
14352,
29896,
29892,
448,
29896,
29962,
353,
29871,
29896,
29889,
29900,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
284,
3242,
29918,
11745,
29898,
2749,
29892,
274,
29918,
12011,
29892,
29871,
29946,
29897,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
10858,
1409,
29901,
320,
29876,
29905,
29876,
29995,
29878,
29905,
29876,
29905,
299,
29877,
267,
451,
1993,
278,
1959,
1234,
3583,
29876,
29905,
29876,
29995,
29878,
3850,
1273,
313,
2749,
29892,
274,
29918,
12011,
876,
13,
4706,
12020,
29898,
29872,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
703,
19111,
29890,
29991,
1159,
13,
13,
13,
1753,
1243,
29918,
14073,
397,
2139,
545,
29918,
2248,
29898,
2749,
1125,
13,
13,
1678,
7442,
29889,
8172,
29889,
26776,
29898,
29946,
29906,
29897,
13,
1678,
289,
29886,
29918,
1272,
353,
7442,
29889,
8172,
29889,
8945,
29898,
2029,
29922,
29896,
29900,
29900,
29892,
6287,
29922,
29945,
29892,
2159,
7607,
29906,
29900,
29892,
29871,
29906,
29946,
29892,
29871,
29941,
29900,
29892,
29871,
29906,
876,
13,
1678,
274,
29918,
12011,
353,
289,
29886,
29918,
1272,
7503,
29892,
584,
29892,
29871,
29896,
29955,
29892,
29871,
29896,
29962,
13,
13,
1678,
1018,
29901,
13,
4706,
4974,
29898,
2749,
29889,
12181,
1275,
313,
29906,
29900,
29892,
29871,
29906,
29946,
876,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
1576,
1121,
310,
596,
26190,
5858,
338,
310,
8267,
1273,
29878,
29892,
376,
13,
795,
376,
8000,
372,
881,
367,
1273,
29878,
29892,
18451,
29871,
29906,
29900,
17800,
491,
29871,
29906,
29946,
6199,
29908,
29871,
1273,
313,
2749,
29889,
12181,
29892,
313,
29906,
29900,
29892,
29871,
29906,
29946,
4961,
13,
4706,
12020,
29898,
29872,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
284,
3242,
29918,
11745,
29898,
2749,
29892,
274,
29918,
12011,
29892,
29871,
29946,
29897,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
10858,
1234,
338,
451,
1959,
29991,
7440,
366,
6060,
9566,
393,
5132,
756,
5225,
29899,
6707,
26190,
29973,
313,
6730,
2380,
338,
29871,
29900,
14366,
1159,
13,
4706,
12020,
29898,
29872,
29897,
13,
268,
13,
1678,
1596,
703,
3492,
29915,
276,
29811,
1821,
29991,
1159,
13,
13,
13,
1753,
1243,
29918,
20054,
29918,
2248,
292,
29898,
2749,
1125,
13,
268,
13,
1678,
590,
29918,
2378,
353,
7442,
29889,
2378,
4197,
29961,
29900,
29892,
29871,
29896,
29892,
448,
29896,
29892,
448,
29906,
1402,
13,
462,
268,
518,
29906,
29892,
448,
29945,
29892,
29871,
29896,
29892,
29871,
29946,
1402,
13,
462,
268,
518,
29896,
29900,
29892,
448,
29906,
29892,
448,
29946,
29892,
29871,
29906,
29900,
24960,
13,
1678,
274,
29918,
12011,
353,
590,
29918,
2378,
29961,
1357,
29918,
2378,
3579,
29871,
29906,
1405,
29871,
29946,
29962,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
11745,
29898,
2749,
29892,
274,
29918,
12011,
29897,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
797,
15728,
1234,
29991,
306,
3806,
1273,
29878,
29892,
541,
306,
2355,
1273,
29878,
29908,
1273,
313,
29883,
29918,
12011,
29892,
3948,
876,
13,
4706,
12020,
29898,
29872,
29897,
13,
268,
13,
1678,
1596,
703,
29923,
2227,
29907,
29991,
1159,
13,
268,
13,
13,
1753,
1243,
29918,
29873,
1767,
29918,
12097,
362,
29898,
2749,
29892,
298,
29900,
29892,
260,
791,
29918,
550,
1125,
13,
268,
13,
1678,
274,
29918,
29873,
791,
353,
313,
2749,
29889,
12676,
580,
448,
298,
29900,
29897,
847,
313,
2749,
29889,
4172,
580,
847,
7442,
29889,
3676,
29898,
2749,
29889,
2311,
448,
29871,
29896,
876,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
284,
3242,
29918,
11745,
29898,
29873,
791,
29918,
550,
29892,
274,
29918,
29873,
791,
29897,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
29911,
29899,
1767,
338,
10240,
29991,
3575,
260,
29899,
1767,
338,
18695,
29941,
29888,
29892,
1550,
372,
881,
367,
18695,
29941,
29888,
29908,
1273,
313,
29873,
791,
29918,
550,
29892,
274,
29918,
29873,
791,
876,
13,
4706,
12020,
29898,
29872,
29897,
13,
268,
13,
1678,
1596,
703,
12521,
1621,
29991,
887,
22663,
281,
17909,
29991,
1159,
13,
13,
268,
13,
1753,
1243,
29918,
2378,
29918,
4704,
29918,
392,
29918,
2083,
29898,
2749,
1125,
13,
268,
13,
1678,
3948,
29918,
29909,
353,
7442,
29889,
279,
927,
29898,
29896,
29900,
467,
690,
14443,
3552,
29945,
29892,
29871,
29906,
876,
13,
1678,
3948,
29918,
29933,
353,
7442,
29889,
279,
927,
29898,
29896,
29900,
29892,
29871,
29906,
29900,
467,
690,
14443,
3552,
29945,
29892,
29871,
29906,
876,
13,
1678,
274,
29918,
12011,
353,
313,
2749,
29918,
29909,
334,
3948,
29918,
29933,
29897,
718,
29871,
29945,
13,
13,
1678,
1018,
29901,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
11745,
29898,
2749,
29892,
274,
29918,
12011,
29897,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
10858,
1234,
338,
10240,
29991,
306,
2355,
3583,
29876,
29905,
29876,
29995,
29878,
29905,
29876,
29905,
29876,
4187,
306,
3806,
3583,
29876,
29905,
29876,
29995,
29878,
29908,
1273,
313,
2749,
29892,
274,
29918,
12011,
876,
13,
4706,
12020,
29898,
29872,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
703,
25120,
271,
29991,
1159,
13,
308,
13,
13,
1753,
1243,
29918,
26017,
29918,
3881,
29918,
8111,
1891,
29898,
2749,
29892,
6063,
1125,
13,
268,
13,
1678,
274,
29918,
12011,
353,
3948,
29889,
3317,
29898,
8990,
29922,
29900,
29897,
448,
3948,
29889,
1195,
29898,
8990,
29922,
29900,
29897,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
4974,
29898,
550,
29889,
12181,
1275,
274,
29918,
12011,
29889,
12181,
29897,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
1576,
8267,
310,
596,
1234,
338,
10240,
29991,
306,
2355,
1273,
29878,
29892,
376,
13,
795,
376,
4187,
306,
3806,
1273,
29878,
363,
1881,
29899,
2378,
310,
8267,
1273,
29878,
29908,
1273,
313,
550,
29889,
12181,
29892,
274,
29918,
12011,
29889,
12181,
29892,
3948,
29889,
12181,
876,
13,
4706,
12020,
29898,
29872,
29897,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
284,
3242,
29918,
11745,
29898,
550,
29892,
274,
29918,
12011,
29892,
29871,
29946,
29897,
13,
1678,
5174,
16499,
291,
2392,
408,
321,
29901,
13,
4706,
1596,
703,
10858,
1234,
338,
10240,
29991,
3575,
1234,
338,
3583,
29876,
29905,
29876,
29995,
29878,
29914,
29876,
29914,
29876,
1205,
306,
3806,
3583,
29876,
29905,
29876,
29995,
29878,
29908,
1273,
313,
550,
29892,
274,
29918,
12011,
876,
13,
4706,
12020,
29898,
29872,
29897,
13,
268,
13,
1678,
1596,
703,
29923,
8995,
1236,
8995,
29991,
1159,
2
] |
Chapter08/chapter8_sflowtool_1.py | stavsta/Mastering-Python-Networking-Second-Edition | 107 | 29309 | #!/usr/bin/env python3
import sys, re
for line in iter(sys.stdin.readline, ''):
if re.search('agent ', line):
print(line.strip())
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
5215,
10876,
29892,
337,
13,
13,
1454,
1196,
297,
4256,
29898,
9675,
29889,
4172,
262,
29889,
949,
1220,
29892,
6629,
1125,
13,
1678,
565,
337,
29889,
4478,
877,
14748,
13420,
1196,
1125,
13,
308,
1596,
29898,
1220,
29889,
17010,
3101,
13,
13,
13,
2
] |
examples/example1.py | mtasic85/pynogil | 0 | 179076 | N = 1_000_000
a = list(range(N))
b = list(range(N))
# c = [0] * N
# c = [a[i] + b[i] for i in range(N)]
c = [x + y for x, y in zip(a, b)]
s = sum(c)
print(s)
| [
1,
405,
353,
29871,
29896,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
13,
13,
29874,
353,
1051,
29898,
3881,
29898,
29940,
876,
13,
29890,
353,
1051,
29898,
3881,
29898,
29940,
876,
13,
29937,
274,
353,
518,
29900,
29962,
334,
405,
13,
29937,
274,
353,
518,
29874,
29961,
29875,
29962,
718,
289,
29961,
29875,
29962,
363,
474,
297,
3464,
29898,
29940,
4638,
13,
29883,
353,
518,
29916,
718,
343,
363,
921,
29892,
343,
297,
14319,
29898,
29874,
29892,
289,
4638,
13,
29879,
353,
2533,
29898,
29883,
29897,
13,
2158,
29898,
29879,
29897,
13,
2
] |
server/www/packages/packages-windows/x86/ldap3/utils/asn1.py | zhoulhb/teleport | 640 | 1635 | """
"""
# Created on 2015.08.19
#
# Author: <NAME>
#
# Copyright 2015 - 2018 <NAME>
#
# This file is part of ldap3.
#
# ldap3 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ldap3 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with ldap3 in the COPYING and COPYING.LESSER files.
# If not, see <http://www.gnu.org/licenses/>.
from pyasn1 import __version__ as pyasn1_version
from pyasn1.codec.ber import decoder # for usage in other modules
from pyasn1.codec.ber.encoder import Encoder # for monkeypatching of boolean value
from ..core.results import RESULT_CODES
from ..utils.conv import to_unicode
from ..protocol.convert import referrals_to_list
CLASSES = {(False, False): 0, # Universal
(False, True): 1, # Application
(True, False): 2, # Context
(True, True): 3} # Private
# Monkeypatching of pyasn1 for encoding Boolean with the value 0xFF for TRUE
# THIS IS NOT PART OF THE FAST BER DECODER
if pyasn1_version == 'xxx0.2.3':
from pyasn1.codec.ber.encoder import tagMap, BooleanEncoder, encode
from pyasn1.type.univ import Boolean
from pyasn1.compat.octets import ints2octs
class BooleanCEREncoder(BooleanEncoder):
_true = ints2octs((255,))
tagMap[Boolean.tagSet] = BooleanCEREncoder()
else:
from pyasn1.codec.ber.encoder import tagMap, typeMap, AbstractItemEncoder
from pyasn1.type.univ import Boolean
from copy import deepcopy
class LDAPBooleanEncoder(AbstractItemEncoder):
supportIndefLenMode = False
if pyasn1_version <= '0.2.3':
from pyasn1.compat.octets import ints2octs
_true = ints2octs((255,))
_false = ints2octs((0,))
def encodeValue(self, encodeFun, value, defMode, maxChunkSize):
return value and self._true or self._false, 0
elif pyasn1_version <= '0.3.1':
def encodeValue(self, encodeFun, value, defMode, maxChunkSize):
return value and (255,) or (0,), False, False
elif pyasn1_version <= '0.3.4':
def encodeValue(self, encodeFun, value, defMode, maxChunkSize, ifNotEmpty=False):
return value and (255,) or (0,), False, False
elif pyasn1_version <= '0.3.7':
def encodeValue(self, value, encodeFun, **options):
return value and (255,) or (0,), False, False
else:
def encodeValue(self, value, asn1Spec, encodeFun, **options):
return value and (255,) or (0,), False, False
customTagMap = deepcopy(tagMap)
customTypeMap = deepcopy(typeMap)
customTagMap[Boolean.tagSet] = LDAPBooleanEncoder()
customTypeMap[Boolean.typeId] = LDAPBooleanEncoder()
encode = Encoder(customTagMap, customTypeMap)
# end of monkey patching
# a fast BER decoder for LDAP responses only
def compute_ber_size(data):
"""
Compute size according to BER definite length rules
Returns size of value and value offset
"""
if data[1] <= 127: # BER definite length - short form. Highest bit of byte 1 is 0, message length is in the last 7 bits - Value can be up to 127 bytes long
return data[1], 2
else: # BER definite length - long form. Highest bit of byte 1 is 1, last 7 bits counts the number of following octets containing the value length
bytes_length = data[1] - 128
value_length = 0
cont = bytes_length
for byte in data[2: 2 + bytes_length]:
cont -= 1
value_length += byte * (256 ** cont)
return value_length, bytes_length + 2
def decode_message_fast(message):
ber_len, ber_value_offset = compute_ber_size(get_bytes(message[:10])) # get start of sequence, at maximum 3 bytes for length
decoded = decode_sequence(message, ber_value_offset, ber_len + ber_value_offset, LDAP_MESSAGE_CONTEXT)
return {
'messageID': decoded[0][3],
'protocolOp': decoded[1][2],
'payload': decoded[1][3],
'controls': decoded[2][3] if len(decoded) == 3 else None
}
def decode_sequence(message, start, stop, context_decoders=None):
decoded = []
while start < stop:
octet = get_byte(message[start])
ber_class = CLASSES[(bool(octet & 0b10000000), bool(octet & 0b01000000))]
ber_constructed = bool(octet & 0b00100000)
ber_type = octet & 0b00011111
ber_decoder = DECODERS[(ber_class, octet & 0b00011111)] if ber_class < 2 else None
ber_len, ber_value_offset = compute_ber_size(get_bytes(message[start: start + 10]))
start += ber_value_offset
if ber_decoder:
value = ber_decoder(message, start, start + ber_len, context_decoders) # call value decode function
else:
# try:
value = context_decoders[ber_type](message, start, start + ber_len) # call value decode function for context class
# except KeyError:
# if ber_type == 3: # Referral in result
# value = decode_sequence(message, start, start + ber_len)
# else:
# raise # re-raise, should never happen
decoded.append((ber_class, ber_constructed, ber_type, value))
start += ber_len
return decoded
def decode_integer(message, start, stop, context_decoders=None):
first = message[start]
value = -1 if get_byte(first) & 0x80 else 0
for octet in message[start: stop]:
value = value << 8 | get_byte(octet)
return value
def decode_octet_string(message, start, stop, context_decoders=None):
return message[start: stop]
def decode_boolean(message, start, stop, context_decoders=None):
return False if message[start: stop] == 0 else True
def decode_bind_response(message, start, stop, context_decoders=None):
return decode_sequence(message, start, stop, BIND_RESPONSE_CONTEXT)
def decode_extended_response(message, start, stop, context_decoders=None):
return decode_sequence(message, start, stop, EXTENDED_RESPONSE_CONTEXT)
def decode_intermediate_response(message, start, stop, context_decoders=None):
return decode_sequence(message, start, stop, INTERMEDIATE_RESPONSE_CONTEXT)
def decode_controls(message, start, stop, context_decoders=None):
return decode_sequence(message, start, stop, CONTROLS_CONTEXT)
def ldap_result_to_dict_fast(response):
response_dict = dict()
response_dict['result'] = int(response[0][3]) # resultCode
response_dict['description'] = RESULT_CODES[response_dict['result']]
response_dict['dn'] = to_unicode(response[1][3], from_server=True) # matchedDN
response_dict['message'] = to_unicode(response[2][3], from_server=True) # diagnosticMessage
if len(response) == 4:
response_dict['referrals'] = referrals_to_list([to_unicode(referral[3], from_server=True) for referral in response[3][3]]) # referrals
else:
response_dict['referrals'] = None
return response_dict
######
if str is not bytes: # Python 3
def get_byte(x):
return x
def get_bytes(x):
return x
else: # Python 2
def get_byte(x):
return ord(x)
def get_bytes(x):
return bytearray(x)
DECODERS = {
# Universal
(0, 1): decode_boolean, # Boolean
(0, 2): decode_integer, # Integer
(0, 4): decode_octet_string, # Octet String
(0, 10): decode_integer, # Enumerated
(0, 16): decode_sequence, # Sequence
(0, 17): decode_sequence, # Set
# Application
(1, 1): decode_bind_response, # Bind response
(1, 4): decode_sequence, # Search result entry
(1, 5): decode_sequence, # Search result done
(1, 7): decode_sequence, # Modify response
(1, 9): decode_sequence, # Add response
(1, 11): decode_sequence, # Delete response
(1, 13): decode_sequence, # ModifyDN response
(1, 15): decode_sequence, # Compare response
(1, 19): decode_sequence, # Search result reference
(1, 24): decode_extended_response, # Extended response
(1, 25): decode_intermediate_response, # intermediate response
(2, 3): decode_octet_string #
}
BIND_RESPONSE_CONTEXT = {
7: decode_octet_string # SaslCredentials
}
EXTENDED_RESPONSE_CONTEXT = {
10: decode_octet_string, # ResponseName
11: decode_octet_string # Response Value
}
INTERMEDIATE_RESPONSE_CONTEXT = {
0: decode_octet_string, # IntermediateResponseName
1: decode_octet_string # IntermediateResponseValue
}
LDAP_MESSAGE_CONTEXT = {
0: decode_controls, # Controls
3: decode_sequence # Referral
}
CONTROLS_CONTEXT = {
0: decode_sequence # Control
}
| [
1,
9995,
30004,
13,
15945,
19451,
13,
30004,
13,
29937,
6760,
630,
373,
29871,
29906,
29900,
29896,
29945,
29889,
29900,
29947,
29889,
29896,
29929,
30004,
13,
29937,
30004,
13,
29937,
13361,
29901,
529,
5813,
3238,
13,
29937,
30004,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29945,
448,
29871,
29906,
29900,
29896,
29947,
529,
5813,
3238,
13,
29937,
30004,
13,
29937,
910,
934,
338,
760,
310,
301,
29881,
481,
29941,
22993,
13,
29937,
30004,
13,
29937,
301,
29881,
481,
29941,
338,
3889,
7047,
29901,
366,
508,
2654,
391,
2666,
372,
322,
29914,
272,
6623,
30004,
13,
29937,
372,
1090,
278,
4958,
310,
278,
15143,
365,
16136,
4593,
5236,
19245,
408,
6369,
30004,
13,
29937,
491,
278,
12362,
18540,
10606,
29892,
2845,
1873,
29871,
29941,
310,
278,
19245,
29892,
470,
30004,
13,
29937,
313,
271,
596,
2984,
29897,
738,
2678,
1873,
22993,
13,
29937,
30004,
13,
29937,
301,
29881,
481,
29941,
338,
13235,
297,
278,
4966,
393,
372,
674,
367,
5407,
11167,
13,
29937,
541,
399,
1806,
8187,
2692,
13764,
29979,
399,
1718,
29934,
13566,
29979,
29936,
1728,
1584,
278,
2411,
2957,
1370,
21867,
29891,
310,
30004,
13,
29937,
341,
1001,
3210,
13566,
2882,
6227,
11937,
470,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
29889,
29871,
2823,
278,
30004,
13,
29937,
15143,
365,
16136,
4593,
5236,
19245,
363,
901,
4902,
22993,
13,
29937,
30004,
13,
29937,
887,
881,
505,
4520,
263,
3509,
310,
278,
15143,
365,
16136,
4593,
5236,
19245,
30004,
13,
29937,
3412,
411,
301,
29881,
481,
29941,
297,
278,
315,
4590,
29979,
4214,
322,
315,
4590,
29979,
4214,
29889,
1307,
1799,
1001,
2066,
22993,
13,
29937,
960,
451,
29892,
1074,
529,
1124,
597,
1636,
29889,
18713,
29889,
990,
29914,
506,
11259,
3779,
22993,
13,
30004,
13,
3166,
11451,
294,
29876,
29896,
1053,
4770,
3259,
1649,
408,
11451,
294,
29876,
29896,
29918,
3259,
30004,
13,
3166,
11451,
294,
29876,
29896,
29889,
401,
29883,
29889,
495,
1053,
1602,
6119,
29871,
396,
363,
8744,
297,
916,
10585,
30004,
13,
3166,
11451,
294,
29876,
29896,
29889,
401,
29883,
29889,
495,
29889,
3977,
6119,
1053,
11346,
6119,
396,
363,
1601,
446,
1478,
905,
292,
310,
7223,
995,
30004,
13,
3166,
6317,
3221,
29889,
9902,
1053,
390,
2890,
8647,
29918,
16524,
29903,
30004,
13,
3166,
6317,
13239,
29889,
20580,
1053,
304,
29918,
2523,
356,
30004,
13,
3166,
6317,
20464,
29889,
13441,
1053,
2737,
29878,
1338,
29918,
517,
29918,
1761,
30004,
13,
30004,
13,
6154,
3289,
1660,
29903,
353,
426,
29898,
8824,
29892,
7700,
1125,
29871,
29900,
29892,
29871,
396,
21536,
30004,
13,
965,
313,
8824,
29892,
5852,
1125,
29871,
29896,
29892,
29871,
396,
8427,
30004,
13,
965,
313,
5574,
29892,
7700,
1125,
29871,
29906,
29892,
29871,
396,
15228,
30004,
13,
965,
313,
5574,
29892,
5852,
1125,
29871,
29941,
29913,
29871,
396,
12230,
30004,
13,
30004,
13,
30004,
13,
29937,
2598,
446,
1478,
905,
292,
310,
11451,
294,
29876,
29896,
363,
8025,
11185,
411,
278,
995,
29871,
29900,
29916,
4198,
363,
15676,
30004,
13,
29937,
3446,
3235,
8519,
6058,
349,
8322,
8079,
6093,
13515,
1254,
350,
1001,
5012,
3217,
8032,
30004,
13,
361,
11451,
294,
29876,
29896,
29918,
3259,
1275,
525,
12353,
29900,
29889,
29906,
29889,
29941,
2396,
30004,
13,
1678,
515,
11451,
294,
29876,
29896,
29889,
401,
29883,
29889,
495,
29889,
3977,
6119,
1053,
4055,
3388,
29892,
11185,
8566,
6119,
29892,
19750,
30004,
13,
1678,
515,
11451,
294,
29876,
29896,
29889,
1853,
29889,
348,
440,
1053,
11185,
30004,
13,
1678,
515,
11451,
294,
29876,
29896,
29889,
12667,
29889,
20082,
1691,
1053,
938,
29879,
29906,
20082,
29879,
30004,
13,
1678,
770,
11185,
29907,
1001,
8566,
6119,
29898,
18146,
8566,
6119,
1125,
30004,
13,
4706,
903,
3009,
353,
938,
29879,
29906,
20082,
29879,
3552,
29906,
29945,
29945,
29892,
876,
30004,
13,
30004,
13,
1678,
4055,
3388,
29961,
18146,
29889,
4039,
2697,
29962,
353,
11185,
29907,
1001,
8566,
6119,
26471,
13,
2870,
29901,
30004,
13,
1678,
515,
11451,
294,
29876,
29896,
29889,
401,
29883,
29889,
495,
29889,
3977,
6119,
1053,
4055,
3388,
29892,
1134,
3388,
29892,
25513,
2001,
8566,
6119,
30004,
13,
1678,
515,
11451,
294,
29876,
29896,
29889,
1853,
29889,
348,
440,
1053,
11185,
30004,
13,
1678,
515,
3509,
1053,
6483,
8552,
30004,
13,
30004,
13,
1678,
770,
365,
29928,
3301,
18146,
8566,
6119,
29898,
9118,
2001,
8566,
6119,
1125,
30004,
13,
4706,
2304,
2568,
1389,
21515,
6818,
353,
7700,
30004,
13,
4706,
565,
11451,
294,
29876,
29896,
29918,
3259,
5277,
525,
29900,
29889,
29906,
29889,
29941,
2396,
30004,
13,
9651,
515,
11451,
294,
29876,
29896,
29889,
12667,
29889,
20082,
1691,
1053,
938,
29879,
29906,
20082,
29879,
30004,
13,
9651,
903,
3009,
353,
938,
29879,
29906,
20082,
29879,
3552,
29906,
29945,
29945,
29892,
876,
30004,
13,
9651,
903,
4541,
353,
938,
29879,
29906,
20082,
29879,
3552,
29900,
29892,
876,
30004,
13,
9651,
822,
19750,
1917,
29898,
1311,
29892,
19750,
25394,
29892,
995,
29892,
822,
6818,
29892,
4236,
1451,
2960,
3505,
1125,
30004,
13,
18884,
736,
995,
322,
1583,
3032,
3009,
470,
1583,
3032,
4541,
29892,
29871,
29900,
30004,
13,
4706,
25342,
11451,
294,
29876,
29896,
29918,
3259,
5277,
525,
29900,
29889,
29941,
29889,
29896,
2396,
30004,
13,
9651,
822,
19750,
1917,
29898,
1311,
29892,
19750,
25394,
29892,
995,
29892,
822,
6818,
29892,
4236,
1451,
2960,
3505,
1125,
30004,
13,
18884,
736,
995,
322,
313,
29906,
29945,
29945,
29892,
29897,
470,
313,
29900,
29892,
511,
7700,
29892,
7700,
30004,
13,
4706,
25342,
11451,
294,
29876,
29896,
29918,
3259,
5277,
525,
29900,
29889,
29941,
29889,
29946,
2396,
30004,
13,
9651,
822,
19750,
1917,
29898,
1311,
29892,
19750,
25394,
29892,
995,
29892,
822,
6818,
29892,
4236,
1451,
2960,
3505,
29892,
565,
3664,
8915,
29922,
8824,
1125,
30004,
13,
18884,
736,
995,
322,
313,
29906,
29945,
29945,
29892,
29897,
470,
313,
29900,
29892,
511,
7700,
29892,
7700,
30004,
13,
4706,
25342,
11451,
294,
29876,
29896,
29918,
3259,
5277,
525,
29900,
29889,
29941,
29889,
29955,
2396,
30004,
13,
9651,
822,
19750,
1917,
29898,
1311,
29892,
995,
29892,
19750,
25394,
29892,
3579,
6768,
1125,
30004,
13,
18884,
736,
995,
322,
313,
29906,
29945,
29945,
29892,
29897,
470,
313,
29900,
29892,
511,
7700,
29892,
7700,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
822,
19750,
1917,
29898,
1311,
29892,
995,
29892,
408,
29876,
29896,
10299,
29892,
19750,
25394,
29892,
3579,
6768,
1125,
30004,
13,
18884,
736,
995,
322,
313,
29906,
29945,
29945,
29892,
29897,
470,
313,
29900,
29892,
511,
7700,
29892,
7700,
30004,
13,
30004,
13,
1678,
2888,
8176,
3388,
353,
6483,
8552,
29898,
4039,
3388,
8443,
13,
1678,
2888,
1542,
3388,
353,
6483,
8552,
29898,
1853,
3388,
8443,
13,
1678,
2888,
8176,
3388,
29961,
18146,
29889,
4039,
2697,
29962,
353,
365,
29928,
3301,
18146,
8566,
6119,
26471,
13,
1678,
2888,
1542,
3388,
29961,
18146,
29889,
1853,
1204,
29962,
353,
365,
29928,
3301,
18146,
8566,
6119,
26471,
13,
30004,
13,
1678,
19750,
353,
11346,
6119,
29898,
6341,
8176,
3388,
29892,
2888,
1542,
3388,
8443,
13,
29937,
1095,
310,
1601,
1989,
13261,
292,
30004,
13,
30004,
13,
29937,
263,
5172,
350,
1001,
1602,
6119,
363,
365,
29928,
3301,
20890,
871,
30004,
13,
1753,
10272,
29918,
495,
29918,
2311,
29898,
1272,
1125,
30004,
13,
1678,
9995,
30004,
13,
1678,
11796,
29872,
2159,
5034,
304,
350,
1001,
24860,
3309,
6865,
30004,
13,
1678,
16969,
2159,
310,
995,
322,
995,
9210,
30004,
13,
1678,
9995,
30004,
13,
30004,
13,
1678,
565,
848,
29961,
29896,
29962,
5277,
29871,
29896,
29906,
29955,
29901,
29871,
396,
350,
1001,
24860,
3309,
448,
3273,
883,
29889,
5057,
342,
2586,
310,
7023,
29871,
29896,
338,
29871,
29900,
29892,
2643,
3309,
338,
297,
278,
1833,
29871,
29955,
9978,
448,
7865,
508,
367,
701,
304,
29871,
29896,
29906,
29955,
6262,
1472,
30004,
13,
4706,
736,
848,
29961,
29896,
1402,
29871,
29906,
30004,
13,
1678,
1683,
29901,
29871,
396,
350,
1001,
24860,
3309,
448,
1472,
883,
29889,
5057,
342,
2586,
310,
7023,
29871,
29896,
338,
29871,
29896,
29892,
1833,
29871,
29955,
9978,
18139,
278,
1353,
310,
1494,
4725,
1691,
6943,
278,
995,
3309,
30004,
13,
4706,
6262,
29918,
2848,
353,
848,
29961,
29896,
29962,
448,
29871,
29896,
29906,
29947,
30004,
13,
4706,
995,
29918,
2848,
353,
29871,
29900,
30004,
13,
4706,
640,
353,
6262,
29918,
2848,
30004,
13,
4706,
363,
7023,
297,
848,
29961,
29906,
29901,
29871,
29906,
718,
6262,
29918,
2848,
5387,
30004,
13,
9651,
640,
22361,
29871,
29896,
30004,
13,
9651,
995,
29918,
2848,
4619,
7023,
334,
313,
29906,
29945,
29953,
3579,
640,
8443,
13,
4706,
736,
995,
29918,
2848,
29892,
6262,
29918,
2848,
718,
29871,
29906,
30004,
13,
30004,
13,
30004,
13,
1753,
21822,
29918,
4906,
29918,
11255,
29898,
4906,
1125,
30004,
13,
1678,
7655,
29918,
2435,
29892,
7655,
29918,
1767,
29918,
10289,
353,
10272,
29918,
495,
29918,
2311,
29898,
657,
29918,
13193,
29898,
4906,
7503,
29896,
29900,
12622,
29871,
396,
679,
1369,
310,
5665,
29892,
472,
7472,
29871,
29941,
6262,
363,
3309,
30004,
13,
1678,
1602,
6797,
353,
21822,
29918,
16506,
29898,
4906,
29892,
7655,
29918,
1767,
29918,
10289,
29892,
7655,
29918,
2435,
718,
7655,
29918,
1767,
29918,
10289,
29892,
365,
29928,
3301,
29918,
2303,
1799,
10461,
29918,
6007,
16975,
8443,
13,
1678,
736,
3336,
13,
4706,
525,
4906,
1367,
2396,
1602,
6797,
29961,
29900,
3816,
29941,
1402,
30004,
13,
4706,
525,
20464,
11746,
2396,
1602,
6797,
29961,
29896,
3816,
29906,
1402,
30004,
13,
4706,
525,
23813,
2396,
1602,
6797,
29961,
29896,
3816,
29941,
1402,
30004,
13,
4706,
525,
26255,
2396,
1602,
6797,
29961,
29906,
3816,
29941,
29962,
565,
7431,
29898,
7099,
6797,
29897,
1275,
29871,
29941,
1683,
6213,
30004,
13,
1678,
4970,
13,
30004,
13,
30004,
13,
1753,
21822,
29918,
16506,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
3030,
29918,
7099,
397,
414,
29922,
8516,
1125,
30004,
13,
1678,
1602,
6797,
353,
5159,
30004,
13,
1678,
1550,
1369,
529,
5040,
29901,
30004,
13,
4706,
4725,
300,
353,
679,
29918,
10389,
29898,
4906,
29961,
2962,
2314,
30004,
13,
4706,
7655,
29918,
1990,
353,
17332,
3289,
1660,
29903,
15625,
11227,
29898,
20082,
300,
669,
29871,
29900,
29890,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
511,
6120,
29898,
20082,
300,
669,
29871,
29900,
29890,
29900,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
28166,
30004,
13,
4706,
7655,
29918,
11433,
287,
353,
6120,
29898,
20082,
300,
669,
29871,
29900,
29890,
29900,
29900,
29896,
29900,
29900,
29900,
29900,
29900,
8443,
13,
4706,
7655,
29918,
1853,
353,
4725,
300,
669,
29871,
29900,
29890,
29900,
29900,
29900,
29896,
29896,
29896,
29896,
29896,
30004,
13,
4706,
7655,
29918,
7099,
6119,
353,
5012,
3217,
8032,
29903,
15625,
495,
29918,
1990,
29892,
4725,
300,
669,
29871,
29900,
29890,
29900,
29900,
29900,
29896,
29896,
29896,
29896,
29896,
4638,
565,
7655,
29918,
1990,
529,
29871,
29906,
1683,
6213,
30004,
13,
4706,
7655,
29918,
2435,
29892,
7655,
29918,
1767,
29918,
10289,
353,
10272,
29918,
495,
29918,
2311,
29898,
657,
29918,
13193,
29898,
4906,
29961,
2962,
29901,
1369,
718,
29871,
29896,
29900,
12622,
30004,
13,
4706,
1369,
4619,
7655,
29918,
1767,
29918,
10289,
30004,
13,
4706,
565,
7655,
29918,
7099,
6119,
29901,
30004,
13,
9651,
995,
353,
7655,
29918,
7099,
6119,
29898,
4906,
29892,
1369,
29892,
1369,
718,
7655,
29918,
2435,
29892,
3030,
29918,
7099,
397,
414,
29897,
29871,
396,
1246,
995,
21822,
740,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
396,
1018,
29901,
30004,
13,
9651,
995,
353,
3030,
29918,
7099,
397,
414,
29961,
495,
29918,
1853,
850,
4906,
29892,
1369,
29892,
1369,
718,
7655,
29918,
2435,
29897,
29871,
396,
1246,
995,
21822,
740,
363,
3030,
770,
30004,
13,
9651,
396,
5174,
7670,
2392,
29901,
30004,
13,
9651,
396,
268,
565,
7655,
29918,
1853,
1275,
29871,
29941,
29901,
29871,
396,
4118,
1705,
297,
1121,
30004,
13,
9651,
396,
308,
995,
353,
21822,
29918,
16506,
29898,
4906,
29892,
1369,
29892,
1369,
718,
7655,
29918,
2435,
8443,
13,
9651,
396,
268,
1683,
29901,
30004,
13,
9651,
396,
308,
12020,
29871,
396,
337,
29899,
22692,
29892,
881,
2360,
3799,
30004,
13,
4706,
1602,
6797,
29889,
4397,
3552,
495,
29918,
1990,
29892,
7655,
29918,
11433,
287,
29892,
7655,
29918,
1853,
29892,
995,
876,
30004,
13,
4706,
1369,
4619,
7655,
29918,
2435,
30004,
13,
30004,
13,
1678,
736,
1602,
6797,
30004,
13,
30004,
13,
30004,
13,
1753,
21822,
29918,
16031,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
3030,
29918,
7099,
397,
414,
29922,
8516,
1125,
30004,
13,
1678,
937,
353,
2643,
29961,
2962,
29962,
30004,
13,
1678,
995,
353,
448,
29896,
565,
679,
29918,
10389,
29898,
4102,
29897,
669,
29871,
29900,
29916,
29947,
29900,
1683,
29871,
29900,
30004,
13,
1678,
363,
4725,
300,
297,
2643,
29961,
2962,
29901,
5040,
5387,
30004,
13,
4706,
995,
353,
995,
3532,
29871,
29947,
891,
679,
29918,
10389,
29898,
20082,
300,
8443,
13,
30004,
13,
1678,
736,
995,
30004,
13,
30004,
13,
30004,
13,
1753,
21822,
29918,
20082,
300,
29918,
1807,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
3030,
29918,
7099,
397,
414,
29922,
8516,
1125,
30004,
13,
1678,
736,
2643,
29961,
2962,
29901,
5040,
29962,
30004,
13,
30004,
13,
30004,
13,
1753,
21822,
29918,
20054,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
3030,
29918,
7099,
397,
414,
29922,
8516,
1125,
30004,
13,
1678,
736,
7700,
565,
2643,
29961,
2962,
29901,
5040,
29962,
1275,
29871,
29900,
1683,
5852,
30004,
13,
30004,
13,
30004,
13,
1753,
21822,
29918,
5355,
29918,
5327,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
3030,
29918,
7099,
397,
414,
29922,
8516,
1125,
30004,
13,
1678,
736,
21822,
29918,
16506,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
350,
22255,
29918,
1525,
5550,
1164,
1660,
29918,
6007,
16975,
8443,
13,
30004,
13,
30004,
13,
1753,
21822,
29918,
1062,
2760,
29918,
5327,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
3030,
29918,
7099,
397,
414,
29922,
8516,
1125,
30004,
13,
1678,
736,
21822,
29918,
16506,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
8528,
29911,
1430,
2287,
29928,
29918,
1525,
5550,
1164,
1660,
29918,
6007,
16975,
8443,
13,
30004,
13,
30004,
13,
1753,
21822,
29918,
1639,
13847,
29918,
5327,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
3030,
29918,
7099,
397,
414,
29922,
8516,
1125,
30004,
13,
1678,
736,
21822,
29918,
16506,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
2672,
4945,
2303,
4571,
3040,
29918,
1525,
5550,
1164,
1660,
29918,
6007,
16975,
8443,
13,
30004,
13,
30004,
13,
1753,
21822,
29918,
26255,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
3030,
29918,
7099,
397,
414,
29922,
8516,
1125,
30004,
13,
1678,
736,
21822,
29918,
16506,
29898,
4906,
29892,
1369,
29892,
5040,
29892,
8707,
29911,
1672,
8547,
29918,
6007,
16975,
8443,
13,
30004,
13,
30004,
13,
1753,
301,
29881,
481,
29918,
2914,
29918,
517,
29918,
8977,
29918,
11255,
29898,
5327,
1125,
30004,
13,
1678,
2933,
29918,
8977,
353,
9657,
26471,
13,
1678,
2933,
29918,
8977,
1839,
2914,
2033,
353,
938,
29898,
5327,
29961,
29900,
3816,
29941,
2314,
29871,
396,
1121,
3399,
30004,
13,
1678,
2933,
29918,
8977,
1839,
8216,
2033,
353,
390,
2890,
8647,
29918,
16524,
29903,
29961,
5327,
29918,
8977,
1839,
2914,
2033,
29962,
30004,
13,
1678,
2933,
29918,
8977,
1839,
5200,
2033,
353,
304,
29918,
2523,
356,
29898,
5327,
29961,
29896,
3816,
29941,
1402,
515,
29918,
2974,
29922,
5574,
29897,
29871,
396,
19228,
28307,
30004,
13,
1678,
2933,
29918,
8977,
1839,
4906,
2033,
353,
304,
29918,
2523,
356,
29898,
5327,
29961,
29906,
3816,
29941,
1402,
515,
29918,
2974,
29922,
5574,
29897,
29871,
396,
652,
21780,
3728,
30004,
13,
1678,
565,
7431,
29898,
5327,
29897,
1275,
29871,
29946,
29901,
30004,
13,
4706,
2933,
29918,
8977,
1839,
20275,
29878,
1338,
2033,
353,
2737,
29878,
1338,
29918,
517,
29918,
1761,
4197,
517,
29918,
2523,
356,
29898,
20275,
1705,
29961,
29941,
1402,
515,
29918,
2974,
29922,
5574,
29897,
363,
2737,
1705,
297,
2933,
29961,
29941,
3816,
29941,
24960,
29871,
396,
2737,
29878,
1338,
30004,
13,
1678,
1683,
29901,
30004,
13,
4706,
2933,
29918,
8977,
1839,
20275,
29878,
1338,
2033,
353,
6213,
30004,
13,
30004,
13,
1678,
736,
2933,
29918,
8977,
30004,
13,
30004,
13,
30004,
13,
4136,
2277,
30004,
13,
30004,
13,
361,
851,
338,
451,
6262,
29901,
29871,
396,
5132,
29871,
29941,
30004,
13,
1678,
822,
679,
29918,
10389,
29898,
29916,
1125,
30004,
13,
4706,
736,
921,
30004,
13,
30004,
13,
1678,
822,
679,
29918,
13193,
29898,
29916,
1125,
30004,
13,
4706,
736,
921,
30004,
13,
2870,
29901,
29871,
396,
5132,
29871,
29906,
30004,
13,
1678,
822,
679,
29918,
10389,
29898,
29916,
1125,
30004,
13,
4706,
736,
4356,
29898,
29916,
8443,
13,
30004,
13,
1678,
822,
679,
29918,
13193,
29898,
29916,
1125,
30004,
13,
4706,
736,
7023,
2378,
29898,
29916,
8443,
13,
30004,
13,
2287,
3217,
8032,
29903,
353,
3336,
13,
1678,
396,
21536,
30004,
13,
1678,
313,
29900,
29892,
29871,
29896,
1125,
21822,
29918,
20054,
29892,
29871,
396,
11185,
30004,
13,
1678,
313,
29900,
29892,
29871,
29906,
1125,
21822,
29918,
16031,
29892,
29871,
396,
8102,
30004,
13,
1678,
313,
29900,
29892,
29871,
29946,
1125,
21822,
29918,
20082,
300,
29918,
1807,
29892,
29871,
396,
4756,
300,
1714,
30004,
13,
1678,
313,
29900,
29892,
29871,
29896,
29900,
1125,
21822,
29918,
16031,
29892,
29871,
396,
1174,
4680,
630,
30004,
13,
1678,
313,
29900,
29892,
29871,
29896,
29953,
1125,
21822,
29918,
16506,
29892,
29871,
396,
922,
3910,
30004,
13,
1678,
313,
29900,
29892,
29871,
29896,
29955,
1125,
21822,
29918,
16506,
29892,
29871,
396,
3789,
30004,
13,
1678,
396,
8427,
30004,
13,
1678,
313,
29896,
29892,
29871,
29896,
1125,
21822,
29918,
5355,
29918,
5327,
29892,
29871,
396,
29672,
2933,
30004,
13,
1678,
313,
29896,
29892,
29871,
29946,
1125,
21822,
29918,
16506,
29892,
29871,
396,
11856,
1121,
6251,
30004,
13,
1678,
313,
29896,
29892,
29871,
29945,
1125,
21822,
29918,
16506,
29892,
29871,
396,
11856,
1121,
2309,
30004,
13,
1678,
313,
29896,
29892,
29871,
29955,
1125,
21822,
29918,
16506,
29892,
29871,
396,
3382,
1598,
2933,
30004,
13,
1678,
313,
29896,
29892,
29871,
29929,
1125,
21822,
29918,
16506,
29892,
29871,
396,
3462,
2933,
30004,
13,
1678,
313,
29896,
29892,
29871,
29896,
29896,
1125,
21822,
29918,
16506,
29892,
29871,
396,
21267,
2933,
30004,
13,
1678,
313,
29896,
29892,
29871,
29896,
29941,
1125,
21822,
29918,
16506,
29892,
29871,
396,
3382,
1598,
28307,
2933,
30004,
13,
1678,
313,
29896,
29892,
29871,
29896,
29945,
1125,
21822,
29918,
16506,
29892,
29871,
396,
3831,
598,
2933,
30004,
13,
1678,
313,
29896,
29892,
29871,
29896,
29929,
1125,
21822,
29918,
16506,
29892,
29871,
396,
11856,
1121,
3407,
30004,
13,
1678,
313,
29896,
29892,
29871,
29906,
29946,
1125,
21822,
29918,
1062,
2760,
29918,
5327,
29892,
29871,
396,
7338,
2760,
2933,
30004,
13,
1678,
313,
29896,
29892,
29871,
29906,
29945,
1125,
21822,
29918,
1639,
13847,
29918,
5327,
29892,
29871,
396,
19697,
2933,
30004,
13,
1678,
313,
29906,
29892,
29871,
29941,
1125,
21822,
29918,
20082,
300,
29918,
1807,
29871,
396,
30004,
13,
8117,
13,
30004,
13,
29933,
22255,
29918,
1525,
5550,
1164,
1660,
29918,
6007,
16975,
353,
3336,
13,
268,
29955,
29901,
21822,
29918,
20082,
300,
29918,
1807,
29871,
396,
317,
294,
29880,
28037,
30004,
13,
8117,
13,
30004,
13,
12194,
1430,
2287,
29928,
29918,
1525,
5550,
1164,
1660,
29918,
6007,
16975,
353,
3336,
13,
268,
29896,
29900,
29901,
21822,
29918,
20082,
300,
29918,
1807,
29892,
29871,
396,
13291,
1170,
30004,
13,
268,
29896,
29896,
29901,
21822,
29918,
20082,
300,
29918,
1807,
29871,
396,
13291,
7865,
30004,
13,
8117,
13,
30004,
13,
23845,
2303,
4571,
3040,
29918,
1525,
5550,
1164,
1660,
29918,
6007,
16975,
353,
3336,
13,
268,
29900,
29901,
21822,
29918,
20082,
300,
29918,
1807,
29892,
29871,
396,
4124,
13847,
5103,
1170,
30004,
13,
268,
29896,
29901,
21822,
29918,
20082,
300,
29918,
1807,
29871,
396,
4124,
13847,
5103,
1917,
30004,
13,
8117,
13,
30004,
13,
10249,
3301,
29918,
2303,
1799,
10461,
29918,
6007,
16975,
353,
3336,
13,
268,
29900,
29901,
21822,
29918,
26255,
29892,
29871,
396,
11264,
29879,
30004,
13,
268,
29941,
29901,
21822,
29918,
16506,
29871,
396,
4118,
1705,
30004,
13,
8117,
13,
30004,
13,
22412,
1672,
8547,
29918,
6007,
16975,
353,
3336,
13,
268,
29900,
29901,
21822,
29918,
16506,
29871,
396,
11264,
30004,
13,
8117,
13,
2
] |
app/logic/gitrepo/controllers/__init__.py | imvu/bluesteel | 10 | 87751 | <reponame>imvu/bluesteel<filename>app/logic/gitrepo/controllers/__init__.py
""" Automatic file """
from app.logic.gitrepo.controllers.GitController import GitController
| [
1,
529,
276,
1112,
420,
29958,
326,
24845,
29914,
2204,
29884,
4196,
295,
29966,
9507,
29958,
932,
29914,
19227,
29914,
5559,
20095,
29914,
1285,
11897,
29914,
1649,
2344,
26914,
2272,
13,
15945,
29908,
15854,
2454,
934,
9995,
13,
13,
3166,
623,
29889,
19227,
29889,
5559,
20095,
29889,
1285,
11897,
29889,
28712,
2956,
1053,
11786,
2956,
13,
2
] |
ancilla/ancilla/foundation/node/api/api.py | frenzylabs/ancilla | 7 | 51127 | <filename>ancilla/ancilla/foundation/node/api/api.py
'''
api.py
ancilla
Created by <NAME> (<EMAIL>) on 01/08/20
Copyright 2019 FrenzyLabs, LLC.
'''
import time
import json
from ...data.models import Service, ServiceAttachment
from ..response import AncillaError
class Api(object):
def __init__(self, service):
self.service = service
self.setup()
def setup(self, prefix = ""):
self.service.route(f'{prefix}/settings', 'GET', self.settings)
self.service.route(f'{prefix}/actions', 'GET', self.actions)
self.service.route(f'{prefix}/routes', 'GET', self.routes)
self.service.route(f'{prefix}/events', 'GET', self.events)
self.service.route(f'{prefix}/attachments/<attachment_id>', 'DELETE', self.delete_attachment)
self.service.route(f'{prefix}/attachments', 'POST', self.add_attachment)
self.service.route(f'{prefix}/attachments', 'GET', self.attachments)
def settings(self, *args):
return {"settings": self.service.settings.to_json()}
def routes(self, *args):
return {"routes": [f"{r}" for r in self.service.routes]}
def actions(self, *args):
return {"actions": self.service.list_actions()}
def events(self, *args):
# print(f"THE EVENT DICT = {self.service.event_class.event_dict()}", flush=True)
return {"events": self.service.event_class.list_events()}
def delete_attachment(self, request, attachment_id, *args, **kwargs):
# attachment = self.service.model.service_attachments.where(ServiceAttachment.attachment_id == service_id).first()
attachment = self.service.model.service_attachments.where(ServiceAttachment.id == attachment_id).first()
if attachment:
attachment.delete_instance()
return {"sucess": "Removed Attachment"}
raise AncillaError(404, {"error": "No Attachment Found"})
def add_attachment(self, request, *args):
service_id = request.params.get("service_id")
res = self.service.model.service_attachments.where(ServiceAttachment.attachment_id == service_id).first()
if res:
return {"attachment": res.json}
attachment = Service.get_by_id(service_id)
sa = ServiceAttachment(parent=self.service.model, attachment=attachment)
sa.save()
return {"attachment": sa.json}
def attachments(self, *args):
return {"attachments": [a.json for a in self.service.model.service_attachments]}
def update_attachment(self, request, attachment_id, *args):
pass
| [
1,
529,
9507,
29958,
4564,
2911,
29914,
4564,
2911,
29914,
11940,
362,
29914,
3177,
29914,
2754,
29914,
2754,
29889,
2272,
13,
12008,
13,
7882,
29889,
2272,
13,
10359,
2911,
13,
13,
6760,
630,
491,
529,
5813,
29958,
313,
29966,
26862,
6227,
12948,
373,
29871,
29900,
29896,
29914,
29900,
29947,
29914,
29906,
29900,
13,
14187,
1266,
29871,
29906,
29900,
29896,
29929,
383,
1267,
1537,
29931,
6897,
29892,
365,
12182,
29889,
13,
12008,
13,
13,
5215,
931,
13,
5215,
4390,
13,
13,
3166,
2023,
1272,
29889,
9794,
1053,
6692,
29892,
6692,
4165,
25117,
13,
3166,
6317,
5327,
1053,
530,
29883,
2911,
2392,
13,
13,
13,
1990,
29749,
29898,
3318,
1125,
13,
268,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2669,
1125,
13,
4706,
1583,
29889,
5509,
353,
2669,
462,
13,
4706,
1583,
29889,
14669,
580,
13,
13,
1678,
822,
6230,
29898,
1311,
29892,
10944,
353,
5124,
1125,
13,
418,
1583,
29889,
5509,
29889,
13134,
29898,
29888,
29915,
29912,
13506,
6822,
11027,
742,
525,
7194,
742,
1583,
29889,
11027,
29897,
13,
418,
1583,
29889,
5509,
29889,
13134,
29898,
29888,
29915,
29912,
13506,
6822,
7387,
742,
525,
7194,
742,
1583,
29889,
7387,
29897,
13,
418,
1583,
29889,
5509,
29889,
13134,
29898,
29888,
29915,
29912,
13506,
6822,
27894,
742,
525,
7194,
742,
1583,
29889,
27894,
29897,
13,
418,
1583,
29889,
5509,
29889,
13134,
29898,
29888,
29915,
29912,
13506,
6822,
13604,
742,
525,
7194,
742,
1583,
29889,
13604,
29897,
13,
418,
1583,
29889,
5509,
29889,
13134,
29898,
29888,
29915,
29912,
13506,
6822,
14930,
1860,
29914,
29966,
14930,
358,
29918,
333,
29958,
742,
525,
2287,
18476,
742,
1583,
29889,
8143,
29918,
14930,
358,
29897,
13,
418,
1583,
29889,
5509,
29889,
13134,
29898,
29888,
29915,
29912,
13506,
6822,
14930,
1860,
742,
525,
5438,
742,
1583,
29889,
1202,
29918,
14930,
358,
29897,
13,
418,
1583,
29889,
5509,
29889,
13134,
29898,
29888,
29915,
29912,
13506,
6822,
14930,
1860,
742,
525,
7194,
742,
1583,
29889,
14930,
1860,
29897,
13,
13,
1678,
822,
6055,
29898,
1311,
29892,
334,
5085,
1125,
13,
418,
736,
8853,
11027,
1115,
1583,
29889,
5509,
29889,
11027,
29889,
517,
29918,
3126,
28296,
13,
13,
1678,
822,
12049,
29898,
1311,
29892,
334,
5085,
1125,
13,
418,
736,
8853,
27894,
1115,
518,
29888,
29908,
29912,
29878,
5038,
363,
364,
297,
1583,
29889,
5509,
29889,
27894,
12258,
13,
13,
1678,
822,
8820,
29898,
1311,
29892,
334,
5085,
1125,
539,
13,
418,
736,
8853,
7387,
1115,
1583,
29889,
5509,
29889,
1761,
29918,
7387,
28296,
13,
268,
13,
1678,
822,
4959,
29898,
1311,
29892,
334,
5085,
1125,
13,
418,
396,
1596,
29898,
29888,
29908,
28350,
382,
29963,
3919,
22471,
1783,
353,
426,
1311,
29889,
5509,
29889,
3696,
29918,
1990,
29889,
3696,
29918,
8977,
580,
17671,
28371,
29922,
5574,
29897,
13,
418,
736,
8853,
13604,
1115,
1583,
29889,
5509,
29889,
3696,
29918,
1990,
29889,
1761,
29918,
13604,
28296,
539,
13,
13,
1678,
822,
5217,
29918,
14930,
358,
29898,
1311,
29892,
2009,
29892,
26305,
29918,
333,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
418,
396,
26305,
353,
1583,
29889,
5509,
29889,
4299,
29889,
5509,
29918,
14930,
1860,
29889,
3062,
29898,
3170,
4165,
25117,
29889,
14930,
358,
29918,
333,
1275,
2669,
29918,
333,
467,
4102,
580,
13,
418,
26305,
353,
1583,
29889,
5509,
29889,
4299,
29889,
5509,
29918,
14930,
1860,
29889,
3062,
29898,
3170,
4165,
25117,
29889,
333,
1275,
26305,
29918,
333,
467,
4102,
580,
13,
418,
565,
26305,
29901,
13,
4706,
26305,
29889,
8143,
29918,
8758,
580,
308,
13,
4706,
736,
8853,
2146,
985,
1115,
376,
7301,
8238,
6212,
25117,
9092,
13,
13,
418,
12020,
530,
29883,
2911,
2392,
29898,
29946,
29900,
29946,
29892,
8853,
2704,
1115,
376,
3782,
6212,
25117,
7460,
29908,
1800,
13,
13,
539,
13,
1678,
822,
788,
29918,
14930,
358,
29898,
1311,
29892,
2009,
29892,
334,
5085,
1125,
13,
418,
2669,
29918,
333,
353,
2009,
29889,
7529,
29889,
657,
703,
5509,
29918,
333,
1159,
13,
539,
13,
418,
620,
353,
1583,
29889,
5509,
29889,
4299,
29889,
5509,
29918,
14930,
1860,
29889,
3062,
29898,
3170,
4165,
25117,
29889,
14930,
358,
29918,
333,
1275,
2669,
29918,
333,
467,
4102,
580,
13,
418,
565,
620,
29901,
13,
4706,
736,
8853,
14930,
358,
1115,
620,
29889,
3126,
29913,
13,
308,
13,
418,
26305,
353,
6692,
29889,
657,
29918,
1609,
29918,
333,
29898,
5509,
29918,
333,
29897,
13,
418,
872,
353,
6692,
4165,
25117,
29898,
3560,
29922,
1311,
29889,
5509,
29889,
4299,
29892,
26305,
29922,
14930,
358,
29897,
13,
418,
872,
29889,
7620,
580,
13,
418,
736,
8853,
14930,
358,
1115,
872,
29889,
3126,
29913,
13,
13,
1678,
822,
10641,
1860,
29898,
1311,
29892,
334,
5085,
1125,
13,
418,
736,
8853,
14930,
1860,
1115,
518,
29874,
29889,
3126,
363,
263,
297,
1583,
29889,
5509,
29889,
4299,
29889,
5509,
29918,
14930,
1860,
12258,
13,
13,
1678,
822,
2767,
29918,
14930,
358,
29898,
1311,
29892,
2009,
29892,
26305,
29918,
333,
29892,
334,
5085,
1125,
13,
418,
1209,
13,
13,
259,
2
] |
hook_faster_rcnn.py | ratkhohieu/Context-aware-emotion-recognition-based-on-visual-relationship-detection | 0 | 186696 | import pandas as pd
import torchvision
from torch.utils.data import DataLoader
from tqdm import tqdm
from pre_process import *
from utils import *
warnings.filterwarnings("ignore")
parser = argparse.ArgumentParser(description='MuSE Training')
parser.add_argument('--lr', default=1e-3, type=float, help='learning rate')
parser.add_argument('--batch_size', default=1, type=int, help='batch size')
args = parser.parse_args()
device = "cuda:0" if torch.cuda.is_available() else 'cpu'
scaler = torch.cuda.amp.GradScaler()
def hook_faster_rcnn(model, image_input):
outputs = []
hook = model.backbone.register_forward_hook(
lambda self, input, output: outputs.append(output))
res = model(image_input)
hook.remove()
selected_rois = model.roi_heads.box_roi_pool(
outputs[0], [r['boxes'] for r in res], [i.shape[-2:] for i in image_input])
out_pool = nn.AdaptiveAvgPool2d((1, 1))
result = {
'features_object': np.array(out_pool(selected_rois).view(selected_rois.size(0), -1).detach().cpu()),
'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
'labes': np.array(res[0]['labels'].detach().cpu())
}
return result
def main():
seed_everything()
# train_context, train_body, train_cat, train_cont = load_data_npy(mode='train')
# val_context, val_body, val_cat, val_cont = load_data_npy(mode='valid')
# test_context, test_body, test_cat, test_cont = load_data_npy(mode='test')
# cat2ind, ind2cat, ind2vad = pre_ind2cat()
root = '/media/sven/HUNG/CAER/extracted_feature/'
# train_transform = transforms.Compose([transforms.ToPILImage(),
# transforms.Resize(size=(320, 320)),
# # transforms.RandomHorizontalFlip(),
# # transforms.ColorJitter(brightness=0.4, contrast=0.4, saturation=0.4),
# transforms.ToTensor()])
#
# test_transform = transforms.Compose([transforms.ToPILImage(),
# transforms.Resize(size=(320, 320)),
# transforms.ToTensor()])
#
# train_dataset = Emotic_PreDataset(train_context, train_body, train_cat, train_cont, train_transform,
# root=root,
# data_src='emotic_pre/train.csv', mode_unnorm=True)
# train_loader = DataLoader(dataset=train_dataset,
# batch_size=args.batch_size,
# num_workers=4,
# shuffle=False,
# drop_last=False)
#
# valid_dataset = Emotic_PreDataset(val_context, val_body, val_cat, val_cont, test_transform,
# root=root,
# data_src='emotic_pre/val.csv', mode_unnorm=True)
# valid_loader = DataLoader(dataset=valid_dataset,
# batch_size=args.batch_size,
# num_workers=4,
# shuffle=False)
#
# test_dataset = Emotic_PreDataset(test_context, test_body, test_cat, test_cont, test_transform,
# root=root,
# data_src='emotic_pre/test.csv', mode_unnorm=True)
# test_loader = DataLoader(dataset=test_dataset,
# batch_size=args.batch_size,
# num_workers=4,
# shuffle=False)
# load a model pre-trained pre-trained on COCO
train_dataset = Caer_Dataset(path_df='/media/sven/HUNG/CAER/extracted_feature/train.csv', transform=train_transform)
train_loader = DataLoader(dataset=train_dataset,
batch_size=args.batch_size,
num_workers=4,
shuffle=False,
drop_last=False)
test_dataset = Caer_Dataset(path_df='/media/sven/HUNG/CAER/extracted_feature/test.csv', transform=test_transform)
test_loader = DataLoader(dataset=test_dataset,
batch_size=args.batch_size,
num_workers=4,
shuffle=False)
model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True, box_detections_per_img=10,
box_score_thresh=0.4, box_nms_thresh=0.4,
box_fg_iou_thresh=0.5, box_bg_iou_thresh=0.5, )
model.to(device)
model.eval()
# for k, v in {'train': train_loader, 'test': test_loader}.items():
# results = []
# for batch_idx, sample in tqdm(enumerate(v), total=len(v)):
# images_context = sample['image_context'].to(device)
# outputs = []
# hook = model.backbone.register_forward_hook(
# lambda self, input, output: outputs.append(output))
# res = model(images_context)
# # import pdb;
# # pdb.set_trace()
# try:
# assert len(res[0]['labels'] != 0)
# except:
# # TODO: need to process when can't detect anything, box, label, features are zeros
# print('Zeros_box')
# result = {
# 'features_object': np.zeros((1, 1024)),
# 'bounding_box': np.zeros((1, 4)),
# 'labes': np.zeros(1)
# }
# results.append(result)
# continue
#
# hook.remove()
# selected_rois = model.roi_heads.box_roi_pool(
# outputs[0], [r['boxes'] for r in res], [i.shape[-2:] for i in images_context])
#
# # out_pool = nn.AdaptiveAvgPool2d((1, 1))
# #
# # result = {
# # 'features_object': np.array(out_pool(selected_rois).view(selected_rois.size(0), -1).detach().cpu()),
# # 'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
# # 'labes': np.array(res[0]['labels'].detach().cpu())
# # }
#
# result = {
# 'features_object': np.array(model.roi_heads.box_head(selected_rois).detach().cpu()),
# 'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
# 'labes': np.array(res[0]['labels'].detach().cpu())
# }
#
# results.append(result)
# path_npy = os.path.join(root, 'hook_faster')
# os.makedirs(path_npy, exist_ok=True)
# np.save(os.path.join(path_npy, f'{k}_faster_320_1024.npy'), results)
# print(len(results))
for k, v in {'train': train_loader, 'test': test_loader}.items():
results = []
df = pd.read_csv(f'/media/sven/HUNG/CAER/extracted_feature/{k}.csv')
for batch_idx, sample in tqdm(enumerate(v), total=len(v)):
images_context = sample['image_context'].to(device)
outputs = []
hook = model.backbone.register_forward_hook(
lambda self, input, output: outputs.append(output))
res = model(images_context)
# import pdb;
# pdb.set_trace()
try:
assert len(res[0]['labels'] != 0)
except:
# TODO: need to process when can't detect anything, box, label, features are zeros
print('Zeros_box')
result = {
'features_object': np.zeros((1, 1024)),
'bounding_box': np.zeros((1, 4)),
'labes': np.zeros(1)
}
results.append(result)
continue
hook.remove()
selected_rois = model.roi_heads.box_roi_pool(
outputs[0], [r['boxes'] for r in res], [i.shape[-2:] for i in images_context])
# out_pool = nn.AdaptiveAvgPool2d((1, 1))
#
# result = {
# 'features_object': np.array(out_pool(selected_rois).view(selected_rois.size(0), -1).detach().cpu()),
# 'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
# 'labes': np.array(res[0]['labels'].detach().cpu())
# }
result = {
'features_object': np.array(model.roi_heads.box_head(selected_rois).detach().cpu()),
'bounding_box': np.array(res[0]['boxes'].detach().cpu()),
'labes': np.array(res[0]['labels'].detach().cpu())
}
name_npy_file = df.iloc[batch_idx]['image']
emotion = df.iloc[batch_idx]['emotion']
path_npy = os.path.join(root, 'hook_faster')
os.makedirs(path_npy, exist_ok=True)
np.save(os.path.join(path_npy, f'{emotion}_{name_npy_file}.npy'), result)
results.append(os.path.join(path_npy, f'{emotion}_{name_npy_file}.npy'))
df['hook_faster'] = results
df.to_csv(f'{k}_hook.csv')
if __name__ == '__main__':
main()
| [
1,
1053,
11701,
408,
10518,
13,
5215,
4842,
305,
4924,
13,
3166,
4842,
305,
29889,
13239,
29889,
1272,
1053,
3630,
10036,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
13,
3166,
758,
29918,
5014,
1053,
334,
13,
3166,
3667,
29879,
1053,
334,
13,
13,
25442,
886,
29889,
4572,
25442,
886,
703,
17281,
1159,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
29924,
29884,
1660,
26101,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
29212,
742,
2322,
29922,
29896,
29872,
29899,
29941,
29892,
1134,
29922,
7411,
29892,
1371,
2433,
21891,
6554,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
16175,
29918,
2311,
742,
2322,
29922,
29896,
29892,
1134,
29922,
524,
29892,
1371,
2433,
16175,
2159,
1495,
13,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
10141,
353,
376,
29883,
6191,
29901,
29900,
29908,
565,
4842,
305,
29889,
29883,
6191,
29889,
275,
29918,
16515,
580,
1683,
525,
21970,
29915,
13,
19529,
261,
353,
4842,
305,
29889,
29883,
6191,
29889,
1160,
29889,
25584,
29636,
261,
580,
13,
13,
13,
1753,
12422,
29918,
29888,
1901,
29918,
2214,
15755,
29898,
4299,
29892,
1967,
29918,
2080,
1125,
13,
1678,
14391,
353,
5159,
13,
1678,
12422,
353,
1904,
29889,
1627,
15933,
29889,
9573,
29918,
11333,
29918,
20849,
29898,
13,
4706,
14013,
1583,
29892,
1881,
29892,
1962,
29901,
14391,
29889,
4397,
29898,
4905,
876,
13,
1678,
620,
353,
1904,
29898,
3027,
29918,
2080,
29897,
13,
1678,
12422,
29889,
5992,
580,
13,
13,
1678,
4629,
29918,
307,
275,
353,
1904,
29889,
307,
29875,
29918,
2813,
29879,
29889,
1884,
29918,
307,
29875,
29918,
10109,
29898,
13,
4706,
14391,
29961,
29900,
1402,
518,
29878,
1839,
1884,
267,
2033,
363,
364,
297,
620,
1402,
518,
29875,
29889,
12181,
14352,
29906,
17531,
363,
474,
297,
1967,
29918,
2080,
2314,
13,
13,
1678,
714,
29918,
10109,
353,
302,
29876,
29889,
29909,
1388,
415,
573,
12810,
29887,
11426,
29906,
29881,
3552,
29896,
29892,
29871,
29896,
876,
13,
13,
1678,
1121,
353,
426,
13,
4706,
525,
22100,
29918,
3318,
2396,
7442,
29889,
2378,
29898,
449,
29918,
10109,
29898,
8391,
29918,
307,
275,
467,
1493,
29898,
8391,
29918,
307,
275,
29889,
2311,
29898,
29900,
511,
448,
29896,
467,
4801,
496,
2141,
21970,
25739,
13,
4706,
525,
9917,
292,
29918,
1884,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
1884,
267,
13359,
4801,
496,
2141,
21970,
25739,
13,
4706,
525,
8205,
267,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
21134,
13359,
4801,
496,
2141,
21970,
3101,
13,
1678,
500,
13,
1678,
736,
1121,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
16717,
29918,
17991,
1918,
580,
13,
1678,
396,
7945,
29918,
4703,
29892,
7945,
29918,
2587,
29892,
7945,
29918,
4117,
29892,
7945,
29918,
1285,
353,
2254,
29918,
1272,
29918,
29876,
2272,
29898,
8513,
2433,
14968,
1495,
13,
1678,
396,
659,
29918,
4703,
29892,
659,
29918,
2587,
29892,
659,
29918,
4117,
29892,
659,
29918,
1285,
353,
2254,
29918,
1272,
29918,
29876,
2272,
29898,
8513,
2433,
3084,
1495,
13,
1678,
396,
1243,
29918,
4703,
29892,
1243,
29918,
2587,
29892,
1243,
29918,
4117,
29892,
1243,
29918,
1285,
353,
2254,
29918,
1272,
29918,
29876,
2272,
29898,
8513,
2433,
1688,
1495,
13,
13,
1678,
396,
6635,
29906,
513,
29892,
1399,
29906,
4117,
29892,
1399,
29906,
29894,
328,
353,
758,
29918,
513,
29906,
4117,
580,
13,
13,
1678,
3876,
353,
8207,
9799,
29914,
29879,
854,
29914,
29950,
3904,
29954,
29914,
5454,
1001,
29914,
21111,
287,
29918,
14394,
22208,
13,
1678,
396,
7945,
29918,
9067,
353,
4327,
29879,
29889,
1523,
4220,
4197,
9067,
29879,
29889,
1762,
2227,
29931,
2940,
3285,
13,
1678,
396,
462,
462,
539,
4327,
29879,
29889,
1666,
675,
29898,
2311,
7607,
29941,
29906,
29900,
29892,
29871,
29941,
29906,
29900,
8243,
13,
1678,
396,
462,
462,
539,
396,
4327,
29879,
29889,
17875,
24932,
29943,
3466,
3285,
13,
1678,
396,
462,
462,
539,
396,
4327,
29879,
29889,
3306,
29967,
5171,
29898,
1182,
523,
2264,
29922,
29900,
29889,
29946,
29892,
12814,
29922,
29900,
29889,
29946,
29892,
269,
1337,
362,
29922,
29900,
29889,
29946,
511,
13,
1678,
396,
462,
462,
539,
4327,
29879,
29889,
1762,
29911,
6073,
580,
2314,
13,
1678,
396,
13,
1678,
396,
1243,
29918,
9067,
353,
4327,
29879,
29889,
1523,
4220,
4197,
9067,
29879,
29889,
1762,
2227,
29931,
2940,
3285,
13,
1678,
396,
462,
462,
418,
4327,
29879,
29889,
1666,
675,
29898,
2311,
7607,
29941,
29906,
29900,
29892,
29871,
29941,
29906,
29900,
8243,
13,
1678,
396,
462,
462,
418,
4327,
29879,
29889,
1762,
29911,
6073,
580,
2314,
13,
1678,
396,
13,
1678,
396,
7945,
29918,
24713,
353,
2812,
13574,
29918,
6572,
16390,
24541,
29898,
14968,
29918,
4703,
29892,
7945,
29918,
2587,
29892,
7945,
29918,
4117,
29892,
7945,
29918,
1285,
29892,
7945,
29918,
9067,
29892,
13,
1678,
396,
462,
462,
259,
3876,
29922,
4632,
29892,
13,
1678,
396,
462,
462,
259,
848,
29918,
4351,
2433,
331,
13574,
29918,
1457,
29914,
14968,
29889,
7638,
742,
4464,
29918,
5963,
555,
29922,
5574,
29897,
13,
1678,
396,
7945,
29918,
12657,
353,
3630,
10036,
29898,
24713,
29922,
14968,
29918,
24713,
29892,
13,
1678,
396,
462,
965,
9853,
29918,
2311,
29922,
5085,
29889,
16175,
29918,
2311,
29892,
13,
1678,
396,
462,
965,
954,
29918,
1287,
414,
29922,
29946,
29892,
13,
1678,
396,
462,
965,
528,
21897,
29922,
8824,
29892,
13,
1678,
396,
462,
965,
5768,
29918,
4230,
29922,
8824,
29897,
13,
1678,
396,
13,
1678,
396,
2854,
29918,
24713,
353,
2812,
13574,
29918,
6572,
16390,
24541,
29898,
791,
29918,
4703,
29892,
659,
29918,
2587,
29892,
659,
29918,
4117,
29892,
659,
29918,
1285,
29892,
1243,
29918,
9067,
29892,
13,
1678,
396,
462,
462,
259,
3876,
29922,
4632,
29892,
13,
1678,
396,
462,
462,
259,
848,
29918,
4351,
2433,
331,
13574,
29918,
1457,
29914,
791,
29889,
7638,
742,
4464,
29918,
5963,
555,
29922,
5574,
29897,
13,
1678,
396,
2854,
29918,
12657,
353,
3630,
10036,
29898,
24713,
29922,
3084,
29918,
24713,
29892,
13,
1678,
396,
462,
965,
9853,
29918,
2311,
29922,
5085,
29889,
16175,
29918,
2311,
29892,
13,
1678,
396,
462,
965,
954,
29918,
1287,
414,
29922,
29946,
29892,
13,
1678,
396,
462,
965,
528,
21897,
29922,
8824,
29897,
13,
1678,
396,
13,
1678,
396,
1243,
29918,
24713,
353,
2812,
13574,
29918,
6572,
16390,
24541,
29898,
1688,
29918,
4703,
29892,
1243,
29918,
2587,
29892,
1243,
29918,
4117,
29892,
1243,
29918,
1285,
29892,
1243,
29918,
9067,
29892,
13,
1678,
396,
462,
462,
29871,
3876,
29922,
4632,
29892,
13,
1678,
396,
462,
462,
29871,
848,
29918,
4351,
2433,
331,
13574,
29918,
1457,
29914,
1688,
29889,
7638,
742,
4464,
29918,
5963,
555,
29922,
5574,
29897,
13,
1678,
396,
1243,
29918,
12657,
353,
3630,
10036,
29898,
24713,
29922,
1688,
29918,
24713,
29892,
13,
1678,
396,
462,
3986,
9853,
29918,
2311,
29922,
5085,
29889,
16175,
29918,
2311,
29892,
13,
1678,
396,
462,
3986,
954,
29918,
1287,
414,
29922,
29946,
29892,
13,
1678,
396,
462,
3986,
528,
21897,
29922,
8824,
29897,
13,
13,
1678,
396,
2254,
263,
1904,
758,
29899,
3018,
1312,
758,
29899,
3018,
1312,
373,
4810,
3217,
13,
13,
1678,
7945,
29918,
24713,
353,
9243,
261,
29918,
16390,
24541,
29898,
2084,
29918,
2176,
2433,
29914,
9799,
29914,
29879,
854,
29914,
29950,
3904,
29954,
29914,
5454,
1001,
29914,
21111,
287,
29918,
14394,
29914,
14968,
29889,
7638,
742,
4327,
29922,
14968,
29918,
9067,
29897,
13,
1678,
7945,
29918,
12657,
353,
3630,
10036,
29898,
24713,
29922,
14968,
29918,
24713,
29892,
13,
462,
795,
9853,
29918,
2311,
29922,
5085,
29889,
16175,
29918,
2311,
29892,
13,
462,
795,
954,
29918,
1287,
414,
29922,
29946,
29892,
13,
462,
795,
528,
21897,
29922,
8824,
29892,
13,
462,
795,
5768,
29918,
4230,
29922,
8824,
29897,
13,
13,
1678,
1243,
29918,
24713,
353,
9243,
261,
29918,
16390,
24541,
29898,
2084,
29918,
2176,
2433,
29914,
9799,
29914,
29879,
854,
29914,
29950,
3904,
29954,
29914,
5454,
1001,
29914,
21111,
287,
29918,
14394,
29914,
1688,
29889,
7638,
742,
4327,
29922,
1688,
29918,
9067,
29897,
13,
1678,
1243,
29918,
12657,
353,
3630,
10036,
29898,
24713,
29922,
1688,
29918,
24713,
29892,
13,
462,
632,
9853,
29918,
2311,
29922,
5085,
29889,
16175,
29918,
2311,
29892,
13,
462,
632,
954,
29918,
1287,
414,
29922,
29946,
29892,
13,
462,
632,
528,
21897,
29922,
8824,
29897,
13,
13,
1678,
1904,
353,
4842,
305,
4924,
29889,
9794,
29889,
29881,
2650,
428,
29889,
29888,
1901,
2214,
15755,
29918,
690,
1212,
29945,
29900,
29918,
18091,
29876,
29898,
1457,
3018,
1312,
29922,
5574,
29892,
3800,
29918,
29881,
2650,
1953,
29918,
546,
29918,
2492,
29922,
29896,
29900,
29892,
13,
462,
462,
462,
462,
3800,
29918,
13628,
29918,
386,
3781,
29922,
29900,
29889,
29946,
29892,
3800,
29918,
29876,
1516,
29918,
386,
3781,
29922,
29900,
29889,
29946,
29892,
13,
462,
462,
462,
462,
3800,
29918,
16434,
29918,
29875,
283,
29918,
386,
3781,
29922,
29900,
29889,
29945,
29892,
3800,
29918,
16264,
29918,
29875,
283,
29918,
386,
3781,
29922,
29900,
29889,
29945,
29892,
1723,
13,
13,
1678,
1904,
29889,
517,
29898,
10141,
29897,
13,
1678,
1904,
29889,
14513,
580,
13,
13,
1678,
396,
363,
413,
29892,
325,
297,
11117,
14968,
2396,
7945,
29918,
12657,
29892,
525,
1688,
2396,
1243,
29918,
12657,
1836,
7076,
7295,
13,
1678,
396,
268,
2582,
353,
5159,
13,
1678,
396,
268,
363,
9853,
29918,
13140,
29892,
4559,
297,
260,
29939,
18933,
29898,
15172,
29898,
29894,
511,
3001,
29922,
2435,
29898,
29894,
22164,
13,
1678,
396,
308,
4558,
29918,
4703,
353,
4559,
1839,
3027,
29918,
4703,
13359,
517,
29898,
10141,
29897,
13,
1678,
396,
308,
14391,
353,
5159,
13,
1678,
396,
308,
12422,
353,
1904,
29889,
1627,
15933,
29889,
9573,
29918,
11333,
29918,
20849,
29898,
13,
1678,
396,
632,
14013,
1583,
29892,
1881,
29892,
1962,
29901,
14391,
29889,
4397,
29898,
4905,
876,
13,
1678,
396,
308,
620,
353,
1904,
29898,
8346,
29918,
4703,
29897,
13,
1678,
396,
308,
396,
1053,
282,
2585,
29936,
13,
1678,
396,
308,
396,
282,
2585,
29889,
842,
29918,
15003,
580,
13,
1678,
396,
308,
1018,
29901,
13,
1678,
396,
632,
4974,
7431,
29898,
690,
29961,
29900,
22322,
21134,
2033,
2804,
29871,
29900,
29897,
13,
1678,
396,
308,
5174,
29901,
13,
1678,
396,
632,
396,
14402,
29901,
817,
304,
1889,
746,
508,
29915,
29873,
6459,
3099,
29892,
3800,
29892,
3858,
29892,
5680,
526,
24786,
13,
1678,
396,
632,
1596,
877,
29999,
9672,
29918,
1884,
1495,
13,
1678,
396,
632,
1121,
353,
426,
13,
1678,
396,
462,
525,
22100,
29918,
3318,
2396,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29871,
29896,
29900,
29906,
29946,
8243,
13,
1678,
396,
462,
525,
9917,
292,
29918,
1884,
2396,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29871,
29946,
8243,
13,
1678,
396,
462,
525,
8205,
267,
2396,
7442,
29889,
3298,
359,
29898,
29896,
29897,
13,
1678,
396,
632,
500,
13,
1678,
396,
632,
2582,
29889,
4397,
29898,
2914,
29897,
13,
1678,
396,
632,
6773,
13,
1678,
396,
13,
1678,
396,
308,
12422,
29889,
5992,
580,
13,
1678,
396,
308,
4629,
29918,
307,
275,
353,
1904,
29889,
307,
29875,
29918,
2813,
29879,
29889,
1884,
29918,
307,
29875,
29918,
10109,
29898,
13,
1678,
396,
632,
14391,
29961,
29900,
1402,
518,
29878,
1839,
1884,
267,
2033,
363,
364,
297,
620,
1402,
518,
29875,
29889,
12181,
14352,
29906,
17531,
363,
474,
297,
4558,
29918,
4703,
2314,
13,
1678,
396,
13,
1678,
396,
308,
396,
714,
29918,
10109,
353,
302,
29876,
29889,
29909,
1388,
415,
573,
12810,
29887,
11426,
29906,
29881,
3552,
29896,
29892,
29871,
29896,
876,
13,
1678,
396,
308,
396,
13,
1678,
396,
308,
396,
1121,
353,
426,
13,
1678,
396,
308,
396,
268,
525,
22100,
29918,
3318,
2396,
7442,
29889,
2378,
29898,
449,
29918,
10109,
29898,
8391,
29918,
307,
275,
467,
1493,
29898,
8391,
29918,
307,
275,
29889,
2311,
29898,
29900,
511,
448,
29896,
467,
4801,
496,
2141,
21970,
25739,
13,
1678,
396,
308,
396,
268,
525,
9917,
292,
29918,
1884,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
1884,
267,
13359,
4801,
496,
2141,
21970,
25739,
13,
1678,
396,
308,
396,
268,
525,
8205,
267,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
21134,
13359,
4801,
496,
2141,
21970,
3101,
13,
1678,
396,
308,
396,
500,
13,
1678,
396,
13,
1678,
396,
308,
1121,
353,
426,
13,
1678,
396,
632,
525,
22100,
29918,
3318,
2396,
7442,
29889,
2378,
29898,
4299,
29889,
307,
29875,
29918,
2813,
29879,
29889,
1884,
29918,
2813,
29898,
8391,
29918,
307,
275,
467,
4801,
496,
2141,
21970,
25739,
13,
1678,
396,
632,
525,
9917,
292,
29918,
1884,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
1884,
267,
13359,
4801,
496,
2141,
21970,
25739,
13,
1678,
396,
632,
525,
8205,
267,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
21134,
13359,
4801,
496,
2141,
21970,
3101,
13,
1678,
396,
308,
500,
13,
1678,
396,
13,
1678,
396,
308,
2582,
29889,
4397,
29898,
2914,
29897,
13,
1678,
396,
268,
2224,
29918,
29876,
2272,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
525,
20849,
29918,
29888,
1901,
1495,
13,
1678,
396,
268,
2897,
29889,
29885,
12535,
12935,
29898,
2084,
29918,
29876,
2272,
29892,
1863,
29918,
554,
29922,
5574,
29897,
13,
1678,
396,
268,
7442,
29889,
7620,
29898,
359,
29889,
2084,
29889,
7122,
29898,
2084,
29918,
29876,
2272,
29892,
285,
29915,
29912,
29895,
2403,
29888,
1901,
29918,
29941,
29906,
29900,
29918,
29896,
29900,
29906,
29946,
29889,
29876,
2272,
5477,
2582,
29897,
13,
1678,
396,
268,
1596,
29898,
2435,
29898,
9902,
876,
13,
13,
1678,
363,
413,
29892,
325,
297,
11117,
14968,
2396,
7945,
29918,
12657,
29892,
525,
1688,
2396,
1243,
29918,
12657,
1836,
7076,
7295,
13,
4706,
2582,
353,
5159,
13,
4706,
4489,
353,
10518,
29889,
949,
29918,
7638,
29898,
29888,
29915,
29914,
9799,
29914,
29879,
854,
29914,
29950,
3904,
29954,
29914,
5454,
1001,
29914,
21111,
287,
29918,
14394,
19248,
29895,
1836,
7638,
1495,
13,
4706,
363,
9853,
29918,
13140,
29892,
4559,
297,
260,
29939,
18933,
29898,
15172,
29898,
29894,
511,
3001,
29922,
2435,
29898,
29894,
22164,
13,
9651,
4558,
29918,
4703,
353,
4559,
1839,
3027,
29918,
4703,
13359,
517,
29898,
10141,
29897,
13,
9651,
14391,
353,
5159,
13,
9651,
12422,
353,
1904,
29889,
1627,
15933,
29889,
9573,
29918,
11333,
29918,
20849,
29898,
13,
18884,
14013,
1583,
29892,
1881,
29892,
1962,
29901,
14391,
29889,
4397,
29898,
4905,
876,
13,
9651,
620,
353,
1904,
29898,
8346,
29918,
4703,
29897,
13,
9651,
396,
1053,
282,
2585,
29936,
13,
9651,
396,
282,
2585,
29889,
842,
29918,
15003,
580,
13,
9651,
1018,
29901,
13,
18884,
4974,
7431,
29898,
690,
29961,
29900,
22322,
21134,
2033,
2804,
29871,
29900,
29897,
13,
9651,
5174,
29901,
13,
18884,
396,
14402,
29901,
817,
304,
1889,
746,
508,
29915,
29873,
6459,
3099,
29892,
3800,
29892,
3858,
29892,
5680,
526,
24786,
13,
18884,
1596,
877,
29999,
9672,
29918,
1884,
1495,
13,
18884,
1121,
353,
426,
13,
462,
1678,
525,
22100,
29918,
3318,
2396,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29871,
29896,
29900,
29906,
29946,
8243,
13,
462,
1678,
525,
9917,
292,
29918,
1884,
2396,
7442,
29889,
3298,
359,
3552,
29896,
29892,
29871,
29946,
8243,
13,
462,
1678,
525,
8205,
267,
2396,
7442,
29889,
3298,
359,
29898,
29896,
29897,
13,
18884,
500,
13,
18884,
2582,
29889,
4397,
29898,
2914,
29897,
13,
18884,
6773,
13,
13,
9651,
12422,
29889,
5992,
580,
13,
9651,
4629,
29918,
307,
275,
353,
1904,
29889,
307,
29875,
29918,
2813,
29879,
29889,
1884,
29918,
307,
29875,
29918,
10109,
29898,
13,
18884,
14391,
29961,
29900,
1402,
518,
29878,
1839,
1884,
267,
2033,
363,
364,
297,
620,
1402,
518,
29875,
29889,
12181,
14352,
29906,
17531,
363,
474,
297,
4558,
29918,
4703,
2314,
13,
13,
9651,
396,
714,
29918,
10109,
353,
302,
29876,
29889,
29909,
1388,
415,
573,
12810,
29887,
11426,
29906,
29881,
3552,
29896,
29892,
29871,
29896,
876,
13,
9651,
396,
13,
9651,
396,
1121,
353,
426,
13,
9651,
396,
268,
525,
22100,
29918,
3318,
2396,
7442,
29889,
2378,
29898,
449,
29918,
10109,
29898,
8391,
29918,
307,
275,
467,
1493,
29898,
8391,
29918,
307,
275,
29889,
2311,
29898,
29900,
511,
448,
29896,
467,
4801,
496,
2141,
21970,
25739,
13,
9651,
396,
268,
525,
9917,
292,
29918,
1884,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
1884,
267,
13359,
4801,
496,
2141,
21970,
25739,
13,
9651,
396,
268,
525,
8205,
267,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
21134,
13359,
4801,
496,
2141,
21970,
3101,
13,
9651,
396,
500,
13,
13,
9651,
1121,
353,
426,
13,
18884,
525,
22100,
29918,
3318,
2396,
7442,
29889,
2378,
29898,
4299,
29889,
307,
29875,
29918,
2813,
29879,
29889,
1884,
29918,
2813,
29898,
8391,
29918,
307,
275,
467,
4801,
496,
2141,
21970,
25739,
13,
18884,
525,
9917,
292,
29918,
1884,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
1884,
267,
13359,
4801,
496,
2141,
21970,
25739,
13,
18884,
525,
8205,
267,
2396,
7442,
29889,
2378,
29898,
690,
29961,
29900,
22322,
21134,
13359,
4801,
496,
2141,
21970,
3101,
13,
9651,
500,
13,
13,
9651,
1024,
29918,
29876,
2272,
29918,
1445,
353,
4489,
29889,
309,
542,
29961,
16175,
29918,
13140,
22322,
3027,
2033,
13,
9651,
953,
8194,
353,
4489,
29889,
309,
542,
29961,
16175,
29918,
13140,
22322,
331,
8194,
2033,
13,
9651,
2224,
29918,
29876,
2272,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
525,
20849,
29918,
29888,
1901,
1495,
13,
9651,
2897,
29889,
29885,
12535,
12935,
29898,
2084,
29918,
29876,
2272,
29892,
1863,
29918,
554,
29922,
5574,
29897,
13,
9651,
7442,
29889,
7620,
29898,
359,
29889,
2084,
29889,
7122,
29898,
2084,
29918,
29876,
2272,
29892,
285,
29915,
29912,
331,
8194,
3227,
978,
29918,
29876,
2272,
29918,
1445,
1836,
29876,
2272,
5477,
1121,
29897,
13,
9651,
2582,
29889,
4397,
29898,
359,
29889,
2084,
29889,
7122,
29898,
2084,
29918,
29876,
2272,
29892,
285,
29915,
29912,
331,
8194,
3227,
978,
29918,
29876,
2272,
29918,
1445,
1836,
29876,
2272,
8785,
13,
4706,
4489,
1839,
20849,
29918,
29888,
1901,
2033,
353,
2582,
13,
4706,
4489,
29889,
517,
29918,
7638,
29898,
29888,
29915,
29912,
29895,
2403,
20849,
29889,
7638,
1495,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
keras_bert/activations/gelu_tensorflow.py | Saumitra-Shukla/keras-bert | 9 | 85661 | <reponame>Saumitra-Shukla/keras-bert
from tensorflow.python.ops.math_ops import erf, sqrt
__all__ = ['gelu']
def gelu(x):
return 0.5 * x * (1.0 + erf(x / sqrt(2.0)))
| [
1,
529,
276,
1112,
420,
29958,
17618,
398,
277,
336,
29899,
2713,
2679,
433,
29914,
3946,
294,
29899,
2151,
13,
3166,
26110,
29889,
4691,
29889,
3554,
29889,
755,
29918,
3554,
1053,
23467,
29892,
18074,
2273,
13,
13,
1649,
497,
1649,
353,
6024,
7467,
29884,
2033,
13,
13,
13,
1753,
9127,
29884,
29898,
29916,
1125,
13,
1678,
736,
29871,
29900,
29889,
29945,
334,
921,
334,
313,
29896,
29889,
29900,
718,
23467,
29898,
29916,
847,
18074,
2273,
29898,
29906,
29889,
29900,
4961,
13,
2
] |
day14.py | dos1/AoC21 | 0 | 96723 | <reponame>dos1/AoC21
def I(d,i,v):d[i]=d.setdefault(i,0)+v
L=open("inputday14").readlines();t,d,p=L[0],dict([l.strip().split(' -> ')for l in L[2:]]),{};[I(p,t[i:i+2],1)for i in range(len(t)-2)]
def E(P):o=dict(P);[(I(P,p,-o[p]),I(P,p[0]+n,o[p]),I(P,n+p[1],o[p]))for p,n in d.items()if p in o.keys()];return P
def C(P):e={};[I(e,c,v)for p,v in P.items()for c in p];return{x:-int(e[x]/2//-1)for x in e}
print((r:=[max(e:=C(E(p)).values())-min(e)for i in range(40)])[9],r[-1])
| [
1,
529,
276,
1112,
420,
29958,
29881,
359,
29896,
29914,
29909,
29877,
29907,
29906,
29896,
13,
1753,
306,
29898,
29881,
29892,
29875,
29892,
29894,
1125,
29881,
29961,
29875,
13192,
29881,
29889,
842,
4381,
29898,
29875,
29892,
29900,
7240,
29894,
13,
29931,
29922,
3150,
703,
2080,
3250,
29896,
29946,
2564,
949,
9012,
890,
29873,
29892,
29881,
29892,
29886,
29922,
29931,
29961,
29900,
1402,
8977,
4197,
29880,
29889,
17010,
2141,
5451,
877,
1599,
25710,
1454,
301,
297,
365,
29961,
29906,
29901,
5262,
511,
29912,
3400,
29961,
29902,
29898,
29886,
29892,
29873,
29961,
29875,
29901,
29875,
29974,
29906,
1402,
29896,
29897,
1454,
474,
297,
3464,
29898,
2435,
29898,
29873,
6817,
29906,
4638,
13,
1753,
382,
29898,
29925,
1125,
29877,
29922,
8977,
29898,
29925,
416,
15625,
29902,
29898,
29925,
29892,
29886,
6653,
29877,
29961,
29886,
11724,
29902,
29898,
29925,
29892,
29886,
29961,
29900,
10062,
29876,
29892,
29877,
29961,
29886,
11724,
29902,
29898,
29925,
29892,
29876,
29974,
29886,
29961,
29896,
1402,
29877,
29961,
29886,
12622,
1454,
282,
29892,
29876,
297,
270,
29889,
7076,
580,
361,
282,
297,
288,
29889,
8149,
580,
1385,
2457,
349,
13,
1753,
315,
29898,
29925,
1125,
29872,
3790,
3400,
29961,
29902,
29898,
29872,
29892,
29883,
29892,
29894,
29897,
1454,
282,
29892,
29894,
297,
349,
29889,
7076,
580,
1454,
274,
297,
282,
1385,
2457,
29912,
29916,
13018,
524,
29898,
29872,
29961,
29916,
16261,
29906,
458,
29899,
29896,
29897,
1454,
921,
297,
321,
29913,
13,
2158,
3552,
29878,
9361,
29961,
3317,
29898,
29872,
9361,
29907,
29898,
29923,
29898,
29886,
8106,
5975,
3101,
29899,
1195,
29898,
29872,
29897,
1454,
474,
297,
3464,
29898,
29946,
29900,
29897,
2314,
29961,
29929,
1402,
29878,
14352,
29896,
2314,
13,
2
] |
P05/ex04_rand.py | ChanganXLTZ/project_test | 1 | 163367 | # -*- coding:UTF-8 -*-
#! /usr/bin/python3
import random
list_a = [1,2,3,4,1,2,3,4,5,1,4,3,4,1,10]
print(range(10))
print('将range(10)转化成数组:',list(range(10)))
print(random.choice(list_a))
print(random.choice(range(10)))
# print(random.randrange(-10,10,1.5)) # randrange ([start,] stop [,step])
print(random.random()) # 随机生成下一个实数,它在[0,1)范围内。
print(random.shuffle(list_a)) # 将序列的所有元素随机排序。
print(random.uniform(-10,10)) # 随机生成实数,它在[x,y]范围内。 | [
1,
396,
448,
29930,
29899,
14137,
29901,
10496,
29899,
29947,
448,
29930,
29899,
30004,
13,
29937,
29991,
847,
4855,
29914,
2109,
29914,
4691,
29941,
30004,
13,
5215,
4036,
30004,
13,
30004,
13,
1761,
29918,
29874,
353,
518,
29896,
29892,
29906,
29892,
29941,
29892,
29946,
29892,
29896,
29892,
29906,
29892,
29941,
29892,
29946,
29892,
29945,
29892,
29896,
29892,
29946,
29892,
29941,
29892,
29946,
29892,
29896,
29892,
29896,
29900,
29962,
30004,
13,
2158,
29898,
3881,
29898,
29896,
29900,
876,
30004,
13,
2158,
877,
30998,
3881,
29898,
29896,
29900,
29897,
31415,
30705,
30494,
30354,
31263,
30383,
742,
1761,
29898,
3881,
29898,
29896,
29900,
4961,
30004,
13,
2158,
29898,
8172,
29889,
16957,
29898,
1761,
29918,
29874,
876,
30004,
13,
2158,
29898,
8172,
29889,
16957,
29898,
3881,
29898,
29896,
29900,
4961,
30004,
13,
29937,
1596,
29898,
8172,
29889,
9502,
3881,
6278,
29896,
29900,
29892,
29896,
29900,
29892,
29896,
29889,
29945,
876,
396,
20088,
3881,
9310,
2962,
26073,
5040,
518,
29892,
10568,
2314,
30004,
13,
2158,
29898,
8172,
29889,
8172,
3101,
396,
29871,
236,
157,
146,
31429,
30486,
30494,
30557,
30287,
30502,
31195,
30354,
30214,
232,
177,
134,
30505,
29961,
29900,
29892,
29896,
29897,
235,
143,
134,
232,
158,
183,
30728,
30267,
30004,
13,
2158,
29898,
8172,
29889,
845,
21897,
29898,
1761,
29918,
29874,
876,
396,
29871,
30998,
31463,
31025,
30210,
30744,
30417,
30824,
31605,
236,
157,
146,
31429,
233,
145,
149,
31463,
30267,
30004,
13,
2158,
29898,
8172,
29889,
29590,
6278,
29896,
29900,
29892,
29896,
29900,
876,
396,
29871,
236,
157,
146,
31429,
30486,
30494,
31195,
30354,
30214,
232,
177,
134,
30505,
29961,
29916,
29892,
29891,
29962,
235,
143,
134,
232,
158,
183,
30728,
30267,
2
] |
time_wizard/mixins.py | wfehr/django-time-wizard | 5 | 32327 | <filename>time_wizard/mixins.py<gh_stars>1-10
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.utils.timezone import now
class TimeWizardInlineMixin(models.Model):
"""
Mixin for the inline support of PeriodModel.
"""
periods = GenericRelation(
'time_wizard.PeriodModel',
)
class Meta:
abstract = True
@property
def is_published(self):
dt = now()
for p in self.periods.all():
if p.contains(dt):
return True
return False
class TimeWizardMixin(models.Model):
"""
Mixin to let models have a foreign-key-relation to the TimeWizard. Property
`is_published` is used to indicate if a TimeWizard is set wether or not
to show the contents/children.
"""
time_wizard = models.ForeignKey(
'time_wizard.TimeWizardModel',
on_delete=models.SET_NULL,
blank=True,
null=True,
)
class Meta:
abstract = True
@property
def is_published(self):
if self.time_wizard_id:
return self.time_wizard.is_published
else:
return False
| [
1,
529,
9507,
29958,
2230,
29918,
29893,
17909,
29914,
28084,
1144,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
9557,
29889,
21570,
29889,
3051,
8768,
29889,
9621,
1053,
3251,
293,
9662,
362,
13,
3166,
9557,
29889,
2585,
1053,
4733,
13,
3166,
9557,
29889,
13239,
29889,
2230,
8028,
1053,
1286,
13,
13,
13,
1990,
5974,
29956,
17909,
797,
1220,
29924,
861,
262,
29898,
9794,
29889,
3195,
1125,
13,
1678,
9995,
13,
1678,
23478,
262,
363,
278,
10583,
2304,
310,
29498,
3195,
29889,
13,
1678,
9995,
13,
1678,
23704,
353,
3251,
293,
9662,
362,
29898,
13,
4706,
525,
2230,
29918,
29893,
17909,
29889,
29853,
3195,
742,
13,
1678,
1723,
13,
13,
1678,
770,
20553,
29901,
13,
4706,
9846,
353,
5852,
13,
13,
1678,
732,
6799,
13,
1678,
822,
338,
29918,
5467,
3726,
29898,
1311,
1125,
13,
4706,
11636,
353,
1286,
580,
13,
4706,
363,
282,
297,
1583,
29889,
19145,
29879,
29889,
497,
7295,
13,
9651,
565,
282,
29889,
11516,
29898,
6008,
1125,
13,
18884,
736,
5852,
13,
4706,
736,
7700,
13,
13,
13,
1990,
5974,
29956,
17909,
29924,
861,
262,
29898,
9794,
29889,
3195,
1125,
13,
1678,
9995,
13,
1678,
23478,
262,
304,
1235,
4733,
505,
263,
9117,
29899,
1989,
29899,
23445,
304,
278,
5974,
29956,
17909,
29889,
9079,
13,
1678,
421,
275,
29918,
5467,
3726,
29952,
338,
1304,
304,
12266,
565,
263,
5974,
29956,
17909,
338,
731,
281,
1979,
470,
451,
13,
1678,
304,
1510,
278,
8118,
29914,
11991,
29889,
13,
1678,
9995,
13,
1678,
931,
29918,
29893,
17909,
353,
4733,
29889,
27755,
2558,
29898,
13,
4706,
525,
2230,
29918,
29893,
17909,
29889,
2481,
29956,
17909,
3195,
742,
13,
4706,
373,
29918,
8143,
29922,
9794,
29889,
10490,
29918,
10074,
29892,
13,
4706,
9654,
29922,
5574,
29892,
13,
4706,
1870,
29922,
5574,
29892,
13,
1678,
1723,
13,
13,
1678,
770,
20553,
29901,
13,
4706,
9846,
353,
5852,
13,
13,
1678,
732,
6799,
13,
1678,
822,
338,
29918,
5467,
3726,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
2230,
29918,
29893,
17909,
29918,
333,
29901,
13,
9651,
736,
1583,
29889,
2230,
29918,
29893,
17909,
29889,
275,
29918,
5467,
3726,
13,
4706,
1683,
29901,
13,
9651,
736,
7700,
13,
2
] |
scraper/storage_spiders/sieuthisua365vn.py | chongiadung/choinho | 0 | 109019 | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//h1[@class='titleProduct']",
'price' : "//div[@class='desc3']/span[@class='price']",
'category' : "//div[@class='inner']/a",
'description' : "//div[@class='leftcontentDetails']/div[@class='tabct active']",
'images' : "//meta[@property='og:image']/@content",
'canonical' : "",
'base_url' : "",
'brand' : ""
}
name = 'sieuthis<EMAIL>6<EMAIL>'
allowed_domains = ['sieuthisua365.vn']
start_urls = ['http://sieuthisua365.vn/']
tracking_url = ''
sitemap_urls = ['']
sitemap_rules = [('', 'parse_item')]
sitemap_follow = []
rules = [
#Rule(LinkExtractor(), 'parse_item'),
#Rule(LinkExtractor(), 'parse'),
Rule(LinkExtractor(allow=['/[a-zA-Z0-9-]+\.htm$']), 'parse_item_and_links'),
]
| [
1,
396,
11133,
5759,
491,
15299,
29889,
2272,
29889,
21267,
445,
1196,
565,
366,
1207,
21733,
29889,
13,
3166,
24559,
2272,
29889,
1028,
11376,
1053,
27308,
13,
3166,
24559,
2272,
29889,
1915,
446,
486,
1461,
943,
1053,
6645,
5647,
28891,
13,
13,
29990,
10145,
353,
426,
13,
1678,
525,
978,
29915,
584,
376,
458,
29882,
29896,
17548,
1990,
2433,
3257,
7566,
2033,
613,
13,
1678,
525,
9175,
29915,
584,
376,
458,
4563,
17548,
1990,
2433,
14273,
29941,
2033,
29914,
9653,
17548,
1990,
2433,
9175,
2033,
613,
13,
1678,
525,
7320,
29915,
584,
376,
458,
4563,
17548,
1990,
2433,
3993,
2033,
29914,
29874,
613,
13,
1678,
525,
8216,
29915,
584,
376,
458,
4563,
17548,
1990,
2433,
1563,
3051,
10602,
2033,
29914,
4563,
17548,
1990,
2433,
3891,
312,
6136,
2033,
613,
13,
1678,
525,
8346,
29915,
584,
376,
458,
7299,
17548,
6799,
2433,
468,
29901,
3027,
2033,
29368,
3051,
613,
13,
1678,
525,
3068,
265,
936,
29915,
584,
12633,
13,
1678,
525,
3188,
29918,
2271,
29915,
584,
12633,
13,
1678,
525,
16472,
29915,
584,
5124,
13,
29913,
13,
978,
353,
525,
29879,
347,
2806,
275,
29966,
26862,
6227,
29958,
29953,
29966,
26862,
6227,
16299,
13,
24622,
29918,
3129,
2708,
353,
6024,
29879,
347,
2806,
275,
3357,
29941,
29953,
29945,
29889,
18564,
2033,
13,
2962,
29918,
26045,
353,
6024,
1124,
597,
29879,
347,
2806,
275,
3357,
29941,
29953,
29945,
29889,
18564,
29914,
2033,
13,
11294,
292,
29918,
2271,
353,
6629,
13,
29879,
667,
481,
29918,
26045,
353,
6024,
2033,
13,
29879,
667,
481,
29918,
19238,
353,
518,
877,
742,
525,
5510,
29918,
667,
1495,
29962,
13,
29879,
667,
481,
29918,
23031,
353,
5159,
13,
19238,
353,
518,
13,
1678,
396,
10740,
29898,
6595,
5647,
28891,
3285,
525,
5510,
29918,
667,
5477,
13,
1678,
396,
10740,
29898,
6595,
5647,
28891,
3285,
525,
5510,
5477,
13,
1678,
27308,
29898,
6595,
5647,
28891,
29898,
9536,
29922,
1839,
29914,
29961,
29874,
29899,
25265,
29899,
29999,
29900,
29899,
29929,
29899,
29962,
3124,
29889,
13357,
29938,
2033,
511,
525,
5510,
29918,
667,
29918,
392,
29918,
4965,
5477,
13,
29962,
13,
2
] |
duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/12_features/numtrees_20/rule_6.py | apcarrik/kaggle | 0 | 6729 | def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Gender, obj[4]: Age, obj[5]: Education, obj[6]: Occupation, obj[7]: Bar, obj[8]: Coffeehouse, obj[9]: Restaurant20to50, obj[10]: Direction_same, obj[11]: Distance
# {"feature": "Age", "instances": 51, "metric_value": 0.9662, "depth": 1}
if obj[4]>0:
# {"feature": "Occupation", "instances": 44, "metric_value": 0.9024, "depth": 2}
if obj[6]>1:
# {"feature": "Bar", "instances": 33, "metric_value": 0.9834, "depth": 3}
if obj[7]<=1.0:
# {"feature": "Education", "instances": 22, "metric_value": 0.994, "depth": 4}
if obj[5]>0:
# {"feature": "Passanger", "instances": 17, "metric_value": 0.9774, "depth": 5}
if obj[0]<=2:
# {"feature": "Time", "instances": 11, "metric_value": 0.994, "depth": 6}
if obj[1]<=2:
# {"feature": "Restaurant20to50", "instances": 8, "metric_value": 0.9544, "depth": 7}
if obj[9]>0.0:
# {"feature": "Coffeehouse", "instances": 6, "metric_value": 0.65, "depth": 8}
if obj[8]<=2.0:
return 'True'
elif obj[8]>2.0:
return 'False'
else: return 'False'
elif obj[9]<=0.0:
return 'False'
else: return 'False'
elif obj[1]>2:
return 'False'
else: return 'False'
elif obj[0]>2:
# {"feature": "Gender", "instances": 6, "metric_value": 0.65, "depth": 6}
if obj[3]>0:
return 'True'
elif obj[3]<=0:
# {"feature": "Time", "instances": 2, "metric_value": 1.0, "depth": 7}
if obj[1]<=2:
return 'True'
elif obj[1]>2:
return 'False'
else: return 'False'
else: return 'True'
else: return 'True'
elif obj[5]<=0:
return 'False'
else: return 'False'
elif obj[7]>1.0:
# {"feature": "Coupon", "instances": 11, "metric_value": 0.684, "depth": 4}
if obj[2]>2:
return 'True'
elif obj[2]<=2:
# {"feature": "Direction_same", "instances": 4, "metric_value": 1.0, "depth": 5}
if obj[10]>0:
return 'True'
elif obj[10]<=0:
return 'False'
else: return 'False'
else: return 'True'
else: return 'True'
elif obj[6]<=1:
return 'True'
else: return 'True'
elif obj[4]<=0:
# {"feature": "Passanger", "instances": 7, "metric_value": 0.5917, "depth": 2}
if obj[0]>0:
return 'False'
elif obj[0]<=0:
return 'True'
else: return 'True'
else: return 'False'
| [
1,
822,
1284,
6185,
2459,
29898,
5415,
1125,
396,
5415,
29961,
29900,
5387,
6978,
4600,
29892,
5446,
29961,
29896,
5387,
5974,
29892,
5446,
29961,
29906,
5387,
19565,
1112,
29892,
5446,
29961,
29941,
5387,
402,
1581,
29892,
5446,
29961,
29946,
5387,
16767,
29892,
5446,
29961,
29945,
5387,
13151,
29892,
5446,
29961,
29953,
5387,
16117,
786,
362,
29892,
5446,
29961,
29955,
5387,
2261,
29892,
5446,
29961,
29947,
5387,
315,
2696,
3905,
8697,
29892,
5446,
29961,
29929,
5387,
390,
22837,
424,
29906,
29900,
517,
29945,
29900,
29892,
5446,
29961,
29896,
29900,
5387,
360,
8684,
29918,
17642,
29892,
5446,
29961,
29896,
29896,
5387,
6652,
749,
13,
12,
29937,
8853,
14394,
1115,
376,
22406,
613,
376,
2611,
2925,
1115,
29871,
29945,
29896,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29929,
29953,
29953,
29906,
29892,
376,
19488,
1115,
29871,
29896,
29913,
13,
12,
361,
5446,
29961,
29946,
29962,
29958,
29900,
29901,
13,
12,
12,
29937,
8853,
14394,
1115,
376,
22034,
786,
362,
613,
376,
2611,
2925,
1115,
29871,
29946,
29946,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29929,
29900,
29906,
29946,
29892,
376,
19488,
1115,
29871,
29906,
29913,
13,
12,
12,
361,
5446,
29961,
29953,
29962,
29958,
29896,
29901,
13,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
4297,
613,
376,
2611,
2925,
1115,
29871,
29941,
29941,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29929,
29947,
29941,
29946,
29892,
376,
19488,
1115,
29871,
29941,
29913,
13,
12,
12,
12,
361,
5446,
29961,
29955,
29962,
14065,
29896,
29889,
29900,
29901,
13,
12,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
29923,
29392,
613,
376,
2611,
2925,
1115,
29871,
29906,
29906,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29929,
29929,
29946,
29892,
376,
19488,
1115,
29871,
29946,
29913,
13,
12,
12,
12,
12,
361,
5446,
29961,
29945,
29962,
29958,
29900,
29901,
13,
12,
12,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
7129,
4600,
613,
376,
2611,
2925,
1115,
29871,
29896,
29955,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29929,
29955,
29955,
29946,
29892,
376,
19488,
1115,
29871,
29945,
29913,
13,
12,
12,
12,
12,
12,
361,
5446,
29961,
29900,
29962,
14065,
29906,
29901,
13,
12,
12,
12,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
2481,
613,
376,
2611,
2925,
1115,
29871,
29896,
29896,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29929,
29929,
29946,
29892,
376,
19488,
1115,
29871,
29953,
29913,
13,
12,
12,
12,
12,
12,
12,
361,
5446,
29961,
29896,
29962,
14065,
29906,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
29934,
22837,
424,
29906,
29900,
517,
29945,
29900,
613,
376,
2611,
2925,
1115,
29871,
29947,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29929,
29945,
29946,
29946,
29892,
376,
19488,
1115,
29871,
29955,
29913,
13,
12,
12,
12,
12,
12,
12,
12,
361,
5446,
29961,
29929,
29962,
29958,
29900,
29889,
29900,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
29907,
2696,
3905,
8697,
613,
376,
2611,
2925,
1115,
29871,
29953,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29953,
29945,
29892,
376,
19488,
1115,
29871,
29947,
29913,
13,
12,
12,
12,
12,
12,
12,
12,
12,
361,
5446,
29961,
29947,
29962,
14065,
29906,
29889,
29900,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
12,
12,
2457,
525,
5574,
29915,
13,
12,
12,
12,
12,
12,
12,
12,
12,
23681,
5446,
29961,
29947,
29962,
29958,
29906,
29889,
29900,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
12,
12,
2457,
525,
8824,
29915,
13,
12,
12,
12,
12,
12,
12,
12,
12,
2870,
29901,
736,
525,
8824,
29915,
13,
12,
12,
12,
12,
12,
12,
12,
23681,
5446,
29961,
29929,
29962,
14065,
29900,
29889,
29900,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
12,
2457,
525,
8824,
29915,
13,
12,
12,
12,
12,
12,
12,
12,
2870,
29901,
736,
525,
8824,
29915,
13,
12,
12,
12,
12,
12,
12,
23681,
5446,
29961,
29896,
29962,
29958,
29906,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
2457,
525,
8824,
29915,
13,
12,
12,
12,
12,
12,
12,
2870,
29901,
736,
525,
8824,
29915,
13,
12,
12,
12,
12,
12,
23681,
5446,
29961,
29900,
29962,
29958,
29906,
29901,
13,
12,
12,
12,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
29954,
1581,
613,
376,
2611,
2925,
1115,
29871,
29953,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29953,
29945,
29892,
376,
19488,
1115,
29871,
29953,
29913,
13,
12,
12,
12,
12,
12,
12,
361,
5446,
29961,
29941,
29962,
29958,
29900,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
2457,
525,
5574,
29915,
13,
12,
12,
12,
12,
12,
12,
23681,
5446,
29961,
29941,
29962,
14065,
29900,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
2481,
613,
376,
2611,
2925,
1115,
29871,
29906,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29896,
29889,
29900,
29892,
376,
19488,
1115,
29871,
29955,
29913,
13,
12,
12,
12,
12,
12,
12,
12,
361,
5446,
29961,
29896,
29962,
14065,
29906,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
12,
2457,
525,
5574,
29915,
13,
12,
12,
12,
12,
12,
12,
12,
23681,
5446,
29961,
29896,
29962,
29958,
29906,
29901,
13,
12,
12,
12,
12,
12,
12,
12,
12,
2457,
525,
8824,
29915,
13,
12,
12,
12,
12,
12,
12,
12,
2870,
29901,
736,
525,
8824,
29915,
13,
12,
12,
12,
12,
12,
12,
2870,
29901,
736,
525,
5574,
29915,
13,
12,
12,
12,
12,
12,
2870,
29901,
736,
525,
5574,
29915,
13,
12,
12,
12,
12,
23681,
5446,
29961,
29945,
29962,
14065,
29900,
29901,
13,
12,
12,
12,
12,
12,
2457,
525,
8824,
29915,
13,
12,
12,
12,
12,
2870,
29901,
736,
525,
8824,
29915,
13,
12,
12,
12,
23681,
5446,
29961,
29955,
29962,
29958,
29896,
29889,
29900,
29901,
13,
12,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
29907,
283,
1112,
613,
376,
2611,
2925,
1115,
29871,
29896,
29896,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29953,
29947,
29946,
29892,
376,
19488,
1115,
29871,
29946,
29913,
13,
12,
12,
12,
12,
361,
5446,
29961,
29906,
29962,
29958,
29906,
29901,
13,
12,
12,
12,
12,
12,
2457,
525,
5574,
29915,
13,
12,
12,
12,
12,
23681,
5446,
29961,
29906,
29962,
14065,
29906,
29901,
13,
12,
12,
12,
12,
12,
29937,
8853,
14394,
1115,
376,
21602,
29918,
17642,
613,
376,
2611,
2925,
1115,
29871,
29946,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29896,
29889,
29900,
29892,
376,
19488,
1115,
29871,
29945,
29913,
13,
12,
12,
12,
12,
12,
361,
5446,
29961,
29896,
29900,
29962,
29958,
29900,
29901,
13,
12,
12,
12,
12,
12,
12,
2457,
525,
5574,
29915,
13,
12,
12,
12,
12,
12,
23681,
5446,
29961,
29896,
29900,
29962,
14065,
29900,
29901,
13,
12,
12,
12,
12,
12,
12,
2457,
525,
8824,
29915,
13,
12,
12,
12,
12,
12,
2870,
29901,
736,
525,
8824,
29915,
13,
12,
12,
12,
12,
2870,
29901,
736,
525,
5574,
29915,
13,
12,
12,
12,
2870,
29901,
736,
525,
5574,
29915,
13,
12,
12,
23681,
5446,
29961,
29953,
29962,
14065,
29896,
29901,
13,
12,
12,
12,
2457,
525,
5574,
29915,
13,
12,
12,
2870,
29901,
736,
525,
5574,
29915,
13,
12,
23681,
5446,
29961,
29946,
29962,
14065,
29900,
29901,
13,
12,
12,
29937,
8853,
14394,
1115,
376,
7129,
4600,
613,
376,
2611,
2925,
1115,
29871,
29955,
29892,
376,
16414,
29918,
1767,
1115,
29871,
29900,
29889,
29945,
29929,
29896,
29955,
29892,
376,
19488,
1115,
29871,
29906,
29913,
13,
12,
12,
361,
5446,
29961,
29900,
29962,
29958,
29900,
29901,
13,
12,
12,
12,
2457,
525,
8824,
29915,
13,
12,
12,
23681,
5446,
29961,
29900,
29962,
14065,
29900,
29901,
13,
12,
12,
12,
2457,
525,
5574,
29915,
13,
12,
12,
2870,
29901,
736,
525,
5574,
29915,
13,
12,
2870,
29901,
736,
525,
8824,
29915,
13,
2
] |
label_wav_lebhoryi.py | Lebhoryi/ML-KWS-for-MCU | 1 | 78704 | <reponame>Lebhoryi/ML-KWS-for-MCU<filename>label_wav_lebhoryi.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
r"""Runs a trained audio graph against a WAVE file and reports the results.
The model, labels and .wav file specified in the arguments will be loaded, and
then the predictions from running the model against the audio data will be
printed to the console. This is a useful script for sanity checking trained
models, and as an example of how to use an audio model from Python.
Here's an example of running it:
python tensorflow/examples/speech_commands/label_wav.py \
--graph=/tmp/my_frozen_graph.pb \
--labels=/tmp/speech_commands_train/conv_labels.txt \
--wav=/tmp/speech_dataset/left/a5d485dc_nohash_0.wav
"""
#### update 2020.3.28 #############################
# 1. 将--wav 改为 --dir_path , 获取音频文件夹路径
# 2. 新增识别准确率输出
# 3. 执行命令如下:
# python3 label_wav \
# --dir_path=../local_data/test_wav/other \
# --graph=./pb/327_dnn.pb \
# --labels=./train_model/326_dnn/dnn_labels.txt
###################################################
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"]='2' # Only showing warning & Error
import librosa
from python_speech_features import mfcc as pmfcc
import glob
import tensorflow as tf
# pylint: disable=unused-import
from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
# pylint: enable=unused-import
FLAGS = None
def load_graph(filename):
"""Unpersists graph from file as default graph."""
with tf.gfile.FastGFile(filename, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
tf.import_graph_def(graph_def, name='')
def load_labels(filename):
"""Read in labels, one label per line."""
return [line.rstrip() for line in tf.gfile.GFile(filename)]
def run_graph(wav_data, labels, input_layer_name, output_layer_name,
count_top_predictions):
"""Runs the audio data through the graph and prints predictions."""
with tf.Session() as sess:
# Feed the audio data as input to the graph.
# predictions will contain a two-dimensional array, where one
# dimension represents the input image count, and the other has
# predictions per class
softmax_tensor = sess.graph.get_tensor_by_name(output_layer_name)
predictions, = sess.run(softmax_tensor, {input_layer_name: wav_data})
# Sort to show labels in order of confidence
top_k = predictions.argsort()[-count_top_predictions:][::-1]
# for node_id in top_k:
# human_string = labels[node_id]
# score = predictions[node_id]
# print('%s (score = %.5f)' % (human_string, score))
# 只保留分值最高的标签
return labels[int(top_k[:1])]
def label_wav(dir_path, labels, graph, input_name, output_name, how_many_labels):
"""Loads the model and labels, and runs the inference to print predictions."""
# wav file
if not dir_path or not tf.gfile.Exists(dir_path):
# tf.logging.fatal('Audio file does not exist %s', wav)
tf.logging.fatal('Audio file path does not exist %s', dir_path)
# label file
if not labels or not tf.gfile.Exists(labels):
tf.logging.fatal('Labels file does not exist %s', labels)
# model file
if not graph or not tf.gfile.Exists(graph):
tf.logging.fatal('Graph file does not exist %s', graph)
labels_list = load_labels(labels)
# load graph, which is stored in the default session
load_graph(graph)
# 原本是wav, 改成了dir_path
# 完整的音频路径 list
# 识别错误的样本总数 | 在other时,识别为xrxr的数量 | 在other时,识别为nihaoxr的数量
count, count1, count2 = 0, 0, 0
wav_paths = glob.glob(os.path.join(dir_path, "*.wav"))
# 文件夹前四个字母
dir_name = os.path.basename(dir_path)[:4]
for wav in wav_paths:
# wav = os.path.join(os.path.dirname(wav_paths[i]), str(i) + ".wav")
# os.rename(wav_paths[i], wav) # rename
# 获取mfcc
# y,sr = librosa.load(wav)
# mfcc = librosa.feature.mfcc(y, sr, n_mfcc=13)
# print("{} 的mfcc 为:".format(os.path.basename(wav)))
# with open("/home/lebhoryi/Desktop/mfcc.txt", "w") as f:
# f.write(str(mfcc))
with open(wav, 'rb') as wav_file:
wav_data = wav_file.read()
label = run_graph(wav_data, labels_list, input_name, output_name, how_many_labels)
# print(os.path.split(os.path.dirname(wav)))
# 打印所有样本的预测信息
print('{} : {}'.format(os.path.basename(wav), label))
# 根据文件夹名字来分别xrxr \ nhxr \ other
if dir_name[:4] == "othe":
count1 = count1 + 1 if label == "xrxr" else count1
count2 = count2 + 1 if label == "nihaoxr" else count2
print('{} : {}'.format(os.path.basename(wav), label))
elif dir_name[:4] == "xrxr":
if label != "xrxr":
count += 1
print('{} : {}'.format(os.path.basename(wav), label))
elif dir_name[:4] == "niha":
if label != "nihaoxr":
count += 1
print('{} : {}'.format(os.path.basename(wav), label))
if dir_name[:4] == "othe":
count = count1 + count2
print("总共有{}个样本, 识别错误的有{}条样本".format(len(wav_paths), count))
print("识别为xrxr:{}, 识别为nihaoxr:{}".format(count1, count2))
else:
print("总共有{}个样本, 识别错误的有{}条样本".format(len(wav_paths), count))
print("准确率为:{}".format(1 - count / len(wav_paths)))
def main(_):
"""Entry point for script, converts flags to arguments."""
label_wav(FLAGS.dir_path, FLAGS.labels, FLAGS.graph, FLAGS.input_name,
FLAGS.output_name, FLAGS.how_many_labels)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# parser.add_argument(
# '--wav', type=str, default='', help='Audio file to be identified.')
parser.add_argument(
'--dir_path', type=str, default='../local_data/test_wav/2_classes/other',
help='Wav files path.')
parser.add_argument(
'--graph', type=str, default='', help='Model to use for identification.')
parser.add_argument(
'--labels', type=str, default='', help='Path to file containing labels.')
parser.add_argument(
'--input_name',
type=str,
default='wav_data:0',
help='Name of WAVE data input node in model.')
parser.add_argument(
'--output_name',
type=str,
default='labels_softmax:0',
help='Name of node outputting a prediction in the model.')
parser.add_argument(
'--how_many_labels',
type=int,
default=3,
help='countber of results to show.')
FLAGS, unparsed = parser.parse_known_args()
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
| [
1,
529,
276,
1112,
420,
29958,
29931,
774,
29882,
706,
29875,
29914,
1988,
29899,
29968,
7811,
29899,
1454,
29899,
12513,
29965,
29966,
9507,
29958,
1643,
29918,
29893,
485,
29918,
19982,
29882,
706,
29875,
29889,
2272,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29955,
450,
323,
6073,
17907,
13189,
943,
29889,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
2751,
13,
29878,
15945,
29908,
6558,
29879,
263,
16370,
10348,
3983,
2750,
263,
399,
7520,
29923,
934,
322,
13676,
278,
2582,
29889,
13,
13,
1576,
1904,
29892,
11073,
322,
869,
29893,
485,
934,
6790,
297,
278,
6273,
674,
367,
7500,
29892,
322,
13,
6098,
278,
27303,
515,
2734,
278,
1904,
2750,
278,
10348,
848,
674,
367,
13,
2158,
287,
304,
278,
2991,
29889,
910,
338,
263,
5407,
2471,
363,
9753,
537,
8454,
16370,
13,
9794,
29892,
322,
408,
385,
1342,
310,
920,
304,
671,
385,
10348,
1904,
515,
5132,
29889,
13,
13,
10605,
29915,
29879,
385,
1342,
310,
2734,
372,
29901,
13,
13,
4691,
26110,
29914,
19057,
29914,
5965,
5309,
29918,
26381,
29914,
1643,
29918,
29893,
485,
29889,
2272,
320,
13,
489,
4262,
14327,
7050,
29914,
1357,
29918,
29888,
307,
2256,
29918,
4262,
29889,
24381,
320,
13,
489,
21134,
14327,
7050,
29914,
5965,
5309,
29918,
26381,
29918,
14968,
29914,
20580,
29918,
21134,
29889,
3945,
320,
13,
489,
29893,
485,
14327,
7050,
29914,
5965,
5309,
29918,
24713,
29914,
1563,
29914,
29874,
29945,
29881,
29946,
29947,
29945,
13891,
29918,
29876,
1148,
1161,
29918,
29900,
29889,
29893,
485,
13,
13,
15945,
29908,
13,
13,
4136,
2767,
29871,
29906,
29900,
29906,
29900,
29889,
29941,
29889,
29906,
29947,
835,
13383,
7346,
2277,
13,
29937,
29871,
29896,
29889,
29871,
30998,
489,
29893,
485,
29871,
31264,
30573,
1192,
3972,
29918,
2084,
1919,
29871,
31024,
30683,
30941,
236,
165,
148,
30333,
30631,
232,
167,
188,
30874,
232,
193,
135,
13,
29937,
29871,
29906,
29889,
29871,
30374,
232,
165,
161,
235,
178,
137,
232,
139,
174,
232,
138,
137,
31835,
234,
145,
138,
31573,
30544,
13,
29937,
29871,
29941,
29889,
29871,
233,
140,
170,
30448,
31237,
31650,
30847,
30557,
30383,
13,
29937,
268,
3017,
29941,
3858,
29918,
29893,
485,
320,
13,
29937,
268,
1192,
3972,
29918,
2084,
29922,
6995,
2997,
29918,
1272,
29914,
1688,
29918,
29893,
485,
29914,
1228,
320,
13,
29937,
268,
1192,
4262,
29922,
6904,
24381,
29914,
29941,
29906,
29955,
29918,
5200,
29876,
29889,
24381,
320,
13,
29937,
268,
1192,
21134,
29922,
6904,
14968,
29918,
4299,
29914,
29941,
29906,
29953,
29918,
5200,
29876,
29914,
5200,
29876,
29918,
21134,
29889,
3945,
13,
13383,
13383,
13383,
2277,
29937,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
5215,
1852,
5510,
13,
5215,
10876,
13,
5215,
2897,
13,
359,
29889,
21813,
3366,
8969,
29918,
6271,
29925,
29918,
16173,
29918,
14480,
29918,
1307,
29963,
6670,
3108,
2433,
29906,
29915,
396,
9333,
6445,
9177,
669,
4829,
13,
13,
5215,
4303,
1883,
29874,
13,
3166,
3017,
29918,
5965,
5309,
29918,
22100,
1053,
286,
29888,
617,
408,
26354,
29888,
617,
13,
5215,
13149,
13,
5215,
26110,
408,
15886,
13,
13,
29937,
282,
2904,
524,
29901,
11262,
29922,
348,
3880,
29899,
5215,
13,
3166,
26110,
29889,
21570,
29889,
4468,
29889,
4691,
29889,
3554,
1053,
10348,
29918,
3554,
408,
17737,
29918,
18494,
13,
29937,
282,
2904,
524,
29901,
9025,
29922,
348,
3880,
29899,
5215,
13,
13,
18823,
10749,
353,
6213,
13,
13,
13,
1753,
2254,
29918,
4262,
29898,
9507,
1125,
13,
29871,
9995,
2525,
6774,
2879,
3983,
515,
934,
408,
2322,
3983,
1213,
15945,
13,
29871,
411,
15886,
29889,
29887,
1445,
29889,
29943,
579,
29954,
2283,
29898,
9507,
29892,
525,
6050,
1495,
408,
285,
29901,
13,
1678,
3983,
29918,
1753,
353,
15886,
29889,
9527,
3206,
580,
13,
1678,
3983,
29918,
1753,
29889,
12914,
4591,
1231,
29898,
29888,
29889,
949,
3101,
13,
1678,
15886,
29889,
5215,
29918,
4262,
29918,
1753,
29898,
4262,
29918,
1753,
29892,
1024,
2433,
1495,
13,
13,
13,
1753,
2254,
29918,
21134,
29898,
9507,
1125,
13,
29871,
9995,
6359,
297,
11073,
29892,
697,
3858,
639,
1196,
1213,
15945,
13,
29871,
736,
518,
1220,
29889,
29878,
17010,
580,
363,
1196,
297,
15886,
29889,
29887,
1445,
29889,
29954,
2283,
29898,
9507,
4638,
13,
13,
13,
1753,
1065,
29918,
4262,
29898,
29893,
485,
29918,
1272,
29892,
11073,
29892,
1881,
29918,
13148,
29918,
978,
29892,
1962,
29918,
13148,
29918,
978,
29892,
13,
795,
2302,
29918,
3332,
29918,
27711,
1080,
1125,
13,
29871,
9995,
6558,
29879,
278,
10348,
848,
1549,
278,
3983,
322,
14677,
27303,
1213,
15945,
13,
29871,
411,
15886,
29889,
7317,
580,
408,
27937,
29901,
13,
1678,
396,
5169,
287,
278,
10348,
848,
408,
1881,
304,
278,
3983,
29889,
13,
1678,
396,
259,
27303,
29871,
674,
1712,
263,
1023,
29899,
12531,
1409,
29892,
988,
697,
13,
1678,
396,
259,
9927,
11524,
278,
1881,
1967,
2302,
29892,
322,
278,
916,
756,
13,
1678,
396,
259,
27303,
639,
770,
13,
1678,
4964,
3317,
29918,
20158,
353,
27937,
29889,
4262,
29889,
657,
29918,
20158,
29918,
1609,
29918,
978,
29898,
4905,
29918,
13148,
29918,
978,
29897,
13,
1678,
27303,
29892,
353,
27937,
29889,
3389,
29898,
2695,
3317,
29918,
20158,
29892,
426,
2080,
29918,
13148,
29918,
978,
29901,
281,
485,
29918,
1272,
1800,
13,
13,
1678,
396,
20025,
304,
1510,
11073,
297,
1797,
310,
16420,
13,
1678,
2246,
29918,
29895,
353,
27303,
29889,
5085,
441,
580,
14352,
2798,
29918,
3332,
29918,
27711,
1080,
29901,
3816,
1057,
29899,
29896,
29962,
13,
1678,
396,
363,
2943,
29918,
333,
297,
2246,
29918,
29895,
29901,
13,
1678,
396,
259,
5199,
29918,
1807,
353,
11073,
29961,
3177,
29918,
333,
29962,
13,
1678,
396,
259,
8158,
353,
27303,
29961,
3177,
29918,
333,
29962,
13,
1678,
396,
259,
1596,
877,
29995,
29879,
313,
13628,
353,
18695,
29945,
29888,
16029,
1273,
313,
26029,
29918,
1807,
29892,
8158,
876,
13,
13,
1678,
396,
29871,
31557,
30982,
234,
152,
156,
30748,
30959,
30878,
30528,
30210,
31062,
234,
176,
193,
13,
1678,
736,
11073,
29961,
524,
29898,
3332,
29918,
29895,
7503,
29896,
2314,
29962,
13,
13,
13,
1753,
3858,
29918,
29893,
485,
29898,
3972,
29918,
2084,
29892,
11073,
29892,
3983,
29892,
1881,
29918,
978,
29892,
1962,
29918,
978,
29892,
920,
29918,
13011,
29918,
21134,
1125,
13,
29871,
9995,
5896,
29879,
278,
1904,
322,
11073,
29892,
322,
6057,
278,
27262,
304,
1596,
27303,
1213,
15945,
13,
29871,
396,
281,
485,
934,
13,
29871,
565,
451,
4516,
29918,
2084,
470,
451,
15886,
29889,
29887,
1445,
29889,
24217,
29898,
3972,
29918,
2084,
1125,
13,
1678,
396,
15886,
29889,
21027,
29889,
29888,
2075,
877,
17111,
934,
947,
451,
1863,
1273,
29879,
742,
281,
485,
29897,
13,
1678,
15886,
29889,
21027,
29889,
29888,
2075,
877,
17111,
934,
2224,
947,
451,
1863,
1273,
29879,
742,
4516,
29918,
2084,
29897,
13,
13,
29871,
396,
3858,
934,
13,
29871,
565,
451,
11073,
470,
451,
15886,
29889,
29887,
1445,
29889,
24217,
29898,
21134,
1125,
13,
1678,
15886,
29889,
21027,
29889,
29888,
2075,
877,
4775,
29879,
934,
947,
451,
1863,
1273,
29879,
742,
11073,
29897,
13,
13,
29871,
396,
1904,
934,
13,
29871,
565,
451,
3983,
470,
451,
15886,
29889,
29887,
1445,
29889,
24217,
29898,
4262,
1125,
13,
1678,
15886,
29889,
21027,
29889,
29888,
2075,
877,
9527,
934,
947,
451,
1863,
1273,
29879,
742,
3983,
29897,
13,
13,
29871,
11073,
29918,
1761,
353,
2254,
29918,
21134,
29898,
21134,
29897,
13,
13,
29871,
396,
2254,
3983,
29892,
607,
338,
6087,
297,
278,
2322,
4867,
13,
29871,
2254,
29918,
4262,
29898,
4262,
29897,
13,
13,
29871,
396,
29871,
30667,
30346,
30392,
29893,
485,
29892,
29871,
31264,
30494,
30743,
3972,
29918,
2084,
13,
29871,
396,
29871,
31366,
233,
152,
183,
30210,
30941,
236,
165,
148,
30874,
232,
193,
135,
1051,
13,
29871,
396,
29871,
235,
178,
137,
232,
139,
174,
31745,
235,
178,
178,
30210,
31819,
30346,
233,
131,
190,
30354,
891,
29871,
30505,
1228,
30594,
30214,
235,
178,
137,
232,
139,
174,
30573,
29916,
17697,
29878,
30210,
30354,
31180,
891,
29871,
30505,
1228,
30594,
30214,
235,
178,
137,
232,
139,
174,
30573,
1240,
2350,
2251,
29878,
30210,
30354,
31180,
13,
29871,
2302,
29892,
2302,
29896,
29892,
2302,
29906,
353,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
13,
29871,
281,
485,
29918,
24772,
353,
13149,
29889,
23705,
29898,
359,
29889,
2084,
29889,
7122,
29898,
3972,
29918,
2084,
29892,
376,
10521,
29893,
485,
5783,
13,
29871,
396,
29871,
30333,
30631,
232,
167,
188,
30658,
30928,
30502,
30578,
31763,
13,
29871,
4516,
29918,
978,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
3972,
29918,
2084,
29897,
7503,
29946,
29962,
13,
29871,
363,
281,
485,
297,
281,
485,
29918,
24772,
29901,
13,
1678,
396,
281,
485,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
29898,
29893,
485,
29918,
24772,
29961,
29875,
11724,
851,
29898,
29875,
29897,
718,
11393,
29893,
485,
1159,
13,
1678,
396,
2897,
29889,
1267,
420,
29898,
29893,
485,
29918,
24772,
29961,
29875,
1402,
281,
485,
29897,
29871,
396,
19508,
13,
13,
1678,
396,
29871,
31024,
30683,
29885,
29888,
617,
13,
1678,
396,
343,
29892,
21935,
353,
4303,
1883,
29874,
29889,
1359,
29898,
29893,
485,
29897,
13,
1678,
396,
286,
29888,
617,
353,
4303,
1883,
29874,
29889,
14394,
29889,
29885,
29888,
617,
29898,
29891,
29892,
27236,
29892,
302,
29918,
29885,
29888,
617,
29922,
29896,
29941,
29897,
13,
1678,
396,
1596,
703,
8875,
29871,
30210,
29885,
29888,
617,
29871,
30573,
30383,
1642,
4830,
29898,
359,
29889,
2084,
29889,
6500,
3871,
29898,
29893,
485,
4961,
13,
1678,
396,
411,
1722,
11974,
5184,
29914,
19982,
29882,
706,
29875,
29914,
17600,
29914,
29885,
29888,
617,
29889,
3945,
613,
376,
29893,
1159,
408,
285,
29901,
13,
1678,
396,
268,
285,
29889,
3539,
29898,
710,
29898,
29885,
29888,
617,
876,
13,
13,
1678,
411,
1722,
29898,
29893,
485,
29892,
525,
6050,
1495,
408,
281,
485,
29918,
1445,
29901,
13,
418,
281,
485,
29918,
1272,
353,
281,
485,
29918,
1445,
29889,
949,
580,
13,
13,
1678,
3858,
353,
1065,
29918,
4262,
29898,
29893,
485,
29918,
1272,
29892,
11073,
29918,
1761,
29892,
1881,
29918,
978,
29892,
1962,
29918,
978,
29892,
920,
29918,
13011,
29918,
21134,
29897,
13,
13,
1678,
396,
1596,
29898,
359,
29889,
2084,
29889,
5451,
29898,
359,
29889,
2084,
29889,
25721,
29898,
29893,
485,
4961,
13,
1678,
396,
29871,
31656,
232,
144,
179,
30744,
30417,
31819,
30346,
30210,
236,
165,
135,
31851,
30689,
31021,
13,
1678,
1596,
877,
8875,
584,
6571,
4286,
4830,
29898,
359,
29889,
2084,
29889,
6500,
3871,
29898,
29893,
485,
511,
3858,
876,
13,
13,
1678,
396,
29871,
31393,
30763,
30333,
30631,
232,
167,
188,
30548,
30578,
30805,
30748,
232,
139,
174,
29916,
17697,
29878,
320,
302,
29882,
29916,
29878,
320,
916,
13,
1678,
565,
4516,
29918,
978,
7503,
29946,
29962,
1275,
376,
10323,
1115,
13,
418,
2302,
29896,
353,
2302,
29896,
718,
29871,
29896,
565,
3858,
1275,
376,
29916,
17697,
29878,
29908,
1683,
2302,
29896,
13,
418,
2302,
29906,
353,
2302,
29906,
718,
29871,
29896,
565,
3858,
1275,
376,
1240,
2350,
2251,
29878,
29908,
1683,
2302,
29906,
13,
418,
1596,
877,
8875,
584,
6571,
4286,
4830,
29898,
359,
29889,
2084,
29889,
6500,
3871,
29898,
29893,
485,
511,
3858,
876,
13,
1678,
25342,
4516,
29918,
978,
7503,
29946,
29962,
1275,
376,
29916,
17697,
29878,
1115,
13,
418,
565,
3858,
2804,
376,
29916,
17697,
29878,
1115,
13,
4706,
2302,
4619,
29871,
29896,
13,
4706,
1596,
877,
8875,
584,
6571,
4286,
4830,
29898,
359,
29889,
2084,
29889,
6500,
3871,
29898,
29893,
485,
511,
3858,
876,
13,
1678,
25342,
4516,
29918,
978,
7503,
29946,
29962,
1275,
376,
1240,
2350,
1115,
13,
418,
565,
3858,
2804,
376,
1240,
2350,
2251,
29878,
1115,
13,
4706,
2302,
4619,
29871,
29896,
13,
4706,
1596,
877,
8875,
584,
6571,
4286,
4830,
29898,
359,
29889,
2084,
29889,
6500,
3871,
29898,
29893,
485,
511,
3858,
876,
13,
29871,
565,
4516,
29918,
978,
7503,
29946,
29962,
1275,
376,
10323,
1115,
13,
1678,
2302,
353,
2302,
29896,
718,
2302,
29906,
13,
1678,
1596,
703,
233,
131,
190,
31611,
30417,
8875,
30502,
31819,
30346,
29892,
29871,
235,
178,
137,
232,
139,
174,
31745,
235,
178,
178,
30210,
30417,
8875,
31217,
31819,
30346,
1642,
4830,
29898,
2435,
29898,
29893,
485,
29918,
24772,
511,
2302,
876,
13,
1678,
1596,
703,
235,
178,
137,
232,
139,
174,
30573,
29916,
17697,
29878,
30383,
29912,
1118,
29871,
235,
178,
137,
232,
139,
174,
30573,
1240,
2350,
2251,
29878,
30383,
8875,
1642,
4830,
29898,
2798,
29896,
29892,
2302,
29906,
876,
13,
29871,
1683,
29901,
13,
1678,
1596,
703,
233,
131,
190,
31611,
30417,
8875,
30502,
31819,
30346,
29892,
29871,
235,
178,
137,
232,
139,
174,
31745,
235,
178,
178,
30210,
30417,
8875,
31217,
31819,
30346,
1642,
4830,
29898,
2435,
29898,
29893,
485,
29918,
24772,
511,
2302,
876,
13,
29871,
1596,
703,
232,
138,
137,
31835,
234,
145,
138,
30573,
30383,
8875,
1642,
4830,
29898,
29896,
448,
2302,
847,
7431,
29898,
29893,
485,
29918,
24772,
4961,
13,
13,
1753,
1667,
7373,
1125,
13,
29871,
9995,
9634,
1298,
363,
2471,
29892,
29436,
13449,
304,
6273,
1213,
15945,
13,
29871,
3858,
29918,
29893,
485,
29898,
18823,
10749,
29889,
3972,
29918,
2084,
29892,
383,
4375,
10749,
29889,
21134,
29892,
383,
4375,
10749,
29889,
4262,
29892,
383,
4375,
10749,
29889,
2080,
29918,
978,
29892,
13,
9651,
383,
4375,
10749,
29889,
4905,
29918,
978,
29892,
383,
4375,
10749,
29889,
3525,
29918,
13011,
29918,
21134,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
29871,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
29871,
396,
13812,
29889,
1202,
29918,
23516,
29898,
13,
29871,
396,
268,
525,
489,
29893,
485,
742,
1134,
29922,
710,
29892,
2322,
2433,
742,
1371,
2433,
17111,
934,
304,
367,
15659,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
29898,
13,
418,
525,
489,
3972,
29918,
2084,
742,
1134,
29922,
710,
29892,
2322,
2433,
6995,
2997,
29918,
1272,
29914,
1688,
29918,
29893,
485,
29914,
29906,
29918,
13203,
29914,
1228,
742,
13,
418,
1371,
2433,
29956,
485,
2066,
2224,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
29898,
13,
418,
525,
489,
4262,
742,
1134,
29922,
710,
29892,
2322,
2433,
742,
1371,
2433,
3195,
304,
671,
363,
29769,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
29898,
13,
418,
525,
489,
21134,
742,
1134,
29922,
710,
29892,
2322,
2433,
742,
1371,
2433,
2605,
304,
934,
6943,
11073,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
29898,
13,
418,
525,
489,
2080,
29918,
978,
742,
13,
418,
1134,
29922,
710,
29892,
13,
418,
2322,
2433,
29893,
485,
29918,
1272,
29901,
29900,
742,
13,
418,
1371,
2433,
1170,
310,
399,
7520,
29923,
848,
1881,
2943,
297,
1904,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
29898,
13,
418,
525,
489,
4905,
29918,
978,
742,
13,
418,
1134,
29922,
710,
29892,
13,
418,
2322,
2433,
21134,
29918,
2695,
3317,
29901,
29900,
742,
13,
418,
1371,
2433,
1170,
310,
2943,
1962,
1259,
263,
18988,
297,
278,
1904,
29889,
1495,
13,
29871,
13812,
29889,
1202,
29918,
23516,
29898,
13,
418,
525,
489,
3525,
29918,
13011,
29918,
21134,
742,
13,
418,
1134,
29922,
524,
29892,
13,
418,
2322,
29922,
29941,
29892,
13,
418,
1371,
2433,
2798,
495,
310,
2582,
304,
1510,
29889,
1495,
13,
13,
29871,
383,
4375,
10749,
29892,
443,
862,
8485,
353,
13812,
29889,
5510,
29918,
5203,
29918,
5085,
580,
13,
29871,
15886,
29889,
932,
29889,
3389,
29898,
3396,
29922,
3396,
29892,
1852,
29894,
11759,
9675,
29889,
19218,
29961,
29900,
5262,
718,
443,
862,
8485,
29897,
13,
2
] |
custom_tools/encoder/sub_encoder.py | danf42/vulnserver | 0 | 1612782 | import argparse
import binascii
import sys
import os
"""
For the type of encoder we are going to use, this is a list of characters that
will conflict with the bad character list
first, check if there are no bad char conflicts - AND eAX, SUB r8, SUB eAX, XOR r/m16/32, XOR r8, XOR eAX,
DEC eDX , DEC eBP, DEC eSI
PUSH eAX, PUSH eBP, POP eSP
"""
NOBADCHARS = "\x25\x2a\x2d\x31\x32\x35\x4a\x4d\x4e\x50\x55\x5c"
# Instruction dictionary
ASM_DICT = {
'NOP':"\x90",
'AND':{
'EAX':"\x25"
},
'SUB':{
'EAX':"\x2D"
},
'PUSH':{
'EBP':"\x55",
'ESP':"\x54",
'EAX':"\x50",
'EBX':"\x53",
'ECX':"\x51",
'EDX':"\x52",
'EDI':"\x57",
'ESI':"\x56"
},
'POP':{
'ESP':"\x5C",
'EAX':"\x58"
}
}
def find_opposit_bytes(char_list):
'''
Given a list of characters, find opposit bytes that
when AND'd together equal 0
return two values in hex
'''
is_found = False
ord1 = None
ord2 = None
for val1 in char_list:
for val2 in char_list:
ord1 = '{:02x}'.format(ord(val1)) * 4
ord2 = '{:02x}'.format(ord(val2)) * 4
int1 = hex_str_to_int(ord1)
int2 = hex_str_to_int(ord2)
if int1 & int2 == 0:
print("[+] Opposite Values Founds: {} & {}".format(ord1, ord2))
is_found = True
break
if is_found:
break
if not is_found:
print("[-] Failed to find opposite values")
return (ord1, ord2)
def prepare_shellcode(pShelcode):
'''
Align shellcode and split into 4 byte chunks
'''
rem = len(pShelcode) % 4
if rem != 0:
nop_sled = [ASM_DICT['NOP']] * (4-rem)
pShelcode = pShelcode + nop_sled
# Verify that we are aligned now
if (len(pShelcode) % 4) == 0:
print("[+] Added {} nops to alight shellcode to 4 bytes".format(len(nop_sled)))
else:
print("[-] Shellcode is not 4 byte aligned, can't continue.")
return None
# get hex value from shellcode
hex_str = bin2hex(pShelcode)
chunks = hex2array(hex_str, size=8)
reversed_chunks = chunks[::-1]
print("[+] Number of chunks: {}".format(len(chunks)))
print("[+] Chunks: {}".format(chunks))
print("[+] Reversed Chunks: {}".format(chunks))
return reversed_chunks
def process_inputfile(input_file):
'''
Read in the input file and convert contents to Hex string list
'''
with open(input_file, 'r') as fd:
contents = fd.readline().strip()
# convert character string to a list
contents = contents.replace("\\x", "")
contents = contents.replace("\"", "")
contents = contents.replace("\'", "")
hex_str = [binascii.a2b_hex(i + j) for i, j in zip(str(contents[0::2]), str(contents[1::2]))]
return hex_str
def bin2hex(bin_bytes):
'''
Converts hex string to a string of space separated hex bytes
'''
hex_str = ''.join('%02x' % ord(c) for c in bin_bytes)
return hex_str
def hex2array(hex_str, size=2):
'''
Convert a string of hex bytes into an array of size chunks
Default is 2 (1 byte)
'''
hex_array = [hex_str[i:i+size] for i in range(0, len(hex_str),size)]
return hex_array
def hex2bin(pattern):
"""
Converts a hex string (\\x??\\x??\\x??\\x??) to real hex bytes
Arguments:
pattern - A string representing the bytes to convert
Return:
the bytes
"""
pattern = pattern.replace("\\x", "")
pattern = pattern.replace("\"", "")
pattern = pattern.replace("\'", "")
hex_str = [binascii.a2b_hex(i + j) for i, j in zip(str(pattern[0::2]), str(pattern[1::2]))]
return hex_str
def hex_str_to_int(input_str):
"""
Converts a string with hex bytes to a numeric value
"""
try:
val_to_return = int(input_str, 16)
except Exception as e:
val_to_return = 0
print('Exception converting hex to int: {}'.format(e))
return val_to_return
def to_hex(input_int):
'''
Convert integer value to hex
'''
return '{:08x}'.format(input_int)
def tohex(val, nbits=32):
'''
Convert an integer value to hex
use nbits to compute twos complement value
'''
#return hex((val + (1 << nbits)) % (1 << nbits))
intval = ((val + (1 << nbits)) % (1 << nbits))
return '{:08x}'.format(intval)
def validatebadchars_enc(val1, val2, val3, badchars):
newvals = []
allok = 0
giveup = 0
type = 0
origval1 = val1
origval2 = val2
origval3 = val3
d1 = 0
#d2 = 0
d3 = 0
#lastd1 = 0
#lastd2 = 0
lastd3 = 0
while allok == 0 and giveup == 0:
# check if there are bad chars left
charcnt = 0
val1ok = 1
val2ok = 1
val3ok = 1
while charcnt < len(badchars):
if (("{:02x}".format(int(val1)))in badchars):
val1ok = 0
if (("{:02x}".format(int(val2))) in badchars):
val2ok = 0
if (("{:02x}".format(int(val3))) in badchars):
val3ok = 0
charcnt = charcnt + 1
if (val1ok == 0) or (val2ok == 0) or (val3ok == 0):
allok = 0
else:
allok = 1
if allok == 0:
# try first by sub 1 from val1 and val2, and add more to val3
if type == 0:
val1 = val1 - 1
val2 = val2 - 1
val3 = val3 + 2
if (val1 < 1) or (val2 == 0) or (val3 > 126):
val1 = origval1
val2 = origval2
val3 = origval3
type = 1
if type == 1:
# then try by add 1 to val1 and val2, and sub more from val3
val1 = val1 + 1
val2 = val2 + 1
val3 = val3 - 2
if (val1 > 126) or (val2 > 126) or (val3 < 1):
val1 = origval1
val2 = origval2
val3 = origval3
type = 2
if type == 2:
# try by sub 2 from val1, and add 1 to val2 and val3
val1 = val1 - 2
val2 = val2 + 1
val3 = val3 + 1
if (val1 < 1) or (val2 > 126) or (val3 > 126):
val1 = origval1
val2 = origval2
val3 = origval3
type = 3
if type == 3:
# try by add 2 to val1, and sub 1 from val2 and val3
val1 = val1 + 2
val2 = val2 - 1
val3 = val3 - 1
if (val1 > 126) or (val2 < 1) or (val3 < 1):
val1 = origval1
val2 = origval2
val3 = origval3
type = 4
if type == 4:
if (val1ok == 0):
val1 = val1 - 1
d1 = d1 + 1
else:
# now spread delta over other 2 values
if (d1 > 0):
val2 = val2 + 1
val3 = origval3 + d1 - 1
d1 = d1 - 1
else:
val1 = 0
if (val1 < 1) or (val2 > 126) or (val3 > 126):
val1 = origval1
val2 = origval2
val3 = origval3
d1 = 0
type = 5
if type == 5:
if (val1ok == 0):
val1 = val1 + 1
d1 = d1 + 1
else:
# now spread delta over other 2 values
if (d1 > 0):
val2 = val2 - 1
val3 = origval3 - d1 + 1
d1 = d1 - 1
else:
val1 = 255
if (val1 > 126) or (val2 < 1) or (val3 < 1):
val1 = origval1
val2 = origval2
val3 = origval3
val1ok = 0
val2ok = 0
val3ok = 0
d1 = 0
d2 = 0
d3 = 0
type = 6
if type == 6:
if (val1ok == 0):
val1 = val1 - 1
# d1=d1+1
if (val2ok == 0):
val2 = val2 + 1
# d2=d2+1
d3 = origval1 - val1 + origval2 - val2
val3 = origval3 + d3
if (lastd3 == d3) and (d3 > 0):
val1 = origval1
val2 = origval2
val3 = origval3
giveup = 1
else:
lastd3 = d3
if (val1 < 1) or (val2 < 1) or (val3 > 126):
val1 = origval1
val2 = origval2
val3 = origval3
giveup = 1
# check results
charcnt = 0
val1ok = 1
val2ok = 1
val3ok = 1
val1text = "OK"
val2text = "OK"
val3text = "OK"
while charcnt < len(badchars):
if (val1 == badchars[charcnt]):
val1ok = 0
val1text = "NOK"
if (val2 == badchars[charcnt]):
val2ok = 0
val2text = "NOK"
if (val3 == badchars[charcnt]):
val3ok = 0
val3text = "NOK"
charcnt = charcnt + 1
if (val1ok == 0) or (val2ok == 0) or (val3ok == 0):
print(" ** Unable to fix bad char issue !")
print(" -> Values to check : %s(%s) %s(%s) %s(%s) " % (
bin2hex(origval1), val1text, bin2hex(origval2), val2text, bin2hex(origval3), val3text))
val1 = origval1
val2 = origval2
val3 = origval3
newvals.append(val1)
newvals.append(val2)
newvals.append(val3)
return newvals
def sub_3(shellcode, goodchars=[], badchars=[]):
# convert nobadchar str to an array
nobadchars = hex2array(bin2hex(NOBADCHARS))
if badchars:
badchar_found = False
for b in badchars:
if b in nobadchars:
print("[-] Error: Byte {} cannot be a bad char with this encoder".format(b))
badchar_found = True
break
if badchar_found:
return None
# Determine how to AND EAX together to get 0
eax_and_val1 = '554E4D4A'
eax_and_val2 = '2A313235'
if goodchars:
eax_and_val1, eax_and_val2 = find_opposit_bytes(goodchars)
# Prepare shellcode
reversed_payload = prepare_shellcode(shellcode)
encodedline = 0
encodedbytes = {}
num_chunks = len(reversed_payload)
blockcnt = num_chunks
total_length = 0
for chunk in reversed_payload:
print("Processing chunk {} of {}".format(blockcnt, num_chunks))
# reverse the value so that LSB is first
reverse_chunk = "".join(reversed([chunk[i:i+2] for i in range(0, len(chunk), 2)]))
# convert hex to int
revval = hex_str_to_int(reverse_chunk)
# Get two's complement
# hex(4294967296) == 0x100000000
twoval = 4294967296 - revval
# convert two's complement back to hex
twobytes = tohex(twoval)
print("[+]\tOpcode to Produce: {}".format(chunk))
print("[+]\tReversed Opcode: {}".format(reverse_chunk))
print("[+]\tTwos complement: {}\n".format(twobytes))
# for each byte, start with the last one first
bcnt = 3
overflow = 0
opcodes = []
while bcnt >= 0:
# This is getting the last byte from the chunk
curbyte = twobytes[(bcnt * 2)] + twobytes[(bcnt * 2) + 1]
# convert hex value to int
curval = hex_str_to_int(curbyte) - overflow
testval = curval/3
# handle overflow
if testval < 32:
curbyte = "1" + curbyte
curval = hex_str_to_int(curbyte) - overflow
overflow = 1
else:
overflow = 0
val1 = int(curval / 3)
val2 = int(curval / 3)
val3 = int(curval / 3)
sumval = val1 + val2 + val3
if sumval < curval:
val3 = val3 + (curval - sumval)
# verify bad characters
fixvals = validatebadchars_enc(val1, val2, val3, badchars)
val1 = "%02x" % (int(fixvals[0]))
val2 = "%02x" % (int(fixvals[1]))
val3 = "%02x" % (int(fixvals[2]))
opcodes.append(val1)
opcodes.append(val2)
opcodes.append(val3)
bcnt = bcnt - 1
# Create shellcode
thisencodedbyte = bin2hex(ASM_DICT['AND']['EAX'])
thisencodedbyte += eax_and_val1
# Store shellcode plus Assembly instructions
encodedbytes[encodedline] = [thisencodedbyte, 'AND EAX, 0x{}'.format(eax_and_val1)]
encodedline += 1
total_length += len(thisencodedbyte)
# Create shellcode
thisencodedbyte = bin2hex(ASM_DICT['AND']['EAX'])
thisencodedbyte += eax_and_val2
# Store shellcode plus Assembly instructions
encodedbytes[encodedline] = [thisencodedbyte, 'AND EAX, 0x{}'.format(eax_and_val2)]
encodedline += 1
total_length += len(thisencodedbyte)
# Create shellcode -- Sub Insruction 1
thisencodedbyte = bin2hex(ASM_DICT['SUB']['EAX'])
thisencodedbyte += '{}{}{}{}'.format(opcodes[0], opcodes[3], opcodes[6], opcodes[9])
# Store shellcode plus Assembly instructions -- Sub Insruction 1
encodedbytes[encodedline] = [thisencodedbyte, "SUB EAX, 0x{}{}{}{}".format(opcodes[9], opcodes[6], opcodes[3], opcodes[0])]
encodedline += 1
total_length += len(thisencodedbyte)
# Create shellcode -- Sub Insruction 2
thisencodedbyte = bin2hex(ASM_DICT['SUB']['EAX'])
thisencodedbyte += '{}{}{}{}'.format(opcodes[1], opcodes[4], opcodes[7], opcodes[10])
# Store shellcode plus Assembly instructions -- Sub Insruction 2
encodedbytes[encodedline] = [thisencodedbyte, "SUB EAX, 0x{}{}{}{}".format(opcodes[10], opcodes[7], opcodes[4], opcodes[1])]
encodedline += 1
total_length += len(thisencodedbyte)
# Create shellcode -- Sub Insruction 3
thisencodedbyte = bin2hex(ASM_DICT['SUB']['EAX'])
thisencodedbyte += '{}{}{}{}'.format(opcodes[2], opcodes[5], opcodes[8], opcodes[11])
# Store shellcode plus Assembly instructions -- Sub Insruction 3
encodedbytes[encodedline] = [thisencodedbyte, "SUB EAX, 0x{}{}{}{}".format(opcodes[11], opcodes[8], opcodes[5], opcodes[2])]
encodedline += 1
total_length += len(thisencodedbyte)
# Store shellcode plus Assembly instructions
thisencodedbyte = bin2hex(ASM_DICT['PUSH']['EAX'])
encodedbytes[encodedline] = [thisencodedbyte, "PUSH EAX"]
encodedline += 1
total_length += len(thisencodedbyte)
# Decrement block count
blockcnt -= 1
return encodedbytes
# def printEncodedPayload(encodedbytes):
# '''
# Print out the encoded bytes
# '''
# for line in encodedbytes:
# print(encodedbytes[line][0])
def printEncodedPayload(encodedbytes):
'''
Print out the encoded bytes
'''
shellcode_string = ""
print("\n\n ======== Results ========")
for line in encodedbytes:
shellcode = "\\x" + '\\x'.join(hex2array(encodedbytes[line][0]))
shellcode_string += shellcode
assembly = encodedbytes[line][1]
print("{} : {}".format(shellcode, assembly))
print("\n\n ======== Assembly Code ========")
for line in encodedbytes:
print(encodedbytes[line][1])
print("\n\n ======== Shellcode ========")
for line in encodedbytes:
print("\\x" + '\\x'.join(hex2array(encodedbytes[line][0])))
print("\n\n ======== Shellcode String ========")
print("Encoded Shellcode Length: {}".format(len(hex2bin(shellcode_string))))
print(shellcode_string)
def main():
parser = argparse.ArgumentParser(description="Encode payload using sub instructions")
parser.add_argument("-p", "--payload",
help="File containg payload to encode containing hex string (eg. \\x41\\x42)",
required=True)
parser.add_argument("-b", "--bad_characters",
help="File containing bad characters to ignore in hex string (eg. \\x00\\x0A)",
required=True)
parser.add_argument("-g", "--good_characters",
help="File containing good characters in hex string (eg. \\x00\\x0A)",
required=True)
args = parser.parse_args()
# Read in good character list
goodchars_list = []
if args.good_characters:
goodchars_list = process_inputfile(args.good_characters)
print("[+] Number of good characters: {}".format(len(goodchars_list)))
# Process bad characters
badchars_list = []
if args.bad_characters:
badchars_list = process_inputfile(args.bad_characters)
print("[+] Number of bad characters: {}".format(len(badchars_list)))
if args.payload:
payload = process_inputfile(args.payload)
encoded_bytes = sub_3(payload, goodchars=goodchars_list, badchars=badchars_list)
printEncodedPayload(encoded_bytes)
else:
print(parser.print_help(sys.stderr))
if __name__ == "__main__":
main()
| [
1,
1053,
1852,
5510,
13,
5215,
9016,
294,
18869,
13,
5215,
10876,
13,
5215,
2897,
13,
13,
15945,
29908,
13,
2831,
278,
1134,
310,
2094,
6119,
591,
526,
2675,
304,
671,
29892,
445,
338,
263,
1051,
310,
4890,
393,
13,
14043,
14529,
411,
278,
4319,
2931,
1051,
13,
13,
4102,
29892,
1423,
565,
727,
526,
694,
4319,
1373,
28792,
448,
5300,
321,
6604,
29892,
27092,
364,
29947,
29892,
27092,
321,
6604,
29892,
1060,
1955,
364,
29914,
29885,
29896,
29953,
29914,
29941,
29906,
29892,
1060,
1955,
364,
29947,
29892,
1060,
1955,
321,
6604,
29892,
29871,
13,
2287,
29907,
321,
29928,
29990,
1919,
5012,
29907,
321,
29933,
29925,
29892,
5012,
29907,
321,
5425,
13,
29925,
3308,
29950,
321,
6604,
29892,
349,
3308,
29950,
321,
29933,
29925,
29892,
349,
4590,
321,
5550,
13,
15945,
29908,
13,
6632,
29933,
3035,
11282,
29903,
353,
6634,
29916,
29906,
29945,
29905,
29916,
29906,
29874,
29905,
29916,
29906,
29881,
29905,
29916,
29941,
29896,
29905,
29916,
29941,
29906,
29905,
29916,
29941,
29945,
29905,
29916,
29946,
29874,
29905,
29916,
29946,
29881,
29905,
29916,
29946,
29872,
29905,
29916,
29945,
29900,
29905,
29916,
29945,
29945,
29905,
29916,
29945,
29883,
29908,
13,
13,
29937,
2799,
4080,
8600,
13,
3289,
29924,
29918,
4571,
1783,
353,
426,
13,
1678,
525,
29940,
4590,
2396,
26732,
29916,
29929,
29900,
613,
13,
1678,
525,
9468,
2396,
29912,
29871,
13,
4706,
525,
29923,
6604,
2396,
26732,
29916,
29906,
29945,
29908,
29871,
13,
1678,
2981,
13,
1678,
525,
20633,
2396,
29912,
29871,
13,
4706,
525,
29923,
6604,
2396,
26732,
29916,
29906,
29928,
29908,
29871,
13,
1678,
2981,
13,
1678,
525,
29925,
3308,
29950,
2396,
29912,
13,
4706,
525,
25752,
29925,
2396,
26732,
29916,
29945,
29945,
613,
13,
4706,
525,
2890,
29925,
2396,
26732,
29916,
29945,
29946,
613,
13,
4706,
525,
29923,
6604,
2396,
26732,
29916,
29945,
29900,
613,
13,
4706,
525,
25752,
29990,
2396,
26732,
29916,
29945,
29941,
613,
13,
4706,
525,
11206,
29990,
2396,
26732,
29916,
29945,
29896,
613,
13,
4706,
525,
3352,
29990,
2396,
26732,
29916,
29945,
29906,
613,
13,
4706,
525,
3352,
29902,
2396,
26732,
29916,
29945,
29955,
613,
13,
4706,
525,
2890,
29902,
2396,
26732,
29916,
29945,
29953,
29908,
13,
1678,
2981,
13,
1678,
525,
29925,
4590,
2396,
29912,
29871,
13,
4706,
525,
2890,
29925,
2396,
26732,
29916,
29945,
29907,
613,
29871,
13,
4706,
525,
29923,
6604,
2396,
26732,
29916,
29945,
29947,
29908,
13,
1678,
500,
13,
29913,
13,
13,
1753,
1284,
29918,
9354,
359,
277,
29918,
13193,
29898,
3090,
29918,
1761,
1125,
13,
1678,
14550,
13,
1678,
11221,
263,
1051,
310,
4890,
29892,
1284,
9209,
277,
6262,
393,
29871,
13,
1678,
746,
5300,
29915,
29881,
4208,
5186,
29871,
29900,
13,
13,
1678,
736,
1023,
1819,
297,
15090,
13,
1678,
14550,
13,
13,
1678,
338,
29918,
11940,
353,
7700,
13,
13,
1678,
4356,
29896,
353,
6213,
13,
1678,
4356,
29906,
353,
6213,
13,
13,
1678,
363,
659,
29896,
297,
1373,
29918,
1761,
29901,
13,
4706,
363,
659,
29906,
297,
1373,
29918,
1761,
29901,
13,
13,
9651,
4356,
29896,
353,
22372,
29901,
29900,
29906,
29916,
29913,
4286,
4830,
29898,
536,
29898,
791,
29896,
876,
334,
29871,
29946,
13,
9651,
4356,
29906,
353,
22372,
29901,
29900,
29906,
29916,
29913,
4286,
4830,
29898,
536,
29898,
791,
29906,
876,
334,
29871,
29946,
13,
13,
9651,
938,
29896,
353,
15090,
29918,
710,
29918,
517,
29918,
524,
29898,
536,
29896,
29897,
13,
9651,
938,
29906,
353,
15090,
29918,
710,
29918,
517,
29918,
524,
29898,
536,
29906,
29897,
13,
13,
9651,
565,
938,
29896,
669,
938,
29906,
1275,
29871,
29900,
29901,
13,
18884,
1596,
703,
29961,
29974,
29962,
438,
407,
359,
568,
2630,
1041,
383,
3885,
29901,
6571,
669,
6571,
1642,
4830,
29898,
536,
29896,
29892,
4356,
29906,
876,
13,
18884,
338,
29918,
11940,
353,
5852,
13,
18884,
2867,
13,
13,
4706,
565,
338,
29918,
11940,
29901,
13,
9651,
2867,
13,
13,
1678,
565,
451,
338,
29918,
11940,
29901,
13,
4706,
1596,
703,
14352,
29962,
18390,
304,
1284,
11564,
1819,
1159,
13,
268,
13,
1678,
736,
313,
536,
29896,
29892,
4356,
29906,
29897,
13,
13,
1753,
19012,
29918,
15903,
401,
29898,
29886,
2713,
295,
401,
1125,
13,
1678,
14550,
13,
1678,
838,
647,
6473,
401,
322,
6219,
964,
29871,
29946,
7023,
521,
18801,
13,
1678,
14550,
13,
13,
1678,
1083,
353,
7431,
29898,
29886,
2713,
295,
401,
29897,
1273,
29871,
29946,
13,
13,
1678,
565,
1083,
2804,
29871,
29900,
29901,
13,
4706,
302,
459,
29918,
29879,
839,
353,
518,
3289,
29924,
29918,
4571,
1783,
1839,
29940,
4590,
2033,
29962,
334,
313,
29946,
29899,
1745,
29897,
13,
4706,
282,
2713,
295,
401,
353,
282,
2713,
295,
401,
718,
302,
459,
29918,
29879,
839,
13,
13,
4706,
396,
1798,
1598,
393,
591,
526,
26118,
1286,
13,
4706,
565,
313,
2435,
29898,
29886,
2713,
295,
401,
29897,
1273,
29871,
29946,
29897,
1275,
29871,
29900,
29901,
13,
9651,
1596,
703,
29961,
29974,
29962,
25601,
6571,
302,
3554,
304,
394,
523,
6473,
401,
304,
29871,
29946,
6262,
1642,
4830,
29898,
2435,
29898,
29876,
459,
29918,
29879,
839,
4961,
13,
308,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
14352,
29962,
1383,
514,
401,
338,
451,
29871,
29946,
7023,
26118,
29892,
508,
29915,
29873,
6773,
23157,
13,
9651,
736,
6213,
13,
13,
13,
1678,
396,
679,
15090,
995,
515,
6473,
401,
13,
1678,
15090,
29918,
710,
353,
9016,
29906,
20970,
29898,
29886,
2713,
295,
401,
29897,
13,
13,
1678,
521,
18801,
353,
15090,
29906,
2378,
29898,
20970,
29918,
710,
29892,
2159,
29922,
29947,
29897,
13,
1678,
18764,
287,
29918,
305,
18801,
353,
521,
18801,
29961,
1057,
29899,
29896,
29962,
13,
13,
1678,
1596,
703,
29961,
29974,
29962,
9681,
310,
521,
18801,
29901,
6571,
1642,
4830,
29898,
2435,
29898,
305,
18801,
4961,
13,
1678,
1596,
703,
29961,
29974,
29962,
678,
18801,
29901,
965,
6571,
1642,
4830,
29898,
305,
18801,
876,
13,
1678,
1596,
703,
29961,
29974,
29962,
830,
874,
287,
678,
18801,
29901,
29871,
6571,
1642,
4830,
29898,
305,
18801,
876,
13,
13,
1678,
736,
18764,
287,
29918,
305,
18801,
13,
13,
1753,
1889,
29918,
2080,
1445,
29898,
2080,
29918,
1445,
1125,
13,
1678,
14550,
13,
1678,
7523,
297,
278,
1881,
934,
322,
3588,
8118,
304,
379,
735,
1347,
1051,
13,
1678,
14550,
13,
13,
1678,
411,
1722,
29898,
2080,
29918,
1445,
29892,
525,
29878,
1495,
408,
285,
29881,
29901,
13,
4706,
8118,
353,
285,
29881,
29889,
949,
1220,
2141,
17010,
580,
13,
13,
1678,
396,
3588,
2931,
1347,
304,
263,
1051,
13,
1678,
8118,
353,
8118,
29889,
6506,
703,
1966,
29916,
613,
20569,
13,
1678,
8118,
353,
8118,
29889,
6506,
703,
5931,
613,
20569,
13,
1678,
8118,
353,
8118,
29889,
6506,
14182,
29915,
613,
20569,
13,
13,
1678,
15090,
29918,
710,
353,
518,
2109,
294,
18869,
29889,
29874,
29906,
29890,
29918,
20970,
29898,
29875,
718,
432,
29897,
363,
474,
29892,
432,
297,
14319,
29898,
710,
29898,
10853,
29961,
29900,
1057,
29906,
11724,
851,
29898,
10853,
29961,
29896,
1057,
29906,
12622,
29962,
13,
13,
1678,
736,
15090,
29918,
710,
13,
13,
1753,
9016,
29906,
20970,
29898,
2109,
29918,
13193,
1125,
13,
1678,
14550,
29871,
13,
1678,
1281,
369,
1372,
15090,
1347,
304,
263,
1347,
310,
2913,
13055,
15090,
6262,
13,
1678,
14550,
13,
1678,
15090,
29918,
710,
353,
525,
4286,
7122,
877,
29995,
29900,
29906,
29916,
29915,
1273,
4356,
29898,
29883,
29897,
363,
274,
297,
9016,
29918,
13193,
29897,
13,
1678,
736,
15090,
29918,
710,
13,
13,
1753,
15090,
29906,
2378,
29898,
20970,
29918,
710,
29892,
2159,
29922,
29906,
1125,
13,
1678,
14550,
13,
1678,
14806,
263,
1347,
310,
15090,
6262,
964,
385,
1409,
310,
2159,
521,
18801,
13,
1678,
13109,
338,
29871,
29906,
313,
29896,
7023,
29897,
13,
1678,
14550,
13,
1678,
15090,
29918,
2378,
353,
518,
20970,
29918,
710,
29961,
29875,
29901,
29875,
29974,
2311,
29962,
363,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
20970,
29918,
710,
511,
2311,
4638,
29871,
13,
13,
1678,
736,
15090,
29918,
2378,
13,
13,
1753,
15090,
29906,
2109,
29898,
11037,
1125,
13,
1678,
9995,
13,
1678,
1281,
369,
1372,
263,
15090,
1347,
313,
1966,
29916,
8773,
1966,
29916,
8773,
1966,
29916,
8773,
1966,
29916,
29973,
7897,
304,
1855,
15090,
6262,
13,
1678,
11842,
9331,
29901,
13,
1678,
4766,
448,
319,
1347,
15783,
278,
6262,
304,
3588,
13,
1678,
7106,
29901,
13,
1678,
278,
6262,
13,
1678,
9995,
13,
1678,
4766,
353,
4766,
29889,
6506,
703,
1966,
29916,
613,
20569,
13,
1678,
4766,
353,
4766,
29889,
6506,
703,
5931,
613,
20569,
13,
1678,
4766,
353,
4766,
29889,
6506,
14182,
29915,
613,
20569,
13,
13,
1678,
15090,
29918,
710,
353,
518,
2109,
294,
18869,
29889,
29874,
29906,
29890,
29918,
20970,
29898,
29875,
718,
432,
29897,
363,
474,
29892,
432,
297,
14319,
29898,
710,
29898,
11037,
29961,
29900,
1057,
29906,
11724,
851,
29898,
11037,
29961,
29896,
1057,
29906,
12622,
29962,
13,
13,
1678,
736,
15090,
29918,
710,
13,
13,
1753,
15090,
29918,
710,
29918,
517,
29918,
524,
29898,
2080,
29918,
710,
1125,
13,
1678,
9995,
13,
1678,
1281,
369,
1372,
263,
1347,
411,
15090,
6262,
304,
263,
16985,
995,
13,
1678,
9995,
13,
1678,
1018,
29901,
13,
4706,
659,
29918,
517,
29918,
2457,
353,
938,
29898,
2080,
29918,
710,
29892,
29871,
29896,
29953,
29897,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
659,
29918,
517,
29918,
2457,
353,
29871,
29900,
13,
4706,
1596,
877,
2451,
17415,
15090,
304,
938,
29901,
6571,
4286,
4830,
29898,
29872,
876,
13,
1678,
736,
659,
29918,
517,
29918,
2457,
13,
13,
1753,
304,
29918,
20970,
29898,
2080,
29918,
524,
1125,
13,
1678,
14550,
13,
1678,
14806,
6043,
995,
304,
15090,
13,
1678,
14550,
13,
1678,
736,
22372,
29901,
29900,
29947,
29916,
29913,
4286,
4830,
29898,
2080,
29918,
524,
29897,
13,
13,
13,
1753,
304,
20970,
29898,
791,
29892,
302,
14836,
29922,
29941,
29906,
1125,
13,
1678,
14550,
13,
1678,
14806,
385,
6043,
995,
304,
15090,
13,
1678,
671,
302,
14836,
304,
10272,
3252,
359,
19595,
995,
13,
1678,
14550,
13,
1678,
396,
2457,
15090,
3552,
791,
718,
313,
29896,
3532,
302,
14836,
876,
1273,
313,
29896,
3532,
302,
14836,
876,
13,
13,
1678,
938,
791,
353,
5135,
791,
718,
313,
29896,
3532,
302,
14836,
876,
1273,
313,
29896,
3532,
302,
14836,
876,
13,
1678,
736,
22372,
29901,
29900,
29947,
29916,
29913,
4286,
4830,
29898,
524,
791,
29897,
13,
13,
13,
1753,
12725,
12313,
305,
1503,
29918,
3977,
29898,
791,
29896,
29892,
659,
29906,
29892,
659,
29941,
29892,
4319,
305,
1503,
1125,
13,
1678,
716,
791,
29879,
353,
5159,
13,
1678,
25169,
29895,
353,
29871,
29900,
13,
1678,
2367,
786,
353,
29871,
29900,
13,
1678,
1134,
353,
29871,
29900,
13,
1678,
1677,
791,
29896,
353,
659,
29896,
13,
1678,
1677,
791,
29906,
353,
659,
29906,
13,
1678,
1677,
791,
29941,
353,
659,
29941,
13,
1678,
270,
29896,
353,
29871,
29900,
13,
1678,
396,
29881,
29906,
353,
29871,
29900,
13,
1678,
270,
29941,
353,
29871,
29900,
13,
1678,
396,
4230,
29881,
29896,
353,
29871,
29900,
13,
1678,
396,
4230,
29881,
29906,
353,
29871,
29900,
13,
1678,
1833,
29881,
29941,
353,
29871,
29900,
13,
1678,
1550,
25169,
29895,
1275,
29871,
29900,
322,
2367,
786,
1275,
29871,
29900,
29901,
13,
4706,
396,
1423,
565,
727,
526,
4319,
22524,
2175,
13,
4706,
1373,
20047,
353,
29871,
29900,
13,
4706,
659,
29896,
554,
353,
29871,
29896,
13,
4706,
659,
29906,
554,
353,
29871,
29896,
13,
4706,
659,
29941,
554,
353,
29871,
29896,
13,
4706,
1550,
1373,
20047,
529,
7431,
29898,
12313,
305,
1503,
1125,
13,
9651,
565,
313,
703,
25641,
29900,
29906,
29916,
29913,
1642,
4830,
29898,
524,
29898,
791,
29896,
4961,
262,
4319,
305,
1503,
1125,
13,
18884,
659,
29896,
554,
353,
29871,
29900,
13,
9651,
565,
313,
703,
25641,
29900,
29906,
29916,
29913,
1642,
4830,
29898,
524,
29898,
791,
29906,
4961,
297,
4319,
305,
1503,
1125,
13,
18884,
659,
29906,
554,
353,
29871,
29900,
13,
9651,
565,
313,
703,
25641,
29900,
29906,
29916,
29913,
1642,
4830,
29898,
524,
29898,
791,
29941,
4961,
297,
4319,
305,
1503,
1125,
13,
18884,
659,
29941,
554,
353,
29871,
29900,
13,
9651,
1373,
20047,
353,
1373,
20047,
718,
29871,
29896,
13,
4706,
565,
313,
791,
29896,
554,
1275,
29871,
29900,
29897,
470,
313,
791,
29906,
554,
1275,
29871,
29900,
29897,
470,
313,
791,
29941,
554,
1275,
29871,
29900,
1125,
13,
9651,
25169,
29895,
353,
29871,
29900,
13,
4706,
1683,
29901,
13,
9651,
25169,
29895,
353,
29871,
29896,
13,
4706,
565,
25169,
29895,
1275,
29871,
29900,
29901,
13,
9651,
396,
1018,
937,
491,
1014,
29871,
29896,
515,
659,
29896,
322,
659,
29906,
29892,
322,
788,
901,
304,
659,
29941,
13,
9651,
565,
1134,
1275,
29871,
29900,
29901,
13,
18884,
659,
29896,
353,
659,
29896,
448,
29871,
29896,
13,
18884,
659,
29906,
353,
659,
29906,
448,
29871,
29896,
13,
18884,
659,
29941,
353,
659,
29941,
718,
29871,
29906,
13,
18884,
565,
313,
791,
29896,
529,
29871,
29896,
29897,
470,
313,
791,
29906,
1275,
29871,
29900,
29897,
470,
313,
791,
29941,
1405,
29871,
29896,
29906,
29953,
1125,
13,
462,
1678,
659,
29896,
353,
1677,
791,
29896,
13,
462,
1678,
659,
29906,
353,
1677,
791,
29906,
13,
462,
1678,
659,
29941,
353,
1677,
791,
29941,
13,
462,
1678,
1134,
353,
29871,
29896,
13,
9651,
565,
1134,
1275,
29871,
29896,
29901,
13,
18884,
396,
769,
1018,
491,
788,
29871,
29896,
304,
659,
29896,
322,
659,
29906,
29892,
322,
1014,
901,
515,
659,
29941,
13,
18884,
659,
29896,
353,
659,
29896,
718,
29871,
29896,
13,
18884,
659,
29906,
353,
659,
29906,
718,
29871,
29896,
13,
18884,
659,
29941,
353,
659,
29941,
448,
29871,
29906,
13,
18884,
565,
313,
791,
29896,
1405,
29871,
29896,
29906,
29953,
29897,
470,
313,
791,
29906,
1405,
29871,
29896,
29906,
29953,
29897,
470,
313,
791,
29941,
529,
29871,
29896,
1125,
13,
462,
1678,
659,
29896,
353,
1677,
791,
29896,
13,
462,
1678,
659,
29906,
353,
1677,
791,
29906,
13,
462,
1678,
659,
29941,
353,
1677,
791,
29941,
13,
462,
1678,
1134,
353,
29871,
29906,
13,
9651,
565,
1134,
1275,
29871,
29906,
29901,
13,
18884,
396,
1018,
491,
1014,
29871,
29906,
515,
659,
29896,
29892,
322,
788,
29871,
29896,
304,
659,
29906,
322,
659,
29941,
13,
18884,
659,
29896,
353,
659,
29896,
448,
29871,
29906,
13,
18884,
659,
29906,
353,
659,
29906,
718,
29871,
29896,
13,
18884,
659,
29941,
353,
659,
29941,
718,
29871,
29896,
13,
18884,
565,
313,
791,
29896,
529,
29871,
29896,
29897,
470,
313,
791,
29906,
1405,
29871,
29896,
29906,
29953,
29897,
470,
313,
791,
29941,
1405,
29871,
29896,
29906,
29953,
1125,
13,
462,
1678,
659,
29896,
353,
1677,
791,
29896,
13,
462,
1678,
659,
29906,
353,
1677,
791,
29906,
13,
462,
1678,
659,
29941,
353,
1677,
791,
29941,
13,
462,
1678,
1134,
353,
29871,
29941,
13,
9651,
565,
1134,
1275,
29871,
29941,
29901,
13,
18884,
396,
1018,
491,
788,
29871,
29906,
304,
659,
29896,
29892,
322,
1014,
29871,
29896,
515,
659,
29906,
322,
659,
29941,
13,
18884,
659,
29896,
353,
659,
29896,
718,
29871,
29906,
13,
18884,
659,
29906,
353,
659,
29906,
448,
29871,
29896,
13,
18884,
659,
29941,
353,
659,
29941,
448,
29871,
29896,
13,
18884,
565,
313,
791,
29896,
1405,
29871,
29896,
29906,
29953,
29897,
470,
313,
791,
29906,
529,
29871,
29896,
29897,
470,
313,
791,
29941,
529,
29871,
29896,
1125,
13,
462,
1678,
659,
29896,
353,
1677,
791,
29896,
13,
462,
1678,
659,
29906,
353,
1677,
791,
29906,
13,
462,
1678,
659,
29941,
353,
1677,
791,
29941,
13,
462,
1678,
1134,
353,
29871,
29946,
13,
9651,
565,
1134,
1275,
29871,
29946,
29901,
13,
18884,
565,
313,
791,
29896,
554,
1275,
29871,
29900,
1125,
13,
462,
1678,
659,
29896,
353,
659,
29896,
448,
29871,
29896,
13,
462,
1678,
270,
29896,
353,
270,
29896,
718,
29871,
29896,
13,
18884,
1683,
29901,
13,
462,
1678,
396,
1286,
9677,
19471,
975,
916,
29871,
29906,
1819,
13,
462,
1678,
565,
313,
29881,
29896,
1405,
29871,
29900,
1125,
13,
462,
4706,
659,
29906,
353,
659,
29906,
718,
29871,
29896,
13,
462,
4706,
659,
29941,
353,
1677,
791,
29941,
718,
270,
29896,
448,
29871,
29896,
13,
462,
4706,
270,
29896,
353,
270,
29896,
448,
29871,
29896,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
659,
29896,
353,
29871,
29900,
13,
18884,
565,
313,
791,
29896,
529,
29871,
29896,
29897,
470,
313,
791,
29906,
1405,
29871,
29896,
29906,
29953,
29897,
470,
313,
791,
29941,
1405,
29871,
29896,
29906,
29953,
1125,
13,
462,
1678,
659,
29896,
353,
1677,
791,
29896,
13,
462,
1678,
659,
29906,
353,
1677,
791,
29906,
13,
462,
1678,
659,
29941,
353,
1677,
791,
29941,
13,
462,
1678,
270,
29896,
353,
29871,
29900,
13,
462,
1678,
1134,
353,
29871,
29945,
13,
9651,
565,
1134,
1275,
29871,
29945,
29901,
13,
18884,
565,
313,
791,
29896,
554,
1275,
29871,
29900,
1125,
13,
462,
1678,
659,
29896,
353,
659,
29896,
718,
29871,
29896,
13,
462,
1678,
270,
29896,
353,
270,
29896,
718,
29871,
29896,
13,
18884,
1683,
29901,
13,
462,
1678,
396,
1286,
9677,
19471,
975,
916,
29871,
29906,
1819,
13,
462,
1678,
565,
313,
29881,
29896,
1405,
29871,
29900,
1125,
13,
462,
4706,
659,
29906,
353,
659,
29906,
448,
29871,
29896,
13,
462,
4706,
659,
29941,
353,
1677,
791,
29941,
448,
270,
29896,
718,
29871,
29896,
13,
462,
4706,
270,
29896,
353,
270,
29896,
448,
29871,
29896,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
659,
29896,
353,
29871,
29906,
29945,
29945,
13,
18884,
565,
313,
791,
29896,
1405,
29871,
29896,
29906,
29953,
29897,
470,
313,
791,
29906,
529,
29871,
29896,
29897,
470,
313,
791,
29941,
529,
29871,
29896,
1125,
13,
462,
1678,
659,
29896,
353,
1677,
791,
29896,
13,
462,
1678,
659,
29906,
353,
1677,
791,
29906,
13,
462,
1678,
659,
29941,
353,
1677,
791,
29941,
13,
462,
1678,
659,
29896,
554,
353,
29871,
29900,
13,
462,
1678,
659,
29906,
554,
353,
29871,
29900,
13,
462,
1678,
659,
29941,
554,
353,
29871,
29900,
13,
462,
1678,
270,
29896,
353,
29871,
29900,
13,
462,
1678,
270,
29906,
353,
29871,
29900,
13,
462,
1678,
270,
29941,
353,
29871,
29900,
13,
462,
1678,
1134,
353,
29871,
29953,
13,
9651,
565,
1134,
1275,
29871,
29953,
29901,
13,
18884,
565,
313,
791,
29896,
554,
1275,
29871,
29900,
1125,
13,
462,
1678,
659,
29896,
353,
659,
29896,
448,
29871,
29896,
13,
18884,
396,
270,
29896,
29922,
29881,
29896,
29974,
29896,
13,
18884,
565,
313,
791,
29906,
554,
1275,
29871,
29900,
1125,
13,
462,
1678,
659,
29906,
353,
659,
29906,
718,
29871,
29896,
13,
18884,
396,
270,
29906,
29922,
29881,
29906,
29974,
29896,
13,
18884,
270,
29941,
353,
1677,
791,
29896,
448,
659,
29896,
718,
1677,
791,
29906,
448,
659,
29906,
13,
18884,
659,
29941,
353,
1677,
791,
29941,
718,
270,
29941,
13,
18884,
565,
313,
4230,
29881,
29941,
1275,
270,
29941,
29897,
322,
313,
29881,
29941,
1405,
29871,
29900,
1125,
13,
462,
1678,
659,
29896,
353,
1677,
791,
29896,
13,
462,
1678,
659,
29906,
353,
1677,
791,
29906,
13,
462,
1678,
659,
29941,
353,
1677,
791,
29941,
13,
462,
1678,
2367,
786,
353,
29871,
29896,
13,
18884,
1683,
29901,
13,
462,
1678,
1833,
29881,
29941,
353,
270,
29941,
13,
18884,
565,
313,
791,
29896,
529,
29871,
29896,
29897,
470,
313,
791,
29906,
529,
29871,
29896,
29897,
470,
313,
791,
29941,
1405,
29871,
29896,
29906,
29953,
1125,
13,
462,
1678,
659,
29896,
353,
1677,
791,
29896,
13,
462,
1678,
659,
29906,
353,
1677,
791,
29906,
13,
462,
1678,
659,
29941,
353,
1677,
791,
29941,
13,
462,
1678,
2367,
786,
353,
29871,
29896,
13,
1678,
396,
1423,
2582,
13,
1678,
1373,
20047,
353,
29871,
29900,
13,
1678,
659,
29896,
554,
353,
29871,
29896,
13,
1678,
659,
29906,
554,
353,
29871,
29896,
13,
1678,
659,
29941,
554,
353,
29871,
29896,
13,
1678,
659,
29896,
726,
353,
376,
8949,
29908,
13,
1678,
659,
29906,
726,
353,
376,
8949,
29908,
13,
1678,
659,
29941,
726,
353,
376,
8949,
29908,
13,
1678,
1550,
1373,
20047,
529,
7431,
29898,
12313,
305,
1503,
1125,
13,
4706,
565,
313,
791,
29896,
1275,
4319,
305,
1503,
29961,
3090,
20047,
29962,
1125,
13,
9651,
659,
29896,
554,
353,
29871,
29900,
13,
9651,
659,
29896,
726,
353,
376,
6632,
29968,
29908,
13,
4706,
565,
313,
791,
29906,
1275,
4319,
305,
1503,
29961,
3090,
20047,
29962,
1125,
13,
9651,
659,
29906,
554,
353,
29871,
29900,
13,
9651,
659,
29906,
726,
353,
376,
6632,
29968,
29908,
13,
4706,
565,
313,
791,
29941,
1275,
4319,
305,
1503,
29961,
3090,
20047,
29962,
1125,
13,
9651,
659,
29941,
554,
353,
29871,
29900,
13,
9651,
659,
29941,
726,
353,
376,
6632,
29968,
29908,
13,
4706,
1373,
20047,
353,
1373,
20047,
718,
29871,
29896,
13,
13,
1678,
565,
313,
791,
29896,
554,
1275,
29871,
29900,
29897,
470,
313,
791,
29906,
554,
1275,
29871,
29900,
29897,
470,
313,
791,
29941,
554,
1275,
29871,
29900,
1125,
13,
4706,
1596,
703,
29871,
3579,
20065,
304,
2329,
4319,
1373,
2228,
1738,
1159,
13,
4706,
1596,
703,
12,
29871,
1599,
2630,
1041,
304,
1423,
584,
1273,
29879,
29414,
29879,
29897,
1273,
29879,
29414,
29879,
29897,
1273,
29879,
29414,
29879,
29897,
376,
1273,
313,
13,
9651,
9016,
29906,
20970,
29898,
12683,
791,
29896,
511,
659,
29896,
726,
29892,
9016,
29906,
20970,
29898,
12683,
791,
29906,
511,
659,
29906,
726,
29892,
9016,
29906,
20970,
29898,
12683,
791,
29941,
511,
659,
29941,
726,
876,
13,
4706,
659,
29896,
353,
1677,
791,
29896,
13,
4706,
659,
29906,
353,
1677,
791,
29906,
13,
4706,
659,
29941,
353,
1677,
791,
29941,
13,
1678,
716,
791,
29879,
29889,
4397,
29898,
791,
29896,
29897,
13,
1678,
716,
791,
29879,
29889,
4397,
29898,
791,
29906,
29897,
13,
1678,
716,
791,
29879,
29889,
4397,
29898,
791,
29941,
29897,
13,
268,
13,
1678,
736,
716,
791,
29879,
13,
13,
1753,
1014,
29918,
29941,
29898,
15903,
401,
29892,
1781,
305,
1503,
11759,
1402,
4319,
305,
1503,
29922,
2636,
1125,
13,
13,
1678,
396,
3588,
694,
12313,
3090,
851,
304,
385,
1409,
13,
1678,
694,
12313,
305,
1503,
353,
15090,
29906,
2378,
29898,
2109,
29906,
20970,
29898,
6632,
29933,
3035,
11282,
29903,
876,
13,
13,
1678,
565,
4319,
305,
1503,
29901,
13,
13,
4706,
4319,
3090,
29918,
11940,
353,
7700,
13,
4706,
363,
289,
297,
4319,
305,
1503,
29901,
13,
9651,
565,
289,
297,
694,
12313,
305,
1503,
29901,
13,
18884,
1596,
703,
14352,
29962,
4829,
29901,
19831,
6571,
2609,
367,
263,
4319,
1373,
411,
445,
2094,
6119,
1642,
4830,
29898,
29890,
876,
13,
18884,
4319,
3090,
29918,
11940,
353,
5852,
29871,
13,
18884,
2867,
13,
13,
4706,
565,
4319,
3090,
29918,
11940,
29901,
13,
9651,
736,
6213,
268,
13,
13,
1678,
396,
5953,
837,
457,
920,
304,
5300,
382,
6604,
4208,
304,
679,
29871,
29900,
29871,
13,
1678,
321,
1165,
29918,
392,
29918,
791,
29896,
353,
525,
29945,
29945,
29946,
29923,
29946,
29928,
29946,
29909,
29915,
13,
1678,
321,
1165,
29918,
392,
29918,
791,
29906,
353,
525,
29906,
29909,
29941,
29896,
29941,
29906,
29941,
29945,
29915,
13,
13,
1678,
565,
1781,
305,
1503,
29901,
13,
4706,
321,
1165,
29918,
392,
29918,
791,
29896,
29892,
321,
1165,
29918,
392,
29918,
791,
29906,
353,
1284,
29918,
9354,
359,
277,
29918,
13193,
29898,
16773,
305,
1503,
29897,
13,
13,
1678,
396,
349,
3445,
598,
6473,
401,
13,
1678,
18764,
287,
29918,
23813,
353,
19012,
29918,
15903,
401,
29898,
15903,
401,
29897,
13,
13,
1678,
18511,
1220,
353,
29871,
29900,
13,
1678,
18511,
13193,
353,
6571,
13,
13,
1678,
954,
29918,
305,
18801,
353,
7431,
29898,
276,
874,
287,
29918,
23813,
29897,
13,
1678,
2908,
20047,
353,
954,
29918,
305,
18801,
13,
1678,
3001,
29918,
2848,
353,
29871,
29900,
13,
13,
1678,
363,
19875,
297,
18764,
287,
29918,
23813,
29901,
13,
13,
4706,
1596,
703,
7032,
292,
19875,
6571,
310,
6571,
1642,
4830,
29898,
1271,
20047,
29892,
954,
29918,
305,
18801,
876,
13,
13,
4706,
396,
11837,
278,
995,
577,
393,
365,
1744,
338,
937,
13,
4706,
11837,
29918,
29812,
353,
376,
1642,
7122,
29898,
276,
874,
287,
4197,
29812,
29961,
29875,
29901,
29875,
29974,
29906,
29962,
363,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
29812,
511,
29871,
29906,
4638,
876,
13,
13,
4706,
396,
3588,
15090,
304,
938,
13,
4706,
6664,
791,
353,
15090,
29918,
710,
29918,
517,
29918,
524,
29898,
24244,
29918,
29812,
29897,
13,
13,
4706,
396,
3617,
1023,
29915,
29879,
19595,
29871,
13,
4706,
396,
15090,
29898,
29946,
29906,
29929,
29946,
29929,
29953,
29955,
29906,
29929,
29953,
29897,
1275,
29871,
29900,
29916,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
13,
4706,
3252,
10611,
353,
29871,
29946,
29906,
29929,
29946,
29929,
29953,
29955,
29906,
29929,
29953,
448,
6664,
791,
13,
13,
4706,
396,
3588,
1023,
29915,
29879,
19595,
1250,
304,
15090,
13,
4706,
3252,
18711,
2167,
353,
304,
20970,
29898,
7516,
10611,
29897,
13,
13,
4706,
1596,
703,
29961,
29974,
10725,
29873,
11746,
401,
304,
7138,
346,
29901,
6571,
1642,
4830,
29898,
29812,
876,
13,
4706,
1596,
703,
29961,
29974,
10725,
29873,
1123,
874,
287,
6461,
401,
29901,
259,
6571,
1642,
4830,
29898,
24244,
29918,
29812,
876,
13,
4706,
1596,
703,
29961,
29974,
10725,
29873,
27418,
359,
19595,
29901,
259,
426,
1012,
29876,
1642,
4830,
29898,
7516,
18711,
2167,
876,
13,
13,
4706,
396,
363,
1269,
7023,
29892,
1369,
411,
278,
1833,
697,
937,
13,
4706,
289,
20047,
353,
29871,
29941,
13,
4706,
11969,
353,
29871,
29900,
13,
4706,
1015,
18137,
353,
5159,
13,
13,
4706,
1550,
289,
20047,
6736,
29871,
29900,
29901,
13,
13,
9651,
396,
910,
338,
2805,
278,
1833,
7023,
515,
278,
19875,
13,
9651,
3151,
10389,
353,
3252,
18711,
2167,
15625,
12328,
593,
334,
29871,
29906,
4638,
718,
3252,
18711,
2167,
15625,
12328,
593,
334,
29871,
29906,
29897,
718,
29871,
29896,
29962,
13,
13,
9651,
396,
3588,
15090,
995,
304,
938,
13,
9651,
3151,
791,
353,
15090,
29918,
710,
29918,
517,
29918,
524,
29898,
2764,
10389,
29897,
448,
11969,
13,
13,
9651,
1243,
791,
353,
3151,
791,
29914,
29941,
13,
13,
9651,
396,
4386,
11969,
13,
9651,
565,
1243,
791,
529,
29871,
29941,
29906,
29901,
13,
18884,
3151,
10389,
353,
376,
29896,
29908,
718,
3151,
10389,
13,
18884,
3151,
791,
353,
15090,
29918,
710,
29918,
517,
29918,
524,
29898,
2764,
10389,
29897,
448,
11969,
13,
18884,
11969,
353,
29871,
29896,
13,
13,
9651,
1683,
29901,
13,
18884,
11969,
353,
29871,
29900,
13,
13,
9651,
659,
29896,
353,
938,
29898,
2764,
791,
847,
29871,
29941,
29897,
13,
9651,
659,
29906,
353,
938,
29898,
2764,
791,
847,
29871,
29941,
29897,
13,
9651,
659,
29941,
353,
938,
29898,
2764,
791,
847,
29871,
29941,
29897,
13,
9651,
2533,
791,
353,
659,
29896,
718,
659,
29906,
718,
659,
29941,
29871,
13,
13,
9651,
565,
2533,
791,
529,
3151,
791,
29901,
13,
18884,
659,
29941,
353,
659,
29941,
718,
313,
2764,
791,
448,
2533,
791,
29897,
13,
13,
9651,
396,
11539,
4319,
4890,
29871,
13,
9651,
2329,
791,
29879,
353,
12725,
12313,
305,
1503,
29918,
3977,
29898,
791,
29896,
29892,
659,
29906,
29892,
659,
29941,
29892,
4319,
305,
1503,
29897,
13,
13,
9651,
659,
29896,
353,
11860,
29900,
29906,
29916,
29908,
1273,
313,
524,
29898,
5878,
791,
29879,
29961,
29900,
12622,
13,
9651,
659,
29906,
353,
11860,
29900,
29906,
29916,
29908,
1273,
313,
524,
29898,
5878,
791,
29879,
29961,
29896,
12622,
13,
9651,
659,
29941,
353,
11860,
29900,
29906,
29916,
29908,
1273,
313,
524,
29898,
5878,
791,
29879,
29961,
29906,
12622,
13,
9651,
1015,
18137,
29889,
4397,
29898,
791,
29896,
29897,
13,
9651,
1015,
18137,
29889,
4397,
29898,
791,
29906,
29897,
13,
9651,
1015,
18137,
29889,
4397,
29898,
791,
29941,
29897,
13,
9651,
289,
20047,
353,
289,
20047,
448,
29871,
29896,
13,
13,
4706,
396,
6204,
6473,
401,
29871,
13,
4706,
445,
26716,
10389,
353,
9016,
29906,
20970,
29898,
3289,
29924,
29918,
4571,
1783,
1839,
9468,
16215,
29923,
6604,
11287,
13,
4706,
445,
26716,
10389,
4619,
321,
1165,
29918,
392,
29918,
791,
29896,
13,
13,
4706,
396,
14491,
6473,
401,
2298,
13266,
11994,
13,
4706,
18511,
13193,
29961,
26716,
1220,
29962,
353,
518,
1366,
26716,
10389,
29892,
525,
9468,
382,
6604,
29892,
29871,
29900,
29916,
8875,
4286,
4830,
29898,
29872,
1165,
29918,
392,
29918,
791,
29896,
4638,
13,
4706,
18511,
1220,
4619,
29871,
29896,
13,
4706,
3001,
29918,
2848,
4619,
7431,
29898,
1366,
26716,
10389,
29897,
13,
13,
4706,
396,
6204,
6473,
401,
13,
4706,
445,
26716,
10389,
353,
9016,
29906,
20970,
29898,
3289,
29924,
29918,
4571,
1783,
1839,
9468,
16215,
29923,
6604,
11287,
13,
4706,
445,
26716,
10389,
4619,
321,
1165,
29918,
392,
29918,
791,
29906,
13,
13,
4706,
396,
14491,
6473,
401,
2298,
13266,
11994,
13,
4706,
18511,
13193,
29961,
26716,
1220,
29962,
353,
518,
1366,
26716,
10389,
29892,
525,
9468,
382,
6604,
29892,
29871,
29900,
29916,
8875,
4286,
4830,
29898,
29872,
1165,
29918,
392,
29918,
791,
29906,
4638,
13,
4706,
18511,
1220,
4619,
29871,
29896,
13,
4706,
3001,
29918,
2848,
4619,
7431,
29898,
1366,
26716,
10389,
29897,
13,
13,
4706,
396,
6204,
6473,
401,
1192,
3323,
13377,
4080,
29871,
29896,
13,
4706,
445,
26716,
10389,
353,
9016,
29906,
20970,
29898,
3289,
29924,
29918,
4571,
1783,
1839,
20633,
16215,
29923,
6604,
11287,
13,
4706,
445,
26716,
10389,
4619,
22372,
1157,
1157,
1157,
29913,
4286,
4830,
29898,
459,
18137,
29961,
29900,
1402,
1015,
18137,
29961,
29941,
1402,
1015,
18137,
29961,
29953,
1402,
29871,
1015,
18137,
29961,
29929,
2314,
13,
308,
13,
4706,
396,
14491,
6473,
401,
2298,
13266,
11994,
1192,
3323,
13377,
4080,
29871,
29896,
13,
4706,
18511,
13193,
29961,
26716,
1220,
29962,
353,
518,
1366,
26716,
10389,
29892,
376,
20633,
382,
6604,
29892,
29871,
29900,
29916,
29912,
1157,
1157,
1157,
29913,
1642,
4830,
29898,
459,
18137,
29961,
29929,
1402,
1015,
18137,
29961,
29953,
1402,
1015,
18137,
29961,
29941,
1402,
1015,
18137,
29961,
29900,
2314,
29962,
13,
4706,
18511,
1220,
4619,
29871,
29896,
13,
4706,
3001,
29918,
2848,
4619,
7431,
29898,
1366,
26716,
10389,
29897,
13,
13,
4706,
396,
6204,
6473,
401,
1192,
3323,
13377,
4080,
29871,
29906,
13,
4706,
445,
26716,
10389,
353,
9016,
29906,
20970,
29898,
3289,
29924,
29918,
4571,
1783,
1839,
20633,
16215,
29923,
6604,
11287,
13,
4706,
445,
26716,
10389,
4619,
22372,
1157,
1157,
1157,
29913,
4286,
4830,
29898,
459,
18137,
29961,
29896,
1402,
1015,
18137,
29961,
29946,
1402,
1015,
18137,
29961,
29955,
1402,
29871,
1015,
18137,
29961,
29896,
29900,
2314,
13,
13,
4706,
396,
14491,
6473,
401,
2298,
13266,
11994,
1192,
3323,
13377,
4080,
29871,
29906,
13,
4706,
18511,
13193,
29961,
26716,
1220,
29962,
353,
518,
1366,
26716,
10389,
29892,
376,
20633,
382,
6604,
29892,
29871,
29900,
29916,
29912,
1157,
1157,
1157,
29913,
1642,
4830,
29898,
459,
18137,
29961,
29896,
29900,
1402,
1015,
18137,
29961,
29955,
1402,
1015,
18137,
29961,
29946,
1402,
1015,
18137,
29961,
29896,
2314,
29962,
13,
4706,
18511,
1220,
4619,
29871,
29896,
13,
4706,
3001,
29918,
2848,
4619,
7431,
29898,
1366,
26716,
10389,
29897,
13,
13,
4706,
396,
6204,
6473,
401,
1192,
3323,
13377,
4080,
29871,
29941,
13,
4706,
445,
26716,
10389,
353,
9016,
29906,
20970,
29898,
3289,
29924,
29918,
4571,
1783,
1839,
20633,
16215,
29923,
6604,
11287,
13,
4706,
445,
26716,
10389,
4619,
22372,
1157,
1157,
1157,
29913,
4286,
4830,
29898,
459,
18137,
29961,
29906,
1402,
1015,
18137,
29961,
29945,
1402,
1015,
18137,
29961,
29947,
1402,
29871,
1015,
18137,
29961,
29896,
29896,
2314,
13,
13,
4706,
396,
14491,
6473,
401,
2298,
13266,
11994,
1192,
3323,
13377,
4080,
29871,
29941,
13,
4706,
18511,
13193,
29961,
26716,
1220,
29962,
353,
518,
1366,
26716,
10389,
29892,
376,
20633,
382,
6604,
29892,
29871,
29900,
29916,
29912,
1157,
1157,
1157,
29913,
1642,
4830,
29898,
459,
18137,
29961,
29896,
29896,
1402,
1015,
18137,
29961,
29947,
1402,
1015,
18137,
29961,
29945,
1402,
1015,
18137,
29961,
29906,
2314,
29962,
13,
4706,
18511,
1220,
4619,
29871,
29896,
13,
4706,
3001,
29918,
2848,
4619,
7431,
29898,
1366,
26716,
10389,
29897,
13,
13,
4706,
396,
14491,
6473,
401,
2298,
13266,
11994,
13,
4706,
445,
26716,
10389,
353,
9016,
29906,
20970,
29898,
3289,
29924,
29918,
4571,
1783,
1839,
29925,
3308,
29950,
16215,
29923,
6604,
11287,
13,
4706,
18511,
13193,
29961,
26716,
1220,
29962,
353,
518,
1366,
26716,
10389,
29892,
376,
29925,
3308,
29950,
382,
6604,
3108,
13,
4706,
18511,
1220,
4619,
29871,
29896,
13,
4706,
3001,
29918,
2848,
4619,
7431,
29898,
1366,
26716,
10389,
29897,
13,
13,
4706,
396,
3826,
276,
358,
2908,
2302,
13,
4706,
2908,
20047,
22361,
29871,
29896,
13,
13,
1678,
736,
18511,
13193,
13,
13,
29937,
822,
1596,
8566,
6797,
15467,
1359,
29898,
26716,
13193,
1125,
29871,
13,
29937,
268,
14550,
13,
29937,
268,
13905,
714,
278,
18511,
6262,
13,
29937,
268,
14550,
13,
13,
29937,
268,
363,
1196,
297,
18511,
13193,
29901,
13,
13,
29937,
308,
1596,
29898,
26716,
13193,
29961,
1220,
3816,
29900,
2314,
13,
13,
1753,
1596,
8566,
6797,
15467,
1359,
29898,
26716,
13193,
1125,
29871,
13,
1678,
14550,
13,
1678,
13905,
714,
278,
18511,
6262,
13,
1678,
14550,
13,
1678,
6473,
401,
29918,
1807,
353,
5124,
13,
1678,
1596,
14182,
29876,
29905,
29876,
1275,
2751,
1360,
17212,
1275,
2751,
26359,
29897,
13,
13,
1678,
363,
1196,
297,
18511,
13193,
29901,
13,
4706,
6473,
401,
353,
376,
1966,
29916,
29908,
718,
525,
1966,
29916,
4286,
7122,
29898,
20970,
29906,
2378,
29898,
26716,
13193,
29961,
1220,
3816,
29900,
12622,
13,
4706,
6473,
401,
29918,
1807,
4619,
6473,
401,
13,
4706,
11470,
353,
18511,
13193,
29961,
1220,
3816,
29896,
29962,
13,
13,
4706,
1596,
703,
8875,
584,
6571,
1642,
4830,
29898,
15903,
401,
29892,
11470,
876,
13,
13,
1678,
1596,
14182,
29876,
29905,
29876,
1275,
2751,
1360,
13266,
5920,
1275,
2751,
26359,
29897,
13,
1678,
363,
1196,
297,
18511,
13193,
29901,
13,
13,
4706,
1596,
29898,
26716,
13193,
29961,
1220,
3816,
29896,
2314,
13,
13,
1678,
1596,
14182,
29876,
29905,
29876,
1275,
2751,
1360,
1383,
514,
401,
1275,
2751,
26359,
29897,
13,
1678,
363,
1196,
297,
18511,
13193,
29901,
13,
4706,
1596,
703,
1966,
29916,
29908,
718,
525,
1966,
29916,
4286,
7122,
29898,
20970,
29906,
2378,
29898,
26716,
13193,
29961,
1220,
3816,
29900,
29962,
4961,
13,
13,
1678,
1596,
14182,
29876,
29905,
29876,
1275,
2751,
1360,
1383,
514,
401,
1714,
1275,
2751,
26359,
29897,
13,
1678,
1596,
703,
8566,
6797,
1383,
514,
401,
365,
1477,
29901,
6571,
1642,
4830,
29898,
2435,
29898,
20970,
29906,
2109,
29898,
15903,
401,
29918,
1807,
13697,
13,
1678,
1596,
29898,
15903,
401,
29918,
1807,
29897,
13,
13,
13,
1753,
1667,
7295,
13,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
543,
2369,
401,
20092,
773,
1014,
11994,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
29899,
29886,
613,
376,
489,
23813,
613,
29871,
13,
462,
18884,
1371,
543,
2283,
640,
29874,
292,
20092,
304,
19750,
6943,
15090,
1347,
313,
387,
29889,
2474,
29916,
29946,
29896,
1966,
29916,
29946,
29906,
19123,
13,
462,
18884,
3734,
29922,
5574,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
29899,
29890,
613,
376,
489,
12313,
29918,
3090,
21706,
613,
29871,
13,
462,
18884,
1371,
543,
2283,
6943,
4319,
4890,
304,
11455,
297,
15090,
1347,
313,
387,
29889,
2474,
29916,
29900,
29900,
1966,
29916,
29900,
29909,
19123,
13,
462,
18884,
3734,
29922,
5574,
29897,
13,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
29899,
29887,
613,
376,
489,
16773,
29918,
3090,
21706,
613,
29871,
13,
462,
18884,
1371,
543,
2283,
6943,
1781,
4890,
297,
15090,
1347,
313,
387,
29889,
2474,
29916,
29900,
29900,
1966,
29916,
29900,
29909,
19123,
13,
462,
18884,
3734,
29922,
5574,
29897,
13,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
268,
13,
1678,
396,
7523,
297,
1781,
2931,
1051,
13,
1678,
1781,
305,
1503,
29918,
1761,
353,
5159,
13,
1678,
565,
6389,
29889,
16773,
29918,
3090,
21706,
29901,
13,
4706,
1781,
305,
1503,
29918,
1761,
353,
1889,
29918,
2080,
1445,
29898,
5085,
29889,
16773,
29918,
3090,
21706,
29897,
13,
4706,
1596,
703,
29961,
29974,
29962,
9681,
310,
1781,
4890,
29901,
6571,
1642,
4830,
29898,
2435,
29898,
16773,
305,
1503,
29918,
1761,
4961,
13,
539,
13,
1678,
396,
10554,
4319,
4890,
13,
1678,
4319,
305,
1503,
29918,
1761,
353,
5159,
13,
1678,
565,
6389,
29889,
12313,
29918,
3090,
21706,
29901,
13,
4706,
4319,
305,
1503,
29918,
1761,
353,
1889,
29918,
2080,
1445,
29898,
5085,
29889,
12313,
29918,
3090,
21706,
29897,
13,
4706,
1596,
703,
29961,
29974,
29962,
9681,
310,
4319,
4890,
29901,
6571,
1642,
4830,
29898,
2435,
29898,
12313,
305,
1503,
29918,
1761,
4961,
13,
13,
1678,
565,
6389,
29889,
23813,
29901,
13,
4706,
13,
4706,
20092,
353,
1889,
29918,
2080,
1445,
29898,
5085,
29889,
23813,
29897,
13,
13,
4706,
18511,
29918,
13193,
353,
1014,
29918,
29941,
29898,
23813,
29892,
1781,
305,
1503,
29922,
16773,
305,
1503,
29918,
1761,
29892,
4319,
305,
1503,
29922,
12313,
305,
1503,
29918,
1761,
29897,
13,
4706,
1596,
8566,
6797,
15467,
1359,
29898,
26716,
29918,
13193,
29897,
13,
13,
13,
1678,
1683,
29901,
13,
4706,
1596,
29898,
16680,
29889,
2158,
29918,
8477,
29898,
9675,
29889,
303,
20405,
876,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
580,
13,
2
] |
Scripts/Preprocessing/pre04_map_domains_id.py | mattiasu96/recsys-challenge-2021-twitter | 6 | 115444 | from preprocessing_utilities import create_and_save_uniques, load_uniques_create_dict_map, count_array_feature
from Scripts.utilities import start_correct_cluster, read_dataset, save_dataset, parse_args
from preprocessing_utilities import dict_path, temp_output_path, dataset_path
import numpy as np
import pyarrow as pa
dict_name = "domains_id"
out_cols = ["mapped_domains_id", 'tweet_domains_count']
out_frame_name = "mapped_domains"
if __name__ == '__main__':
generate_dict, is_test = parse_args()
c = start_correct_cluster(is_test, use_processes=False)
### Map Domains
# Load dataset
df = read_dataset(dataset_path, ["raw_feature_tweet_domains"])
generate_dict, _ = parse_args()
# Create Dict
if generate_dict:
create_and_save_uniques(dict_path, dict_name, df["raw_feature_tweet_domains"], '\t')
# Map the feature
out = load_uniques_create_dict_map(c, dict_path, dict_name,
df["raw_feature_tweet_domains"], out_cols[0], np.uint32,
'\t').to_frame()
out['tweet_domains_count'] = count_array_feature(out['mapped_domains_id'], np.uint8)
# Write the output dataset
save_dataset(temp_output_path, out, name='mapped_domains',
schema={"mapped_domains_id": pa.list_(pa.uint32()), 'tweet_domains_count': pa.uint8()})
| [
1,
515,
758,
19170,
29918,
4422,
1907,
1053,
1653,
29918,
392,
29918,
7620,
29918,
348,
3783,
29892,
2254,
29918,
348,
3783,
29918,
3258,
29918,
8977,
29918,
1958,
29892,
2302,
29918,
2378,
29918,
14394,
13,
3166,
14415,
29879,
29889,
4422,
1907,
1053,
1369,
29918,
15728,
29918,
19594,
29892,
1303,
29918,
24713,
29892,
4078,
29918,
24713,
29892,
6088,
29918,
5085,
13,
3166,
758,
19170,
29918,
4422,
1907,
1053,
9657,
29918,
2084,
29892,
5694,
29918,
4905,
29918,
2084,
29892,
8783,
29918,
2084,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
11451,
2936,
408,
3300,
13,
13,
8977,
29918,
978,
353,
376,
3129,
2708,
29918,
333,
29908,
13,
449,
29918,
22724,
353,
6796,
655,
2986,
29918,
3129,
2708,
29918,
333,
613,
525,
29873,
16668,
29918,
3129,
2708,
29918,
2798,
2033,
13,
449,
29918,
2557,
29918,
978,
353,
376,
655,
2986,
29918,
3129,
2708,
29908,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
5706,
29918,
8977,
29892,
338,
29918,
1688,
353,
6088,
29918,
5085,
580,
13,
1678,
274,
353,
1369,
29918,
15728,
29918,
19594,
29898,
275,
29918,
1688,
29892,
671,
29918,
5014,
267,
29922,
8824,
29897,
13,
13,
1678,
835,
7315,
7809,
2708,
13,
13,
1678,
396,
16012,
8783,
13,
1678,
4489,
353,
1303,
29918,
24713,
29898,
24713,
29918,
2084,
29892,
6796,
1610,
29918,
14394,
29918,
29873,
16668,
29918,
3129,
2708,
20068,
13,
13,
1678,
5706,
29918,
8977,
29892,
903,
353,
6088,
29918,
5085,
580,
13,
13,
1678,
396,
6204,
360,
919,
13,
1678,
565,
5706,
29918,
8977,
29901,
13,
4706,
1653,
29918,
392,
29918,
7620,
29918,
348,
3783,
29898,
8977,
29918,
2084,
29892,
9657,
29918,
978,
29892,
4489,
3366,
1610,
29918,
14394,
29918,
29873,
16668,
29918,
3129,
2708,
12436,
11297,
29873,
1495,
13,
13,
1678,
396,
7315,
278,
4682,
13,
1678,
714,
353,
2254,
29918,
348,
3783,
29918,
3258,
29918,
8977,
29918,
1958,
29898,
29883,
29892,
9657,
29918,
2084,
29892,
9657,
29918,
978,
29892,
13,
462,
462,
539,
4489,
3366,
1610,
29918,
14394,
29918,
29873,
16668,
29918,
3129,
2708,
12436,
714,
29918,
22724,
29961,
29900,
1402,
7442,
29889,
13470,
29941,
29906,
29892,
13,
462,
462,
539,
11297,
29873,
2824,
517,
29918,
2557,
580,
13,
1678,
714,
1839,
29873,
16668,
29918,
3129,
2708,
29918,
2798,
2033,
353,
2302,
29918,
2378,
29918,
14394,
29898,
449,
1839,
655,
2986,
29918,
3129,
2708,
29918,
333,
7464,
7442,
29889,
13470,
29947,
29897,
13,
13,
1678,
396,
14350,
278,
1962,
8783,
13,
1678,
4078,
29918,
24713,
29898,
7382,
29918,
4905,
29918,
2084,
29892,
714,
29892,
1024,
2433,
655,
2986,
29918,
3129,
2708,
742,
13,
462,
10938,
3790,
29908,
655,
2986,
29918,
3129,
2708,
29918,
333,
1115,
3300,
29889,
1761,
23538,
3274,
29889,
13470,
29941,
29906,
25739,
525,
29873,
16668,
29918,
3129,
2708,
29918,
2798,
2396,
3300,
29889,
13470,
29947,
580,
1800,
13,
2
] |
data/tileset_loader.py | Firecharmlily/CyberEdu | 5 | 157945 | import pygame
from data.clip import clip
def load_tileset(path):
tileset_img = pygame.image.load(path + 'tileset.png').convert()
tileset_img.set_colorkey((0, 0, 0))
width = tileset_img.get_width()
tile_size = [16, 16]
tile_count = int((width + 1) / (tile_size[0] + 1))
images = [clip(tileset_img, i * (tile_size[0] + 1), 0, tile_size[0], tile_size[1]) for i in range(tile_count)]
return images
| [
1,
1053,
22028,
13,
3166,
848,
29889,
24049,
1053,
20102,
13,
13,
1753,
2254,
29918,
1376,
267,
300,
29898,
2084,
1125,
13,
1678,
260,
5475,
300,
29918,
2492,
353,
22028,
29889,
3027,
29889,
1359,
29898,
2084,
718,
525,
1376,
267,
300,
29889,
2732,
2824,
13441,
580,
13,
1678,
260,
5475,
300,
29918,
2492,
29889,
842,
29918,
2780,
1989,
3552,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
876,
13,
1678,
2920,
353,
260,
5475,
300,
29918,
2492,
29889,
657,
29918,
2103,
580,
13,
1678,
25900,
29918,
2311,
353,
518,
29896,
29953,
29892,
29871,
29896,
29953,
29962,
13,
1678,
25900,
29918,
2798,
353,
938,
3552,
2103,
718,
29871,
29896,
29897,
847,
313,
29873,
488,
29918,
2311,
29961,
29900,
29962,
718,
29871,
29896,
876,
13,
1678,
4558,
353,
518,
24049,
29898,
1376,
267,
300,
29918,
2492,
29892,
474,
334,
313,
29873,
488,
29918,
2311,
29961,
29900,
29962,
718,
29871,
29896,
511,
29871,
29900,
29892,
25900,
29918,
2311,
29961,
29900,
1402,
25900,
29918,
2311,
29961,
29896,
2314,
363,
474,
297,
3464,
29898,
29873,
488,
29918,
2798,
4638,
13,
1678,
736,
4558,
13,
2
] |
tests/rest_kubectl/flask_rest_test.py | estuaryoss/estuary-deployer | 1 | 172226 | <filename>tests/rest_kubectl/flask_rest_test.py<gh_stars>1-10
#!/usr/bin/env python3
import unittest
import requests
import yaml
from flask import json
from parameterized import parameterized
from requests_toolbelt.utils import dump
from rest.api.constants.api_code import ApiCode
from rest.api.responsehelpers.error_message import ErrorMessage
class FlaskServerTestCase(unittest.TestCase):
server_base = "http://localhost:8080"
server = "{}/kubectl".format(server_base)
expected_version = "4.2.3"
sleep_before_container_up = 5
def test_env_endpoint(self):
response = requests.get(self.server + "/env")
body = json.loads(response.text)
self.assertEqual(response.status_code, 200)
self.assertGreaterEqual(len(body.get('description')), 7)
self.assertIn("/variables", body.get('description')["VARS_DIR"])
# self.assertEqual(body.get('message')["TEMPLATES_DIR"], "/data")
self.assertEqual(body.get('message'), ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
@parameterized.expand([
("ENV_TYPE", "DOCKER")
])
def test_env_load_from_props(self, env_var, expected_value):
response = requests.get(self.server + "/env/" + env_var)
body = response.json()
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get("message"), ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertEqual(body.get('description'), expected_value)
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
self.assertIsNotNone(body.get('path'))
def test_setenv_endpoint_jsonwithvalues_p(self):
payload = {"a": "b", "FOO2": "BAR1"}
headers = {'Content-type': 'application/json'}
response = requests.post(self.server + "/env", data=json.dumps(payload),
headers=headers)
body = response.json()
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('description'), payload)
self.assertEqual(body.get("message"), ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
self.assertIsNotNone(body.get('path'))
def test_ping_endpoint(self):
response = requests.get(self.server + "/ping")
body = response.json()
headers = response.headers
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('description'), "pong")
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
self.assertEqual(body.get('path'), "/kubectl/ping?")
self.assertEqual(len(headers.get('X-Request-ID')), 16)
def test_ping_endpoint_xid_set_by_client(self):
xid = 'whatever'
headers = {'X-Request-ID': xid}
response = requests.get(self.server + "/ping", headers=headers)
body = json.loads(response.text)
headers = response.headers
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('description'), "pong")
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
self.assertEqual(headers.get('X-Request-ID'), xid)
def test_about_endpoint(self):
response = requests.get(self.server + "/about")
name = "estuary-deployer"
body = json.loads(response.text)
self.assertEqual(response.status_code, 200)
self.assertIsInstance(body.get('description'), dict)
self.assertEqual(body.get('message'), ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('name'), name)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
def test_about_endpoint_unauthorized(self):
headers = {'Token': "invalidtoken"}
response = requests.get(self.server + "/about", headers=headers)
service_name = "estuary-deployer"
body = response.json()
headers = response.headers
self.assertEqual(response.status_code, 401)
self.assertEqual(body.get('description'), "Invalid Token")
self.assertEqual(body.get('name'), service_name)
self.assertEqual(body.get('message'), ErrorMessage.HTTP_CODE.get(ApiCode.UNAUTHORIZED.value))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.UNAUTHORIZED.value)
self.assertIsNotNone(body.get('timestamp'))
self.assertEqual(len(headers.get('X-Request-ID')), 16)
# def test_swagger_endpoint(self):
# response = requests.get(self.server_base + "/apidocs")
#
# body = response.text
# self.assertEqual(response.status_code, 200)
# self.assertTrue(body.find("html") >= 0)
#
# def test_swagger_endpoint_swagger_still_accesible(self):
# headers = {'Token': '<PASSWORD>'}
# response = requests.get(self.server_base + "/apidocs", headers=headers)
#
# body = response.text
# self.assertEqual(response.status_code, 200)
# self.assertTrue(body.find("html") >= 0)
#
# def test_swagger_yml_endpoint(self):
# response = requests.get(self.server + "/swagger/swagger.json")
#
# self.assertEqual(response.status_code, 200)
#
# def test_swagger_yml_swagger_still_accesible(self):
# headers = {'Token': '<PASSWORD>'}
# response = requests.get(self.server + "/swagger/swagger.json", headers=headers)
#
# self.assertEqual(response.status_code, 200)
@parameterized.expand([
("json.j2", "json.json"),
("yml.j2", "yml.yml")
])
def test_rend_endpoint(self, template, variables):
response = requests.get(self.server + f"/render/{template}/{variables}", Loader=yaml.Loader)
body = yaml.safe_load(response.text)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(body), 3)
@parameterized.expand([
("json.j2", "doesnotexists.json"),
("yml.j2", "doesnotexists.yml")
])
def test_rend_endpoint(self, template, variables):
expected = f"Exception([Errno 2] No such file or directory:"
response = requests.get(self.server + f"/render/{template}/{variables}")
body = response.json()
self.assertEqual(response.status_code, 500)
self.assertIn(expected, body.get("description"))
@parameterized.expand([
("doesnotexists.j2", "json.json"),
("doesnotexists.j2", "yml.yml")
])
def test_rend_endpoint(self, template, variables):
expected = f"Exception({template})"
response = requests.get(self.server + f"/render/{template}/{variables}")
body = response.json()
self.assertEqual(response.status_code, 500)
self.assertEqual(expected, body.get("description"))
# @parameterized.expand([
# ("standalone.yml", "variables.yml")
# ])
# @unittest.skipIf(os.environ.get('TEMPLATES_DIR') == "inputs/templates", "Skip on VM")
# def test_rendwithenv_endpoint(self, template, variables):
# payload = {'DATABASE': 'mysql56', 'IMAGE': 'latest'}
# headers = {'Content-type': 'application/json'}
#
# response = requests.post(self.server + f"/render/{template}/{variables}", data=json.dumps(payload),
# headers=headers)
#
# print(dump.dump_all(response))
# body = yaml.safe_load(response.text)
# self.assertEqual(response.status_code, 200)
# self.assertEqual(len(body.get("services")), 2)
# self.assertEqual(int(body.get("version")), 3)
def test_getdeployerfile_p(self):
headers = {
'Content-type': 'application/json',
'File-Path': '/etc/hostname'
}
response = requests.get(self.server + f"/file", headers=headers)
self.assertEqual(response.status_code, 200)
self.assertGreater(len(response.text), 0)
def test_getdeployerfile_n(self):
headers = {
'Content-type': 'application/json',
'File-Path': '/etc/dummy'
}
response = requests.get(self.server + f"/file", headers=headers)
body = response.json()
headers = response.headers
self.assertEqual(response.status_code, 500)
self.assertEqual(body.get('message'),
ErrorMessage.HTTP_CODE.get(ApiCode.GET_FILE_FAILURE.value))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.GET_FILE_FAILURE.value)
self.assertIsNotNone(body.get('timestamp'))
self.assertEqual(len(headers.get('X-Request-ID')), 16)
def test_getdeployerfile_missing_param_n(self):
header_key = 'File-Path'
headers = {'Content-type': 'application/json'}
response = requests.post(self.server + f"/file", headers=headers)
body = response.json()
self.assertEqual(response.status_code, 500)
self.assertEqual(body.get('message'),
ErrorMessage.HTTP_CODE.get(ApiCode.HTTP_HEADER_NOT_PROVIDED.value) % header_key)
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.HTTP_HEADER_NOT_PROVIDED.value)
self.assertIsNotNone(body.get('timestamp'))
def test_getenv_endpoint_p(self):
env_var = "VARS_DIR"
response = requests.get(self.server + f"/env/{env_var}")
body = response.json()
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('message'), ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertIsNotNone(body.get('description'))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
def test_getenv_endpoint_n(self):
env_var = "alabalaportocala"
response = requests.get(self.server + f"/env/{env_var}")
body = response.json()
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('message'), ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertEqual(body.get('description'), None)
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
@parameterized.expand([
"{\"file\": \"/dummy/config.properties\", \"content\": \"ip=10.0.0.1\\nrequest_sec=100\\nthreads=10\\ntype=dual\"}"
])
def test_uploadfile_n(self, payload):
headers = {'Content-type': 'application/json'}
mandatory_header_key = 'File-Path'
response = requests.post(
self.server + f"/file",
data=payload, headers=headers)
body = response.json()
print(dump.dump_all(response))
self.assertEqual(response.status_code, 500)
self.assertEqual(body.get('message'),
ErrorMessage.HTTP_CODE.get(ApiCode.HTTP_HEADER_NOT_PROVIDED.value) % mandatory_header_key)
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.HTTP_HEADER_NOT_PROVIDED.value)
self.assertIsNotNone(body.get('timestamp'))
@parameterized.expand([
""
])
def test_uploadfile_n(self, payload):
headers = {
'Content-type': 'application/json',
'File-Path': '/tmp/config.properties'
}
response = requests.post(
self.server + f"/file",
data=payload, headers=headers)
body = response.json()
print(dump.dump_all(response))
self.assertEqual(response.status_code, 500)
self.assertEqual(body.get('message'),
ErrorMessage.HTTP_CODE.get(ApiCode.EMPTY_REQUEST_BODY_PROVIDED.value))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.EMPTY_REQUEST_BODY_PROVIDED.value)
self.assertIsNotNone(body.get('timestamp'))
@parameterized.expand([
"{\"file\": \"/tmp/config.properties\", \"content\": \"ip=10.0.0.1\\nrequest_sec=100\\nthreads=10\\ntype=dual\"}"
])
def test_uploadfile_p(self, payload):
headers = {
'Content-type': 'application/json',
'File-Path': 'config.properties'
}
response = requests.put(
self.server + f"/file",
data=payload, headers=headers)
body = response.json()
print(dump.dump_all(response))
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('message'),
ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
def test_executecommand_n(self):
command = "abracadabra" # not working on linux
response = requests.post(
self.server + f"/command",
data=command)
body = response.json()
print(dump.dump_all(response))
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('message'),
ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertNotEqual(body.get('description').get('commands').get(command).get('details').get('code'), 0)
self.assertEqual(body.get('description').get('commands').get(command).get('details').get('out'), "")
self.assertNotEqual(body.get('description').get('commands').get(command).get('details').get('err'), "")
self.assertGreater(body.get('description').get('commands').get(command).get('details').get('pid'), 0)
self.assertIsInstance(body.get('description').get('commands').get(command).get('details').get('args'), list)
self.assertIsNotNone(body.get('timestamp'))
def test_executecommand_p(self):
command = "cat /etc/hostname"
response = requests.post(
self.server + f"/command",
data=command)
body = response.json()
print(dump.dump_all(response))
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('message'),
ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertEqual(body.get('description').get('commands').get(command).get('details').get('code'), 0)
self.assertNotEqual(body.get('description').get('commands').get(command).get('details').get('out'), "")
self.assertEqual(body.get('description').get('commands').get(command).get('details').get('err'), "")
self.assertGreater(body.get('description').get('commands').get(command).get('details').get('pid'), 0)
self.assertIsInstance(body.get('description').get('commands').get(command).get('details').get('args'), list)
self.assertIsNotNone(body.get('timestamp'))
def test_executecommand_rm_allowed_p(self):
command = "rm -rf /tmp"
response = requests.post(
self.server + f"/command",
data=command)
body = response.json()
print(dump.dump_all(response))
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('message'),
ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertIsInstance(body.get('description'), dict)
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
def test_both_valid_are_executed(self):
command = "rm -rf /tmp\nls -lrt"
commands = command.split("\n")
response = requests.post(
self.server + f"/command",
data=command)
body = response.json()
print(dump.dump_all(response))
self.assertEqual(response.status_code, 200)
self.assertEqual(body.get('message'),
ErrorMessage.HTTP_CODE.get(ApiCode.SUCCESS.value))
self.assertEqual(len(body.get('description').get("commands")), 2) # only 1 cmd is executed
self.assertEqual(body.get('description').get("commands").get(commands[1]).get('details').get('code'), 0)
self.assertEqual(body.get('version'), self.expected_version)
self.assertEqual(body.get('code'), ApiCode.SUCCESS.value)
self.assertIsNotNone(body.get('timestamp'))
def test_executecommand_timeout_from_client_n(self):
command = "sleep 20"
try:
requests.post(self.server + f"/command", data=command, timeout=2)
except Exception as e:
self.assertIsInstance(e, requests.exceptions.ReadTimeout)
if __name__ == '__main__':
unittest.main()
| [
1,
529,
9507,
29958,
21150,
29914,
5060,
29918,
29895,
431,
522,
29880,
29914,
1579,
1278,
29918,
5060,
29918,
1688,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
5215,
443,
27958,
13,
13,
5215,
7274,
13,
5215,
343,
8807,
13,
3166,
29784,
1053,
4390,
13,
3166,
3443,
1891,
1053,
3443,
1891,
13,
3166,
7274,
29918,
10154,
29890,
2152,
29889,
13239,
1053,
16766,
13,
13,
3166,
1791,
29889,
2754,
29889,
3075,
1934,
29889,
2754,
29918,
401,
1053,
29749,
3399,
13,
3166,
1791,
29889,
2754,
29889,
5327,
3952,
6774,
29889,
2704,
29918,
4906,
1053,
4829,
3728,
13,
13,
13,
1990,
2379,
1278,
6004,
3057,
8259,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
1923,
29918,
3188,
353,
376,
1124,
597,
7640,
29901,
29947,
29900,
29947,
29900,
29908,
13,
1678,
1923,
353,
29850,
6822,
29895,
431,
522,
29880,
1642,
4830,
29898,
2974,
29918,
3188,
29897,
13,
13,
1678,
3806,
29918,
3259,
353,
376,
29946,
29889,
29906,
29889,
29941,
29908,
13,
1678,
8709,
29918,
11083,
29918,
7611,
29918,
786,
353,
29871,
29945,
13,
13,
1678,
822,
1243,
29918,
6272,
29918,
29734,
29898,
1311,
1125,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
5591,
6272,
1159,
13,
13,
4706,
3573,
353,
4390,
29889,
18132,
29898,
5327,
29889,
726,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
25120,
1008,
9843,
29898,
2435,
29898,
2587,
29889,
657,
877,
8216,
1495,
511,
29871,
29955,
29897,
13,
4706,
1583,
29889,
9294,
797,
11974,
20897,
613,
3573,
29889,
657,
877,
8216,
1495,
3366,
26865,
29903,
29918,
9464,
20068,
13,
4706,
396,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
1495,
3366,
4330,
3580,
29931,
1299,
2890,
29918,
9464,
12436,
5591,
1272,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
732,
15501,
1891,
29889,
18837,
4197,
13,
4706,
4852,
25838,
29918,
11116,
613,
376,
3970,
7077,
1001,
1159,
13,
268,
2314,
13,
1678,
822,
1243,
29918,
6272,
29918,
1359,
29918,
3166,
29918,
11030,
29898,
1311,
29892,
8829,
29918,
1707,
29892,
3806,
29918,
1767,
1125,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
5591,
6272,
12975,
718,
8829,
29918,
1707,
29897,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
703,
4906,
4968,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
5477,
3806,
29918,
1767,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
2084,
8785,
13,
13,
1678,
822,
1243,
29918,
842,
6272,
29918,
29734,
29918,
3126,
2541,
5975,
29918,
29886,
29898,
1311,
1125,
13,
4706,
20092,
353,
8853,
29874,
1115,
376,
29890,
613,
376,
5800,
29949,
29906,
1115,
376,
29933,
1718,
29896,
9092,
13,
4706,
9066,
353,
11117,
3916,
29899,
1853,
2396,
525,
6214,
29914,
3126,
10827,
13,
13,
4706,
2933,
353,
7274,
29889,
2490,
29898,
1311,
29889,
2974,
718,
5591,
6272,
613,
848,
29922,
3126,
29889,
29881,
17204,
29898,
23813,
511,
13,
462,
462,
9066,
29922,
13662,
29897,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
5477,
20092,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
703,
4906,
4968,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
2084,
8785,
13,
13,
1678,
822,
1243,
29918,
15702,
29918,
29734,
29898,
1311,
1125,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
5591,
15702,
1159,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
9066,
353,
2933,
29889,
13662,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
5477,
376,
29886,
549,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
2084,
5477,
5591,
29895,
431,
522,
29880,
29914,
15702,
29973,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
13662,
29889,
657,
877,
29990,
29899,
3089,
29899,
1367,
1495,
511,
29871,
29896,
29953,
29897,
13,
13,
1678,
822,
1243,
29918,
15702,
29918,
29734,
29918,
29916,
333,
29918,
842,
29918,
1609,
29918,
4645,
29898,
1311,
1125,
13,
4706,
921,
333,
353,
525,
1332,
5564,
29915,
13,
4706,
9066,
353,
11117,
29990,
29899,
3089,
29899,
1367,
2396,
921,
333,
29913,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
5591,
15702,
613,
9066,
29922,
13662,
29897,
13,
13,
4706,
3573,
353,
4390,
29889,
18132,
29898,
5327,
29889,
726,
29897,
13,
4706,
9066,
353,
2933,
29889,
13662,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
5477,
376,
29886,
549,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13662,
29889,
657,
877,
29990,
29899,
3089,
29899,
1367,
5477,
921,
333,
29897,
13,
13,
1678,
822,
1243,
29918,
12717,
29918,
29734,
29898,
1311,
1125,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
5591,
12717,
1159,
13,
4706,
1024,
353,
376,
342,
29884,
653,
29899,
16519,
261,
29908,
13,
13,
4706,
3573,
353,
4390,
29889,
18132,
29898,
5327,
29889,
726,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
3624,
4998,
29898,
2587,
29889,
657,
877,
8216,
5477,
9657,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
978,
5477,
1024,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
822,
1243,
29918,
12717,
29918,
29734,
29918,
348,
8921,
1891,
29898,
1311,
1125,
13,
4706,
9066,
353,
11117,
6066,
2396,
376,
20965,
6979,
9092,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
5591,
12717,
613,
9066,
29922,
13662,
29897,
13,
4706,
2669,
29918,
978,
353,
376,
342,
29884,
653,
29899,
16519,
261,
29908,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
9066,
353,
2933,
29889,
13662,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29946,
29900,
29896,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
5477,
376,
13919,
25159,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
978,
5477,
2669,
29918,
978,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
29965,
3521,
2692,
29950,
1955,
26664,
3352,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
29965,
3521,
2692,
29950,
1955,
26664,
3352,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
13662,
29889,
657,
877,
29990,
29899,
3089,
29899,
1367,
1495,
511,
29871,
29896,
29953,
29897,
13,
13,
1678,
396,
822,
1243,
29918,
2774,
9921,
29918,
29734,
29898,
1311,
1125,
13,
1678,
396,
268,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
29918,
3188,
718,
5591,
481,
333,
12332,
1159,
13,
1678,
396,
13,
1678,
396,
268,
3573,
353,
2933,
29889,
726,
13,
1678,
396,
268,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
1678,
396,
268,
1583,
29889,
9294,
5574,
29898,
2587,
29889,
2886,
703,
1420,
1159,
6736,
29871,
29900,
29897,
13,
1678,
396,
13,
1678,
396,
822,
1243,
29918,
2774,
9921,
29918,
29734,
29918,
2774,
9921,
29918,
303,
453,
29918,
562,
778,
1821,
29898,
1311,
1125,
13,
1678,
396,
268,
9066,
353,
11117,
6066,
2396,
12801,
25711,
17013,
29958,
10827,
13,
1678,
396,
268,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
29918,
3188,
718,
5591,
481,
333,
12332,
613,
9066,
29922,
13662,
29897,
13,
1678,
396,
13,
1678,
396,
268,
3573,
353,
2933,
29889,
726,
13,
1678,
396,
268,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
1678,
396,
268,
1583,
29889,
9294,
5574,
29898,
2587,
29889,
2886,
703,
1420,
1159,
6736,
29871,
29900,
29897,
13,
1678,
396,
13,
1678,
396,
822,
1243,
29918,
2774,
9921,
29918,
21053,
29918,
29734,
29898,
1311,
1125,
13,
1678,
396,
268,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
5591,
2774,
9921,
29914,
2774,
9921,
29889,
3126,
1159,
13,
1678,
396,
13,
1678,
396,
268,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
1678,
396,
13,
1678,
396,
822,
1243,
29918,
2774,
9921,
29918,
21053,
29918,
2774,
9921,
29918,
303,
453,
29918,
562,
778,
1821,
29898,
1311,
1125,
13,
1678,
396,
268,
9066,
353,
11117,
6066,
2396,
12801,
25711,
17013,
29958,
10827,
13,
1678,
396,
268,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
5591,
2774,
9921,
29914,
2774,
9921,
29889,
3126,
613,
9066,
29922,
13662,
29897,
13,
1678,
396,
13,
1678,
396,
268,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
732,
15501,
1891,
29889,
18837,
4197,
13,
4706,
4852,
3126,
29889,
29926,
29906,
613,
376,
3126,
29889,
3126,
4968,
13,
4706,
4852,
21053,
29889,
29926,
29906,
613,
376,
21053,
29889,
21053,
1159,
13,
268,
2314,
13,
1678,
822,
1243,
29918,
28759,
29918,
29734,
29898,
1311,
29892,
4472,
29892,
3651,
1125,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
285,
23901,
9482,
19248,
6886,
6822,
29912,
20897,
17671,
4309,
1664,
29922,
25162,
29889,
10036,
29897,
13,
13,
4706,
3573,
353,
343,
8807,
29889,
11177,
29918,
1359,
29898,
5327,
29889,
726,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
2587,
511,
29871,
29941,
29897,
13,
13,
1678,
732,
15501,
1891,
29889,
18837,
4197,
13,
4706,
4852,
3126,
29889,
29926,
29906,
613,
376,
13221,
1333,
9933,
29889,
3126,
4968,
13,
4706,
4852,
21053,
29889,
29926,
29906,
613,
376,
13221,
1333,
9933,
29889,
21053,
1159,
13,
268,
2314,
13,
1678,
822,
1243,
29918,
28759,
29918,
29734,
29898,
1311,
29892,
4472,
29892,
3651,
1125,
13,
4706,
3806,
353,
285,
29908,
2451,
4197,
19212,
1217,
29871,
29906,
29962,
1939,
1316,
934,
470,
3884,
6160,
13,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
285,
23901,
9482,
19248,
6886,
6822,
29912,
20897,
27195,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29945,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
797,
29898,
9684,
29892,
3573,
29889,
657,
703,
8216,
5783,
13,
13,
1678,
732,
15501,
1891,
29889,
18837,
4197,
13,
4706,
4852,
13221,
1333,
9933,
29889,
29926,
29906,
613,
376,
3126,
29889,
3126,
4968,
13,
4706,
4852,
13221,
1333,
9933,
29889,
29926,
29906,
613,
376,
21053,
29889,
21053,
1159,
13,
268,
2314,
13,
1678,
822,
1243,
29918,
28759,
29918,
29734,
29898,
1311,
29892,
4472,
29892,
3651,
1125,
13,
4706,
3806,
353,
285,
29908,
2451,
3319,
6886,
1800,
29908,
13,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
285,
23901,
9482,
19248,
6886,
6822,
29912,
20897,
27195,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29945,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
9684,
29892,
3573,
29889,
657,
703,
8216,
5783,
13,
13,
1678,
396,
732,
15501,
1891,
29889,
18837,
4197,
13,
1678,
396,
268,
4852,
1689,
18785,
29889,
21053,
613,
376,
20897,
29889,
21053,
1159,
13,
1678,
396,
29871,
2314,
13,
1678,
396,
732,
348,
27958,
29889,
11014,
3644,
29898,
359,
29889,
21813,
29889,
657,
877,
4330,
3580,
29931,
1299,
2890,
29918,
9464,
1495,
1275,
376,
2080,
29879,
29914,
20943,
613,
376,
15797,
666,
373,
11400,
1159,
13,
1678,
396,
822,
1243,
29918,
28759,
2541,
6272,
29918,
29734,
29898,
1311,
29892,
4472,
29892,
3651,
1125,
13,
1678,
396,
268,
20092,
353,
11117,
25832,
27982,
2396,
525,
7938,
29945,
29953,
742,
525,
2382,
2396,
525,
12333,
10827,
13,
1678,
396,
268,
9066,
353,
11117,
3916,
29899,
1853,
2396,
525,
6214,
29914,
3126,
10827,
13,
1678,
396,
13,
1678,
396,
268,
2933,
353,
7274,
29889,
2490,
29898,
1311,
29889,
2974,
718,
285,
23901,
9482,
19248,
6886,
6822,
29912,
20897,
17671,
848,
29922,
3126,
29889,
29881,
17204,
29898,
23813,
511,
13,
1678,
396,
462,
795,
9066,
29922,
13662,
29897,
13,
1678,
396,
13,
1678,
396,
268,
1596,
29898,
15070,
29889,
15070,
29918,
497,
29898,
5327,
876,
13,
1678,
396,
268,
3573,
353,
343,
8807,
29889,
11177,
29918,
1359,
29898,
5327,
29889,
726,
29897,
13,
1678,
396,
268,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
1678,
396,
268,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
2587,
29889,
657,
703,
9916,
1159,
511,
29871,
29906,
29897,
13,
1678,
396,
268,
1583,
29889,
9294,
9843,
29898,
524,
29898,
2587,
29889,
657,
703,
3259,
1159,
511,
29871,
29941,
29897,
13,
13,
1678,
822,
1243,
29918,
657,
16519,
261,
1445,
29918,
29886,
29898,
1311,
1125,
13,
4706,
9066,
353,
426,
13,
9651,
525,
3916,
29899,
1853,
2396,
525,
6214,
29914,
3126,
742,
13,
9651,
525,
2283,
29899,
2605,
2396,
8207,
7070,
29914,
28988,
29915,
13,
4706,
500,
13,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
285,
23901,
1445,
613,
9066,
29922,
13662,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
25120,
1008,
29898,
2435,
29898,
5327,
29889,
726,
511,
29871,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
657,
16519,
261,
1445,
29918,
29876,
29898,
1311,
1125,
13,
4706,
9066,
353,
426,
13,
9651,
525,
3916,
29899,
1853,
2396,
525,
6214,
29914,
3126,
742,
13,
9651,
525,
2283,
29899,
2605,
2396,
8207,
7070,
29914,
29881,
11770,
29915,
13,
4706,
500,
13,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
285,
23901,
1445,
613,
9066,
29922,
13662,
29897,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
9066,
353,
2933,
29889,
13662,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29945,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
13,
462,
308,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
7194,
29918,
7724,
29918,
4519,
6227,
11499,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
7194,
29918,
7724,
29918,
4519,
6227,
11499,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
13662,
29889,
657,
877,
29990,
29899,
3089,
29899,
1367,
1495,
511,
29871,
29896,
29953,
29897,
13,
13,
1678,
822,
1243,
29918,
657,
16519,
261,
1445,
29918,
27259,
29918,
3207,
29918,
29876,
29898,
1311,
1125,
13,
4706,
4839,
29918,
1989,
353,
525,
2283,
29899,
2605,
29915,
13,
4706,
9066,
353,
11117,
3916,
29899,
1853,
2396,
525,
6214,
29914,
3126,
10827,
13,
13,
4706,
2933,
353,
7274,
29889,
2490,
29898,
1311,
29889,
2974,
718,
285,
23901,
1445,
613,
9066,
29922,
13662,
29897,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29945,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
13,
462,
308,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
10493,
29918,
23252,
1001,
29918,
12256,
29918,
8618,
13044,
3352,
29889,
1767,
29897,
1273,
4839,
29918,
1989,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
10493,
29918,
23252,
1001,
29918,
12256,
29918,
8618,
13044,
3352,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
822,
1243,
29918,
657,
6272,
29918,
29734,
29918,
29886,
29898,
1311,
1125,
13,
4706,
8829,
29918,
1707,
353,
376,
26865,
29903,
29918,
9464,
29908,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
285,
23901,
6272,
19248,
6272,
29918,
1707,
27195,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
8216,
8785,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
822,
1243,
29918,
657,
6272,
29918,
29734,
29918,
29876,
29898,
1311,
1125,
13,
4706,
8829,
29918,
1707,
353,
376,
284,
370,
284,
481,
441,
542,
2883,
29908,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
1311,
29889,
2974,
718,
285,
23901,
6272,
19248,
6272,
29918,
1707,
27195,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
5477,
6213,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
732,
15501,
1891,
29889,
18837,
4197,
13,
4706,
376,
741,
29908,
1445,
16203,
13218,
29914,
29881,
11770,
29914,
2917,
29889,
11330,
23370,
13218,
3051,
16203,
13218,
666,
29922,
29896,
29900,
29889,
29900,
29889,
29900,
29889,
29896,
1966,
29876,
3827,
29918,
3471,
29922,
29896,
29900,
29900,
1966,
29876,
28993,
29922,
29896,
29900,
1966,
593,
668,
29922,
700,
284,
5931,
5038,
13,
268,
2314,
13,
1678,
822,
1243,
29918,
9009,
1445,
29918,
29876,
29898,
1311,
29892,
20092,
1125,
13,
4706,
9066,
353,
11117,
3916,
29899,
1853,
2396,
525,
6214,
29914,
3126,
10827,
13,
4706,
9619,
7606,
29918,
6672,
29918,
1989,
353,
525,
2283,
29899,
2605,
29915,
13,
13,
4706,
2933,
353,
7274,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2974,
718,
285,
23901,
1445,
613,
13,
9651,
848,
29922,
23813,
29892,
9066,
29922,
13662,
29897,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1596,
29898,
15070,
29889,
15070,
29918,
497,
29898,
5327,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29945,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
13,
462,
308,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
10493,
29918,
23252,
1001,
29918,
12256,
29918,
8618,
13044,
3352,
29889,
1767,
29897,
1273,
9619,
7606,
29918,
6672,
29918,
1989,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
10493,
29918,
23252,
1001,
29918,
12256,
29918,
8618,
13044,
3352,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
732,
15501,
1891,
29889,
18837,
4197,
13,
4706,
5124,
13,
268,
2314,
13,
1678,
822,
1243,
29918,
9009,
1445,
29918,
29876,
29898,
1311,
29892,
20092,
1125,
13,
4706,
9066,
353,
426,
13,
9651,
525,
3916,
29899,
1853,
2396,
525,
6214,
29914,
3126,
742,
13,
9651,
525,
2283,
29899,
2605,
2396,
8207,
7050,
29914,
2917,
29889,
11330,
29915,
13,
4706,
500,
13,
13,
4706,
2933,
353,
7274,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2974,
718,
285,
23901,
1445,
613,
13,
9651,
848,
29922,
23813,
29892,
9066,
29922,
13662,
29897,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1596,
29898,
15070,
29889,
15070,
29918,
497,
29898,
5327,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29945,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
13,
462,
308,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
29923,
3580,
15631,
29918,
16244,
29918,
8456,
29928,
29979,
29918,
8618,
13044,
3352,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
29923,
3580,
15631,
29918,
16244,
29918,
8456,
29928,
29979,
29918,
8618,
13044,
3352,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
732,
15501,
1891,
29889,
18837,
4197,
13,
4706,
376,
741,
29908,
1445,
16203,
13218,
29914,
7050,
29914,
2917,
29889,
11330,
23370,
13218,
3051,
16203,
13218,
666,
29922,
29896,
29900,
29889,
29900,
29889,
29900,
29889,
29896,
1966,
29876,
3827,
29918,
3471,
29922,
29896,
29900,
29900,
1966,
29876,
28993,
29922,
29896,
29900,
1966,
593,
668,
29922,
700,
284,
5931,
5038,
13,
268,
2314,
13,
1678,
822,
1243,
29918,
9009,
1445,
29918,
29886,
29898,
1311,
29892,
20092,
1125,
13,
4706,
9066,
353,
426,
13,
9651,
525,
3916,
29899,
1853,
2396,
525,
6214,
29914,
3126,
742,
13,
9651,
525,
2283,
29899,
2605,
2396,
525,
2917,
29889,
11330,
29915,
13,
4706,
500,
13,
13,
4706,
2933,
353,
7274,
29889,
649,
29898,
13,
9651,
1583,
29889,
2974,
718,
285,
23901,
1445,
613,
13,
9651,
848,
29922,
23813,
29892,
9066,
29922,
13662,
29897,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1596,
29898,
15070,
29889,
15070,
29918,
497,
29898,
5327,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
13,
462,
308,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
822,
1243,
29918,
7978,
6519,
29918,
29876,
29898,
1311,
1125,
13,
4706,
1899,
353,
376,
370,
945,
328,
370,
336,
29908,
29871,
396,
451,
1985,
373,
10542,
13,
13,
4706,
2933,
353,
7274,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2974,
718,
285,
23901,
6519,
613,
13,
9651,
848,
29922,
6519,
29897,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1596,
29898,
15070,
29889,
15070,
29918,
497,
29898,
5327,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
13,
462,
308,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
401,
5477,
29871,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
449,
5477,
20569,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
3127,
5477,
20569,
13,
4706,
1583,
29889,
9294,
25120,
1008,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
5935,
5477,
29871,
29900,
29897,
13,
4706,
1583,
29889,
9294,
3624,
4998,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
5085,
5477,
1051,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
822,
1243,
29918,
7978,
6519,
29918,
29886,
29898,
1311,
1125,
13,
4706,
1899,
353,
376,
4117,
847,
7070,
29914,
28988,
29908,
13,
13,
4706,
2933,
353,
7274,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2974,
718,
285,
23901,
6519,
613,
13,
9651,
848,
29922,
6519,
29897,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1596,
29898,
15070,
29889,
15070,
29918,
497,
29898,
5327,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
13,
462,
308,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
401,
5477,
29871,
29900,
29897,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
449,
5477,
20569,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
3127,
5477,
20569,
13,
4706,
1583,
29889,
9294,
25120,
1008,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
5935,
5477,
29871,
29900,
29897,
13,
4706,
1583,
29889,
9294,
3624,
4998,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
877,
26381,
2824,
657,
29898,
6519,
467,
657,
877,
14144,
2824,
657,
877,
5085,
5477,
1051,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
822,
1243,
29918,
7978,
6519,
29918,
1758,
29918,
24622,
29918,
29886,
29898,
1311,
1125,
13,
4706,
1899,
353,
376,
1758,
448,
9600,
847,
7050,
29908,
13,
13,
4706,
2933,
353,
7274,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2974,
718,
285,
23901,
6519,
613,
13,
9651,
848,
29922,
6519,
29897,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1596,
29898,
15070,
29889,
15070,
29918,
497,
29898,
5327,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
13,
462,
308,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
3624,
4998,
29898,
2587,
29889,
657,
877,
8216,
5477,
9657,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
822,
1243,
29918,
20313,
29918,
3084,
29918,
598,
29918,
4258,
3860,
29898,
1311,
1125,
13,
4706,
1899,
353,
376,
1758,
448,
9600,
847,
7050,
29905,
29876,
3137,
448,
29880,
2273,
29908,
13,
4706,
8260,
353,
1899,
29889,
5451,
14182,
29876,
1159,
13,
13,
4706,
2933,
353,
7274,
29889,
2490,
29898,
13,
9651,
1583,
29889,
2974,
718,
285,
23901,
6519,
613,
13,
9651,
848,
29922,
6519,
29897,
13,
13,
4706,
3573,
353,
2933,
29889,
3126,
580,
13,
4706,
1596,
29898,
15070,
29889,
15070,
29918,
497,
29898,
5327,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
4906,
5477,
13,
462,
308,
4829,
3728,
29889,
10493,
29918,
16524,
29889,
657,
29898,
11713,
3399,
29889,
14605,
26925,
29889,
1767,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
703,
26381,
1159,
511,
29871,
29906,
29897,
29871,
396,
871,
29871,
29896,
9920,
338,
8283,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
8216,
2824,
657,
703,
26381,
2564,
657,
29898,
26381,
29961,
29896,
14664,
657,
877,
14144,
2824,
657,
877,
401,
5477,
29871,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
3259,
5477,
1583,
29889,
9684,
29918,
3259,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2587,
29889,
657,
877,
401,
5477,
29749,
3399,
29889,
14605,
26925,
29889,
1767,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
2587,
29889,
657,
877,
16394,
8785,
13,
13,
1678,
822,
1243,
29918,
7978,
6519,
29918,
15619,
29918,
3166,
29918,
4645,
29918,
29876,
29898,
1311,
1125,
13,
4706,
1899,
353,
376,
17059,
29871,
29906,
29900,
29908,
13,
13,
4706,
1018,
29901,
13,
9651,
7274,
29889,
2490,
29898,
1311,
29889,
2974,
718,
285,
23901,
6519,
613,
848,
29922,
6519,
29892,
11815,
29922,
29906,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1583,
29889,
9294,
3624,
4998,
29898,
29872,
29892,
7274,
29889,
11739,
29879,
29889,
6359,
10851,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
3_Retazce/3.44_SpajRetaz.py | ViktoriaGallikova/basic-python | 0 | 121574 | # Spajanie reťazcov
# Na vstupe získate dve frázy. Na výstup vypíšte výhovorku vygenerovanú z týchto fráz.
str1 = input() # umyť riad
str2 = input() # musím chytať Pokémony
print(f'Bohužiaľ nemôžem {str1}, pretože {str2}.')
# Bohužiaľ nemôžem umyť riad, pretože musím chytať Pokémony. | [
1,
396,
1706,
1175,
6067,
337,
30182,
834,
24542,
13,
13,
29937,
4465,
325,
303,
29884,
412,
503,
29983,
808,
403,
270,
345,
1424,
29976,
1537,
29889,
4465,
9660,
303,
786,
325,
1478,
29983,
30039,
371,
9660,
23294,
548,
29884,
10195,
4738,
10471,
30030,
503,
260,
5255,
517,
1424,
5058,
29889,
13,
13,
710,
29896,
353,
1881,
580,
396,
318,
1357,
30182,
10107,
328,
13,
710,
29906,
353,
1881,
580,
396,
2301,
5487,
521,
29891,
941,
30182,
21747,
2249,
2592,
13,
13,
2158,
29898,
29888,
29915,
29933,
1148,
25555,
423,
30377,
6583,
30069,
30044,
331,
426,
710,
29896,
1118,
758,
517,
11590,
426,
710,
29906,
1836,
1495,
13,
29937,
17966,
25555,
423,
30377,
6583,
30069,
30044,
331,
318,
1357,
30182,
10107,
328,
29892,
758,
517,
11590,
2301,
5487,
521,
29891,
941,
30182,
21747,
2249,
2592,
29889,
2
] |
Taller Control de estructuras 2/Ejercicio_2.py | Majito17/Trabajos-Majo | 0 | 120104 | <filename>Taller Control de estructuras 2/Ejercicio_2.py
"""
for i in range(1,101,2):
if(i%7==0):
continue
print(i)
"""
c=0
while c<=100:
if(c%2!=0 and c%7!=0):
print(c)
c=c+1 | [
1,
529,
9507,
29958,
29911,
12572,
11264,
316,
26530,
10939,
29871,
29906,
29914,
29923,
29926,
6269,
11088,
29918,
29906,
29889,
2272,
13,
15945,
29908,
13,
1454,
474,
297,
3464,
29898,
29896,
29892,
29896,
29900,
29896,
29892,
29906,
1125,
13,
1678,
565,
29898,
29875,
29995,
29955,
1360,
29900,
1125,
13,
4706,
6773,
13,
1678,
1596,
29898,
29875,
29897,
13,
15945,
29908,
13,
29883,
29922,
29900,
13,
8000,
274,
14065,
29896,
29900,
29900,
29901,
13,
1678,
565,
29898,
29883,
29995,
29906,
19216,
29900,
322,
274,
29995,
29955,
19216,
29900,
1125,
13,
4706,
1596,
29898,
29883,
29897,
13,
1678,
274,
29922,
29883,
29974,
29896,
2
] |
heat/common/environment_util.py | larsks/heat | 0 | 76738 | <reponame>larsks/heat<filename>heat/common/environment_util.py
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
ALLOWED_PARAM_MERGE_STRATEGIES = (OVERWRITE, MERGE, DEEP_MERGE) = (
'overwrite', 'merge', 'deep_merge')
def get_param_merge_strategy(merge_strategies, param_key):
if merge_strategies is None:
return OVERWRITE
env_default = merge_strategies.get('default', OVERWRITE)
merge_strategy = merge_strategies.get(param_key, env_default)
if merge_strategy in ALLOWED_PARAM_MERGE_STRATEGIES:
return merge_strategy
return env_default
| [
1,
529,
276,
1112,
420,
29958,
4675,
808,
29879,
29914,
354,
271,
29966,
9507,
29958,
354,
271,
29914,
9435,
29914,
20944,
29918,
4422,
29889,
2272,
13,
29937,
13,
29937,
1678,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
366,
1122,
13,
29937,
1678,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
887,
1122,
4017,
13,
29937,
1678,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
308,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
1678,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
1678,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
13,
29937,
1678,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
2823,
278,
13,
29937,
1678,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1678,
1090,
278,
19245,
29889,
13,
13,
1964,
27998,
3352,
29918,
16320,
5194,
29918,
29924,
1001,
1692,
29918,
10810,
3040,
29954,
29059,
353,
313,
29949,
5348,
16365,
29892,
341,
1001,
1692,
29892,
5012,
15488,
29918,
29924,
1001,
1692,
29897,
353,
313,
13,
1678,
525,
957,
3539,
742,
525,
14634,
742,
525,
24535,
29918,
14634,
1495,
13,
13,
13,
1753,
679,
29918,
3207,
29918,
14634,
29918,
710,
8963,
29898,
14634,
29918,
710,
1845,
583,
29892,
1828,
29918,
1989,
1125,
13,
13,
1678,
565,
10366,
29918,
710,
1845,
583,
338,
6213,
29901,
13,
4706,
736,
438,
5348,
16365,
13,
13,
1678,
8829,
29918,
4381,
353,
10366,
29918,
710,
1845,
583,
29889,
657,
877,
4381,
742,
438,
5348,
16365,
29897,
13,
13,
1678,
10366,
29918,
710,
8963,
353,
10366,
29918,
710,
1845,
583,
29889,
657,
29898,
3207,
29918,
1989,
29892,
8829,
29918,
4381,
29897,
13,
1678,
565,
10366,
29918,
710,
8963,
297,
15149,
9806,
3352,
29918,
16320,
5194,
29918,
29924,
1001,
1692,
29918,
10810,
3040,
29954,
29059,
29901,
13,
4706,
736,
10366,
29918,
710,
8963,
13,
13,
1678,
736,
8829,
29918,
4381,
13,
2
] |
models/edhoc/draftedhoc-20200301/oracle.py | hoheinzollern/EDHOC-Verification | 0 | 38670 | <filename>models/edhoc/draftedhoc-20200301/oracle.py<gh_stars>0
#!/usr/bin/python3
import sys, re
from functools import reduce
DEBUG = False
#DEBUG = True
# Put prios between 0 and 100. Above 100 is for default strategy
MAXNPRIO = 200 # max number of prios, 0 is lowest prio
FALLBACKPRIO = MAXNPRIO # max number of prios, 0 is lowest prio
prios = [(i, []) for i in range(MAXNPRIO + 1)]
def outputPrios(goalLines, lemma):
rankedGoals = [str(goal) + "\n" for prioList in prios for goal in prioList[1]]
print("".join(rankedGoals))
def dumpPrios(goalLines, lemma):
print("Prios:")
for pl in prios:
for p in pl[1]:
print(" > level:{}, goalNo:{}".format(pl[0], p))
def prioritize(goalNumber, prio, goalLine):
prios[prio][1].insert(0, goalNumber)
if DEBUG:
goal = re.sub("\s+", " ", goalLine)
print("goalNo:{} prio:{} goal:{}".format(goalNumber, prio, goal))
def genPrios(goalLines, lemma):
# Prioritize splitEqs over new instances
# splitEqs = False
# splitEqsLine = -1
# for i in range(len(goalLines)):
# if re.match(".*splitEqs.*", goalLines[i]):
# splitEqs = True
# splitEqsLine = i
for line in goalLines:
goal = line.split(':')[0]
if "sanity" in lemma:
if DEBUG:
print("MATCHING Sanity LEMMA: {}".format(lemma))
if re.match(".*SKRev.*", line) or\
re.match(".*Completed.*", line):
prioritize(goal, 90, line)
elif re.match(".*StR.*", line) or\
re.match(".*StI.*", line):
prioritize(goal, 80, line)
elif re.match(".*KU\( 'g'\^~xx \).*", line) or\
re.match(".*KU\( 'g'\^~yy \).*", line) or\
re.match(".*KU\( ~xx.*", line) or\
re.match(".*KU\( ~yy.*", line) or\
re.match(".*~~>.*", line) or\
re.match(".*=.*=.*", line):
prioritize(goal, 70, line)
elif re.match(".*LTK_.*", line):
prioritize(goal, 67, line)
elif re.match(".*aead.*", line):
prioritize(goal, 65, line)
elif re.match(".*KU\( sign.*", line) or\
re.match(".*KU\( extr.*", line) or\
re.match(".*KU\( expa.*", line):
prioritize(goal, 60, line)
elif re.match(".*KU\( h\(.*", line):
prioritize(goal, 55, line)
elif re.match(".*KU\( h\(.*", line):
prioritize(goal, 55, line)
else:
prioritize(goal, 50, line)
elif "authImplicit" in lemma: #"authGIYImplicitAuthGuarantee" in lemma: # Special for imp agree
if DEBUG:
print("MATCHING Auth LEMMA: {}".format(lemma))
if re.match(".*: !KU\( ~xx \).*", line) or\
re.match(".*: !KU\( ~yy \).*", line) or\
re.match(".*: !KU\( ~xx\.. \).*", line) or\
re.match(".*: !KU\( ~yy\.. \).*", line) or\
re.match(".*~~>.*", line) or\
re.match(".*: !KU\( 'g'\^~xx \).*", line) or\
re.match(".*: !KU\( 'g'\^~xx\.. \).*", line) or\
re.match(".*: !KU\( 'g'\^~yy \).*", line) or\
re.match(".*: !KU\( 'g'\^~yy\.. \).*", line) or\
re.match(".*: !KU\( ~ltk \).*", line) or\
re.match(".*: !KU\( ~ltk\.. \).*", line) or\
re.match(".*: !KU\( pk\(~ltk\) \).*", line) or\
re.match(".*: !KU\( 'g'\^~ltk \).*", line) or\
re.match(".*: !KU\( 'g'\^~ltk\.. \).*", line) or\
re.match(".*: !LTK_SIG\(.*", line) or\
re.match(".*: !LTK_STAT\(.*", line) or\
re.match(".*: !PK_SIG\(.*", line) or\
re.match(".*: !PK_STAT\(.*", line) or\
re.match(".*: StI._.*", line) or\
re.match(".*: StR._.*", line) or\
re.match(".*ExpRunning.*", line):
prioritize(goal, 97, line)
elif re.match(".*KU\( 'g'\^\(~yy.*\*~ltk.*", line) or\
re.match(".*KU\( 'g'\^\(~xx.*\*~ltk.*", line):
prioritize(goal, 93, line)
elif re.match(".*KU\( 'g'\^\(~xx.*\*~yy.*", line) or\
re.match(".*KU\( 'g'\^\(~yy.*\*~xx.*", line):
prioritize(goal, 90, line)
elif re.match(".*KU\( extr.*", line) or\
re.match(".*KU\( expa.*", line):
prioritize(goal, 80, line)
elif re.match(".*LTKRev.*", line) or\
re.match(".*sign.*", line) or\
re.match(".*aead.*", line):
prioritize(goal, 70, line)
elif re.match(".*KU\( h\(.*", line):
prioritize(goal, 60, line)
elif re.match(".*KU\( \(.V⊕.*", line):
prioritize(goal, 40, line)
else:
prioritize(goal, 50, line)
elif "auth" in lemma:
if DEBUG:
print("MATCHING Auth LEMMA: {}".format(lemma))
if re.match(".*KU\( ~ltk.*", line) or\
re.match(".*KU\( ~xx.*", line) or\
re.match(".*KU\( ~yy.*", line):
prioritize(goal, 98, line)
elif re.match(".*: !KU\( ~xx \).*", line) or\
re.match(".*: !KU\( ~yy \).*", line) or\
re.match(".*: !KU\( ~xx\.. \).*", line) or\
re.match(".*: !KU\( ~yy\.. \).*", line) or\
re.match(".*~~>.*", line) or\
re.match(".*: !KU\( 'g'\^~xx \).*", line) or\
re.match(".*: !KU\( 'g'\^~xx\.. \).*", line) or\
re.match(".*: !KU\( 'g'\^~yy \).*", line) or\
re.match(".*: !KU\( 'g'\^~yy\.. \).*", line) or\
re.match(".*: !KU\( ~ltk \).*", line) or\
re.match(".*: !KU\( ~ltk\.. \).*", line) or\
re.match(".*: !KU\( pk\(~ltk\) \).*", line) or\
re.match(".*: !KU\( 'g'\^~ltk \).*", line) or\
re.match(".*: !KU\( 'g'\^~ltk\.. \).*", line) or\
re.match(".*: !LTK_SIG\(.*", line) or\
re.match(".*: !LTK_STAT\(.*", line) or\
re.match(".*: !PK_SIG\(.*", line) or\
re.match(".*: !PK_STAT\(.*", line) or\
re.match(".*: StI._.*", line) or\
re.match(".*: StR._.*", line) or\
re.match(".*ExpRunning.*", line):
prioritize(goal, 90, line)
elif \
re.match(".*aead.*", line) or\
re.match(".*KU\( expa.*", line) or\
re.match(".*KU\( extr.*", line):
prioritize(goal, 87, line)
elif re.match(".*KU\( 'g'\^~ltk.*\).*", line) or\
re.match(".*KU\( 'g'\^\(~ltk.*\).*", line) or\
re.match(".*Helper.*", line) or\
re.match(".*~~>.*", line) or\
re.match(".*=.*=.*", line):
prioritize(goal, 85, line)
elif re.match(".*KU\( 'g'\^\(~yy.*\*~ltk.*", line) or\
re.match(".*KU\( 'g'\^\(~xx.*\*~ltk.*", line):
prioritize(goal, 80, line)
elif re.match(".*KU\( 'g'\^\(~xx.*\*~yy.*", line) or\
re.match(".*KU\( 'g'\^\(~yy.*\*~xx.*", line):
prioritize(goal, 75, line)
elif re.match(".*LTKRev.*", line) or\
re.match(".*sign.*", line) or\
re.match(".*splitEqs.*", line) or\
re.match(".*StI.*", line) or\
re.match(".*StR.*", line):
prioritize(goal, 70, line)
elif re.match(".*KU\( h\(.*", line):
prioritize(goal, 60, line)
elif re.match(".*KU\( \(.V⊕.*", line):
prioritize(goal, 40, line)
else:
prioritize(goal, 50, line)
elif "AEAD" in lemma:
if DEBUG:
print("MATCHING AEAD LEMMA: {}".format(lemma))
if re.match(".*: !KU\( ~xx \).*", line) or\
re.match(".*: !KU\( ~yy \).*", line) or\
re.match(".*: !KU\( ~xx\.. \).*", line) or\
re.match(".*: !KU\( ~yy\.. \).*", line) or\
re.match(".*: !KU\( ~ltk \).*", line) or\
re.match(".*: !KU\( ~ltk\.. \).*", line) or\
re.match(".*: !KU\( ~AD_3.*", line):
prioritize(goal, 90, line)
elif \
re.match(".*KU\( 'g'\^\(~xx\*~yy\).*", line) or\
re.match(".*KU\( 'g'\^\(~ltk\*~yy\).*", line) or\
re.match(".*KU\( 'g'\^\(~ltk\*~xx\).*", line):
prioritize(goal, 80, line)
elif \
re.match(".*: !KU\( *aead\(.*", line) or\
re.match(".*: !KU\( *expa.*", line):
re.match(".*: !KU\( *extr.*", line) or\
prioritize(goal, 70, line)
elif \
re.match(".*last.*", line) or\
re.match(".*: !KU\( pk\(~ltk\) \).*", line) or\
re.match(".*: !KU\( 'g'\^~ltk \).*", line) or\
re.match(".*: !KU\( 'g'\^~ltk\.. \).*", line) or\
re.match(".*: !LTK_SIG\(.*", line) or\
re.match(".*: !LTK_STAT\(.*", line) or\
re.match(".*: !PK_SIG\(.*", line) or\
re.match(".*: !PK_STAT\(.*", line) or\
re.match(".*: St.*", line):
prioritize(goal, 60, line)
else:
prioritize(goal, 50, line)
elif "secrecy" in lemma:
if DEBUG:
print("MATCHING Secrecy LEMMA: {}".format(lemma))
if re.match(".*KU\( ~ltk.*", line) or\
re.match(".*KU\( 'g'\^\(~ltk\*.*\).*", line):
prioritize(goal, 97, line)
elif re.match(".*KU\( ~xx.*", line) or\
re.match(".*KU\( ~yy.*", line) or\
re.match(".*Helper.*", line) or\
re.match(".*~~>.*", line) or\
re.match(".*=.*=.*", line):
prioritize(goal, 95, line)
elif re.match(".*KU\( 'g'\^\(~xx\*~yy\).*", line) or\
re.match(".*KU\( 'g'\^\(~yy\*~xx\).*", line):
prioritize(goal, 90, line)
elif \
re.match(".*KU\( expa.*", line) or\
re.match(".*KU\( extr.*", line):
prioritize(goal, 80, line)
elif re.match(".*LTKRev.*", line) or\
re.match(".*sign.*", line) or\
re.match(".*StI.*", line) or\
re.match(".*StR.*", line) or\
re.match(".*aead.*", line):
prioritize(goal, 70, line)
elif re.match(".*KU\( h\(.*", line):
prioritize(goal, 60, line)
elif re.match(".*KU\( \(.V⊕.*", line):
prioritize(goal, 40, line)
else:
prioritize(goal, 50, line)
else:
if DEBUG:
print("NO MATCH FOR LEMMA: {}".format(lemma))
exit(0)
def echoOracle(goalLines, lemma):
for line in goalLines:
goal = line.split(':')[0]
prioritize(goal, 0, line)
def testMatch(pattern, tamarinString):
if re.match(pattern, tamarinString):
print("Matches!")
else:
print("Don't match!")
if __name__ == "__main__":
if sys.argv[1] == "testMatch":
if len(sys.argv) != 4:
print("usage: oracle.py testMatch pattern tamarinString")
sys.exit(1)
testMatch(sys.argv[2], sys.argv[3])
sys.exit(0)
goalLines = sys.stdin.readlines()
lemma = sys.argv[1]
genPrios(goalLines, lemma)
#echoOracle(goalLines, lemma)
# We want 0 to be lowest prio, so reverse all level-lists and the list itself
prios = [(p[0], p[1][::-1]) for p in prios][::-1]
outputPrios(goalLines, lemma)
#dumpPrios(goalLines, lemma)
| [
1,
529,
9507,
29958,
9794,
29914,
287,
29882,
542,
29914,
29881,
4154,
287,
29882,
542,
29899,
29906,
29900,
29906,
29900,
29900,
29941,
29900,
29896,
29914,
11347,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
29941,
13,
5215,
10876,
29892,
337,
13,
3166,
2090,
312,
8789,
1053,
10032,
13,
13,
18525,
353,
7700,
13,
29937,
18525,
353,
5852,
13,
13,
29937,
12065,
3691,
359,
1546,
29871,
29900,
322,
29871,
29896,
29900,
29900,
29889,
319,
29205,
29871,
29896,
29900,
29900,
338,
363,
2322,
13705,
13,
12648,
25500,
3960,
29949,
353,
29871,
29906,
29900,
29900,
1678,
396,
4236,
1353,
310,
3691,
359,
29892,
29871,
29900,
338,
19604,
3691,
29877,
13,
29943,
9818,
29933,
11375,
29829,
29949,
353,
18134,
25500,
3960,
29949,
1678,
396,
4236,
1353,
310,
3691,
359,
29892,
29871,
29900,
338,
19604,
3691,
29877,
13,
29886,
13095,
353,
17288,
29875,
29892,
518,
2314,
363,
474,
297,
3464,
29898,
12648,
25500,
3960,
29949,
718,
29871,
29896,
4638,
13,
13,
13,
1753,
1962,
29925,
13095,
29898,
28111,
20261,
29892,
10383,
1125,
13,
1678,
26642,
8120,
1338,
353,
518,
710,
29898,
28111,
29897,
718,
6634,
29876,
29908,
363,
3691,
29877,
1293,
297,
3691,
359,
363,
7306,
297,
3691,
29877,
1293,
29961,
29896,
5262,
13,
1678,
1596,
703,
1642,
7122,
29898,
10003,
287,
8120,
1338,
876,
13,
13,
13,
1753,
16766,
29925,
13095,
29898,
28111,
20261,
29892,
10383,
1125,
13,
1678,
1596,
703,
29925,
13095,
29901,
1159,
13,
1678,
363,
715,
297,
3691,
359,
29901,
13,
4706,
363,
282,
297,
715,
29961,
29896,
5387,
13,
9651,
1596,
703,
1678,
1405,
3233,
26254,
1118,
7306,
3782,
29901,
8875,
1642,
4830,
29898,
572,
29961,
29900,
1402,
282,
876,
13,
13,
13,
1753,
7536,
277,
675,
29898,
28111,
4557,
29892,
3691,
29877,
29892,
7306,
3542,
1125,
13,
1678,
3691,
359,
29961,
29886,
5378,
3816,
29896,
1822,
7851,
29898,
29900,
29892,
7306,
4557,
29897,
13,
1678,
565,
21681,
29901,
13,
4706,
7306,
353,
337,
29889,
1491,
14182,
29879,
29974,
613,
376,
9162,
7306,
3542,
29897,
13,
4706,
1596,
703,
28111,
3782,
29901,
8875,
3691,
29877,
29901,
8875,
7306,
29901,
8875,
1642,
4830,
29898,
28111,
4557,
29892,
3691,
29877,
29892,
7306,
876,
13,
13,
13,
1753,
2531,
29925,
13095,
29898,
28111,
20261,
29892,
10383,
1125,
13,
1678,
396,
22096,
277,
675,
6219,
18630,
29879,
975,
716,
8871,
13,
1678,
396,
6219,
18630,
29879,
353,
7700,
13,
1678,
396,
6219,
18630,
29879,
3542,
353,
448,
29896,
13,
1678,
396,
363,
474,
297,
3464,
29898,
2435,
29898,
28111,
20261,
22164,
13,
1678,
396,
268,
565,
337,
29889,
4352,
703,
5575,
5451,
18630,
29879,
5575,
613,
7306,
20261,
29961,
29875,
29962,
1125,
13,
1678,
396,
308,
6219,
18630,
29879,
353,
5852,
13,
1678,
396,
308,
6219,
18630,
29879,
3542,
353,
474,
13,
13,
1678,
363,
1196,
297,
7306,
20261,
29901,
13,
4706,
7306,
353,
1196,
29889,
5451,
877,
29901,
29861,
29900,
29962,
13,
4706,
565,
376,
28455,
537,
29908,
297,
10383,
29901,
13,
9651,
565,
21681,
29901,
13,
18884,
1596,
703,
29924,
14789,
4214,
3087,
537,
11060,
29924,
1529,
29901,
6571,
1642,
4830,
29898,
13846,
876,
13,
9651,
565,
337,
29889,
4352,
703,
5575,
16033,
1123,
29894,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
26010,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
855,
29934,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
855,
29902,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29947,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
4419,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
8071,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
3695,
4419,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
3695,
8071,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
7377,
29958,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
29922,
5575,
29922,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29955,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
5850,
29968,
5396,
29930,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29953,
29955,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29874,
1479,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29953,
29945,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
1804,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
17541,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
1518,
29874,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29953,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
298,
29905,
28104,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29945,
29945,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
298,
29905,
28104,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29945,
29945,
29892,
1196,
29897,
13,
9651,
1683,
29901,
13,
18884,
7536,
277,
675,
29898,
28111,
29892,
29871,
29945,
29900,
29892,
1196,
29897,
13,
4706,
25342,
376,
5150,
24192,
4019,
29908,
297,
10383,
29901,
396,
29908,
5150,
29954,
29902,
29979,
24192,
4019,
6444,
9485,
9519,
29872,
29908,
297,
10383,
29901,
259,
396,
12630,
363,
2411,
8661,
13,
9651,
565,
21681,
29901,
13,
18884,
1596,
703,
29924,
14789,
4214,
13189,
11060,
29924,
1529,
29901,
6571,
1642,
4830,
29898,
13846,
876,
13,
9651,
565,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
4419,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
8071,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
4419,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
8071,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
7377,
29958,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
4419,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
4419,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
8071,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
8071,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
1896,
29895,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
1896,
29895,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
282,
29895,
29905,
29898,
30022,
1896,
29895,
7244,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
1896,
29895,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
1896,
29895,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
5850,
29968,
29918,
5425,
29954,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
5850,
29968,
29918,
17816,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
21738,
29918,
5425,
29954,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
21738,
29918,
17816,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
624,
29902,
3032,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
624,
29934,
3032,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
9544,
27795,
5575,
613,
1196,
1125,
13,
462,
418,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29955,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
8071,
5575,
29905,
29930,
30022,
1896,
29895,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
4419,
5575,
29905,
29930,
30022,
1896,
29895,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29941,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
4419,
5575,
29905,
29930,
30022,
8071,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
8071,
5575,
29905,
29930,
30022,
4419,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
17541,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
1518,
29874,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29947,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
5850,
29968,
1123,
29894,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
4530,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29874,
1479,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29955,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
298,
29905,
28104,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29953,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
4269,
29889,
29963,
31200,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29946,
29900,
29892,
1196,
29897,
13,
9651,
1683,
29901,
13,
462,
7536,
277,
675,
29898,
28111,
29892,
29871,
29945,
29900,
29892,
1196,
29897,
13,
4706,
25342,
376,
5150,
29908,
297,
10383,
29901,
13,
9651,
565,
21681,
29901,
13,
18884,
1596,
703,
29924,
14789,
4214,
13189,
11060,
29924,
1529,
29901,
6571,
1642,
4830,
29898,
13846,
876,
13,
9651,
565,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
3695,
1896,
29895,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
3695,
4419,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
3695,
8071,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29947,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
4419,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
8071,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
4419,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
8071,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
7377,
29958,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
4419,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
4419,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
8071,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
8071,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
1896,
29895,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
1896,
29895,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
282,
29895,
29905,
29898,
30022,
1896,
29895,
7244,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
1896,
29895,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
1896,
29895,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
5850,
29968,
29918,
5425,
29954,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
5850,
29968,
29918,
17816,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
21738,
29918,
5425,
29954,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
21738,
29918,
17816,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
624,
29902,
3032,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
624,
29934,
3032,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
9544,
27795,
5575,
613,
1196,
1125,
13,
462,
418,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29900,
29892,
1196,
29897,
13,
9651,
25342,
320,
13,
462,
337,
29889,
4352,
703,
5575,
29874,
1479,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
1518,
29874,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
17541,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29947,
29955,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
1896,
29895,
5575,
29800,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
1896,
29895,
5575,
29800,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
10739,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
7377,
29958,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29922,
5575,
29922,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29947,
29945,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
8071,
5575,
29905,
29930,
30022,
1896,
29895,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
4419,
5575,
29905,
29930,
30022,
1896,
29895,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29947,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
4419,
5575,
29905,
29930,
30022,
8071,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
8071,
5575,
29905,
29930,
30022,
4419,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29955,
29945,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
5850,
29968,
1123,
29894,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
4530,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
5451,
18630,
29879,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
855,
29902,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
855,
29934,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29955,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
298,
29905,
28104,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29953,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
4269,
29889,
29963,
31200,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29946,
29900,
29892,
1196,
29897,
13,
9651,
1683,
29901,
13,
462,
7536,
277,
675,
29898,
28111,
29892,
29871,
29945,
29900,
29892,
1196,
29897,
13,
4706,
25342,
376,
16036,
3035,
29908,
297,
10383,
29901,
13,
9651,
565,
21681,
29901,
13,
18884,
1596,
703,
29924,
14789,
4214,
319,
29923,
3035,
11060,
29924,
1529,
29901,
6571,
1642,
4830,
29898,
13846,
876,
13,
9651,
565,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
4419,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
18884,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
8071,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
18884,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
4419,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
18884,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
8071,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
18884,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
1896,
29895,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
18884,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
1896,
29895,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
18884,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
3695,
3035,
29918,
29941,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29900,
29892,
1196,
29897,
13,
9651,
25342,
320,
13,
18884,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
4419,
29905,
29930,
30022,
8071,
29800,
29930,
613,
1196,
29897,
470,
29905,
13,
18884,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
1896,
29895,
29905,
29930,
30022,
8071,
29800,
29930,
613,
1196,
29897,
470,
29905,
13,
18884,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
1896,
29895,
29905,
29930,
30022,
4419,
29800,
29930,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29947,
29900,
29892,
1196,
29897,
13,
9651,
25342,
320,
13,
18884,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
334,
29874,
1479,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
18884,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
334,
735,
3274,
5575,
613,
1196,
1125,
13,
18884,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
334,
1062,
29878,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29955,
29900,
29892,
1196,
29897,
13,
9651,
25342,
320,
13,
462,
337,
29889,
4352,
703,
5575,
4230,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
282,
29895,
29905,
29898,
30022,
1896,
29895,
7244,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
1896,
29895,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
29968,
29965,
29905,
29898,
525,
29887,
12764,
29985,
30022,
1896,
29895,
29905,
636,
320,
467,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
5850,
29968,
29918,
5425,
29954,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
5850,
29968,
29918,
17816,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
21738,
29918,
5425,
29954,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
1738,
21738,
29918,
17816,
29905,
28104,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29901,
624,
5575,
613,
1196,
1125,
13,
462,
418,
7536,
277,
675,
29898,
28111,
29892,
29871,
29953,
29900,
29892,
1196,
29897,
13,
9651,
1683,
29901,
13,
18884,
7536,
277,
675,
29898,
28111,
29892,
29871,
29945,
29900,
29892,
1196,
29897,
13,
4706,
25342,
376,
344,
1037,
1270,
29908,
297,
10383,
29901,
13,
9651,
565,
21681,
29901,
13,
1669,
1596,
703,
29924,
14789,
4214,
5356,
276,
1270,
11060,
29924,
1529,
29901,
6571,
1642,
4830,
29898,
13846,
876,
13,
9651,
565,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
3695,
1896,
29895,
5575,
613,
1196,
29897,
470,
29905,
13,
1669,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
1896,
29895,
29905,
29930,
5575,
29800,
29930,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29955,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
3695,
4419,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
3695,
8071,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
10739,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
7377,
29958,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29922,
5575,
29922,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29945,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
4419,
29905,
29930,
30022,
8071,
29800,
29930,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
525,
29887,
12764,
3823,
29898,
30022,
8071,
29905,
29930,
30022,
4419,
29800,
29930,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29929,
29900,
29892,
1196,
29897,
13,
9651,
25342,
320,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
1518,
29874,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
17541,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29947,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
5850,
29968,
1123,
29894,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
4530,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
855,
29902,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
855,
29934,
5575,
613,
1196,
29897,
470,
29905,
13,
462,
337,
29889,
4352,
703,
5575,
29874,
1479,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29955,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
298,
29905,
28104,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29953,
29900,
29892,
1196,
29897,
13,
9651,
25342,
337,
29889,
4352,
703,
5575,
29968,
29965,
29905,
29898,
4269,
29889,
29963,
31200,
5575,
613,
1196,
1125,
13,
462,
1678,
7536,
277,
675,
29898,
28111,
29892,
29871,
29946,
29900,
29892,
1196,
29897,
13,
9651,
1683,
29901,
13,
462,
7536,
277,
675,
29898,
28111,
29892,
29871,
29945,
29900,
29892,
1196,
29897,
13,
4706,
1683,
29901,
13,
9651,
565,
21681,
29901,
13,
18884,
1596,
703,
6632,
341,
14789,
15842,
11060,
29924,
1529,
29901,
6571,
1642,
4830,
29898,
13846,
876,
13,
9651,
6876,
29898,
29900,
29897,
13,
13,
13,
1753,
2916,
29949,
10792,
29898,
28111,
20261,
29892,
10383,
1125,
13,
1678,
363,
1196,
297,
7306,
20261,
29901,
13,
4706,
7306,
353,
1196,
29889,
5451,
877,
29901,
29861,
29900,
29962,
13,
4706,
7536,
277,
675,
29898,
28111,
29892,
29871,
29900,
29892,
1196,
29897,
13,
13,
1753,
1243,
9652,
29898,
11037,
29892,
260,
18257,
1231,
1125,
13,
1678,
565,
337,
29889,
4352,
29898,
11037,
29892,
260,
18257,
1231,
1125,
13,
4706,
1596,
703,
9652,
267,
29991,
1159,
13,
1678,
1683,
29901,
13,
4706,
1596,
703,
10310,
29915,
29873,
1993,
29991,
1159,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
565,
10876,
29889,
19218,
29961,
29896,
29962,
1275,
376,
1688,
9652,
1115,
13,
4706,
565,
7431,
29898,
9675,
29889,
19218,
29897,
2804,
29871,
29946,
29901,
13,
9651,
1596,
703,
21125,
29901,
17919,
29889,
2272,
1243,
9652,
4766,
260,
18257,
1231,
1159,
13,
9651,
10876,
29889,
13322,
29898,
29896,
29897,
13,
4706,
1243,
9652,
29898,
9675,
29889,
19218,
29961,
29906,
1402,
10876,
29889,
19218,
29961,
29941,
2314,
13,
4706,
10876,
29889,
13322,
29898,
29900,
29897,
13,
13,
1678,
7306,
20261,
353,
10876,
29889,
4172,
262,
29889,
949,
9012,
580,
13,
1678,
10383,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
13,
1678,
2531,
29925,
13095,
29898,
28111,
20261,
29892,
10383,
29897,
13,
1678,
396,
8057,
29949,
10792,
29898,
28111,
20261,
29892,
10383,
29897,
13,
13,
1678,
396,
1334,
864,
29871,
29900,
304,
367,
19604,
3691,
29877,
29892,
577,
11837,
599,
3233,
29899,
21513,
322,
278,
1051,
3528,
13,
1678,
3691,
359,
353,
17288,
29886,
29961,
29900,
1402,
282,
29961,
29896,
3816,
1057,
29899,
29896,
2314,
363,
282,
297,
3691,
359,
3816,
1057,
29899,
29896,
29962,
13,
13,
1678,
1962,
29925,
13095,
29898,
28111,
20261,
29892,
10383,
29897,
13,
1678,
396,
15070,
29925,
13095,
29898,
28111,
20261,
29892,
10383,
29897,
13,
13,
13,
13,
2
] |
drawM.py | bshrram/Graduation-Project---Omnidirectional-Conveyor-Table | 1 | 174767 | <filename>drawM.py
import time
import sys
sys.path.insert(1, './feedback_system')
sys.path.insert(2, './control_system')
from common import *
from data.cellDatabase import *
from table import Table
from feedback_system.findTable import *
from feedback_system.tracker import Tracker
from feedback_system.detector import Detector
from PID.pid_controller import PIDController
import numpy as np
import cv2 as cv
import argparse
import imutils
parser = argparse.ArgumentParser()
parser.add_argument('--input', type=str,
help='Path to a video or a sequence of image.', default='data/videos/9.mp4')
parser.add_argument('--algo', type=str,
help='Background subtraction method (KNN, MOG2, COLOR).', default='COLOR')
parser.add_argument('--train', type=str,
help='Path to a video or a sequence of image.', default='data/videos/2.mp4')
args = parser.parse_args()
if args.algo == 'MOG2':
detector = Detector(type="MOG2")
elif args.algo == 'KNN':
detector = Detector(type="KNN")
elif args.algo == 'COLOR':
lower_blue = np.array([105, 50, 50])
upper_blue = np.array([130, 255, 255])
detector = Detector(type="COLOR", color=(lower_blue, upper_blue))
tracker = Tracker(160, 30, 10, 100)
track_colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0),
(0, 255, 255), (255, 0, 255), (255, 127, 255),
(127, 0, 255), (127, 0, 127)]
#capture = cv.VideoCapture(cv.samples.findFileOrKeep(args.input))
capture = cv.VideoCapture('http://192.168.43.1:8080/video')
if not capture.isOpened:
print('Unable to open: ' + args.input)
exit(0)
frames = 0
inf = 999999991
corners = [[0, 0], [inf, 0], [inf, inf], [0, inf]]
myTable = Table(cellDatabase)
y0 = 163.75
x0 = 165.8
dy = 157.5
dx = 90.93 * 2
rng = 10
# draw M with real MM locations
loc = myTable.getCellByLocation([2,0]).coordinates
locations = [[x0 + dx/2 + rng, y0 + 3*dy - rng], [x0+rng, y0+rng], [x0+2 *
dx, y0 + 1.5*dy], [x0+4*dx - rng, y0+rng], [x0 + 4.5*dx-rng, y0+3*dy-rng]]
endCells = list(map(myTable.getCellByLocation, locations))
index = 0
rot = False
count = 0
xp, yp = (0, 0) # xpast, ypast
b = 0 # boolean to move or rotate
dir = 1 # direction of rotate
while True:
keyboard = cv.waitKey(1)
if keyboard == 'q' or keyboard == 27:
for i in range(20):
comCells = myTable.getCommonCells(myTable.cells[i])
myTable.cells[i].stop(comCells)
time.sleep(.2)
break
ret, frame = capture.read()
if frame is None:
break
# frame = cv.resize(frame, (640, 360))
#frame = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
frames = frames + 1
if frames < 50:
corners1 = getCorners(frame)
corners[0][0] = max(corners[0][0], corners1[0][0])
corners[0][1] = max(corners[0][1], corners1[0][1])
corners[1][0] = min(corners[1][0], corners1[1][0])
corners[1][1] = max(corners[1][1], corners1[1][1])
corners[2][0] = min(corners[2][0], corners1[2][0])
corners[2][1] = min(corners[2][1], corners1[2][1])
corners[3][0] = max(corners[3][0], corners1[3][0])
corners[3][1] = min(corners[3][1], corners1[3][1])
# print(corners1)
continue
if frames < 100:
continue
corners = np.float32(corners)
frame = getTableFromFrame(corners, frame)
(centers, angles) = detector.Detect(frame)
h1, w1 = frame.shape[:2]
if len(centers) == 0:
continue
centersMM = pixelToMm((float(centers[0][0]), float(centers[0][1])), w1, h1)
angle = angles[0][0]
runningCells = myTable.getCellsByNearLocation(centersMM, 4)
if calculateDistance(centersMM, locations[index]) < 100:
# rot = True
index = (index+1) % len(locations)
# else:
# rot = False
if (rot):
endAngle = myTable.getAngle(
endCells[index].coordinates, endCells[(index+1) % len(locations)].coordinates)
angle += 90
angle %= 180
endAngle %= 180
w = endAngle - angle
print(angle, endAngle)
# print (w)
# print(f"rotating {endCells[index].location}")
if (abs(w) < 10):
index = (index+1) % len(locations)
rot = False
continue
w = 70
myTable.move(endCells[index], 0, 0, w)
[x, y] = endCells[index].location
dx = [-1, 1, 0]
if x % 2 == 1:
dy = [0, 0, 1]
else:
dy = [-1, -1, 1]
rotatingCells = []
for i in range(len(dx)):
cell = myTable.getCellByLocation([x + dx[i], y + dy[i]])
if cell is not None:
rotatingCells.append(cell)
for i in range(len(rotatingCells)):
if rotatingCells[i].id == endCells[index].id:
continue
myTable.move(rotatingCells[i], 0, 0, -w)
if (not rot):
if (b):
# rotate to fix hanging in location
print(f'count: {count}')
w = 140 * dir
for i in range(len(runningCells)):
myTable.move(runningCells[i], 0, 0, w)
count -= 1
if count == 0:
b = 0
continue
else:
print("move")
myTable.goToLocation(locations[index], runningCells)
# subtract cur pos of past pos
xcur = centers[0][0]
ycur = centers[0][1]
dis = calculateDistance((xcur, ycur), (xp, yp))
xp = xcur
yp = ycur
if (dis < 6):
count += 1
if count >= 10:
count *= 2.5
b = 1
dir *= -1
else:
count = 0
# if (len(centers) > 0):
# tracker.Update(centers)
# for i in range(len(tracker.tracks)):
# if (len(tracker.tracks[i].trace) > 1):
# for j in range(len(tracker.tracks[i].trace)-1):
# # Draw trace line
# x1 = tracker.tracks[i].trace[j][0][0]
# y1 = tracker.tracks[i].trace[j][1][0]
# x2 = tracker.tracks[i].trace[j+1][0][0]
# y2 = tracker.tracks[i].trace[j+1][1][0]
# clr = tracker.tracks[i].track_id % 9
# cv.line(frame, (int(x1), int(y1)), (int(x2), int(y2)),
# track_colors[clr], 2)
# l = len(tracker.tracks[i].trace)
# if (l > 1):
# xcur = tracker.tracks[0].trace[l-1][0][0]
# ycur = tracker.tracks[0].trace[l-1][1][0]
# xp = tracker.tracks[0].trace[l-2][0][0]
# yp = tracker.tracks[0].trace[l-2][1][0]
# dis = calculateDistance((xcur, ycur), (xp, yp))
# if (ref < 10):
# count+=1
# else:
# count = 0
# # Display the resulting tracking frame
cv.imshow('Tracking', frame)
| [
1,
529,
9507,
29958,
4012,
29924,
29889,
2272,
13,
5215,
931,
13,
5215,
10876,
13,
9675,
29889,
2084,
29889,
7851,
29898,
29896,
29892,
19283,
18798,
1627,
29918,
5205,
1495,
13,
9675,
29889,
2084,
29889,
7851,
29898,
29906,
29892,
19283,
6451,
29918,
5205,
1495,
13,
3166,
3619,
1053,
334,
13,
3166,
848,
29889,
3729,
9112,
1053,
334,
13,
3166,
1591,
1053,
6137,
13,
3166,
16705,
29918,
5205,
29889,
2886,
3562,
1053,
334,
13,
3166,
16705,
29918,
5205,
29889,
3018,
4937,
1053,
3201,
4937,
13,
3166,
16705,
29918,
5205,
29889,
4801,
3019,
1053,
5953,
3019,
13,
3166,
349,
1367,
29889,
5935,
29918,
8299,
1053,
349,
1367,
2956,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
408,
13850,
13,
5215,
1852,
5510,
13,
5215,
527,
13239,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
2080,
742,
1134,
29922,
710,
29892,
13,
462,
1678,
1371,
2433,
2605,
304,
263,
4863,
470,
263,
5665,
310,
1967,
29889,
742,
2322,
2433,
1272,
29914,
29894,
7958,
29914,
29929,
29889,
1526,
29946,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
284,
1484,
742,
1134,
29922,
710,
29892,
13,
462,
1678,
1371,
2433,
10581,
1014,
3018,
428,
1158,
313,
29968,
10262,
29892,
16999,
29954,
29906,
29892,
23958,
1955,
467,
742,
2322,
2433,
15032,
1955,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
14968,
742,
1134,
29922,
710,
29892,
13,
462,
1678,
1371,
2433,
2605,
304,
263,
4863,
470,
263,
5665,
310,
1967,
29889,
742,
2322,
2433,
1272,
29914,
29894,
7958,
29914,
29906,
29889,
1526,
29946,
1495,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
361,
6389,
29889,
284,
1484,
1275,
525,
6720,
29954,
29906,
2396,
13,
1678,
1439,
3019,
353,
5953,
3019,
29898,
1853,
543,
6720,
29954,
29906,
1159,
13,
23681,
6389,
29889,
284,
1484,
1275,
525,
29968,
10262,
2396,
13,
1678,
1439,
3019,
353,
5953,
3019,
29898,
1853,
543,
29968,
10262,
1159,
13,
23681,
6389,
29889,
284,
1484,
1275,
525,
15032,
1955,
2396,
13,
1678,
5224,
29918,
9539,
353,
7442,
29889,
2378,
4197,
29896,
29900,
29945,
29892,
29871,
29945,
29900,
29892,
29871,
29945,
29900,
2314,
13,
1678,
7568,
29918,
9539,
353,
7442,
29889,
2378,
4197,
29896,
29941,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
2314,
13,
1678,
1439,
3019,
353,
5953,
3019,
29898,
1853,
543,
15032,
1955,
613,
2927,
7607,
13609,
29918,
9539,
29892,
7568,
29918,
9539,
876,
13,
13,
3018,
4937,
353,
3201,
4937,
29898,
29896,
29953,
29900,
29892,
29871,
29941,
29900,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29900,
29897,
13,
11294,
29918,
27703,
353,
17288,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
511,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29900,
511,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29906,
29945,
29945,
511,
313,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29900,
511,
13,
18884,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
511,
313,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29906,
29945,
29945,
511,
313,
29906,
29945,
29945,
29892,
29871,
29896,
29906,
29955,
29892,
29871,
29906,
29945,
29945,
511,
13,
18884,
313,
29896,
29906,
29955,
29892,
29871,
29900,
29892,
29871,
29906,
29945,
29945,
511,
313,
29896,
29906,
29955,
29892,
29871,
29900,
29892,
29871,
29896,
29906,
29955,
4638,
13,
13,
29937,
17885,
545,
353,
13850,
29889,
15167,
21133,
545,
29898,
11023,
29889,
27736,
29889,
2886,
2283,
2816,
9598,
1022,
29898,
5085,
29889,
2080,
876,
13,
17885,
545,
353,
13850,
29889,
15167,
21133,
545,
877,
1124,
597,
29896,
29929,
29906,
29889,
29896,
29953,
29947,
29889,
29946,
29941,
29889,
29896,
29901,
29947,
29900,
29947,
29900,
29914,
9641,
1495,
13,
361,
451,
10446,
29889,
275,
6585,
287,
29901,
13,
1678,
1596,
877,
2525,
519,
304,
1722,
29901,
525,
718,
6389,
29889,
2080,
29897,
13,
1678,
6876,
29898,
29900,
29897,
13,
13,
19935,
353,
29871,
29900,
13,
7192,
353,
29871,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29896,
13,
29883,
1398,
414,
353,
5519,
29900,
29892,
29871,
29900,
1402,
518,
7192,
29892,
29871,
29900,
1402,
518,
7192,
29892,
3041,
1402,
518,
29900,
29892,
3041,
5262,
13,
1357,
3562,
353,
6137,
29898,
3729,
9112,
29897,
13,
13,
29891,
29900,
353,
29871,
29896,
29953,
29941,
29889,
29955,
29945,
13,
29916,
29900,
353,
29871,
29896,
29953,
29945,
29889,
29947,
13,
4518,
353,
29871,
29896,
29945,
29955,
29889,
29945,
13,
8235,
353,
29871,
29929,
29900,
29889,
29929,
29941,
334,
29871,
29906,
13,
13,
29878,
865,
353,
29871,
29896,
29900,
13,
29937,
4216,
341,
411,
1855,
28880,
14354,
13,
2029,
353,
590,
3562,
29889,
657,
4617,
2059,
6508,
4197,
29906,
29892,
29900,
14664,
1111,
24266,
13,
2029,
800,
353,
5519,
29916,
29900,
718,
15414,
29914,
29906,
718,
364,
865,
29892,
343,
29900,
718,
29871,
29941,
29930,
4518,
448,
364,
865,
1402,
518,
29916,
29900,
29974,
29878,
865,
29892,
343,
29900,
29974,
29878,
865,
1402,
518,
29916,
29900,
29974,
29906,
334,
13,
462,
462,
462,
462,
1678,
15414,
29892,
343,
29900,
718,
29871,
29896,
29889,
29945,
29930,
4518,
1402,
518,
29916,
29900,
29974,
29946,
29930,
8235,
448,
364,
865,
29892,
343,
29900,
29974,
29878,
865,
1402,
518,
29916,
29900,
718,
29871,
29946,
29889,
29945,
29930,
8235,
29899,
29878,
865,
29892,
343,
29900,
29974,
29941,
29930,
4518,
29899,
29878,
865,
5262,
13,
13,
13,
355,
13418,
353,
1051,
29898,
1958,
29898,
1357,
3562,
29889,
657,
4617,
2059,
6508,
29892,
14354,
876,
13,
2248,
353,
29871,
29900,
13,
5450,
353,
7700,
13,
13,
2798,
353,
29871,
29900,
13,
26330,
29892,
343,
29886,
353,
313,
29900,
29892,
29871,
29900,
29897,
396,
921,
29886,
579,
29892,
343,
29886,
579,
13,
29890,
353,
29871,
29900,
396,
7223,
304,
4337,
470,
16734,
13,
3972,
353,
29871,
29896,
396,
5305,
310,
16734,
13,
8000,
5852,
29901,
13,
1678,
12247,
353,
13850,
29889,
10685,
2558,
29898,
29896,
29897,
13,
1678,
565,
12247,
1275,
525,
29939,
29915,
470,
12247,
1275,
29871,
29906,
29955,
29901,
13,
4706,
363,
474,
297,
3464,
29898,
29906,
29900,
1125,
13,
9651,
419,
13418,
353,
590,
3562,
29889,
657,
18877,
13418,
29898,
1357,
3562,
29889,
3729,
29879,
29961,
29875,
2314,
13,
9651,
590,
3562,
29889,
3729,
29879,
29961,
29875,
1822,
9847,
29898,
510,
13418,
29897,
13,
4706,
931,
29889,
17059,
11891,
29906,
29897,
13,
4706,
2867,
13,
1678,
3240,
29892,
3515,
353,
10446,
29889,
949,
580,
13,
1678,
565,
3515,
338,
6213,
29901,
13,
4706,
2867,
13,
1678,
396,
3515,
353,
13850,
29889,
21476,
29898,
2557,
29892,
313,
29953,
29946,
29900,
29892,
29871,
29941,
29953,
29900,
876,
13,
1678,
396,
2557,
353,
13850,
29889,
11023,
29873,
3306,
29898,
2557,
29892,
13850,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
29954,
22800,
29897,
13,
1678,
16608,
353,
16608,
718,
29871,
29896,
13,
1678,
565,
16608,
529,
29871,
29945,
29900,
29901,
13,
4706,
26995,
29896,
353,
679,
29907,
1398,
414,
29898,
2557,
29897,
13,
4706,
26995,
29961,
29900,
3816,
29900,
29962,
353,
4236,
29898,
29883,
1398,
414,
29961,
29900,
3816,
29900,
1402,
26995,
29896,
29961,
29900,
3816,
29900,
2314,
13,
4706,
26995,
29961,
29900,
3816,
29896,
29962,
353,
4236,
29898,
29883,
1398,
414,
29961,
29900,
3816,
29896,
1402,
26995,
29896,
29961,
29900,
3816,
29896,
2314,
13,
4706,
26995,
29961,
29896,
3816,
29900,
29962,
353,
1375,
29898,
29883,
1398,
414,
29961,
29896,
3816,
29900,
1402,
26995,
29896,
29961,
29896,
3816,
29900,
2314,
13,
4706,
26995,
29961,
29896,
3816,
29896,
29962,
353,
4236,
29898,
29883,
1398,
414,
29961,
29896,
3816,
29896,
1402,
26995,
29896,
29961,
29896,
3816,
29896,
2314,
13,
4706,
26995,
29961,
29906,
3816,
29900,
29962,
353,
1375,
29898,
29883,
1398,
414,
29961,
29906,
3816,
29900,
1402,
26995,
29896,
29961,
29906,
3816,
29900,
2314,
13,
4706,
26995,
29961,
29906,
3816,
29896,
29962,
353,
1375,
29898,
29883,
1398,
414,
29961,
29906,
3816,
29896,
1402,
26995,
29896,
29961,
29906,
3816,
29896,
2314,
13,
4706,
26995,
29961,
29941,
3816,
29900,
29962,
353,
4236,
29898,
29883,
1398,
414,
29961,
29941,
3816,
29900,
1402,
26995,
29896,
29961,
29941,
3816,
29900,
2314,
13,
4706,
26995,
29961,
29941,
3816,
29896,
29962,
353,
1375,
29898,
29883,
1398,
414,
29961,
29941,
3816,
29896,
1402,
26995,
29896,
29961,
29941,
3816,
29896,
2314,
13,
13,
4706,
396,
1596,
29898,
29883,
1398,
414,
29896,
29897,
13,
4706,
6773,
13,
1678,
565,
16608,
529,
29871,
29896,
29900,
29900,
29901,
13,
4706,
6773,
13,
1678,
26995,
353,
7442,
29889,
7411,
29941,
29906,
29898,
29883,
1398,
414,
29897,
13,
1678,
3515,
353,
679,
3562,
4591,
4308,
29898,
29883,
1398,
414,
29892,
3515,
29897,
13,
1678,
313,
1760,
414,
29892,
23619,
29897,
353,
1439,
3019,
29889,
6362,
522,
29898,
2557,
29897,
13,
1678,
298,
29896,
29892,
281,
29896,
353,
3515,
29889,
12181,
7503,
29906,
29962,
13,
1678,
565,
7431,
29898,
1760,
414,
29897,
1275,
29871,
29900,
29901,
13,
4706,
6773,
13,
13,
1678,
1644,
414,
7428,
353,
15526,
1762,
29924,
29885,
3552,
7411,
29898,
1760,
414,
29961,
29900,
3816,
29900,
11724,
5785,
29898,
1760,
414,
29961,
29900,
3816,
29896,
2314,
511,
281,
29896,
29892,
298,
29896,
29897,
13,
1678,
10696,
353,
23619,
29961,
29900,
3816,
29900,
29962,
13,
1678,
2734,
13418,
353,
590,
3562,
29889,
657,
13418,
2059,
29940,
799,
6508,
29898,
1760,
414,
7428,
29892,
29871,
29946,
29897,
13,
1678,
565,
8147,
27469,
29898,
1760,
414,
7428,
29892,
14354,
29961,
2248,
2314,
529,
29871,
29896,
29900,
29900,
29901,
13,
4706,
396,
29871,
5731,
353,
5852,
13,
4706,
2380,
353,
313,
2248,
29974,
29896,
29897,
1273,
7431,
29898,
2029,
800,
29897,
13,
1678,
396,
1683,
29901,
13,
1678,
396,
268,
5731,
353,
7700,
13,
1678,
565,
313,
5450,
1125,
13,
4706,
1095,
19582,
353,
590,
3562,
29889,
657,
19582,
29898,
13,
9651,
1095,
13418,
29961,
2248,
1822,
1111,
24266,
29892,
1095,
13418,
15625,
2248,
29974,
29896,
29897,
1273,
7431,
29898,
2029,
800,
29897,
1822,
1111,
24266,
29897,
13,
4706,
10696,
4619,
29871,
29929,
29900,
13,
4706,
10696,
1273,
29922,
29871,
29896,
29947,
29900,
13,
4706,
1095,
19582,
1273,
29922,
29871,
29896,
29947,
29900,
13,
4706,
281,
353,
1095,
19582,
448,
10696,
13,
4706,
1596,
29898,
2521,
29892,
1095,
19582,
29897,
13,
4706,
396,
1596,
313,
29893,
29897,
13,
4706,
396,
1596,
29898,
29888,
29908,
5450,
1218,
426,
355,
13418,
29961,
2248,
1822,
5479,
27195,
13,
4706,
565,
313,
6897,
29898,
29893,
29897,
529,
29871,
29896,
29900,
1125,
13,
9651,
2380,
353,
313,
2248,
29974,
29896,
29897,
1273,
7431,
29898,
2029,
800,
29897,
13,
9651,
5731,
353,
7700,
13,
9651,
6773,
13,
4706,
281,
353,
29871,
29955,
29900,
13,
4706,
590,
3562,
29889,
11631,
29898,
355,
13418,
29961,
2248,
1402,
29871,
29900,
29892,
29871,
29900,
29892,
281,
29897,
13,
4706,
518,
29916,
29892,
343,
29962,
353,
1095,
13418,
29961,
2248,
1822,
5479,
13,
4706,
15414,
353,
21069,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29962,
13,
4706,
565,
921,
1273,
29871,
29906,
1275,
29871,
29896,
29901,
13,
9651,
13475,
353,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29962,
13,
4706,
1683,
29901,
13,
9651,
13475,
353,
21069,
29896,
29892,
448,
29896,
29892,
29871,
29896,
29962,
13,
4706,
5731,
1218,
13418,
353,
5159,
13,
4706,
363,
474,
297,
3464,
29898,
2435,
29898,
8235,
22164,
13,
9651,
3038,
353,
590,
3562,
29889,
657,
4617,
2059,
6508,
4197,
29916,
718,
15414,
29961,
29875,
1402,
343,
718,
13475,
29961,
29875,
24960,
13,
9651,
565,
3038,
338,
451,
6213,
29901,
13,
18884,
5731,
1218,
13418,
29889,
4397,
29898,
3729,
29897,
13,
13,
4706,
363,
474,
297,
3464,
29898,
2435,
29898,
5450,
1218,
13418,
22164,
13,
9651,
565,
5731,
1218,
13418,
29961,
29875,
1822,
333,
1275,
1095,
13418,
29961,
2248,
1822,
333,
29901,
13,
18884,
6773,
13,
9651,
590,
3562,
29889,
11631,
29898,
5450,
1218,
13418,
29961,
29875,
1402,
29871,
29900,
29892,
29871,
29900,
29892,
448,
29893,
29897,
13,
13,
1678,
565,
313,
1333,
5731,
1125,
13,
4706,
565,
313,
29890,
1125,
29871,
13,
9651,
396,
16734,
304,
2329,
298,
9776,
297,
4423,
13,
9651,
1596,
29898,
29888,
29915,
2798,
29901,
426,
2798,
29913,
1495,
13,
9651,
281,
353,
29871,
29896,
29946,
29900,
334,
4516,
13,
9651,
363,
474,
297,
3464,
29898,
2435,
29898,
21094,
13418,
22164,
13,
18884,
590,
3562,
29889,
11631,
29898,
21094,
13418,
29961,
29875,
1402,
29871,
29900,
29892,
29871,
29900,
29892,
281,
29897,
13,
9651,
2302,
22361,
29871,
29896,
13,
9651,
565,
2302,
1275,
29871,
29900,
29901,
13,
18884,
289,
353,
29871,
29900,
13,
9651,
6773,
13,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
11631,
1159,
13,
9651,
590,
3562,
29889,
1484,
1762,
6508,
29898,
2029,
800,
29961,
2248,
1402,
2734,
13418,
29897,
13,
13,
4706,
396,
23197,
3151,
926,
310,
4940,
926,
13,
4706,
921,
2764,
353,
1644,
414,
29961,
29900,
3816,
29900,
29962,
13,
4706,
343,
2764,
353,
1644,
414,
29961,
29900,
3816,
29896,
29962,
13,
4706,
766,
353,
8147,
27469,
3552,
29916,
2764,
29892,
343,
2764,
511,
313,
26330,
29892,
343,
29886,
876,
13,
4706,
921,
29886,
353,
921,
2764,
13,
4706,
343,
29886,
353,
343,
2764,
13,
4706,
565,
313,
2218,
529,
29871,
29953,
1125,
13,
9651,
2302,
4619,
29871,
29896,
13,
9651,
565,
2302,
6736,
29871,
29896,
29900,
29901,
13,
18884,
2302,
334,
29922,
29871,
29906,
29889,
29945,
13,
18884,
289,
353,
29871,
29896,
13,
18884,
4516,
334,
29922,
448,
29896,
13,
4706,
1683,
29901,
13,
9651,
2302,
353,
29871,
29900,
13,
13,
1678,
396,
565,
313,
2435,
29898,
1760,
414,
29897,
1405,
29871,
29900,
1125,
13,
1678,
396,
268,
1020,
4937,
29889,
6422,
29898,
1760,
414,
29897,
13,
13,
1678,
396,
363,
474,
297,
3464,
29898,
2435,
29898,
3018,
4937,
29889,
3018,
4684,
22164,
13,
1678,
396,
268,
565,
313,
2435,
29898,
3018,
4937,
29889,
3018,
4684,
29961,
29875,
1822,
15003,
29897,
1405,
29871,
29896,
1125,
13,
1678,
396,
308,
363,
432,
297,
3464,
29898,
2435,
29898,
3018,
4937,
29889,
3018,
4684,
29961,
29875,
1822,
15003,
6817,
29896,
1125,
13,
1678,
396,
632,
396,
18492,
9637,
1196,
13,
1678,
396,
632,
921,
29896,
353,
1020,
4937,
29889,
3018,
4684,
29961,
29875,
1822,
15003,
29961,
29926,
3816,
29900,
3816,
29900,
29962,
13,
1678,
396,
632,
343,
29896,
353,
1020,
4937,
29889,
3018,
4684,
29961,
29875,
1822,
15003,
29961,
29926,
3816,
29896,
3816,
29900,
29962,
13,
1678,
396,
632,
921,
29906,
353,
1020,
4937,
29889,
3018,
4684,
29961,
29875,
1822,
15003,
29961,
29926,
29974,
29896,
3816,
29900,
3816,
29900,
29962,
13,
1678,
396,
632,
343,
29906,
353,
1020,
4937,
29889,
3018,
4684,
29961,
29875,
1822,
15003,
29961,
29926,
29974,
29896,
3816,
29896,
3816,
29900,
29962,
13,
1678,
396,
632,
1067,
29878,
353,
1020,
4937,
29889,
3018,
4684,
29961,
29875,
1822,
11294,
29918,
333,
1273,
29871,
29929,
13,
1678,
396,
632,
13850,
29889,
1220,
29898,
2557,
29892,
313,
524,
29898,
29916,
29896,
511,
938,
29898,
29891,
29896,
8243,
313,
524,
29898,
29916,
29906,
511,
938,
29898,
29891,
29906,
8243,
13,
1678,
396,
462,
268,
5702,
29918,
27703,
29961,
695,
29878,
1402,
29871,
29906,
29897,
13,
13,
1678,
396,
301,
353,
7431,
29898,
3018,
4937,
29889,
3018,
4684,
29961,
29875,
1822,
15003,
29897,
13,
1678,
396,
565,
313,
29880,
1405,
29871,
29896,
1125,
13,
1678,
396,
268,
921,
2764,
353,
1020,
4937,
29889,
3018,
4684,
29961,
29900,
1822,
15003,
29961,
29880,
29899,
29896,
3816,
29900,
3816,
29900,
29962,
13,
1678,
396,
268,
343,
2764,
353,
1020,
4937,
29889,
3018,
4684,
29961,
29900,
1822,
15003,
29961,
29880,
29899,
29896,
3816,
29896,
3816,
29900,
29962,
13,
1678,
396,
268,
921,
29886,
353,
1020,
4937,
29889,
3018,
4684,
29961,
29900,
1822,
15003,
29961,
29880,
29899,
29906,
3816,
29900,
3816,
29900,
29962,
13,
1678,
396,
268,
343,
29886,
353,
1020,
4937,
29889,
3018,
4684,
29961,
29900,
1822,
15003,
29961,
29880,
29899,
29906,
3816,
29896,
3816,
29900,
29962,
13,
1678,
396,
268,
766,
353,
8147,
27469,
3552,
29916,
2764,
29892,
343,
2764,
511,
313,
26330,
29892,
343,
29886,
876,
13,
1678,
396,
268,
565,
313,
999,
529,
29871,
29896,
29900,
1125,
13,
1678,
396,
308,
2302,
23661,
29896,
13,
1678,
396,
268,
1683,
29901,
13,
1678,
396,
308,
2302,
353,
29871,
29900,
13,
13,
1678,
396,
396,
17440,
278,
9819,
23110,
3515,
13,
1678,
13850,
29889,
326,
4294,
877,
17936,
292,
742,
3515,
29897,
13,
2
] |
tests/test_running.py | Zaab1t/simple-language | 0 | 52261 | <reponame>Zaab1t/simple-language
import functools
import pytest
from simplelang import ast_tree, tokenizer, objects
from simplelang.run import Interpreter
# run a bunch of code in the same interpreter and context
@pytest.fixture(scope='function')
def run_code():
interp = Interpreter()
def run(code):
tokens = list(tokenizer.tokenize(code))
ast_statements = list(ast_tree.parse(tokens))
for statement in ast_statements:
interp.execute(statement, interp.global_context)
run.context = interp.global_context
return run
def test_hello_world(run_code, capsys):
run_code('print "hello world";')
assert capsys.readouterr() == ('hello world\n', '')
def test_variables(run_code, capsys):
run_code('''
var a = "value of a";
var b = print;
b a;
a = "wat";
b a;
''')
assert capsys.readouterr() == ('value of a\nwat\n', '')
with pytest.raises(ValueError):
run_code('undefined_var = "toot";')
with pytest.raises(ValueError):
run_code('print undefined_var;')
class Dummy(objects.Object):
def __init__(self):
super().__init__()
self.attributes.set_locally('attribute', objects.String("hi"))
def test_attributes(run_code, capsys):
run_code.context.namespace.set_locally('d', Dummy())
run_code('''print d.attribute;
d.attribute = "new hi";
print d.attribute;''')
assert capsys.readouterr() == ('hi\nnew hi\n', '')
run_code('var d.lol = "asd";')
lol = run_code.context.namespace.get('d').attributes.get('lol')
assert isinstance(lol, objects.String)
assert lol.python_string == 'asd'
run_code('print d.lol; d.lol = "new lol"; print d.lol;')
assert capsys.readouterr() == ('asd\nnew lol\n', '')
run_code('var d.wat = "ASD";')
wat = run_code.context.namespace.get('d').attributes.get('wat')
assert isinstance(wat, objects.String)
assert wat.python_string == 'ASD'
with pytest.raises(ValueError):
run_code('d.this_is_not_defined_anywhere_must_use_var_first = "toot";')
run_code.context.namespace.get('d').attributes.read_only = True
# attributes must still work...
run_code('print d.lol;')
assert capsys.readouterr() == ('new lol\n', '')
# ...even though nothing can be changed
with pytest.raises(ValueError):
run_code('var d.lol = "very new lol";')
run_code('print d.lol;')
assert capsys.readouterr() == ('new lol\n', '')
with pytest.raises(ValueError):
run_code('d.this_doesnt_exist = "waaaaaat";')
with pytest.raises(ValueError):
run_code('print d.this_doesnt_exist;')
def test_blocks(run_code, capsys):
run_code('''
var hello = {
print "hello world";
print "hello again";
};
''')
assert capsys.readouterr() == ('', '')
with pytest.raises(AttributeError): # lol
run_code('hello;')
run_code('hello.run;')
assert capsys.readouterr() == ('hello world\nhello again\n', '')
run_code('''
var a = "original a";
var firstblock = {
print a;
a = "new a";
print a;
};
firstblock.run;
print a;
''')
assert capsys.readouterr() == ('original a\nnew a\nnew a\n', '')
run_code('''
{
var a = "even newer a";
print a;
}.run;
print a; # it didn't change this
''')
assert capsys.readouterr() == ('even newer a\nnew a\n', '')
run_code('''
var a = "damn new a";
firstblock.run; # it changed everything that uses this context
''')
assert capsys.readouterr() == ('damn new a\nnew a\n', '')
# a friend of mine says that this is an idiom... i have never seen it
# being actually used though
def test_funny_idiom(run_code, capsys):
run_code('''
var a = "global a";
{
var a=a; # localize a
a = "local a";
print a;
}.run;
print a;
''')
assert capsys.readouterr() == ('local a\nglobal a\n', '')
| [
1,
529,
276,
1112,
420,
29958,
29999,
29874,
370,
29896,
29873,
29914,
12857,
29899,
11675,
13,
5215,
2090,
312,
8789,
13,
13,
5215,
11451,
1688,
13,
13,
3166,
2560,
3893,
1053,
8717,
29918,
8336,
29892,
5993,
3950,
29892,
3618,
13,
3166,
2560,
3893,
29889,
3389,
1053,
4124,
1457,
357,
13,
13,
13,
29937,
1065,
263,
14928,
310,
775,
297,
278,
1021,
26997,
322,
3030,
13,
29992,
2272,
1688,
29889,
7241,
15546,
29898,
6078,
2433,
2220,
1495,
13,
1753,
1065,
29918,
401,
7295,
13,
1678,
1006,
29886,
353,
4124,
1457,
357,
580,
13,
13,
1678,
822,
1065,
29898,
401,
1125,
13,
4706,
18897,
353,
1051,
29898,
6979,
3950,
29889,
6979,
675,
29898,
401,
876,
13,
4706,
8717,
29918,
6112,
4110,
353,
1051,
29898,
579,
29918,
8336,
29889,
5510,
29898,
517,
12360,
876,
13,
4706,
363,
3229,
297,
8717,
29918,
6112,
4110,
29901,
13,
9651,
1006,
29886,
29889,
7978,
29898,
20788,
29892,
1006,
29886,
29889,
10945,
29918,
4703,
29897,
13,
13,
1678,
1065,
29889,
4703,
353,
1006,
29886,
29889,
10945,
29918,
4703,
13,
1678,
736,
1065,
13,
13,
13,
1753,
1243,
29918,
12199,
29918,
11526,
29898,
3389,
29918,
401,
29892,
2117,
9675,
1125,
13,
1678,
1065,
29918,
401,
877,
2158,
376,
12199,
3186,
1769,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
12199,
3186,
29905,
29876,
742,
27255,
13,
13,
13,
1753,
1243,
29918,
20897,
29898,
3389,
29918,
401,
29892,
2117,
9675,
1125,
13,
1678,
1065,
29918,
401,
877,
4907,
13,
1678,
722,
263,
353,
376,
1767,
310,
263,
1769,
13,
1678,
722,
289,
353,
1596,
29936,
13,
1678,
289,
263,
29936,
13,
13,
1678,
263,
353,
376,
29893,
271,
1769,
13,
1678,
289,
263,
29936,
13,
1678,
6629,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
1767,
310,
263,
29905,
29876,
29893,
271,
29905,
29876,
742,
27255,
13,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1917,
2392,
1125,
13,
4706,
1065,
29918,
401,
877,
15955,
29918,
1707,
353,
376,
517,
327,
1769,
1495,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1917,
2392,
1125,
13,
4706,
1065,
29918,
401,
877,
2158,
7580,
29918,
1707,
29936,
1495,
13,
13,
13,
1990,
360,
11770,
29898,
12650,
29889,
2061,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
15697,
29889,
842,
29918,
2029,
635,
877,
12715,
742,
3618,
29889,
1231,
703,
2918,
5783,
13,
13,
13,
1753,
1243,
29918,
15697,
29898,
3389,
29918,
401,
29892,
2117,
9675,
1125,
13,
1678,
1065,
29918,
401,
29889,
4703,
29889,
22377,
29889,
842,
29918,
2029,
635,
877,
29881,
742,
360,
11770,
3101,
13,
13,
1678,
1065,
29918,
401,
877,
4907,
2158,
270,
29889,
12715,
29936,
13,
18884,
270,
29889,
12715,
353,
376,
1482,
7251,
1769,
13,
18884,
1596,
270,
29889,
12715,
29936,
4907,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
2918,
29905,
29876,
1482,
7251,
29905,
29876,
742,
27255,
13,
13,
1678,
1065,
29918,
401,
877,
1707,
270,
29889,
29880,
324,
353,
376,
294,
29881,
1769,
1495,
13,
1678,
301,
324,
353,
1065,
29918,
401,
29889,
4703,
29889,
22377,
29889,
657,
877,
29881,
2824,
15697,
29889,
657,
877,
29880,
324,
1495,
13,
1678,
4974,
338,
8758,
29898,
29880,
324,
29892,
3618,
29889,
1231,
29897,
13,
1678,
4974,
301,
324,
29889,
4691,
29918,
1807,
1275,
525,
294,
29881,
29915,
13,
13,
1678,
1065,
29918,
401,
877,
2158,
270,
29889,
29880,
324,
29936,
270,
29889,
29880,
324,
353,
376,
1482,
301,
324,
1769,
1596,
270,
29889,
29880,
324,
29936,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
294,
29881,
29905,
29876,
1482,
301,
324,
29905,
29876,
742,
27255,
13,
13,
1678,
1065,
29918,
401,
877,
1707,
270,
29889,
29893,
271,
353,
376,
3289,
29928,
1769,
1495,
13,
1678,
16699,
353,
1065,
29918,
401,
29889,
4703,
29889,
22377,
29889,
657,
877,
29881,
2824,
15697,
29889,
657,
877,
29893,
271,
1495,
13,
1678,
4974,
338,
8758,
29898,
29893,
271,
29892,
3618,
29889,
1231,
29897,
13,
1678,
4974,
16699,
29889,
4691,
29918,
1807,
1275,
525,
3289,
29928,
29915,
13,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1917,
2392,
1125,
13,
4706,
1065,
29918,
401,
877,
29881,
29889,
1366,
29918,
275,
29918,
1333,
29918,
12119,
29918,
1384,
3062,
29918,
21969,
29918,
1509,
29918,
1707,
29918,
4102,
353,
376,
517,
327,
1769,
1495,
13,
13,
1678,
1065,
29918,
401,
29889,
4703,
29889,
22377,
29889,
657,
877,
29881,
2824,
15697,
29889,
949,
29918,
6194,
353,
5852,
13,
13,
1678,
396,
8393,
1818,
1603,
664,
856,
13,
1678,
1065,
29918,
401,
877,
2158,
270,
29889,
29880,
324,
29936,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
1482,
301,
324,
29905,
29876,
742,
27255,
13,
13,
1678,
396,
2023,
11884,
2466,
3078,
508,
367,
3939,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1917,
2392,
1125,
13,
4706,
1065,
29918,
401,
877,
1707,
270,
29889,
29880,
324,
353,
376,
1201,
716,
301,
324,
1769,
1495,
13,
1678,
1065,
29918,
401,
877,
2158,
270,
29889,
29880,
324,
29936,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
1482,
301,
324,
29905,
29876,
742,
27255,
13,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1917,
2392,
1125,
13,
4706,
1065,
29918,
401,
877,
29881,
29889,
1366,
29918,
13221,
593,
29918,
28997,
353,
376,
2766,
27137,
271,
1769,
1495,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
1917,
2392,
1125,
13,
4706,
1065,
29918,
401,
877,
2158,
270,
29889,
1366,
29918,
13221,
593,
29918,
28997,
29936,
1495,
13,
13,
13,
1753,
1243,
29918,
1271,
29879,
29898,
3389,
29918,
401,
29892,
2117,
9675,
1125,
13,
1678,
1065,
29918,
401,
877,
4907,
13,
1678,
722,
22172,
353,
426,
13,
4706,
1596,
376,
12199,
3186,
1769,
13,
4706,
1596,
376,
12199,
1449,
1769,
13,
1678,
3980,
13,
1678,
6629,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
742,
27255,
13,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
6708,
2392,
1125,
268,
396,
301,
324,
13,
4706,
1065,
29918,
401,
877,
12199,
29936,
1495,
13,
1678,
1065,
29918,
401,
877,
12199,
29889,
3389,
29936,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
12199,
3186,
29905,
29876,
12199,
1449,
29905,
29876,
742,
27255,
13,
13,
1678,
1065,
29918,
401,
877,
4907,
13,
1678,
722,
263,
353,
376,
13492,
263,
1769,
13,
1678,
722,
937,
1271,
353,
426,
13,
4706,
1596,
263,
29936,
13,
4706,
263,
353,
376,
1482,
263,
1769,
13,
4706,
1596,
263,
29936,
13,
1678,
3980,
13,
1678,
937,
1271,
29889,
3389,
29936,
13,
1678,
1596,
263,
29936,
13,
1678,
6629,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
13492,
263,
29905,
29876,
1482,
263,
29905,
29876,
1482,
263,
29905,
29876,
742,
27255,
13,
13,
1678,
1065,
29918,
401,
877,
4907,
13,
1678,
426,
13,
4706,
722,
263,
353,
376,
11884,
20687,
263,
1769,
13,
4706,
1596,
263,
29936,
13,
1678,
500,
29889,
3389,
29936,
13,
1678,
1596,
263,
29936,
1678,
396,
372,
3282,
29915,
29873,
1735,
445,
13,
1678,
6629,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
11884,
20687,
263,
29905,
29876,
1482,
263,
29905,
29876,
742,
27255,
13,
13,
1678,
1065,
29918,
401,
877,
4907,
13,
1678,
722,
263,
353,
376,
16846,
29876,
716,
263,
1769,
13,
1678,
937,
1271,
29889,
3389,
29936,
418,
396,
372,
3939,
4129,
393,
3913,
445,
3030,
13,
1678,
6629,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
16846,
29876,
716,
263,
29905,
29876,
1482,
263,
29905,
29876,
742,
27255,
13,
13,
13,
29937,
263,
5121,
310,
7903,
4083,
393,
445,
338,
385,
1178,
14910,
856,
474,
505,
2360,
3595,
372,
13,
29937,
1641,
2869,
1304,
2466,
13,
1753,
1243,
29918,
7692,
1460,
29918,
8819,
290,
29898,
3389,
29918,
401,
29892,
2117,
9675,
1125,
13,
1678,
1065,
29918,
401,
877,
4907,
13,
1678,
722,
263,
353,
376,
10945,
263,
1769,
13,
1678,
426,
13,
4706,
722,
263,
29922,
29874,
29936,
1678,
396,
1887,
675,
263,
13,
4706,
263,
353,
376,
2997,
263,
1769,
13,
4706,
1596,
263,
29936,
13,
1678,
500,
29889,
3389,
29936,
13,
1678,
1596,
263,
29936,
13,
1678,
6629,
1495,
13,
1678,
4974,
2117,
9675,
29889,
949,
5561,
29878,
580,
1275,
6702,
2997,
263,
29905,
865,
3157,
263,
29905,
29876,
742,
27255,
13,
2
] |
data_management/databases/classification/cropped_camera_trap_dataset_statistics.py | shelviaandi/CameraTraps | 1 | 176982 | <filename>data_management/databases/classification/cropped_camera_trap_dataset_statistics.py<gh_stars>1-10
from pycocotools.coco import COCO
import json
import numpy as np
import argparse
parser = argparse.ArgumentParser('Tools for getting dataset statistics. It is written for datasets generated with ' + \
'the make_classification_dataset.py script.')
parser.add_argument("camera_trap_json", type=str, help='Path to json file of the camera trap dataset from LILA.')
parser.add_argument('train_json', type=str, help='Path to train.json generated by the make_classification_dataset.py script')
parser.add_argument('test_json', type=str, help='Path to test.json generated by the make_classification_dataset.py script')
parser.add_argument('--classlist_output', type=str, default='', help='Generates the list of classes that corresponds ' + \
'to the outputs of a network trained with the train.json file')
parser.add_argument('--location_key', type=str, default='location',
help='Key in the camera trap json specifying the location which was used for splitting the dataset.')
args = parser.parse_args()
CT_JSON = args.camera_trap_json
TRAIN_JSON = args.train_json
TEST_JSON = args.test_json
CLASSLIST_OUTPUT = args.classlist_output
LOCATION_KEY = args.location_key
coco = COCO(CT_JSON)
def print_locations(json_file):
#json_file = TEST_JSON
with open(json_file, 'rt') as fi:
js = json.load(fi)
print('Locations used: ')
print(sorted(list(set([coco.loadImgs([im['original_key']])[0][LOCATION_KEY] for im in js['images']]))))
#js_keys = ['/'.join(im['file_name'].split('/')[1:])[:-4] for im in js['images']]
#for tk in js_keys:
# assert np.isclose(1, np.sum(detections[tk]['detection_scores'] > 0.5))
class_to_name = {c['id']:c['name'] for c in js['categories']}
if CLASSLIST_OUTPUT and json_file == TRAIN_JSON:
with open(CLASSLIST_OUTPUT, 'wt') as fi:
fi.write('\n'.join([class_to_name[i] for i in range(max(class_to_name.keys())+1)]))
labels = np.array([a['category_id'] for a in js['annotations']])
print('In total ', len(class_to_name), ' classes and ', len(labels), ' images.')
print('Classes with one or more images: ', len(set(labels)))
print('Images per class:')
print('{:5} {:<15} {:>11}'.format('ID','Name','Image count'))
for cls in range(max(class_to_name.keys()) + 1):
print('{:5} {:<15} {:>11}'.format(cls, class_to_name[cls], np.sum(labels==cls)))
print('Statistics of the training split: ')
print_locations(TRAIN_JSON)
print('\n\nStatistics of the testing split: ')
print_locations(TEST_JSON)
| [
1,
529,
9507,
29958,
1272,
29918,
21895,
29914,
29503,
2129,
29914,
1990,
2450,
29914,
24077,
2986,
29918,
26065,
29918,
29873,
2390,
29918,
24713,
29918,
6112,
6765,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
282,
11078,
542,
327,
8789,
29889,
29883,
6235,
1053,
4810,
3217,
13,
5215,
4390,
13,
5215,
12655,
408,
7442,
13,
5215,
1852,
5510,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
877,
24183,
363,
2805,
8783,
13964,
29889,
739,
338,
3971,
363,
20035,
5759,
411,
525,
718,
320,
13,
462,
462,
525,
1552,
1207,
29918,
1990,
2450,
29918,
24713,
29889,
2272,
2471,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
703,
26065,
29918,
29873,
2390,
29918,
3126,
613,
1134,
29922,
710,
29892,
1371,
2433,
2605,
304,
4390,
934,
310,
278,
10656,
26505,
8783,
515,
17705,
4375,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
14968,
29918,
3126,
742,
1134,
29922,
710,
29892,
1371,
2433,
2605,
304,
7945,
29889,
3126,
5759,
491,
278,
1207,
29918,
1990,
2450,
29918,
24713,
29889,
2272,
2471,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
1688,
29918,
3126,
742,
1134,
29922,
710,
29892,
1371,
2433,
2605,
304,
1243,
29889,
3126,
5759,
491,
278,
1207,
29918,
1990,
2450,
29918,
24713,
29889,
2272,
2471,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
1990,
1761,
29918,
4905,
742,
1134,
29922,
710,
29892,
2322,
2433,
742,
1371,
2433,
5631,
1078,
278,
1051,
310,
4413,
393,
16161,
525,
718,
320,
13,
462,
462,
29871,
525,
517,
278,
14391,
310,
263,
3564,
16370,
411,
278,
7945,
29889,
3126,
934,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
5479,
29918,
1989,
742,
1134,
29922,
710,
29892,
2322,
2433,
5479,
742,
13,
462,
1678,
1371,
2433,
2558,
297,
278,
10656,
26505,
4390,
22146,
278,
4423,
607,
471,
1304,
363,
24368,
278,
8783,
29889,
1495,
13,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
1783,
29918,
7249,
353,
6389,
29889,
26065,
29918,
29873,
2390,
29918,
3126,
13,
29911,
4717,
1177,
29918,
7249,
353,
6389,
29889,
14968,
29918,
3126,
13,
18267,
29918,
7249,
353,
6389,
29889,
1688,
29918,
3126,
13,
13875,
1799,
24360,
29918,
12015,
12336,
353,
6389,
29889,
1990,
1761,
29918,
4905,
13,
16652,
8098,
29918,
10818,
353,
6389,
29889,
5479,
29918,
1989,
13,
13,
29883,
6235,
353,
4810,
3217,
29898,
1783,
29918,
7249,
29897,
13,
13,
1753,
1596,
29918,
2029,
800,
29898,
3126,
29918,
1445,
1125,
13,
1678,
396,
3126,
29918,
1445,
353,
17067,
1254,
29918,
7249,
13,
1678,
411,
1722,
29898,
3126,
29918,
1445,
29892,
525,
2273,
1495,
408,
5713,
29901,
13,
4706,
6965,
353,
4390,
29889,
1359,
29898,
7241,
29897,
13,
1678,
1596,
877,
3524,
800,
1304,
29901,
25710,
13,
1678,
1596,
29898,
24582,
29898,
1761,
29898,
842,
4197,
29883,
6235,
29889,
1359,
1888,
3174,
4197,
326,
1839,
13492,
29918,
1989,
2033,
2314,
29961,
29900,
3816,
16652,
8098,
29918,
10818,
29962,
363,
527,
297,
6965,
1839,
8346,
2033,
12622,
876,
13,
1678,
396,
1315,
29918,
8149,
353,
6024,
29914,
4286,
7122,
29898,
326,
1839,
1445,
29918,
978,
13359,
5451,
11219,
29861,
29896,
29901,
2314,
7503,
29899,
29946,
29962,
363,
527,
297,
6965,
1839,
8346,
2033,
29962,
13,
1678,
396,
1454,
18883,
297,
6965,
29918,
8149,
29901,
13,
1678,
396,
1678,
4974,
7442,
29889,
275,
5358,
29898,
29896,
29892,
7442,
29889,
2083,
29898,
29881,
2650,
1953,
29961,
11178,
22322,
29881,
2650,
428,
29918,
1557,
2361,
2033,
1405,
29871,
29900,
29889,
29945,
876,
13,
1678,
770,
29918,
517,
29918,
978,
353,
426,
29883,
1839,
333,
2033,
29901,
29883,
1839,
978,
2033,
363,
274,
297,
6965,
1839,
20683,
2033,
29913,
13,
1678,
565,
315,
4375,
1799,
24360,
29918,
12015,
12336,
322,
4390,
29918,
1445,
1275,
323,
4717,
1177,
29918,
7249,
29901,
13,
4706,
411,
1722,
29898,
13875,
1799,
24360,
29918,
12015,
12336,
29892,
525,
14554,
1495,
408,
5713,
29901,
13,
9651,
5713,
29889,
3539,
28909,
29876,
4286,
7122,
4197,
1990,
29918,
517,
29918,
978,
29961,
29875,
29962,
363,
474,
297,
3464,
29898,
3317,
29898,
1990,
29918,
517,
29918,
978,
29889,
8149,
3101,
29974,
29896,
4638,
876,
13,
1678,
11073,
353,
7442,
29889,
2378,
4197,
29874,
1839,
7320,
29918,
333,
2033,
363,
263,
297,
6965,
1839,
6735,
800,
2033,
2314,
13,
1678,
1596,
877,
797,
3001,
13420,
7431,
29898,
1990,
29918,
517,
29918,
978,
511,
525,
4413,
322,
13420,
7431,
29898,
21134,
511,
525,
4558,
29889,
1495,
13,
1678,
1596,
877,
27403,
411,
697,
470,
901,
4558,
29901,
13420,
7431,
29898,
842,
29898,
21134,
4961,
13,
1678,
1596,
877,
20163,
639,
770,
29901,
1495,
13,
1678,
1596,
877,
25641,
29945,
29913,
12365,
29966,
29896,
29945,
29913,
12365,
29958,
29896,
29896,
29913,
4286,
4830,
877,
1367,
3788,
1170,
3788,
2940,
2302,
8785,
13,
1678,
363,
1067,
29879,
297,
3464,
29898,
3317,
29898,
1990,
29918,
517,
29918,
978,
29889,
8149,
3101,
718,
29871,
29896,
1125,
13,
4706,
1596,
877,
25641,
29945,
29913,
12365,
29966,
29896,
29945,
29913,
12365,
29958,
29896,
29896,
29913,
4286,
4830,
29898,
25932,
29892,
770,
29918,
517,
29918,
978,
29961,
25932,
1402,
7442,
29889,
2083,
29898,
21134,
1360,
25932,
4961,
13,
13,
2158,
877,
9513,
6765,
310,
278,
6694,
6219,
29901,
25710,
13,
2158,
29918,
2029,
800,
29898,
29911,
4717,
1177,
29918,
7249,
29897,
13,
2158,
28909,
29876,
29905,
29876,
9513,
6765,
310,
278,
6724,
6219,
29901,
25710,
13,
2158,
29918,
2029,
800,
29898,
18267,
29918,
7249,
29897,
13,
2
] |
piecrust/wsgiutil/__init__.py | airbornemint/PieCrust2 | 0 | 26283 | from piecrust.serving.server import WsgiServer
def get_app(root_dir, cache_key='prod', enable_debug_info=False):
app = WsgiServer(root_dir,
cache_key=cache_key,
enable_debug_info=enable_debug_info)
return app
| [
1,
515,
5036,
7283,
504,
29889,
643,
1747,
29889,
2974,
1053,
399,
29879,
3146,
6004,
13,
13,
13,
1753,
679,
29918,
932,
29898,
4632,
29918,
3972,
29892,
7090,
29918,
1989,
2433,
10633,
742,
9025,
29918,
8382,
29918,
3888,
29922,
8824,
1125,
13,
1678,
623,
353,
399,
29879,
3146,
6004,
29898,
4632,
29918,
3972,
29892,
13,
462,
268,
7090,
29918,
1989,
29922,
8173,
29918,
1989,
29892,
13,
462,
268,
9025,
29918,
8382,
29918,
3888,
29922,
12007,
29918,
8382,
29918,
3888,
29897,
13,
1678,
736,
623,
13,
13,
2
] |
erpnext_chinese/utils.py | eanfs/erpnext_chinese | 0 | 150478 | import frappe
import json
from erpnext.stock.get_item_details import get_item_details
from six import string_types
@frappe.whitelist()
def get_user_default():
return frappe.get_all("User Default",
filters = {'user': frappe.session.user},
fields = ["setting_key", "setting_value"])
@frappe.whitelist()
def get_print_format(doc):
if not frappe.db.has_column('Print Format', 'condition_for_default'):
return
if isinstance(doc, str):
doc = json.loads(doc)
doc = frappe.get_doc(doc)
print_format_list = frappe.get_all('Print Format',
filters = {'doc_type': doc.doctype,
'disabled': 0},
fields = ['name', 'condition_for_default'],
order_by = 'priority', as_list = 1)
for (print_format, condition) in print_format_list:
if condition and frappe.safe_eval(condition, None, dict(doc=doc, get_roles = frappe.get_roles)):
return print_format
@frappe.whitelist()
def new_get_item_details(args, doc=None, for_validate=False, overwrite_warehouse=True):
"""fisher 修复旧物料切换到默认交易(采购、销售)单位与基本单位不同的新物料,单位转换率不自动刷新的问题"""
if isinstance(args, string_types):
args = json.loads(args)
args.pop('conversion_factor', None)
return get_item_details(args, doc=doc, for_validate=for_validate, overwrite_warehouse=overwrite_warehouse)
| [
1,
1053,
5227,
4798,
13,
5215,
4390,
13,
3166,
604,
29886,
4622,
29889,
17712,
29889,
657,
29918,
667,
29918,
14144,
1053,
679,
29918,
667,
29918,
14144,
13,
3166,
4832,
1053,
1347,
29918,
8768,
13,
13,
13,
29992,
20910,
4798,
29889,
1332,
7454,
391,
580,
13,
1753,
679,
29918,
1792,
29918,
4381,
7295,
13,
1678,
736,
5227,
4798,
29889,
657,
29918,
497,
703,
2659,
13109,
613,
29871,
13,
4706,
18094,
353,
11117,
1792,
2396,
5227,
4798,
29889,
7924,
29889,
1792,
1118,
13,
4706,
4235,
353,
6796,
26740,
29918,
1989,
613,
376,
26740,
29918,
1767,
20068,
13,
13,
29992,
20910,
4798,
29889,
1332,
7454,
391,
580,
13,
1753,
679,
29918,
2158,
29918,
4830,
29898,
1514,
1125,
13,
1678,
565,
451,
5227,
4798,
29889,
2585,
29889,
5349,
29918,
4914,
877,
11816,
19191,
742,
525,
16122,
29918,
1454,
29918,
4381,
29374,
13,
4706,
736,
13,
13,
1678,
565,
338,
8758,
29898,
1514,
29892,
851,
1125,
13,
4706,
1574,
353,
4390,
29889,
18132,
29898,
1514,
29897,
13,
1678,
1574,
353,
5227,
4798,
29889,
657,
29918,
1514,
29898,
1514,
29897,
13,
1678,
1596,
29918,
4830,
29918,
1761,
353,
29871,
5227,
4798,
29889,
657,
29918,
497,
877,
11816,
19191,
742,
29871,
13,
462,
462,
4706,
18094,
353,
11117,
1514,
29918,
1853,
2396,
1574,
29889,
1867,
312,
668,
29892,
13,
462,
462,
462,
259,
525,
18279,
2396,
29871,
29900,
1118,
13,
462,
462,
4706,
4235,
353,
6024,
978,
742,
525,
16122,
29918,
1454,
29918,
4381,
7464,
13,
462,
462,
4706,
1797,
29918,
1609,
353,
525,
29886,
21766,
742,
408,
29918,
1761,
353,
29871,
29896,
29897,
13,
13,
1678,
363,
313,
2158,
29918,
4830,
29892,
4195,
29897,
297,
1596,
29918,
4830,
29918,
1761,
29901,
13,
4706,
565,
4195,
322,
5227,
4798,
29889,
11177,
29918,
14513,
29898,
16122,
29892,
6213,
29892,
9657,
29898,
1514,
29922,
1514,
29892,
679,
29918,
307,
793,
353,
5227,
4798,
29889,
657,
29918,
307,
793,
22164,
13,
9651,
736,
1596,
29918,
4830,
13,
13,
29992,
20910,
4798,
29889,
1332,
7454,
391,
580,
13,
1753,
716,
29918,
657,
29918,
667,
29918,
14144,
29898,
5085,
29892,
1574,
29922,
8516,
29892,
363,
29918,
15480,
29922,
8824,
29892,
26556,
29918,
2519,
8697,
29922,
5574,
1125,
13,
1678,
9995,
15161,
261,
29871,
31273,
31810,
233,
154,
170,
30834,
31949,
31757,
31640,
30780,
31735,
31439,
31398,
233,
155,
150,
29898,
236,
138,
138,
235,
183,
176,
30330,
236,
151,
131,
232,
151,
177,
29897,
31166,
30956,
31267,
31359,
30346,
31166,
30956,
30413,
30980,
30210,
30374,
30834,
31949,
30214,
31166,
30956,
31415,
31640,
234,
145,
138,
30413,
30688,
30846,
232,
139,
186,
30374,
30210,
31658,
31596,
15945,
29908,
13,
1678,
565,
338,
8758,
29898,
5085,
29892,
1347,
29918,
8768,
1125,
13,
4706,
6389,
353,
4390,
29889,
18132,
29898,
5085,
29897,
13,
268,
13,
1678,
6389,
29889,
7323,
877,
535,
3259,
29918,
19790,
742,
6213,
29897,
13,
1678,
736,
679,
29918,
667,
29918,
14144,
29898,
5085,
29892,
1574,
29922,
1514,
29892,
363,
29918,
15480,
29922,
1454,
29918,
15480,
29892,
26556,
29918,
2519,
8697,
29922,
957,
3539,
29918,
2519,
8697,
29897,
13,
2
] |
medicalseg/utils/utils.py | onecatcn/MedicalSeg | 0 | 27855 | <filename>medicalseg/utils/utils.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import contextlib
import filelock
import os
import tempfile
import numpy as np
import random
from urllib.parse import urlparse, unquote
import paddle
from medicalseg.utils import logger, seg_env
from medicalseg.utils.download import download_file_and_uncompress
@contextlib.contextmanager
def generate_tempdir(directory: str = None, **kwargs):
'''Generate a temporary directory'''
directory = seg_env.TMP_HOME if not directory else directory
with tempfile.TemporaryDirectory(dir=directory, **kwargs) as _dir:
yield _dir
def load_entire_model(model, pretrained):
if pretrained is not None:
load_pretrained_model(model, pretrained)
else:
logger.warning('Not all pretrained params of {} are loaded, ' \
'training from scratch or a pretrained backbone.'.format(model.__class__.__name__))
def download_pretrained_model(pretrained_model):
"""
Download pretrained model from url.
Args:
pretrained_model (str): the url of pretrained weight
Returns:
str: the path of pretrained weight
"""
assert urlparse(pretrained_model).netloc, "The url is not valid."
pretrained_model = unquote(pretrained_model)
savename = pretrained_model.split('/')[-1]
if not savename.endswith(('tgz', 'tar.gz', 'tar', 'zip')):
savename = pretrained_model.split('/')[-2]
else:
savename = savename.split('.')[0]
with generate_tempdir() as _dir:
with filelock.FileLock(os.path.join(seg_env.TMP_HOME, savename)):
pretrained_model = download_file_and_uncompress(
pretrained_model,
savepath=_dir,
extrapath=seg_env.PRETRAINED_MODEL_HOME,
extraname=savename)
pretrained_model = os.path.join(pretrained_model, 'model.pdparams')
return pretrained_model
def load_pretrained_model(model, pretrained_model):
if pretrained_model is not None:
logger.info(
'Loading pretrained model from {}'.format(pretrained_model))
if urlparse(pretrained_model).netloc:
pretrained_model = download_pretrained_model(pretrained_model)
if os.path.exists(pretrained_model):
para_state_dict = paddle.load(pretrained_model)
model_state_dict = model.state_dict()
keys = model_state_dict.keys()
num_params_loaded = 0
for k in keys:
if k not in para_state_dict:
logger.warning("{} is not in pretrained model".format(k))
elif list(para_state_dict[k].shape) != list(
model_state_dict[k].shape):
logger.warning(
"[SKIP] Shape of pretrained params {} doesn't match.(Pretrained: {}, Actual: {})"
.format(k, para_state_dict[k].shape,
model_state_dict[k].shape))
else:
model_state_dict[k] = para_state_dict[k]
num_params_loaded += 1
model.set_dict(model_state_dict)
logger.info("There are {}/{} variables loaded into {}.".format(
num_params_loaded, len(model_state_dict),
model.__class__.__name__))
else:
raise ValueError(
'The pretrained model directory is not Found: {}'.format(
pretrained_model))
else:
logger.info(
'No pretrained model to load, {} will be trained from scratch.'.
format(model.__class__.__name__))
def resume(model, optimizer, resume_model):
if resume_model is not None:
logger.info('Resume model from {}'.format(resume_model))
if os.path.exists(resume_model):
resume_model = os.path.normpath(resume_model)
ckpt_path = os.path.join(resume_model, 'model.pdparams')
para_state_dict = paddle.load(ckpt_path)
ckpt_path = os.path.join(resume_model, 'model.pdopt')
opti_state_dict = paddle.load(ckpt_path)
model.set_state_dict(para_state_dict)
optimizer.set_state_dict(opti_state_dict)
iter = resume_model.split('_')[-1]
iter = int(iter)
return iter
else:
raise ValueError(
'Directory of the model needed to resume is not Found: {}'.
format(resume_model))
else:
logger.info('No model needed to resume.')
def worker_init_fn(worker_id):
np.random.seed(random.randint(0, 100000))
def get_image_list(image_path, valid_suffix=None, filter_key=None):
"""Get image list from image name or image directory name with valid suffix.
if needed, filter_key can be used to whether 'include' the key word.
When filter_key is not None,it indicates whether filenames should include certain key.
Args:
image_path(str): the image or image folder where you want to get a image list from.
valid_suffix(tuple): Contain only the suffix you want to include.
filter_key(dict): the key and whether you want to include it. e.g.:{"segmentation": True} will futher filter the imagename with segmentation in it.
"""
if valid_suffix is None:
valid_suffix = [
'nii.gz', 'nii', 'dcm', 'nrrd', 'mhd', 'raw', 'npy', 'mha'
]
image_list = []
if os.path.isfile(image_path):
if image_path.split("/")[-1].split('.',
maxsplit=1)[-1] in valid_suffix:
if filter_key is not None:
f_name = image_path.split("/")[
-1] # TODO change to system invariant
for key, val in filter_key:
if (key in f_name) is not val:
break
else:
image_list.append(image_path)
else:
image_list.append(image_path)
else:
raise FileNotFoundError(
'{} is not a file end with supported suffix, the support suffixes are {}.'
.format(image_path, valid_suffix))
# load image in a directory
elif os.path.isdir(image_path):
for root, dirs, files in os.walk(image_path):
for f in files:
if '.ipynb_checkpoints' in root:
continue
if f.split(".", maxsplit=1)[-1] in valid_suffix:
image_list.append(os.path.join(root, f))
else:
raise FileNotFoundError(
'`--image_path` is not found. it should be a path of image, or a directory including images.'
)
if len(image_list) == 0:
raise RuntimeError(
'There are not image file in `--image_path`={}'.format(image_path))
return image_list
| [
1,
529,
9507,
29958,
2168,
936,
10199,
29914,
13239,
29914,
13239,
29889,
2272,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29900,
349,
22352,
29925,
22352,
13189,
943,
29889,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
1678,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
5215,
3030,
1982,
13,
5215,
934,
908,
13,
5215,
2897,
13,
5215,
5694,
1445,
13,
5215,
12655,
408,
7442,
13,
5215,
4036,
13,
3166,
3142,
1982,
29889,
5510,
1053,
3142,
5510,
29892,
443,
1396,
13,
13,
5215,
282,
22352,
13,
13,
3166,
16083,
10199,
29889,
13239,
1053,
17927,
29892,
2377,
29918,
6272,
13,
3166,
16083,
10199,
29889,
13239,
29889,
10382,
1053,
5142,
29918,
1445,
29918,
392,
29918,
348,
510,
2139,
13,
13,
13,
29992,
4703,
1982,
29889,
4703,
12847,
13,
1753,
5706,
29918,
7382,
3972,
29898,
12322,
29901,
851,
353,
6213,
29892,
3579,
19290,
1125,
13,
1678,
14550,
5631,
403,
263,
13201,
3884,
12008,
13,
1678,
3884,
353,
2377,
29918,
6272,
29889,
29911,
3580,
29918,
17353,
565,
451,
3884,
1683,
3884,
13,
1678,
411,
5694,
1445,
29889,
5776,
1971,
653,
9882,
29898,
3972,
29922,
12322,
29892,
3579,
19290,
29897,
408,
903,
3972,
29901,
13,
4706,
7709,
903,
3972,
13,
13,
13,
1753,
2254,
29918,
296,
533,
29918,
4299,
29898,
4299,
29892,
758,
3018,
1312,
1125,
13,
1678,
565,
758,
3018,
1312,
338,
451,
6213,
29901,
13,
4706,
2254,
29918,
1457,
3018,
1312,
29918,
4299,
29898,
4299,
29892,
758,
3018,
1312,
29897,
13,
1678,
1683,
29901,
13,
4706,
17927,
29889,
27392,
877,
3664,
599,
758,
3018,
1312,
8636,
310,
6571,
526,
7500,
29892,
525,
320,
13,
462,
539,
525,
26495,
515,
22728,
470,
263,
758,
3018,
1312,
1250,
15933,
29889,
4286,
4830,
29898,
4299,
17255,
1990,
1649,
17255,
978,
1649,
876,
13,
13,
13,
1753,
5142,
29918,
1457,
3018,
1312,
29918,
4299,
29898,
1457,
3018,
1312,
29918,
4299,
1125,
13,
1678,
9995,
13,
1678,
25553,
758,
3018,
1312,
1904,
515,
3142,
29889,
13,
1678,
826,
3174,
29901,
13,
4706,
758,
3018,
1312,
29918,
4299,
313,
710,
1125,
278,
3142,
310,
758,
3018,
1312,
7688,
13,
1678,
16969,
29901,
13,
4706,
851,
29901,
278,
2224,
310,
758,
3018,
1312,
7688,
13,
1678,
9995,
13,
1678,
4974,
3142,
5510,
29898,
1457,
3018,
1312,
29918,
4299,
467,
1212,
2029,
29892,
376,
1576,
3142,
338,
451,
2854,
1213,
13,
13,
1678,
758,
3018,
1312,
29918,
4299,
353,
443,
1396,
29898,
1457,
3018,
1312,
29918,
4299,
29897,
13,
1678,
269,
3496,
420,
353,
758,
3018,
1312,
29918,
4299,
29889,
5451,
11219,
1495,
14352,
29896,
29962,
13,
1678,
565,
451,
269,
3496,
420,
29889,
1975,
2541,
29898,
877,
29873,
18828,
742,
525,
12637,
29889,
18828,
742,
525,
12637,
742,
525,
7554,
8785,
29901,
13,
4706,
269,
3496,
420,
353,
758,
3018,
1312,
29918,
4299,
29889,
5451,
11219,
1495,
14352,
29906,
29962,
13,
1678,
1683,
29901,
13,
4706,
269,
3496,
420,
353,
269,
3496,
420,
29889,
5451,
12839,
29861,
29900,
29962,
13,
13,
1678,
411,
5706,
29918,
7382,
3972,
580,
408,
903,
3972,
29901,
13,
4706,
411,
934,
908,
29889,
2283,
16542,
29898,
359,
29889,
2084,
29889,
7122,
29898,
10199,
29918,
6272,
29889,
29911,
3580,
29918,
17353,
29892,
269,
3496,
420,
22164,
13,
9651,
758,
3018,
1312,
29918,
4299,
353,
5142,
29918,
1445,
29918,
392,
29918,
348,
510,
2139,
29898,
13,
18884,
758,
3018,
1312,
29918,
4299,
29892,
13,
18884,
4078,
2084,
29922,
29918,
3972,
29892,
13,
18884,
4805,
2084,
29922,
10199,
29918,
6272,
29889,
15094,
29911,
4717,
1177,
3352,
29918,
20387,
29931,
29918,
17353,
29892,
13,
18884,
17541,
273,
420,
29922,
29879,
3496,
420,
29897,
13,
9651,
758,
3018,
1312,
29918,
4299,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1457,
3018,
1312,
29918,
4299,
29892,
525,
4299,
29889,
15926,
7529,
1495,
13,
1678,
736,
758,
3018,
1312,
29918,
4299,
13,
13,
13,
1753,
2254,
29918,
1457,
3018,
1312,
29918,
4299,
29898,
4299,
29892,
758,
3018,
1312,
29918,
4299,
1125,
13,
1678,
565,
758,
3018,
1312,
29918,
4299,
338,
451,
6213,
29901,
13,
4706,
17927,
29889,
3888,
29898,
13,
9651,
525,
23456,
758,
3018,
1312,
1904,
515,
6571,
4286,
4830,
29898,
1457,
3018,
1312,
29918,
4299,
876,
13,
13,
4706,
565,
3142,
5510,
29898,
1457,
3018,
1312,
29918,
4299,
467,
1212,
2029,
29901,
13,
9651,
758,
3018,
1312,
29918,
4299,
353,
5142,
29918,
1457,
3018,
1312,
29918,
4299,
29898,
1457,
3018,
1312,
29918,
4299,
29897,
13,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
1457,
3018,
1312,
29918,
4299,
1125,
13,
9651,
1702,
29918,
3859,
29918,
8977,
353,
282,
22352,
29889,
1359,
29898,
1457,
3018,
1312,
29918,
4299,
29897,
13,
13,
9651,
1904,
29918,
3859,
29918,
8977,
353,
1904,
29889,
3859,
29918,
8977,
580,
13,
9651,
6611,
353,
1904,
29918,
3859,
29918,
8977,
29889,
8149,
580,
13,
9651,
954,
29918,
7529,
29918,
15638,
353,
29871,
29900,
13,
9651,
363,
413,
297,
6611,
29901,
13,
18884,
565,
413,
451,
297,
1702,
29918,
3859,
29918,
8977,
29901,
13,
462,
1678,
17927,
29889,
27392,
703,
8875,
338,
451,
297,
758,
3018,
1312,
1904,
1642,
4830,
29898,
29895,
876,
13,
18884,
25342,
1051,
29898,
22752,
29918,
3859,
29918,
8977,
29961,
29895,
1822,
12181,
29897,
2804,
1051,
29898,
13,
462,
4706,
1904,
29918,
3859,
29918,
8977,
29961,
29895,
1822,
12181,
1125,
13,
462,
1678,
17927,
29889,
27392,
29898,
13,
462,
4706,
14704,
16033,
5690,
29962,
1383,
4085,
310,
758,
3018,
1312,
8636,
6571,
1838,
29915,
29873,
1993,
14030,
29925,
2267,
22042,
29901,
24335,
3185,
950,
29901,
426,
1800,
29908,
13,
462,
4706,
869,
4830,
29898,
29895,
29892,
1702,
29918,
3859,
29918,
8977,
29961,
29895,
1822,
12181,
29892,
13,
462,
18884,
1904,
29918,
3859,
29918,
8977,
29961,
29895,
1822,
12181,
876,
13,
18884,
1683,
29901,
13,
462,
1678,
1904,
29918,
3859,
29918,
8977,
29961,
29895,
29962,
353,
1702,
29918,
3859,
29918,
8977,
29961,
29895,
29962,
13,
462,
1678,
954,
29918,
7529,
29918,
15638,
4619,
29871,
29896,
13,
9651,
1904,
29889,
842,
29918,
8977,
29898,
4299,
29918,
3859,
29918,
8977,
29897,
13,
9651,
17927,
29889,
3888,
703,
8439,
526,
6571,
29914,
8875,
3651,
7500,
964,
6571,
1213,
29889,
4830,
29898,
13,
18884,
954,
29918,
7529,
29918,
15638,
29892,
7431,
29898,
4299,
29918,
3859,
29918,
8977,
511,
13,
18884,
1904,
17255,
1990,
1649,
17255,
978,
1649,
876,
13,
13,
4706,
1683,
29901,
13,
9651,
12020,
7865,
2392,
29898,
13,
18884,
525,
1576,
758,
3018,
1312,
1904,
3884,
338,
451,
7460,
29901,
6571,
4286,
4830,
29898,
13,
462,
1678,
758,
3018,
1312,
29918,
4299,
876,
13,
1678,
1683,
29901,
13,
4706,
17927,
29889,
3888,
29898,
13,
9651,
525,
3782,
758,
3018,
1312,
1904,
304,
2254,
29892,
6571,
674,
367,
16370,
515,
22728,
29889,
4286,
13,
9651,
3402,
29898,
4299,
17255,
1990,
1649,
17255,
978,
1649,
876,
13,
13,
13,
1753,
620,
2017,
29898,
4299,
29892,
5994,
3950,
29892,
620,
2017,
29918,
4299,
1125,
13,
1678,
565,
620,
2017,
29918,
4299,
338,
451,
6213,
29901,
13,
4706,
17927,
29889,
3888,
877,
1666,
2017,
1904,
515,
6571,
4286,
4830,
29898,
690,
2017,
29918,
4299,
876,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
690,
2017,
29918,
4299,
1125,
13,
9651,
620,
2017,
29918,
4299,
353,
2897,
29889,
2084,
29889,
12324,
2084,
29898,
690,
2017,
29918,
4299,
29897,
13,
9651,
274,
29895,
415,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
690,
2017,
29918,
4299,
29892,
525,
4299,
29889,
15926,
7529,
1495,
13,
9651,
1702,
29918,
3859,
29918,
8977,
353,
282,
22352,
29889,
1359,
29898,
384,
415,
29918,
2084,
29897,
13,
9651,
274,
29895,
415,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
690,
2017,
29918,
4299,
29892,
525,
4299,
29889,
29886,
1867,
415,
1495,
13,
9651,
3523,
29875,
29918,
3859,
29918,
8977,
353,
282,
22352,
29889,
1359,
29898,
384,
415,
29918,
2084,
29897,
13,
9651,
1904,
29889,
842,
29918,
3859,
29918,
8977,
29898,
22752,
29918,
3859,
29918,
8977,
29897,
13,
9651,
5994,
3950,
29889,
842,
29918,
3859,
29918,
8977,
29898,
3670,
29875,
29918,
3859,
29918,
8977,
29897,
13,
13,
9651,
4256,
353,
620,
2017,
29918,
4299,
29889,
5451,
877,
29918,
1495,
14352,
29896,
29962,
13,
9651,
4256,
353,
938,
29898,
1524,
29897,
13,
9651,
736,
4256,
13,
4706,
1683,
29901,
13,
9651,
12020,
7865,
2392,
29898,
13,
18884,
525,
9882,
310,
278,
1904,
4312,
304,
620,
2017,
338,
451,
7460,
29901,
6571,
4286,
13,
18884,
3402,
29898,
690,
2017,
29918,
4299,
876,
13,
1678,
1683,
29901,
13,
4706,
17927,
29889,
3888,
877,
3782,
1904,
4312,
304,
620,
2017,
29889,
1495,
13,
13,
13,
1753,
15645,
29918,
2344,
29918,
9144,
29898,
24602,
29918,
333,
1125,
13,
1678,
7442,
29889,
8172,
29889,
26776,
29898,
8172,
29889,
9502,
524,
29898,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
876,
13,
13,
13,
1753,
679,
29918,
3027,
29918,
1761,
29898,
3027,
29918,
2084,
29892,
2854,
29918,
2146,
600,
861,
29922,
8516,
29892,
4175,
29918,
1989,
29922,
8516,
1125,
13,
1678,
9995,
2577,
1967,
1051,
515,
1967,
1024,
470,
1967,
3884,
1024,
411,
2854,
25557,
29889,
13,
13,
1678,
565,
4312,
29892,
4175,
29918,
1989,
508,
367,
1304,
304,
3692,
525,
2856,
29915,
278,
1820,
1734,
29889,
13,
1678,
1932,
4175,
29918,
1989,
338,
451,
6213,
30214,
277,
14088,
3692,
977,
264,
1280,
881,
3160,
3058,
1820,
29889,
13,
13,
13,
1678,
826,
3174,
29901,
13,
1678,
1967,
29918,
2084,
29898,
710,
1125,
278,
1967,
470,
1967,
4138,
988,
366,
864,
304,
679,
263,
1967,
1051,
515,
29889,
13,
1678,
2854,
29918,
2146,
600,
861,
29898,
23583,
1125,
2866,
475,
871,
278,
25557,
366,
864,
304,
3160,
29889,
13,
1678,
4175,
29918,
1989,
29898,
8977,
1125,
278,
1820,
322,
3692,
366,
864,
304,
3160,
372,
29889,
321,
29889,
29887,
4898,
6377,
28192,
362,
1115,
5852,
29913,
674,
3105,
2276,
4175,
278,
6382,
3871,
411,
10768,
362,
297,
372,
29889,
13,
13,
1678,
9995,
13,
1678,
565,
2854,
29918,
2146,
600,
861,
338,
6213,
29901,
13,
4706,
2854,
29918,
2146,
600,
861,
353,
518,
13,
9651,
525,
1240,
29875,
29889,
18828,
742,
525,
1240,
29875,
742,
525,
29881,
4912,
742,
525,
22230,
5499,
742,
525,
29885,
16440,
742,
525,
1610,
742,
525,
29876,
2272,
742,
525,
29885,
2350,
29915,
13,
4706,
4514,
13,
13,
1678,
1967,
29918,
1761,
353,
5159,
13,
1678,
565,
2897,
29889,
2084,
29889,
275,
1445,
29898,
3027,
29918,
2084,
1125,
13,
4706,
565,
1967,
29918,
2084,
29889,
5451,
11974,
1159,
14352,
29896,
1822,
5451,
12839,
742,
13,
462,
462,
965,
4236,
5451,
29922,
29896,
9601,
29899,
29896,
29962,
297,
2854,
29918,
2146,
600,
861,
29901,
13,
9651,
565,
4175,
29918,
1989,
338,
451,
6213,
29901,
13,
18884,
285,
29918,
978,
353,
1967,
29918,
2084,
29889,
5451,
11974,
1159,
29961,
13,
462,
1678,
448,
29896,
29962,
29871,
396,
14402,
1735,
304,
1788,
22619,
13,
18884,
363,
1820,
29892,
659,
297,
4175,
29918,
1989,
29901,
13,
462,
1678,
565,
313,
1989,
297,
285,
29918,
978,
29897,
338,
451,
659,
29901,
13,
462,
4706,
2867,
13,
18884,
1683,
29901,
13,
462,
1678,
1967,
29918,
1761,
29889,
4397,
29898,
3027,
29918,
2084,
29897,
13,
13,
9651,
1683,
29901,
13,
18884,
1967,
29918,
1761,
29889,
4397,
29898,
3027,
29918,
2084,
29897,
13,
4706,
1683,
29901,
13,
9651,
12020,
3497,
17413,
2392,
29898,
13,
18884,
525,
8875,
338,
451,
263,
934,
1095,
411,
6969,
25557,
29892,
278,
2304,
25557,
267,
526,
426,
1836,
29915,
13,
18884,
869,
4830,
29898,
3027,
29918,
2084,
29892,
2854,
29918,
2146,
600,
861,
876,
13,
13,
1678,
396,
2254,
1967,
297,
263,
3884,
13,
1678,
25342,
2897,
29889,
2084,
29889,
275,
3972,
29898,
3027,
29918,
2084,
1125,
13,
4706,
363,
3876,
29892,
4516,
29879,
29892,
2066,
297,
2897,
29889,
20919,
29898,
3027,
29918,
2084,
1125,
13,
9651,
363,
285,
297,
2066,
29901,
13,
18884,
565,
15300,
666,
948,
29890,
29918,
3198,
9748,
29915,
297,
3876,
29901,
13,
462,
1678,
6773,
13,
18884,
565,
285,
29889,
5451,
17350,
613,
4236,
5451,
29922,
29896,
9601,
29899,
29896,
29962,
297,
2854,
29918,
2146,
600,
861,
29901,
13,
462,
1678,
1967,
29918,
1761,
29889,
4397,
29898,
359,
29889,
2084,
29889,
7122,
29898,
4632,
29892,
285,
876,
13,
1678,
1683,
29901,
13,
4706,
12020,
3497,
17413,
2392,
29898,
13,
9651,
525,
29952,
489,
3027,
29918,
2084,
29952,
338,
451,
1476,
29889,
372,
881,
367,
263,
2224,
310,
1967,
29892,
470,
263,
3884,
3704,
4558,
6169,
13,
4706,
1723,
13,
13,
1678,
565,
7431,
29898,
3027,
29918,
1761,
29897,
1275,
29871,
29900,
29901,
13,
4706,
12020,
24875,
2392,
29898,
13,
9651,
525,
8439,
526,
451,
1967,
934,
297,
22974,
3027,
29918,
2084,
29952,
3790,
29913,
4286,
4830,
29898,
3027,
29918,
2084,
876,
13,
13,
1678,
736,
1967,
29918,
1761,
13,
2
] |
cgi-bin/paint_x2_unet/unet.py | ohong/pretty-whale | 2,990 | 72418 | #!/usr/bin/env python
import numpy as np
import math
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import cuda, optimizers, serializers, Variable
from chainer import function
from chainer.utils import type_check
class UNET(chainer.Chain):
def __init__(self):
super(UNET, self).__init__(
c0=L.Convolution2D(4, 32, 3, 1, 1),
c1=L.Convolution2D(32, 64, 4, 2, 1),
c2=L.Convolution2D(64, 64, 3, 1, 1),
c3=L.Convolution2D(64, 128, 4, 2, 1),
c4=L.Convolution2D(128, 128, 3, 1, 1),
c5=L.Convolution2D(128, 256, 4, 2, 1),
c6=L.Convolution2D(256, 256, 3, 1, 1),
c7=L.Convolution2D(256, 512, 4, 2, 1),
c8=L.Convolution2D(512, 512, 3, 1, 1),
dc8=L.Deconvolution2D(1024, 512, 4, 2, 1),
dc7=L.Convolution2D(512, 256, 3, 1, 1),
dc6=L.Deconvolution2D(512, 256, 4, 2, 1),
dc5=L.Convolution2D(256, 128, 3, 1, 1),
dc4=L.Deconvolution2D(256, 128, 4, 2, 1),
dc3=L.Convolution2D(128, 64, 3, 1, 1),
dc2=L.Deconvolution2D(128, 64, 4, 2, 1),
dc1=L.Convolution2D(64, 32, 3, 1, 1),
dc0=L.Convolution2D(64, 3, 3, 1, 1),
bnc0=L.BatchNormalization(32),
bnc1=L.BatchNormalization(64),
bnc2=L.BatchNormalization(64),
bnc3=L.BatchNormalization(128),
bnc4=L.BatchNormalization(128),
bnc5=L.BatchNormalization(256),
bnc6=L.BatchNormalization(256),
bnc7=L.BatchNormalization(512),
bnc8=L.BatchNormalization(512),
bnd8=L.BatchNormalization(512),
bnd7=L.BatchNormalization(256),
bnd6=L.BatchNormalization(256),
bnd5=L.BatchNormalization(128),
bnd4=L.BatchNormalization(128),
bnd3=L.BatchNormalization(64),
bnd2=L.BatchNormalization(64),
bnd1=L.BatchNormalization(32)
# l = L.Linear(3*3*256, 2)'
)
def calc(self, x):
e0 = F.relu(self.bnc0(self.c0(x)))
e1 = F.relu(self.bnc1(self.c1(e0)))
e2 = F.relu(self.bnc2(self.c2(e1)))
del e1
e3 = F.relu(self.bnc3(self.c3(e2)))
e4 = F.relu(self.bnc4(self.c4(e3)))
del e3
e5 = F.relu(self.bnc5(self.c5(e4)))
e6 = F.relu(self.bnc6(self.c6(e5)))
del e5
e7 = F.relu(self.bnc7(self.c7(e6)))
e8 = F.relu(self.bnc8(self.c8(e7)))
d8 = F.relu(self.bnd8(self.dc8(F.concat([e7, e8]))))
del e7, e8
d7 = F.relu(self.bnd7(self.dc7(d8)))
del d8
d6 = F.relu(self.bnd6(self.dc6(F.concat([e6, d7]))))
del d7, e6
d5 = F.relu(self.bnd5(self.dc5(d6)))
del d6
d4 = F.relu(self.bnd4(self.dc4(F.concat([e4, d5]))))
del d5, e4
d3 = F.relu(self.bnd3(self.dc3(d4)))
del d4
d2 = F.relu(self.bnd2(self.dc2(F.concat([e2, d3]))))
del d3, e2
d1 = F.relu(self.bnd1(self.dc1(d2)))
del d2
d0 = self.dc0(F.concat([e0, d1]))
return d0
def __call__(self, x, t):
h = self.calc(x)
loss = F.mean_absolute_error(h, t)
chainer.report({'loss': loss}, self)
return loss
class DIS(chainer.Chain):
def __init__(self):
super(DIS, self).__init__(
c1=L.Convolution2D(3, 32, 4, 2, 1),
c2=L.Convolution2D(32, 32, 3, 1, 1),
c3=L.Convolution2D(32, 64, 4, 2, 1),
c4=L.Convolution2D(64, 64, 3, 1, 1),
c5=L.Convolution2D(64, 128, 4, 2, 1),
c6=L.Convolution2D(128, 128, 3, 1, 1),
c7=L.Convolution2D(128, 256, 4, 2, 1),
l8l=L.Linear(None, 2,
initialW=chainer.initializers.HeNormal(
math.sqrt(0.02 * math.sqrt(8 * 8 * 256) / 2))),
bnc1=L.BatchNormalization(32),
bnc2=L.BatchNormalization(32),
bnc3=L.BatchNormalization(64),
bnc4=L.BatchNormalization(64),
bnc5=L.BatchNormalization(128),
bnc6=L.BatchNormalization(128),
bnc7=L.BatchNormalization(256),
)
def calc(self, x):
h = F.relu(self.bnc1(self.c1(x)))
h = F.relu(self.bnc2(self.c2(h)))
h = F.relu(self.bnc3(self.c3(h)))
h = F.relu(self.bnc4(self.c4(h)))
h = F.relu(self.bnc5(self.c5(h)))
h = F.relu(self.bnc6(self.c6(h)))
h = F.relu(self.bnc7(self.c7(h)))
return self.l8l(h)
def __call__(self, x, t):
h = self.calc(x)
loss = F.softmax_cross_entropy(h, t)
#chainer.report({'loss': loss }, self)
return loss
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
5844,
13,
5215,
521,
4008,
13,
5215,
521,
4008,
29889,
12171,
408,
383,
13,
5215,
521,
4008,
29889,
4965,
408,
365,
13,
3166,
521,
4008,
1053,
274,
6191,
29892,
5994,
19427,
29892,
7797,
19427,
29892,
28736,
13,
13,
13,
3166,
521,
4008,
1053,
740,
13,
3166,
521,
4008,
29889,
13239,
1053,
1134,
29918,
3198,
13,
13,
13,
1990,
501,
6006,
29898,
305,
4008,
29889,
14688,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
29898,
3904,
2544,
29892,
1583,
467,
1649,
2344,
12035,
13,
9651,
274,
29900,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29946,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
274,
29896,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29941,
29906,
29892,
29871,
29953,
29946,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
274,
29906,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
274,
29941,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
274,
29946,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
274,
29945,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29896,
29906,
29947,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
274,
29953,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29906,
29945,
29953,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
274,
29955,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29906,
29945,
29953,
29892,
29871,
29945,
29896,
29906,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
274,
29947,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29945,
29896,
29906,
29892,
29871,
29945,
29896,
29906,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
13,
9651,
270,
29883,
29947,
29922,
29931,
29889,
2772,
535,
4068,
29906,
29928,
29898,
29896,
29900,
29906,
29946,
29892,
29871,
29945,
29896,
29906,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
270,
29883,
29955,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29945,
29896,
29906,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
270,
29883,
29953,
29922,
29931,
29889,
2772,
535,
4068,
29906,
29928,
29898,
29945,
29896,
29906,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
270,
29883,
29945,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29906,
29945,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
270,
29883,
29946,
29922,
29931,
29889,
2772,
535,
4068,
29906,
29928,
29898,
29906,
29945,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
270,
29883,
29941,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29896,
29906,
29947,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
270,
29883,
29906,
29922,
29931,
29889,
2772,
535,
4068,
29906,
29928,
29898,
29896,
29906,
29947,
29892,
29871,
29953,
29946,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
270,
29883,
29896,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29953,
29946,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
270,
29883,
29900,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29953,
29946,
29892,
29871,
29941,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
13,
9651,
289,
17608,
29900,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29941,
29906,
511,
13,
9651,
289,
17608,
29896,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29953,
29946,
511,
13,
9651,
289,
17608,
29906,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29953,
29946,
511,
13,
9651,
289,
17608,
29941,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29896,
29906,
29947,
511,
13,
9651,
289,
17608,
29946,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29896,
29906,
29947,
511,
13,
9651,
289,
17608,
29945,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29906,
29945,
29953,
511,
13,
9651,
289,
17608,
29953,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29906,
29945,
29953,
511,
13,
9651,
289,
17608,
29955,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29945,
29896,
29906,
511,
13,
9651,
289,
17608,
29947,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29945,
29896,
29906,
511,
13,
13,
9651,
289,
299,
29947,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29945,
29896,
29906,
511,
13,
9651,
289,
299,
29955,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29906,
29945,
29953,
511,
13,
9651,
289,
299,
29953,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29906,
29945,
29953,
511,
13,
9651,
289,
299,
29945,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29896,
29906,
29947,
511,
13,
9651,
289,
299,
29946,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29896,
29906,
29947,
511,
13,
9651,
289,
299,
29941,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29953,
29946,
511,
13,
9651,
289,
299,
29906,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29953,
29946,
511,
13,
9651,
289,
299,
29896,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29941,
29906,
29897,
13,
9651,
396,
301,
353,
365,
29889,
12697,
29898,
29941,
29930,
29941,
29930,
29906,
29945,
29953,
29892,
29871,
29906,
16029,
13,
4706,
1723,
13,
13,
1678,
822,
22235,
29898,
1311,
29892,
921,
1125,
13,
4706,
321,
29900,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29900,
29898,
1311,
29889,
29883,
29900,
29898,
29916,
4961,
13,
4706,
321,
29896,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29896,
29898,
1311,
29889,
29883,
29896,
29898,
29872,
29900,
4961,
13,
4706,
321,
29906,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29906,
29898,
1311,
29889,
29883,
29906,
29898,
29872,
29896,
4961,
13,
4706,
628,
321,
29896,
13,
4706,
321,
29941,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29941,
29898,
1311,
29889,
29883,
29941,
29898,
29872,
29906,
4961,
13,
4706,
321,
29946,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29946,
29898,
1311,
29889,
29883,
29946,
29898,
29872,
29941,
4961,
13,
4706,
628,
321,
29941,
13,
4706,
321,
29945,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29945,
29898,
1311,
29889,
29883,
29945,
29898,
29872,
29946,
4961,
13,
4706,
321,
29953,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29953,
29898,
1311,
29889,
29883,
29953,
29898,
29872,
29945,
4961,
13,
4706,
628,
321,
29945,
13,
4706,
321,
29955,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29955,
29898,
1311,
29889,
29883,
29955,
29898,
29872,
29953,
4961,
13,
4706,
321,
29947,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29947,
29898,
1311,
29889,
29883,
29947,
29898,
29872,
29955,
4961,
13,
13,
4706,
270,
29947,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
29890,
299,
29947,
29898,
1311,
29889,
13891,
29947,
29898,
29943,
29889,
17685,
4197,
29872,
29955,
29892,
321,
29947,
12622,
876,
13,
4706,
628,
321,
29955,
29892,
321,
29947,
13,
4706,
270,
29955,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
29890,
299,
29955,
29898,
1311,
29889,
13891,
29955,
29898,
29881,
29947,
4961,
13,
4706,
628,
270,
29947,
13,
4706,
270,
29953,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
29890,
299,
29953,
29898,
1311,
29889,
13891,
29953,
29898,
29943,
29889,
17685,
4197,
29872,
29953,
29892,
270,
29955,
12622,
876,
13,
4706,
628,
270,
29955,
29892,
321,
29953,
13,
4706,
270,
29945,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
29890,
299,
29945,
29898,
1311,
29889,
13891,
29945,
29898,
29881,
29953,
4961,
13,
4706,
628,
270,
29953,
13,
4706,
270,
29946,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
29890,
299,
29946,
29898,
1311,
29889,
13891,
29946,
29898,
29943,
29889,
17685,
4197,
29872,
29946,
29892,
270,
29945,
12622,
876,
13,
4706,
628,
270,
29945,
29892,
321,
29946,
13,
4706,
270,
29941,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
29890,
299,
29941,
29898,
1311,
29889,
13891,
29941,
29898,
29881,
29946,
4961,
13,
4706,
628,
270,
29946,
13,
4706,
270,
29906,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
29890,
299,
29906,
29898,
1311,
29889,
13891,
29906,
29898,
29943,
29889,
17685,
4197,
29872,
29906,
29892,
270,
29941,
12622,
876,
13,
4706,
628,
270,
29941,
29892,
321,
29906,
13,
4706,
270,
29896,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
29890,
299,
29896,
29898,
1311,
29889,
13891,
29896,
29898,
29881,
29906,
4961,
13,
4706,
628,
270,
29906,
13,
4706,
270,
29900,
353,
1583,
29889,
13891,
29900,
29898,
29943,
29889,
17685,
4197,
29872,
29900,
29892,
270,
29896,
12622,
13,
13,
4706,
736,
270,
29900,
13,
13,
1678,
822,
4770,
4804,
12035,
1311,
29892,
921,
29892,
260,
1125,
13,
4706,
298,
353,
1583,
29889,
28667,
29898,
29916,
29897,
13,
4706,
6410,
353,
383,
29889,
12676,
29918,
23552,
29918,
2704,
29898,
29882,
29892,
260,
29897,
13,
4706,
521,
4008,
29889,
12276,
3319,
29915,
6758,
2396,
6410,
1118,
1583,
29897,
13,
4706,
736,
6410,
13,
13,
13,
1990,
28657,
29898,
305,
4008,
29889,
14688,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
29898,
23711,
29892,
1583,
467,
1649,
2344,
12035,
13,
9651,
274,
29896,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29941,
29892,
29871,
29941,
29906,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
274,
29906,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29941,
29906,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
274,
29941,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29941,
29906,
29892,
29871,
29953,
29946,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
274,
29946,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29953,
29946,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
274,
29945,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
274,
29953,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29896,
29906,
29947,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29896,
511,
13,
9651,
274,
29955,
29922,
29931,
29889,
1168,
4068,
29906,
29928,
29898,
29896,
29906,
29947,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29896,
511,
13,
9651,
301,
29947,
29880,
29922,
29931,
29889,
12697,
29898,
8516,
29892,
29871,
29906,
29892,
13,
462,
308,
2847,
29956,
29922,
305,
4008,
29889,
11228,
19427,
29889,
3868,
19077,
29898,
13,
462,
632,
5844,
29889,
3676,
29898,
29900,
29889,
29900,
29906,
334,
5844,
29889,
3676,
29898,
29947,
334,
29871,
29947,
334,
29871,
29906,
29945,
29953,
29897,
847,
29871,
29906,
876,
511,
13,
13,
9651,
289,
17608,
29896,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29941,
29906,
511,
13,
9651,
289,
17608,
29906,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29941,
29906,
511,
13,
9651,
289,
17608,
29941,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29953,
29946,
511,
13,
9651,
289,
17608,
29946,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29953,
29946,
511,
13,
9651,
289,
17608,
29945,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29896,
29906,
29947,
511,
13,
9651,
289,
17608,
29953,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29896,
29906,
29947,
511,
13,
9651,
289,
17608,
29955,
29922,
29931,
29889,
23145,
19077,
2133,
29898,
29906,
29945,
29953,
511,
13,
4706,
1723,
13,
13,
1678,
822,
22235,
29898,
1311,
29892,
921,
1125,
13,
4706,
298,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29896,
29898,
1311,
29889,
29883,
29896,
29898,
29916,
4961,
13,
4706,
298,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29906,
29898,
1311,
29889,
29883,
29906,
29898,
29882,
4961,
13,
4706,
298,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29941,
29898,
1311,
29889,
29883,
29941,
29898,
29882,
4961,
13,
4706,
298,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29946,
29898,
1311,
29889,
29883,
29946,
29898,
29882,
4961,
13,
4706,
298,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29945,
29898,
1311,
29889,
29883,
29945,
29898,
29882,
4961,
13,
4706,
298,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29953,
29898,
1311,
29889,
29883,
29953,
29898,
29882,
4961,
13,
4706,
298,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
11197,
29883,
29955,
29898,
1311,
29889,
29883,
29955,
29898,
29882,
4961,
13,
4706,
736,
1583,
29889,
29880,
29947,
29880,
29898,
29882,
29897,
13,
13,
1678,
822,
4770,
4804,
12035,
1311,
29892,
921,
29892,
260,
1125,
13,
4706,
298,
353,
1583,
29889,
28667,
29898,
29916,
29897,
13,
4706,
6410,
353,
383,
29889,
2695,
3317,
29918,
19128,
29918,
296,
14441,
29898,
29882,
29892,
260,
29897,
13,
4706,
396,
305,
4008,
29889,
12276,
3319,
29915,
6758,
2396,
6410,
2981,
1583,
29897,
13,
4706,
736,
6410,
13,
2
] |
cohesity_management_sdk/models/office_365_env_job_parameters.py | nick6655/management-sdk-python | 18 | 165479 | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
import cohesity_management_sdk.models.one_drive_env_job_parameters
import cohesity_management_sdk.models.outlook_env_job_parameters
class Office365EnvJobParameters(object):
"""Implementation of the 'Office365EnvJobParameters' model.
Specifies Office365 parameters applicable for all Office365 Environment
type Protection Sources in a Protection Job. This encapsulates both
OneDrive
& Mailbox parameters.
Attributes:
onedrive_parameters (OneDriveEnvJobParameters): Specifies OneDrive job
parameters applicable for all Office365 Environment type
Protection Sources in a Protection Job.
outlook_parameters (OutlookEnvJobParameters): Specifies Outlook job
parameters applicable for all Office365 Environment type
Protection Sources in a Protection Job.
"""
# Create a mapping from Model property names to API property names
_names = {
"onedrive_parameters":'onedriveParameters',
"outlook_parameters":'outlookParameters'
}
def __init__(self,
onedrive_parameters=None,
outlook_parameters=None):
"""Constructor for the Office365EnvJobParameters class"""
# Initialize members of the class
self.onedrive_parameters = onedrive_parameters
self.outlook_parameters = outlook_parameters
@classmethod
def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object as
obtained from the deserialization of the server's response. The keys
MUST match property names in the API description.
Returns:
object: An instance of this structure class.
"""
if dictionary is None:
return None
# Extract variables from the dictionary
onedrive_parameters = cohesity_management_sdk.models.one_drive_env_job_parameters.OneDriveEnvJobParameters.from_dictionary(dictionary.get('onedriveParameters')) if dictionary.get('onedriveParameters') else None
outlook_parameters = cohesity_management_sdk.models.outlook_env_job_parameters.OutlookEnvJobParameters.from_dictionary(dictionary.get('outlookParameters')) if dictionary.get('outlookParameters') else None
# Return an object of this model
return cls(onedrive_parameters,
outlook_parameters)
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29896,
315,
1148,
267,
537,
9266,
29889,
13,
13,
5215,
16165,
267,
537,
29918,
21895,
29918,
15348,
29889,
9794,
29889,
650,
29918,
21594,
29918,
6272,
29918,
9057,
29918,
16744,
13,
5215,
16165,
267,
537,
29918,
21895,
29918,
15348,
29889,
9794,
29889,
449,
6914,
29918,
6272,
29918,
9057,
29918,
16744,
13,
13,
1990,
11367,
29941,
29953,
29945,
21745,
11947,
11507,
29898,
3318,
1125,
13,
13,
1678,
9995,
1888,
14607,
310,
278,
525,
27247,
29941,
29953,
29945,
21745,
11947,
11507,
29915,
1904,
29889,
13,
13,
1678,
12048,
11057,
11367,
29941,
29953,
29945,
4128,
22903,
363,
599,
11367,
29941,
29953,
29945,
16738,
13,
1678,
1134,
14409,
428,
317,
2863,
297,
263,
14409,
428,
17163,
29889,
910,
2094,
2547,
352,
1078,
1716,
13,
1678,
3118,
29928,
4401,
13,
1678,
669,
18623,
1884,
4128,
29889,
13,
13,
1678,
6212,
5026,
29901,
13,
4706,
373,
287,
4401,
29918,
16744,
313,
6716,
29928,
4401,
21745,
11947,
11507,
1125,
12048,
11057,
3118,
29928,
4401,
4982,
13,
9651,
4128,
22903,
363,
599,
11367,
29941,
29953,
29945,
16738,
1134,
13,
9651,
14409,
428,
317,
2863,
297,
263,
14409,
428,
17163,
29889,
13,
4706,
714,
6914,
29918,
16744,
313,
3744,
6914,
21745,
11947,
11507,
1125,
12048,
11057,
4451,
6914,
4982,
13,
9651,
4128,
22903,
363,
599,
11367,
29941,
29953,
29945,
16738,
1134,
13,
9651,
14409,
428,
317,
2863,
297,
263,
14409,
428,
17163,
29889,
13,
13,
1678,
9995,
13,
13,
1678,
396,
6204,
263,
10417,
515,
8125,
2875,
2983,
304,
3450,
2875,
2983,
13,
1678,
903,
7039,
353,
426,
13,
4706,
376,
22367,
4401,
29918,
16744,
1115,
29915,
22367,
4401,
11507,
742,
13,
4706,
376,
449,
6914,
29918,
16744,
1115,
29915,
449,
6914,
11507,
29915,
13,
1678,
500,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
373,
287,
4401,
29918,
16744,
29922,
8516,
29892,
13,
462,
714,
6914,
29918,
16744,
29922,
8516,
1125,
13,
4706,
9995,
23770,
363,
278,
11367,
29941,
29953,
29945,
21745,
11947,
11507,
770,
15945,
29908,
13,
13,
4706,
396,
25455,
5144,
310,
278,
770,
13,
4706,
1583,
29889,
22367,
4401,
29918,
16744,
353,
373,
287,
4401,
29918,
16744,
13,
4706,
1583,
29889,
449,
6914,
29918,
16744,
353,
714,
6914,
29918,
16744,
13,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
27126,
29898,
25932,
29892,
13,
462,
4706,
8600,
1125,
13,
4706,
9995,
9832,
1078,
385,
2777,
310,
445,
1904,
515,
263,
8600,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
8600,
313,
27126,
1125,
319,
8600,
8954,
310,
278,
1203,
408,
13,
9651,
7625,
515,
278,
16964,
616,
2133,
310,
278,
1923,
29915,
29879,
2933,
29889,
450,
6611,
13,
9651,
341,
17321,
1993,
2875,
2983,
297,
278,
3450,
6139,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
1203,
29901,
530,
2777,
310,
445,
3829,
770,
29889,
13,
13,
4706,
9995,
13,
4706,
565,
8600,
338,
6213,
29901,
13,
9651,
736,
6213,
13,
13,
4706,
396,
7338,
1461,
3651,
515,
278,
8600,
13,
4706,
373,
287,
4401,
29918,
16744,
353,
16165,
267,
537,
29918,
21895,
29918,
15348,
29889,
9794,
29889,
650,
29918,
21594,
29918,
6272,
29918,
9057,
29918,
16744,
29889,
6716,
29928,
4401,
21745,
11947,
11507,
29889,
3166,
29918,
27126,
29898,
27126,
29889,
657,
877,
22367,
4401,
11507,
8785,
565,
8600,
29889,
657,
877,
22367,
4401,
11507,
1495,
1683,
6213,
13,
4706,
714,
6914,
29918,
16744,
353,
16165,
267,
537,
29918,
21895,
29918,
15348,
29889,
9794,
29889,
449,
6914,
29918,
6272,
29918,
9057,
29918,
16744,
29889,
3744,
6914,
21745,
11947,
11507,
29889,
3166,
29918,
27126,
29898,
27126,
29889,
657,
877,
449,
6914,
11507,
8785,
565,
8600,
29889,
657,
877,
449,
6914,
11507,
1495,
1683,
6213,
13,
13,
4706,
396,
7106,
385,
1203,
310,
445,
1904,
13,
4706,
736,
1067,
29879,
29898,
22367,
4401,
29918,
16744,
29892,
13,
462,
259,
714,
6914,
29918,
16744,
29897,
13,
13,
13,
2
] |
data_science_app/app.py | Johne-DuChene/data_science_learning_app | 0 | 4050 | <gh_stars>0
from flask import Flask
# initialize the app
app = Flask(__name__)
# execute iris function at /iris route
@app.route("/iris")
def iris():
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
X, y = load_iris(return_X_y=True)
clf = LogisticRegression(
random_state = 42,
solver="lbfgs",
multi_class="multinomial"
).fit(X, y)
return str(clf.predict(X[:2, :])) | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
29784,
1053,
2379,
1278,
13,
13,
29937,
11905,
278,
623,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
13,
29937,
6222,
3805,
275,
740,
472,
847,
381,
275,
5782,
13,
29992,
932,
29889,
13134,
11974,
381,
275,
1159,
13,
1753,
3805,
275,
7295,
13,
1678,
515,
2071,
19668,
29889,
14538,
1691,
1053,
2254,
29918,
381,
275,
13,
1678,
515,
2071,
19668,
29889,
10660,
29918,
4299,
1053,
4522,
4695,
4597,
23881,
13,
1678,
1060,
29892,
343,
353,
2254,
29918,
381,
275,
29898,
2457,
29918,
29990,
29918,
29891,
29922,
5574,
29897,
13,
1678,
1067,
29888,
353,
4522,
4695,
4597,
23881,
29898,
13,
4706,
4036,
29918,
3859,
353,
29871,
29946,
29906,
29892,
13,
4706,
899,
369,
543,
29880,
1635,
3174,
613,
13,
4706,
2473,
29918,
1990,
543,
4713,
262,
7615,
29908,
13,
1678,
13742,
9202,
29898,
29990,
29892,
343,
29897,
13,
13,
1678,
736,
851,
29898,
695,
29888,
29889,
27711,
29898,
29990,
7503,
29906,
29892,
584,
12622,
2
] |
demo_viskp.py | Jillyyy/SPINN | 0 | 110497 | """
Demo code
To run our method, you need a bounding box around the person. The person needs to be centered inside the bounding box and the bounding box should be relatively tight. You can either supply the bounding box directly or provide an [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose) detection file. In the latter case we infer the bounding box from the detections.
In summary, we provide 3 different ways to use our demo code and models:
1. Provide only an input image (using ```--img```), in which case it is assumed that it is already cropped with the person centered in the image.
2. Provide an input image as before, together with the OpenPose detection .json (using ```--openpose```). Our code will use the detections to compute the bounding box and crop the image.
3. Provide an image and a bounding box (using ```--bbox```). The expected format for the json file can be seen in ```examples/im1010_bbox.json```.
Example with OpenPose detection .json
```
python3 demo.py --checkpoint=data/model_checkpoint.pt --img=examples/im1010.png --openpose=examples/im1010_openpose.json
```
Example with predefined Bounding Box
```
python3 demo.py --checkpoint=data/model_checkpoint.pt --img=examples/im1010.png --bbox=examples/im1010_bbox.json
```
Example with cropped and centered image
```
python3 demo.py --checkpoint=data/model_checkpoint.pt --img=examples/im1010.png
```
Running the previous command will save the results in ```examples/im1010_{shape,shape_side}.png```. The file ```im1010_shape.png``` shows the overlayed reconstruction of human shape. We also render a side view, saved in ```im1010_shape_side.png```.
"""
import torch
from torchvision.transforms import Normalize
import numpy as np
import cv2
import argparse
import json
import os
from tqdm import tqdm
from models import hmr, SMPL
from utils.imutils import crop
from utils.renderer import Renderer
import config
import constants
from utils.geometry import batch_rodrigues, perspective_projection, estimate_translation
parser = argparse.ArgumentParser()
parser.add_argument('--checkpoint', required=True, help='Path to pretrained checkpoint')
# parser.add_argument('--img', type=str, required=True, help='Path to input image')
parser.add_argument('--bbox', type=str, default=None, help='Path to .json file containing bounding box coordinates')
parser.add_argument('--openpose', type=str, default=None, help='Path to .json containing openpose detections')
parser.add_argument('--outfile', type=str, default=None, help='Filename of output images. If not set use input filename.')
def draw_full_skeleton(input_image, joints, all_joints=None, draw_edges=True, vis=None, all_vis=None, radius=None):
"""
joints is 3 x 19. but if not will transpose it.
0: Right ankle
1: Right knee
2: Right hip
3: Left hip
4: Left knee
5: Left ankle
6: Right wrist
7: Right elbow
8: Right shoulder
9: Left shoulder
10: Left elbow
11: Left wrist
12: Neck
13: Head top
14: nose
15: left_eye
16: right_eye
17: left_ear
18: right_ear
"""
joints = joints + 112
print(joints)
if radius is None:
radius = max(4, (np.mean(input_image.shape[:2]) * 0.01).astype(int))
colors = {
'pink': np.array([197, 27, 125]), # L lower leg
'light_pink': np.array([233, 163, 201]), # L upper leg
'light_green': np.array([161, 215, 106]), # L lower arm
'green': np.array([77, 146, 33]), # L upper arm
'red': np.array([215, 48, 39]), # head
'light_red': np.array([252, 146, 114]), # head
'light_orange': np.array([252, 141, 89]), # chest
'purple': np.array([118, 42, 131]), # R lower leg
'light_purple': np.array([175, 141, 195]), # R upper
'light_blue': np.array([145, 191, 219]), # R lower arm
'blue': np.array([0, 0, 255]), # R upper arm
'gray': np.array([130, 130, 130]), #
'white': np.array([255, 255, 255]) #
}
image = input_image.copy()
input_is_float = False
if np.issubdtype(image.dtype, np.float):
input_is_float = True
max_val = image.max()
if max_val <= 2.: # should be 1 but sometimes it's slightly above 1
image = (image * 255).astype(np.uint8)
else:
image = (image).astype(np.uint8)
if joints.shape[0] != 2:
joints = joints.T
joints = np.round(joints).astype(int)
if all_joints is not None:
if all_joints.shape[0] != 2:
all_joints = all_joints.T
all_joints = np.round(all_joints).astype(int)
jcolors = [
'light_pink', 'light_pink', 'light_pink', 'pink', 'pink', 'pink',
'light_blue', 'light_blue', 'light_blue', 'blue', 'blue', 'blue',
'purple', 'purple', 'red', 'green', 'green', 'white', 'white'
]
all_jcolors = [
'light_pink', 'light_pink', 'light_pink', 'light_pink', 'pink', 'pink', 'pink', 'pink',
'light_blue', 'light_blue', 'light_blue', 'light_blue', 'blue', 'blue', 'blue', 'blue',
'purple', 'purple', 'purple', 'purple', 'red', 'green', 'green', 'green', 'white', 'white' ,'white', 'white'
]
# draw all ketpoints
if joints is not None:
print(joints.shape[1])
for i in range(joints.shape[1]):
point = joints[:, i]
# If invisible skip
# if all_vis is not None and all_vis[i] == 0:
# continue
if draw_edges:
# print(radius)
# print(point)
# cv2.circle(image, (100, 60), 3, (0, 0, 213), -1)
cv2.circle(image, (point[0], point[1]), 2, colors['blue'].tolist(),
2)
# cv2.circle(image, (point[0], point[1]), radius-1, colors['blue'].tolist(),
# -1)
# cv2.circle(image, (point[0], point[1]), radius - 2,
# colors['blue'].tolist(), -1)
else:
# cv2.circle(image, (point[0], point[1]), 5, colors['white'], 1)
cv2.circle(image, (point[0], point[1]), radius - 1,
colors['blue'].tolist(), 1)
# cv2.circle(image, (point[0], point[1]), 5, colors['gray'], -1)
return image
def bbox_from_openpose(openpose_file, rescale=1.2, detection_thresh=0.2):
"""Get center and scale for bounding box from openpose detections."""
with open(openpose_file, 'r') as f:
keypoints = json.load(f)['people'][0]['pose_keypoints_2d']
keypoints = np.reshape(np.array(keypoints), (-1,3))
valid = keypoints[:,-1] > detection_thresh
valid_keypoints = keypoints[valid][:,:-1]
center = valid_keypoints.mean(axis=0)
bbox_size = (valid_keypoints.max(axis=0) - valid_keypoints.min(axis=0)).max()
# adjust bounding box tightness
scale = bbox_size / 200.0
scale *= rescale
return center, scale
def bbox_from_json(bbox_file):
"""Get center and scale of bounding box from bounding box annotations.
The expected format is [top_left(x), top_left(y), width, height].
"""
with open(bbox_file, 'r') as f:
bbox = np.array(json.load(f)['bbox']).astype(np.float32)
ul_corner = bbox[:2]
center = ul_corner + 0.5 * bbox[2:]
width = max(bbox[2], bbox[3])
scale = width / 200.0
# make sure the bounding box is rectangular
return center, scale
def process_image(img_file, bbox_file, openpose_file, input_res=224):
"""Read image, do preprocessing and possibly crop it according to the bounding box.
If there are bounding box annotations, use them to crop the image.
If no bounding box is specified but openpose detections are available, use them to get the bounding box.
"""
normalize_img = Normalize(mean=constants.IMG_NORM_MEAN, std=constants.IMG_NORM_STD)
img = cv2.imread(img_file)[:,:,::-1].copy() # PyTorch does not support negative stride at the moment
print(img.shape)
if bbox_file is None and openpose_file is None:
# Assume that the person is centerered in the image
height = img.shape[0]
width = img.shape[1]
center = np.array([width // 2, height // 2])
scale = max(height, width) / 200
else:
if bbox_file is not None:
center, scale = bbox_from_json(bbox_file)
elif openpose_file is not None:
center, scale = bbox_from_openpose(openpose_file)
img = crop(img, center, scale, (input_res, input_res))
img = img.astype(np.float32) / 255.
img = torch.from_numpy(img).permute(2,0,1)
norm_img = normalize_img(img.clone())[None]
return img, norm_img
if __name__ == '__main__':
args = parser.parse_args()
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
# Load pretrained model
model = hmr(config.SMPL_MEAN_PARAMS).to(device)
checkpoint = torch.load(args.checkpoint)
model.load_state_dict(checkpoint['model'], strict=False)
# Load SMPL model
smpl = SMPL(config.SMPL_MODEL_DIR,
batch_size=1,
create_transl=False).to(device)
model.eval()
# Setup renderer for visualization
renderer = Renderer(focal_length=constants.FOCAL_LENGTH, img_res=constants.IMG_RES, faces=smpl.faces)
# imgs_path = '/project/hpn_yyy/datasets/preprocess/min_imgs_up-3d'
imgs_path = 'crop_vis'
imgpath_list = []
for dirpath, dirnames, filenames in os.walk(imgs_path):
for f in filenames :
if os.path.splitext(f)[1] == '.png' or os.path.splitext(f)[1] == '.jpg':
imgpath_list.append(os.path.join(dirpath, f))
for imgpath in tqdm(imgpath_list):
# Preprocess input image and generate predictions
img, norm_img = process_image(imgpath, args.bbox, args.openpose, input_res=constants.IMG_RES)
with torch.no_grad():
pred_rotmat, pred_betas, pred_camera = model(norm_img.to(device))
pred_output = smpl(betas=pred_betas, body_pose=pred_rotmat[:,1:], global_orient=pred_rotmat[:,0].unsqueeze(1), pose2rot=False)
pred_vertices = pred_output.vertices
pred_joints = pred_output.joints
# Calculate camera parameters for rendering
camera_translation = torch.stack([pred_camera[:,1], pred_camera[:,2], 2*constants.FOCAL_LENGTH/(constants.IMG_RES * pred_camera[:,0] +1e-9)],dim=-1)
# Convert Weak Perspective Camera [s, tx, ty] to camera translation [tx, ty, tz] in 3D given the bounding box size
batch_size = 1
camera_center = torch.zeros(batch_size, 2, device=device)
pred_keypoints_2d = perspective_projection(pred_joints,
rotation=torch.eye(3, device=device).unsqueeze(0).expand(batch_size, -1, -1),
translation=camera_translation,
focal_length=constants.FOCAL_LENGTH,
camera_center=camera_center)
# print(pred_keypoints_2d.shape)
kp_img = draw_full_skeleton(img.permute(1,2,0).cpu().numpy(), pred_keypoints_2d[0][25:,:].cpu().numpy())
# cv2.imwrite('test_kp.jpg', kp_img[:,:,::-1])
camera_translation = camera_translation[0].cpu().numpy()
pred_vertices = pred_vertices[0].cpu().numpy()
img = img.permute(1,2,0).cpu().numpy()
# Render parametric shape
img_shape = renderer(pred_vertices, camera_translation, img)
# Render side views
aroundy = cv2.Rodrigues(np.array([0, np.radians(90.), 0]))[0]
center = pred_vertices.mean(axis=0)
rot_vertices = np.dot((pred_vertices - center), aroundy) + center
# Render non-parametric shape
img_shape_side = renderer(rot_vertices, camera_translation, np.ones_like(img))
outfile = imgpath.split('.')[0] if args.outfile is None else args.outfile
# Save reconstructions
cv2.imwrite(outfile + '_kp.jpg', kp_img[:,:,::-1])
cv2.imwrite(outfile + '_shape.png', 255 * img_shape[:,:,::-1])
cv2.imwrite(outfile + '_shape_side.png', 255 * img_shape_side[:,:,::-1]) | [
1,
9995,
13,
23444,
775,
13,
13,
1762,
1065,
1749,
1158,
29892,
366,
817,
263,
3216,
292,
3800,
2820,
278,
2022,
29889,
450,
2022,
4225,
304,
367,
24764,
2768,
278,
3216,
292,
3800,
322,
278,
3216,
292,
3800,
881,
367,
13774,
19932,
29889,
887,
508,
2845,
11421,
278,
3216,
292,
3800,
4153,
470,
3867,
385,
518,
6585,
29925,
852,
850,
991,
597,
3292,
29889,
510,
29914,
24494,
29965,
29899,
5894,
1547,
950,
29899,
20606,
292,
29899,
28632,
29914,
3150,
4220,
29897,
15326,
934,
29889,
512,
278,
7480,
1206,
591,
10115,
278,
3216,
292,
3800,
515,
278,
1439,
29872,
1953,
29889,
13,
13,
797,
15837,
29892,
591,
3867,
29871,
29941,
1422,
5837,
304,
671,
1749,
13455,
775,
322,
4733,
29901,
13,
29896,
29889,
9133,
680,
871,
385,
1881,
1967,
313,
4746,
7521,
489,
2492,
16159,
19775,
297,
607,
1206,
372,
338,
12023,
393,
372,
338,
2307,
8182,
2986,
411,
278,
2022,
24764,
297,
278,
1967,
29889,
13,
29906,
29889,
9133,
680,
385,
1881,
1967,
408,
1434,
29892,
4208,
411,
278,
4673,
29925,
852,
15326,
869,
3126,
313,
4746,
7521,
489,
3150,
4220,
16159,
12913,
8680,
775,
674,
671,
278,
1439,
29872,
1953,
304,
10272,
278,
3216,
292,
3800,
322,
274,
1336,
278,
1967,
29889,
13,
29941,
29889,
9133,
680,
385,
1967,
322,
263,
3216,
292,
3800,
313,
4746,
7521,
489,
29890,
1884,
16159,
12913,
450,
3806,
3402,
363,
278,
4390,
934,
508,
367,
3595,
297,
7521,
19057,
29914,
326,
29896,
29900,
29896,
29900,
29918,
29890,
1884,
29889,
3126,
16159,
1412,
13,
13,
14023,
411,
4673,
29925,
852,
15326,
869,
3126,
13,
28956,
13,
4691,
29941,
13455,
29889,
2272,
1192,
3198,
3149,
29922,
1272,
29914,
4299,
29918,
3198,
3149,
29889,
415,
1192,
2492,
29922,
19057,
29914,
326,
29896,
29900,
29896,
29900,
29889,
2732,
1192,
3150,
4220,
29922,
19057,
29914,
326,
29896,
29900,
29896,
29900,
29918,
3150,
4220,
29889,
3126,
13,
28956,
13,
14023,
411,
758,
12119,
350,
12449,
11773,
13,
28956,
13,
4691,
29941,
13455,
29889,
2272,
1192,
3198,
3149,
29922,
1272,
29914,
4299,
29918,
3198,
3149,
29889,
415,
1192,
2492,
29922,
19057,
29914,
326,
29896,
29900,
29896,
29900,
29889,
2732,
1192,
29890,
1884,
29922,
19057,
29914,
326,
29896,
29900,
29896,
29900,
29918,
29890,
1884,
29889,
3126,
13,
28956,
13,
14023,
411,
8182,
2986,
322,
24764,
1967,
13,
28956,
13,
4691,
29941,
13455,
29889,
2272,
1192,
3198,
3149,
29922,
1272,
29914,
4299,
29918,
3198,
3149,
29889,
415,
1192,
2492,
29922,
19057,
29914,
326,
29896,
29900,
29896,
29900,
29889,
2732,
13,
28956,
13,
13,
27795,
278,
3517,
1899,
674,
4078,
278,
2582,
297,
7521,
19057,
29914,
326,
29896,
29900,
29896,
29900,
648,
12181,
29892,
12181,
29918,
2975,
1836,
2732,
16159,
1412,
450,
934,
7521,
326,
29896,
29900,
29896,
29900,
29918,
12181,
29889,
2732,
28956,
3697,
278,
27292,
287,
17789,
4080,
310,
5199,
8267,
29889,
1334,
884,
4050,
263,
2625,
1776,
29892,
7160,
297,
7521,
326,
29896,
29900,
29896,
29900,
29918,
12181,
29918,
2975,
29889,
2732,
16159,
1412,
13,
15945,
29908,
13,
13,
5215,
4842,
305,
13,
3166,
4842,
305,
4924,
29889,
9067,
29879,
1053,
21981,
675,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
13,
5215,
1852,
5510,
13,
5215,
4390,
13,
5215,
2897,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
13,
3166,
4733,
1053,
298,
29885,
29878,
29892,
317,
3580,
29931,
13,
3166,
3667,
29879,
29889,
326,
13239,
1053,
274,
1336,
13,
3166,
3667,
29879,
29889,
9482,
261,
1053,
26000,
261,
13,
5215,
2295,
13,
5215,
17727,
13,
3166,
3667,
29879,
29889,
19156,
1053,
9853,
29918,
5964,
8966,
1041,
29892,
18520,
29918,
771,
6929,
29892,
12678,
29918,
3286,
18411,
13,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
3198,
3149,
742,
3734,
29922,
5574,
29892,
1371,
2433,
2605,
304,
758,
3018,
1312,
1423,
3149,
1495,
13,
29937,
13812,
29889,
1202,
29918,
23516,
877,
489,
2492,
742,
1134,
29922,
710,
29892,
3734,
29922,
5574,
29892,
1371,
2433,
2605,
304,
1881,
1967,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
29890,
1884,
742,
1134,
29922,
710,
29892,
2322,
29922,
8516,
29892,
1371,
2433,
2605,
304,
869,
3126,
934,
6943,
3216,
292,
3800,
10350,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
3150,
4220,
742,
1134,
29922,
710,
29892,
2322,
29922,
8516,
29892,
1371,
2433,
2605,
304,
869,
3126,
6943,
1722,
4220,
1439,
29872,
1953,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
449,
1445,
742,
1134,
29922,
710,
29892,
2322,
29922,
8516,
29892,
1371,
2433,
3434,
3871,
310,
1962,
4558,
29889,
960,
451,
731,
671,
1881,
10422,
29889,
1495,
13,
13,
1753,
4216,
29918,
8159,
29918,
26050,
11285,
29898,
2080,
29918,
3027,
29892,
14002,
29879,
29892,
599,
29918,
2212,
9466,
29922,
8516,
29892,
4216,
29918,
287,
2710,
29922,
5574,
29892,
1998,
29922,
8516,
29892,
599,
29918,
1730,
29922,
8516,
29892,
11855,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
14002,
29879,
338,
29871,
29941,
921,
29871,
29896,
29929,
29889,
541,
565,
451,
674,
1301,
4220,
372,
29889,
13,
268,
29900,
29901,
10428,
385,
29895,
280,
13,
268,
29896,
29901,
10428,
17905,
29872,
13,
268,
29906,
29901,
10428,
21464,
13,
268,
29941,
29901,
19941,
21464,
13,
268,
29946,
29901,
19941,
17905,
29872,
13,
268,
29945,
29901,
19941,
385,
29895,
280,
13,
268,
29953,
29901,
10428,
281,
2021,
13,
268,
29955,
29901,
10428,
560,
17729,
13,
268,
29947,
29901,
10428,
23468,
13,
268,
29929,
29901,
19941,
23468,
13,
268,
29896,
29900,
29901,
19941,
560,
17729,
13,
268,
29896,
29896,
29901,
19941,
281,
2021,
13,
268,
29896,
29906,
29901,
2448,
384,
13,
268,
29896,
29941,
29901,
12252,
2246,
13,
268,
29896,
29946,
29901,
26414,
13,
268,
29896,
29945,
29901,
2175,
29918,
1032,
29872,
13,
268,
29896,
29953,
29901,
1492,
29918,
1032,
29872,
13,
268,
29896,
29955,
29901,
2175,
29918,
799,
13,
268,
29896,
29947,
29901,
1492,
29918,
799,
13,
1678,
9995,
13,
13,
268,
13,
1678,
14002,
29879,
353,
14002,
29879,
718,
29871,
29896,
29896,
29906,
13,
1678,
1596,
29898,
2212,
9466,
29897,
13,
13,
1678,
565,
11855,
338,
6213,
29901,
13,
4706,
11855,
353,
4236,
29898,
29946,
29892,
313,
9302,
29889,
12676,
29898,
2080,
29918,
3027,
29889,
12181,
7503,
29906,
2314,
334,
29871,
29900,
29889,
29900,
29896,
467,
579,
668,
29898,
524,
876,
13,
13,
1678,
11955,
353,
426,
13,
4706,
525,
29886,
682,
2396,
7442,
29889,
2378,
4197,
29896,
29929,
29955,
29892,
29871,
29906,
29955,
29892,
29871,
29896,
29906,
29945,
11724,
29871,
396,
365,
5224,
2814,
13,
4706,
525,
4366,
29918,
29886,
682,
2396,
7442,
29889,
2378,
4197,
29906,
29941,
29941,
29892,
29871,
29896,
29953,
29941,
29892,
29871,
29906,
29900,
29896,
11724,
29871,
396,
365,
7568,
2814,
13,
4706,
525,
4366,
29918,
12692,
2396,
7442,
29889,
2378,
4197,
29896,
29953,
29896,
29892,
29871,
29906,
29896,
29945,
29892,
29871,
29896,
29900,
29953,
11724,
29871,
396,
365,
5224,
5075,
13,
4706,
525,
12692,
2396,
7442,
29889,
2378,
4197,
29955,
29955,
29892,
29871,
29896,
29946,
29953,
29892,
29871,
29941,
29941,
11724,
29871,
396,
365,
7568,
5075,
13,
4706,
525,
1127,
2396,
7442,
29889,
2378,
4197,
29906,
29896,
29945,
29892,
29871,
29946,
29947,
29892,
29871,
29941,
29929,
11724,
29871,
396,
2343,
13,
4706,
525,
4366,
29918,
1127,
2396,
7442,
29889,
2378,
4197,
29906,
29945,
29906,
29892,
29871,
29896,
29946,
29953,
29892,
29871,
29896,
29896,
29946,
11724,
29871,
396,
2343,
13,
4706,
525,
4366,
29918,
272,
927,
2396,
7442,
29889,
2378,
4197,
29906,
29945,
29906,
29892,
29871,
29896,
29946,
29896,
29892,
29871,
29947,
29929,
11724,
29871,
396,
521,
342,
13,
4706,
525,
15503,
552,
2396,
7442,
29889,
2378,
4197,
29896,
29896,
29947,
29892,
29871,
29946,
29906,
29892,
29871,
29896,
29941,
29896,
11724,
29871,
396,
390,
5224,
2814,
13,
4706,
525,
4366,
29918,
15503,
552,
2396,
7442,
29889,
2378,
4197,
29896,
29955,
29945,
29892,
29871,
29896,
29946,
29896,
29892,
29871,
29896,
29929,
29945,
11724,
29871,
396,
390,
7568,
13,
4706,
525,
4366,
29918,
9539,
2396,
7442,
29889,
2378,
4197,
29896,
29946,
29945,
29892,
29871,
29896,
29929,
29896,
29892,
29871,
29906,
29896,
29929,
11724,
29871,
396,
390,
5224,
5075,
13,
4706,
525,
9539,
2396,
7442,
29889,
2378,
4197,
29900,
29892,
29871,
29900,
29892,
29871,
29906,
29945,
29945,
11724,
29871,
396,
390,
7568,
5075,
13,
4706,
525,
21012,
2396,
7442,
29889,
2378,
4197,
29896,
29941,
29900,
29892,
29871,
29896,
29941,
29900,
29892,
29871,
29896,
29941,
29900,
11724,
29871,
396,
13,
4706,
525,
10921,
2396,
7442,
29889,
2378,
4197,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
2314,
396,
13,
1678,
500,
13,
13,
1678,
1967,
353,
1881,
29918,
3027,
29889,
8552,
580,
462,
462,
1678,
13,
1678,
1881,
29918,
275,
29918,
7411,
353,
7700,
13,
13,
1678,
565,
7442,
29889,
790,
431,
29881,
1853,
29898,
3027,
29889,
29881,
1853,
29892,
7442,
29889,
7411,
1125,
13,
4706,
1881,
29918,
275,
29918,
7411,
353,
5852,
13,
4706,
4236,
29918,
791,
353,
1967,
29889,
3317,
580,
13,
4706,
565,
4236,
29918,
791,
5277,
29871,
29906,
4898,
29871,
396,
881,
367,
29871,
29896,
541,
6041,
372,
29915,
29879,
10029,
2038,
29871,
29896,
13,
9651,
1967,
353,
313,
3027,
334,
29871,
29906,
29945,
29945,
467,
579,
668,
29898,
9302,
29889,
13470,
29947,
29897,
13,
4706,
1683,
29901,
13,
9651,
1967,
353,
313,
3027,
467,
579,
668,
29898,
9302,
29889,
13470,
29947,
29897,
13,
13,
1678,
565,
14002,
29879,
29889,
12181,
29961,
29900,
29962,
2804,
29871,
29906,
29901,
13,
4706,
14002,
29879,
353,
14002,
29879,
29889,
29911,
13,
1678,
14002,
29879,
353,
7442,
29889,
14486,
29898,
2212,
9466,
467,
579,
668,
29898,
524,
29897,
13,
13,
1678,
565,
599,
29918,
2212,
9466,
338,
451,
6213,
29901,
29871,
13,
4706,
565,
599,
29918,
2212,
9466,
29889,
12181,
29961,
29900,
29962,
2804,
29871,
29906,
29901,
13,
9651,
599,
29918,
2212,
9466,
353,
599,
29918,
2212,
9466,
29889,
29911,
13,
4706,
599,
29918,
2212,
9466,
353,
7442,
29889,
14486,
29898,
497,
29918,
2212,
9466,
467,
579,
668,
29898,
524,
29897,
13,
13,
1678,
432,
27703,
353,
518,
13,
4706,
525,
4366,
29918,
29886,
682,
742,
525,
4366,
29918,
29886,
682,
742,
525,
4366,
29918,
29886,
682,
742,
525,
29886,
682,
742,
525,
29886,
682,
742,
525,
29886,
682,
742,
13,
4706,
525,
4366,
29918,
9539,
742,
525,
4366,
29918,
9539,
742,
525,
4366,
29918,
9539,
742,
525,
9539,
742,
525,
9539,
742,
525,
9539,
742,
13,
4706,
525,
15503,
552,
742,
525,
15503,
552,
742,
525,
1127,
742,
525,
12692,
742,
525,
12692,
742,
525,
10921,
742,
525,
10921,
29915,
13,
1678,
4514,
13,
13,
1678,
599,
29918,
29926,
27703,
353,
518,
13,
4706,
525,
4366,
29918,
29886,
682,
742,
525,
4366,
29918,
29886,
682,
742,
525,
4366,
29918,
29886,
682,
742,
525,
4366,
29918,
29886,
682,
742,
525,
29886,
682,
742,
525,
29886,
682,
742,
525,
29886,
682,
742,
525,
29886,
682,
742,
13,
4706,
525,
4366,
29918,
9539,
742,
525,
4366,
29918,
9539,
742,
525,
4366,
29918,
9539,
742,
525,
4366,
29918,
9539,
742,
525,
9539,
742,
525,
9539,
742,
525,
9539,
742,
525,
9539,
742,
13,
4706,
525,
15503,
552,
742,
525,
15503,
552,
742,
525,
15503,
552,
742,
525,
15503,
552,
742,
525,
1127,
742,
525,
12692,
742,
525,
12692,
742,
525,
12692,
742,
525,
10921,
742,
525,
10921,
29915,
1919,
29915,
10921,
742,
525,
10921,
29915,
13,
1678,
4514,
13,
13,
1678,
396,
4216,
599,
413,
300,
9748,
13,
1678,
565,
14002,
29879,
338,
451,
6213,
29901,
29871,
13,
4706,
1596,
29898,
2212,
9466,
29889,
12181,
29961,
29896,
2314,
13,
4706,
363,
474,
297,
3464,
29898,
2212,
9466,
29889,
12181,
29961,
29896,
29962,
1125,
13,
9651,
1298,
353,
14002,
29879,
7503,
29892,
474,
29962,
13,
9651,
396,
960,
27597,
14383,
13,
9651,
396,
565,
599,
29918,
1730,
338,
451,
6213,
322,
599,
29918,
1730,
29961,
29875,
29962,
1275,
29871,
29900,
29901,
13,
9651,
396,
268,
6773,
13,
9651,
565,
4216,
29918,
287,
2710,
29901,
13,
18884,
396,
1596,
29898,
13471,
29897,
13,
18884,
396,
1596,
29898,
3149,
29897,
13,
18884,
396,
13850,
29906,
29889,
16622,
29898,
3027,
29892,
313,
29896,
29900,
29900,
29892,
29871,
29953,
29900,
511,
29871,
29941,
29892,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29906,
29896,
29941,
511,
448,
29896,
29897,
13,
18884,
13850,
29906,
29889,
16622,
29898,
3027,
29892,
313,
3149,
29961,
29900,
1402,
1298,
29961,
29896,
11724,
29871,
29906,
29892,
11955,
1839,
9539,
13359,
25027,
391,
3285,
13,
462,
308,
29906,
29897,
13,
18884,
396,
13850,
29906,
29889,
16622,
29898,
3027,
29892,
313,
3149,
29961,
29900,
1402,
1298,
29961,
29896,
11724,
11855,
29899,
29896,
29892,
11955,
1839,
9539,
13359,
25027,
391,
3285,
13,
18884,
396,
308,
448,
29896,
29897,
13,
18884,
396,
13850,
29906,
29889,
16622,
29898,
3027,
29892,
313,
3149,
29961,
29900,
1402,
1298,
29961,
29896,
11724,
11855,
448,
29871,
29906,
29892,
13,
18884,
396,
308,
11955,
1839,
9539,
13359,
25027,
391,
3285,
448,
29896,
29897,
13,
9651,
1683,
29901,
13,
18884,
396,
13850,
29906,
29889,
16622,
29898,
3027,
29892,
313,
3149,
29961,
29900,
1402,
1298,
29961,
29896,
11724,
29871,
29945,
29892,
11955,
1839,
10921,
7464,
29871,
29896,
29897,
13,
18884,
13850,
29906,
29889,
16622,
29898,
3027,
29892,
313,
3149,
29961,
29900,
1402,
1298,
29961,
29896,
11724,
11855,
448,
29871,
29896,
29892,
13,
462,
4706,
11955,
1839,
9539,
13359,
25027,
391,
3285,
29871,
29896,
29897,
13,
18884,
396,
13850,
29906,
29889,
16622,
29898,
3027,
29892,
313,
3149,
29961,
29900,
1402,
1298,
29961,
29896,
11724,
29871,
29945,
29892,
11955,
1839,
21012,
7464,
448,
29896,
29897,
13,
1678,
736,
1967,
13,
13,
13,
1753,
289,
1884,
29918,
3166,
29918,
3150,
4220,
29898,
3150,
4220,
29918,
1445,
29892,
620,
29883,
744,
29922,
29896,
29889,
29906,
29892,
15326,
29918,
386,
3781,
29922,
29900,
29889,
29906,
1125,
13,
1678,
9995,
2577,
4818,
322,
6287,
363,
3216,
292,
3800,
515,
1722,
4220,
1439,
29872,
1953,
1213,
15945,
13,
1678,
411,
1722,
29898,
3150,
4220,
29918,
1445,
29892,
525,
29878,
1495,
408,
285,
29901,
13,
4706,
1820,
9748,
353,
4390,
29889,
1359,
29898,
29888,
29897,
1839,
25719,
2033,
29961,
29900,
22322,
4220,
29918,
1989,
9748,
29918,
29906,
29881,
2033,
13,
1678,
1820,
9748,
353,
7442,
29889,
690,
14443,
29898,
9302,
29889,
2378,
29898,
1989,
9748,
511,
8521,
29896,
29892,
29941,
876,
13,
1678,
2854,
353,
1820,
9748,
7503,
6653,
29896,
29962,
1405,
15326,
29918,
386,
3781,
13,
1678,
2854,
29918,
1989,
9748,
353,
1820,
9748,
29961,
3084,
3816,
29901,
29892,
13018,
29896,
29962,
13,
1678,
4818,
353,
2854,
29918,
1989,
9748,
29889,
12676,
29898,
8990,
29922,
29900,
29897,
13,
1678,
289,
1884,
29918,
2311,
353,
313,
3084,
29918,
1989,
9748,
29889,
3317,
29898,
8990,
29922,
29900,
29897,
448,
2854,
29918,
1989,
9748,
29889,
1195,
29898,
8990,
29922,
29900,
8106,
3317,
580,
13,
1678,
396,
10365,
3216,
292,
3800,
19932,
2264,
13,
1678,
6287,
353,
289,
1884,
29918,
2311,
847,
29871,
29906,
29900,
29900,
29889,
29900,
13,
1678,
6287,
334,
29922,
620,
29883,
744,
13,
1678,
736,
4818,
29892,
6287,
13,
13,
1753,
289,
1884,
29918,
3166,
29918,
3126,
29898,
29890,
1884,
29918,
1445,
1125,
13,
1678,
9995,
2577,
4818,
322,
6287,
310,
3216,
292,
3800,
515,
3216,
292,
3800,
25495,
29889,
13,
1678,
450,
3806,
3402,
338,
518,
3332,
29918,
1563,
29898,
29916,
511,
2246,
29918,
1563,
29898,
29891,
511,
2920,
29892,
3171,
1822,
13,
1678,
9995,
13,
1678,
411,
1722,
29898,
29890,
1884,
29918,
1445,
29892,
525,
29878,
1495,
408,
285,
29901,
13,
4706,
289,
1884,
353,
7442,
29889,
2378,
29898,
3126,
29889,
1359,
29898,
29888,
29897,
1839,
29890,
1884,
2033,
467,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
9238,
29918,
2616,
1089,
353,
289,
1884,
7503,
29906,
29962,
13,
1678,
4818,
353,
9238,
29918,
2616,
1089,
718,
29871,
29900,
29889,
29945,
334,
289,
1884,
29961,
29906,
17531,
13,
1678,
2920,
353,
4236,
29898,
29890,
1884,
29961,
29906,
1402,
289,
1884,
29961,
29941,
2314,
13,
1678,
6287,
353,
2920,
847,
29871,
29906,
29900,
29900,
29889,
29900,
13,
1678,
396,
1207,
1854,
278,
3216,
292,
3800,
338,
7705,
6825,
13,
1678,
736,
4818,
29892,
6287,
13,
13,
1753,
1889,
29918,
3027,
29898,
2492,
29918,
1445,
29892,
289,
1884,
29918,
1445,
29892,
1722,
4220,
29918,
1445,
29892,
1881,
29918,
690,
29922,
29906,
29906,
29946,
1125,
13,
1678,
9995,
6359,
1967,
29892,
437,
758,
19170,
322,
10075,
274,
1336,
372,
5034,
304,
278,
3216,
292,
3800,
29889,
13,
1678,
960,
727,
526,
3216,
292,
3800,
25495,
29892,
671,
963,
304,
274,
1336,
278,
1967,
29889,
13,
1678,
960,
694,
3216,
292,
3800,
338,
6790,
541,
1722,
4220,
1439,
29872,
1953,
526,
3625,
29892,
671,
963,
304,
679,
278,
3216,
292,
3800,
29889,
13,
1678,
9995,
13,
1678,
4226,
675,
29918,
2492,
353,
21981,
675,
29898,
12676,
29922,
3075,
1934,
29889,
7833,
29954,
29918,
29940,
12054,
29918,
2303,
2190,
29892,
3659,
29922,
3075,
1934,
29889,
7833,
29954,
29918,
29940,
12054,
29918,
1254,
29928,
29897,
13,
1678,
10153,
353,
13850,
29906,
29889,
326,
949,
29898,
2492,
29918,
1445,
29897,
7503,
29892,
29901,
29892,
1057,
29899,
29896,
1822,
8552,
580,
396,
10772,
29911,
25350,
947,
451,
2304,
8178,
380,
2426,
472,
278,
3256,
13,
1678,
1596,
29898,
2492,
29889,
12181,
29897,
13,
1678,
565,
289,
1884,
29918,
1445,
338,
6213,
322,
1722,
4220,
29918,
1445,
338,
6213,
29901,
13,
4706,
396,
22680,
393,
278,
2022,
338,
4818,
14561,
297,
278,
1967,
13,
4706,
3171,
353,
10153,
29889,
12181,
29961,
29900,
29962,
13,
4706,
2920,
353,
10153,
29889,
12181,
29961,
29896,
29962,
13,
4706,
4818,
353,
7442,
29889,
2378,
4197,
2103,
849,
29871,
29906,
29892,
3171,
849,
29871,
29906,
2314,
13,
4706,
6287,
353,
4236,
29898,
3545,
29892,
2920,
29897,
847,
29871,
29906,
29900,
29900,
13,
1678,
1683,
29901,
13,
4706,
565,
289,
1884,
29918,
1445,
338,
451,
6213,
29901,
13,
9651,
4818,
29892,
6287,
353,
289,
1884,
29918,
3166,
29918,
3126,
29898,
29890,
1884,
29918,
1445,
29897,
13,
4706,
25342,
1722,
4220,
29918,
1445,
338,
451,
6213,
29901,
13,
9651,
4818,
29892,
6287,
353,
289,
1884,
29918,
3166,
29918,
3150,
4220,
29898,
3150,
4220,
29918,
1445,
29897,
13,
1678,
10153,
353,
274,
1336,
29898,
2492,
29892,
4818,
29892,
6287,
29892,
313,
2080,
29918,
690,
29892,
1881,
29918,
690,
876,
13,
1678,
10153,
353,
10153,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
847,
29871,
29906,
29945,
29945,
29889,
13,
1678,
10153,
353,
4842,
305,
29889,
3166,
29918,
23749,
29898,
2492,
467,
17858,
1082,
29898,
29906,
29892,
29900,
29892,
29896,
29897,
13,
1678,
6056,
29918,
2492,
353,
4226,
675,
29918,
2492,
29898,
2492,
29889,
16513,
3101,
29961,
8516,
29962,
13,
1678,
736,
10153,
29892,
6056,
29918,
2492,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
268,
13,
1678,
4742,
353,
4842,
305,
29889,
10141,
877,
29883,
6191,
1495,
565,
4842,
305,
29889,
29883,
6191,
29889,
275,
29918,
16515,
580,
1683,
4842,
305,
29889,
10141,
877,
21970,
1495,
13,
268,
13,
1678,
396,
16012,
758,
3018,
1312,
1904,
13,
1678,
1904,
353,
298,
29885,
29878,
29898,
2917,
29889,
29903,
3580,
29931,
29918,
2303,
2190,
29918,
16320,
29909,
4345,
467,
517,
29898,
10141,
29897,
13,
1678,
1423,
3149,
353,
4842,
305,
29889,
1359,
29898,
5085,
29889,
3198,
3149,
29897,
13,
1678,
1904,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
3198,
3149,
1839,
4299,
7464,
9406,
29922,
8824,
29897,
13,
13,
1678,
396,
16012,
317,
3580,
29931,
1904,
13,
1678,
1560,
572,
353,
317,
3580,
29931,
29898,
2917,
29889,
29903,
3580,
29931,
29918,
20387,
29931,
29918,
9464,
29892,
13,
18884,
9853,
29918,
2311,
29922,
29896,
29892,
13,
18884,
1653,
29918,
3286,
29880,
29922,
8824,
467,
517,
29898,
10141,
29897,
13,
1678,
1904,
29889,
14513,
580,
13,
13,
1678,
396,
3789,
786,
4050,
261,
363,
7604,
2133,
13,
1678,
4050,
261,
353,
26000,
261,
29898,
29888,
18642,
29918,
2848,
29922,
3075,
1934,
29889,
5800,
29907,
1964,
29918,
19433,
29892,
10153,
29918,
690,
29922,
3075,
1934,
29889,
7833,
29954,
29918,
15989,
29892,
17240,
29922,
3844,
572,
29889,
8726,
29897,
13,
13,
1678,
396,
527,
3174,
29918,
2084,
353,
8207,
4836,
29914,
29882,
21257,
29918,
8071,
29891,
29914,
14538,
1691,
29914,
1457,
5014,
29914,
1195,
29918,
2492,
29879,
29918,
786,
29899,
29941,
29881,
29915,
259,
13,
1678,
527,
3174,
29918,
2084,
353,
525,
29883,
1336,
29918,
1730,
29915,
259,
13,
13,
1678,
10153,
2084,
29918,
1761,
353,
5159,
1678,
13,
1678,
363,
4516,
2084,
29892,
4516,
7039,
29892,
977,
264,
1280,
297,
2897,
29889,
20919,
29898,
2492,
29879,
29918,
2084,
1125,
259,
13,
4706,
363,
285,
297,
977,
264,
1280,
584,
259,
13,
9651,
565,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
29888,
9601,
29896,
29962,
1275,
15300,
2732,
29915,
470,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
29888,
9601,
29896,
29962,
1275,
15300,
6173,
2396,
259,
13,
18884,
10153,
2084,
29918,
1761,
29889,
4397,
29898,
359,
29889,
2084,
29889,
7122,
29898,
3972,
2084,
29892,
285,
876,
29871,
13,
13,
1678,
363,
10153,
2084,
297,
260,
29939,
18933,
29898,
2492,
2084,
29918,
1761,
1125,
13,
4706,
396,
4721,
5014,
1881,
1967,
322,
5706,
27303,
13,
4706,
10153,
29892,
6056,
29918,
2492,
353,
1889,
29918,
3027,
29898,
2492,
2084,
29892,
6389,
29889,
29890,
1884,
29892,
6389,
29889,
3150,
4220,
29892,
1881,
29918,
690,
29922,
3075,
1934,
29889,
7833,
29954,
29918,
15989,
29897,
13,
4706,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
9651,
4450,
29918,
5450,
2922,
29892,
4450,
29918,
6878,
294,
29892,
4450,
29918,
26065,
353,
1904,
29898,
12324,
29918,
2492,
29889,
517,
29898,
10141,
876,
13,
9651,
4450,
29918,
4905,
353,
1560,
572,
29898,
6878,
294,
29922,
11965,
29918,
6878,
294,
29892,
3573,
29918,
4220,
29922,
11965,
29918,
5450,
2922,
7503,
29892,
29896,
29901,
1402,
5534,
29918,
12236,
29922,
11965,
29918,
5450,
2922,
7503,
29892,
29900,
1822,
6948,
802,
29872,
911,
29898,
29896,
511,
18593,
29906,
5450,
29922,
8824,
29897,
13,
9651,
4450,
29918,
1765,
1575,
353,
4450,
29918,
4905,
29889,
1765,
1575,
13,
9651,
4450,
29918,
2212,
9466,
353,
4450,
29918,
4905,
29889,
2212,
9466,
13,
632,
13,
4706,
396,
20535,
403,
10656,
4128,
363,
15061,
13,
4706,
10656,
29918,
3286,
18411,
353,
4842,
305,
29889,
1429,
4197,
11965,
29918,
26065,
7503,
29892,
29896,
1402,
4450,
29918,
26065,
7503,
29892,
29906,
1402,
29871,
29906,
29930,
3075,
1934,
29889,
5800,
29907,
1964,
29918,
19433,
14571,
3075,
1934,
29889,
7833,
29954,
29918,
15989,
334,
4450,
29918,
26065,
7503,
29892,
29900,
29962,
718,
29896,
29872,
29899,
29929,
29897,
1402,
6229,
10457,
29896,
29897,
13,
4706,
396,
14806,
1334,
557,
9034,
12645,
24321,
518,
29879,
29892,
25568,
29892,
7911,
29962,
304,
10656,
13962,
518,
7508,
29892,
7911,
29892,
260,
29920,
29962,
297,
29871,
29941,
29928,
2183,
278,
3216,
292,
3800,
2159,
13,
4706,
9853,
29918,
2311,
353,
29871,
29896,
13,
4706,
10656,
29918,
5064,
353,
4842,
305,
29889,
3298,
359,
29898,
16175,
29918,
2311,
29892,
29871,
29906,
29892,
4742,
29922,
10141,
29897,
13,
4706,
4450,
29918,
1989,
9748,
29918,
29906,
29881,
353,
18520,
29918,
771,
6929,
29898,
11965,
29918,
2212,
9466,
29892,
13,
462,
462,
462,
1678,
13733,
29922,
7345,
305,
29889,
1032,
29872,
29898,
29941,
29892,
4742,
29922,
10141,
467,
6948,
802,
29872,
911,
29898,
29900,
467,
18837,
29898,
16175,
29918,
2311,
29892,
448,
29896,
29892,
448,
29896,
511,
13,
462,
462,
462,
1678,
13962,
29922,
26065,
29918,
3286,
18411,
29892,
13,
462,
462,
462,
1678,
12789,
284,
29918,
2848,
29922,
3075,
1934,
29889,
5800,
29907,
1964,
29918,
19433,
29892,
13,
462,
462,
462,
1678,
10656,
29918,
5064,
29922,
26065,
29918,
5064,
29897,
13,
4706,
396,
1596,
29898,
11965,
29918,
1989,
9748,
29918,
29906,
29881,
29889,
12181,
29897,
13,
4706,
413,
29886,
29918,
2492,
353,
4216,
29918,
8159,
29918,
26050,
11285,
29898,
2492,
29889,
17858,
1082,
29898,
29896,
29892,
29906,
29892,
29900,
467,
21970,
2141,
23749,
3285,
4450,
29918,
1989,
9748,
29918,
29906,
29881,
29961,
29900,
3816,
29906,
29945,
29901,
29892,
29901,
1822,
21970,
2141,
23749,
3101,
13,
4706,
396,
13850,
29906,
29889,
326,
3539,
877,
1688,
29918,
29895,
29886,
29889,
6173,
742,
413,
29886,
29918,
2492,
7503,
29892,
29901,
29892,
1057,
29899,
29896,
2314,
13,
4706,
10656,
29918,
3286,
18411,
353,
10656,
29918,
3286,
18411,
29961,
29900,
1822,
21970,
2141,
23749,
580,
13,
4706,
4450,
29918,
1765,
1575,
353,
4450,
29918,
1765,
1575,
29961,
29900,
1822,
21970,
2141,
23749,
580,
13,
4706,
10153,
353,
10153,
29889,
17858,
1082,
29898,
29896,
29892,
29906,
29892,
29900,
467,
21970,
2141,
23749,
580,
13,
13,
13,
13,
308,
13,
4706,
396,
26000,
25011,
2200,
8267,
13,
4706,
10153,
29918,
12181,
353,
4050,
261,
29898,
11965,
29918,
1765,
1575,
29892,
10656,
29918,
3286,
18411,
29892,
10153,
29897,
13,
308,
13,
4706,
396,
26000,
2625,
8386,
13,
4706,
2820,
29891,
353,
13850,
29906,
29889,
29934,
397,
8966,
1041,
29898,
9302,
29889,
2378,
4197,
29900,
29892,
7442,
29889,
3665,
5834,
29898,
29929,
29900,
9774,
29871,
29900,
12622,
29961,
29900,
29962,
13,
4706,
4818,
353,
4450,
29918,
1765,
1575,
29889,
12676,
29898,
8990,
29922,
29900,
29897,
13,
4706,
5731,
29918,
1765,
1575,
353,
7442,
29889,
6333,
3552,
11965,
29918,
1765,
1575,
448,
4818,
511,
2820,
29891,
29897,
718,
4818,
13,
308,
13,
4706,
396,
26000,
1661,
29899,
3207,
300,
2200,
8267,
13,
4706,
10153,
29918,
12181,
29918,
2975,
353,
4050,
261,
29898,
5450,
29918,
1765,
1575,
29892,
10656,
29918,
3286,
18411,
29892,
7442,
29889,
2873,
29918,
4561,
29898,
2492,
876,
13,
13,
4706,
714,
1445,
353,
10153,
2084,
29889,
5451,
12839,
29861,
29900,
29962,
565,
6389,
29889,
449,
1445,
338,
6213,
1683,
6389,
29889,
449,
1445,
13,
13,
4706,
396,
16913,
17789,
582,
1953,
13,
4706,
13850,
29906,
29889,
326,
3539,
29898,
449,
1445,
718,
22868,
29895,
29886,
29889,
6173,
742,
413,
29886,
29918,
2492,
7503,
29892,
29901,
29892,
1057,
29899,
29896,
2314,
13,
4706,
13850,
29906,
29889,
326,
3539,
29898,
449,
1445,
718,
22868,
12181,
29889,
2732,
742,
29871,
29906,
29945,
29945,
334,
10153,
29918,
12181,
7503,
29892,
29901,
29892,
1057,
29899,
29896,
2314,
13,
4706,
13850,
29906,
29889,
326,
3539,
29898,
449,
1445,
718,
22868,
12181,
29918,
2975,
29889,
2732,
742,
29871,
29906,
29945,
29945,
334,
10153,
29918,
12181,
29918,
2975,
7503,
29892,
29901,
29892,
1057,
29899,
29896,
2314,
2
] |
Real_Estate/Configs/app_config.py | Divya-Madhuri/ppty_mgmnt | 0 | 120228 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import event
from sqlalchemy.engine import Engine
from sqlite3 import Connection as SQLite3Connection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////Users/divyamadhuri/Documents/Python/ppty_mgmnt/Real_Estate/RESdb.db'
app.config['SECRET_KEY'] = "random string"
db = SQLAlchemy(app)
@event.listens_for(Engine, "connect")
def _set_sqlite_pragma(dbapi_connection, connection_record):
if isinstance(dbapi_connection, SQLite3Connection):
cursor = dbapi_connection.cursor()
cursor.execute("PRAGMA foreign_keys=ON;")
cursor.close() | [
1,
515,
29784,
1053,
2379,
1278,
13,
3166,
29784,
29918,
2850,
284,
305,
6764,
1053,
3758,
2499,
305,
6764,
13,
3166,
4576,
284,
305,
6764,
1053,
1741,
13,
3166,
4576,
284,
305,
6764,
29889,
10599,
1053,
10863,
13,
3166,
21120,
29941,
1053,
15160,
408,
23299,
29941,
5350,
13,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
13,
932,
29889,
2917,
1839,
4176,
1964,
3210,
12665,
29979,
29918,
25832,
27982,
29918,
15551,
2033,
353,
525,
22793,
597,
458,
5959,
29914,
4563,
29891,
314,
328,
29882,
5338,
29914,
20128,
29914,
11980,
29914,
407,
1017,
29918,
29885,
29887,
29885,
593,
29914,
21713,
29918,
29923,
3859,
29914,
15989,
2585,
29889,
2585,
29915,
13,
932,
29889,
2917,
1839,
1660,
22245,
29911,
29918,
10818,
2033,
353,
376,
8172,
1347,
29908,
13,
13,
13,
2585,
353,
3758,
2499,
305,
6764,
29898,
932,
29897,
13,
13,
13,
29992,
3696,
29889,
1761,
575,
29918,
1454,
29898,
12412,
29892,
376,
6915,
1159,
13,
1753,
903,
842,
29918,
22793,
29918,
28436,
29898,
2585,
2754,
29918,
9965,
29892,
3957,
29918,
11651,
1125,
13,
1678,
565,
338,
8758,
29898,
2585,
2754,
29918,
9965,
29892,
23299,
29941,
5350,
1125,
13,
4706,
10677,
353,
4833,
2754,
29918,
9965,
29889,
18127,
580,
13,
4706,
10677,
29889,
7978,
703,
29925,
4717,
29954,
1529,
9117,
29918,
8149,
29922,
1164,
29936,
1159,
13,
4706,
10677,
29889,
5358,
580,
2
] |
crud_app/urls.py | DeeAjayi/djaroku1 | 1 | 124468 | from django.conf.urls import url
from . import views
app_name = 'crud_app'
urlpatterns = [
# /students/
url(r'^$', views.index, name='index'),
# /students/id<1>
url(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), name='detail'),
# /students/add
url(r'add/$', views.StudentCreate.as_view(), name='student-add'),
# /students/update/<pk>
url(r'update/(?P<pk>[0-9]+)/$', views.StudentUpdate.as_view(), name='student-update'),
# /students/delete/<pk>/
url(r'delete/(?P<pk>[0-9]+)/$', views.StudentDelete.as_view(), name='student-delete'),
# /students/all/
url(r'all/$', views.ListView.as_view(), name='all_list'),
# /students/contact
url(r'contact/$', views.index, name='contact'),
# /students/delete/confirm/
url(r'delete/confirm/$', views.delete_confirm, name='delete-confirm'),
]
| [
1,
515,
9557,
29889,
5527,
29889,
26045,
1053,
3142,
13,
3166,
869,
1053,
8386,
13,
13,
932,
29918,
978,
353,
525,
7283,
566,
29918,
932,
29915,
13,
13,
2271,
11037,
29879,
353,
518,
13,
1678,
396,
847,
18082,
1237,
29914,
13,
1678,
3142,
29898,
29878,
29915,
29985,
29938,
742,
8386,
29889,
2248,
29892,
1024,
2433,
2248,
5477,
13,
13,
1678,
396,
847,
18082,
1237,
29914,
333,
29966,
29896,
29958,
13,
1678,
3142,
29898,
29878,
29915,
29985,
10780,
29925,
29966,
20571,
24566,
29900,
29899,
29929,
10062,
6802,
29938,
742,
8386,
29889,
16570,
1043,
29889,
294,
29918,
1493,
3285,
1024,
2433,
16432,
5477,
13,
13,
1678,
396,
847,
18082,
1237,
29914,
1202,
13,
1678,
3142,
29898,
29878,
29915,
1202,
13346,
742,
8386,
29889,
20791,
4391,
29889,
294,
29918,
1493,
3285,
1024,
2433,
18945,
29899,
1202,
5477,
13,
13,
1678,
396,
847,
18082,
1237,
29914,
5504,
29914,
29966,
20571,
29958,
13,
1678,
3142,
29898,
29878,
29915,
5504,
29914,
10780,
29925,
29966,
20571,
24566,
29900,
29899,
29929,
10062,
6802,
29938,
742,
8386,
29889,
20791,
6422,
29889,
294,
29918,
1493,
3285,
1024,
2433,
18945,
29899,
5504,
5477,
13,
13,
1678,
396,
847,
18082,
1237,
29914,
8143,
29914,
29966,
20571,
20690,
13,
1678,
3142,
29898,
29878,
29915,
8143,
29914,
10780,
29925,
29966,
20571,
24566,
29900,
29899,
29929,
10062,
6802,
29938,
742,
8386,
29889,
20791,
12498,
29889,
294,
29918,
1493,
3285,
1024,
2433,
18945,
29899,
8143,
5477,
13,
13,
1678,
396,
847,
18082,
1237,
29914,
497,
29914,
13,
1678,
3142,
29898,
29878,
29915,
497,
13346,
742,
8386,
29889,
15660,
29889,
294,
29918,
1493,
3285,
1024,
2433,
497,
29918,
1761,
5477,
13,
13,
1678,
396,
847,
18082,
1237,
29914,
12346,
13,
1678,
3142,
29898,
29878,
29915,
12346,
13346,
742,
8386,
29889,
2248,
29892,
1024,
2433,
12346,
5477,
13,
13,
1678,
396,
847,
18082,
1237,
29914,
8143,
29914,
26897,
29914,
13,
1678,
3142,
29898,
29878,
29915,
8143,
29914,
26897,
13346,
742,
8386,
29889,
8143,
29918,
26897,
29892,
1024,
2433,
8143,
29899,
26897,
5477,
13,
13,
29962,
13,
2
] |
graphic_convergence_topology.py | win7/parallel_social_spider_optimization | 1 | 37922 | # -*- coding: utf-8 -*-
"""
============================================================================
Authors:
<NAME> and <NAME>*
*Department of Informatics
Universidad Nacional de San Antonio Abad del Cusco (UNSAAC) - Perú
============================================================================
"""
# Python: 3.8.x
"""
Script for evaluate best topology (static and dinamic) about convergence
"""
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter # useful for `logit` scale
import numpy as np
from utils import topology, dataset
print("******* START *******")
dataset_topology = [
[9, 5, 2, 3, 7, 8, 4, 1, 6], # d 20
[], # d 21
[5, 7, 2, 6, 8, 9, 3, 1, 4], # d 22
[9, 5, 1, 2, 8, 3, 4, 6, 7], # d 23
[8, 7, 1, 5, 2, 4, 3, 6, 9], # d 24
[7, 8, 1, 5, 6, 4, 2, 3, 9], # d 25
[9, 8, 4, 5, 1, 2, 6, 7, 3], # d 26
[7, 4, 1, 2, 8, 9, 3, 5, 6], # d 27
[8, 6, 3, 4, 5, 7, 1, 2, 9], # d 28
[] # d 29
]
rankig_low = [] # ranking metric for low dataset
rankig_high = [] # ranking metric for high dataset
rankig_all = [] # ranking metric low and high dataset
for index, index_topology in enumerate([0, 1, 2, 3, 4, 5, 6, 7, 8]): # change [0, 1, 2, 3, 4, 5, 6, 7, 8]
# load data for plot
rankig_l = []
rankig_h = []
rankig_a = []
for index_dataset in [20, 22, 23, 24, 25, 26, 27, 28]: # change [0, ..., 29]
if index_dataset >= 26:
rankig_h.append(dataset_topology[index_dataset - 20][index])
else:
rankig_l.append(dataset_topology[index_dataset - 20][index])
rankig_a.append(dataset_topology[index_dataset - 20][index])
rankig_low.append(np.sum(rankig_l))
rankig_high.append(np.sum(rankig_h))
rankig_all.append(np.sum(rankig_a))
labels = topology
# rankig_low = [20, 34, 30, 35, 27]
# rankig_high = [25, 32, 34, 20, 25]
x = np.arange(len(labels)) # the label locations
width = 0.25 # the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(x - width / 2, rankig_low, width, label='Low size')
rects2 = ax.bar(x + width / 2, rankig_high, width, label='High size')
"""rects1 = ax.bar(x - width, rankig_low, width, label='Low size')
rects2 = ax.bar(x, rankig_high, width, label='High size')
rects3 = ax.bar(x + width, rankig_all, width, label='All') """
# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel("Scores")
ax.set_xlabel("Topology")
ax.set_title("Best Topology")
ax.set_xticks(x)
ax.set_xticklabels(labels)
ax.legend()
def autolabel(rects):
"""Attach a text label above each bar in *rects*, displaying its height."""
for rect in rects:
height = rect.get_height()
ax.annotate('{}'.format(height),
xy=(rect.get_x() + rect.get_width() / 2, height),
xytext=(0, 3), # 3 points vertical offset
textcoords="offset points",
ha='center', va='bottom')
autolabel(rects1)
autolabel(rects2)
# autolabel(rects3)
fig.tight_layout()
plt.grid()
plt.show()
print("******* END *******")
# Run:
# python graphic_convergence_topology.py | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
9166,
9166,
9166,
9166,
4936,
2751,
13,
6444,
943,
29901,
13,
12,
29966,
5813,
29958,
322,
529,
5813,
29958,
29930,
13,
12,
29930,
8498,
442,
358,
310,
512,
4830,
1199,
29871,
13,
12,
11574,
2368,
8468,
316,
3087,
9630,
1976,
328,
628,
315,
375,
1111,
313,
29965,
3059,
29909,
2477,
29897,
448,
28686,
13,
9166,
9166,
9166,
9166,
4936,
2751,
13,
15945,
29908,
13,
29937,
5132,
29901,
29871,
29941,
29889,
29947,
29889,
29916,
13,
15945,
29908,
13,
4081,
363,
14707,
1900,
20159,
313,
7959,
322,
4538,
314,
293,
29897,
1048,
17221,
13,
15945,
29908,
13,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
3166,
22889,
29889,
29873,
6541,
1053,
19014,
18522,
29871,
396,
5407,
363,
421,
1188,
277,
29952,
6287,
13,
5215,
12655,
408,
7442,
13,
3166,
3667,
29879,
1053,
20159,
29892,
8783,
13,
13,
2158,
703,
2328,
17435,
6850,
8322,
334,
2328,
1068,
1159,
13,
13,
24713,
29918,
3332,
3002,
353,
518,
13,
12,
29961,
29929,
29892,
29871,
29945,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29955,
29892,
29871,
29947,
29892,
29871,
29946,
29892,
29871,
29896,
29892,
29871,
29953,
1402,
12,
29937,
270,
29871,
29906,
29900,
13,
12,
29961,
1402,
12,
12,
12,
12,
12,
12,
12,
12,
29937,
270,
29871,
29906,
29896,
13,
12,
29961,
29945,
29892,
29871,
29955,
29892,
29871,
29906,
29892,
29871,
29953,
29892,
29871,
29947,
29892,
29871,
29929,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29946,
1402,
12,
29937,
270,
29871,
29906,
29906,
13,
12,
29961,
29929,
29892,
29871,
29945,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29947,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29953,
29892,
29871,
29955,
1402,
12,
29937,
270,
29871,
29906,
29941,
13,
12,
29961,
29947,
29892,
29871,
29955,
29892,
29871,
29896,
29892,
29871,
29945,
29892,
29871,
29906,
29892,
29871,
29946,
29892,
29871,
29941,
29892,
29871,
29953,
29892,
29871,
29929,
1402,
12,
29937,
270,
29871,
29906,
29946,
13,
12,
29961,
29955,
29892,
29871,
29947,
29892,
29871,
29896,
29892,
29871,
29945,
29892,
29871,
29953,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29929,
1402,
12,
29937,
270,
29871,
29906,
29945,
13,
12,
29961,
29929,
29892,
29871,
29947,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29953,
29892,
29871,
29955,
29892,
29871,
29941,
1402,
12,
29937,
270,
29871,
29906,
29953,
13,
12,
29961,
29955,
29892,
29871,
29946,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29947,
29892,
29871,
29929,
29892,
29871,
29941,
29892,
29871,
29945,
29892,
29871,
29953,
1402,
12,
29937,
270,
29871,
29906,
29955,
13,
12,
29961,
29947,
29892,
29871,
29953,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29955,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29929,
1402,
12,
29937,
270,
29871,
29906,
29947,
13,
12,
2636,
12,
12,
12,
12,
12,
12,
12,
12,
29937,
270,
29871,
29906,
29929,
13,
29962,
13,
13,
10003,
335,
29918,
677,
353,
5159,
12,
12,
29937,
24034,
12714,
363,
4482,
8783,
13,
10003,
335,
29918,
9812,
353,
5159,
12,
29937,
24034,
12714,
363,
1880,
8783,
13,
10003,
335,
29918,
497,
353,
5159,
12,
12,
29937,
24034,
12714,
4482,
322,
1880,
8783,
13,
13,
1454,
2380,
29892,
2380,
29918,
3332,
3002,
297,
26985,
4197,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29953,
29892,
29871,
29955,
29892,
29871,
29947,
29962,
1125,
259,
396,
1735,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29953,
29892,
29871,
29955,
29892,
29871,
29947,
29962,
13,
12,
13,
12,
29937,
2254,
848,
363,
6492,
13,
12,
10003,
335,
29918,
29880,
353,
5159,
13,
12,
10003,
335,
29918,
29882,
353,
5159,
13,
12,
10003,
335,
29918,
29874,
353,
5159,
13,
12,
1454,
2380,
29918,
24713,
297,
518,
29906,
29900,
29892,
29871,
29906,
29906,
29892,
29871,
29906,
29941,
29892,
29871,
29906,
29946,
29892,
29871,
29906,
29945,
29892,
29871,
29906,
29953,
29892,
29871,
29906,
29955,
29892,
29871,
29906,
29947,
5387,
259,
396,
1735,
518,
29900,
29892,
2023,
29892,
29871,
29906,
29929,
29962,
13,
12,
12,
361,
2380,
29918,
24713,
6736,
29871,
29906,
29953,
29901,
13,
12,
12,
12,
10003,
335,
29918,
29882,
29889,
4397,
29898,
24713,
29918,
3332,
3002,
29961,
2248,
29918,
24713,
448,
29871,
29906,
29900,
3816,
2248,
2314,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
10003,
335,
29918,
29880,
29889,
4397,
29898,
24713,
29918,
3332,
3002,
29961,
2248,
29918,
24713,
448,
29871,
29906,
29900,
3816,
2248,
2314,
13,
12,
12,
10003,
335,
29918,
29874,
29889,
4397,
29898,
24713,
29918,
3332,
3002,
29961,
2248,
29918,
24713,
448,
29871,
29906,
29900,
3816,
2248,
2314,
13,
13,
12,
10003,
335,
29918,
677,
29889,
4397,
29898,
9302,
29889,
2083,
29898,
10003,
335,
29918,
29880,
876,
13,
12,
10003,
335,
29918,
9812,
29889,
4397,
29898,
9302,
29889,
2083,
29898,
10003,
335,
29918,
29882,
876,
13,
12,
10003,
335,
29918,
497,
29889,
4397,
29898,
9302,
29889,
2083,
29898,
10003,
335,
29918,
29874,
876,
13,
13,
21134,
353,
20159,
13,
29937,
7115,
335,
29918,
677,
353,
518,
29906,
29900,
29892,
29871,
29941,
29946,
29892,
29871,
29941,
29900,
29892,
29871,
29941,
29945,
29892,
29871,
29906,
29955,
29962,
13,
29937,
7115,
335,
29918,
9812,
353,
518,
29906,
29945,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
29946,
29892,
29871,
29906,
29900,
29892,
29871,
29906,
29945,
29962,
13,
13,
29916,
353,
7442,
29889,
279,
927,
29898,
2435,
29898,
21134,
876,
29871,
396,
278,
3858,
14354,
13,
2103,
353,
29871,
29900,
29889,
29906,
29945,
29871,
396,
278,
2920,
310,
278,
22306,
13,
13,
1003,
29892,
4853,
353,
14770,
29889,
1491,
26762,
580,
13,
1621,
29879,
29896,
353,
4853,
29889,
1646,
29898,
29916,
448,
2920,
847,
29871,
29906,
29892,
7115,
335,
29918,
677,
29892,
2920,
29892,
3858,
2433,
29931,
340,
2159,
1495,
13,
1621,
29879,
29906,
353,
4853,
29889,
1646,
29898,
29916,
718,
2920,
847,
29871,
29906,
29892,
7115,
335,
29918,
9812,
29892,
2920,
29892,
3858,
2433,
16382,
2159,
1495,
13,
13,
15945,
29908,
1621,
29879,
29896,
353,
4853,
29889,
1646,
29898,
29916,
448,
2920,
29892,
7115,
335,
29918,
677,
29892,
2920,
29892,
3858,
2433,
29931,
340,
2159,
1495,
13,
1621,
29879,
29906,
353,
4853,
29889,
1646,
29898,
29916,
29892,
7115,
335,
29918,
9812,
29892,
2920,
29892,
3858,
2433,
16382,
2159,
1495,
13,
1621,
29879,
29941,
353,
4853,
29889,
1646,
29898,
29916,
718,
2920,
29892,
7115,
335,
29918,
497,
29892,
2920,
29892,
3858,
2433,
3596,
1495,
9995,
13,
13,
29937,
3462,
777,
1426,
363,
11073,
29892,
3611,
322,
2888,
921,
29899,
8990,
16892,
11073,
29892,
2992,
29889,
13,
1165,
29889,
842,
29918,
29891,
1643,
703,
4421,
2361,
1159,
13,
1165,
29889,
842,
29918,
29916,
1643,
703,
7031,
3002,
1159,
13,
1165,
29889,
842,
29918,
3257,
703,
25353,
7488,
3002,
1159,
13,
1165,
29889,
842,
29918,
486,
7358,
29898,
29916,
29897,
13,
1165,
29889,
842,
29918,
486,
860,
21134,
29898,
21134,
29897,
13,
1165,
29889,
26172,
580,
13,
13,
1753,
1120,
324,
1107,
29898,
1621,
29879,
1125,
13,
1678,
9995,
4165,
496,
263,
1426,
3858,
2038,
1269,
2594,
297,
334,
1621,
29879,
15966,
16384,
967,
3171,
1213,
15945,
13,
1678,
363,
7705,
297,
7705,
29879,
29901,
13,
4706,
3171,
353,
7705,
29889,
657,
29918,
3545,
580,
13,
4706,
4853,
29889,
6735,
403,
877,
8875,
4286,
4830,
29898,
3545,
511,
13,
462,
1678,
921,
29891,
7607,
1621,
29889,
657,
29918,
29916,
580,
718,
7705,
29889,
657,
29918,
2103,
580,
847,
29871,
29906,
29892,
3171,
511,
13,
462,
1678,
921,
29891,
726,
7607,
29900,
29892,
29871,
29941,
511,
29871,
396,
29871,
29941,
3291,
11408,
9210,
13,
462,
1678,
1426,
1111,
4339,
543,
10289,
3291,
613,
13,
462,
1678,
447,
2433,
5064,
742,
2947,
2433,
8968,
1495,
13,
13,
1300,
324,
1107,
29898,
1621,
29879,
29896,
29897,
13,
1300,
324,
1107,
29898,
1621,
29879,
29906,
29897,
13,
29937,
1120,
324,
1107,
29898,
1621,
29879,
29941,
29897,
13,
13,
1003,
29889,
29873,
523,
29918,
2680,
580,
13,
13,
572,
29873,
29889,
7720,
580,
13,
572,
29873,
29889,
4294,
580,
13,
13,
2158,
703,
2328,
17435,
11056,
334,
2328,
1068,
1159,
13,
13,
29937,
7525,
29901,
13,
29937,
3017,
3983,
293,
29918,
535,
369,
10238,
29918,
3332,
3002,
29889,
2272,
2
] |
mundo2-EstruturasDeControle/047 - Contagem de pares.py | jonasht/CursoEmVideo-CursoDePython3 | 0 | 80953 | <filename>mundo2-EstruturasDeControle/047 - Contagem de pares.py
#Exercício Python 047:
#Crie um programa que mostre na tela todos os números pares que estão no intervalo entre 1 e 50.
for i in range(1, 50+1, 2):
print(i, end=' ') | [
1,
529,
9507,
29958,
29885,
6201,
29906,
29899,
29923,
710,
329,
10939,
2772,
1323,
12154,
29914,
29900,
29946,
29955,
448,
2866,
13904,
316,
610,
267,
29889,
2272,
13,
29937,
1252,
6269,
24394,
5132,
29871,
29900,
29946,
29955,
29901,
13,
29937,
29907,
2546,
1922,
16914,
712,
1556,
276,
1055,
260,
3100,
10843,
2897,
12158,
359,
610,
267,
712,
707,
1368,
694,
7292,
29877,
2637,
29871,
29896,
321,
29871,
29945,
29900,
29889,
13,
13,
1454,
474,
297,
3464,
29898,
29896,
29892,
29871,
29945,
29900,
29974,
29896,
29892,
29871,
29906,
1125,
13,
1678,
1596,
29898,
29875,
29892,
1095,
2433,
25710,
2
] |
pybliometrics/scopus/classes/__init__.py | fabiosangregorio/scopus | 11 | 189783 | <reponame>fabiosangregorio/scopus<gh_stars>10-100
from pybliometrics.scopus.classes.retrieval import *
from pybliometrics.scopus.classes.search import *
| [
1,
529,
276,
1112,
420,
29958,
16582,
2363,
574,
1727,
10893,
29914,
21785,
375,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
3166,
11451,
29890,
492,
3297,
10817,
29889,
21785,
375,
29889,
13203,
29889,
276,
509,
16837,
1053,
334,
13,
3166,
11451,
29890,
492,
3297,
10817,
29889,
21785,
375,
29889,
13203,
29889,
4478,
1053,
334,
13,
2
] |
corehq/apps/data_interfaces/views.py | johan--/commcare-hq | 0 | 98499 | <reponame>johan--/commcare-hq
import csv
import io
import uuid
from couchdbkit import ResourceNotFound
from django.contrib import messages
from django.core.cache import cache
from corehq import privileges, toggles
from corehq.apps.accounting.decorators import requires_privilege_with_fallback
from corehq.apps.casegroups.dbaccessors import get_case_groups_in_domain, \
get_number_of_case_groups_in_domain
from corehq.apps.casegroups.models import CommCareCaseGroup
from corehq.apps.hqwebapp.forms import BulkUploadForm
from corehq.apps.hqwebapp.templatetags.hq_shared_tags import static
from corehq.apps.hqwebapp.utils import get_bulk_upload_form
from corehq.util.spreadsheets.excel import JSONReaderError, WorkbookJSONReader
from django.utils.decorators import method_decorator
from openpyxl.utils.exceptions import InvalidFileException
from corehq.apps.data_interfaces.tasks import (
bulk_upload_cases_to_group, bulk_archive_forms, bulk_form_management_async)
from corehq.apps.data_interfaces.forms import (
AddCaseGroupForm, UpdateCaseGroupForm, AddCaseToGroupForm)
from corehq.apps.domain.decorators import login_and_domain_required
from corehq.apps.domain.views import BaseDomainView
from corehq.apps.hqcase.utils import get_case_by_identifier
from corehq.apps.hqwebapp.views import CRUDPaginatedViewMixin, PaginatedItemException
from corehq.apps.reports.standard.export import ExcelExportReport
from corehq.apps.data_interfaces.dispatcher import (DataInterfaceDispatcher, EditDataInterfaceDispatcher,
require_can_edit_data)
from .dispatcher import require_form_management_privilege
from .interfaces import FormManagementMode, BulkFormManagementInterface, CaseReassignmentInterface
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404, HttpResponseServerError
from django.shortcuts import render
from dimagi.utils.decorators.memoized import memoized
from django.utils.translation import ugettext as _, ugettext_noop, ugettext_lazy
from soil.exceptions import TaskFailedError
from soil.util import expose_cached_download, get_download_context
@login_and_domain_required
def default(request, domain):
if not request.project or request.project.is_snapshot:
raise Http404()
return HttpResponseRedirect(default_data_view_url(request, domain))
def default_data_view_url(request, domain):
if request.couch_user.can_view_reports():
return reverse(DataInterfaceDispatcher.name(), args=[domain, ExcelExportReport.slug])
exportable_reports = request.couch_user.get_exportable_reports(domain)
if exportable_reports:
return reverse(DataInterfaceDispatcher.name(), args=[domain, exportable_reports[0]])
if request.couch_user.can_edit_data():
return reverse(EditDataInterfaceDispatcher.name(), args=[domain, CaseReassignmentInterface.slug])
raise Http404()
class BulkUploadCasesException(Exception):
pass
class DataInterfaceSection(BaseDomainView):
section_name = ugettext_noop("Data")
@method_decorator(require_can_edit_data)
def dispatch(self, request, *args, **kwargs):
return super(DataInterfaceSection, self).dispatch(request, *args, **kwargs)
@property
def section_url(self):
return reverse("data_interfaces_default", args=[self.domain])
class CaseGroupListView(DataInterfaceSection, CRUDPaginatedViewMixin):
template_name = "data_interfaces/list_case_groups.html"
urlname = 'case_group_list'
page_title = ugettext_lazy("Case Groups")
limit_text = ugettext_lazy("groups per page")
empty_notification = ugettext_lazy("You have no case groups. Please create one!")
loading_message = ugettext_lazy("Loading groups...")
deleted_items_header = ugettext_lazy("Deleted Groups:")
new_items_header = ugettext_lazy("New Groups:")
@property
def page_url(self):
return reverse(self.urlname, args=[self.domain])
@property
def parameters(self):
return self.request.POST if self.request.method == 'POST' else self.request.GET
@property
@memoized
def total(self):
return get_number_of_case_groups_in_domain(self.domain)
@property
def column_names(self):
return [
_("Group Name"),
_("Number of Cases"),
_("Actions"),
]
@property
def page_context(self):
return self.pagination_context
@property
def paginated_list(self):
for group in get_case_groups_in_domain(
self.domain,
limit=self.limit,
skip=self.skip
):
item_data = self._get_item_data(group)
item_data['updateForm'] = self.get_update_form_response(
self.get_update_form(initial_data={
'item_id': group._id,
'name': group.name,
})
)
yield {
'itemData': item_data,
'template': 'existing-group-template',
}
def _get_item_data(self, case_group):
return {
'id': case_group._id,
'name': case_group.name,
'numCases': len(case_group.cases),
'editUrl': reverse(CaseGroupCaseManagementView.urlname, args=[self.domain, case_group._id])
}
def post(self, *args, **kwargs):
return self.paginate_crud_response
def get_create_form(self, is_blank=False):
if self.request.method == 'POST' and not is_blank:
return AddCaseGroupForm(self.request.POST)
return AddCaseGroupForm()
def get_update_form(self, initial_data=None):
if self.request.method == 'POST' and self.action == 'update':
return UpdateCaseGroupForm(self.request.POST)
return UpdateCaseGroupForm(initial=initial_data)
def get_create_item_data(self, create_form):
case_group = create_form.create_group(self.domain)
return {
'itemData': self._get_item_data(case_group),
'template': 'new-group-template',
}
def get_deleted_item_data(self, item_id):
case_group = CommCareCaseGroup.get(item_id)
item_data = self._get_item_data(case_group)
case_group.soft_delete()
return {
'itemData': item_data,
'template': 'deleted-group-template',
}
class ArchiveFormView(DataInterfaceSection):
template_name = 'data_interfaces/interfaces/import_forms.html'
urlname = 'archive_forms'
page_title = ugettext_noop("Bulk Archive Forms")
ONE_MB = 1000000
MAX_SIZE = 3 * ONE_MB
@method_decorator(requires_privilege_with_fallback(privileges.BULK_CASE_MANAGEMENT))
def dispatch(self, request, *args, **kwargs):
if not toggles.BULK_ARCHIVE_FORMS.enabled(request.user.username):
raise Http404()
return super(ArchiveFormView, self).dispatch(request, *args, **kwargs)
@property
def page_url(self):
return reverse(self.urlname, args=[self.domain])
@property
def page_context(self):
context = {}
context.update({
'bulk_upload': {
"download_url": static(
'data_interfaces/files/forms_bulk_example.xlsx'),
"adjective": _("example"),
"verb": _("archive"),
"plural_noun": _("forms"),
},
})
context.update({
'bulk_upload_form': get_bulk_upload_form(context),
})
return context
@property
@memoized
def uploaded_file(self):
try:
bulk_file = self.request.FILES['bulk_upload_file']
if bulk_file.size > self.MAX_SIZE:
raise BulkUploadCasesException(_(u"File size too large. "
"Please upload file less than"
" {size} Megabytes").format(size=self.MAX_SIZE / self.ONE_MB))
except KeyError:
raise BulkUploadCasesException(_("No files uploaded"))
try:
return WorkbookJSONReader(bulk_file)
except InvalidFileException:
try:
csv.DictReader(io.StringIO(bulk_file.read().decode('utf-8'),
newline=None))
raise BulkUploadCasesException(_("CommCare HQ does not support that file type."
"Please convert to Excel 2007 or higher (.xlsx) "
"and try again."))
except UnicodeDecodeError:
raise BulkUploadCasesException(_("Unrecognized format"))
except JSONReaderError as e:
raise BulkUploadCasesException(_('Your upload was unsuccessful. %s') % e.message)
def process(self):
try:
bulk_archive_forms.delay(
self.domain,
self.request.user,
list(self.uploaded_file.get_worksheet())
)
messages.success(self.request, _("We received your file and are processing it. "
"You will receive an email when it has finished."))
except BulkUploadCasesException as e:
messages.error(self.request, e.message)
return None
def post(self, request, *args, **kwargs):
self.process()
return HttpResponseRedirect(self.page_url)
class CaseGroupCaseManagementView(DataInterfaceSection, CRUDPaginatedViewMixin):
template_name = 'data_interfaces/manage_case_groups.html'
urlname = 'manage_case_groups'
page_title = ugettext_noop("Manage Case Group")
limit_text = ugettext_noop("cases per page")
empty_notification = ugettext_noop("You have no cases in your group.")
loading_message = ugettext_noop("Loading cases...")
deleted_items_header = ugettext_noop("Removed Cases:")
new_items_header = ugettext_noop("Added Cases:")
@property
def group_id(self):
return self.kwargs.get('group_id')
@property
@memoized
def case_group(self):
try:
return CommCareCaseGroup.get(self.group_id)
except ResourceNotFound:
raise Http404()
@property
def parent_pages(self):
return [{
'title': CaseGroupListView.page_title,
'url': reverse(CaseGroupListView.urlname, args=[self.domain])
}]
@property
def page_name(self):
return _("Manage Group '%s'" % self.case_group.name)
@property
def page_url(self):
return reverse(self.urlname, args=[self.domain, self.group_id])
@property
def page_context(self):
context = self.pagination_context
context.update({
'bulk_upload': {
"download_url": static(
'data_interfaces/files/cases_bulk_example.xlsx'),
"adjective": _("case"),
"plural_noun": _("cases"),
},
'bulk_upload_id': self.bulk_upload_id,
'update_case_group_form': self.update_case_group_form,
'group_name': self.case_group.name,
})
context.update({
'bulk_upload_form': get_bulk_upload_form(context),
})
return context
@property
@memoized
def update_case_group_form(self):
initial = {
'name': self.case_group.name,
'item_id': self.case_group._id,
}
if self.is_case_group_update:
return UpdateCaseGroupForm(self.request.POST, initial=initial)
return UpdateCaseGroupForm(initial=initial)
@property
def parameters(self):
return self.request.POST if self.request.method == 'POST' else self.request.GET
@property
@memoized
def total(self):
return self.case_group.get_total_cases()
@property
def column_names(self):
return [
_("Case Name"),
_("Phone Number"),
_("External ID"),
_("Action"),
]
@property
def paginated_list(self):
for case in self.case_group.get_cases(limit=self.limit, skip=self.skip):
yield {
'itemData': self._get_item_data(case),
'template': 'existing-case-template',
}
@property
def allowed_actions(self):
actions = super(CaseGroupCaseManagementView, self).allowed_actions
actions.append('bulk')
return actions
@property
def bulk_response(self):
return cache.get(self.request.POST['upload_id'])
@property
def is_bulk_upload(self):
return self.request.method == 'POST' and self.request.POST.get('action') == 'bulk_upload'
@property
def is_case_group_update(self):
return self.request.method == 'POST' and self.request.POST.get('action') == 'update_case_group'
@property
def bulk_upload_id(self):
if not self.is_bulk_upload:
return None
try:
if self.uploaded_file:
upload_id = uuid.uuid4().hex
bulk_upload_cases_to_group.delay(
upload_id,
self.domain,
self.group_id,
list(self.uploaded_file.get_worksheet())
)
messages.success(self.request, _("We received your file and are processing it..."))
return upload_id
except BulkUploadCasesException as e:
messages.error(self.request, e.message)
return None
@property
@memoized
def uploaded_file(self):
try:
bulk_file = self.request.FILES['bulk_upload_file']
except KeyError:
raise BulkUploadCasesException(_("No files uploaded"))
try:
return WorkbookJSONReader(bulk_file)
except InvalidFileException:
try:
csv.DictReader(io.StringIO(bulk_file.read().decode('ascii'),
newline=None))
raise BulkUploadCasesException(_("CommCare HQ no longer supports CSV upload. "
"Please convert to Excel 2007 or higher (.xlsx) "
"and try again."))
except UnicodeDecodeError:
raise BulkUploadCasesException(_("Unrecognized format"))
except JSONReaderError as e:
raise BulkUploadCasesException(_('Your upload was unsuccessful. %s') % e.message)
def _get_item_data(self, case):
return {
'id': case._id,
'detailsUrl': reverse('case_details', args=[self.domain, case._id]),
'name': case.name,
'externalId': case.external_id if case.external_id else '--',
'phoneNumber': getattr(case, 'contact_phone_number', '--'),
}
def get_create_form(self, is_blank=False):
if self.request.method == 'POST' and not is_blank:
return AddCaseToGroupForm(self.request.POST)
return AddCaseToGroupForm()
def get_create_item_data(self, create_form):
case_identifier = create_form.cleaned_data['case_identifier']
case = get_case_by_identifier(self.domain, case_identifier)
if case is None:
return {
'itemData': {
'id': case_identifier.replace(' ', '_'),
'identifier': case_identifier,
'message': _('Sorry, we could not a find a case that '
'matched the identifier you provided.'),
},
'rowClass': 'warning',
'template': 'case-message-template',
}
item_data = self._get_item_data(case)
if case._id in self.case_group.cases:
message = '<span class="label label-important">%s</span>' % _("Case already in group")
elif case.doc_type != 'CommCareCase':
message = '<span class="label label-important">%s</span>' % _("It looks like this case was deleted.")
else:
message = '<span class="label label-success">%s</span>' % _("Case added")
self.case_group.cases.append(case._id)
self.case_group.save()
item_data['message'] = message
return {
'itemData': item_data,
'template': 'new-case-template',
}
def get_deleted_item_data(self, item_id):
if not item_id:
raise PaginatedItemException("The case's ID was blank.")
current_cases = set(self.case_group.cases)
self.case_group.cases = list(current_cases.difference([item_id]))
self.case_group.save()
return {
'template': 'removed-case-template',
}
def post(self, request, *args, **kwargs):
if self.is_bulk_upload or self.is_case_group_update:
if self.is_case_group_update and self.update_case_group_form.is_valid():
self.update_case_group_form.update_group()
return HttpResponseRedirect(self.page_url)
return self.get(request, *args, **kwargs)
return self.paginate_crud_response
class XFormManagementView(DataInterfaceSection):
urlname = 'xform_management'
page_title = ugettext_noop('Form Management')
def get_form_ids_or_query_string(self, request):
if 'select_all' in self.request.POST:
# Altough evaluating form_ids and sending to task would be cleaner,
# heavier calls should be in in an async task instead
import urllib
form_query_string = urllib.unquote(self.request.POST.get('select_all'))
return form_query_string
else:
return self.request.POST.getlist('xform_ids')
def post(self, request, *args, **kwargs):
form_ids_or_query_string = self.get_form_ids_or_query_string(request)
mode = self.request.POST.get('mode')
task_ref = expose_cached_download(payload=None, expiry=1*60*60, file_extension=None)
task = bulk_form_management_async.delay(
mode,
self.domain,
self.request.couch_user,
form_ids_or_query_string
)
task_ref.set_task(task)
return HttpResponseRedirect(
reverse(
XFormManagementStatusView.urlname,
args=[self.domain, mode, task_ref.download_id]
)
)
@method_decorator(require_form_management_privilege)
def dispatch(self, request, *args, **kwargs):
return super(XFormManagementView, self).dispatch(request, *args, **kwargs)
class XFormManagementStatusView(DataInterfaceSection):
urlname = 'xform_management_status'
page_title = ugettext_noop('Form Status')
def get(self, request, *args, **kwargs):
context = super(XFormManagementStatusView, self).main_context
mode = FormManagementMode(kwargs['mode'])
context.update({
'domain': self.domain,
'download_id': kwargs['download_id'],
'poll_url': "{url}?mode={mode}".format(
url=reverse('xform_management_job_poll', args=[self.domain, kwargs['download_id']]),
mode=mode.mode_name),
'title': mode.status_page_title,
'error_text': mode.error_text,
})
return render(request, 'style/bootstrap2/soil_status_full.html', context)
def page_url(self):
return reverse(self.urlname, args=self.args, kwargs=self.kwargs)
@require_can_edit_data
@require_form_management_privilege
def xform_management_job_poll(request, domain, download_id,
template="data_interfaces/partials/xform_management_status.html"):
mode = FormManagementMode(request.GET.get('mode'), validate=True)
try:
context = get_download_context(download_id, check_state=True)
except TaskFailedError:
return HttpResponseServerError()
context.update({
'on_complete_short': mode.complete_short,
'mode': mode,
'form_management_url': reverse(EditDataInterfaceDispatcher.name(),
args=[domain, BulkFormManagementInterface.slug])
})
return render(request, template, context)
| [
1,
529,
276,
1112,
420,
29958,
29926,
1148,
273,
489,
29914,
2055,
18020,
29899,
29882,
29939,
13,
5215,
11799,
13,
5215,
12013,
13,
5215,
318,
5416,
13,
3166,
274,
3222,
2585,
7354,
1053,
18981,
17413,
13,
3166,
9557,
29889,
21570,
1053,
7191,
13,
3166,
9557,
29889,
3221,
29889,
8173,
1053,
7090,
13,
3166,
7136,
29882,
29939,
1053,
28091,
29892,
17304,
793,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
10149,
292,
29889,
19557,
4097,
1053,
6858,
29918,
22534,
488,
479,
29918,
2541,
29918,
11950,
1627,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
9398,
4872,
4410,
29889,
2585,
5943,
943,
1053,
679,
29918,
4878,
29918,
13155,
29918,
262,
29918,
7247,
29892,
320,
13,
1678,
679,
29918,
4537,
29918,
974,
29918,
4878,
29918,
13155,
29918,
262,
29918,
7247,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
9398,
4872,
4410,
29889,
9794,
1053,
1876,
29907,
598,
8259,
4782,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
29882,
29939,
2676,
932,
29889,
9514,
1053,
8313,
29895,
17553,
2500,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
29882,
29939,
2676,
932,
29889,
1356,
572,
271,
300,
810,
29889,
29882,
29939,
29918,
12366,
29918,
11338,
1053,
2294,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
29882,
29939,
2676,
932,
29889,
13239,
1053,
679,
29918,
8645,
29895,
29918,
9009,
29918,
689,
13,
3166,
7136,
29882,
29939,
29889,
4422,
29889,
1028,
949,
19360,
29889,
24633,
1053,
4663,
6982,
2392,
29892,
5244,
2909,
7249,
6982,
13,
3166,
9557,
29889,
13239,
29889,
19557,
4097,
1053,
1158,
29918,
19557,
1061,
13,
3166,
1722,
2272,
15524,
29889,
13239,
29889,
11739,
29879,
1053,
21403,
2283,
2451,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
1272,
29918,
1639,
8726,
29889,
20673,
1053,
313,
13,
1678,
21610,
29918,
9009,
29918,
11436,
29918,
517,
29918,
2972,
29892,
21610,
29918,
10867,
29918,
9514,
29892,
21610,
29918,
689,
29918,
21895,
29918,
12674,
29897,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
1272,
29918,
1639,
8726,
29889,
9514,
1053,
313,
13,
1678,
3462,
8259,
4782,
2500,
29892,
10318,
8259,
4782,
2500,
29892,
3462,
8259,
1762,
4782,
2500,
29897,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
7247,
29889,
19557,
4097,
1053,
6464,
29918,
392,
29918,
7247,
29918,
12403,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
7247,
29889,
7406,
1053,
7399,
15951,
1043,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
29882,
29939,
4878,
29889,
13239,
1053,
679,
29918,
4878,
29918,
1609,
29918,
25378,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
29882,
29939,
2676,
932,
29889,
7406,
1053,
15600,
29965,
11191,
26584,
630,
1043,
29924,
861,
262,
29892,
349,
26584,
630,
2001,
2451,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
276,
4011,
29889,
15770,
29889,
15843,
1053,
11388,
26382,
13020,
13,
3166,
7136,
29882,
29939,
29889,
13371,
29889,
1272,
29918,
1639,
8726,
29889,
13369,
261,
1053,
313,
1469,
10448,
23669,
29892,
7641,
1469,
10448,
23669,
29892,
13,
462,
462,
462,
1678,
1996,
29918,
3068,
29918,
5628,
29918,
1272,
29897,
13,
3166,
869,
13369,
261,
1053,
1996,
29918,
689,
29918,
21895,
29918,
22534,
488,
479,
13,
3166,
869,
1639,
8726,
1053,
3812,
27107,
6818,
29892,
8313,
29895,
2500,
27107,
10448,
29892,
11733,
1123,
465,
10194,
10448,
13,
3166,
9557,
29889,
3221,
29889,
2271,
9778,
874,
1053,
11837,
13,
3166,
9557,
29889,
1124,
1053,
9056,
5103,
24735,
29892,
9056,
29946,
29900,
29946,
29892,
9056,
5103,
6004,
2392,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
3166,
3964,
17698,
29889,
13239,
29889,
19557,
4097,
29889,
6954,
29877,
1891,
1053,
2626,
29877,
1891,
13,
3166,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
318,
657,
726,
408,
17117,
318,
657,
726,
29918,
1217,
459,
29892,
318,
657,
726,
29918,
433,
1537,
13,
3166,
22473,
29889,
11739,
29879,
1053,
9330,
17776,
2392,
13,
3166,
22473,
29889,
4422,
1053,
24396,
29918,
29883,
3791,
29918,
10382,
29892,
679,
29918,
10382,
29918,
4703,
13,
13,
13,
29992,
7507,
29918,
392,
29918,
7247,
29918,
12403,
13,
1753,
2322,
29898,
3827,
29892,
5354,
1125,
13,
1678,
565,
451,
2009,
29889,
4836,
470,
2009,
29889,
4836,
29889,
275,
29918,
29879,
14551,
29901,
13,
4706,
12020,
9056,
29946,
29900,
29946,
580,
13,
13,
1678,
736,
9056,
5103,
24735,
29898,
4381,
29918,
1272,
29918,
1493,
29918,
2271,
29898,
3827,
29892,
5354,
876,
13,
13,
13,
1753,
2322,
29918,
1272,
29918,
1493,
29918,
2271,
29898,
3827,
29892,
5354,
1125,
13,
1678,
565,
2009,
29889,
29883,
3222,
29918,
1792,
29889,
3068,
29918,
1493,
29918,
276,
4011,
7295,
13,
4706,
736,
11837,
29898,
1469,
10448,
23669,
29889,
978,
3285,
6389,
11759,
7247,
29892,
11388,
26382,
13020,
29889,
29517,
2314,
13,
13,
1678,
5609,
519,
29918,
276,
4011,
353,
2009,
29889,
29883,
3222,
29918,
1792,
29889,
657,
29918,
15843,
519,
29918,
276,
4011,
29898,
7247,
29897,
13,
1678,
565,
5609,
519,
29918,
276,
4011,
29901,
13,
4706,
736,
11837,
29898,
1469,
10448,
23669,
29889,
978,
3285,
6389,
11759,
7247,
29892,
5609,
519,
29918,
276,
4011,
29961,
29900,
24960,
13,
13,
1678,
565,
2009,
29889,
29883,
3222,
29918,
1792,
29889,
3068,
29918,
5628,
29918,
1272,
7295,
13,
4706,
736,
11837,
29898,
6103,
1469,
10448,
23669,
29889,
978,
3285,
6389,
11759,
7247,
29892,
11733,
1123,
465,
10194,
10448,
29889,
29517,
2314,
13,
1678,
12020,
9056,
29946,
29900,
29946,
580,
13,
13,
13,
1990,
8313,
29895,
17553,
29907,
2129,
2451,
29898,
2451,
1125,
13,
1678,
1209,
13,
13,
13,
1990,
3630,
10448,
13438,
29898,
5160,
15951,
1043,
1125,
13,
1678,
4004,
29918,
978,
353,
318,
657,
726,
29918,
1217,
459,
703,
1469,
1159,
13,
13,
1678,
732,
5696,
29918,
19557,
1061,
29898,
12277,
29918,
3068,
29918,
5628,
29918,
1272,
29897,
13,
1678,
822,
13916,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
2428,
29898,
1469,
10448,
13438,
29892,
1583,
467,
13369,
29898,
3827,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
4004,
29918,
2271,
29898,
1311,
1125,
13,
4706,
736,
11837,
703,
1272,
29918,
1639,
8726,
29918,
4381,
613,
6389,
11759,
1311,
29889,
7247,
2314,
13,
13,
13,
1990,
11733,
4782,
15660,
29898,
1469,
10448,
13438,
29892,
15600,
29965,
11191,
26584,
630,
1043,
29924,
861,
262,
1125,
13,
1678,
4472,
29918,
978,
353,
376,
1272,
29918,
1639,
8726,
29914,
1761,
29918,
4878,
29918,
13155,
29889,
1420,
29908,
13,
1678,
3142,
978,
353,
525,
4878,
29918,
2972,
29918,
1761,
29915,
13,
1678,
1813,
29918,
3257,
353,
318,
657,
726,
29918,
433,
1537,
703,
8259,
1632,
4410,
1159,
13,
13,
1678,
4046,
29918,
726,
353,
318,
657,
726,
29918,
433,
1537,
703,
13155,
639,
1813,
1159,
13,
1678,
4069,
29918,
24671,
353,
318,
657,
726,
29918,
433,
1537,
703,
3492,
505,
694,
1206,
6471,
29889,
3529,
1653,
697,
29991,
1159,
13,
1678,
8363,
29918,
4906,
353,
318,
657,
726,
29918,
433,
1537,
703,
23456,
6471,
856,
1159,
13,
1678,
11132,
29918,
7076,
29918,
6672,
353,
318,
657,
726,
29918,
433,
1537,
703,
2772,
22742,
1632,
4410,
29901,
1159,
13,
1678,
716,
29918,
7076,
29918,
6672,
353,
318,
657,
726,
29918,
433,
1537,
703,
4373,
1632,
4410,
29901,
1159,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1813,
29918,
2271,
29898,
1311,
1125,
13,
4706,
736,
11837,
29898,
1311,
29889,
2271,
978,
29892,
6389,
11759,
1311,
29889,
7247,
2314,
13,
13,
1678,
732,
6799,
13,
1678,
822,
4128,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3827,
29889,
5438,
565,
1583,
29889,
3827,
29889,
5696,
1275,
525,
5438,
29915,
1683,
1583,
29889,
3827,
29889,
7194,
13,
13,
1678,
732,
6799,
13,
1678,
732,
6954,
29877,
1891,
13,
1678,
822,
3001,
29898,
1311,
1125,
13,
4706,
736,
679,
29918,
4537,
29918,
974,
29918,
4878,
29918,
13155,
29918,
262,
29918,
7247,
29898,
1311,
29889,
7247,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1897,
29918,
7039,
29898,
1311,
1125,
13,
4706,
736,
518,
13,
9651,
903,
703,
4782,
4408,
4968,
13,
9651,
903,
703,
4557,
310,
315,
2129,
4968,
13,
9651,
903,
703,
26525,
4968,
13,
4706,
4514,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1813,
29918,
4703,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
13573,
3381,
29918,
4703,
13,
13,
1678,
732,
6799,
13,
1678,
822,
10203,
262,
630,
29918,
1761,
29898,
1311,
1125,
13,
4706,
363,
2318,
297,
679,
29918,
4878,
29918,
13155,
29918,
262,
29918,
7247,
29898,
13,
18884,
1583,
29889,
7247,
29892,
13,
18884,
4046,
29922,
1311,
29889,
13400,
29892,
13,
18884,
14383,
29922,
1311,
29889,
11014,
13,
632,
1125,
13,
9651,
2944,
29918,
1272,
353,
1583,
3032,
657,
29918,
667,
29918,
1272,
29898,
2972,
29897,
13,
9651,
2944,
29918,
1272,
1839,
5504,
2500,
2033,
353,
1583,
29889,
657,
29918,
5504,
29918,
689,
29918,
5327,
29898,
13,
18884,
1583,
29889,
657,
29918,
5504,
29918,
689,
29898,
11228,
29918,
1272,
3790,
13,
462,
1678,
525,
667,
29918,
333,
2396,
2318,
3032,
333,
29892,
13,
462,
1678,
525,
978,
2396,
2318,
29889,
978,
29892,
13,
18884,
5615,
13,
9651,
1723,
13,
9651,
7709,
426,
13,
18884,
525,
667,
1469,
2396,
2944,
29918,
1272,
29892,
13,
18884,
525,
6886,
2396,
525,
735,
15423,
29899,
2972,
29899,
6886,
742,
13,
9651,
500,
13,
13,
1678,
822,
903,
657,
29918,
667,
29918,
1272,
29898,
1311,
29892,
1206,
29918,
2972,
1125,
13,
4706,
736,
426,
13,
9651,
525,
333,
2396,
1206,
29918,
2972,
3032,
333,
29892,
13,
9651,
525,
978,
2396,
1206,
29918,
2972,
29889,
978,
29892,
13,
9651,
525,
1949,
29907,
2129,
2396,
7431,
29898,
4878,
29918,
2972,
29889,
11436,
511,
13,
9651,
525,
5628,
5983,
2396,
11837,
29898,
8259,
4782,
8259,
27107,
1043,
29889,
2271,
978,
29892,
6389,
11759,
1311,
29889,
7247,
29892,
1206,
29918,
2972,
3032,
333,
2314,
13,
4706,
500,
13,
13,
1678,
822,
1400,
29898,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
1583,
29889,
13573,
16976,
29918,
7283,
566,
29918,
5327,
13,
13,
1678,
822,
679,
29918,
3258,
29918,
689,
29898,
1311,
29892,
338,
29918,
19465,
29922,
8824,
1125,
13,
4706,
565,
1583,
29889,
3827,
29889,
5696,
1275,
525,
5438,
29915,
322,
451,
338,
29918,
19465,
29901,
13,
9651,
736,
3462,
8259,
4782,
2500,
29898,
1311,
29889,
3827,
29889,
5438,
29897,
13,
4706,
736,
3462,
8259,
4782,
2500,
580,
13,
13,
1678,
822,
679,
29918,
5504,
29918,
689,
29898,
1311,
29892,
2847,
29918,
1272,
29922,
8516,
1125,
13,
4706,
565,
1583,
29889,
3827,
29889,
5696,
1275,
525,
5438,
29915,
322,
1583,
29889,
2467,
1275,
525,
5504,
2396,
13,
9651,
736,
10318,
8259,
4782,
2500,
29898,
1311,
29889,
3827,
29889,
5438,
29897,
13,
4706,
736,
10318,
8259,
4782,
2500,
29898,
11228,
29922,
11228,
29918,
1272,
29897,
13,
13,
1678,
822,
679,
29918,
3258,
29918,
667,
29918,
1272,
29898,
1311,
29892,
1653,
29918,
689,
1125,
13,
4706,
1206,
29918,
2972,
353,
1653,
29918,
689,
29889,
3258,
29918,
2972,
29898,
1311,
29889,
7247,
29897,
13,
4706,
736,
426,
13,
9651,
525,
667,
1469,
2396,
1583,
3032,
657,
29918,
667,
29918,
1272,
29898,
4878,
29918,
2972,
511,
13,
9651,
525,
6886,
2396,
525,
1482,
29899,
2972,
29899,
6886,
742,
13,
4706,
500,
13,
13,
1678,
822,
679,
29918,
311,
22742,
29918,
667,
29918,
1272,
29898,
1311,
29892,
2944,
29918,
333,
1125,
13,
4706,
1206,
29918,
2972,
353,
1876,
29907,
598,
8259,
4782,
29889,
657,
29898,
667,
29918,
333,
29897,
13,
4706,
2944,
29918,
1272,
353,
1583,
3032,
657,
29918,
667,
29918,
1272,
29898,
4878,
29918,
2972,
29897,
13,
4706,
1206,
29918,
2972,
29889,
2695,
29918,
8143,
580,
13,
4706,
736,
426,
13,
9651,
525,
667,
1469,
2396,
2944,
29918,
1272,
29892,
13,
9651,
525,
6886,
2396,
525,
311,
22742,
29899,
2972,
29899,
6886,
742,
13,
4706,
500,
13,
13,
13,
1990,
9000,
2500,
1043,
29898,
1469,
10448,
13438,
1125,
13,
1678,
4472,
29918,
978,
353,
525,
1272,
29918,
1639,
8726,
29914,
1639,
8726,
29914,
5215,
29918,
9514,
29889,
1420,
29915,
13,
1678,
3142,
978,
353,
525,
10867,
29918,
9514,
29915,
13,
1678,
1813,
29918,
3257,
353,
318,
657,
726,
29918,
1217,
459,
703,
29933,
24456,
9000,
3812,
29879,
1159,
13,
13,
1678,
6732,
29923,
29918,
9486,
353,
29871,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
13,
1678,
18134,
29918,
14226,
353,
29871,
29941,
334,
6732,
29923,
29918,
9486,
13,
13,
1678,
732,
5696,
29918,
19557,
1061,
29898,
276,
339,
2658,
29918,
22534,
488,
479,
29918,
2541,
29918,
11950,
1627,
29898,
22534,
488,
2710,
29889,
7838,
29931,
29968,
29918,
23487,
29918,
1529,
3521,
1692,
13780,
876,
13,
1678,
822,
13916,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
565,
451,
17304,
793,
29889,
7838,
29931,
29968,
29918,
1718,
3210,
18474,
29918,
22051,
4345,
29889,
17590,
29898,
3827,
29889,
1792,
29889,
6786,
1125,
13,
9651,
12020,
9056,
29946,
29900,
29946,
580,
13,
4706,
736,
2428,
29898,
13197,
573,
2500,
1043,
29892,
1583,
467,
13369,
29898,
3827,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1813,
29918,
2271,
29898,
1311,
1125,
13,
4706,
736,
11837,
29898,
1311,
29889,
2271,
978,
29892,
6389,
11759,
1311,
29889,
7247,
2314,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1813,
29918,
4703,
29898,
1311,
1125,
13,
4706,
3030,
353,
6571,
13,
4706,
3030,
29889,
5504,
3319,
13,
9651,
525,
8645,
29895,
29918,
9009,
2396,
426,
13,
18884,
376,
10382,
29918,
2271,
1115,
2294,
29898,
13,
462,
1678,
525,
1272,
29918,
1639,
8726,
29914,
5325,
29914,
9514,
29918,
8645,
29895,
29918,
4773,
29889,
20267,
29916,
5477,
13,
18884,
376,
328,
25674,
1115,
903,
703,
4773,
4968,
13,
18884,
376,
18248,
1115,
903,
703,
10867,
4968,
13,
18884,
376,
572,
3631,
29918,
29876,
1309,
1115,
903,
703,
9514,
4968,
13,
9651,
2981,
13,
4706,
5615,
13,
4706,
3030,
29889,
5504,
3319,
13,
9651,
525,
8645,
29895,
29918,
9009,
29918,
689,
2396,
679,
29918,
8645,
29895,
29918,
9009,
29918,
689,
29898,
4703,
511,
13,
4706,
5615,
13,
4706,
736,
3030,
13,
13,
1678,
732,
6799,
13,
1678,
732,
6954,
29877,
1891,
13,
1678,
822,
20373,
29918,
1445,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
21610,
29918,
1445,
353,
1583,
29889,
3827,
29889,
24483,
1839,
8645,
29895,
29918,
9009,
29918,
1445,
2033,
13,
9651,
565,
21610,
29918,
1445,
29889,
2311,
1405,
1583,
29889,
12648,
29918,
14226,
29901,
13,
18884,
12020,
8313,
29895,
17553,
29907,
2129,
2451,
7373,
29898,
29884,
29908,
2283,
2159,
2086,
2919,
29889,
376,
13,
462,
462,
462,
376,
12148,
6441,
934,
3109,
1135,
29908,
13,
462,
462,
462,
376,
426,
2311,
29913,
13727,
10798,
2167,
2564,
4830,
29898,
2311,
29922,
1311,
29889,
12648,
29918,
14226,
847,
1583,
29889,
12413,
29918,
9486,
876,
13,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
12020,
8313,
29895,
17553,
29907,
2129,
2451,
7373,
703,
3782,
2066,
20373,
5783,
13,
4706,
1018,
29901,
13,
9651,
736,
5244,
2909,
7249,
6982,
29898,
8645,
29895,
29918,
1445,
29897,
13,
4706,
5174,
21403,
2283,
2451,
29901,
13,
9651,
1018,
29901,
13,
18884,
11799,
29889,
21533,
6982,
29898,
601,
29889,
1231,
5971,
29898,
8645,
29895,
29918,
1445,
29889,
949,
2141,
13808,
877,
9420,
29899,
29947,
5477,
13,
462,
462,
965,
25899,
29922,
8516,
876,
13,
18884,
12020,
8313,
29895,
17553,
29907,
2129,
2451,
7373,
703,
5261,
29907,
598,
379,
29984,
947,
451,
2304,
393,
934,
1134,
1213,
13,
462,
462,
462,
376,
12148,
3588,
304,
11388,
29871,
29906,
29900,
29900,
29955,
470,
6133,
14544,
20267,
29916,
29897,
376,
13,
462,
462,
462,
376,
392,
1018,
1449,
1213,
876,
13,
9651,
5174,
23862,
2772,
401,
2392,
29901,
13,
18884,
12020,
8313,
29895,
17553,
29907,
2129,
2451,
7373,
703,
2525,
29423,
1891,
3402,
5783,
13,
4706,
5174,
4663,
6982,
2392,
408,
321,
29901,
13,
9651,
12020,
8313,
29895,
17553,
29907,
2129,
2451,
7373,
877,
10858,
6441,
471,
443,
8698,
1319,
29889,
1273,
29879,
1495,
1273,
321,
29889,
4906,
29897,
13,
13,
1678,
822,
1889,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
21610,
29918,
10867,
29918,
9514,
29889,
18829,
29898,
13,
18884,
1583,
29889,
7247,
29892,
13,
18884,
1583,
29889,
3827,
29889,
1792,
29892,
13,
18884,
1051,
29898,
1311,
29889,
9009,
287,
29918,
1445,
29889,
657,
29918,
1287,
9855,
3101,
13,
9651,
1723,
13,
9651,
7191,
29889,
8698,
29898,
1311,
29889,
3827,
29892,
903,
703,
4806,
4520,
596,
934,
322,
526,
9068,
372,
29889,
376,
13,
462,
462,
632,
376,
3492,
674,
7150,
385,
4876,
746,
372,
756,
7743,
1213,
876,
13,
4706,
5174,
8313,
29895,
17553,
29907,
2129,
2451,
408,
321,
29901,
13,
9651,
7191,
29889,
2704,
29898,
1311,
29889,
3827,
29892,
321,
29889,
4906,
29897,
13,
4706,
736,
6213,
13,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
1583,
29889,
5014,
580,
13,
4706,
736,
9056,
5103,
24735,
29898,
1311,
29889,
3488,
29918,
2271,
29897,
13,
13,
13,
1990,
11733,
4782,
8259,
27107,
1043,
29898,
1469,
10448,
13438,
29892,
15600,
29965,
11191,
26584,
630,
1043,
29924,
861,
262,
1125,
13,
1678,
4472,
29918,
978,
353,
525,
1272,
29918,
1639,
8726,
29914,
1171,
482,
29918,
4878,
29918,
13155,
29889,
1420,
29915,
13,
1678,
3142,
978,
353,
525,
1171,
482,
29918,
4878,
29918,
13155,
29915,
13,
1678,
1813,
29918,
3257,
353,
318,
657,
726,
29918,
1217,
459,
703,
2517,
482,
11733,
6431,
1159,
13,
13,
1678,
4046,
29918,
726,
353,
318,
657,
726,
29918,
1217,
459,
703,
11436,
639,
1813,
1159,
13,
1678,
4069,
29918,
24671,
353,
318,
657,
726,
29918,
1217,
459,
703,
3492,
505,
694,
4251,
297,
596,
2318,
23157,
13,
1678,
8363,
29918,
4906,
353,
318,
657,
726,
29918,
1217,
459,
703,
23456,
4251,
856,
1159,
13,
1678,
11132,
29918,
7076,
29918,
6672,
353,
318,
657,
726,
29918,
1217,
459,
703,
7301,
8238,
315,
2129,
29901,
1159,
13,
1678,
716,
29918,
7076,
29918,
6672,
353,
318,
657,
726,
29918,
1217,
459,
703,
2528,
287,
315,
2129,
29901,
1159,
13,
13,
1678,
732,
6799,
13,
1678,
822,
2318,
29918,
333,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
19290,
29889,
657,
877,
2972,
29918,
333,
1495,
13,
13,
1678,
732,
6799,
13,
1678,
732,
6954,
29877,
1891,
13,
1678,
822,
1206,
29918,
2972,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
1876,
29907,
598,
8259,
4782,
29889,
657,
29898,
1311,
29889,
2972,
29918,
333,
29897,
13,
4706,
5174,
18981,
17413,
29901,
13,
9651,
12020,
9056,
29946,
29900,
29946,
580,
13,
13,
1678,
732,
6799,
13,
1678,
822,
3847,
29918,
12292,
29898,
1311,
1125,
13,
4706,
736,
15974,
13,
9651,
525,
3257,
2396,
11733,
4782,
15660,
29889,
3488,
29918,
3257,
29892,
13,
9651,
525,
2271,
2396,
11837,
29898,
8259,
4782,
15660,
29889,
2271,
978,
29892,
6389,
11759,
1311,
29889,
7247,
2314,
13,
4706,
500,
29962,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1813,
29918,
978,
29898,
1311,
1125,
13,
4706,
736,
903,
703,
2517,
482,
6431,
14210,
29879,
11838,
1273,
1583,
29889,
4878,
29918,
2972,
29889,
978,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1813,
29918,
2271,
29898,
1311,
1125,
13,
4706,
736,
11837,
29898,
1311,
29889,
2271,
978,
29892,
6389,
11759,
1311,
29889,
7247,
29892,
1583,
29889,
2972,
29918,
333,
2314,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1813,
29918,
4703,
29898,
1311,
1125,
13,
4706,
3030,
353,
1583,
29889,
13573,
3381,
29918,
4703,
13,
4706,
3030,
29889,
5504,
3319,
13,
9651,
525,
8645,
29895,
29918,
9009,
2396,
426,
13,
18884,
376,
10382,
29918,
2271,
1115,
2294,
29898,
13,
462,
1678,
525,
1272,
29918,
1639,
8726,
29914,
5325,
29914,
11436,
29918,
8645,
29895,
29918,
4773,
29889,
20267,
29916,
5477,
13,
18884,
376,
328,
25674,
1115,
903,
703,
4878,
4968,
13,
18884,
376,
572,
3631,
29918,
29876,
1309,
1115,
903,
703,
11436,
4968,
13,
9651,
2981,
13,
9651,
525,
8645,
29895,
29918,
9009,
29918,
333,
2396,
1583,
29889,
8645,
29895,
29918,
9009,
29918,
333,
29892,
13,
9651,
525,
5504,
29918,
4878,
29918,
2972,
29918,
689,
2396,
1583,
29889,
5504,
29918,
4878,
29918,
2972,
29918,
689,
29892,
13,
9651,
525,
2972,
29918,
978,
2396,
1583,
29889,
4878,
29918,
2972,
29889,
978,
29892,
13,
4706,
5615,
13,
4706,
3030,
29889,
5504,
3319,
13,
9651,
525,
8645,
29895,
29918,
9009,
29918,
689,
2396,
679,
29918,
8645,
29895,
29918,
9009,
29918,
689,
29898,
4703,
511,
13,
4706,
5615,
13,
4706,
736,
3030,
13,
13,
1678,
732,
6799,
13,
1678,
732,
6954,
29877,
1891,
13,
1678,
822,
2767,
29918,
4878,
29918,
2972,
29918,
689,
29898,
1311,
1125,
13,
4706,
2847,
353,
426,
13,
9651,
525,
978,
2396,
1583,
29889,
4878,
29918,
2972,
29889,
978,
29892,
13,
9651,
525,
667,
29918,
333,
2396,
1583,
29889,
4878,
29918,
2972,
3032,
333,
29892,
13,
4706,
500,
13,
4706,
565,
1583,
29889,
275,
29918,
4878,
29918,
2972,
29918,
5504,
29901,
13,
9651,
736,
10318,
8259,
4782,
2500,
29898,
1311,
29889,
3827,
29889,
5438,
29892,
2847,
29922,
11228,
29897,
13,
4706,
736,
10318,
8259,
4782,
2500,
29898,
11228,
29922,
11228,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
4128,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3827,
29889,
5438,
565,
1583,
29889,
3827,
29889,
5696,
1275,
525,
5438,
29915,
1683,
1583,
29889,
3827,
29889,
7194,
13,
13,
1678,
732,
6799,
13,
1678,
732,
6954,
29877,
1891,
13,
1678,
822,
3001,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
4878,
29918,
2972,
29889,
657,
29918,
7827,
29918,
11436,
580,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1897,
29918,
7039,
29898,
1311,
1125,
13,
4706,
736,
518,
13,
9651,
903,
703,
8259,
4408,
4968,
13,
9651,
903,
703,
9861,
9681,
4968,
13,
9651,
903,
703,
25865,
3553,
4968,
13,
9651,
903,
703,
4276,
4968,
13,
4706,
4514,
13,
13,
1678,
732,
6799,
13,
1678,
822,
10203,
262,
630,
29918,
1761,
29898,
1311,
1125,
13,
4706,
363,
1206,
297,
1583,
29889,
4878,
29918,
2972,
29889,
657,
29918,
11436,
29898,
13400,
29922,
1311,
29889,
13400,
29892,
14383,
29922,
1311,
29889,
11014,
1125,
13,
9651,
7709,
426,
13,
18884,
525,
667,
1469,
2396,
1583,
3032,
657,
29918,
667,
29918,
1272,
29898,
4878,
511,
13,
18884,
525,
6886,
2396,
525,
735,
15423,
29899,
4878,
29899,
6886,
742,
13,
9651,
500,
13,
13,
1678,
732,
6799,
13,
1678,
822,
6068,
29918,
7387,
29898,
1311,
1125,
13,
4706,
8820,
353,
2428,
29898,
8259,
4782,
8259,
27107,
1043,
29892,
1583,
467,
24622,
29918,
7387,
13,
4706,
8820,
29889,
4397,
877,
8645,
29895,
1495,
13,
4706,
736,
8820,
13,
13,
1678,
732,
6799,
13,
1678,
822,
21610,
29918,
5327,
29898,
1311,
1125,
13,
4706,
736,
7090,
29889,
657,
29898,
1311,
29889,
3827,
29889,
5438,
1839,
9009,
29918,
333,
11287,
13,
13,
1678,
732,
6799,
13,
1678,
822,
338,
29918,
8645,
29895,
29918,
9009,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3827,
29889,
5696,
1275,
525,
5438,
29915,
322,
1583,
29889,
3827,
29889,
5438,
29889,
657,
877,
2467,
1495,
1275,
525,
8645,
29895,
29918,
9009,
29915,
13,
13,
1678,
732,
6799,
13,
1678,
822,
338,
29918,
4878,
29918,
2972,
29918,
5504,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
3827,
29889,
5696,
1275,
525,
5438,
29915,
322,
1583,
29889,
3827,
29889,
5438,
29889,
657,
877,
2467,
1495,
1275,
525,
5504,
29918,
4878,
29918,
2972,
29915,
13,
13,
1678,
732,
6799,
13,
1678,
822,
21610,
29918,
9009,
29918,
333,
29898,
1311,
1125,
13,
4706,
565,
451,
1583,
29889,
275,
29918,
8645,
29895,
29918,
9009,
29901,
13,
9651,
736,
6213,
13,
4706,
1018,
29901,
13,
9651,
565,
1583,
29889,
9009,
287,
29918,
1445,
29901,
13,
18884,
6441,
29918,
333,
353,
318,
5416,
29889,
25118,
29946,
2141,
20970,
13,
18884,
21610,
29918,
9009,
29918,
11436,
29918,
517,
29918,
2972,
29889,
18829,
29898,
13,
462,
1678,
6441,
29918,
333,
29892,
13,
462,
1678,
1583,
29889,
7247,
29892,
13,
462,
1678,
1583,
29889,
2972,
29918,
333,
29892,
13,
462,
1678,
1051,
29898,
1311,
29889,
9009,
287,
29918,
1445,
29889,
657,
29918,
1287,
9855,
3101,
13,
18884,
1723,
13,
18884,
7191,
29889,
8698,
29898,
1311,
29889,
3827,
29892,
903,
703,
4806,
4520,
596,
934,
322,
526,
9068,
372,
856,
5783,
13,
18884,
736,
6441,
29918,
333,
13,
4706,
5174,
8313,
29895,
17553,
29907,
2129,
2451,
408,
321,
29901,
13,
9651,
7191,
29889,
2704,
29898,
1311,
29889,
3827,
29892,
321,
29889,
4906,
29897,
13,
4706,
736,
6213,
13,
13,
1678,
732,
6799,
13,
1678,
732,
6954,
29877,
1891,
13,
1678,
822,
20373,
29918,
1445,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
21610,
29918,
1445,
353,
1583,
29889,
3827,
29889,
24483,
1839,
8645,
29895,
29918,
9009,
29918,
1445,
2033,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
12020,
8313,
29895,
17553,
29907,
2129,
2451,
7373,
703,
3782,
2066,
20373,
5783,
13,
4706,
1018,
29901,
13,
9651,
736,
5244,
2909,
7249,
6982,
29898,
8645,
29895,
29918,
1445,
29897,
13,
4706,
5174,
21403,
2283,
2451,
29901,
13,
9651,
1018,
29901,
13,
18884,
11799,
29889,
21533,
6982,
29898,
601,
29889,
1231,
5971,
29898,
8645,
29895,
29918,
1445,
29889,
949,
2141,
13808,
877,
294,
18869,
5477,
13,
462,
462,
965,
25899,
29922,
8516,
876,
13,
18884,
12020,
8313,
29895,
17553,
29907,
2129,
2451,
7373,
703,
5261,
29907,
598,
379,
29984,
694,
5520,
11286,
16874,
6441,
29889,
376,
13,
462,
462,
462,
376,
12148,
3588,
304,
11388,
29871,
29906,
29900,
29900,
29955,
470,
6133,
14544,
20267,
29916,
29897,
376,
13,
462,
462,
462,
376,
392,
1018,
1449,
1213,
876,
13,
9651,
5174,
23862,
2772,
401,
2392,
29901,
13,
18884,
12020,
8313,
29895,
17553,
29907,
2129,
2451,
7373,
703,
2525,
29423,
1891,
3402,
5783,
13,
4706,
5174,
4663,
6982,
2392,
408,
321,
29901,
13,
9651,
12020,
8313,
29895,
17553,
29907,
2129,
2451,
7373,
877,
10858,
6441,
471,
443,
8698,
1319,
29889,
1273,
29879,
1495,
1273,
321,
29889,
4906,
29897,
13,
13,
1678,
822,
903,
657,
29918,
667,
29918,
1272,
29898,
1311,
29892,
1206,
1125,
13,
4706,
736,
426,
13,
9651,
525,
333,
2396,
1206,
3032,
333,
29892,
13,
9651,
525,
14144,
5983,
2396,
11837,
877,
4878,
29918,
14144,
742,
6389,
11759,
1311,
29889,
7247,
29892,
1206,
3032,
333,
11724,
13,
9651,
525,
978,
2396,
1206,
29889,
978,
29892,
13,
9651,
525,
23176,
1204,
2396,
1206,
29889,
23176,
29918,
333,
565,
1206,
29889,
23176,
29918,
333,
1683,
525,
489,
742,
13,
9651,
525,
6710,
4557,
2396,
679,
5552,
29898,
4878,
29892,
525,
12346,
29918,
6710,
29918,
4537,
742,
525,
489,
5477,
13,
4706,
500,
13,
13,
1678,
822,
679,
29918,
3258,
29918,
689,
29898,
1311,
29892,
338,
29918,
19465,
29922,
8824,
1125,
13,
4706,
565,
1583,
29889,
3827,
29889,
5696,
1275,
525,
5438,
29915,
322,
451,
338,
29918,
19465,
29901,
13,
9651,
736,
3462,
8259,
1762,
4782,
2500,
29898,
1311,
29889,
3827,
29889,
5438,
29897,
13,
4706,
736,
3462,
8259,
1762,
4782,
2500,
580,
13,
13,
1678,
822,
679,
29918,
3258,
29918,
667,
29918,
1272,
29898,
1311,
29892,
1653,
29918,
689,
1125,
13,
4706,
1206,
29918,
25378,
353,
1653,
29918,
689,
29889,
14941,
287,
29918,
1272,
1839,
4878,
29918,
25378,
2033,
13,
4706,
1206,
353,
679,
29918,
4878,
29918,
1609,
29918,
25378,
29898,
1311,
29889,
7247,
29892,
1206,
29918,
25378,
29897,
13,
4706,
565,
1206,
338,
6213,
29901,
13,
9651,
736,
426,
13,
18884,
525,
667,
1469,
2396,
426,
13,
462,
1678,
525,
333,
2396,
1206,
29918,
25378,
29889,
6506,
877,
13420,
22868,
5477,
13,
462,
1678,
525,
25378,
2396,
1206,
29918,
25378,
29892,
13,
462,
1678,
525,
4906,
2396,
903,
877,
29903,
3818,
29892,
591,
1033,
451,
263,
1284,
263,
1206,
393,
525,
13,
462,
462,
525,
4352,
287,
278,
15882,
366,
4944,
29889,
5477,
13,
18884,
2981,
13,
18884,
525,
798,
2385,
2396,
525,
27392,
742,
13,
18884,
525,
6886,
2396,
525,
4878,
29899,
4906,
29899,
6886,
742,
13,
9651,
500,
13,
4706,
2944,
29918,
1272,
353,
1583,
3032,
657,
29918,
667,
29918,
1272,
29898,
4878,
29897,
13,
4706,
565,
1206,
3032,
333,
297,
1583,
29889,
4878,
29918,
2972,
29889,
11436,
29901,
13,
9651,
2643,
353,
12801,
9653,
770,
543,
1643,
3858,
29899,
17001,
1013,
29995,
29879,
829,
9653,
16299,
1273,
903,
703,
8259,
2307,
297,
2318,
1159,
13,
4706,
25342,
1206,
29889,
1514,
29918,
1853,
2804,
525,
5261,
29907,
598,
8259,
2396,
13,
9651,
2643,
353,
12801,
9653,
770,
543,
1643,
3858,
29899,
17001,
1013,
29995,
29879,
829,
9653,
16299,
1273,
903,
703,
3112,
3430,
763,
445,
1206,
471,
11132,
23157,
13,
4706,
1683,
29901,
13,
9651,
2643,
353,
12801,
9653,
770,
543,
1643,
3858,
29899,
8698,
1013,
29995,
29879,
829,
9653,
16299,
1273,
903,
703,
8259,
2715,
1159,
13,
9651,
1583,
29889,
4878,
29918,
2972,
29889,
11436,
29889,
4397,
29898,
4878,
3032,
333,
29897,
13,
9651,
1583,
29889,
4878,
29918,
2972,
29889,
7620,
580,
13,
4706,
2944,
29918,
1272,
1839,
4906,
2033,
353,
2643,
13,
4706,
736,
426,
13,
9651,
525,
667,
1469,
2396,
2944,
29918,
1272,
29892,
13,
9651,
525,
6886,
2396,
525,
1482,
29899,
4878,
29899,
6886,
742,
13,
4706,
500,
13,
13,
1678,
822,
679,
29918,
311,
22742,
29918,
667,
29918,
1272,
29898,
1311,
29892,
2944,
29918,
333,
1125,
13,
4706,
565,
451,
2944,
29918,
333,
29901,
13,
9651,
12020,
349,
26584,
630,
2001,
2451,
703,
1576,
1206,
29915,
29879,
3553,
471,
9654,
23157,
13,
4706,
1857,
29918,
11436,
353,
731,
29898,
1311,
29889,
4878,
29918,
2972,
29889,
11436,
29897,
13,
4706,
1583,
29889,
4878,
29918,
2972,
29889,
11436,
353,
1051,
29898,
3784,
29918,
11436,
29889,
29881,
17678,
4197,
667,
29918,
333,
12622,
13,
4706,
1583,
29889,
4878,
29918,
2972,
29889,
7620,
580,
13,
4706,
736,
426,
13,
9651,
525,
6886,
2396,
525,
1745,
8238,
29899,
4878,
29899,
6886,
742,
13,
4706,
500,
13,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
275,
29918,
8645,
29895,
29918,
9009,
470,
1583,
29889,
275,
29918,
4878,
29918,
2972,
29918,
5504,
29901,
13,
9651,
565,
1583,
29889,
275,
29918,
4878,
29918,
2972,
29918,
5504,
322,
1583,
29889,
5504,
29918,
4878,
29918,
2972,
29918,
689,
29889,
275,
29918,
3084,
7295,
13,
18884,
1583,
29889,
5504,
29918,
4878,
29918,
2972,
29918,
689,
29889,
5504,
29918,
2972,
580,
13,
18884,
736,
9056,
5103,
24735,
29898,
1311,
29889,
3488,
29918,
2271,
29897,
13,
9651,
736,
1583,
29889,
657,
29898,
3827,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
4706,
736,
1583,
29889,
13573,
16976,
29918,
7283,
566,
29918,
5327,
13,
13,
13,
1990,
1060,
2500,
27107,
1043,
29898,
1469,
10448,
13438,
1125,
13,
1678,
3142,
978,
353,
525,
29916,
689,
29918,
21895,
29915,
13,
1678,
1813,
29918,
3257,
353,
318,
657,
726,
29918,
1217,
459,
877,
2500,
15057,
1495,
13,
13,
1678,
822,
679,
29918,
689,
29918,
4841,
29918,
272,
29918,
1972,
29918,
1807,
29898,
1311,
29892,
2009,
1125,
13,
4706,
565,
525,
2622,
29918,
497,
29915,
297,
1583,
29889,
3827,
29889,
5438,
29901,
13,
9651,
396,
10790,
820,
6161,
1218,
883,
29918,
4841,
322,
9348,
304,
3414,
723,
367,
27372,
29892,
13,
9651,
396,
14200,
631,
5717,
881,
367,
297,
297,
385,
7465,
3414,
2012,
13,
9651,
1053,
3142,
1982,
13,
9651,
883,
29918,
1972,
29918,
1807,
353,
3142,
1982,
29889,
348,
1396,
29898,
1311,
29889,
3827,
29889,
5438,
29889,
657,
877,
2622,
29918,
497,
8785,
13,
9651,
736,
883,
29918,
1972,
29918,
1807,
13,
4706,
1683,
29901,
13,
9651,
736,
1583,
29889,
3827,
29889,
5438,
29889,
657,
1761,
877,
29916,
689,
29918,
4841,
1495,
13,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
883,
29918,
4841,
29918,
272,
29918,
1972,
29918,
1807,
353,
1583,
29889,
657,
29918,
689,
29918,
4841,
29918,
272,
29918,
1972,
29918,
1807,
29898,
3827,
29897,
13,
4706,
4464,
353,
1583,
29889,
3827,
29889,
5438,
29889,
657,
877,
8513,
1495,
13,
4706,
3414,
29918,
999,
353,
24396,
29918,
29883,
3791,
29918,
10382,
29898,
23813,
29922,
8516,
29892,
1518,
16129,
29922,
29896,
29930,
29953,
29900,
29930,
29953,
29900,
29892,
934,
29918,
17588,
29922,
8516,
29897,
13,
4706,
3414,
353,
21610,
29918,
689,
29918,
21895,
29918,
12674,
29889,
18829,
29898,
13,
9651,
4464,
29892,
13,
9651,
1583,
29889,
7247,
29892,
13,
9651,
1583,
29889,
3827,
29889,
29883,
3222,
29918,
1792,
29892,
13,
9651,
883,
29918,
4841,
29918,
272,
29918,
1972,
29918,
1807,
13,
4706,
1723,
13,
4706,
3414,
29918,
999,
29889,
842,
29918,
7662,
29898,
7662,
29897,
13,
13,
4706,
736,
9056,
5103,
24735,
29898,
13,
9651,
11837,
29898,
13,
18884,
1060,
2500,
27107,
5709,
1043,
29889,
2271,
978,
29892,
13,
18884,
6389,
11759,
1311,
29889,
7247,
29892,
4464,
29892,
3414,
29918,
999,
29889,
10382,
29918,
333,
29962,
13,
9651,
1723,
13,
4706,
1723,
13,
13,
1678,
732,
5696,
29918,
19557,
1061,
29898,
12277,
29918,
689,
29918,
21895,
29918,
22534,
488,
479,
29897,
13,
1678,
822,
13916,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
2428,
29898,
29990,
2500,
27107,
1043,
29892,
1583,
467,
13369,
29898,
3827,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
13,
1990,
1060,
2500,
27107,
5709,
1043,
29898,
1469,
10448,
13438,
1125,
13,
13,
1678,
3142,
978,
353,
525,
29916,
689,
29918,
21895,
29918,
4882,
29915,
13,
1678,
1813,
29918,
3257,
353,
318,
657,
726,
29918,
1217,
459,
877,
2500,
16034,
1495,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
3030,
353,
2428,
29898,
29990,
2500,
27107,
5709,
1043,
29892,
1583,
467,
3396,
29918,
4703,
13,
4706,
4464,
353,
3812,
27107,
6818,
29898,
19290,
1839,
8513,
11287,
13,
13,
4706,
3030,
29889,
5504,
3319,
13,
9651,
525,
7247,
2396,
1583,
29889,
7247,
29892,
13,
9651,
525,
10382,
29918,
333,
2396,
9049,
5085,
1839,
10382,
29918,
333,
7464,
13,
9651,
525,
29886,
3028,
29918,
2271,
2396,
29850,
2271,
29913,
29973,
8513,
3790,
8513,
29913,
1642,
4830,
29898,
13,
18884,
3142,
29922,
24244,
877,
29916,
689,
29918,
21895,
29918,
9057,
29918,
29886,
3028,
742,
6389,
11759,
1311,
29889,
7247,
29892,
9049,
5085,
1839,
10382,
29918,
333,
2033,
11724,
13,
18884,
4464,
29922,
8513,
29889,
8513,
29918,
978,
511,
13,
9651,
525,
3257,
2396,
4464,
29889,
4882,
29918,
3488,
29918,
3257,
29892,
13,
9651,
525,
2704,
29918,
726,
2396,
4464,
29889,
2704,
29918,
726,
29892,
13,
4706,
5615,
13,
4706,
736,
4050,
29898,
3827,
29892,
525,
3293,
29914,
8704,
29906,
29914,
578,
309,
29918,
4882,
29918,
8159,
29889,
1420,
742,
3030,
29897,
13,
13,
1678,
822,
1813,
29918,
2271,
29898,
1311,
1125,
13,
4706,
736,
11837,
29898,
1311,
29889,
2271,
978,
29892,
6389,
29922,
1311,
29889,
5085,
29892,
9049,
5085,
29922,
1311,
29889,
19290,
29897,
13,
13,
13,
29992,
12277,
29918,
3068,
29918,
5628,
29918,
1272,
13,
29992,
12277,
29918,
689,
29918,
21895,
29918,
22534,
488,
479,
13,
1753,
921,
689,
29918,
21895,
29918,
9057,
29918,
29886,
3028,
29898,
3827,
29892,
5354,
29892,
5142,
29918,
333,
29892,
13,
462,
795,
4472,
543,
1272,
29918,
1639,
8726,
29914,
3846,
29879,
29914,
29916,
689,
29918,
21895,
29918,
4882,
29889,
1420,
29908,
1125,
13,
1678,
4464,
353,
3812,
27107,
6818,
29898,
3827,
29889,
7194,
29889,
657,
877,
8513,
5477,
12725,
29922,
5574,
29897,
13,
1678,
1018,
29901,
13,
4706,
3030,
353,
679,
29918,
10382,
29918,
4703,
29898,
10382,
29918,
333,
29892,
1423,
29918,
3859,
29922,
5574,
29897,
13,
1678,
5174,
9330,
17776,
2392,
29901,
13,
4706,
736,
9056,
5103,
6004,
2392,
580,
13,
13,
1678,
3030,
29889,
5504,
3319,
13,
4706,
525,
265,
29918,
8835,
29918,
12759,
2396,
4464,
29889,
8835,
29918,
12759,
29892,
13,
4706,
525,
8513,
2396,
4464,
29892,
13,
4706,
525,
689,
29918,
21895,
29918,
2271,
2396,
11837,
29898,
6103,
1469,
10448,
23669,
29889,
978,
3285,
13,
462,
462,
539,
6389,
11759,
7247,
29892,
8313,
29895,
2500,
27107,
10448,
29889,
29517,
2314,
13,
1678,
5615,
13,
1678,
736,
4050,
29898,
3827,
29892,
4472,
29892,
3030,
29897,
13,
2
] |
test/toolkit/test_config.py | babatana/stograde | 0 | 65425 | import datetime
import os
import textwrap
from unittest import mock
import pytest
from stograde.common import chdir
from stograde.toolkit.config import Config
_dir = os.path.dirname(os.path.realpath(__file__))
def test_setup(tmpdir):
with tmpdir.as_cwd():
assert not os.path.exists('stograde.ini')
with mock.patch('stograde.toolkit.config.Config._filename', 'stograde.ini'):
Config()
assert os.path.exists('stograde.ini')
@pytest.mark.datafiles(os.path.join(_dir, 'fixtures', 'config'))
def test_get_last_update_check(datafiles):
with chdir(str(datafiles)):
with mock.patch('stograde.toolkit.config.Config._filename', 'stograde.ini'):
c = Config()
assert c.get_last_update_check() == datetime.datetime(2020, 8, 30, 11, 59, 39, 378987)
@pytest.mark.datafiles(os.path.join(_dir, 'fixtures', 'config'))
def test_set_last_update_check(datafiles):
with chdir(str(datafiles)):
with open('stograde.ini') as file:
old_contents = file.read()
file.close()
with mock.patch('stograde.toolkit.config.Config._filename', 'stograde.ini'):
Config().set_last_update_check()
with open('stograde.ini') as file:
new_contents = file.read()
file.close()
assert old_contents != new_contents
@pytest.mark.datafiles(os.path.join(_dir, 'fixtures', 'config'))
def test_needs_update_check(datafiles):
with chdir(str(datafiles)):
with mock.patch('stograde.toolkit.config.Config._filename', 'stograde.ini'):
c = Config()
assert c.needs_update_check()
c.set_last_update_check()
assert not c.needs_update_check()
| [
1,
1053,
12865,
13,
5215,
2897,
13,
5215,
1426,
6312,
13,
3166,
443,
27958,
1053,
11187,
13,
13,
5215,
11451,
1688,
13,
13,
3166,
380,
468,
15464,
29889,
9435,
1053,
521,
3972,
13,
3166,
380,
468,
15464,
29889,
10154,
7354,
29889,
2917,
1053,
12782,
13,
13,
29918,
3972,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
6370,
2084,
22168,
1445,
1649,
876,
13,
13,
13,
1753,
1243,
29918,
14669,
29898,
7050,
3972,
1125,
13,
1678,
411,
13128,
3972,
29889,
294,
29918,
29883,
9970,
7295,
13,
4706,
4974,
451,
2897,
29889,
2084,
29889,
9933,
877,
303,
468,
15464,
29889,
2172,
1495,
13,
4706,
411,
11187,
29889,
5041,
877,
303,
468,
15464,
29889,
10154,
7354,
29889,
2917,
29889,
3991,
3032,
9507,
742,
525,
303,
468,
15464,
29889,
2172,
29374,
13,
9651,
12782,
580,
13,
4706,
4974,
2897,
29889,
2084,
29889,
9933,
877,
303,
468,
15464,
29889,
2172,
1495,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
1272,
5325,
29898,
359,
29889,
2084,
29889,
7122,
7373,
3972,
29892,
525,
7241,
486,
1973,
742,
525,
2917,
8785,
13,
1753,
1243,
29918,
657,
29918,
4230,
29918,
5504,
29918,
3198,
29898,
1272,
5325,
1125,
13,
1678,
411,
521,
3972,
29898,
710,
29898,
1272,
5325,
22164,
13,
4706,
411,
11187,
29889,
5041,
877,
303,
468,
15464,
29889,
10154,
7354,
29889,
2917,
29889,
3991,
3032,
9507,
742,
525,
303,
468,
15464,
29889,
2172,
29374,
13,
9651,
274,
353,
12782,
580,
13,
9651,
4974,
274,
29889,
657,
29918,
4230,
29918,
5504,
29918,
3198,
580,
1275,
12865,
29889,
12673,
29898,
29906,
29900,
29906,
29900,
29892,
29871,
29947,
29892,
29871,
29941,
29900,
29892,
29871,
29896,
29896,
29892,
29871,
29945,
29929,
29892,
29871,
29941,
29929,
29892,
29871,
29941,
29955,
29947,
29929,
29947,
29955,
29897,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
1272,
5325,
29898,
359,
29889,
2084,
29889,
7122,
7373,
3972,
29892,
525,
7241,
486,
1973,
742,
525,
2917,
8785,
13,
1753,
1243,
29918,
842,
29918,
4230,
29918,
5504,
29918,
3198,
29898,
1272,
5325,
1125,
13,
1678,
411,
521,
3972,
29898,
710,
29898,
1272,
5325,
22164,
13,
4706,
411,
1722,
877,
303,
468,
15464,
29889,
2172,
1495,
408,
934,
29901,
13,
9651,
2030,
29918,
10853,
353,
934,
29889,
949,
580,
13,
9651,
934,
29889,
5358,
580,
13,
4706,
411,
11187,
29889,
5041,
877,
303,
468,
15464,
29889,
10154,
7354,
29889,
2917,
29889,
3991,
3032,
9507,
742,
525,
303,
468,
15464,
29889,
2172,
29374,
13,
9651,
12782,
2141,
842,
29918,
4230,
29918,
5504,
29918,
3198,
580,
13,
4706,
411,
1722,
877,
303,
468,
15464,
29889,
2172,
1495,
408,
934,
29901,
13,
9651,
716,
29918,
10853,
353,
934,
29889,
949,
580,
13,
9651,
934,
29889,
5358,
580,
13,
13,
4706,
4974,
2030,
29918,
10853,
2804,
716,
29918,
10853,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
1272,
5325,
29898,
359,
29889,
2084,
29889,
7122,
7373,
3972,
29892,
525,
7241,
486,
1973,
742,
525,
2917,
8785,
13,
1753,
1243,
29918,
484,
5779,
29918,
5504,
29918,
3198,
29898,
1272,
5325,
1125,
13,
1678,
411,
521,
3972,
29898,
710,
29898,
1272,
5325,
22164,
13,
4706,
411,
11187,
29889,
5041,
877,
303,
468,
15464,
29889,
10154,
7354,
29889,
2917,
29889,
3991,
3032,
9507,
742,
525,
303,
468,
15464,
29889,
2172,
29374,
13,
9651,
274,
353,
12782,
580,
13,
9651,
4974,
274,
29889,
484,
5779,
29918,
5504,
29918,
3198,
580,
13,
9651,
274,
29889,
842,
29918,
4230,
29918,
5504,
29918,
3198,
580,
13,
9651,
4974,
451,
274,
29889,
484,
5779,
29918,
5504,
29918,
3198,
580,
13,
2
] |
producemeta.py | aireveries/pix-plot | 1 | 104397 | import csv
import sys
import glob
import xml.etree.ElementTree as ET
path = sys.argv[1]
with open('test.csv', 'w', newline='') as csvfile:
writer = csv.writer(csvfile, delimiter=",",
quotechar="|", quoting=csv.QUOTE_MINIMAL)
# write the header
writer.writerow(['filename', 'tags', 'description', 'permalink'])
for filename in glob.glob(path):
if filename[-8:] != "mask.png":
dataFile = filename[:-4] + ".xml"
tree = ET.parse(dataFile)
root = tree.getroot()
| [
1,
1053,
11799,
13,
5215,
10876,
13,
5215,
13149,
13,
5215,
4903,
29889,
300,
929,
29889,
2642,
9643,
408,
382,
29911,
13,
13,
2084,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
2541,
1722,
877,
1688,
29889,
7638,
742,
525,
29893,
742,
25899,
2433,
1495,
408,
11799,
1445,
29901,
13,
1678,
9227,
353,
11799,
29889,
13236,
29898,
7638,
1445,
29892,
28552,
543,
29892,
613,
13,
462,
4706,
14978,
3090,
543,
29989,
613,
439,
11427,
29922,
7638,
29889,
13356,
2891,
29923,
29918,
16173,
2260,
29931,
29897,
13,
1678,
396,
2436,
278,
4839,
13,
1678,
9227,
29889,
13236,
340,
18959,
9507,
742,
525,
11338,
742,
525,
8216,
742,
525,
546,
5156,
682,
11287,
13,
1678,
363,
10422,
297,
13149,
29889,
23705,
29898,
2084,
1125,
13,
4706,
565,
10422,
14352,
29947,
17531,
2804,
376,
13168,
29889,
2732,
1115,
13,
9651,
848,
2283,
353,
10422,
7503,
29899,
29946,
29962,
718,
11393,
3134,
29908,
13,
9651,
5447,
353,
382,
29911,
29889,
5510,
29898,
1272,
2283,
29897,
13,
9651,
3876,
353,
5447,
29889,
657,
4632,
580,
13,
2
] |
leetcode/smallest_string_with_a_given_numeric_value/smallest_string_with_a_given_numeric_value.py | sagasu/python-algorithms | 0 | 119577 | class Solution:
def getSmallestString(self, n: int, k: int) -> str:
result = ""
for index in range(n):
digitsLeft = n - index - 1
for c in range(1, 27):
if k - c <= digitsLeft * 26:
k -= c
result += chr(ord('a') + c -1)
break
return result | [
1,
770,
24380,
29901,
13,
1678,
822,
679,
12636,
497,
342,
1231,
29898,
1311,
29892,
302,
29901,
938,
29892,
413,
29901,
938,
29897,
1599,
851,
29901,
13,
4706,
1121,
353,
5124,
13,
13,
4706,
363,
2380,
297,
3464,
29898,
29876,
1125,
13,
9651,
13340,
8091,
353,
302,
448,
2380,
448,
29871,
29896,
13,
13,
9651,
363,
274,
297,
3464,
29898,
29896,
29892,
29871,
29906,
29955,
1125,
13,
18884,
565,
413,
448,
274,
5277,
13340,
8091,
334,
29871,
29906,
29953,
29901,
13,
462,
1678,
413,
22361,
274,
13,
462,
1678,
1121,
4619,
18460,
29898,
536,
877,
29874,
1495,
718,
274,
448,
29896,
29897,
13,
462,
1678,
2867,
13,
4706,
736,
1121,
2
] |
rapidflask/app/main/views.py | TM-KUNGFOOO/rapidflask-orchestra | 0 | 145786 | <reponame>TM-KUNGFOOO/rapidflask-orchestra
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
from datetime import datetime
from flask import render_template, redirect, url_for, abort, flash, make_response, jsonify, session, g
from . import main
from app import db
from .forms import *
from app.decorators import *
@main.route('/', methods=["GET", "POST"])
def index():
return render_template('main_index.html', current_time=datetime.utcnow())
| [
1,
529,
276,
1112,
420,
29958,
23081,
29899,
29968,
3904,
29954,
5800,
29949,
29949,
29914,
2390,
333,
1579,
1278,
29899,
272,
15554,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
1649,
8921,
1649,
353,
12801,
5813,
16299,
13,
13,
3166,
12865,
1053,
12865,
13,
13,
3166,
29784,
1053,
4050,
29918,
6886,
29892,
6684,
29892,
3142,
29918,
1454,
29892,
27450,
29892,
11013,
29892,
1207,
29918,
5327,
29892,
4390,
1598,
29892,
4867,
29892,
330,
13,
13,
3166,
869,
1053,
1667,
13,
3166,
623,
1053,
4833,
13,
3166,
869,
9514,
1053,
334,
13,
3166,
623,
29889,
19557,
4097,
1053,
334,
13,
13,
13,
29992,
3396,
29889,
13134,
11219,
742,
3519,
29922,
3366,
7194,
613,
376,
5438,
20068,
13,
1753,
2380,
7295,
13,
1678,
736,
4050,
29918,
6886,
877,
3396,
29918,
2248,
29889,
1420,
742,
1857,
29918,
2230,
29922,
12673,
29889,
329,
29883,
3707,
3101,
13,
2
] |
python/aad/plot_anomalies_rectangle.py | rislam/ad_examples | 1 | 42074 | import os
import numpy as np
import numpy.random as rnd
import matplotlib.pyplot as plt
import logging
from pandas import DataFrame
from common.gen_samples import *
from common.data_plotter import *
from aad.aad_globals import *
from aad.aad_support import *
from aad.forest_description import *
from aad.anomaly_dataset_support import *
# from percept.percept import *
"""
pythonw -m aad.plot_anomalies_rectangle
"""
def get_x_tau(x, w, tau):
v = x.dot(w)
ranked = np.argsort(-v)
tau_id = ranked[int(tau * len(v))]
return tau_id, x[tau_id]
def plot_anomalies_ifor(outdir, plot=False, plot_legends=False):
u_theta = np.pi * 4. / 4 + np.pi * 5 / 180
x, y = get_sphere_samples([(50, 0, np.pi * 4. / 4, np.pi * 4. / 4 + np.pi * 2 / 4),
(15, 1, u_theta - np.pi * 5 / 180, u_theta + np.pi * 5 / 180),
(15, 1, np.pi * 6. / 4 - np.pi * 1.5 / 180, np.pi * 6. / 4)])
n, d = x.shape
id_nomls = np.where(y == 0)[0]
id_anoms = np.where(y == 1)[0]
n_anoms = len(id_anoms)
x_nomls, y_nomls = x[id_nomls, :], y[id_nomls]
x_anoms, y_anoms = x[id_anoms, :], y[id_anoms]
if plot:
axis_fontsize = 16
line_colors = ["blue", "red", "red"]
line_types = ["--", "--", "-"]
line_widths = [2, 2, 2]
lines = list()
line_labels = list()
tau = n_anoms * 1. / n # multiplying by a factor to move the plane lower
w = normalize(np.ones(2))
r = np.array([np.min(x[:, 0]), np.max(x[:, 0])])
tau_id, x_tau = get_x_tau(x, w, tau)
q_tau = w.dot(x_tau)
# plot the true weight vector
u = interpolate_2D_line_by_point_and_vec(np.array([-1., 1.]), [0., 0.],
[np.cos(u_theta + np.pi * 1 / 4), np.sin(u_theta + np.pi * 1 / 4)])
lines.append(u)
line_labels.append(r"True weights ${\bf u}$")
zd = interpolate_2D_line_by_point_and_vec(np.array([-1., 1.0]), [0., 0.], w)
lines.append(zd)
line_labels.append(r"Uniform weights ${\bf w}_{unif}$")
zw = interpolate_2D_line_by_slope_and_intercept(np.array([-1., 1.]), -w[0] / w[1], q_tau / w[1])
lines.append(zw)
line_labels.append(r"hyperplane $\perp$ ${\bf w}_{unif}$")
pdffile = os.path.join(outdir, "anomalies_in_ifor.pdf")
dp = DataPlotter(pdfpath=pdffile, rows=1, cols=1)
pl = dp.get_next_plot()
pl.set_aspect('equal')
# plt.xlabel('x', fontsize=axis_fontsize)
# plt.ylabel('y', fontsize=axis_fontsize)
plt.xticks([])
plt.yticks([])
plt.xlim([-1.05, 1.05])
plt.ylim([-1.05, 1.05])
pl.scatter(x_nomls[:, 0], x_nomls[:, 1], s=45, c="blue", marker="+", label="Nominal")
pl.scatter(x_anoms[:, 0], x_anoms[:, 1], s=45, c="red", marker="+", label="Anomaly")
for i, line in enumerate(lines):
color = "blue" if line_colors is None else line_colors[i]
pl.plot(line[:, 0], line[:, 1], line_types[i], color=color, linewidth=line_widths[i],
label=line_labels[i] if plot_legends else None)
plt.axhline(0, linestyle="--", color="lightgrey")
plt.axvline(0, linestyle="--", color="lightgrey")
if plot_legends:
pl.legend(loc='lower right', prop={'size': 12})
dp.close()
return x, y
def plot_anomalies_rect(outdir, plot=False, plot_legends=False):
x_nomls = rnd.uniform(0., 1., 500)
x_nomls = np.reshape(x_nomls, newshape=(250, -1))
anom_mu = (0.83, 0.95)
u_theta = np.arctan(0.9 / 0.8)
anom_score_dist = MVNParams(
mu=np.array([anom_mu[0], anom_mu[1]]),
mcorr=np.array([
[1, -0.5],
[0, 1.0]]),
dvar=np.array([0.002, 0.0005])
)
n_anoms = 30
x_anoms = generate_dependent_normal_samples(n_anoms,
anom_score_dist.mu,
anom_score_dist.mcorr,
anom_score_dist.dvar)
x = np.vstack([x_nomls, x_anoms])
y = np.array(np.zeros(x_nomls.shape[0], dtype=int))
y = np.append(y, np.ones(x_anoms.shape[0], dtype=int))
if plot:
n, d = x.shape
# tau is computed assuming that the anomalies occupy tau-proportion
# of the circumference
tau = n_anoms * 1.3 / n # multiplying by a factor to move the plane lower
w = normalize(np.ones(2))
r = np.array([np.min(x[:, 0]), np.max(x[:, 0])])
line_colors = ["blue", "red", "red"]
line_types = ["--", "--", "-"]
line_widths = [2, 2, 2]
lines = list()
line_labels = list()
tau_id, x_tau = get_x_tau(x, w, tau)
q_tau = w.dot(x_tau)
# plot the true weight vector
u = interpolate_2D_line_by_point_and_vec(np.array([0., 1.]), [0., 0.],
[np.cos(u_theta), np.sin(u_theta)])
lines.append(u)
line_labels.append(r"True weights ${\bf u}$")
zd = interpolate_2D_line_by_point_and_vec(np.array([0., 1.0]), [0., 0.], w)
lines.append(zd)
line_labels.append(r"Uniform weights ${\bf w}_{unif}$")
zw = interpolate_2D_line_by_slope_and_intercept(np.array([0., 1.05]), -w[0] / w[1], q_tau / w[1])
lines.append(zw)
line_labels.append(r"hyperplane $\perp$ ${\bf w}_{unif}$")
axis_fontsize = 16
pdffile = os.path.join(outdir, "anomalies_in_rect.pdf")
dp = DataPlotter(pdfpath=pdffile, rows=1, cols=1)
pl = dp.get_next_plot()
pl.set_aspect('equal')
# plt.xlabel('x', fontsize=axis_fontsize)
# plt.ylabel('y', fontsize=axis_fontsize)
plt.xticks([])
plt.yticks([])
plt.xlim([-0.05, 1.05])
plt.ylim([-0.05, 1.05])
pl.scatter(x_nomls[:, 0], x_nomls[:, 1], s=45, c="blue", marker="+", label="Nominal")
pl.scatter(x_anoms[:, 0], x_anoms[:, 1], s=45, c="red", marker="+", label="Anomaly")
for i, line in enumerate(lines):
color = "blue" if line_colors is None else line_colors[i]
pl.plot(line[:, 0], line[:, 1], line_types[i], color=color, linewidth=line_widths[i],
label=line_labels[i] if plot_legends else None)
if plot_legends:
pl.legend(loc='lower right', prop={'size': 12})
dp.close()
return x, y
if __name__ == "__main__":
logger = logging.getLogger(__name__)
args = get_command_args(debug=True, debug_args=["--debug",
"--plot",
"--log_file=temp/plot_anomalies_rectangle.log"])
# print "log file: %s" % args.log_file
configure_logger(args)
rnd.seed(42)
outdir = "./temp/illustration"
dir_create(outdir)
# plot isolation forest score distribution illustration
# plot_anomalies_ifor(outdir, plot=True, plot_legends=False)
plot_anomalies_rect(outdir, plot=True, plot_legends=False) | [
1,
1053,
2897,
13,
5215,
12655,
408,
7442,
13,
5215,
12655,
29889,
8172,
408,
364,
299,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
13,
5215,
12183,
13,
3166,
11701,
1053,
3630,
4308,
13,
13,
3166,
3619,
29889,
1885,
29918,
27736,
1053,
334,
13,
3166,
3619,
29889,
1272,
29918,
5317,
357,
1053,
334,
13,
13,
3166,
263,
328,
29889,
29874,
328,
29918,
23705,
1338,
1053,
334,
13,
3166,
263,
328,
29889,
29874,
328,
29918,
5924,
1053,
334,
13,
3166,
263,
328,
29889,
1454,
342,
29918,
8216,
1053,
334,
13,
3166,
263,
328,
29889,
273,
290,
14997,
29918,
24713,
29918,
5924,
1053,
334,
13,
29937,
515,
639,
1547,
29889,
546,
1547,
1053,
334,
13,
13,
13,
15945,
29908,
13,
4691,
29893,
448,
29885,
263,
328,
29889,
5317,
29918,
273,
290,
284,
583,
29918,
1621,
2521,
13,
15945,
29908,
13,
13,
13,
1753,
679,
29918,
29916,
29918,
4722,
29898,
29916,
29892,
281,
29892,
260,
585,
1125,
13,
1678,
325,
353,
921,
29889,
6333,
29898,
29893,
29897,
13,
1678,
26642,
353,
7442,
29889,
5085,
441,
6278,
29894,
29897,
13,
1678,
260,
585,
29918,
333,
353,
26642,
29961,
524,
29898,
4722,
334,
7431,
29898,
29894,
28166,
13,
1678,
736,
260,
585,
29918,
333,
29892,
921,
29961,
4722,
29918,
333,
29962,
13,
13,
13,
1753,
6492,
29918,
273,
290,
284,
583,
29918,
361,
272,
29898,
449,
3972,
29892,
6492,
29922,
8824,
29892,
6492,
29918,
1397,
1975,
29922,
8824,
1125,
13,
1678,
318,
29918,
3416,
353,
7442,
29889,
1631,
334,
29871,
29946,
29889,
847,
29871,
29946,
718,
7442,
29889,
1631,
334,
29871,
29945,
847,
29871,
29896,
29947,
29900,
13,
1678,
921,
29892,
343,
353,
679,
29918,
29879,
9085,
29918,
27736,
4197,
29898,
29945,
29900,
29892,
29871,
29900,
29892,
7442,
29889,
1631,
334,
29871,
29946,
29889,
847,
29871,
29946,
29892,
7442,
29889,
1631,
334,
29871,
29946,
29889,
847,
29871,
29946,
718,
7442,
29889,
1631,
334,
29871,
29906,
847,
29871,
29946,
511,
13,
462,
1669,
313,
29896,
29945,
29892,
29871,
29896,
29892,
318,
29918,
3416,
448,
7442,
29889,
1631,
334,
29871,
29945,
847,
29871,
29896,
29947,
29900,
29892,
318,
29918,
3416,
718,
7442,
29889,
1631,
334,
29871,
29945,
847,
29871,
29896,
29947,
29900,
511,
13,
462,
1669,
313,
29896,
29945,
29892,
29871,
29896,
29892,
7442,
29889,
1631,
334,
29871,
29953,
29889,
847,
29871,
29946,
448,
7442,
29889,
1631,
334,
29871,
29896,
29889,
29945,
847,
29871,
29896,
29947,
29900,
29892,
7442,
29889,
1631,
334,
29871,
29953,
29889,
847,
29871,
29946,
29897,
2314,
13,
1678,
302,
29892,
270,
353,
921,
29889,
12181,
13,
13,
1678,
1178,
29918,
11522,
3137,
353,
7442,
29889,
3062,
29898,
29891,
1275,
29871,
29900,
9601,
29900,
29962,
13,
1678,
1178,
29918,
273,
4835,
353,
7442,
29889,
3062,
29898,
29891,
1275,
29871,
29896,
9601,
29900,
29962,
13,
1678,
302,
29918,
273,
4835,
353,
7431,
29898,
333,
29918,
273,
4835,
29897,
13,
13,
1678,
921,
29918,
11522,
3137,
29892,
343,
29918,
11522,
3137,
353,
921,
29961,
333,
29918,
11522,
3137,
29892,
584,
1402,
343,
29961,
333,
29918,
11522,
3137,
29962,
13,
1678,
921,
29918,
273,
4835,
29892,
343,
29918,
273,
4835,
353,
921,
29961,
333,
29918,
273,
4835,
29892,
584,
1402,
343,
29961,
333,
29918,
273,
4835,
29962,
13,
13,
1678,
565,
6492,
29901,
13,
4706,
9685,
29918,
5657,
2311,
353,
29871,
29896,
29953,
13,
13,
4706,
1196,
29918,
27703,
353,
6796,
9539,
613,
376,
1127,
613,
376,
1127,
3108,
13,
4706,
1196,
29918,
8768,
353,
6796,
489,
613,
376,
489,
613,
11663,
3108,
13,
4706,
1196,
29918,
2103,
29879,
353,
518,
29906,
29892,
29871,
29906,
29892,
29871,
29906,
29962,
13,
4706,
3454,
353,
1051,
580,
13,
4706,
1196,
29918,
21134,
353,
1051,
580,
13,
13,
4706,
260,
585,
353,
302,
29918,
273,
4835,
334,
29871,
29896,
29889,
847,
302,
29871,
396,
6674,
5890,
491,
263,
7329,
304,
4337,
278,
10694,
5224,
13,
4706,
281,
353,
4226,
675,
29898,
9302,
29889,
2873,
29898,
29906,
876,
13,
4706,
364,
353,
7442,
29889,
2378,
4197,
9302,
29889,
1195,
29898,
29916,
7503,
29892,
29871,
29900,
11724,
7442,
29889,
3317,
29898,
29916,
7503,
29892,
29871,
29900,
2314,
2314,
13,
13,
4706,
260,
585,
29918,
333,
29892,
921,
29918,
4722,
353,
679,
29918,
29916,
29918,
4722,
29898,
29916,
29892,
281,
29892,
260,
585,
29897,
13,
4706,
3855,
29918,
4722,
353,
281,
29889,
6333,
29898,
29916,
29918,
4722,
29897,
13,
13,
4706,
396,
6492,
278,
1565,
7688,
4608,
13,
4706,
318,
353,
20064,
403,
29918,
29906,
29928,
29918,
1220,
29918,
1609,
29918,
3149,
29918,
392,
29918,
2003,
29898,
9302,
29889,
2378,
4197,
29899,
29896,
1696,
29871,
29896,
5586,
511,
518,
29900,
1696,
29871,
29900,
29889,
1402,
13,
462,
462,
462,
518,
9302,
29889,
3944,
29898,
29884,
29918,
3416,
718,
7442,
29889,
1631,
334,
29871,
29896,
847,
29871,
29946,
511,
7442,
29889,
5223,
29898,
29884,
29918,
3416,
718,
7442,
29889,
1631,
334,
29871,
29896,
847,
29871,
29946,
29897,
2314,
13,
4706,
3454,
29889,
4397,
29898,
29884,
29897,
13,
4706,
1196,
29918,
21134,
29889,
4397,
29898,
29878,
29908,
5574,
18177,
7555,
1635,
318,
1042,
1159,
13,
13,
4706,
18100,
353,
20064,
403,
29918,
29906,
29928,
29918,
1220,
29918,
1609,
29918,
3149,
29918,
392,
29918,
2003,
29898,
9302,
29889,
2378,
4197,
29899,
29896,
1696,
29871,
29896,
29889,
29900,
11724,
518,
29900,
1696,
29871,
29900,
29889,
1402,
281,
29897,
13,
4706,
3454,
29889,
4397,
29898,
8849,
29897,
13,
4706,
1196,
29918,
21134,
29889,
4397,
29898,
29878,
29908,
2525,
5560,
18177,
7555,
1635,
281,
3227,
348,
361,
1042,
1159,
13,
13,
4706,
5263,
353,
20064,
403,
29918,
29906,
29928,
29918,
1220,
29918,
1609,
29918,
29879,
417,
412,
29918,
392,
29918,
1639,
1547,
29898,
9302,
29889,
2378,
4197,
29899,
29896,
1696,
29871,
29896,
5586,
511,
448,
29893,
29961,
29900,
29962,
847,
281,
29961,
29896,
1402,
3855,
29918,
4722,
847,
281,
29961,
29896,
2314,
13,
4706,
3454,
29889,
4397,
29898,
7659,
29897,
13,
4706,
1196,
29918,
21134,
29889,
4397,
29898,
29878,
29908,
24947,
22116,
779,
24598,
29938,
7555,
1635,
281,
3227,
348,
361,
1042,
1159,
13,
13,
4706,
10518,
600,
488,
353,
2897,
29889,
2084,
29889,
7122,
29898,
449,
3972,
29892,
376,
273,
290,
284,
583,
29918,
262,
29918,
361,
272,
29889,
5140,
1159,
13,
4706,
270,
29886,
353,
3630,
20867,
357,
29898,
5140,
2084,
29922,
15926,
600,
488,
29892,
4206,
29922,
29896,
29892,
28730,
29922,
29896,
29897,
13,
4706,
715,
353,
270,
29886,
29889,
657,
29918,
4622,
29918,
5317,
580,
13,
4706,
715,
29889,
842,
29918,
294,
1103,
877,
11745,
1495,
13,
4706,
396,
14770,
29889,
29916,
1643,
877,
29916,
742,
4079,
2311,
29922,
8990,
29918,
5657,
2311,
29897,
13,
4706,
396,
14770,
29889,
29891,
1643,
877,
29891,
742,
4079,
2311,
29922,
8990,
29918,
5657,
2311,
29897,
13,
4706,
14770,
29889,
486,
7358,
4197,
2314,
13,
4706,
14770,
29889,
3637,
7358,
4197,
2314,
13,
4706,
14770,
29889,
29916,
2576,
4197,
29899,
29896,
29889,
29900,
29945,
29892,
29871,
29896,
29889,
29900,
29945,
2314,
13,
4706,
14770,
29889,
29891,
2576,
4197,
29899,
29896,
29889,
29900,
29945,
29892,
29871,
29896,
29889,
29900,
29945,
2314,
13,
4706,
715,
29889,
1557,
2620,
29898,
29916,
29918,
11522,
3137,
7503,
29892,
29871,
29900,
1402,
921,
29918,
11522,
3137,
7503,
29892,
29871,
29896,
1402,
269,
29922,
29946,
29945,
29892,
274,
543,
9539,
613,
17456,
543,
29974,
613,
3858,
543,
29940,
290,
979,
1159,
13,
4706,
715,
29889,
1557,
2620,
29898,
29916,
29918,
273,
4835,
7503,
29892,
29871,
29900,
1402,
921,
29918,
273,
4835,
7503,
29892,
29871,
29896,
1402,
269,
29922,
29946,
29945,
29892,
274,
543,
1127,
613,
17456,
543,
29974,
613,
3858,
543,
2744,
290,
14997,
1159,
13,
4706,
363,
474,
29892,
1196,
297,
26985,
29898,
9012,
1125,
13,
9651,
2927,
353,
376,
9539,
29908,
565,
1196,
29918,
27703,
338,
6213,
1683,
1196,
29918,
27703,
29961,
29875,
29962,
13,
9651,
715,
29889,
5317,
29898,
1220,
7503,
29892,
29871,
29900,
1402,
1196,
7503,
29892,
29871,
29896,
1402,
1196,
29918,
8768,
29961,
29875,
1402,
2927,
29922,
2780,
29892,
1196,
2103,
29922,
1220,
29918,
2103,
29879,
29961,
29875,
1402,
13,
462,
1678,
3858,
29922,
1220,
29918,
21134,
29961,
29875,
29962,
565,
6492,
29918,
1397,
1975,
1683,
6213,
29897,
13,
13,
4706,
14770,
29889,
1165,
7760,
29898,
29900,
29892,
6276,
342,
1508,
543,
489,
613,
2927,
543,
4366,
7979,
29891,
1159,
13,
4706,
14770,
29889,
1165,
29894,
1220,
29898,
29900,
29892,
6276,
342,
1508,
543,
489,
613,
2927,
543,
4366,
7979,
29891,
1159,
13,
13,
4706,
565,
6492,
29918,
1397,
1975,
29901,
13,
9651,
715,
29889,
26172,
29898,
2029,
2433,
13609,
1492,
742,
3107,
3790,
29915,
2311,
2396,
29871,
29896,
29906,
1800,
13,
4706,
270,
29886,
29889,
5358,
580,
13,
1678,
736,
921,
29892,
343,
13,
13,
13,
1753,
6492,
29918,
273,
290,
284,
583,
29918,
1621,
29898,
449,
3972,
29892,
6492,
29922,
8824,
29892,
6492,
29918,
1397,
1975,
29922,
8824,
1125,
13,
1678,
921,
29918,
11522,
3137,
353,
364,
299,
29889,
29590,
29898,
29900,
1696,
29871,
29896,
1696,
29871,
29945,
29900,
29900,
29897,
13,
1678,
921,
29918,
11522,
3137,
353,
7442,
29889,
690,
14443,
29898,
29916,
29918,
11522,
3137,
29892,
716,
12181,
7607,
29906,
29945,
29900,
29892,
448,
29896,
876,
13,
13,
1678,
29342,
29918,
2589,
353,
313,
29900,
29889,
29947,
29941,
29892,
29871,
29900,
29889,
29929,
29945,
29897,
13,
1678,
318,
29918,
3416,
353,
7442,
29889,
27014,
273,
29898,
29900,
29889,
29929,
847,
29871,
29900,
29889,
29947,
29897,
13,
13,
1678,
29342,
29918,
13628,
29918,
5721,
353,
341,
29963,
29940,
9629,
29898,
13,
4706,
3887,
29922,
9302,
29889,
2378,
4197,
273,
290,
29918,
2589,
29961,
29900,
1402,
29342,
29918,
2589,
29961,
29896,
5262,
511,
13,
4706,
286,
29725,
29922,
9302,
29889,
2378,
4197,
13,
9651,
518,
29896,
29892,
448,
29900,
29889,
29945,
1402,
13,
9651,
518,
29900,
29892,
29871,
29896,
29889,
29900,
5262,
511,
13,
4706,
270,
1707,
29922,
9302,
29889,
2378,
4197,
29900,
29889,
29900,
29900,
29906,
29892,
29871,
29900,
29889,
29900,
29900,
29900,
29945,
2314,
13,
1678,
1723,
13,
1678,
302,
29918,
273,
4835,
353,
29871,
29941,
29900,
13,
1678,
921,
29918,
273,
4835,
353,
5706,
29918,
18980,
29918,
8945,
29918,
27736,
29898,
29876,
29918,
273,
4835,
29892,
13,
462,
462,
18884,
29342,
29918,
13628,
29918,
5721,
29889,
2589,
29892,
13,
462,
462,
18884,
29342,
29918,
13628,
29918,
5721,
29889,
29885,
29725,
29892,
13,
462,
462,
18884,
29342,
29918,
13628,
29918,
5721,
29889,
29881,
1707,
29897,
13,
13,
1678,
921,
353,
7442,
29889,
29894,
1429,
4197,
29916,
29918,
11522,
3137,
29892,
921,
29918,
273,
4835,
2314,
13,
1678,
343,
353,
7442,
29889,
2378,
29898,
9302,
29889,
3298,
359,
29898,
29916,
29918,
11522,
3137,
29889,
12181,
29961,
29900,
1402,
26688,
29922,
524,
876,
13,
1678,
343,
353,
7442,
29889,
4397,
29898,
29891,
29892,
7442,
29889,
2873,
29898,
29916,
29918,
273,
4835,
29889,
12181,
29961,
29900,
1402,
26688,
29922,
524,
876,
13,
13,
1678,
565,
6492,
29901,
13,
4706,
302,
29892,
270,
353,
921,
29889,
12181,
13,
13,
4706,
396,
260,
585,
338,
15712,
10241,
393,
278,
29342,
284,
583,
6919,
29891,
260,
585,
29899,
771,
637,
291,
13,
4706,
396,
310,
278,
9942,
1659,
13,
4706,
260,
585,
353,
302,
29918,
273,
4835,
334,
29871,
29896,
29889,
29941,
847,
302,
29871,
396,
6674,
5890,
491,
263,
7329,
304,
4337,
278,
10694,
5224,
13,
4706,
281,
353,
4226,
675,
29898,
9302,
29889,
2873,
29898,
29906,
876,
13,
4706,
364,
353,
7442,
29889,
2378,
4197,
9302,
29889,
1195,
29898,
29916,
7503,
29892,
29871,
29900,
11724,
7442,
29889,
3317,
29898,
29916,
7503,
29892,
29871,
29900,
2314,
2314,
13,
13,
4706,
1196,
29918,
27703,
353,
6796,
9539,
613,
376,
1127,
613,
376,
1127,
3108,
13,
4706,
1196,
29918,
8768,
353,
6796,
489,
613,
376,
489,
613,
11663,
3108,
13,
4706,
1196,
29918,
2103,
29879,
353,
518,
29906,
29892,
29871,
29906,
29892,
29871,
29906,
29962,
13,
4706,
3454,
353,
1051,
580,
13,
4706,
1196,
29918,
21134,
353,
1051,
580,
13,
13,
4706,
260,
585,
29918,
333,
29892,
921,
29918,
4722,
353,
679,
29918,
29916,
29918,
4722,
29898,
29916,
29892,
281,
29892,
260,
585,
29897,
13,
4706,
3855,
29918,
4722,
353,
281,
29889,
6333,
29898,
29916,
29918,
4722,
29897,
13,
13,
4706,
396,
6492,
278,
1565,
7688,
4608,
13,
4706,
318,
353,
20064,
403,
29918,
29906,
29928,
29918,
1220,
29918,
1609,
29918,
3149,
29918,
392,
29918,
2003,
29898,
9302,
29889,
2378,
4197,
29900,
1696,
29871,
29896,
5586,
511,
518,
29900,
1696,
29871,
29900,
29889,
1402,
13,
462,
462,
462,
518,
9302,
29889,
3944,
29898,
29884,
29918,
3416,
511,
7442,
29889,
5223,
29898,
29884,
29918,
3416,
29897,
2314,
13,
4706,
3454,
29889,
4397,
29898,
29884,
29897,
13,
4706,
1196,
29918,
21134,
29889,
4397,
29898,
29878,
29908,
5574,
18177,
7555,
1635,
318,
1042,
1159,
13,
13,
4706,
18100,
353,
20064,
403,
29918,
29906,
29928,
29918,
1220,
29918,
1609,
29918,
3149,
29918,
392,
29918,
2003,
29898,
9302,
29889,
2378,
4197,
29900,
1696,
29871,
29896,
29889,
29900,
11724,
518,
29900,
1696,
29871,
29900,
29889,
1402,
281,
29897,
13,
4706,
3454,
29889,
4397,
29898,
8849,
29897,
13,
4706,
1196,
29918,
21134,
29889,
4397,
29898,
29878,
29908,
2525,
5560,
18177,
7555,
1635,
281,
3227,
348,
361,
1042,
1159,
13,
13,
4706,
5263,
353,
20064,
403,
29918,
29906,
29928,
29918,
1220,
29918,
1609,
29918,
29879,
417,
412,
29918,
392,
29918,
1639,
1547,
29898,
9302,
29889,
2378,
4197,
29900,
1696,
29871,
29896,
29889,
29900,
29945,
11724,
448,
29893,
29961,
29900,
29962,
847,
281,
29961,
29896,
1402,
3855,
29918,
4722,
847,
281,
29961,
29896,
2314,
13,
4706,
3454,
29889,
4397,
29898,
7659,
29897,
13,
4706,
1196,
29918,
21134,
29889,
4397,
29898,
29878,
29908,
24947,
22116,
779,
24598,
29938,
7555,
1635,
281,
3227,
348,
361,
1042,
1159,
13,
13,
4706,
9685,
29918,
5657,
2311,
353,
29871,
29896,
29953,
13,
4706,
10518,
600,
488,
353,
2897,
29889,
2084,
29889,
7122,
29898,
449,
3972,
29892,
376,
273,
290,
284,
583,
29918,
262,
29918,
1621,
29889,
5140,
1159,
13,
4706,
270,
29886,
353,
3630,
20867,
357,
29898,
5140,
2084,
29922,
15926,
600,
488,
29892,
4206,
29922,
29896,
29892,
28730,
29922,
29896,
29897,
13,
4706,
715,
353,
270,
29886,
29889,
657,
29918,
4622,
29918,
5317,
580,
13,
4706,
715,
29889,
842,
29918,
294,
1103,
877,
11745,
1495,
13,
4706,
396,
14770,
29889,
29916,
1643,
877,
29916,
742,
4079,
2311,
29922,
8990,
29918,
5657,
2311,
29897,
13,
4706,
396,
14770,
29889,
29891,
1643,
877,
29891,
742,
4079,
2311,
29922,
8990,
29918,
5657,
2311,
29897,
13,
4706,
14770,
29889,
486,
7358,
4197,
2314,
13,
4706,
14770,
29889,
3637,
7358,
4197,
2314,
13,
4706,
14770,
29889,
29916,
2576,
4197,
29899,
29900,
29889,
29900,
29945,
29892,
29871,
29896,
29889,
29900,
29945,
2314,
13,
4706,
14770,
29889,
29891,
2576,
4197,
29899,
29900,
29889,
29900,
29945,
29892,
29871,
29896,
29889,
29900,
29945,
2314,
13,
4706,
715,
29889,
1557,
2620,
29898,
29916,
29918,
11522,
3137,
7503,
29892,
29871,
29900,
1402,
921,
29918,
11522,
3137,
7503,
29892,
29871,
29896,
1402,
269,
29922,
29946,
29945,
29892,
274,
543,
9539,
613,
17456,
543,
29974,
613,
3858,
543,
29940,
290,
979,
1159,
13,
4706,
715,
29889,
1557,
2620,
29898,
29916,
29918,
273,
4835,
7503,
29892,
29871,
29900,
1402,
921,
29918,
273,
4835,
7503,
29892,
29871,
29896,
1402,
269,
29922,
29946,
29945,
29892,
274,
543,
1127,
613,
17456,
543,
29974,
613,
3858,
543,
2744,
290,
14997,
1159,
13,
4706,
363,
474,
29892,
1196,
297,
26985,
29898,
9012,
1125,
13,
9651,
2927,
353,
376,
9539,
29908,
565,
1196,
29918,
27703,
338,
6213,
1683,
1196,
29918,
27703,
29961,
29875,
29962,
13,
9651,
715,
29889,
5317,
29898,
1220,
7503,
29892,
29871,
29900,
1402,
1196,
7503,
29892,
29871,
29896,
1402,
1196,
29918,
8768,
29961,
29875,
1402,
2927,
29922,
2780,
29892,
1196,
2103,
29922,
1220,
29918,
2103,
29879,
29961,
29875,
1402,
13,
462,
1678,
3858,
29922,
1220,
29918,
21134,
29961,
29875,
29962,
565,
6492,
29918,
1397,
1975,
1683,
6213,
29897,
13,
13,
4706,
565,
6492,
29918,
1397,
1975,
29901,
13,
9651,
715,
29889,
26172,
29898,
2029,
2433,
13609,
1492,
742,
3107,
3790,
29915,
2311,
2396,
29871,
29896,
29906,
1800,
13,
4706,
270,
29886,
29889,
5358,
580,
13,
13,
1678,
736,
921,
29892,
343,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
13,
1678,
17927,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
1678,
6389,
353,
679,
29918,
6519,
29918,
5085,
29898,
8382,
29922,
5574,
29892,
4744,
29918,
5085,
29922,
3366,
489,
8382,
613,
13,
462,
462,
462,
1678,
376,
489,
5317,
613,
13,
462,
462,
462,
1678,
376,
489,
1188,
29918,
1445,
29922,
7382,
29914,
5317,
29918,
273,
290,
284,
583,
29918,
1621,
2521,
29889,
1188,
20068,
13,
1678,
396,
1596,
376,
1188,
934,
29901,
1273,
29879,
29908,
1273,
6389,
29889,
1188,
29918,
1445,
13,
1678,
10822,
29918,
21707,
29898,
5085,
29897,
13,
13,
1678,
364,
299,
29889,
26776,
29898,
29946,
29906,
29897,
13,
13,
1678,
714,
3972,
353,
376,
6904,
7382,
29914,
453,
11036,
29908,
13,
1678,
4516,
29918,
3258,
29898,
449,
3972,
29897,
13,
13,
1678,
396,
6492,
11695,
362,
13569,
8158,
4978,
8632,
362,
13,
1678,
396,
6492,
29918,
273,
290,
284,
583,
29918,
361,
272,
29898,
449,
3972,
29892,
6492,
29922,
5574,
29892,
6492,
29918,
1397,
1975,
29922,
8824,
29897,
13,
13,
1678,
6492,
29918,
273,
290,
284,
583,
29918,
1621,
29898,
449,
3972,
29892,
6492,
29922,
5574,
29892,
6492,
29918,
1397,
1975,
29922,
8824,
29897,
2
] |
lesson_planner/migrations/0014_auto_20200811_2219.py | Hogwarts250/lesson-discussion | 0 | 167159 | # Generated by Django 3.1 on 2020-08-12 05:19
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('lesson_planner', '0013_auto_20200811_2108'),
]
operations = [
migrations.RemoveField(
model_name='lesson',
name='user',
),
migrations.AddField(
model_name='lesson',
name='teacher',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='teacher', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='lesson',
name='id',
field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False),
),
]
| [
1,
396,
3251,
630,
491,
15337,
29871,
29941,
29889,
29896,
373,
29871,
29906,
29900,
29906,
29900,
29899,
29900,
29947,
29899,
29896,
29906,
29871,
29900,
29945,
29901,
29896,
29929,
13,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
5215,
9557,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
13,
5215,
318,
5416,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
9725,
800,
29889,
2774,
932,
519,
29918,
10836,
29898,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
511,
13,
4706,
6702,
2222,
265,
29918,
572,
7310,
742,
525,
29900,
29900,
29896,
29941,
29918,
6921,
29918,
29906,
29900,
29906,
29900,
29900,
29947,
29896,
29896,
29918,
29906,
29896,
29900,
29947,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
15941,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
2222,
265,
742,
13,
9651,
1024,
2433,
1792,
742,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
2222,
265,
742,
13,
9651,
1024,
2433,
371,
11665,
742,
13,
9651,
1746,
29922,
9794,
29889,
27755,
2558,
29898,
4304,
29922,
5574,
29892,
373,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
371,
11665,
742,
304,
29922,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
2222,
265,
742,
13,
9651,
1024,
2433,
333,
742,
13,
9651,
1746,
29922,
9794,
29889,
29965,
11150,
3073,
29898,
4381,
29922,
25118,
29889,
25118,
29946,
29892,
3863,
519,
29922,
8824,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
511,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
mars/worker/storage/procmemhandler.py | sighingnow/mars | 0 | 113073 | # Copyright 1999-2019 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from ...serialize import dataserializer
from ...utils import calc_data_size
from .core import DataStorageDevice, StorageHandler, ObjectStorageMixin, \
wrap_promised, register_storage_handler_cls
class ProcMemHandler(StorageHandler, ObjectStorageMixin):
storage_type = DataStorageDevice.PROC_MEMORY
def __init__(self, storage_ctx):
StorageHandler.__init__(self, storage_ctx)
self._proc_id = storage_ctx.proc_id
self._inproc_store_ref_attr = None
@property
def _inproc_store_ref(self):
if self._inproc_store_ref_attr is None:
self._inproc_store_ref_attr = self._storage_ctx.actor_ctx.actor_ref(
self._storage_ctx.manager_ref.get_process_holder(
self._proc_id, DataStorageDevice.PROC_MEMORY))
return self._inproc_store_ref_attr
@wrap_promised
def get_object(self, session_id, data_key, serialized=False, _promise=False):
obj = self._inproc_store_ref.get_object(session_id, data_key)
if serialized:
obj = dataserializer.serialize(obj)
return obj
@wrap_promised
def put_object(self, session_id, data_key, obj, serialized=False, _promise=False):
o = self._deserial(obj) if serialized else obj
self._inproc_store_ref.put_object(session_id, data_key, o)
self.register_data(session_id, data_key, calc_data_size(o), shape=getattr(o, 'shape', None))
def load_from_bytes_io(self, session_id, data_key, src_handler):
def _read_and_put(reader):
with reader:
result = reader.get_io_pool() \
.submit(reader.read).result()
self.put_object(session_id, data_key, result, serialized=True)
return src_handler.create_bytes_reader(session_id, data_key, _promise=True) \
.then(_read_and_put)
def load_from_object_io(self, session_id, data_key, src_handler):
return src_handler.get_object(session_id, data_key, _promise=True) \
.then(lambda obj: self.put_object(session_id, data_key, obj))
def delete(self, session_id, data_key, _tell=False):
self._inproc_store_ref.delete_object(session_id, data_key, _tell=_tell)
self.unregister_data(session_id, data_key, _tell=_tell)
register_storage_handler_cls(DataStorageDevice.PROC_MEMORY, ProcMemHandler)
| [
1,
396,
14187,
1266,
29871,
29896,
29929,
29929,
29929,
29899,
29906,
29900,
29896,
29929,
319,
1982,
5363,
6431,
21771,
292,
19806,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
418,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
3166,
2023,
643,
6646,
1053,
6155,
261,
616,
3950,
13,
3166,
2023,
13239,
1053,
22235,
29918,
1272,
29918,
2311,
13,
3166,
869,
3221,
1053,
3630,
10486,
11501,
29892,
26162,
4598,
29892,
4669,
10486,
29924,
861,
262,
29892,
320,
13,
1678,
12244,
29918,
14032,
3368,
29892,
6036,
29918,
12925,
29918,
13789,
29918,
25932,
13,
13,
13,
1990,
1019,
29883,
11442,
4598,
29898,
10486,
4598,
29892,
4669,
10486,
29924,
861,
262,
1125,
13,
1678,
8635,
29918,
1853,
353,
3630,
10486,
11501,
29889,
8618,
29907,
29918,
2303,
29924,
18929,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
8635,
29918,
13073,
1125,
13,
4706,
26162,
4598,
17255,
2344,
12035,
1311,
29892,
8635,
29918,
13073,
29897,
13,
13,
4706,
1583,
3032,
15439,
29918,
333,
353,
8635,
29918,
13073,
29889,
15439,
29918,
333,
13,
4706,
1583,
3032,
262,
15439,
29918,
8899,
29918,
999,
29918,
5552,
353,
6213,
13,
13,
1678,
732,
6799,
13,
1678,
822,
903,
262,
15439,
29918,
8899,
29918,
999,
29898,
1311,
1125,
13,
4706,
565,
1583,
3032,
262,
15439,
29918,
8899,
29918,
999,
29918,
5552,
338,
6213,
29901,
13,
9651,
1583,
3032,
262,
15439,
29918,
8899,
29918,
999,
29918,
5552,
353,
1583,
3032,
12925,
29918,
13073,
29889,
7168,
29918,
13073,
29889,
7168,
29918,
999,
29898,
13,
18884,
1583,
3032,
12925,
29918,
13073,
29889,
12847,
29918,
999,
29889,
657,
29918,
5014,
29918,
7694,
29898,
13,
462,
1678,
1583,
3032,
15439,
29918,
333,
29892,
3630,
10486,
11501,
29889,
8618,
29907,
29918,
2303,
29924,
18929,
876,
13,
4706,
736,
1583,
3032,
262,
15439,
29918,
8899,
29918,
999,
29918,
5552,
13,
13,
1678,
732,
6312,
29918,
14032,
3368,
13,
1678,
822,
679,
29918,
3318,
29898,
1311,
29892,
4867,
29918,
333,
29892,
848,
29918,
1989,
29892,
7797,
1891,
29922,
8824,
29892,
903,
14032,
895,
29922,
8824,
1125,
13,
4706,
5446,
353,
1583,
3032,
262,
15439,
29918,
8899,
29918,
999,
29889,
657,
29918,
3318,
29898,
7924,
29918,
333,
29892,
848,
29918,
1989,
29897,
13,
4706,
565,
7797,
1891,
29901,
13,
9651,
5446,
353,
6155,
261,
616,
3950,
29889,
643,
6646,
29898,
5415,
29897,
13,
4706,
736,
5446,
13,
13,
1678,
732,
6312,
29918,
14032,
3368,
13,
1678,
822,
1925,
29918,
3318,
29898,
1311,
29892,
4867,
29918,
333,
29892,
848,
29918,
1989,
29892,
5446,
29892,
7797,
1891,
29922,
8824,
29892,
903,
14032,
895,
29922,
8824,
1125,
13,
4706,
288,
353,
1583,
3032,
2783,
261,
616,
29898,
5415,
29897,
565,
7797,
1891,
1683,
5446,
13,
4706,
1583,
3032,
262,
15439,
29918,
8899,
29918,
999,
29889,
649,
29918,
3318,
29898,
7924,
29918,
333,
29892,
848,
29918,
1989,
29892,
288,
29897,
13,
4706,
1583,
29889,
9573,
29918,
1272,
29898,
7924,
29918,
333,
29892,
848,
29918,
1989,
29892,
22235,
29918,
1272,
29918,
2311,
29898,
29877,
511,
8267,
29922,
657,
5552,
29898,
29877,
29892,
525,
12181,
742,
6213,
876,
13,
13,
1678,
822,
2254,
29918,
3166,
29918,
13193,
29918,
601,
29898,
1311,
29892,
4867,
29918,
333,
29892,
848,
29918,
1989,
29892,
4765,
29918,
13789,
1125,
13,
4706,
822,
903,
949,
29918,
392,
29918,
649,
29898,
16950,
1125,
13,
9651,
411,
9591,
29901,
13,
18884,
1121,
353,
9591,
29889,
657,
29918,
601,
29918,
10109,
580,
320,
13,
462,
1678,
869,
7892,
29898,
16950,
29889,
949,
467,
2914,
580,
13,
9651,
1583,
29889,
649,
29918,
3318,
29898,
7924,
29918,
333,
29892,
848,
29918,
1989,
29892,
1121,
29892,
7797,
1891,
29922,
5574,
29897,
13,
13,
4706,
736,
4765,
29918,
13789,
29889,
3258,
29918,
13193,
29918,
16950,
29898,
7924,
29918,
333,
29892,
848,
29918,
1989,
29892,
903,
14032,
895,
29922,
5574,
29897,
320,
13,
9651,
869,
6098,
7373,
949,
29918,
392,
29918,
649,
29897,
13,
13,
1678,
822,
2254,
29918,
3166,
29918,
3318,
29918,
601,
29898,
1311,
29892,
4867,
29918,
333,
29892,
848,
29918,
1989,
29892,
4765,
29918,
13789,
1125,
13,
4706,
736,
4765,
29918,
13789,
29889,
657,
29918,
3318,
29898,
7924,
29918,
333,
29892,
848,
29918,
1989,
29892,
903,
14032,
895,
29922,
5574,
29897,
320,
13,
9651,
869,
6098,
29898,
2892,
5446,
29901,
1583,
29889,
649,
29918,
3318,
29898,
7924,
29918,
333,
29892,
848,
29918,
1989,
29892,
5446,
876,
13,
13,
1678,
822,
5217,
29898,
1311,
29892,
4867,
29918,
333,
29892,
848,
29918,
1989,
29892,
903,
29873,
514,
29922,
8824,
1125,
13,
4706,
1583,
3032,
262,
15439,
29918,
8899,
29918,
999,
29889,
8143,
29918,
3318,
29898,
7924,
29918,
333,
29892,
848,
29918,
1989,
29892,
903,
29873,
514,
29922,
29918,
29873,
514,
29897,
13,
4706,
1583,
29889,
348,
9573,
29918,
1272,
29898,
7924,
29918,
333,
29892,
848,
29918,
1989,
29892,
903,
29873,
514,
29922,
29918,
29873,
514,
29897,
13,
13,
13,
9573,
29918,
12925,
29918,
13789,
29918,
25932,
29898,
1469,
10486,
11501,
29889,
8618,
29907,
29918,
2303,
29924,
18929,
29892,
1019,
29883,
11442,
4598,
29897,
13,
2
] |
authdata/views.py | mpassid/MPASSid-data | 0 | 132946 |
# -*- encoding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014-2015 <NAME>, http://haltu.fi
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
import logging
import datetime
import importlib
from django.db.models import Q
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.conf import settings
from rest_framework import filters
from rest_framework import generics
from rest_framework import viewsets
from rest_framework.response import Response
import django_filters
from authdata.serializers import QuerySerializer, UserSerializer, AttributeSerializer, UserAttributeSerializer, MunicipalitySerializer, SchoolSerializer, RoleSerializer, AttendanceSerializer
from authdata.models import User, Attribute, UserAttribute, Municipality, School, Role, Attendance
LOG = logging.getLogger(__name__)
def get_external_user_data(external_source, external_id):
"""
Raises ImportError if external source configuration is wrong
"""
source = settings.AUTH_EXTERNAL_SOURCES[external_source]
LOG.debug('Trying to import module of external authentication source', extra={'data': {'module_name': source[0]}})
handler_module = importlib.import_module(source[0])
kwargs = source[2]
handler = getattr(handler_module, source[1])(**kwargs)
return handler.get_data(external_id)
class QueryView(generics.RetrieveAPIView):
""" Returns information about one user.
The ``username`` is global unique identifier for the user.
The ``roles`` is a list of roles the user has in different schools.
User can have multiple roles in one school.
Possible values for ``role`` are ``teacher`` and ``student``.
Query is made by GET parameters. Only one parameter is allowed. The parameter
consists of an attribute name and an attribute value.
``Not found`` is returned if:
* the parameter name is not recognized
* multiple results would be returned (only one result is allowed)
* no parameters are specified
"""
queryset = User.objects.all()
serializer_class = QuerySerializer
lookup_field = 'username'
def get(self, request, *args, **kwargs):
# 1. look for a user object matching the query parameter. if it's found, check if it's an external user and fetch data
try:
user_obj = self.get_object()
except Http404:
user_obj = None
if user_obj:
# local user object exists.
if user_obj.external_source and user_obj.external_id:
# user is an external user. fetch data from source.
try:
user_data = get_external_user_data(user_obj.external_source, user_obj.external_id)
except ImportError:
LOG.error('Can not import external authentication source', extra={'data': {'external_source': repr(user_obj.external_source)}})
return Response(None)
except KeyError:
LOG.error('External source not configured', extra={'data': {'external_source': repr(user_obj.external_source)}})
return Response(None)
if user_data is None:
# queried user does not exist in the external source
return Response(None)
for user_attribute in user_obj.attributes.all():
# Add attributes to user data
user_data['attributes'].append({'name': user_attribute.attribute.name, 'value': user_attribute.value})
LOG.debug('/query returning data', extra={'data': {'user_data': repr(user_data)}})
return Response(user_data)
else:
# 2. if user was not found and query parameter is mapped to an external source, fetch and create user
for attr in request.GET.keys():
if attr in settings.AUTH_EXTERNAL_ATTRIBUTE_BINDING:
try:
user_data = get_external_user_data(settings.AUTH_EXTERNAL_ATTRIBUTE_BINDING[attr], request.GET.get(attr))
if user_data is None:
# queried user does not exist in the external source
return Response(None)
# New users are created in data source
user_obj = User.objects.get(username=user_data['username'])
for user_attribute in user_obj.attributes.all():
# Add attributes to user data
user_data['attributes'].append({'name': user_attribute.attribute.name, 'value': user_attribute.value})
LOG.debug('/query returning data', extra={'data': {'user_data': repr(user_data)}})
return Response(user_data)
except ImportError as e:
LOG.error('Could not import external data source',
extra={'data': {'error': unicode(e), 'attr': repr(attr)}})
# TODO: error handling
# flow back to normal implementation most likely return empty
break
return super(QueryView, self).get(request, *args, **kwargs)
def get_object(self):
qs = self.filter_queryset(self.get_queryset())
qs = qs.distinct()
filter_kwargs = {}
lookup = self.kwargs.get(self.lookup_field, None)
if lookup:
filter_kwargs = {self.lookup_field: lookup}
else:
for k, v in self.request.GET.iteritems():
a = get_object_or_404(Attribute.objects.all(), name=k)
filter_kwargs['attributes__attribute__name'] = a.name
filter_kwargs['attributes__value'] = v
filter_kwargs['attributes__disabled_at__isnull'] = True
break # only handle one GET variable for now
else:
raise Http404
obj = generics.get_object_or_404(qs, **filter_kwargs)
self.check_object_permissions(self.request, obj)
return obj
class UserFilter(django_filters.FilterSet):
municipality = django_filters.CharFilter(name='attendances__school__municipality__name', lookup_expr='iexact')
school = django_filters.CharFilter(name='attendances__school__name', lookup_expr='iexact')
group = django_filters.CharFilter(name='attendances__group', lookup_expr='iexact')
# changed_at = django_filters.MethodFilter(action='timestamp_filter')
# RR 2018-02-28
changed_at = django_filters.BooleanFilter(name='attendance__timestamp__validity', method='timestamp_filter')
def timestamp_filter(self, queryset, value):
# TODO: this is unaware of removed UserAttributes
try:
tstamp = datetime.datetime.fromtimestamp(float(value))
except ValueError:
return queryset.none()
by_user = Q(modified__gte=tstamp)
by_user_attribute = Q(attributes__modified__gte=tstamp)
by_attribute_name = Q(attributes__attribute__modified__gte=tstamp)
by_attendance = Q(attendances__modified__gte=tstamp)
by_role_name = Q(attendances__role__modified__gte=tstamp)
# SELECT DISTINCT ON ("authdata_user"."id") - makes this query perform a lot faster,
# but is ONLY compatible with PostgreSQL!
return queryset.filter(by_user | by_user_attribute | by_attribute_name | by_attendance | by_role_name).distinct('id')
class Meta:
model = User
fields = ['username', 'school', 'group', 'changed_at']
class UserViewSet(viewsets.ModelViewSet):
queryset = User.objects.all().distinct()
serializer_class = UserSerializer
# filter_backends = (filters.DjangoFilterBackend,)
# Removed DjangoFilterBackend inline with deprecation policy. Use django_filters.rest_framework.FilterSet and/or
# django_filters.rest_framework.DjangoFilterBackend instead. #5273
# RR 2018-02-28
filter_backends = (django_filters.rest_framework.DjangoFilterBackend,)
filter_class = UserFilter
def list(self, request, *args, **kwargs):
if 'municipality' in request.GET and request.GET['municipality'].lower() in [binding_name.lower() for binding_name in settings.AUTH_EXTERNAL_MUNICIPALITY_BINDING.keys()]:
for binding_name, binding in settings.AUTH_EXTERNAL_MUNICIPALITY_BINDING.iteritems():
if binding_name.lower() == request.GET['municipality'].lower():
source = settings.AUTH_EXTERNAL_SOURCES[binding]
try:
handler_module = importlib.import_module(source[0])
k = source[2]
handler = getattr(handler_module, source[1])(**k)
user_data = handler.get_user_data(request)
LOG.debug('/user returning data', extra={'data': {'user_data': repr(user_data)}})
return Response(user_data)
except ImportError as e:
LOG.error('Could not import external data source',
extra={'data': {'error': unicode(e)}})
# TODO: error handling
# flow back to normal implementation most likely return empty
return super(UserViewSet, self).list(request, *args, **kwargs)
class AttributeViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Attribute.objects.all()
serializer_class = AttributeSerializer
class UserAttributeFilter(django_filters.FilterSet):
user = django_filters.CharFilter(name='user__username', lookup_expr='exact')
attribute = django_filters.CharFilter(name='attribute__name', lookup_expr='exact')
class Meta:
model = UserAttribute
fields = ['user', 'attribute']
class UserAttributeViewSet(viewsets.ModelViewSet):
queryset = UserAttribute.objects.filter(disabled_at__isnull=True)
serializer_class = UserAttributeSerializer
# filter_backends = (filters.DjangoFilterBackend,)
# Removed DjangoFilterBackend inline with deprecation policy. Use django_filters.rest_framework.FilterSet and/or
# django_filters.rest_framework.DjangoFilterBackend instead. #5273
# RR 2018-02-28
filter_backends = (django_filters.rest_framework.DjangoFilterBackend,)
filter_class = UserAttributeFilter
def destroy(self, request, *args, **kwargs):
# UserAttribute is flagged as disabled
obj = self.get_object()
obj.disabled_at = datetime.datetime.now()
obj.save()
return Response(status=204)
class MunicipalityViewSet(viewsets.ModelViewSet):
queryset = Municipality.objects.all()
serializer_class = MunicipalitySerializer
class SchoolViewSet(viewsets.ModelViewSet):
queryset = School.objects.all()
serializer_class = SchoolSerializer
class RoleViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Role.objects.all()
serializer_class = RoleSerializer
class AttendanceViewSet(viewsets.ModelViewSet):
queryset = Attendance.objects.all()
serializer_class = AttendanceSerializer
# vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2
| [
1,
29871,
13,
29937,
448,
29930,
29899,
8025,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
29937,
450,
341,
1806,
19245,
313,
26349,
29897,
13,
29937,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29946,
29899,
29906,
29900,
29896,
29945,
529,
5813,
10202,
1732,
597,
10647,
29884,
29889,
7241,
13,
29937,
13,
29937,
20894,
2333,
338,
1244,
1609,
16896,
29892,
3889,
310,
8323,
29892,
304,
738,
2022,
4017,
292,
263,
3509,
13,
29937,
310,
445,
7047,
322,
6942,
5106,
2066,
313,
1552,
376,
6295,
14093,
4968,
304,
5376,
13,
29937,
297,
278,
18540,
1728,
24345,
29892,
3704,
1728,
29485,
278,
10462,
13,
29937,
304,
671,
29892,
3509,
29892,
6623,
29892,
10366,
29892,
9805,
29892,
1320,
2666,
29892,
269,
803,
1947,
29892,
322,
29914,
272,
19417,
13,
29937,
14591,
310,
278,
18540,
29892,
322,
304,
14257,
12407,
304,
6029,
278,
18540,
338,
13,
29937,
15252,
3276,
304,
437,
577,
29892,
4967,
304,
278,
1494,
5855,
29901,
13,
29937,
13,
29937,
450,
2038,
3509,
1266,
8369,
322,
445,
10751,
8369,
4091,
367,
5134,
297,
13,
29937,
599,
14591,
470,
23228,
2011,
1080,
310,
278,
18540,
29889,
13,
29937,
13,
29937,
6093,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
376,
3289,
8519,
613,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
8528,
15094,
1799,
6323,
13,
29937,
306,
3580,
5265,
3352,
29892,
2672,
6154,
15789,
4214,
350,
2692,
6058,
27848,
3352,
7495,
6093,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
13,
29937,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
13,
29937,
26524,
29950,
24125,
6323,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
20700,
17705,
6181,
15842,
13764,
29979,
315,
4375,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
438,
29911,
4448,
13,
29937,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
323,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
9033,
3235,
4214,
3895,
29892,
13,
29937,
19474,
8079,
6323,
2672,
8707,
8186,
9838,
22659,
6093,
7791,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
438,
29911,
4448,
5012,
1964,
4214,
29903,
2672,
13,
29937,
6093,
7791,
7818,
12982,
1525,
29889,
13,
13,
5215,
12183,
13,
5215,
12865,
13,
5215,
1053,
1982,
13,
3166,
9557,
29889,
2585,
29889,
9794,
1053,
660,
13,
3166,
9557,
29889,
1124,
1053,
9056,
29946,
29900,
29946,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
1791,
29918,
4468,
1053,
18094,
13,
3166,
1791,
29918,
4468,
1053,
1176,
1199,
13,
3166,
1791,
29918,
4468,
1053,
1776,
7224,
13,
3166,
1791,
29918,
4468,
29889,
5327,
1053,
13291,
13,
5215,
9557,
29918,
26705,
13,
3166,
4817,
1272,
29889,
15550,
19427,
1053,
13641,
17679,
29892,
4911,
17679,
29892,
23833,
17679,
29892,
4911,
6708,
17679,
29892,
12813,
2877,
17679,
29892,
4523,
17679,
29892,
1528,
280,
17679,
29892,
6212,
21642,
17679,
13,
3166,
4817,
1272,
29889,
9794,
1053,
4911,
29892,
23833,
29892,
4911,
6708,
29892,
12813,
2877,
29892,
4523,
29892,
1528,
280,
29892,
6212,
21642,
13,
13,
14480,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
13,
1753,
679,
29918,
23176,
29918,
1792,
29918,
1272,
29898,
23176,
29918,
4993,
29892,
7029,
29918,
333,
1125,
13,
29871,
9995,
13,
29871,
390,
1759,
267,
16032,
2392,
565,
7029,
2752,
5285,
338,
2743,
13,
29871,
9995,
13,
29871,
2752,
353,
6055,
29889,
20656,
29950,
29918,
5746,
4945,
29940,
1964,
29918,
27839,
27266,
29961,
23176,
29918,
4993,
29962,
13,
29871,
25401,
29889,
8382,
877,
15870,
292,
304,
1053,
3883,
310,
7029,
10760,
2752,
742,
4805,
3790,
29915,
1272,
2396,
11117,
5453,
29918,
978,
2396,
2752,
29961,
29900,
29962,
24289,
13,
29871,
7834,
29918,
5453,
353,
1053,
1982,
29889,
5215,
29918,
5453,
29898,
4993,
29961,
29900,
2314,
13,
29871,
9049,
5085,
353,
2752,
29961,
29906,
29962,
13,
29871,
7834,
353,
679,
5552,
29898,
13789,
29918,
5453,
29892,
2752,
29961,
29896,
2314,
29898,
1068,
19290,
29897,
13,
29871,
736,
7834,
29889,
657,
29918,
1272,
29898,
23176,
29918,
333,
29897,
13,
13,
13,
1990,
13641,
1043,
29898,
4738,
1199,
29889,
8015,
29878,
2418,
8787,
1043,
1125,
13,
29871,
9995,
16969,
2472,
1048,
697,
1404,
29889,
13,
13,
29871,
450,
4954,
6786,
16159,
338,
5534,
5412,
15882,
363,
278,
1404,
29889,
13,
13,
29871,
450,
4954,
307,
793,
16159,
338,
263,
1051,
310,
16178,
278,
1404,
756,
297,
1422,
12462,
29889,
13,
29871,
4911,
508,
505,
2999,
16178,
297,
697,
3762,
29889,
13,
13,
29871,
20049,
1819,
363,
4954,
12154,
16159,
526,
4954,
371,
11665,
16159,
322,
4954,
18945,
29952,
1412,
13,
13,
29871,
13641,
338,
1754,
491,
12354,
4128,
29889,
9333,
697,
3443,
338,
6068,
29889,
450,
3443,
13,
29871,
11624,
310,
385,
5352,
1024,
322,
385,
5352,
995,
29889,
13,
13,
29871,
4954,
3664,
1476,
16159,
338,
4133,
565,
29901,
13,
13,
29871,
334,
278,
3443,
1024,
338,
451,
14831,
13,
29871,
334,
2999,
2582,
723,
367,
4133,
313,
6194,
697,
1121,
338,
6068,
29897,
13,
29871,
334,
694,
4128,
526,
6790,
13,
29871,
9995,
13,
29871,
2346,
842,
353,
4911,
29889,
12650,
29889,
497,
580,
13,
29871,
7797,
3950,
29918,
1990,
353,
13641,
17679,
13,
29871,
16280,
29918,
2671,
353,
525,
6786,
29915,
13,
13,
29871,
822,
679,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
1678,
396,
29871,
29896,
29889,
1106,
363,
263,
1404,
1203,
9686,
278,
2346,
3443,
29889,
565,
372,
29915,
29879,
1476,
29892,
1423,
565,
372,
29915,
29879,
385,
7029,
1404,
322,
6699,
848,
13,
1678,
1018,
29901,
13,
418,
1404,
29918,
5415,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
1678,
5174,
9056,
29946,
29900,
29946,
29901,
13,
418,
1404,
29918,
5415,
353,
6213,
13,
1678,
565,
1404,
29918,
5415,
29901,
13,
418,
396,
1887,
1404,
1203,
4864,
29889,
13,
418,
565,
1404,
29918,
5415,
29889,
23176,
29918,
4993,
322,
1404,
29918,
5415,
29889,
23176,
29918,
333,
29901,
13,
4706,
396,
1404,
338,
385,
7029,
1404,
29889,
6699,
848,
515,
2752,
29889,
13,
4706,
1018,
29901,
13,
3986,
1404,
29918,
1272,
353,
679,
29918,
23176,
29918,
1792,
29918,
1272,
29898,
1792,
29918,
5415,
29889,
23176,
29918,
4993,
29892,
1404,
29918,
5415,
29889,
23176,
29918,
333,
29897,
13,
4706,
5174,
16032,
2392,
29901,
13,
3986,
25401,
29889,
2704,
877,
6028,
451,
1053,
7029,
10760,
2752,
742,
4805,
3790,
29915,
1272,
2396,
11117,
23176,
29918,
4993,
2396,
2062,
29898,
1792,
29918,
5415,
29889,
23176,
29918,
4993,
21345,
29897,
13,
3986,
736,
13291,
29898,
8516,
29897,
13,
4706,
5174,
7670,
2392,
29901,
13,
3986,
25401,
29889,
2704,
877,
25865,
2752,
451,
13252,
742,
4805,
3790,
29915,
1272,
2396,
11117,
23176,
29918,
4993,
2396,
2062,
29898,
1792,
29918,
5415,
29889,
23176,
29918,
4993,
21345,
29897,
13,
3986,
736,
13291,
29898,
8516,
29897,
13,
4706,
565,
1404,
29918,
1272,
338,
6213,
29901,
13,
3986,
396,
22320,
1000,
1404,
947,
451,
1863,
297,
278,
7029,
2752,
13,
3986,
736,
13291,
29898,
8516,
29897,
13,
4706,
363,
1404,
29918,
12715,
297,
1404,
29918,
5415,
29889,
15697,
29889,
497,
7295,
13,
3986,
396,
3462,
8393,
304,
1404,
848,
13,
3986,
1404,
29918,
1272,
1839,
15697,
13359,
4397,
3319,
29915,
978,
2396,
1404,
29918,
12715,
29889,
12715,
29889,
978,
29892,
525,
1767,
2396,
1404,
29918,
12715,
29889,
1767,
1800,
13,
4706,
25401,
29889,
8382,
11219,
1972,
7863,
848,
742,
4805,
3790,
29915,
1272,
2396,
11117,
1792,
29918,
1272,
2396,
2062,
29898,
1792,
29918,
1272,
21345,
29897,
13,
4706,
736,
13291,
29898,
1792,
29918,
1272,
29897,
13,
1678,
1683,
29901,
13,
418,
396,
29871,
29906,
29889,
565,
1404,
471,
451,
1476,
322,
2346,
3443,
338,
20545,
304,
385,
7029,
2752,
29892,
6699,
322,
1653,
1404,
13,
418,
363,
12421,
297,
2009,
29889,
7194,
29889,
8149,
7295,
13,
4706,
565,
12421,
297,
6055,
29889,
20656,
29950,
29918,
5746,
4945,
29940,
1964,
29918,
1299,
29911,
3960,
29933,
26027,
29918,
29933,
22255,
4214,
29901,
13,
3986,
1018,
29901,
13,
9651,
1404,
29918,
1272,
353,
679,
29918,
23176,
29918,
1792,
29918,
1272,
29898,
11027,
29889,
20656,
29950,
29918,
5746,
4945,
29940,
1964,
29918,
1299,
29911,
3960,
29933,
26027,
29918,
29933,
22255,
4214,
29961,
5552,
1402,
2009,
29889,
7194,
29889,
657,
29898,
5552,
876,
13,
9651,
565,
1404,
29918,
1272,
338,
6213,
29901,
13,
795,
396,
22320,
1000,
1404,
947,
451,
1863,
297,
278,
7029,
2752,
13,
795,
736,
13291,
29898,
8516,
29897,
13,
13,
9651,
396,
1570,
4160,
526,
2825,
297,
848,
2752,
13,
9651,
1404,
29918,
5415,
353,
4911,
29889,
12650,
29889,
657,
29898,
6786,
29922,
1792,
29918,
1272,
1839,
6786,
11287,
13,
9651,
363,
1404,
29918,
12715,
297,
1404,
29918,
5415,
29889,
15697,
29889,
497,
7295,
13,
795,
396,
3462,
8393,
304,
1404,
848,
13,
795,
1404,
29918,
1272,
1839,
15697,
13359,
4397,
3319,
29915,
978,
2396,
1404,
29918,
12715,
29889,
12715,
29889,
978,
29892,
525,
1767,
2396,
1404,
29918,
12715,
29889,
1767,
1800,
13,
9651,
25401,
29889,
8382,
11219,
1972,
7863,
848,
742,
4805,
3790,
29915,
1272,
2396,
11117,
1792,
29918,
1272,
2396,
2062,
29898,
1792,
29918,
1272,
21345,
29897,
13,
9651,
736,
13291,
29898,
1792,
29918,
1272,
29897,
13,
13,
3986,
5174,
16032,
2392,
408,
321,
29901,
13,
9651,
25401,
29889,
2704,
877,
23323,
451,
1053,
7029,
848,
2752,
742,
13,
18884,
4805,
3790,
29915,
1272,
2396,
11117,
2704,
2396,
29104,
29898,
29872,
511,
525,
5552,
2396,
2062,
29898,
5552,
21345,
29897,
13,
9651,
396,
14402,
29901,
1059,
11415,
13,
9651,
396,
4972,
1250,
304,
4226,
5314,
1556,
5517,
736,
4069,
13,
4706,
2867,
13,
1678,
736,
2428,
29898,
3010,
1043,
29892,
1583,
467,
657,
29898,
3827,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
29871,
822,
679,
29918,
3318,
29898,
1311,
1125,
13,
1678,
3855,
29879,
353,
1583,
29889,
4572,
29918,
1972,
842,
29898,
1311,
29889,
657,
29918,
1972,
842,
3101,
13,
1678,
3855,
29879,
353,
3855,
29879,
29889,
5721,
5562,
580,
13,
1678,
4175,
29918,
19290,
353,
6571,
13,
1678,
16280,
353,
1583,
29889,
19290,
29889,
657,
29898,
1311,
29889,
20401,
29918,
2671,
29892,
6213,
29897,
13,
1678,
565,
16280,
29901,
13,
418,
4175,
29918,
19290,
353,
426,
1311,
29889,
20401,
29918,
2671,
29901,
16280,
29913,
13,
1678,
1683,
29901,
13,
418,
363,
413,
29892,
325,
297,
1583,
29889,
3827,
29889,
7194,
29889,
1524,
7076,
7295,
13,
4706,
263,
353,
679,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
6708,
29889,
12650,
29889,
497,
3285,
1024,
29922,
29895,
29897,
13,
4706,
4175,
29918,
19290,
1839,
15697,
1649,
12715,
1649,
978,
2033,
353,
263,
29889,
978,
13,
4706,
4175,
29918,
19290,
1839,
15697,
1649,
1767,
2033,
353,
325,
13,
4706,
4175,
29918,
19290,
1839,
15697,
1649,
18279,
29918,
271,
1649,
275,
4304,
2033,
353,
5852,
13,
4706,
2867,
29871,
396,
871,
4386,
697,
12354,
2286,
363,
1286,
13,
418,
1683,
29901,
13,
4706,
12020,
9056,
29946,
29900,
29946,
13,
1678,
5446,
353,
1176,
1199,
29889,
657,
29918,
3318,
29918,
272,
29918,
29946,
29900,
29946,
29898,
29939,
29879,
29892,
3579,
4572,
29918,
19290,
29897,
13,
1678,
1583,
29889,
3198,
29918,
3318,
29918,
17858,
6847,
29898,
1311,
29889,
3827,
29892,
5446,
29897,
13,
1678,
736,
5446,
13,
13,
13,
1990,
4911,
5072,
29898,
14095,
29918,
26705,
29889,
5072,
2697,
1125,
13,
29871,
21511,
353,
9557,
29918,
26705,
29889,
5914,
5072,
29898,
978,
2433,
27601,
2925,
1649,
27041,
1649,
29885,
4376,
2877,
1649,
978,
742,
16280,
29918,
13338,
2433,
347,
29916,
627,
1495,
13,
29871,
3762,
353,
9557,
29918,
26705,
29889,
5914,
5072,
29898,
978,
2433,
27601,
2925,
1649,
27041,
1649,
978,
742,
16280,
29918,
13338,
2433,
347,
29916,
627,
1495,
13,
29871,
2318,
353,
9557,
29918,
26705,
29889,
5914,
5072,
29898,
978,
2433,
27601,
2925,
1649,
2972,
742,
16280,
29918,
13338,
2433,
347,
29916,
627,
1495,
13,
29871,
396,
3939,
29918,
271,
353,
9557,
29918,
26705,
29889,
4062,
5072,
29898,
2467,
2433,
16394,
29918,
4572,
1495,
13,
29871,
396,
390,
29934,
29871,
29906,
29900,
29896,
29947,
29899,
29900,
29906,
29899,
29906,
29947,
13,
29871,
3939,
29918,
271,
353,
9557,
29918,
26705,
29889,
18146,
5072,
29898,
978,
2433,
1131,
21642,
1649,
16394,
1649,
3084,
537,
742,
1158,
2433,
16394,
29918,
4572,
1495,
13,
13,
13,
29871,
822,
14334,
29918,
4572,
29898,
1311,
29892,
2346,
842,
29892,
995,
1125,
13,
1678,
396,
14402,
29901,
445,
338,
1185,
2519,
310,
6206,
4911,
15801,
13,
1678,
1018,
29901,
13,
418,
260,
303,
1160,
353,
12865,
29889,
12673,
29889,
3166,
16394,
29898,
7411,
29898,
1767,
876,
13,
1678,
5174,
7865,
2392,
29901,
13,
418,
736,
2346,
842,
29889,
9290,
580,
13,
1678,
491,
29918,
1792,
353,
660,
29898,
1545,
2164,
1649,
29887,
371,
29922,
29873,
303,
1160,
29897,
13,
1678,
491,
29918,
1792,
29918,
12715,
353,
660,
29898,
15697,
1649,
1545,
2164,
1649,
29887,
371,
29922,
29873,
303,
1160,
29897,
13,
1678,
491,
29918,
12715,
29918,
978,
353,
660,
29898,
15697,
1649,
12715,
1649,
1545,
2164,
1649,
29887,
371,
29922,
29873,
303,
1160,
29897,
13,
1678,
491,
29918,
1131,
21642,
353,
660,
29898,
27601,
2925,
1649,
1545,
2164,
1649,
29887,
371,
29922,
29873,
303,
1160,
29897,
13,
1678,
491,
29918,
12154,
29918,
978,
353,
660,
29898,
27601,
2925,
1649,
12154,
1649,
1545,
2164,
1649,
29887,
371,
29922,
29873,
303,
1160,
29897,
13,
1678,
396,
5097,
360,
9047,
28852,
6732,
4852,
5150,
1272,
29918,
1792,
29908,
1213,
333,
1159,
448,
3732,
445,
2346,
2189,
263,
3287,
8473,
29892,
13,
1678,
396,
541,
338,
6732,
16786,
15878,
411,
4918,
7979,
4176,
29991,
13,
1678,
736,
2346,
842,
29889,
4572,
29898,
1609,
29918,
1792,
891,
491,
29918,
1792,
29918,
12715,
891,
491,
29918,
12715,
29918,
978,
891,
491,
29918,
1131,
21642,
891,
491,
29918,
12154,
29918,
978,
467,
5721,
5562,
877,
333,
1495,
13,
13,
29871,
770,
20553,
29901,
13,
1678,
1904,
353,
4911,
13,
1678,
4235,
353,
6024,
6786,
742,
525,
27041,
742,
525,
2972,
742,
525,
15033,
29918,
271,
2033,
13,
13,
13,
1990,
4911,
1043,
2697,
29898,
1493,
7224,
29889,
3195,
1043,
2697,
1125,
13,
29871,
2346,
842,
353,
4911,
29889,
12650,
29889,
497,
2141,
5721,
5562,
580,
13,
29871,
7797,
3950,
29918,
1990,
353,
4911,
17679,
13,
29871,
396,
4175,
29918,
1627,
1975,
353,
313,
26705,
29889,
29928,
5364,
5072,
5841,
355,
29892,
29897,
13,
29871,
396,
5240,
8238,
15337,
5072,
5841,
355,
10583,
411,
16460,
362,
8898,
29889,
4803,
9557,
29918,
26705,
29889,
5060,
29918,
4468,
29889,
5072,
2697,
322,
29914,
272,
29871,
13,
29871,
396,
9557,
29918,
26705,
29889,
5060,
29918,
4468,
29889,
29928,
5364,
5072,
5841,
355,
2012,
29889,
396,
29945,
29906,
29955,
29941,
13,
29871,
396,
390,
29934,
29871,
29906,
29900,
29896,
29947,
29899,
29900,
29906,
29899,
29906,
29947,
13,
29871,
4175,
29918,
1627,
1975,
353,
313,
14095,
29918,
26705,
29889,
5060,
29918,
4468,
29889,
29928,
5364,
5072,
5841,
355,
29892,
29897,
13,
29871,
4175,
29918,
1990,
353,
4911,
5072,
13,
13,
29871,
822,
1051,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
1678,
565,
525,
29885,
4376,
2877,
29915,
297,
2009,
29889,
7194,
322,
2009,
29889,
7194,
1839,
29885,
4376,
2877,
13359,
13609,
580,
297,
518,
19672,
29918,
978,
29889,
13609,
580,
363,
9956,
29918,
978,
297,
6055,
29889,
20656,
29950,
29918,
5746,
4945,
29940,
1964,
29918,
29924,
3904,
2965,
5690,
1964,
11937,
29918,
29933,
22255,
4214,
29889,
8149,
580,
5387,
13,
418,
363,
9956,
29918,
978,
29892,
9956,
297,
6055,
29889,
20656,
29950,
29918,
5746,
4945,
29940,
1964,
29918,
29924,
3904,
2965,
5690,
1964,
11937,
29918,
29933,
22255,
4214,
29889,
1524,
7076,
7295,
13,
4706,
565,
9956,
29918,
978,
29889,
13609,
580,
1275,
2009,
29889,
7194,
1839,
29885,
4376,
2877,
13359,
13609,
7295,
13,
3986,
2752,
353,
6055,
29889,
20656,
29950,
29918,
5746,
4945,
29940,
1964,
29918,
27839,
27266,
29961,
19672,
29962,
13,
418,
1018,
29901,
13,
4706,
7834,
29918,
5453,
353,
1053,
1982,
29889,
5215,
29918,
5453,
29898,
4993,
29961,
29900,
2314,
13,
4706,
413,
353,
2752,
29961,
29906,
29962,
13,
4706,
7834,
353,
679,
5552,
29898,
13789,
29918,
5453,
29892,
2752,
29961,
29896,
2314,
29898,
1068,
29895,
29897,
13,
4706,
1404,
29918,
1272,
353,
7834,
29889,
657,
29918,
1792,
29918,
1272,
29898,
3827,
29897,
13,
4706,
25401,
29889,
8382,
11219,
1792,
7863,
848,
742,
4805,
3790,
29915,
1272,
2396,
11117,
1792,
29918,
1272,
2396,
2062,
29898,
1792,
29918,
1272,
21345,
29897,
13,
4706,
736,
13291,
29898,
1792,
29918,
1272,
29897,
13,
418,
5174,
16032,
2392,
408,
321,
29901,
13,
4706,
25401,
29889,
2704,
877,
23323,
451,
1053,
7029,
848,
2752,
742,
13,
18884,
4805,
3790,
29915,
1272,
2396,
11117,
2704,
2396,
29104,
29898,
29872,
21345,
29897,
13,
4706,
396,
14402,
29901,
1059,
11415,
13,
4706,
396,
4972,
1250,
304,
4226,
5314,
1556,
5517,
736,
4069,
13,
13,
1678,
736,
2428,
29898,
2659,
1043,
2697,
29892,
1583,
467,
1761,
29898,
3827,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
13,
1990,
23833,
1043,
2697,
29898,
1493,
7224,
29889,
6359,
11730,
3195,
1043,
2697,
1125,
13,
29871,
2346,
842,
353,
23833,
29889,
12650,
29889,
497,
580,
13,
29871,
7797,
3950,
29918,
1990,
353,
23833,
17679,
13,
13,
13,
1990,
4911,
6708,
5072,
29898,
14095,
29918,
26705,
29889,
5072,
2697,
1125,
13,
29871,
1404,
353,
9557,
29918,
26705,
29889,
5914,
5072,
29898,
978,
2433,
1792,
1649,
6786,
742,
16280,
29918,
13338,
2433,
735,
627,
1495,
13,
29871,
5352,
353,
9557,
29918,
26705,
29889,
5914,
5072,
29898,
978,
2433,
12715,
1649,
978,
742,
16280,
29918,
13338,
2433,
735,
627,
1495,
13,
13,
29871,
770,
20553,
29901,
13,
1678,
1904,
353,
4911,
6708,
13,
1678,
4235,
353,
6024,
1792,
742,
525,
12715,
2033,
13,
13,
13,
1990,
4911,
6708,
1043,
2697,
29898,
1493,
7224,
29889,
3195,
1043,
2697,
1125,
13,
29871,
2346,
842,
353,
4911,
6708,
29889,
12650,
29889,
4572,
29898,
18279,
29918,
271,
1649,
275,
4304,
29922,
5574,
29897,
13,
29871,
7797,
3950,
29918,
1990,
353,
4911,
6708,
17679,
13,
29871,
396,
4175,
29918,
1627,
1975,
353,
313,
26705,
29889,
29928,
5364,
5072,
5841,
355,
29892,
29897,
13,
29871,
396,
5240,
8238,
15337,
5072,
5841,
355,
10583,
411,
16460,
362,
8898,
29889,
4803,
9557,
29918,
26705,
29889,
5060,
29918,
4468,
29889,
5072,
2697,
322,
29914,
272,
29871,
13,
29871,
396,
9557,
29918,
26705,
29889,
5060,
29918,
4468,
29889,
29928,
5364,
5072,
5841,
355,
2012,
29889,
396,
29945,
29906,
29955,
29941,
13,
29871,
396,
390,
29934,
29871,
29906,
29900,
29896,
29947,
29899,
29900,
29906,
29899,
29906,
29947,
13,
29871,
4175,
29918,
1627,
1975,
353,
313,
14095,
29918,
26705,
29889,
5060,
29918,
4468,
29889,
29928,
5364,
5072,
5841,
355,
29892,
29897,
13,
13,
29871,
4175,
29918,
1990,
353,
4911,
6708,
5072,
13,
13,
29871,
822,
8174,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
1678,
396,
4911,
6708,
338,
7353,
3192,
408,
12708,
13,
1678,
5446,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
1678,
5446,
29889,
18279,
29918,
271,
353,
12865,
29889,
12673,
29889,
3707,
580,
13,
1678,
5446,
29889,
7620,
580,
13,
1678,
736,
13291,
29898,
4882,
29922,
29906,
29900,
29946,
29897,
13,
13,
13,
1990,
12813,
2877,
1043,
2697,
29898,
1493,
7224,
29889,
3195,
1043,
2697,
1125,
13,
29871,
2346,
842,
353,
12813,
2877,
29889,
12650,
29889,
497,
580,
13,
29871,
7797,
3950,
29918,
1990,
353,
12813,
2877,
17679,
13,
13,
13,
1990,
4523,
1043,
2697,
29898,
1493,
7224,
29889,
3195,
1043,
2697,
1125,
13,
29871,
2346,
842,
353,
4523,
29889,
12650,
29889,
497,
580,
13,
29871,
7797,
3950,
29918,
1990,
353,
4523,
17679,
13,
13,
13,
1990,
1528,
280,
1043,
2697,
29898,
1493,
7224,
29889,
6359,
11730,
3195,
1043,
2697,
1125,
13,
29871,
2346,
842,
353,
1528,
280,
29889,
12650,
29889,
497,
580,
13,
29871,
7797,
3950,
29918,
1990,
353,
1528,
280,
17679,
13,
13,
13,
1990,
6212,
21642,
1043,
2697,
29898,
1493,
7224,
29889,
3195,
1043,
2697,
1125,
13,
29871,
2346,
842,
353,
6212,
21642,
29889,
12650,
29889,
497,
580,
13,
29871,
7797,
3950,
29918,
1990,
353,
6212,
21642,
17679,
13,
13,
29937,
325,
326,
29901,
4434,
9847,
29922,
29906,
7985,
3891,
9500,
2103,
29922,
29906,
4964,
3891,
9847,
29922,
29906,
13,
13,
2
] |
CDARTS_segmentation/segmentation/data/samplers/distributed_sampler.py | penghouwen/CDARTS | 21 | 194745 | <reponame>penghouwen/CDARTS
# ------------------------------------------------------------------------------
# Reference: https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/samplers/distributed_sampler.py
# Modified by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
import itertools
import math
from collections import defaultdict
from typing import Optional
import torch
from torch.utils.data.sampler import Sampler
from segmentation.utils import comm
class TrainingSampler(Sampler):
"""
In training, we only care about the "infinite stream" of training data.
So this sampler produces an infinite stream of indices and
all workers cooperate to correctly shuffle the indices and sample different indices.
The samplers in each worker effectively produces `indices[worker_id::num_workers]`
where `indices` is an infinite stream of indices consisting of
`shuffle(range(size)) + shuffle(range(size)) + ...` (if shuffle is True)
or `range(size) + range(size) + ...` (if shuffle is False)
"""
def __init__(self, size, shuffle=True, seed=None):
"""
Args:
size (int): the total number of data of the underlying dataset to sample from
shuffle (bool): whether to shuffle the indices or not
seed (int): the initial seed of the shuffle. Must be the same
across all workers. If None, will use a random seed shared
among workers (require synchronization among all workers).
"""
self._size = size
assert size > 0
self._shuffle = shuffle
if seed is None:
seed = comm.shared_random_seed()
self._seed = int(seed)
self._rank = comm.get_rank()
self._world_size = comm.get_world_size()
def __iter__(self):
start = self._rank
yield from itertools.islice(self._infinite_indices(), start, None, self._world_size)
def __len__(self):
return self._size
def _infinite_indices(self):
g = torch.Generator()
g.manual_seed(self._seed)
while True:
if self._shuffle:
yield from torch.randperm(self._size, generator=g)
else:
yield from torch.arange(self._size)
class InferenceSampler(Sampler):
"""
Produce indices for inference.
Inference needs to run on the __exact__ set of samples,
therefore when the total number of samples is not divisible by the number of workers,
this sampler produces different number of samples on different workers.
"""
def __init__(self, size):
"""
Args:
size (int): the total number of data of the underlying dataset to sample from
"""
self._size = size
assert size > 0
self._rank = comm.get_rank()
self._world_size = comm.get_world_size()
shard_size = (self._size - 1) // self._world_size + 1
begin = shard_size * self._rank
end = min(shard_size * (self._rank + 1), self._size)
self._local_indices = range(begin, end)
def __iter__(self):
yield from self._local_indices
def __len__(self):
return len(self._local_indices)
| [
1,
529,
276,
1112,
420,
29958,
29886,
996,
29882,
21630,
29914,
6530,
8322,
29903,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
29937,
12105,
29901,
2045,
597,
3292,
29889,
510,
29914,
15445,
690,
2842,
29914,
4801,
522,
1617,
29906,
29914,
10054,
29914,
6207,
29914,
4801,
522,
1617,
29906,
29914,
1272,
29914,
13445,
572,
414,
29914,
5721,
7541,
29918,
13445,
20069,
29889,
2272,
13,
29937,
3382,
2164,
491,
529,
5813,
29958,
313,
29966,
26862,
6227,
12948,
13,
29937,
448,
2683,
2683,
2683,
2683,
9072,
29899,
13,
13,
5215,
4256,
8504,
13,
5215,
5844,
13,
3166,
16250,
1053,
2322,
8977,
13,
3166,
19229,
1053,
28379,
13,
5215,
4842,
305,
13,
3166,
4842,
305,
29889,
13239,
29889,
1272,
29889,
13445,
20069,
1053,
3685,
20069,
13,
13,
3166,
10768,
362,
29889,
13239,
1053,
844,
13,
13,
13,
1990,
26101,
22966,
20069,
29898,
22966,
20069,
1125,
13,
1678,
9995,
13,
1678,
512,
6694,
29892,
591,
871,
2562,
1048,
278,
376,
262,
18925,
4840,
29908,
310,
6694,
848,
29889,
13,
1678,
1105,
445,
3514,
20069,
13880,
385,
10362,
4840,
310,
16285,
322,
13,
1678,
599,
17162,
1302,
3372,
403,
304,
5149,
528,
21897,
278,
16285,
322,
4559,
1422,
16285,
29889,
13,
1678,
450,
3514,
572,
414,
297,
1269,
15645,
17583,
13880,
421,
513,
1575,
29961,
24602,
29918,
333,
1057,
1949,
29918,
1287,
414,
7961,
13,
1678,
988,
421,
513,
1575,
29952,
338,
385,
10362,
4840,
310,
16285,
19849,
310,
13,
1678,
421,
845,
21897,
29898,
3881,
29898,
2311,
876,
718,
528,
21897,
29898,
3881,
29898,
2311,
876,
718,
2023,
29952,
313,
361,
528,
21897,
338,
5852,
29897,
13,
1678,
470,
421,
3881,
29898,
2311,
29897,
718,
3464,
29898,
2311,
29897,
718,
2023,
29952,
313,
361,
528,
21897,
338,
7700,
29897,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2159,
29892,
528,
21897,
29922,
5574,
29892,
16717,
29922,
8516,
1125,
13,
4706,
9995,
13,
4706,
826,
3174,
29901,
13,
9651,
2159,
313,
524,
1125,
278,
3001,
1353,
310,
848,
310,
278,
14407,
8783,
304,
4559,
515,
13,
9651,
528,
21897,
313,
11227,
1125,
3692,
304,
528,
21897,
278,
16285,
470,
451,
13,
9651,
16717,
313,
524,
1125,
278,
2847,
16717,
310,
278,
528,
21897,
29889,
19928,
367,
278,
1021,
13,
18884,
4822,
599,
17162,
29889,
960,
6213,
29892,
674,
671,
263,
4036,
16717,
7258,
13,
18884,
4249,
17162,
313,
12277,
12231,
2133,
4249,
599,
17162,
467,
13,
4706,
9995,
13,
4706,
1583,
3032,
2311,
353,
2159,
13,
4706,
4974,
2159,
1405,
29871,
29900,
13,
4706,
1583,
3032,
845,
21897,
353,
528,
21897,
13,
4706,
565,
16717,
338,
6213,
29901,
13,
9651,
16717,
353,
844,
29889,
12366,
29918,
8172,
29918,
26776,
580,
13,
4706,
1583,
3032,
26776,
353,
938,
29898,
26776,
29897,
13,
13,
4706,
1583,
3032,
10003,
353,
844,
29889,
657,
29918,
10003,
580,
13,
4706,
1583,
3032,
11526,
29918,
2311,
353,
844,
29889,
657,
29918,
11526,
29918,
2311,
580,
13,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
1369,
353,
1583,
3032,
10003,
13,
4706,
7709,
515,
4256,
8504,
29889,
275,
5897,
29898,
1311,
3032,
262,
18925,
29918,
513,
1575,
3285,
1369,
29892,
6213,
29892,
1583,
3032,
11526,
29918,
2311,
29897,
13,
13,
1678,
822,
4770,
2435,
12035,
1311,
1125,
13,
4706,
736,
1583,
3032,
2311,
13,
13,
1678,
822,
903,
262,
18925,
29918,
513,
1575,
29898,
1311,
1125,
13,
4706,
330,
353,
4842,
305,
29889,
21575,
580,
13,
4706,
330,
29889,
11288,
29918,
26776,
29898,
1311,
3032,
26776,
29897,
13,
4706,
1550,
5852,
29901,
13,
9651,
565,
1583,
3032,
845,
21897,
29901,
13,
18884,
7709,
515,
4842,
305,
29889,
9502,
17858,
29898,
1311,
3032,
2311,
29892,
15299,
29922,
29887,
29897,
13,
9651,
1683,
29901,
13,
18884,
7709,
515,
4842,
305,
29889,
279,
927,
29898,
1311,
3032,
2311,
29897,
13,
13,
13,
1990,
512,
1659,
22966,
20069,
29898,
22966,
20069,
1125,
13,
1678,
9995,
13,
1678,
7138,
346,
16285,
363,
27262,
29889,
13,
1678,
512,
1659,
4225,
304,
1065,
373,
278,
4770,
735,
627,
1649,
731,
310,
11916,
29892,
13,
1678,
5480,
746,
278,
3001,
1353,
310,
11916,
338,
451,
8572,
1821,
491,
278,
1353,
310,
17162,
29892,
13,
1678,
445,
3514,
20069,
13880,
1422,
1353,
310,
11916,
373,
1422,
17162,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2159,
1125,
13,
4706,
9995,
13,
4706,
826,
3174,
29901,
13,
9651,
2159,
313,
524,
1125,
278,
3001,
1353,
310,
848,
310,
278,
14407,
8783,
304,
4559,
515,
13,
4706,
9995,
13,
4706,
1583,
3032,
2311,
353,
2159,
13,
4706,
4974,
2159,
1405,
29871,
29900,
13,
4706,
1583,
3032,
10003,
353,
844,
29889,
657,
29918,
10003,
580,
13,
4706,
1583,
3032,
11526,
29918,
2311,
353,
844,
29889,
657,
29918,
11526,
29918,
2311,
580,
13,
13,
4706,
528,
538,
29918,
2311,
353,
313,
1311,
3032,
2311,
448,
29871,
29896,
29897,
849,
1583,
3032,
11526,
29918,
2311,
718,
29871,
29896,
13,
4706,
3380,
353,
528,
538,
29918,
2311,
334,
1583,
3032,
10003,
13,
4706,
1095,
353,
1375,
29898,
845,
538,
29918,
2311,
334,
313,
1311,
3032,
10003,
718,
29871,
29896,
511,
1583,
3032,
2311,
29897,
13,
4706,
1583,
3032,
2997,
29918,
513,
1575,
353,
3464,
29898,
463,
29892,
1095,
29897,
13,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
7709,
515,
1583,
3032,
2997,
29918,
513,
1575,
13,
13,
1678,
822,
4770,
2435,
12035,
1311,
1125,
13,
4706,
736,
7431,
29898,
1311,
3032,
2997,
29918,
513,
1575,
29897,
13,
2
] |
src/NodeGenerators/GenerateNodeProfile.py | jmikeowen/Spheral | 22 | 160459 | from math import *
import numpy as np
from NodeGeneratorBase import *
from Spheral import (Vector1d, Tensor1d, SymTensor1d,
Vector2d, Tensor2d, SymTensor2d, rotationMatrix2d, testPointInBox2d,
Vector3d, Tensor3d, SymTensor3d, rotationMatrix3d, testPointInBox3d)
from SpheralTestUtilities import fuzzyEqual
#-------------------------------------------------------------------------------
# Class to generate 1-D node positions for a fixed node mass to fit the given
# density profile in a range (xmin, xmax).
#-------------------------------------------------------------------------------
class GenerateNodeProfile1d(NodeGeneratorBase):
#---------------------------------------------------------------------------
# Constructor
#---------------------------------------------------------------------------
def __init__(self,
nx, # number of points to generate
rho, # density profile
xmin,
xmax,
nNodePerh = 2.01,
numbins = 10000):
assert nx > 0
assert xmin < xmax
assert nNodePerh > 0.0
# If the user provided a constant for rho, then use the constantRho
# class to provide this value.
if type(rho) == type(1.0):
self.rhofunc = ConstantRho(rho)
# In the constant rho case, no need to kill ourselves figuring out complicated fits...
dx = (xmax - xmin)/nx
mi = dx*rho
self.x = [xmin + (i+0.5)*dx for i in xrange(nx)]
self.H = [SymTensor1d(1.0/(nNodePerh*dx)) for i in xrange(nx)]
self.m = [mi]*nx
self.rho = [rho]*nx
else:
self.rhofunc = rho
# Build the evenly sampled cumulative mass as a function of position.
ok = False
while not ok:
dx = (xmax - xmin)/numbins
mcum = np.cumsum(np.array([0.0] + [0.5*dx*(self.rhofunc(xmin + i*dx) + self.rhofunc(xmin + (i + 1)*dx)) for i in xrange(numbins)]))
# Find the target mass per node.
mi = mcum[-1]/nx
# Do we need to have a finer binning?
if mcum[-1]/mi > 0.5*numbins:
numbins = int(2*mcum[-1]/mi)
print "Warning, boosting numbins to %i to increase mass resolution for interpolation" % numbins
else:
ok = True
# Now go through and bisect for positions to get the mass per point we want.
xi = xmin
self.x = []
self.rho = []
mtarget = -0.5*mi
while xi < xmax:
mtarget += mi
if mtarget <= mcum[-1]:
i = np.searchsorted(mcum, mtarget) - 1
assert mtarget >= mcum[i] and mtarget <= mcum[i+1]
xi = xmin + (i + (mtarget - mcum[i])/(mcum[i+1] - mcum[i]))*dx
assert (xi >= xmin + i*dx) and (xi <= xmin + (i+1)*dx)
self.x.append(xi)
self.rho.append(self.rhofunc(xi))
else:
xi = xmax
n = len(self.x)
print "Generated %i 1D points." % n
self.m = [mi]*n
# Figure out the H.
self.H = []
for i in xrange(n):
if i == 0:
dxavg = self.x[i+1] - self.x[i]
elif i == n-1:
dxavg = self.x[i] - self.x[i-1]
else:
dxavg = 0.5*(self.x[i+1] - self.x[i-1])
self.H.append(SymTensor1d(1.0/(nNodePerh*dxavg)))
# Have the base class break up the serial node distribution
# for parallel cases.
NodeGeneratorBase.__init__(self, True,
self.x, self.m, self.rho, self.H)
return
#---------------------------------------------------------------------------
# Get the position for the given node index.
#---------------------------------------------------------------------------
def localPosition(self, i):
assert i >= 0 and i < len(self.x)
return Vector1d(self.x[i])
#---------------------------------------------------------------------------
# Get the mass for the given node index.
#---------------------------------------------------------------------------
def localMass(self, i):
assert i >= 0 and i < len(self.m)
return self.m[i]
#---------------------------------------------------------------------------
# Get the mass density for the given node index.
#---------------------------------------------------------------------------
def localMassDensity(self, i):
assert i >= 0 and i < len(self.x)
return self.rho[i]
#---------------------------------------------------------------------------
# Get the H tensor for the given node index.
#---------------------------------------------------------------------------
def localHtensor(self, i):
assert i >= 0 and i < len(self.H)
return self.H[i]
#-------------------------------------------------------------------------------
# Similarly generate a 1D profile in 2D along the x-direction.
#-------------------------------------------------------------------------------
class GeneratePlanarNodeProfile2d(NodeGeneratorBase):
#---------------------------------------------------------------------------
# Constructor
#---------------------------------------------------------------------------
def __init__(self,
nx, # target number of points in x
ny, # target number of points in y
rho, # density profile, must be 1D function
xmin, # (xmin, ymin) coordinates
xmax, # (xmax, ymax) coordinates
nNodePerh = 2.01,
numbins = 10000,
SPH = False):
assert nx > 0
assert ny > 0
assert xmin[0] < xmax[0]
assert xmin[1] < xmax[1]
assert nNodePerh > 0.0
# First use the 1D generator to generate a 1D slice profile along x.
gen1d = GenerateNodeProfile1d(nx = nx,
rho = rho,
xmin = xmin[0],
xmax = xmax[0],
nNodePerh = nNodePerh,
numbins = numbins)
# Stitch the 1D profiles back into serial data.
gen1d.x = mpi.allreduce(gen1d.x, mpi.SUM)
gen1d.m = mpi.allreduce(gen1d.m, mpi.SUM)
gen1d.rho = mpi.allreduce(gen1d.rho, mpi.SUM)
gen1d.H = mpi.allreduce(gen1d.H, mpi.SUM)
n1d = len(gen1d.x)
# Replicate the 1D slices into the full 2D data.
self.x = []
self.y = []
self.m = []
self.rho = []
self.H = []
dy = (xmax[1] - xmin[1])/ny
hyinv = 1.0/(nNodePerh*dy)
for iy in xrange(ny):
self.x += gen1d.x
self.y += [xmin[1] + (iy + 0.5)*dy]*n1d
self.m += [mi*(xmax[1] - xmin[1])/ny for mi in gen1d.m]
self.rho += gen1d.rho
self.H += [SymTensor2d(H1d.xx, 0.0, 0.0, hyinv) for H1d in gen1d.H]
# Have the base class break up the serial node distribution
# for parallel cases.
NodeGeneratorBase.__init__(self, True,
self.x, self.y, self.m, self.rho, self.H)
# If we're forcing round H tensors, do it.
if SPH:
self.makeHround()
return
#---------------------------------------------------------------------------
# Get the position for the given node index.
#---------------------------------------------------------------------------
def localPosition(self, i):
assert i >= 0 and i < len(self.x)
assert len(self.x) == len(self.y)
return Vector2d(self.x[i], self.y[i])
#---------------------------------------------------------------------------
# Get the mass for the given node index.
#---------------------------------------------------------------------------
def localMass(self, i):
assert i >= 0 and i < len(self.m)
return self.m[i]
#---------------------------------------------------------------------------
# Get the mass density for the given node index.
#---------------------------------------------------------------------------
def localMassDensity(self, i):
assert i >= 0 and i < len(self.x)
return self.rho[i]
#---------------------------------------------------------------------------
# Get the H tensor for the given node index.
#---------------------------------------------------------------------------
def localHtensor(self, i):
assert i >= 0 and i < len(self.H)
return self.H[i]
#-------------------------------------------------------------------------------
# Similarly generate a 1D profile in 3D along the x-direction.
#-------------------------------------------------------------------------------
class GeneratePlanarNodeProfile3d(NodeGeneratorBase):
#---------------------------------------------------------------------------
# Constructor
#---------------------------------------------------------------------------
def __init__(self,
nx, # target number of points in x
ny, # target number of points in y
nz, # target number of points in z
rho, # density profile, must be 1D function
xmin, # (xmin, ymin, zmin) coordinates
xmax, # (xmax, ymax, zmax) coordinates
nNodePerh = 2.01,
numbins = 10000,
SPH = False):
assert nx > 0
assert ny > 0
assert nz > 0
assert xmin[0] < xmax[0]
assert xmin[1] < xmax[1]
assert xmin[2] < xmax[2]
assert nNodePerh > 0.0
# First use the 1D generator to generate a 1D slice profile along x.
gen1d = GenerateNodeProfile1d(nx = nx,
rho = rho,
xmin = xmin[0],
xmax = xmax[0],
nNodePerh = nNodePerh,
numbins = numbins)
# Stitch the 1D profiles back into serial data.
gen1d.x = mpi.allreduce(gen1d.x, mpi.SUM)
gen1d.m = mpi.allreduce(gen1d.m, mpi.SUM)
gen1d.rho = mpi.allreduce(gen1d.rho, mpi.SUM)
gen1d.H = mpi.allreduce(gen1d.H, mpi.SUM)
n1d = len(gen1d.x)
# Replicate the 1D slices into the full 3D data.
self.x = []
self.y = []
self.z = []
self.m = []
self.rho = []
self.H = []
dy = (xmax[1] - xmin[1])/ny
dz = (xmax[2] - xmin[2])/nz
hyinv = 1.0/(nNodePerh*dy)
hzinv = 1.0/(nNodePerh*dz)
for iz in xrange(nz):
for iy in xrange(ny):
self.x += gen1d.x
self.y += [xmin[1] + (iy + 0.5)*dy]*n1d
self.z += [xmin[2] + (iz + 0.5)*dz]*n1d
self.m += [mi*(xmax[1] - xmin[1])*(xmax[2] - xmin[2])/(ny*nz) for mi in gen1d.m]
self.rho += gen1d.rho
self.H += [SymTensor3d(H1d.xx, 0.0, 0.0,
0.0, hyinv, 0.0,
0.0, 0.0, hzinv) for H1d in gen1d.H]
# Have the base class break up the serial node distribution
# for parallel cases.
NodeGeneratorBase.__init__(self, True,
self.x, self.y, self.z, self.m, self.rho, self.H)
# If we're forcing round H tensors, do it.
if SPH:
self.makeHround()
return
#---------------------------------------------------------------------------
# Get the position for the given node index.
#---------------------------------------------------------------------------
def localPosition(self, i):
assert i >= 0 and i < len(self.x)
assert len(self.x) == len(self.y)
assert len(self.x) == len(self.z)
return Vector3d(self.x[i], self.y[i], self.z[i])
#---------------------------------------------------------------------------
# Get the mass for the given node index.
#---------------------------------------------------------------------------
def localMass(self, i):
assert i >= 0 and i < len(self.m)
return self.m[i]
#---------------------------------------------------------------------------
# Get the mass density for the given node index.
#---------------------------------------------------------------------------
def localMassDensity(self, i):
assert i >= 0 and i < len(self.x)
return self.rho[i]
#---------------------------------------------------------------------------
# Get the H tensor for the given node index.
#---------------------------------------------------------------------------
def localHtensor(self, i):
assert i >= 0 and i < len(self.H)
return self.H[i]
| [
1,
515,
5844,
1053,
334,
13,
5215,
12655,
408,
7442,
13,
13,
3166,
9071,
21575,
5160,
1053,
334,
13,
13,
3166,
317,
8096,
284,
1053,
313,
12877,
29896,
29881,
29892,
323,
6073,
29896,
29881,
29892,
10667,
29911,
6073,
29896,
29881,
29892,
13,
462,
268,
16510,
29906,
29881,
29892,
323,
6073,
29906,
29881,
29892,
10667,
29911,
6073,
29906,
29881,
29892,
13733,
14609,
29906,
29881,
29892,
1243,
5228,
797,
3313,
29906,
29881,
29892,
13,
462,
268,
16510,
29941,
29881,
29892,
323,
6073,
29941,
29881,
29892,
10667,
29911,
6073,
29941,
29881,
29892,
13733,
14609,
29941,
29881,
29892,
1243,
5228,
797,
3313,
29941,
29881,
29897,
13,
3166,
317,
8096,
284,
3057,
7270,
1907,
1053,
285,
3365,
1537,
9843,
13,
13,
29937,
2683,
2683,
2683,
2683,
9072,
5634,
13,
29937,
4134,
304,
5706,
29871,
29896,
29899,
29928,
2943,
11909,
363,
263,
4343,
2943,
4158,
304,
6216,
278,
2183,
13,
29937,
9027,
8722,
297,
263,
3464,
313,
29916,
1195,
29892,
921,
3317,
467,
13,
29937,
2683,
2683,
2683,
2683,
9072,
5634,
13,
1990,
3251,
403,
4247,
13909,
29896,
29881,
29898,
4247,
21575,
5160,
1125,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
1281,
18769,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
302,
29916,
29892,
462,
396,
1353,
310,
3291,
304,
5706,
13,
462,
364,
1251,
29892,
18884,
396,
9027,
8722,
13,
462,
921,
1195,
29892,
13,
462,
921,
3317,
29892,
13,
462,
302,
4247,
5894,
29882,
353,
29871,
29906,
29889,
29900,
29896,
29892,
13,
462,
954,
29890,
1144,
353,
29871,
29896,
29900,
29900,
29900,
29900,
1125,
13,
13,
4706,
4974,
302,
29916,
1405,
29871,
29900,
13,
4706,
4974,
921,
1195,
529,
921,
3317,
13,
4706,
4974,
302,
4247,
5894,
29882,
1405,
29871,
29900,
29889,
29900,
13,
13,
4706,
396,
960,
278,
1404,
4944,
263,
4868,
363,
364,
1251,
29892,
769,
671,
278,
4868,
29934,
1251,
13,
4706,
396,
770,
304,
3867,
445,
995,
29889,
13,
4706,
565,
1134,
29898,
4650,
29897,
1275,
1134,
29898,
29896,
29889,
29900,
1125,
13,
9651,
1583,
29889,
29878,
8782,
4661,
353,
28601,
29934,
1251,
29898,
4650,
29897,
13,
13,
9651,
396,
512,
278,
4868,
364,
1251,
1206,
29892,
694,
817,
304,
12088,
20278,
2537,
3864,
714,
12092,
23994,
856,
13,
9651,
15414,
353,
313,
29916,
3317,
448,
921,
1195,
6802,
23818,
13,
9651,
3737,
353,
15414,
29930,
4650,
13,
9651,
1583,
29889,
29916,
353,
518,
29916,
1195,
718,
313,
29875,
29974,
29900,
29889,
29945,
11877,
8235,
363,
474,
297,
921,
3881,
29898,
23818,
4638,
13,
9651,
1583,
29889,
29950,
353,
518,
25548,
29911,
6073,
29896,
29881,
29898,
29896,
29889,
29900,
14571,
29876,
4247,
5894,
29882,
29930,
8235,
876,
363,
474,
297,
921,
3881,
29898,
23818,
4638,
13,
9651,
1583,
29889,
29885,
353,
518,
2460,
14178,
23818,
13,
9651,
1583,
29889,
4650,
353,
518,
4650,
14178,
23818,
13,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
29878,
8782,
4661,
353,
364,
1251,
13,
13,
9651,
396,
8878,
278,
1584,
368,
4559,
29881,
13299,
28524,
4158,
408,
263,
740,
310,
2602,
29889,
13,
9651,
3431,
353,
7700,
13,
9651,
1550,
451,
3431,
29901,
13,
18884,
15414,
353,
313,
29916,
3317,
448,
921,
1195,
6802,
1949,
29890,
1144,
13,
18884,
286,
29883,
398,
353,
7442,
29889,
29883,
398,
2083,
29898,
9302,
29889,
2378,
4197,
29900,
29889,
29900,
29962,
718,
518,
29900,
29889,
29945,
29930,
8235,
16395,
1311,
29889,
29878,
8782,
4661,
29898,
29916,
1195,
718,
474,
29930,
8235,
29897,
718,
1583,
29889,
29878,
8782,
4661,
29898,
29916,
1195,
718,
313,
29875,
718,
29871,
29896,
11877,
8235,
876,
363,
474,
297,
921,
3881,
29898,
1949,
29890,
1144,
4638,
876,
13,
13,
18884,
396,
10987,
278,
3646,
4158,
639,
2943,
29889,
13,
18884,
3737,
353,
286,
29883,
398,
14352,
29896,
16261,
23818,
13,
13,
18884,
396,
1938,
591,
817,
304,
505,
263,
1436,
261,
9016,
1076,
29973,
13,
18884,
565,
286,
29883,
398,
14352,
29896,
16261,
2460,
1405,
29871,
29900,
29889,
29945,
29930,
1949,
29890,
1144,
29901,
13,
462,
1678,
954,
29890,
1144,
353,
938,
29898,
29906,
29930,
14047,
398,
14352,
29896,
16261,
2460,
29897,
13,
462,
1678,
1596,
376,
22709,
29892,
14505,
292,
954,
29890,
1144,
304,
1273,
29875,
304,
7910,
4158,
10104,
363,
29694,
29908,
1273,
954,
29890,
1144,
13,
18884,
1683,
29901,
13,
462,
1678,
3431,
353,
5852,
13,
13,
9651,
396,
2567,
748,
1549,
322,
2652,
522,
363,
11909,
304,
679,
278,
4158,
639,
1298,
591,
864,
29889,
13,
9651,
921,
29875,
353,
921,
1195,
13,
9651,
1583,
29889,
29916,
353,
5159,
13,
9651,
1583,
29889,
4650,
353,
5159,
13,
9651,
286,
5182,
353,
448,
29900,
29889,
29945,
29930,
2460,
13,
9651,
1550,
921,
29875,
529,
921,
3317,
29901,
13,
18884,
286,
5182,
4619,
3737,
13,
18884,
565,
286,
5182,
5277,
286,
29883,
398,
14352,
29896,
5387,
13,
462,
1678,
474,
353,
7442,
29889,
4478,
24582,
29898,
14047,
398,
29892,
286,
5182,
29897,
448,
29871,
29896,
13,
462,
1678,
4974,
286,
5182,
6736,
286,
29883,
398,
29961,
29875,
29962,
322,
286,
5182,
5277,
286,
29883,
398,
29961,
29875,
29974,
29896,
29962,
13,
462,
1678,
921,
29875,
353,
921,
1195,
718,
313,
29875,
718,
313,
4378,
2097,
448,
286,
29883,
398,
29961,
29875,
2314,
14571,
14047,
398,
29961,
29875,
29974,
29896,
29962,
448,
286,
29883,
398,
29961,
29875,
12622,
29930,
8235,
13,
462,
1678,
4974,
313,
5389,
6736,
921,
1195,
718,
474,
29930,
8235,
29897,
322,
313,
5389,
5277,
921,
1195,
718,
313,
29875,
29974,
29896,
11877,
8235,
29897,
13,
462,
1678,
1583,
29889,
29916,
29889,
4397,
29898,
5389,
29897,
13,
462,
1678,
1583,
29889,
4650,
29889,
4397,
29898,
1311,
29889,
29878,
8782,
4661,
29898,
5389,
876,
13,
18884,
1683,
29901,
13,
462,
1678,
921,
29875,
353,
921,
3317,
13,
9651,
302,
353,
7431,
29898,
1311,
29889,
29916,
29897,
13,
9651,
1596,
376,
24565,
1273,
29875,
29871,
29896,
29928,
3291,
1213,
1273,
302,
13,
9651,
1583,
29889,
29885,
353,
518,
2460,
14178,
29876,
13,
13,
9651,
396,
11479,
714,
278,
379,
29889,
13,
9651,
1583,
29889,
29950,
353,
5159,
13,
9651,
363,
474,
297,
921,
3881,
29898,
29876,
1125,
13,
18884,
565,
474,
1275,
29871,
29900,
29901,
13,
462,
1678,
15414,
485,
29887,
353,
1583,
29889,
29916,
29961,
29875,
29974,
29896,
29962,
448,
1583,
29889,
29916,
29961,
29875,
29962,
13,
18884,
25342,
474,
1275,
302,
29899,
29896,
29901,
13,
462,
1678,
15414,
485,
29887,
353,
1583,
29889,
29916,
29961,
29875,
29962,
448,
1583,
29889,
29916,
29961,
29875,
29899,
29896,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
15414,
485,
29887,
353,
29871,
29900,
29889,
29945,
16395,
1311,
29889,
29916,
29961,
29875,
29974,
29896,
29962,
448,
1583,
29889,
29916,
29961,
29875,
29899,
29896,
2314,
13,
18884,
1583,
29889,
29950,
29889,
4397,
29898,
25548,
29911,
6073,
29896,
29881,
29898,
29896,
29889,
29900,
14571,
29876,
4247,
5894,
29882,
29930,
8235,
485,
29887,
4961,
13,
13,
4706,
396,
6975,
278,
2967,
770,
2867,
701,
278,
7797,
2943,
4978,
13,
4706,
396,
363,
8943,
4251,
29889,
13,
4706,
9071,
21575,
5160,
17255,
2344,
12035,
1311,
29892,
5852,
29892,
13,
462,
462,
259,
1583,
29889,
29916,
29892,
1583,
29889,
29885,
29892,
1583,
29889,
4650,
29892,
1583,
29889,
29950,
29897,
13,
13,
4706,
736,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
2602,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
8003,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29916,
29897,
13,
4706,
736,
16510,
29896,
29881,
29898,
1311,
29889,
29916,
29961,
29875,
2314,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
4158,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
29924,
465,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29885,
29897,
13,
4706,
736,
1583,
29889,
29885,
29961,
29875,
29962,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
4158,
9027,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
29924,
465,
29928,
575,
537,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29916,
29897,
13,
4706,
736,
1583,
29889,
4650,
29961,
29875,
29962,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
379,
12489,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
29950,
20158,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29950,
29897,
13,
4706,
736,
1583,
29889,
29950,
29961,
29875,
29962,
13,
13,
29937,
2683,
2683,
2683,
2683,
9072,
5634,
13,
29937,
20175,
5706,
263,
29871,
29896,
29928,
8722,
297,
29871,
29906,
29928,
3412,
278,
921,
29899,
20845,
29889,
13,
29937,
2683,
2683,
2683,
2683,
9072,
5634,
13,
1990,
3251,
403,
20334,
279,
4247,
13909,
29906,
29881,
29898,
4247,
21575,
5160,
1125,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
1281,
18769,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
302,
29916,
29892,
462,
396,
3646,
1353,
310,
3291,
297,
921,
13,
462,
7098,
29892,
462,
396,
3646,
1353,
310,
3291,
297,
343,
13,
462,
364,
1251,
29892,
18884,
396,
9027,
8722,
29892,
1818,
367,
29871,
29896,
29928,
740,
13,
462,
921,
1195,
29892,
1669,
396,
313,
29916,
1195,
29892,
343,
1195,
29897,
10350,
13,
462,
921,
3317,
29892,
1669,
396,
313,
29916,
3317,
29892,
343,
3317,
29897,
10350,
13,
462,
302,
4247,
5894,
29882,
353,
29871,
29906,
29889,
29900,
29896,
29892,
13,
462,
954,
29890,
1144,
353,
29871,
29896,
29900,
29900,
29900,
29900,
29892,
13,
462,
10937,
29950,
353,
7700,
1125,
13,
13,
4706,
4974,
302,
29916,
1405,
29871,
29900,
13,
4706,
4974,
7098,
1405,
29871,
29900,
13,
4706,
4974,
921,
1195,
29961,
29900,
29962,
529,
921,
3317,
29961,
29900,
29962,
13,
4706,
4974,
921,
1195,
29961,
29896,
29962,
529,
921,
3317,
29961,
29896,
29962,
13,
4706,
4974,
302,
4247,
5894,
29882,
1405,
29871,
29900,
29889,
29900,
13,
13,
4706,
396,
3824,
671,
278,
29871,
29896,
29928,
15299,
304,
5706,
263,
29871,
29896,
29928,
22780,
8722,
3412,
921,
29889,
13,
4706,
2531,
29896,
29881,
353,
3251,
403,
4247,
13909,
29896,
29881,
29898,
23818,
353,
302,
29916,
29892,
13,
462,
462,
418,
364,
1251,
353,
364,
1251,
29892,
13,
462,
462,
418,
921,
1195,
353,
921,
1195,
29961,
29900,
1402,
13,
462,
462,
418,
921,
3317,
353,
921,
3317,
29961,
29900,
1402,
13,
462,
462,
418,
302,
4247,
5894,
29882,
353,
302,
4247,
5894,
29882,
29892,
13,
462,
462,
418,
954,
29890,
1144,
353,
954,
29890,
1144,
29897,
13,
13,
4706,
396,
624,
2335,
278,
29871,
29896,
29928,
28723,
1250,
964,
7797,
848,
29889,
13,
4706,
2531,
29896,
29881,
29889,
29916,
353,
286,
1631,
29889,
497,
17469,
29898,
1885,
29896,
29881,
29889,
29916,
29892,
286,
1631,
29889,
25021,
29897,
13,
4706,
2531,
29896,
29881,
29889,
29885,
353,
286,
1631,
29889,
497,
17469,
29898,
1885,
29896,
29881,
29889,
29885,
29892,
286,
1631,
29889,
25021,
29897,
13,
4706,
2531,
29896,
29881,
29889,
4650,
353,
286,
1631,
29889,
497,
17469,
29898,
1885,
29896,
29881,
29889,
4650,
29892,
286,
1631,
29889,
25021,
29897,
13,
4706,
2531,
29896,
29881,
29889,
29950,
353,
286,
1631,
29889,
497,
17469,
29898,
1885,
29896,
29881,
29889,
29950,
29892,
286,
1631,
29889,
25021,
29897,
13,
4706,
302,
29896,
29881,
353,
7431,
29898,
1885,
29896,
29881,
29889,
29916,
29897,
13,
13,
4706,
396,
10088,
5926,
278,
29871,
29896,
29928,
269,
29399,
964,
278,
2989,
29871,
29906,
29928,
848,
29889,
13,
4706,
1583,
29889,
29916,
353,
5159,
13,
4706,
1583,
29889,
29891,
353,
5159,
13,
4706,
1583,
29889,
29885,
353,
5159,
13,
4706,
1583,
29889,
4650,
353,
5159,
13,
4706,
1583,
29889,
29950,
353,
5159,
13,
4706,
13475,
353,
313,
29916,
3317,
29961,
29896,
29962,
448,
921,
1195,
29961,
29896,
2314,
29914,
1460,
13,
4706,
7498,
11569,
353,
29871,
29896,
29889,
29900,
14571,
29876,
4247,
5894,
29882,
29930,
4518,
29897,
13,
4706,
363,
474,
29891,
297,
921,
3881,
29898,
1460,
1125,
13,
9651,
1583,
29889,
29916,
4619,
2531,
29896,
29881,
29889,
29916,
13,
9651,
1583,
29889,
29891,
4619,
518,
29916,
1195,
29961,
29896,
29962,
718,
313,
19881,
718,
29871,
29900,
29889,
29945,
11877,
4518,
14178,
29876,
29896,
29881,
13,
9651,
1583,
29889,
29885,
4619,
518,
2460,
16395,
29916,
3317,
29961,
29896,
29962,
448,
921,
1195,
29961,
29896,
2314,
29914,
1460,
363,
3737,
297,
2531,
29896,
29881,
29889,
29885,
29962,
13,
9651,
1583,
29889,
4650,
4619,
2531,
29896,
29881,
29889,
4650,
13,
9651,
1583,
29889,
29950,
4619,
518,
25548,
29911,
6073,
29906,
29881,
29898,
29950,
29896,
29881,
29889,
4419,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
7498,
11569,
29897,
363,
379,
29896,
29881,
297,
2531,
29896,
29881,
29889,
29950,
29962,
13,
13,
4706,
396,
6975,
278,
2967,
770,
2867,
701,
278,
7797,
2943,
4978,
13,
4706,
396,
363,
8943,
4251,
29889,
13,
4706,
9071,
21575,
5160,
17255,
2344,
12035,
1311,
29892,
5852,
29892,
13,
462,
462,
259,
1583,
29889,
29916,
29892,
1583,
29889,
29891,
29892,
1583,
29889,
29885,
29892,
1583,
29889,
4650,
29892,
1583,
29889,
29950,
29897,
13,
13,
4706,
396,
960,
591,
29915,
276,
28172,
4513,
379,
25187,
943,
29892,
437,
372,
29889,
13,
4706,
565,
10937,
29950,
29901,
13,
9651,
1583,
29889,
5675,
29950,
14486,
580,
13,
13,
4706,
736,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
2602,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
8003,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29916,
29897,
13,
4706,
4974,
7431,
29898,
1311,
29889,
29916,
29897,
1275,
7431,
29898,
1311,
29889,
29891,
29897,
13,
4706,
736,
16510,
29906,
29881,
29898,
1311,
29889,
29916,
29961,
29875,
1402,
1583,
29889,
29891,
29961,
29875,
2314,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
4158,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
29924,
465,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29885,
29897,
13,
4706,
736,
1583,
29889,
29885,
29961,
29875,
29962,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
4158,
9027,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
29924,
465,
29928,
575,
537,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29916,
29897,
13,
4706,
736,
1583,
29889,
4650,
29961,
29875,
29962,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
379,
12489,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
29950,
20158,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29950,
29897,
13,
4706,
736,
1583,
29889,
29950,
29961,
29875,
29962,
13,
13,
29937,
2683,
2683,
2683,
2683,
9072,
5634,
13,
29937,
20175,
5706,
263,
29871,
29896,
29928,
8722,
297,
29871,
29941,
29928,
3412,
278,
921,
29899,
20845,
29889,
13,
29937,
2683,
2683,
2683,
2683,
9072,
5634,
13,
1990,
3251,
403,
20334,
279,
4247,
13909,
29941,
29881,
29898,
4247,
21575,
5160,
1125,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
1281,
18769,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
302,
29916,
29892,
462,
396,
3646,
1353,
310,
3291,
297,
921,
13,
462,
7098,
29892,
462,
396,
3646,
1353,
310,
3291,
297,
343,
13,
462,
302,
29920,
29892,
462,
396,
3646,
1353,
310,
3291,
297,
503,
13,
462,
364,
1251,
29892,
18884,
396,
9027,
8722,
29892,
1818,
367,
29871,
29896,
29928,
740,
13,
462,
921,
1195,
29892,
1669,
396,
313,
29916,
1195,
29892,
343,
1195,
29892,
503,
1195,
29897,
10350,
13,
462,
921,
3317,
29892,
1669,
396,
313,
29916,
3317,
29892,
343,
3317,
29892,
503,
3317,
29897,
10350,
13,
462,
302,
4247,
5894,
29882,
353,
29871,
29906,
29889,
29900,
29896,
29892,
13,
462,
954,
29890,
1144,
353,
29871,
29896,
29900,
29900,
29900,
29900,
29892,
13,
462,
10937,
29950,
353,
7700,
1125,
13,
13,
4706,
4974,
302,
29916,
1405,
29871,
29900,
13,
4706,
4974,
7098,
1405,
29871,
29900,
13,
4706,
4974,
302,
29920,
1405,
29871,
29900,
13,
4706,
4974,
921,
1195,
29961,
29900,
29962,
529,
921,
3317,
29961,
29900,
29962,
13,
4706,
4974,
921,
1195,
29961,
29896,
29962,
529,
921,
3317,
29961,
29896,
29962,
13,
4706,
4974,
921,
1195,
29961,
29906,
29962,
529,
921,
3317,
29961,
29906,
29962,
13,
4706,
4974,
302,
4247,
5894,
29882,
1405,
29871,
29900,
29889,
29900,
13,
13,
4706,
396,
3824,
671,
278,
29871,
29896,
29928,
15299,
304,
5706,
263,
29871,
29896,
29928,
22780,
8722,
3412,
921,
29889,
13,
4706,
2531,
29896,
29881,
353,
3251,
403,
4247,
13909,
29896,
29881,
29898,
23818,
353,
302,
29916,
29892,
13,
462,
462,
418,
364,
1251,
353,
364,
1251,
29892,
13,
462,
462,
418,
921,
1195,
353,
921,
1195,
29961,
29900,
1402,
13,
462,
462,
418,
921,
3317,
353,
921,
3317,
29961,
29900,
1402,
13,
462,
462,
418,
302,
4247,
5894,
29882,
353,
302,
4247,
5894,
29882,
29892,
13,
462,
462,
418,
954,
29890,
1144,
353,
954,
29890,
1144,
29897,
13,
13,
4706,
396,
624,
2335,
278,
29871,
29896,
29928,
28723,
1250,
964,
7797,
848,
29889,
13,
4706,
2531,
29896,
29881,
29889,
29916,
353,
286,
1631,
29889,
497,
17469,
29898,
1885,
29896,
29881,
29889,
29916,
29892,
286,
1631,
29889,
25021,
29897,
13,
4706,
2531,
29896,
29881,
29889,
29885,
353,
286,
1631,
29889,
497,
17469,
29898,
1885,
29896,
29881,
29889,
29885,
29892,
286,
1631,
29889,
25021,
29897,
13,
4706,
2531,
29896,
29881,
29889,
4650,
353,
286,
1631,
29889,
497,
17469,
29898,
1885,
29896,
29881,
29889,
4650,
29892,
286,
1631,
29889,
25021,
29897,
13,
4706,
2531,
29896,
29881,
29889,
29950,
353,
286,
1631,
29889,
497,
17469,
29898,
1885,
29896,
29881,
29889,
29950,
29892,
286,
1631,
29889,
25021,
29897,
13,
4706,
302,
29896,
29881,
353,
7431,
29898,
1885,
29896,
29881,
29889,
29916,
29897,
13,
13,
4706,
396,
10088,
5926,
278,
29871,
29896,
29928,
269,
29399,
964,
278,
2989,
29871,
29941,
29928,
848,
29889,
13,
4706,
1583,
29889,
29916,
353,
5159,
13,
4706,
1583,
29889,
29891,
353,
5159,
13,
4706,
1583,
29889,
29920,
353,
5159,
13,
4706,
1583,
29889,
29885,
353,
5159,
13,
4706,
1583,
29889,
4650,
353,
5159,
13,
4706,
1583,
29889,
29950,
353,
5159,
13,
4706,
13475,
353,
313,
29916,
3317,
29961,
29896,
29962,
448,
921,
1195,
29961,
29896,
2314,
29914,
1460,
13,
4706,
9275,
353,
313,
29916,
3317,
29961,
29906,
29962,
448,
921,
1195,
29961,
29906,
2314,
29914,
29876,
29920,
13,
4706,
7498,
11569,
353,
29871,
29896,
29889,
29900,
14571,
29876,
4247,
5894,
29882,
29930,
4518,
29897,
13,
4706,
298,
29920,
11569,
353,
29871,
29896,
29889,
29900,
14571,
29876,
4247,
5894,
29882,
29930,
5601,
29897,
13,
4706,
363,
5951,
297,
921,
3881,
29898,
29876,
29920,
1125,
13,
9651,
363,
474,
29891,
297,
921,
3881,
29898,
1460,
1125,
13,
18884,
1583,
29889,
29916,
4619,
2531,
29896,
29881,
29889,
29916,
13,
18884,
1583,
29889,
29891,
4619,
518,
29916,
1195,
29961,
29896,
29962,
718,
313,
19881,
718,
29871,
29900,
29889,
29945,
11877,
4518,
14178,
29876,
29896,
29881,
13,
18884,
1583,
29889,
29920,
4619,
518,
29916,
1195,
29961,
29906,
29962,
718,
313,
466,
718,
29871,
29900,
29889,
29945,
11877,
5601,
14178,
29876,
29896,
29881,
13,
18884,
1583,
29889,
29885,
4619,
518,
2460,
16395,
29916,
3317,
29961,
29896,
29962,
448,
921,
1195,
29961,
29896,
2314,
16395,
29916,
3317,
29961,
29906,
29962,
448,
921,
1195,
29961,
29906,
2314,
14571,
1460,
29930,
29876,
29920,
29897,
363,
3737,
297,
2531,
29896,
29881,
29889,
29885,
29962,
13,
18884,
1583,
29889,
4650,
4619,
2531,
29896,
29881,
29889,
4650,
13,
18884,
1583,
29889,
29950,
4619,
518,
25548,
29911,
6073,
29941,
29881,
29898,
29950,
29896,
29881,
29889,
4419,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
13,
462,
462,
4706,
29900,
29889,
29900,
29892,
7498,
11569,
29892,
29871,
29900,
29889,
29900,
29892,
13,
462,
462,
4706,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
298,
29920,
11569,
29897,
363,
379,
29896,
29881,
297,
2531,
29896,
29881,
29889,
29950,
29962,
13,
13,
4706,
396,
6975,
278,
2967,
770,
2867,
701,
278,
7797,
2943,
4978,
13,
4706,
396,
363,
8943,
4251,
29889,
13,
4706,
9071,
21575,
5160,
17255,
2344,
12035,
1311,
29892,
5852,
29892,
13,
462,
462,
259,
1583,
29889,
29916,
29892,
1583,
29889,
29891,
29892,
1583,
29889,
29920,
29892,
1583,
29889,
29885,
29892,
1583,
29889,
4650,
29892,
1583,
29889,
29950,
29897,
13,
13,
4706,
396,
960,
591,
29915,
276,
28172,
4513,
379,
25187,
943,
29892,
437,
372,
29889,
13,
4706,
565,
10937,
29950,
29901,
13,
9651,
1583,
29889,
5675,
29950,
14486,
580,
13,
13,
4706,
736,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
2602,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
8003,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29916,
29897,
13,
4706,
4974,
7431,
29898,
1311,
29889,
29916,
29897,
1275,
7431,
29898,
1311,
29889,
29891,
29897,
13,
4706,
4974,
7431,
29898,
1311,
29889,
29916,
29897,
1275,
7431,
29898,
1311,
29889,
29920,
29897,
13,
4706,
736,
16510,
29941,
29881,
29898,
1311,
29889,
29916,
29961,
29875,
1402,
1583,
29889,
29891,
29961,
29875,
1402,
1583,
29889,
29920,
29961,
29875,
2314,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
4158,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
29924,
465,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29885,
29897,
13,
4706,
736,
1583,
29889,
29885,
29961,
29875,
29962,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
4158,
9027,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
29924,
465,
29928,
575,
537,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29916,
29897,
13,
4706,
736,
1583,
29889,
4650,
29961,
29875,
29962,
13,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
396,
3617,
278,
379,
12489,
363,
278,
2183,
2943,
2380,
29889,
13,
1678,
396,
2683,
2683,
2683,
2683,
1378,
5634,
13,
1678,
822,
1887,
29950,
20158,
29898,
1311,
29892,
474,
1125,
13,
4706,
4974,
474,
6736,
29871,
29900,
322,
474,
529,
7431,
29898,
1311,
29889,
29950,
29897,
13,
4706,
736,
1583,
29889,
29950,
29961,
29875,
29962,
13,
13,
2
] |
build/full_test.py | wanghuan578/chrome-gn | 10 | 101212 | #!/usr/bin/env python3
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import subprocess
import sys
import timeit
IS_WIN = sys.platform.startswith('win')
def RemoveDir(d):
if os.path.isdir(d):
shutil.rmtree(d)
def Trial(gn_path_to_use, save_out_dir=None):
bin_path = os.path.join('out', 'gntrial')
if not os.path.isdir(bin_path):
os.makedirs(bin_path)
gn_to_run = os.path.join(bin_path, 'gn' + ('.exe' if IS_WIN else ''))
shutil.copy2(gn_path_to_use, gn_to_run)
comp_dir = os.path.join('out', 'COMP')
subprocess.check_call([gn_to_run, 'gen', comp_dir, '-q', '--check'])
if save_out_dir:
RemoveDir(save_out_dir)
shutil.move(comp_dir, save_out_dir)
def main():
if len(sys.argv) < 3 or len(sys.argv) > 4:
print 'Usage: full_test.py /chrome/tree/at/762a25542878 rel_gn_path [clean]'
return 1
if len(sys.argv) == 4:
RemoveDir('out')
subprocess.check_call([sys.executable, os.path.join('build', 'gen.py')])
subprocess.check_call(['ninja', '-C', 'out'])
subprocess.check_call([os.path.join('out', 'gn_unittests')])
orig_dir = os.getcwd()
in_chrome_tree_gn = sys.argv[2]
our_gn = os.path.join(orig_dir, 'out', 'gn' + ('.exe' if IS_WIN else ''))
os.chdir(sys.argv[1])
# Check in-tree vs. ours. Uses:
# - Chromium tree at 762a25542878 in argv[1] (this can be off by a bit, but
# is roughly when GN was moved out of the Chrome tree, so matches in case GN
# semantics/ordering change after that.)
# - relative path to argv[1] built gn binary in argv[2]
# First, do a comparison to make sure the output between the two gn binaries
# actually matches.
print 'Confirming output matches...'
dir_a = os.path.join('out', 'a')
dir_b = os.path.join('out', 'b')
Trial(in_chrome_tree_gn, dir_a)
Trial(our_gn, dir_b)
subprocess.check_call(['diff', '-r', dir_a, dir_b])
# Then, some time trials.
TRIALS = 5
print 'Comparing performance... (takes a while)'
time_a = timeit.timeit('Trial("%s")' % in_chrome_tree_gn, number=TRIALS,
setup='from __main__ import Trial')
time_b = timeit.timeit('Trial("%s")' % our_gn, number=TRIALS,
setup='from __main__ import Trial')
print 'In-tree gn avg: %.3fs' % (time_a / TRIALS)
print 'Our gn avg: %.3fs' % (time_b / TRIALS)
return 0
if __name__ == '__main__':
sys.exit(main())
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29947,
450,
678,
456,
1974,
13189,
943,
29889,
2178,
10462,
21676,
29889,
13,
29937,
4803,
310,
445,
2752,
775,
338,
4095,
287,
491,
263,
350,
7230,
29899,
3293,
19405,
393,
508,
367,
13,
29937,
1476,
297,
278,
365,
2965,
1430,
1660,
934,
29889,
13,
13,
5215,
2897,
13,
5215,
528,
4422,
13,
5215,
1014,
5014,
13,
5215,
10876,
13,
5215,
931,
277,
13,
13,
13,
3235,
29918,
25152,
353,
10876,
29889,
12120,
29889,
27382,
2541,
877,
5080,
1495,
13,
13,
13,
1753,
15154,
9170,
29898,
29881,
1125,
13,
29871,
565,
2897,
29889,
2084,
29889,
275,
3972,
29898,
29881,
1125,
13,
1678,
528,
4422,
29889,
1758,
8336,
29898,
29881,
29897,
13,
13,
13,
1753,
8602,
284,
29898,
5138,
29918,
2084,
29918,
517,
29918,
1509,
29892,
4078,
29918,
449,
29918,
3972,
29922,
8516,
1125,
13,
29871,
9016,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
877,
449,
742,
525,
29887,
593,
9315,
1495,
13,
29871,
565,
451,
2897,
29889,
2084,
29889,
275,
3972,
29898,
2109,
29918,
2084,
1125,
13,
1678,
2897,
29889,
29885,
12535,
12935,
29898,
2109,
29918,
2084,
29897,
13,
29871,
330,
29876,
29918,
517,
29918,
3389,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2109,
29918,
2084,
29892,
525,
5138,
29915,
718,
313,
4286,
8097,
29915,
565,
8519,
29918,
25152,
1683,
6629,
876,
13,
29871,
528,
4422,
29889,
8552,
29906,
29898,
5138,
29918,
2084,
29918,
517,
29918,
1509,
29892,
330,
29876,
29918,
517,
29918,
3389,
29897,
13,
29871,
752,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
877,
449,
742,
525,
21514,
1495,
13,
29871,
1014,
5014,
29889,
3198,
29918,
4804,
4197,
5138,
29918,
517,
29918,
3389,
29892,
525,
1885,
742,
752,
29918,
3972,
29892,
17411,
29939,
742,
525,
489,
3198,
11287,
13,
29871,
565,
4078,
29918,
449,
29918,
3972,
29901,
13,
1678,
15154,
9170,
29898,
7620,
29918,
449,
29918,
3972,
29897,
13,
1678,
528,
4422,
29889,
11631,
29898,
2388,
29918,
3972,
29892,
4078,
29918,
449,
29918,
3972,
29897,
13,
13,
13,
1753,
1667,
7295,
13,
29871,
565,
7431,
29898,
9675,
29889,
19218,
29897,
529,
29871,
29941,
470,
7431,
29898,
9675,
29889,
19218,
29897,
1405,
29871,
29946,
29901,
13,
1678,
1596,
525,
27573,
29901,
2989,
29918,
1688,
29889,
2272,
847,
18114,
29914,
8336,
29914,
271,
29914,
29955,
29953,
29906,
29874,
29906,
29945,
29945,
29946,
29906,
29947,
29955,
29947,
1104,
29918,
5138,
29918,
2084,
518,
14941,
29962,
29915,
13,
1678,
736,
29871,
29896,
13,
13,
29871,
565,
7431,
29898,
9675,
29889,
19218,
29897,
1275,
29871,
29946,
29901,
13,
1678,
15154,
9170,
877,
449,
1495,
13,
13,
29871,
1014,
5014,
29889,
3198,
29918,
4804,
4197,
9675,
29889,
4258,
9246,
29892,
2897,
29889,
2084,
29889,
7122,
877,
4282,
742,
525,
1885,
29889,
2272,
1495,
2314,
13,
29871,
1014,
5014,
29889,
3198,
29918,
4804,
18959,
29876,
262,
1764,
742,
17411,
29907,
742,
525,
449,
11287,
13,
29871,
1014,
5014,
29889,
3198,
29918,
4804,
4197,
359,
29889,
2084,
29889,
7122,
877,
449,
742,
525,
5138,
29918,
348,
986,
9197,
1495,
2314,
13,
29871,
1677,
29918,
3972,
353,
2897,
29889,
657,
29883,
9970,
580,
13,
13,
29871,
297,
29918,
18114,
29918,
8336,
29918,
5138,
353,
10876,
29889,
19218,
29961,
29906,
29962,
13,
29871,
1749,
29918,
5138,
353,
2897,
29889,
2084,
29889,
7122,
29898,
12683,
29918,
3972,
29892,
525,
449,
742,
525,
5138,
29915,
718,
313,
4286,
8097,
29915,
565,
8519,
29918,
25152,
1683,
6629,
876,
13,
13,
29871,
2897,
29889,
305,
3972,
29898,
9675,
29889,
19218,
29961,
29896,
2314,
13,
13,
29871,
396,
5399,
297,
29899,
8336,
7186,
29889,
1749,
29879,
29889,
10783,
267,
29901,
13,
29871,
396,
448,
678,
456,
1974,
5447,
472,
29871,
29955,
29953,
29906,
29874,
29906,
29945,
29945,
29946,
29906,
29947,
29955,
29947,
297,
1852,
29894,
29961,
29896,
29962,
313,
1366,
508,
367,
1283,
491,
263,
2586,
29892,
541,
13,
29871,
396,
259,
338,
20928,
746,
402,
29940,
471,
6153,
714,
310,
278,
10228,
5447,
29892,
577,
7087,
297,
1206,
402,
29940,
13,
29871,
396,
259,
29505,
29914,
2098,
292,
1735,
1156,
393,
1846,
13,
29871,
396,
448,
6198,
2224,
304,
1852,
29894,
29961,
29896,
29962,
4240,
330,
29876,
7581,
297,
1852,
29894,
29961,
29906,
29962,
13,
13,
29871,
396,
3824,
29892,
437,
263,
10230,
304,
1207,
1854,
278,
1962,
1546,
278,
1023,
330,
29876,
9016,
4314,
13,
29871,
396,
2869,
7087,
29889,
13,
29871,
1596,
525,
16376,
3568,
292,
1962,
7087,
856,
29915,
13,
29871,
4516,
29918,
29874,
353,
2897,
29889,
2084,
29889,
7122,
877,
449,
742,
525,
29874,
1495,
13,
29871,
4516,
29918,
29890,
353,
2897,
29889,
2084,
29889,
7122,
877,
449,
742,
525,
29890,
1495,
13,
29871,
8602,
284,
29898,
262,
29918,
18114,
29918,
8336,
29918,
5138,
29892,
4516,
29918,
29874,
29897,
13,
29871,
8602,
284,
29898,
473,
29918,
5138,
29892,
4516,
29918,
29890,
29897,
13,
29871,
1014,
5014,
29889,
3198,
29918,
4804,
18959,
12765,
742,
17411,
29878,
742,
4516,
29918,
29874,
29892,
4516,
29918,
29890,
2314,
13,
13,
29871,
396,
1987,
29892,
777,
931,
3367,
1338,
29889,
13,
29871,
323,
3960,
1964,
29903,
353,
29871,
29945,
13,
29871,
1596,
525,
1523,
862,
292,
4180,
856,
313,
29873,
6926,
263,
1550,
16029,
13,
29871,
931,
29918,
29874,
353,
931,
277,
29889,
2230,
277,
877,
29911,
9315,
11702,
29879,
1159,
29915,
1273,
297,
29918,
18114,
29918,
8336,
29918,
5138,
29892,
1353,
29922,
29911,
3960,
1964,
29903,
29892,
13,
462,
308,
6230,
2433,
3166,
4770,
3396,
1649,
1053,
8602,
284,
1495,
13,
29871,
931,
29918,
29890,
353,
931,
277,
29889,
2230,
277,
877,
29911,
9315,
11702,
29879,
1159,
29915,
1273,
1749,
29918,
5138,
29892,
1353,
29922,
29911,
3960,
1964,
29903,
29892,
13,
462,
308,
6230,
2433,
3166,
4770,
3396,
1649,
1053,
8602,
284,
1495,
13,
29871,
1596,
525,
797,
29899,
8336,
330,
29876,
1029,
29887,
29901,
18695,
29941,
5847,
29915,
1273,
313,
2230,
29918,
29874,
847,
323,
3960,
1964,
29903,
29897,
13,
29871,
1596,
525,
29949,
332,
330,
29876,
1029,
29887,
29901,
18695,
29941,
5847,
29915,
1273,
313,
2230,
29918,
29890,
847,
323,
3960,
1964,
29903,
29897,
13,
13,
29871,
736,
29871,
29900,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
10876,
29889,
13322,
29898,
3396,
3101,
13,
2
] |
module4/solution/detect_brands.py | axel-sirota/getting-started-azure-computer-vision | 0 | 166931 | <reponame>axel-sirota/getting-started-azure-computer-vision<filename>module4/solution/detect_brands.py<gh_stars>0
import os
from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from msrest.authentication import CognitiveServicesCredentials
# Authenticate
subscription_key = os.environ["AZURE_COMPUTER_VISION_SUBSCRIPTION_KEY"]
endpoint = os.environ["AZURE_COMPUTER_VISION_ENDPOINT"]
computervision_client = ComputerVisionClient(endpoint, CognitiveServicesCredentials(subscription_key))
logo = "https://raw.githubusercontent.com/axel-sirota/getting-started-azure-computer-vision/main/Images/my_car.jpg"
brand_response = computervision_client.analyze_image(logo, visual_features=['Brands'], max_candidates=1)
print(f"Brands are { [brand.name for brand in brand_response.brands] }")
| [
1,
529,
276,
1112,
420,
29958,
1165,
295,
29899,
1039,
307,
941,
29914,
29264,
29899,
2962,
287,
29899,
17688,
29899,
12097,
261,
29899,
4924,
29966,
9507,
29958,
5453,
29946,
29914,
2929,
918,
29914,
4801,
522,
29918,
1182,
4167,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
2897,
13,
13,
3166,
15699,
29889,
29883,
3811,
277,
3145,
6972,
1575,
29889,
4924,
29889,
12097,
261,
4924,
1053,
20972,
29963,
2459,
4032,
13,
3166,
10887,
5060,
29889,
23055,
1053,
315,
3811,
3321,
13779,
28037,
13,
13,
29937,
13189,
4173,
403,
13,
13,
1491,
22371,
29918,
1989,
353,
2897,
29889,
21813,
3366,
29909,
29999,
11499,
29918,
21514,
2692,
1001,
29918,
28607,
2725,
29918,
20633,
7187,
24290,
2725,
29918,
10818,
3108,
13,
29734,
353,
2897,
29889,
21813,
3366,
29909,
29999,
11499,
29918,
21514,
2692,
1001,
29918,
28607,
2725,
29918,
1430,
11191,
6992,
29911,
3108,
13,
13,
12097,
261,
4924,
29918,
4645,
353,
20972,
29963,
2459,
4032,
29898,
29734,
29892,
315,
3811,
3321,
13779,
28037,
29898,
1491,
22371,
29918,
1989,
876,
13,
13,
14569,
353,
376,
991,
597,
1610,
29889,
3292,
1792,
3051,
29889,
510,
29914,
1165,
295,
29899,
1039,
307,
941,
29914,
29264,
29899,
2962,
287,
29899,
17688,
29899,
12097,
261,
29899,
4924,
29914,
3396,
29914,
20163,
29914,
1357,
29918,
4287,
29889,
6173,
29908,
13,
13,
16472,
29918,
5327,
353,
6601,
4924,
29918,
4645,
29889,
24209,
911,
29918,
3027,
29898,
14569,
29892,
7604,
29918,
22100,
29922,
1839,
12432,
4167,
7464,
4236,
29918,
29883,
5380,
1078,
29922,
29896,
29897,
13,
13,
2158,
29898,
29888,
29908,
12432,
4167,
526,
426,
518,
16472,
29889,
978,
363,
14982,
297,
14982,
29918,
5327,
29889,
1182,
4167,
29962,
500,
1159,
13,
2
] |
src/utilities/NumpyHelper.py | AndMu/Market-Wisdom | 14 | 33931 | import numpy as np
class NumpyDynamic:
def __init__(self, dtype, array_size=(100,)):
self.data = np.zeros(array_size, dtype)
self.array_size = list(array_size)
self.size = 0
def add(self, x):
if self.size == self.array_size[0]:
self.array_size[0] *= 2
newdata = np.zeros(self.array_size, self.data.dtype)
newdata[:self.size] = self.data
self.data = newdata
self.data[self.size] = x
self.size += 1
def finalize(self):
return self.data[:self.size] | [
1,
1053,
12655,
408,
7442,
13,
13,
13,
1990,
11848,
2272,
24001,
29901,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
26688,
29892,
1409,
29918,
2311,
7607,
29896,
29900,
29900,
29892,
22164,
13,
4706,
1583,
29889,
1272,
353,
7442,
29889,
3298,
359,
29898,
2378,
29918,
2311,
29892,
26688,
29897,
13,
4706,
1583,
29889,
2378,
29918,
2311,
353,
1051,
29898,
2378,
29918,
2311,
29897,
13,
4706,
1583,
29889,
2311,
353,
29871,
29900,
13,
13,
1678,
822,
788,
29898,
1311,
29892,
921,
1125,
13,
4706,
565,
1583,
29889,
2311,
1275,
1583,
29889,
2378,
29918,
2311,
29961,
29900,
5387,
13,
9651,
1583,
29889,
2378,
29918,
2311,
29961,
29900,
29962,
334,
29922,
29871,
29906,
13,
9651,
716,
1272,
353,
7442,
29889,
3298,
359,
29898,
1311,
29889,
2378,
29918,
2311,
29892,
1583,
29889,
1272,
29889,
29881,
1853,
29897,
13,
9651,
716,
1272,
7503,
1311,
29889,
2311,
29962,
353,
1583,
29889,
1272,
13,
9651,
1583,
29889,
1272,
353,
716,
1272,
13,
13,
4706,
1583,
29889,
1272,
29961,
1311,
29889,
2311,
29962,
353,
921,
13,
4706,
1583,
29889,
2311,
4619,
29871,
29896,
13,
13,
1678,
822,
2186,
675,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
1272,
7503,
1311,
29889,
2311,
29962,
2
] |
mitmirror/data/security/password_hash.py | Claayton/mitmirror-api | 0 | 107192 | """Caso de uso: PasswordHash"""
import bcrypt
from mitmirror.domain.usecases import PasswordHashInterface
class PasswordHash(PasswordHashInterface):
"""Classe responsavel por realizar o hash de senhas de usuarios"""
@staticmethod
def hash(password: str) -> str:
"""Realiza o procesos de hash da senha"""
hashed = bcrypt.hashpw(password.encode("utf8"), bcrypt.gensalt())
return hashed
@staticmethod
def verify(password: str, password_hashed: str) -> bool:
"""Realiza a verificaçao se a senha passada é a mesma da senha cadastrada"""
is_hashed = (
bcrypt.hashpw(password.encode("utf8"), password_hashed) == password_hashed
)
return is_hashed
| [
1,
9995,
29907,
17764,
316,
17448,
29901,
25280,
10438,
15945,
29908,
13,
5215,
289,
29883,
4641,
13,
3166,
1380,
11038,
729,
29889,
7247,
29889,
1509,
11436,
1053,
25280,
10438,
10448,
13,
13,
13,
1990,
25280,
10438,
29898,
10048,
10438,
10448,
1125,
13,
1678,
9995,
29907,
14537,
5544,
6447,
1277,
8869,
279,
288,
6608,
316,
6940,
5349,
316,
502,
29884,
8596,
15945,
29908,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
6608,
29898,
5630,
29901,
851,
29897,
1599,
851,
29901,
13,
4706,
9995,
21713,
6619,
288,
14177,
359,
316,
6608,
1146,
6940,
2350,
15945,
29908,
13,
13,
4706,
6608,
287,
353,
289,
29883,
4641,
29889,
8568,
29886,
29893,
29898,
5630,
29889,
12508,
703,
9420,
29947,
4968,
289,
29883,
4641,
29889,
17397,
1997,
3101,
13,
13,
4706,
736,
6608,
287,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
11539,
29898,
5630,
29901,
851,
29892,
4800,
29918,
8568,
287,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
9995,
21713,
6619,
263,
1147,
15039,
4277,
29877,
409,
263,
6940,
2350,
1209,
1114,
904,
263,
4883,
655,
1146,
6940,
2350,
274,
3922,
509,
1114,
15945,
29908,
13,
13,
4706,
338,
29918,
8568,
287,
353,
313,
13,
9651,
289,
29883,
4641,
29889,
8568,
29886,
29893,
29898,
5630,
29889,
12508,
703,
9420,
29947,
4968,
4800,
29918,
8568,
287,
29897,
1275,
4800,
29918,
8568,
287,
13,
4706,
1723,
13,
13,
4706,
736,
338,
29918,
8568,
287,
13,
2
] |
tools/show_workenv.py | violas-core/bvexchange | 0 | 74127 | #!/usr/bin/python3
import operator
import sys
import json
import os
sys.path.append(os.getcwd())
sys.path.append("..")
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../"))
import log
import log.logger
import traceback
import datetime
import sqlalchemy
import stmanage
import requests
import random
import comm
import comm.error
import comm.result
import comm.values
import stmanage
import redis
from comm.parseargs import parseargs
from comm.values import (
dbindexbase as dbindex,
trantypebase as trantype,
datatypebase as datatype
)
from comm.functions import (
json_print,
human_address
)
from comm.result import result, parse_except
from comm.error import error
from db.dblocal import dblocal as localdb
from db.dbvfilter import dbvfilter
from db.dbvproof import dbvproof
from db.dbvbase import dbvbase
from enum import Enum
from baseobject import baseobject
from vlsopt.violasclient import violasclient, violaswallet
from ethopt.ethclient import (
ethclient,
ethwallet
)
from dataproof import dataproof
from tools import comm_funs
#module name
name="showworkenv"
wallet_name="vwallet"
VIOLAS_ADDRESS_LEN = comm.values.VIOLAS_ADDRESS_LEN
logger = log.logger.getLogger(name)
def get_ethclient(usd_erc20 = True):
client = ethclient(name, stmanage.get_eth_nodes(), "ethereum")
client.load_vlsmproof(stmanage.get_eth_token("vlsmproof")["address"])
if usd_erc20:
tokens = client.get_token_list().datas
logger.debug(f"support tokens: {tokens}")
for token in tokens:
client.load_contract(token)
return client
def get_ethwallet():
return ethwallet(name, dataproof.wallets("ethereum"), "ethereum")
def show_db():
infos = {}
for idx in dbindex:
dbconf = stmanage.get_db(idx.name.lower())
db = dbvbase(name, dbconf.get("host"), dbconf.get("port"), idx.name.lower(), dbconf.get("password"))
info = { \
"mod_name" : db.get_mod_name().datas, \
"latest_filter_ver": db.get_latest_filter_ver().datas, \
"latest_saved_ver": db.get_latest_saved_ver().datas, \
"min_valid_ver": db.get_min_valid_ver().datas, \
"index": idx.value, \
#"db":dbconf, \
}
infos[idx.name.lower()] = info
json_print(infos)
return infos
def show_address():
vclient = comm_funs.violasreg(name, stmanage.get_violas_nodes())
vwclient = comm_funs.walletreg(name, wallet_name)
lclient = comm_funs.violasreg(name, stmanage.get_libra_nodes(), chain = "libra")
lwclient = comm_funs.walletreg(name, wallet_name, chain = "libra")
eclient = get_ethclient()
ewclient = get_ethwallet()
cclients = {"violas":vclient, "libra":lclient, "ethereum": eclient}
wclients = {"violas":vwclient, "libra":lwclient, "ethereum": ewclient}
infos = {}
dtypes = stmanage.get_support_dtypes()
for dtype in dtypes:
from_chain, to_chain = stmanage.get_exchang_chains(dtype)
cclient = cclients.get(to_chain)
wclient = wclients.get(to_chain)
if not cclient or not wclient or not to_chain:
logger.debug(f"not found {to_chain} in {dtype}, continue next...")
continue
logger.debug(f"get chain = {to_chain} dtype = {dtype} info.")
senders = stmanage.get_sender_address_list(dtype, to_chain)
comm_funs.list_address_info(cclient, wclient, senders, ret = infos)
combin = stmanage.get_combine_address(dtype, to_chain)
if not combin:
continue
comm_funs.list_address_info(cclient, wclient, [combin], ret = infos)
for dtype in dtypes:
from_chain, to_chain = stmanage.get_exchang_chains(dtype)
cclient = cclients.get(from_chain)
wclient = wclients.get(from_chain)
if not cclient or not wclient or not to_chain:
logger.debug(f"not found {from_chain}, continue next...")
continue
logger.debug(f"get chain = {from_chain} dtype = {dtype} info.")
if dtype == "e2vm":
receivers = [stmanage.get_map_address(dtype, from_chain)]
else:
receivers = stmanage.get_receiver_address_list(dtype, from_chain)
comm_funs.list_address_info(cclient, wclient, receivers, ret = infos)
#uniswap use combine
combin = stmanage.get_combine_address(dtype, from_chain)
if not combin:
continue
comm_funs.list_address_info(cclient, wclient, [combin], ret = infos)
#funds
receivers = stmanage.get_receiver_address_list("funds", trantype.VIOLAS)
comm_funs.list_address_info(cclient, wclient, receivers, ret = infos)
#start get libra address info
logger.debug("********violas chain address info********")
json_print(infos)
return infos
def show_config():
infos = stmanage.get_conf()
json_print(infos)
return infos
def __create_local_db_name(name, from_chain, path = ""):
return f"{path}{from_chain}_{name}.db"
def __get_local_state_info(db, states):
info = {}
if not db.init_state:
return info
for state in db.state:
count = db.query_state_count(state).datas
if count > 0:
info[state.name] = count
return info
def get_local_info(name, chain):
filename = __create_local_db_name(name, chain)
db = localdb(name, filename, False)
return __get_local_state_info(db, db.state)
def show_local_db():
confs = []
for key in stmanage.get_support_mods_info():
if key.startswith("v"):
confs.append(("violas", key))
elif key.startswith("l"):
confs.append(("libra", key))
elif key.startswith("b"):
confs.append(("btc", key))
elif key.startswith("e"):
confs.append(("ethereum", key))
infos = {}
for conf in confs:
infos[conf[1]] = get_local_info(conf[1], conf[0])
json_print(infos)
return infos
class work_mod(Enum):
CONF = 0
LDB = 1
RDB = 2
ADDR = 3
def list_valid_mods():
valid_mods = ["all"]
for mod in work_mod:
valid_mods.append(mod.name.lower())
return valid_mods
def start(work_mods):
if work_mods.get(work_mod.LDB.name, False):
show_local_db()
if work_mods.get(work_mod.RDB.name, False):
try:
show_db()
except Exception as e:
pass
if work_mods.get(work_mod.CONF.name, False):
show_config()
if work_mods.get(work_mod.ADDR.name, False):
show_address()
def show(mods):
valid_mods = list_valid_mods()
for mod in mods:
if mod is None or mod not in valid_mods:
raise Exception(f"mod({mod}) is invalid {valid_mods}.")
work_mods = {}
for mod in mods:
work_mods[mod.upper()] = True
if mod == "all":
for wm in work_mod:
work_mods[wm.name.upper()] = True
break
start(work_mods)
def init_args(pargs):
pargs.clear()
pargs.append("help", "show arg list.")
pargs.append("conf", "config file path name. default:bvexchange.toml, find from . and /etc/bvexchange/", True, "toml file", priority = 5)
pargs.append("vwallet", "inpurt wallet file or mnemonic", True, "file name/mnemonic", priority = 13, argtype = parseargs.argtype.STR)
pargs.append("ewallet", "inpurt wallet file or mnemonic", True, "file name/mnemonic", priority = 13, argtype = parseargs.argtype.STR)
pargs.append("show", f"show env info args = {list_valid_mods()}.", True, list_valid_mods())
def main(argc, argv):
try:
pargs = parseargs(exit = exit)
init_args(pargs)
if pargs.show_help(argv):
return
opts, err_args = pargs.getopt(argv)
except Exception as e:
logger.error(e)
if exit:
sys.exit(2)
return
#argument start for --
if len(err_args) > 0:
pargs.show_args()
return
names = [opt for opt, arg in opts]
pargs.check_unique(names)
for opt, arg in opts:
arg_list = []
if len(arg) > 0:
count, arg_list = pargs.split_arg(opt, arg)
if pargs.is_matched(opt, ["conf"]):
if len(arg_list) != 1:
pargs.exit_error_opt(opt)
stmanage.set_conf_env(arg_list[0])
elif pargs.is_matched(opt, ["help"]):
pargs.show_args()
return
elif pargs.is_matched(opt, ["vwallet"]):
if not pargs.exit_check_opt_arg(opt, arg, 1):
return
dataproof.wallets.update_wallet("violas", arg_list[0])
elif pargs.is_matched(opt, ["ewallet"]):
if not pargs.exit_check_opt_arg(opt, arg, 1):
return
dataproof.wallets.update_wallet("ethereum", arg_list[0])
elif pargs.is_matched(opt, ["show"]):
if not pargs.exit_check_opt_arg_min(opt, arg, 1):
return
show(arg_list)
return
elif pargs.has_callback(opt):
pargs.callback(opt, *arg_list)
else:
raise Exception(f"not found matched opt: {opt}")
if __name__ == "__main__":
main(len(sys.argv) - 1, sys.argv[1:])
| [
1,
18787,
4855,
29914,
2109,
29914,
4691,
29941,
13,
5215,
5455,
13,
5215,
10876,
13,
5215,
4390,
13,
5215,
2897,
13,
9675,
29889,
2084,
29889,
4397,
29898,
359,
29889,
657,
29883,
9970,
3101,
13,
9675,
29889,
2084,
29889,
4397,
703,
636,
1159,
13,
9675,
29889,
2084,
29889,
4397,
29898,
359,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
22168,
1445,
1649,
8243,
376,
6995,
5783,
13,
5215,
1480,
13,
5215,
1480,
29889,
21707,
13,
5215,
9637,
1627,
13,
5215,
12865,
13,
5215,
4576,
284,
305,
6764,
13,
5215,
380,
1171,
482,
13,
5215,
7274,
13,
5215,
4036,
13,
5215,
844,
13,
5215,
844,
29889,
2704,
13,
5215,
844,
29889,
2914,
13,
5215,
844,
29889,
5975,
13,
5215,
380,
1171,
482,
13,
5215,
29825,
13,
3166,
844,
29889,
5510,
5085,
1053,
6088,
5085,
13,
3166,
844,
29889,
5975,
1053,
313,
13,
4706,
270,
2109,
1390,
3188,
408,
270,
2109,
1390,
29892,
13,
4706,
534,
424,
668,
3188,
408,
534,
424,
668,
29892,
13,
4706,
1418,
23179,
3188,
408,
1418,
23179,
13,
4706,
1723,
13,
13,
3166,
844,
29889,
12171,
1053,
313,
13,
4706,
4390,
29918,
2158,
29892,
29871,
13,
4706,
5199,
29918,
7328,
13,
4706,
1723,
13,
3166,
844,
29889,
2914,
1053,
1121,
29892,
6088,
29918,
19499,
13,
3166,
844,
29889,
2704,
1053,
1059,
13,
3166,
4833,
29889,
2585,
2997,
1053,
4833,
2997,
408,
1887,
2585,
13,
3166,
4833,
29889,
2585,
29894,
4572,
1053,
4833,
29894,
4572,
13,
3166,
4833,
29889,
2585,
29894,
8017,
1053,
4833,
29894,
8017,
13,
3166,
4833,
29889,
2585,
29894,
3188,
1053,
4833,
29894,
3188,
13,
3166,
14115,
1053,
1174,
398,
13,
3166,
2967,
3318,
1053,
2967,
3318,
13,
3166,
14204,
578,
415,
29889,
1403,
16118,
4645,
1053,
5537,
294,
4645,
29892,
5537,
294,
14625,
1026,
13,
3166,
11314,
3670,
29889,
621,
4645,
1053,
313,
13,
4706,
11314,
4645,
29892,
13,
4706,
11314,
14625,
1026,
13,
4706,
1723,
13,
13,
3166,
1418,
481,
307,
974,
1053,
1418,
481,
307,
974,
13,
3166,
8492,
1053,
844,
29918,
29888,
6948,
13,
29937,
5453,
1024,
13,
978,
543,
4294,
1287,
6272,
29908,
13,
14625,
1026,
29918,
978,
543,
29894,
14625,
1026,
29908,
13,
18118,
5607,
3289,
29918,
17744,
26785,
29918,
1307,
29940,
353,
844,
29889,
5975,
29889,
18118,
5607,
3289,
29918,
17744,
26785,
29918,
1307,
29940,
13,
21707,
353,
1480,
29889,
21707,
29889,
657,
16363,
29898,
978,
29897,
13,
13,
1753,
679,
29918,
621,
4645,
29898,
375,
29881,
29918,
6269,
29906,
29900,
353,
5852,
1125,
13,
13,
1678,
3132,
353,
11314,
4645,
29898,
978,
29892,
380,
1171,
482,
29889,
657,
29918,
621,
29918,
18010,
3285,
376,
621,
406,
398,
1159,
13,
1678,
3132,
29889,
1359,
29918,
29894,
3137,
29885,
8017,
29898,
303,
1171,
482,
29889,
657,
29918,
621,
29918,
6979,
703,
29894,
3137,
29885,
8017,
1159,
3366,
7328,
20068,
13,
1678,
565,
502,
29881,
29918,
6269,
29906,
29900,
29901,
13,
4706,
18897,
353,
3132,
29889,
657,
29918,
6979,
29918,
1761,
2141,
14538,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
5924,
18897,
29901,
426,
517,
12360,
27195,
13,
4706,
363,
5993,
297,
18897,
29901,
13,
9651,
3132,
29889,
1359,
29918,
1285,
1461,
29898,
6979,
29897,
13,
1678,
736,
3132,
13,
268,
13,
1753,
679,
29918,
621,
14625,
1026,
7295,
13,
1678,
736,
11314,
14625,
1026,
29898,
978,
29892,
1418,
481,
307,
974,
29889,
14625,
10376,
703,
621,
406,
398,
4968,
376,
621,
406,
398,
1159,
13,
13,
1753,
1510,
29918,
2585,
7295,
13,
1678,
3041,
359,
353,
6571,
13,
1678,
363,
22645,
297,
270,
2109,
1390,
29901,
13,
4706,
4833,
5527,
353,
380,
1171,
482,
29889,
657,
29918,
2585,
29898,
13140,
29889,
978,
29889,
13609,
3101,
13,
4706,
4833,
353,
4833,
29894,
3188,
29898,
978,
29892,
4833,
5527,
29889,
657,
703,
3069,
4968,
4833,
5527,
29889,
657,
703,
637,
4968,
22645,
29889,
978,
29889,
13609,
3285,
4833,
5527,
29889,
657,
703,
5630,
5783,
13,
4706,
5235,
353,
426,
320,
13,
18884,
376,
1545,
29918,
978,
29908,
584,
4833,
29889,
657,
29918,
1545,
29918,
978,
2141,
14538,
29892,
320,
13,
18884,
376,
12333,
29918,
4572,
29918,
369,
1115,
4833,
29889,
657,
29918,
12333,
29918,
4572,
29918,
369,
2141,
14538,
29892,
320,
13,
18884,
376,
12333,
29918,
17314,
29918,
369,
1115,
4833,
29889,
657,
29918,
12333,
29918,
17314,
29918,
369,
2141,
14538,
29892,
320,
13,
18884,
376,
1195,
29918,
3084,
29918,
369,
1115,
4833,
29889,
657,
29918,
1195,
29918,
3084,
29918,
369,
2141,
14538,
29892,
320,
13,
18884,
376,
2248,
1115,
22645,
29889,
1767,
29892,
320,
13,
18884,
396,
29908,
2585,
1115,
2585,
5527,
29892,
320,
13,
18884,
500,
13,
4706,
3041,
359,
29961,
13140,
29889,
978,
29889,
13609,
580,
29962,
353,
5235,
13,
1678,
4390,
29918,
2158,
29898,
7192,
359,
29897,
13,
1678,
736,
3041,
359,
13,
13,
1753,
1510,
29918,
7328,
7295,
13,
1678,
325,
4645,
353,
844,
29918,
29888,
6948,
29889,
1403,
16118,
1727,
29898,
978,
29892,
380,
1171,
482,
29889,
657,
29918,
1403,
16118,
29918,
18010,
3101,
13,
1678,
325,
29893,
4645,
353,
844,
29918,
29888,
6948,
29889,
14625,
1026,
1727,
29898,
978,
29892,
17042,
1026,
29918,
978,
29897,
13,
13,
1678,
301,
4645,
353,
844,
29918,
29888,
6948,
29889,
1403,
16118,
1727,
29898,
978,
29892,
380,
1171,
482,
29889,
657,
29918,
1982,
336,
29918,
18010,
3285,
9704,
353,
376,
1982,
336,
1159,
13,
1678,
301,
29893,
4645,
353,
844,
29918,
29888,
6948,
29889,
14625,
1026,
1727,
29898,
978,
29892,
17042,
1026,
29918,
978,
29892,
9704,
353,
376,
1982,
336,
1159,
13,
13,
1678,
321,
4645,
353,
679,
29918,
621,
4645,
580,
13,
1678,
321,
29893,
4645,
353,
679,
29918,
621,
14625,
1026,
580,
13,
13,
13,
1678,
274,
11303,
1237,
353,
8853,
1403,
16118,
1115,
29894,
4645,
29892,
376,
1982,
336,
1115,
29880,
4645,
29892,
376,
621,
406,
398,
1115,
321,
4645,
29913,
13,
1678,
281,
11303,
1237,
353,
8853,
1403,
16118,
1115,
29894,
29893,
4645,
29892,
376,
1982,
336,
1115,
29880,
29893,
4645,
29892,
376,
621,
406,
398,
1115,
321,
29893,
4645,
29913,
13,
1678,
3041,
359,
353,
6571,
13,
13,
1678,
270,
8768,
353,
380,
1171,
482,
29889,
657,
29918,
5924,
29918,
29881,
8768,
580,
13,
1678,
363,
26688,
297,
270,
8768,
29901,
13,
4706,
515,
29918,
14153,
29892,
304,
29918,
14153,
353,
380,
1171,
482,
29889,
657,
29918,
735,
305,
574,
29918,
305,
2708,
29898,
29881,
1853,
29897,
13,
13,
4706,
274,
4645,
353,
274,
11303,
1237,
29889,
657,
29898,
517,
29918,
14153,
29897,
13,
4706,
281,
4645,
353,
281,
11303,
1237,
29889,
657,
29898,
517,
29918,
14153,
29897,
13,
4706,
565,
451,
274,
4645,
470,
451,
281,
4645,
470,
451,
304,
29918,
14153,
29901,
13,
9651,
17927,
29889,
8382,
29898,
29888,
29908,
1333,
1476,
426,
517,
29918,
14153,
29913,
297,
426,
29881,
1853,
1118,
6773,
2446,
856,
1159,
13,
9651,
6773,
13,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
657,
9704,
353,
426,
517,
29918,
14153,
29913,
29871,
26688,
353,
426,
29881,
1853,
29913,
5235,
23157,
13,
4706,
3638,
414,
353,
380,
1171,
482,
29889,
657,
29918,
15452,
29918,
7328,
29918,
1761,
29898,
29881,
1853,
29892,
304,
29918,
14153,
29897,
13,
4706,
844,
29918,
29888,
6948,
29889,
1761,
29918,
7328,
29918,
3888,
29898,
617,
1593,
29892,
281,
4645,
29892,
3638,
414,
29892,
3240,
353,
3041,
359,
29897,
13,
13,
4706,
5769,
353,
380,
1171,
482,
29889,
657,
29918,
17743,
457,
29918,
7328,
29898,
29881,
1853,
29892,
304,
29918,
14153,
29897,
13,
4706,
565,
451,
5769,
29901,
13,
965,
6773,
29871,
13,
4706,
844,
29918,
29888,
6948,
29889,
1761,
29918,
7328,
29918,
3888,
29898,
617,
1593,
29892,
281,
4645,
29892,
518,
510,
2109,
1402,
3240,
353,
3041,
359,
29897,
13,
13,
13,
1678,
363,
26688,
297,
270,
8768,
29901,
13,
4706,
515,
29918,
14153,
29892,
304,
29918,
14153,
353,
380,
1171,
482,
29889,
657,
29918,
735,
305,
574,
29918,
305,
2708,
29898,
29881,
1853,
29897,
13,
13,
4706,
274,
4645,
353,
274,
11303,
1237,
29889,
657,
29898,
3166,
29918,
14153,
29897,
13,
4706,
281,
4645,
353,
281,
11303,
1237,
29889,
657,
29898,
3166,
29918,
14153,
29897,
13,
4706,
565,
451,
274,
4645,
470,
451,
281,
4645,
470,
451,
304,
29918,
14153,
29901,
13,
9651,
17927,
29889,
8382,
29898,
29888,
29908,
1333,
1476,
426,
3166,
29918,
14153,
1118,
6773,
2446,
856,
1159,
13,
9651,
6773,
13,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
657,
9704,
353,
426,
3166,
29918,
14153,
29913,
29871,
26688,
353,
426,
29881,
1853,
29913,
5235,
23157,
13,
4706,
565,
26688,
1275,
376,
29872,
29906,
6925,
1115,
13,
9651,
2414,
1536,
353,
518,
303,
1171,
482,
29889,
657,
29918,
1958,
29918,
7328,
29898,
29881,
1853,
29892,
515,
29918,
14153,
4638,
13,
4706,
1683,
29901,
13,
9651,
2414,
1536,
353,
380,
1171,
482,
29889,
657,
29918,
13556,
2147,
29918,
7328,
29918,
1761,
29898,
29881,
1853,
29892,
515,
29918,
14153,
29897,
13,
13,
4706,
844,
29918,
29888,
6948,
29889,
1761,
29918,
7328,
29918,
3888,
29898,
617,
1593,
29892,
281,
4645,
29892,
2414,
1536,
29892,
3240,
353,
3041,
359,
29897,
13,
13,
4706,
396,
348,
275,
29893,
481,
671,
14405,
13,
4706,
5769,
353,
380,
1171,
482,
29889,
657,
29918,
17743,
457,
29918,
7328,
29898,
29881,
1853,
29892,
515,
29918,
14153,
29897,
13,
4706,
565,
451,
5769,
29901,
13,
965,
6773,
29871,
13,
4706,
844,
29918,
29888,
6948,
29889,
1761,
29918,
7328,
29918,
3888,
29898,
617,
1593,
29892,
281,
4645,
29892,
518,
510,
2109,
1402,
3240,
353,
3041,
359,
29897,
13,
13,
1678,
396,
27159,
29879,
13,
1678,
2414,
1536,
353,
380,
1171,
482,
29889,
657,
29918,
13556,
2147,
29918,
7328,
29918,
1761,
703,
27159,
29879,
613,
534,
424,
668,
29889,
18118,
5607,
3289,
29897,
13,
1678,
844,
29918,
29888,
6948,
29889,
1761,
29918,
7328,
29918,
3888,
29898,
617,
1593,
29892,
281,
4645,
29892,
2414,
1536,
29892,
3240,
353,
3041,
359,
29897,
13,
13,
1678,
396,
2962,
679,
619,
2634,
3211,
5235,
13,
13,
1678,
17927,
29889,
8382,
703,
4189,
1403,
16118,
9704,
3211,
5235,
4189,
1159,
13,
1678,
4390,
29918,
2158,
29898,
7192,
359,
29897,
13,
13,
1678,
736,
3041,
359,
13,
13,
1753,
1510,
29918,
2917,
7295,
13,
1678,
3041,
359,
353,
380,
1171,
482,
29889,
657,
29918,
5527,
580,
13,
1678,
4390,
29918,
2158,
29898,
7192,
359,
29897,
13,
1678,
736,
3041,
359,
13,
13,
1753,
4770,
3258,
29918,
2997,
29918,
2585,
29918,
978,
29898,
978,
29892,
515,
29918,
14153,
29892,
2224,
353,
5124,
1125,
13,
1678,
736,
285,
29908,
29912,
2084,
1157,
3166,
29918,
14153,
3227,
978,
1836,
2585,
29908,
13,
13,
1753,
4770,
657,
29918,
2997,
29918,
3859,
29918,
3888,
29898,
2585,
29892,
5922,
1125,
13,
1678,
5235,
353,
6571,
13,
1678,
565,
451,
4833,
29889,
2344,
29918,
3859,
29901,
13,
4706,
736,
5235,
13,
13,
1678,
363,
2106,
297,
4833,
29889,
3859,
29901,
13,
4706,
2302,
353,
4833,
29889,
1972,
29918,
3859,
29918,
2798,
29898,
3859,
467,
14538,
13,
4706,
565,
2302,
1405,
29871,
29900,
29901,
13,
9651,
5235,
29961,
3859,
29889,
978,
29962,
353,
2302,
13,
1678,
736,
5235,
13,
13,
1753,
679,
29918,
2997,
29918,
3888,
29898,
978,
29892,
9704,
1125,
13,
1678,
10422,
353,
4770,
3258,
29918,
2997,
29918,
2585,
29918,
978,
29898,
978,
29892,
9704,
29897,
13,
13,
1678,
4833,
353,
1887,
2585,
29898,
978,
29892,
10422,
29892,
7700,
29897,
13,
1678,
736,
4770,
657,
29918,
2997,
29918,
3859,
29918,
3888,
29898,
2585,
29892,
4833,
29889,
3859,
29897,
13,
13,
1753,
1510,
29918,
2997,
29918,
2585,
7295,
13,
1678,
1970,
29879,
353,
5159,
13,
1678,
363,
1820,
297,
380,
1171,
482,
29889,
657,
29918,
5924,
29918,
1545,
29879,
29918,
3888,
7295,
13,
4706,
565,
1820,
29889,
27382,
2541,
703,
29894,
29908,
1125,
13,
9651,
1970,
29879,
29889,
4397,
29898,
703,
1403,
16118,
613,
1820,
876,
13,
4706,
25342,
1820,
29889,
27382,
2541,
703,
29880,
29908,
1125,
13,
9651,
1970,
29879,
29889,
4397,
29898,
703,
1982,
336,
613,
1820,
876,
13,
4706,
25342,
1820,
29889,
27382,
2541,
703,
29890,
29908,
1125,
13,
9651,
1970,
29879,
29889,
4397,
29898,
703,
3116,
29883,
613,
1820,
876,
13,
4706,
25342,
1820,
29889,
27382,
2541,
703,
29872,
29908,
1125,
13,
9651,
1970,
29879,
29889,
4397,
29898,
703,
621,
406,
398,
613,
1820,
876,
13,
1678,
3041,
359,
353,
6571,
13,
1678,
363,
1970,
297,
1970,
29879,
29901,
13,
4706,
3041,
359,
29961,
5527,
29961,
29896,
5262,
353,
679,
29918,
2997,
29918,
3888,
29898,
5527,
29961,
29896,
1402,
1970,
29961,
29900,
2314,
13,
1678,
4390,
29918,
2158,
29898,
7192,
359,
29897,
13,
1678,
736,
3041,
359,
13,
13,
1990,
664,
29918,
1545,
29898,
16854,
1125,
13,
1678,
8707,
29943,
418,
353,
29871,
29900,
13,
1678,
365,
4051,
539,
353,
29871,
29896,
13,
1678,
390,
4051,
539,
353,
29871,
29906,
13,
1678,
27827,
29934,
418,
353,
29871,
29941,
13,
13,
1753,
1051,
29918,
3084,
29918,
1545,
29879,
7295,
13,
1678,
2854,
29918,
1545,
29879,
353,
6796,
497,
3108,
13,
1678,
363,
878,
297,
664,
29918,
1545,
29901,
13,
4706,
2854,
29918,
1545,
29879,
29889,
4397,
29898,
1545,
29889,
978,
29889,
13609,
3101,
13,
1678,
736,
2854,
29918,
1545,
29879,
13,
13,
1753,
1369,
29898,
1287,
29918,
1545,
29879,
1125,
13,
1678,
565,
664,
29918,
1545,
29879,
29889,
657,
29898,
1287,
29918,
1545,
29889,
29931,
4051,
29889,
978,
29892,
7700,
1125,
13,
4706,
1510,
29918,
2997,
29918,
2585,
580,
13,
13,
1678,
565,
664,
29918,
1545,
29879,
29889,
657,
29898,
1287,
29918,
1545,
29889,
29934,
4051,
29889,
978,
29892,
7700,
1125,
13,
4706,
1018,
29901,
13,
965,
1510,
29918,
2585,
580,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1209,
13,
13,
1678,
565,
664,
29918,
1545,
29879,
29889,
657,
29898,
1287,
29918,
1545,
29889,
6007,
29943,
29889,
978,
29892,
7700,
1125,
13,
4706,
1510,
29918,
2917,
580,
13,
13,
1678,
565,
664,
29918,
1545,
29879,
29889,
657,
29898,
1287,
29918,
1545,
29889,
3035,
8353,
29889,
978,
29892,
7700,
1125,
13,
4706,
1510,
29918,
7328,
580,
13,
13,
1753,
1510,
29898,
1545,
29879,
1125,
13,
1678,
2854,
29918,
1545,
29879,
353,
1051,
29918,
3084,
29918,
1545,
29879,
580,
13,
1678,
363,
878,
297,
878,
29879,
29901,
13,
4706,
565,
878,
338,
6213,
470,
878,
451,
297,
2854,
29918,
1545,
29879,
29901,
13,
9651,
12020,
8960,
29898,
29888,
29908,
1545,
3319,
1545,
1800,
338,
8340,
426,
3084,
29918,
1545,
29879,
1836,
1159,
13,
13,
1678,
664,
29918,
1545,
29879,
353,
6571,
13,
1678,
363,
878,
297,
878,
29879,
29901,
13,
4706,
664,
29918,
1545,
29879,
29961,
1545,
29889,
21064,
580,
29962,
353,
5852,
13,
4706,
565,
878,
1275,
376,
497,
1115,
13,
9651,
363,
281,
29885,
297,
664,
29918,
1545,
29901,
13,
18884,
664,
29918,
1545,
29879,
29961,
29893,
29885,
29889,
978,
29889,
21064,
580,
29962,
353,
5852,
13,
9651,
2867,
13,
13,
1678,
1369,
29898,
1287,
29918,
1545,
29879,
29897,
13,
13,
1753,
2069,
29918,
5085,
29898,
862,
3174,
1125,
13,
1678,
610,
3174,
29889,
8551,
580,
13,
1678,
610,
3174,
29889,
4397,
703,
8477,
613,
376,
4294,
1852,
1051,
23157,
13,
1678,
610,
3174,
29889,
4397,
703,
5527,
613,
376,
2917,
934,
2224,
1024,
29889,
2322,
29901,
29890,
13809,
3167,
29889,
15135,
29880,
29892,
1284,
515,
869,
322,
847,
7070,
29914,
29890,
13809,
3167,
29914,
613,
5852,
29892,
376,
15135,
29880,
934,
613,
20136,
353,
29871,
29945,
29897,
13,
1678,
610,
3174,
29889,
4397,
703,
29894,
14625,
1026,
613,
376,
262,
29886,
4227,
17042,
1026,
934,
470,
286,
15344,
8927,
613,
5852,
29892,
376,
1445,
1024,
29914,
29885,
15344,
8927,
613,
20136,
353,
29871,
29896,
29941,
29892,
1852,
1853,
353,
6088,
5085,
29889,
1191,
1853,
29889,
10810,
29897,
13,
1678,
610,
3174,
29889,
4397,
703,
809,
284,
1026,
613,
376,
262,
29886,
4227,
17042,
1026,
934,
470,
286,
15344,
8927,
613,
5852,
29892,
376,
1445,
1024,
29914,
29885,
15344,
8927,
613,
20136,
353,
29871,
29896,
29941,
29892,
1852,
1853,
353,
6088,
5085,
29889,
1191,
1853,
29889,
10810,
29897,
13,
1678,
610,
3174,
29889,
4397,
703,
4294,
613,
285,
29908,
4294,
8829,
5235,
6389,
353,
426,
1761,
29918,
3084,
29918,
1545,
29879,
580,
1836,
613,
5852,
29892,
1051,
29918,
3084,
29918,
1545,
29879,
3101,
13,
13,
13,
1753,
1667,
29898,
1191,
29883,
29892,
1852,
29894,
1125,
13,
13,
1678,
1018,
29901,
13,
4706,
610,
3174,
353,
6088,
5085,
29898,
13322,
353,
6876,
29897,
13,
4706,
2069,
29918,
5085,
29898,
862,
3174,
29897,
13,
4706,
565,
610,
3174,
29889,
4294,
29918,
8477,
29898,
19218,
1125,
13,
9651,
736,
13,
4706,
29111,
29892,
4589,
29918,
5085,
353,
610,
3174,
29889,
657,
3670,
29898,
19218,
29897,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
17927,
29889,
2704,
29898,
29872,
29897,
13,
4706,
565,
6876,
29901,
13,
9651,
10876,
29889,
13322,
29898,
29906,
29897,
13,
4706,
736,
13,
13,
1678,
396,
23516,
1369,
363,
1192,
13,
1678,
565,
7431,
29898,
3127,
29918,
5085,
29897,
1405,
29871,
29900,
29901,
13,
4706,
610,
3174,
29889,
4294,
29918,
5085,
580,
13,
4706,
736,
29871,
13,
13,
1678,
2983,
353,
518,
3670,
363,
3523,
29892,
1852,
297,
29111,
29962,
13,
1678,
610,
3174,
29889,
3198,
29918,
13092,
29898,
7039,
29897,
13,
13,
1678,
363,
3523,
29892,
1852,
297,
29111,
29901,
13,
13,
4706,
1852,
29918,
1761,
353,
5159,
13,
4706,
565,
7431,
29898,
1191,
29897,
1405,
29871,
29900,
29901,
13,
9651,
2302,
29892,
1852,
29918,
1761,
353,
610,
3174,
29889,
5451,
29918,
1191,
29898,
3670,
29892,
1852,
29897,
13,
13,
4706,
565,
610,
3174,
29889,
275,
29918,
4352,
287,
29898,
3670,
29892,
6796,
5527,
3108,
1125,
13,
9651,
565,
7431,
29898,
1191,
29918,
1761,
29897,
2804,
29871,
29896,
29901,
13,
18884,
610,
3174,
29889,
13322,
29918,
2704,
29918,
3670,
29898,
3670,
29897,
13,
9651,
380,
1171,
482,
29889,
842,
29918,
5527,
29918,
6272,
29898,
1191,
29918,
1761,
29961,
29900,
2314,
13,
4706,
25342,
610,
3174,
29889,
275,
29918,
4352,
287,
29898,
3670,
29892,
6796,
8477,
3108,
1125,
13,
9651,
610,
3174,
29889,
4294,
29918,
5085,
580,
13,
9651,
736,
13,
4706,
25342,
610,
3174,
29889,
275,
29918,
4352,
287,
29898,
3670,
29892,
6796,
29894,
14625,
1026,
3108,
1125,
13,
9651,
565,
451,
610,
3174,
29889,
13322,
29918,
3198,
29918,
3670,
29918,
1191,
29898,
3670,
29892,
1852,
29892,
29871,
29896,
1125,
13,
18884,
736,
13,
9651,
1418,
481,
307,
974,
29889,
14625,
10376,
29889,
5504,
29918,
14625,
1026,
703,
1403,
16118,
613,
1852,
29918,
1761,
29961,
29900,
2314,
13,
4706,
25342,
610,
3174,
29889,
275,
29918,
4352,
287,
29898,
3670,
29892,
6796,
809,
284,
1026,
3108,
1125,
13,
9651,
565,
451,
610,
3174,
29889,
13322,
29918,
3198,
29918,
3670,
29918,
1191,
29898,
3670,
29892,
1852,
29892,
29871,
29896,
1125,
13,
18884,
736,
13,
9651,
1418,
481,
307,
974,
29889,
14625,
10376,
29889,
5504,
29918,
14625,
1026,
703,
621,
406,
398,
613,
1852,
29918,
1761,
29961,
29900,
2314,
13,
4706,
25342,
610,
3174,
29889,
275,
29918,
4352,
287,
29898,
3670,
29892,
6796,
4294,
3108,
1125,
13,
9651,
565,
451,
610,
3174,
29889,
13322,
29918,
3198,
29918,
3670,
29918,
1191,
29918,
1195,
29898,
3670,
29892,
1852,
29892,
29871,
29896,
1125,
13,
18884,
736,
13,
9651,
1510,
29898,
1191,
29918,
1761,
29897,
13,
9651,
736,
13,
4706,
25342,
610,
3174,
29889,
5349,
29918,
14035,
29898,
3670,
1125,
13,
9651,
610,
3174,
29889,
14035,
29898,
3670,
29892,
334,
1191,
29918,
1761,
29897,
13,
4706,
1683,
29901,
13,
9651,
12020,
8960,
29898,
29888,
29908,
1333,
1476,
19228,
3523,
29901,
426,
3670,
27195,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
29898,
2435,
29898,
9675,
29889,
19218,
29897,
448,
29871,
29896,
29892,
10876,
29889,
19218,
29961,
29896,
29901,
2314,
13,
2
] |
moe/tests/bandit/__init__.py | dstoeckel/MOE | 966 | 50446 | # -*- coding: utf-8 -*-
r"""Testing code for the (Python) bandit library.
Testing is done via the Testify package:
https://github.com/Yelp/Testify
This package includes:
* Test cases/test setup files
* Tests for bandit/epsilon: :mod:`moe.tests.bandit.epsilon`
* Tests for bandit/ucb: :mod:`moe.tests.bandit.ucb`
* Tests for bandit/bla: :mod:`moe.tests.bandit.bla`
This package includes:
* Test cases/test setup files
* Tests for classes and utils in :mod:`moe.bandit`
**Files in this package**
* :mod:`moe.tests.bandit.bandit_interface_test`: tests for :mod:`moe.bandit.interfaces.bandit_interface.BanditInterface`
* :mod:`moe.tests.bandit.bandit_test_case`: base test case for bandit tests with a simple integration test case
* :mod:`moe.tests.bandit.linkers_test`: tests for :mod:`moe.bandit.linkers`
* :mod:`moe.tests.bandit.utils_test`: tests for :mod:`moe.bandit.utils`
"""
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29878,
15945,
29908,
3057,
292,
775,
363,
278,
313,
11980,
29897,
3719,
277,
3489,
29889,
13,
13,
3057,
292,
338,
2309,
3025,
278,
4321,
1598,
3577,
29901,
13,
991,
597,
3292,
29889,
510,
29914,
29979,
295,
29886,
29914,
3057,
1598,
13,
13,
4013,
3577,
7805,
29901,
13,
13,
29930,
4321,
4251,
29914,
1688,
6230,
2066,
13,
29930,
4321,
29879,
363,
3719,
277,
29914,
5463,
29901,
584,
1545,
18078,
4346,
29872,
29889,
21150,
29889,
4980,
277,
29889,
5463,
29952,
13,
29930,
4321,
29879,
363,
3719,
277,
29914,
1682,
29890,
29901,
584,
1545,
18078,
4346,
29872,
29889,
21150,
29889,
4980,
277,
29889,
1682,
29890,
29952,
13,
29930,
4321,
29879,
363,
3719,
277,
29914,
17530,
29901,
584,
1545,
18078,
4346,
29872,
29889,
21150,
29889,
4980,
277,
29889,
17530,
29952,
13,
13,
4013,
3577,
7805,
29901,
13,
13,
29930,
4321,
4251,
29914,
1688,
6230,
2066,
13,
29930,
4321,
29879,
363,
4413,
322,
3667,
29879,
297,
584,
1545,
18078,
4346,
29872,
29889,
4980,
277,
29952,
13,
13,
1068,
10547,
297,
445,
3577,
1068,
13,
13,
29930,
584,
1545,
18078,
4346,
29872,
29889,
21150,
29889,
4980,
277,
29889,
4980,
277,
29918,
13248,
29918,
1688,
6998,
6987,
363,
584,
1545,
18078,
4346,
29872,
29889,
4980,
277,
29889,
1639,
8726,
29889,
4980,
277,
29918,
13248,
29889,
29933,
392,
277,
10448,
29952,
13,
29930,
584,
1545,
18078,
4346,
29872,
29889,
21150,
29889,
4980,
277,
29889,
4980,
277,
29918,
1688,
29918,
4878,
6998,
2967,
1243,
1206,
363,
3719,
277,
6987,
411,
263,
2560,
13465,
1243,
1206,
13,
29930,
584,
1545,
18078,
4346,
29872,
29889,
21150,
29889,
4980,
277,
29889,
2324,
414,
29918,
1688,
6998,
6987,
363,
584,
1545,
18078,
4346,
29872,
29889,
4980,
277,
29889,
2324,
414,
29952,
13,
29930,
584,
1545,
18078,
4346,
29872,
29889,
21150,
29889,
4980,
277,
29889,
13239,
29918,
1688,
6998,
6987,
363,
584,
1545,
18078,
4346,
29872,
29889,
4980,
277,
29889,
13239,
29952,
13,
13,
15945,
29908,
13,
2
] |
src/CmdArgsMgr.py | yasserprogamer/POSI-SW | 1 | 1603928 | import sys
import colors
def getArg(number:int = 1):
try:
return sys.argv[number]
except IndexError:
return False
def is_passed_max(max:int = 5):
ArgsLength = len(sys.argv)
if ArgsLength == max+1:
print(f"{colors.Color.White}=> {colors.Color.Red}You can't pass more than {max} args. {colors.Color.White}<={colors.Color.reset}")
print()
return True
return False
def run():
for nothing in 5:
print("shutup") | [
1,
1053,
10876,
30004,
13,
5215,
11955,
30004,
13,
30004,
13,
1753,
679,
8559,
29898,
4537,
29901,
524,
353,
29871,
29896,
1125,
30004,
13,
1678,
1018,
29901,
30004,
13,
4706,
736,
10876,
29889,
19218,
29961,
4537,
29962,
30004,
13,
1678,
5174,
11374,
2392,
29901,
30004,
13,
4706,
736,
7700,
30004,
13,
30004,
13,
1753,
338,
29918,
3364,
287,
29918,
3317,
29898,
3317,
29901,
524,
353,
29871,
29945,
1125,
30004,
13,
1678,
826,
3174,
6513,
353,
7431,
29898,
9675,
29889,
19218,
8443,
13,
1678,
565,
826,
3174,
6513,
1275,
4236,
29974,
29896,
29901,
30004,
13,
4706,
1596,
29898,
29888,
29908,
29912,
27703,
29889,
3306,
29889,
21823,
29913,
4261,
426,
27703,
29889,
3306,
29889,
9039,
29913,
3492,
508,
29915,
29873,
1209,
901,
1135,
426,
3317,
29913,
6389,
29889,
426,
27703,
29889,
3306,
29889,
21823,
29913,
29966,
3790,
27703,
29889,
3306,
29889,
12071,
27195,
30004,
13,
4706,
1596,
26471,
13,
4706,
736,
5852,
30004,
13,
1678,
736,
7700,
30004,
13,
30004,
13,
1753,
1065,
7295,
30004,
13,
1678,
363,
3078,
297,
29871,
29945,
29901,
30004,
13,
4706,
1596,
703,
845,
329,
786,
1159,
2
] |
nn.py | sumitsk/cspace_belief | 3 | 25468 | <reponame>sumitsk/cspace_belief
#!/usr/bin/env python -W ignore::DeprecationWarning
import numpy as np
import os
import knn
import warnings
warnings.filterwarnings("ignore")
from sklearn.neighbors import NearestNeighbors, LSHForest
if __name__ == '__main__':
files = (['env_shelf01', 'env_table1', 'env_table3',
'env_shelf02', 'env_kitchen1', 'env_kitchen2',
'env_kitchen_refrigerator', 'env_kitchen_microwave'])
local_path = os.getcwd()
training_set_path = os.path.join(local_path, "imp_samples/sobol_samples_1_7/")
test_set_path = os.path.join(local_path, "test_set/")
results_path = os.path.join(local_path, "metric_results/")
cfree_val = -1.0
cobs_val = 1.0
threshold = 0.0
d = cobs_val - cfree_val
dim = 7
k_values = [1, 5, 10, 15, 20]
N_values = [1000, 5000, 10000, 15000, 20000]
avg_accnn = np.zeros((len(N_values), len(k_values)))
avg_errnn = np.zeros((len(N_values), len(k_values)))
avg_accann = np.zeros((len(N_values), len(k_values)))
avg_errann = np.zeros((len(N_values), len(k_values)))
for i in range(len(files)):
print('------------------', files[i], '------------------')
accnn = np.zeros((len(N_values), len(k_values)))
errnn = np.zeros((len(N_values), len(k_values)))
accann = np.zeros((len(N_values), len(k_values)))
errann = np.zeros((len(N_values), len(k_values)))
accmnn = np.zeros((len(N_values), len(k_values)))
errmnn = np.zeros((len(N_values), len(k_values)))
accmann = np.zeros((len(N_values), len(k_values)))
errmann = np.zeros((len(N_values), len(k_values)))
for j in range(len(N_values)):
training_set_size = N_values[j]
test_set_size = training_set_size / 10
print("training_set_size:", training_set_size)
fn = 'sobol_' + files[i] + '_' + str(training_set_size) + '.npz'
n = np.load(os.path.join(training_set_path,fn))
training_set = n['samples']
training_set_ccr = n['ccr']
sjw = n['sjw']
S = np.cov(training_set.transpose())
inv_cov = np.linalg.inv(S)
fn1 = files[i] + '_' + str(N_values[j]) + '.npz'
n1 = np.load(os.path.join(test_set_path, fn1))
test_set = n1['test_set']
ccr = n1['ccr']
lshf = LSHForest()
lshf.fit(training_set)
nbrs = NearestNeighbors()
nbrs.fit(training_set)
cprnn = np.ones((test_set_size, len(k_values)))
cprann = np.ones((test_set_size, len(k_values)))
cprmnn = np.ones((test_set_size, len(k_values)))
cprmann = np.ones((test_set_size, len(k_values)))
idx = 0
while idx < test_set_size:
query = test_set[idx]
for t in range(len(k_values)):
n_neighbors = k_values[t]
cprnn[idx,t] = knn.nn_predictor(query, training_set, training_set_ccr, nbrs, n_neighbors,
method='r', weights=sjw)
cprann[idx,t] = knn.nn_predictor(query, training_set, training_set_ccr, lshf, n_neighbors,
method='r', weights=sjw)
cprmnn[idx,t] = knn.nn_predictor(query, training_set, training_set_ccr, nbrs, n_neighbors,
method='r', weights=sjw, inv_cov=inv_cov)
cprmann[idx,t] = knn.nn_predictor(query, training_set, training_set_ccr, lshf, n_neighbors,
method='r', weights=sjw, inv_cov=inv_cov)
# print(cprmann[idx,t] , cprann[idx,t]
# raw_input("s")
idx = idx + 1
for t in range(len(k_values)):
accnn[j,t] = 1.0*np.sum((cprnn[:,t] > threshold) == (ccr == cobs_val)) / test_set_size
accann[j,t] = 1.0*np.sum((cprann[:,t] > threshold) == (ccr == cobs_val)) / test_set_size
errnn[j,t] = np.sum(np.absolute(cprnn[:,t] - ccr)) / d / test_set_size
errann[j,t] = np.sum(np.absolute(cprann[:,t] - ccr)) / d / test_set_size
accmnn[j,t] = 1.0*np.sum((cprmnn[:,t] > threshold) == (ccr == cobs_val)) / test_set_size
accmann[j,t] = 1.0*np.sum((cprmann[:,t] > threshold) == (ccr == cobs_val)) / test_set_size
errmnn[j,t] = np.sum(np.absolute(cprmnn[:,t] - ccr)) / d / test_set_size
errmann[j,t] = np.sum(np.absolute(cprmann[:,t] - ccr)) / d / test_set_size
# print(accnn[j,t] , errnn[j,t], accann[j,t] , errann[j,t]
# print(accmnn[j,t] , errmnn[j,t], accmann[j,t] , errmann[j,t]
avg_accnn = avg_accnn + accnn
avg_errnn = avg_errnn + errnn
avg_accann = avg_accann + accann
avg_errann = avg_errann + errann
np.savez(os.path.join(results_path, files[i]+'_NN_w'),
accnn=accnn, accann=accann, errnn=errnn, errann=errann)
np.savez(os.path.join(results_path, files[i]+'_NN_m_w'),
accnn=accmnn, accann=accmann, errnn=errmnn, errann=errmann)
print(accnn, accmnn)
avg_accnn = avg_accnn / len(files)
avg_errnn = avg_errnn / len(files)
avg_accann = avg_accann / len(files)
avg_errann = avg_errann / len(files)
print("average_values:", avg_accnn, avg_accann, avg_errnn, avg_errann)
| [
1,
529,
276,
1112,
420,
29958,
2083,
277,
808,
29914,
29883,
3493,
29918,
6596,
2575,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
448,
29956,
11455,
1057,
8498,
3757,
362,
22709,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
2897,
13,
5215,
889,
29876,
13,
13,
5215,
18116,
13,
25442,
886,
29889,
4572,
25442,
886,
703,
17281,
1159,
13,
13,
3166,
2071,
19668,
29889,
484,
1141,
29890,
943,
1053,
26206,
342,
8139,
1141,
29890,
943,
29892,
365,
7068,
2831,
342,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
2066,
353,
313,
1839,
6272,
29918,
845,
761,
29900,
29896,
742,
525,
6272,
29918,
2371,
29896,
742,
525,
6272,
29918,
2371,
29941,
742,
13,
795,
525,
6272,
29918,
845,
761,
29900,
29906,
742,
525,
6272,
29918,
29895,
23213,
29896,
742,
525,
6272,
29918,
29895,
23213,
29906,
742,
13,
795,
525,
6272,
29918,
29895,
23213,
29918,
999,
29878,
4087,
1061,
742,
525,
6272,
29918,
29895,
23213,
29918,
13076,
798,
1351,
11287,
259,
13,
268,
13,
1678,
1887,
29918,
2084,
353,
2897,
29889,
657,
29883,
9970,
580,
13,
1678,
6694,
29918,
842,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2997,
29918,
2084,
29892,
376,
6574,
29918,
27736,
29914,
578,
2095,
29918,
27736,
29918,
29896,
29918,
29955,
29914,
1159,
13,
1678,
1243,
29918,
842,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2997,
29918,
2084,
29892,
376,
1688,
29918,
842,
29914,
1159,
13,
1678,
2582,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2997,
29918,
2084,
29892,
376,
16414,
29918,
9902,
29914,
1159,
13,
13,
1678,
274,
9021,
29918,
791,
353,
448,
29896,
29889,
29900,
13,
1678,
274,
26290,
29918,
791,
353,
29871,
29896,
29889,
29900,
13,
1678,
16897,
353,
29871,
29900,
29889,
29900,
13,
1678,
270,
353,
274,
26290,
29918,
791,
448,
274,
9021,
29918,
791,
13,
1678,
3964,
353,
29871,
29955,
13,
13,
1678,
413,
29918,
5975,
353,
518,
29896,
29892,
29871,
29945,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29945,
29892,
29871,
29906,
29900,
29962,
13,
1678,
405,
29918,
5975,
353,
518,
29896,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
29900,
29892,
29871,
29896,
29945,
29900,
29900,
29900,
29892,
29871,
29906,
29900,
29900,
29900,
29900,
29962,
13,
13,
1678,
1029,
29887,
29918,
5753,
15755,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
1678,
1029,
29887,
29918,
3127,
15755,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
1678,
1029,
29887,
29918,
5753,
812,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
1678,
1029,
29887,
29918,
261,
661,
29876,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
13,
1678,
363,
474,
297,
3464,
29898,
2435,
29898,
5325,
22164,
13,
4706,
1596,
877,
2683,
489,
742,
2066,
29961,
29875,
1402,
525,
2683,
489,
1495,
13,
4706,
1035,
15755,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
4706,
4589,
15755,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
4706,
1035,
812,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
4706,
604,
661,
29876,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
4706,
1035,
29885,
15755,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
4706,
604,
1758,
15755,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
4706,
1035,
4403,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
4706,
604,
1758,
812,
353,
7442,
29889,
3298,
359,
3552,
2435,
29898,
29940,
29918,
5975,
511,
7431,
29898,
29895,
29918,
5975,
4961,
29871,
13,
308,
13,
4706,
363,
432,
297,
3464,
29898,
2435,
29898,
29940,
29918,
5975,
22164,
13,
9651,
6694,
29918,
842,
29918,
2311,
353,
405,
29918,
5975,
29961,
29926,
29962,
13,
9651,
1243,
29918,
842,
29918,
2311,
353,
6694,
29918,
842,
29918,
2311,
847,
29871,
29896,
29900,
13,
632,
13,
9651,
1596,
703,
26495,
29918,
842,
29918,
2311,
29901,
613,
6694,
29918,
842,
29918,
2311,
29897,
13,
9651,
7876,
353,
525,
578,
2095,
29918,
29915,
718,
2066,
29961,
29875,
29962,
718,
22868,
29915,
718,
851,
29898,
26495,
29918,
842,
29918,
2311,
29897,
718,
15300,
9302,
29920,
29915,
13,
9651,
302,
353,
7442,
29889,
1359,
29898,
359,
29889,
2084,
29889,
7122,
29898,
26495,
29918,
842,
29918,
2084,
29892,
9144,
876,
13,
9651,
6694,
29918,
842,
353,
302,
1839,
27736,
2033,
13,
9651,
6694,
29918,
842,
29918,
617,
29878,
353,
302,
1839,
617,
29878,
2033,
13,
9651,
19421,
29893,
353,
302,
1839,
29879,
29926,
29893,
2033,
13,
9651,
317,
353,
7442,
29889,
24542,
29898,
26495,
29918,
842,
29889,
3286,
4220,
3101,
13,
9651,
2437,
29918,
24542,
353,
7442,
29889,
29880,
979,
29887,
29889,
11569,
29898,
29903,
29897,
13,
632,
13,
9651,
7876,
29896,
353,
2066,
29961,
29875,
29962,
718,
22868,
29915,
718,
851,
29898,
29940,
29918,
5975,
29961,
29926,
2314,
718,
15300,
9302,
29920,
29915,
13,
9651,
302,
29896,
353,
7442,
29889,
1359,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
842,
29918,
2084,
29892,
7876,
29896,
876,
13,
9651,
1243,
29918,
842,
353,
302,
29896,
1839,
1688,
29918,
842,
2033,
13,
9651,
274,
7283,
353,
302,
29896,
1839,
617,
29878,
2033,
13,
13,
9651,
301,
845,
29888,
353,
365,
7068,
2831,
342,
580,
13,
9651,
301,
845,
29888,
29889,
9202,
29898,
26495,
29918,
842,
29897,
13,
13,
9651,
302,
1182,
29879,
353,
26206,
342,
8139,
1141,
29890,
943,
580,
13,
9651,
302,
1182,
29879,
29889,
9202,
29898,
26495,
29918,
842,
29897,
13,
632,
13,
9651,
274,
558,
15755,
353,
7442,
29889,
2873,
3552,
1688,
29918,
842,
29918,
2311,
29892,
7431,
29898,
29895,
29918,
5975,
4961,
13,
9651,
274,
558,
812,
353,
7442,
29889,
2873,
3552,
1688,
29918,
842,
29918,
2311,
29892,
7431,
29898,
29895,
29918,
5975,
4961,
13,
9651,
274,
558,
29885,
15755,
353,
7442,
29889,
2873,
3552,
1688,
29918,
842,
29918,
2311,
29892,
7431,
29898,
29895,
29918,
5975,
4961,
13,
9651,
274,
558,
4403,
353,
7442,
29889,
2873,
3552,
1688,
29918,
842,
29918,
2311,
29892,
7431,
29898,
29895,
29918,
5975,
4961,
13,
13,
9651,
22645,
353,
29871,
29900,
13,
9651,
1550,
22645,
529,
1243,
29918,
842,
29918,
2311,
29901,
13,
18884,
2346,
353,
1243,
29918,
842,
29961,
13140,
29962,
13,
13,
18884,
363,
260,
297,
3464,
29898,
2435,
29898,
29895,
29918,
5975,
22164,
259,
13,
462,
1678,
302,
29918,
484,
1141,
29890,
943,
353,
413,
29918,
5975,
29961,
29873,
29962,
13,
13,
462,
1678,
274,
558,
15755,
29961,
13140,
29892,
29873,
29962,
353,
889,
29876,
29889,
15755,
29918,
27711,
272,
29898,
1972,
29892,
6694,
29918,
842,
29892,
6694,
29918,
842,
29918,
617,
29878,
29892,
302,
1182,
29879,
29892,
302,
29918,
484,
1141,
29890,
943,
29892,
13,
462,
462,
462,
1678,
1158,
2433,
29878,
742,
18177,
29922,
29879,
29926,
29893,
29897,
13,
462,
1678,
274,
558,
812,
29961,
13140,
29892,
29873,
29962,
353,
889,
29876,
29889,
15755,
29918,
27711,
272,
29898,
1972,
29892,
6694,
29918,
842,
29892,
6694,
29918,
842,
29918,
617,
29878,
29892,
301,
845,
29888,
29892,
302,
29918,
484,
1141,
29890,
943,
29892,
13,
462,
462,
462,
268,
1158,
2433,
29878,
742,
18177,
29922,
29879,
29926,
29893,
29897,
13,
462,
1678,
274,
558,
29885,
15755,
29961,
13140,
29892,
29873,
29962,
353,
889,
29876,
29889,
15755,
29918,
27711,
272,
29898,
1972,
29892,
6694,
29918,
842,
29892,
6694,
29918,
842,
29918,
617,
29878,
29892,
302,
1182,
29879,
29892,
302,
29918,
484,
1141,
29890,
943,
29892,
13,
462,
462,
462,
268,
1158,
2433,
29878,
742,
18177,
29922,
29879,
29926,
29893,
29892,
2437,
29918,
24542,
29922,
11569,
29918,
24542,
29897,
13,
462,
1678,
274,
558,
4403,
29961,
13140,
29892,
29873,
29962,
353,
889,
29876,
29889,
15755,
29918,
27711,
272,
29898,
1972,
29892,
6694,
29918,
842,
29892,
6694,
29918,
842,
29918,
617,
29878,
29892,
301,
845,
29888,
29892,
302,
29918,
484,
1141,
29890,
943,
29892,
13,
462,
462,
462,
418,
1158,
2433,
29878,
742,
18177,
29922,
29879,
29926,
29893,
29892,
2437,
29918,
24542,
29922,
11569,
29918,
24542,
29897,
13,
462,
1678,
396,
1596,
29898,
29883,
558,
4403,
29961,
13140,
29892,
29873,
29962,
1919,
274,
558,
812,
29961,
13140,
29892,
29873,
29962,
13,
462,
1678,
396,
10650,
29918,
2080,
703,
29879,
1159,
268,
13,
18884,
22645,
353,
22645,
718,
29871,
29896,
13,
308,
13,
9651,
363,
260,
297,
3464,
29898,
2435,
29898,
29895,
29918,
5975,
22164,
259,
13,
18884,
1035,
15755,
29961,
29926,
29892,
29873,
29962,
353,
29871,
29896,
29889,
29900,
29930,
9302,
29889,
2083,
3552,
29883,
558,
15755,
7503,
29892,
29873,
29962,
1405,
16897,
29897,
1275,
313,
617,
29878,
1275,
274,
26290,
29918,
791,
876,
847,
1243,
29918,
842,
29918,
2311,
13,
18884,
1035,
812,
29961,
29926,
29892,
29873,
29962,
353,
29871,
29896,
29889,
29900,
29930,
9302,
29889,
2083,
3552,
29883,
558,
812,
7503,
29892,
29873,
29962,
1405,
16897,
29897,
1275,
313,
617,
29878,
1275,
274,
26290,
29918,
791,
876,
847,
1243,
29918,
842,
29918,
2311,
13,
13,
18884,
4589,
15755,
29961,
29926,
29892,
29873,
29962,
353,
7442,
29889,
2083,
29898,
9302,
29889,
23552,
29898,
29883,
558,
15755,
7503,
29892,
29873,
29962,
448,
274,
7283,
876,
847,
270,
847,
1243,
29918,
842,
29918,
2311,
13,
18884,
604,
661,
29876,
29961,
29926,
29892,
29873,
29962,
353,
7442,
29889,
2083,
29898,
9302,
29889,
23552,
29898,
29883,
558,
812,
7503,
29892,
29873,
29962,
448,
274,
7283,
876,
847,
270,
847,
1243,
29918,
842,
29918,
2311,
13,
13,
18884,
1035,
29885,
15755,
29961,
29926,
29892,
29873,
29962,
353,
29871,
29896,
29889,
29900,
29930,
9302,
29889,
2083,
3552,
29883,
558,
29885,
15755,
7503,
29892,
29873,
29962,
1405,
16897,
29897,
1275,
313,
617,
29878,
1275,
274,
26290,
29918,
791,
876,
847,
1243,
29918,
842,
29918,
2311,
13,
18884,
1035,
4403,
29961,
29926,
29892,
29873,
29962,
353,
29871,
29896,
29889,
29900,
29930,
9302,
29889,
2083,
3552,
29883,
558,
4403,
7503,
29892,
29873,
29962,
1405,
16897,
29897,
1275,
313,
617,
29878,
1275,
274,
26290,
29918,
791,
876,
847,
1243,
29918,
842,
29918,
2311,
13,
13,
18884,
604,
1758,
15755,
29961,
29926,
29892,
29873,
29962,
353,
7442,
29889,
2083,
29898,
9302,
29889,
23552,
29898,
29883,
558,
29885,
15755,
7503,
29892,
29873,
29962,
448,
274,
7283,
876,
847,
270,
847,
1243,
29918,
842,
29918,
2311,
13,
18884,
604,
1758,
812,
29961,
29926,
29892,
29873,
29962,
353,
7442,
29889,
2083,
29898,
9302,
29889,
23552,
29898,
29883,
558,
4403,
7503,
29892,
29873,
29962,
448,
274,
7283,
876,
847,
270,
847,
1243,
29918,
842,
29918,
2311,
13,
13,
18884,
396,
1596,
29898,
5753,
15755,
29961,
29926,
29892,
29873,
29962,
1919,
4589,
15755,
29961,
29926,
29892,
29873,
1402,
1035,
812,
29961,
29926,
29892,
29873,
29962,
1919,
604,
661,
29876,
29961,
29926,
29892,
29873,
29962,
13,
18884,
396,
1596,
29898,
562,
4912,
15755,
29961,
29926,
29892,
29873,
29962,
1919,
604,
1758,
15755,
29961,
29926,
29892,
29873,
1402,
1035,
4403,
29961,
29926,
29892,
29873,
29962,
1919,
604,
1758,
812,
29961,
29926,
29892,
29873,
29962,
268,
13,
13,
4706,
1029,
29887,
29918,
5753,
15755,
353,
1029,
29887,
29918,
5753,
15755,
718,
1035,
15755,
13,
4706,
1029,
29887,
29918,
3127,
15755,
353,
1029,
29887,
29918,
3127,
15755,
718,
4589,
15755,
13,
4706,
1029,
29887,
29918,
5753,
812,
353,
1029,
29887,
29918,
5753,
812,
718,
1035,
812,
13,
4706,
1029,
29887,
29918,
261,
661,
29876,
353,
1029,
29887,
29918,
261,
661,
29876,
718,
604,
661,
29876,
13,
13,
4706,
7442,
29889,
7620,
29920,
29898,
359,
29889,
2084,
29889,
7122,
29898,
9902,
29918,
2084,
29892,
2066,
29961,
29875,
10062,
15972,
10262,
29918,
29893,
5477,
13,
462,
1678,
1035,
15755,
29922,
5753,
15755,
29892,
1035,
812,
29922,
5753,
812,
29892,
4589,
15755,
29922,
3127,
15755,
29892,
604,
661,
29876,
29922,
261,
661,
29876,
29897,
29871,
13,
4706,
7442,
29889,
7620,
29920,
29898,
359,
29889,
2084,
29889,
7122,
29898,
9902,
29918,
2084,
29892,
2066,
29961,
29875,
10062,
15972,
10262,
29918,
29885,
29918,
29893,
5477,
13,
462,
1678,
1035,
15755,
29922,
562,
4912,
15755,
29892,
1035,
812,
29922,
5753,
4403,
29892,
4589,
15755,
29922,
261,
1758,
15755,
29892,
604,
661,
29876,
29922,
261,
1758,
812,
29897,
13,
4706,
1596,
29898,
5753,
15755,
29892,
1035,
29885,
15755,
29897,
13,
308,
13,
1678,
1029,
29887,
29918,
5753,
15755,
353,
1029,
29887,
29918,
5753,
15755,
847,
7431,
29898,
5325,
29897,
13,
1678,
1029,
29887,
29918,
3127,
15755,
353,
1029,
29887,
29918,
3127,
15755,
847,
7431,
29898,
5325,
29897,
13,
1678,
1029,
29887,
29918,
5753,
812,
353,
1029,
29887,
29918,
5753,
812,
847,
7431,
29898,
5325,
29897,
13,
1678,
1029,
29887,
29918,
261,
661,
29876,
353,
1029,
29887,
29918,
261,
661,
29876,
847,
7431,
29898,
5325,
29897,
13,
13,
1678,
1596,
703,
12483,
482,
29918,
5975,
29901,
613,
1029,
29887,
29918,
5753,
15755,
29892,
1029,
29887,
29918,
5753,
812,
29892,
1029,
29887,
29918,
3127,
15755,
29892,
1029,
29887,
29918,
261,
661,
29876,
29897,
13,
2
] |
TempDataProcess/ComputeMonthAvg.py | jmcgra1/Global-Warming-Visualization | 0 | 110011 | import psycopg2
#Connects to db
con = psycopg2.connect(
host = "localhost",
database = "tempdata",
user = "jack",
password = "<PASSWORD>")
#Create Cursor
cur = con.cursor()
#Execute Query
cur.execute("select distinct(country) from temperatures;")
#Catch all results as countries
countries = cur.fetchall()
#Create second cursor for averages query
cur2 = con.cursor()
#Create third cursor for insertion into monthavg
cur3 = con.cursor()
avgmonth = 0.0
for i in countries:
for c in i:
for j in range(1,13):
cur2.execute("select avg(temp) from temperatures where country = %s and month = %s;",(c,j))
avgmonth = cur2.fetchall()
for avg in avgmonth:
cur3.execute("insert into monthavg(country, month, avgtemp) values(%s,%s,%s);",(c,j,avg))
#Commit any changes
con.commit()
#Close Cursor
cur.close()
cur2.close()
cur3.close()
#Closes Connection
con.close() | [
1,
1053,
6529,
29891,
9708,
29887,
29906,
13,
13,
29937,
17918,
29879,
304,
4833,
13,
535,
353,
6529,
29891,
9708,
29887,
29906,
29889,
6915,
29898,
13,
9651,
3495,
353,
376,
7640,
613,
13,
9651,
2566,
353,
376,
7382,
1272,
613,
13,
9651,
1404,
353,
376,
21452,
613,
13,
9651,
4800,
353,
9872,
25711,
17013,
29958,
1159,
13,
13,
29937,
4391,
315,
5966,
13,
2764,
353,
378,
29889,
18127,
580,
13,
29937,
12296,
13641,
13,
2764,
29889,
7978,
703,
2622,
8359,
29898,
13509,
29897,
515,
6238,
3698,
29936,
1159,
13,
29937,
29907,
905,
599,
2582,
408,
10916,
13,
2798,
2722,
353,
3151,
29889,
9155,
497,
580,
13,
13,
29937,
4391,
1473,
10677,
363,
4759,
1179,
2346,
13,
2764,
29906,
353,
378,
29889,
18127,
580,
13,
29937,
4391,
4654,
10677,
363,
4635,
291,
964,
4098,
485,
29887,
13,
2764,
29941,
353,
378,
29889,
18127,
580,
13,
485,
29887,
10874,
353,
29871,
29900,
29889,
29900,
13,
1454,
474,
297,
10916,
29901,
13,
1678,
363,
274,
297,
474,
29901,
13,
4706,
363,
432,
297,
3464,
29898,
29896,
29892,
29896,
29941,
1125,
13,
9651,
3151,
29906,
29889,
7978,
703,
2622,
1029,
29887,
29898,
7382,
29897,
515,
6238,
3698,
988,
4234,
353,
1273,
29879,
322,
4098,
353,
1273,
29879,
29936,
613,
29898,
29883,
29892,
29926,
876,
13,
9651,
1029,
29887,
10874,
353,
3151,
29906,
29889,
9155,
497,
580,
13,
9651,
363,
1029,
29887,
297,
1029,
29887,
10874,
29901,
13,
18884,
3151,
29941,
29889,
7978,
703,
7851,
964,
4098,
485,
29887,
29898,
13509,
29892,
4098,
29892,
1029,
29887,
7382,
29897,
1819,
29414,
29879,
24163,
29879,
24163,
29879,
416,
613,
29898,
29883,
29892,
29926,
29892,
485,
29887,
876,
13,
13,
29937,
1523,
2415,
738,
3620,
13,
535,
29889,
15060,
580,
13,
13,
29937,
11123,
315,
5966,
13,
2764,
29889,
5358,
580,
13,
2764,
29906,
29889,
5358,
580,
13,
2764,
29941,
29889,
5358,
580,
13,
29937,
29907,
5409,
267,
15160,
13,
535,
29889,
5358,
580,
2
] |
speechdb/migrations/0019_work_lang.py | bmverhel/dices | 0 | 120037 | # Generated by Django 3.1.8 on 2021-06-21 13:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('speechdb', '0018_auto_20210621_0958'),
]
operations = [
migrations.AddField(
model_name='work',
name='lang',
field=models.CharField(choices=[('greek', 'Greek'), ('latin', 'Latin')], default='latin', max_length=8),
preserve_default=False,
),
]
| [
1,
396,
3251,
630,
491,
15337,
29871,
29941,
29889,
29896,
29889,
29947,
373,
29871,
29906,
29900,
29906,
29896,
29899,
29900,
29953,
29899,
29906,
29896,
29871,
29896,
29941,
29901,
29945,
29941,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
5965,
5309,
2585,
742,
525,
29900,
29900,
29896,
29947,
29918,
6921,
29918,
29906,
29900,
29906,
29896,
29900,
29953,
29906,
29896,
29918,
29900,
29929,
29945,
29947,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
1287,
742,
13,
9651,
1024,
2433,
3893,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
1859,
1575,
11759,
877,
29887,
7285,
742,
525,
29954,
7285,
5477,
6702,
5066,
262,
742,
525,
13992,
262,
1495,
1402,
2322,
2433,
5066,
262,
742,
4236,
29918,
2848,
29922,
29947,
511,
13,
9651,
19905,
29918,
4381,
29922,
8824,
29892,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
picdown/picdown/items.py | gamegrd/discuz_spider | 3 | 76392 | <gh_stars>1-10
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy.item import Item, Field
class PicdownItem(Item):
# define the fields for your item here like:
# name = Field()
#text = Field()
image_urls = Field()
image_paths = Field()
site_url = Field()
time = Field()
text = Field()
#link = Field()
pass
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
22402,
1244,
278,
4733,
363,
596,
885,
2390,
287,
4452,
13,
29937,
13,
29937,
2823,
5106,
297,
29901,
13,
29937,
1732,
597,
1514,
29889,
1557,
336,
2272,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
7076,
29889,
1420,
13,
13,
3166,
24559,
2272,
29889,
667,
1053,
10976,
29892,
8989,
13,
13,
1990,
14612,
3204,
2001,
29898,
2001,
1125,
13,
1678,
396,
4529,
278,
4235,
363,
596,
2944,
1244,
763,
29901,
13,
1678,
396,
1024,
353,
8989,
580,
13,
1678,
396,
726,
353,
8989,
580,
13,
1678,
1967,
29918,
26045,
353,
8989,
580,
13,
1678,
1967,
29918,
24772,
353,
8989,
580,
13,
1678,
3268,
29918,
2271,
353,
8989,
580,
13,
1678,
931,
353,
8989,
580,
13,
1678,
1426,
353,
8989,
580,
13,
1678,
396,
2324,
353,
8989,
580,
13,
1678,
1209,
13,
2
] |
setup.py | myyc/cruijff | 0 | 143511 | <reponame>myyc/cruijff<filename>setup.py<gh_stars>0
from setuptools import setup
from cruijff.constants import __version__
DESC = """
TBD
"""
setup(
name="cruijff",
version=__version__,
author="myyc",
description="Some football data",
license="BSD",
keywords="data mining football python pandas mysql mongodb",
packages=["cruijff", "cruijff.espn", "cruijff.opta"],
long_description=DESC,
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
install_requires=["requests", "pandas", "redis", "bs4", "sqlalchemy",
"mysqlclient", "appdirs", "pymongo", "pendulum",
"mnemon"],
)
| [
1,
529,
276,
1112,
420,
29958,
1357,
11078,
29914,
29883,
582,
823,
600,
29966,
9507,
29958,
14669,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
731,
21245,
8789,
1053,
6230,
13,
13,
3166,
7618,
823,
600,
29889,
3075,
1934,
1053,
4770,
3259,
1649,
13,
13,
2287,
7187,
353,
9995,
13,
24895,
29928,
13,
15945,
29908,
13,
13,
13,
14669,
29898,
13,
1678,
1024,
543,
29883,
582,
823,
600,
613,
13,
1678,
1873,
29922,
1649,
3259,
1649,
29892,
13,
1678,
4148,
543,
1357,
11078,
613,
13,
1678,
6139,
543,
9526,
5733,
848,
613,
13,
1678,
19405,
543,
29933,
7230,
613,
13,
1678,
29361,
543,
1272,
1375,
292,
5733,
3017,
11701,
5749,
23290,
613,
13,
1678,
9741,
29922,
3366,
29883,
582,
823,
600,
613,
376,
29883,
582,
823,
600,
29889,
9983,
29876,
613,
376,
29883,
582,
823,
600,
29889,
3670,
29874,
12436,
13,
1678,
1472,
29918,
8216,
29922,
2287,
7187,
29892,
13,
1678,
770,
14903,
11759,
13,
4706,
376,
21956,
358,
16034,
4761,
29871,
29906,
448,
4721,
29899,
28630,
613,
13,
4706,
376,
7031,
293,
4761,
22310,
1907,
613,
13,
4706,
376,
29931,
293,
1947,
4761,
438,
5425,
28268,
1490,
4761,
350,
7230,
19245,
613,
13,
1678,
21251,
13,
1678,
2601,
29918,
276,
339,
2658,
29922,
3366,
24830,
613,
376,
15112,
613,
376,
1127,
275,
613,
376,
5824,
29946,
613,
376,
2850,
284,
305,
6764,
613,
13,
462,
418,
376,
7938,
4645,
613,
376,
932,
3972,
29879,
613,
376,
29886,
962,
7443,
613,
376,
14081,
352,
398,
613,
13,
462,
418,
376,
23521,
9857,
12436,
13,
29897,
13,
2
] |
olfactometer/smell_engine_communicator.py | asu-meteor/The-Smell-Engine | 1 | 33935 | <gh_stars>1-10
import struct
import select
import socket
import sys
import binascii
import getopt
import time
import quantities as pq
from collections import deque
import numpy as np
import datetime
import typer
from typing import Optional
from pprint import pprint
from olfactometer.smell_engine import SmellEngine
from olfactometer.data_container import DataContainer
class SmellEngineCommunicator:
"""
SmellEngineCommunicator establishes a network comm line between Unity and Smell Engine.
First the equipment is configured, then the socket waits for a connection (client devices)
Once client connection is established, PubChemID's are assigned, ValveDriver is instantiated,
then socket loops continuously listening for sets of data.
Attributes:
debug_mode: flag for physical vs simulated hardware specified via command-line.
"""
def __init__(self, debug_mode=False, odor_table=None, write_flag=False):
print("Initializing")
self.write_flag = write_flag
self.debug_mode = debug_mode
self.odor_table = odor_table
self.data_container = DataContainer()
# CREATE TCP/IP SOCKET
self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server.setblocking(0)
self.server.settimeout(1)
self.server.bind(('localhost', 12345))
self.num_odorants = 0
self.last_concentrations = []
print("Listening for clients..")
self.server.listen(1)
# Sockets from which we expect to read
self.inputs = [ self.server ]
# Sockets to which we expect to write
self.outputs = [ ]
self.smell_engine = None
self.initialized = False
self.init_main_loop()
def init_main_loop(self):
while self.inputs:
readable, writable, exceptional = select.select(self.inputs, self.outputs, self.inputs, 1)
if not readable:
print("Skip")
time.sleep(1)
else:
# Handle inputs
for select_readables in readable:
if select_readables is self.server:
# A "readable" server socket is ready to accept a connection
self.client, self.client_adr = self.server.accept()
print("Client connected at:\t" + str(self.client_adr))
self.inputs.append(self.client)
self.client.setblocking(0)
self.inputs.append(self.client)
else:
if (self.num_odorants == 0): self.receive_quantity_odorants()
else:
if not self.smell_engine:
self.smell_engine = SmellEngine(data_container=self.data_container, debug_mode=self.debug_mode,
write_flag=self.write_flag,PID_mode=False, look_up_table_path=self.odor_table)
elif not len(self.smell_engine.om_ids) > 0:
self.smell_engine.set_odorant_molecule_ids(self.receive_pub_chemIDs())
elif (self.smell_engine.om_dilutions != None) and not len(self.smell_engine.om_dilutions) > 0:
self.smell_engine.set_odorant_molecule_dilutions(self.recieve_dilutions())
elif not self.initialized:
#NEED TO SET smell_engine.set_odorant_molecule_dilutions([10, 10])
#I am not sure whats the best way to do this should we do this in unity editor and then send over a socket connection.
self.smell_engine.set_odorant_molecule_dilutions([10, 10,10])
self.smell_engine.initialize_smell_engine_system()
self.initialized = True
else:
self.main_thread_loop()
def receive_quantity_odorants(self):
"""
Assign PubChemID's on startup to the LogicalOlfactomete cid's.
Method is called from LogicalOlfactometer instantiation, so it waits
until the first set of values are transmitted from Unity (which are the PubChemIDs)
"""
print('\nwaiting for a connection')
self.unpacker = struct.Struct('i') # Receive list of ints
data = self.client.recv(self.unpacker.size)
if data:
# print('received # of PubChemIDs:\t{!r}'.format(binascii.hexlify(data)))
unpacked_data = list(self.unpacker.unpack(data))
print('Received # of PubChem IDs:\t', unpacked_data)
self.num_odorants = unpacked_data[0]
def receive_pub_chemIDs(self):
"""
Assign PubChemID's on startup to the LogicalOlfactomete cid's.
Method is called from LogicalOlfactometer instantiation, so it waits
until the first set of values are transmitted from Unity (which are the PubChemIDs)
"""
print('\nreceiving pub chem IDS')
self.unpacker = struct.Struct(self.num_odorants * 'i') # Receive list of ints
data = self.client.recv(self.unpacker.size)
if (data):
print('received PubChemIDs:\t{!r}'.format(binascii.hexlify(data)))
unpacked_data = list(self.unpacker.unpack(data))
print('unpacked PubChem IDs:\t', unpacked_data)
return unpacked_data # This data is assigned to the PID's prop of Valve Driver.
def recieve_dilutions(self):
"""
Recieve Dilutions values for self.smell_engine.set_odorant_molecule_dilutions([10, 10,10])
"""
print('\nreceiving Dilutions')
self.unpacker = struct.Struct(self.num_odorants * 'i') # Receive list of ints
try:
data = self.client.recv(self.unpacker.size)
if (data):
print('received Dilutions:\t{!r}'.format(binascii.hexlify(data)))
unpacked_data = list(self.unpacker.unpack(data))
print('unpacked Dilutions:\t', unpacked_data)
return unpacked_data # This data is assigned to the PID's prop of Valve Driver.
except socket.error as e:
if str(e) == "[Errno 35] Resource temporarily unavailable":
time.sleep(0.1)
def main_thread_loop(self):
"""
LoopConnection continuously listens for a list of doubles, converts the bytes,
then issues them to the Smell Composer and Valve Driver via the method load_concentrations()
"""
self.client.setblocking(1)
self.unpacker = struct.Struct((self.num_odorants) * 'd')
try:
millis = int(round(time.time() * 1000))
data = self.client.recv(self.unpacker.size)
if data:
unpacked_data = list(self.unpacker.unpack(data))
print("Received:\t" + str(unpacked_data))
self.load_concentrations(unpacked_data)
diff_time = int(round(time.time() * 1000)) - millis
if (self.write_flag):
print("Diff time to receive values:\t" + str(diff_time))
target_conc = {'target_concentration' : unpacked_data, 'receive_target_conc_latency' : diff_time/1000}
self.data_container.append_value(datetime.datetime.now().strftime("%m/%d/%Y %H:%M:%S"), target_conc)
except socket.error as e:
print(("Couldnt connect with the socket-server: "
"%s\n terminating program") % e)
print("struct error, aborting connection")
print("connection aborted")
if (self.write_flag): self.data_container.create_json()
self.smell_engine.close_smell_engine()
self.client.close()
print("Client disconnected, server shutting down.")
sys.exit(1)
except struct.error:
print("Skipping odor frame")
def load_concentrations(self, concentration_mixtures):
"""
Append list of concentrations to mixtures deque within Smell Composer,
which in turn issues odorants to the Valve Driver for the Olfactometer.
The desired odorant concentration vector is formatted then passed down the
Smell Engine pipeline.
Attributes:
concentration_mixtures: List of desired odorant concentrations
"""
try:
antilog_concentration_mixtures = []
for concentration in concentration_mixtures:
if abs(10**concentration)==float('inf'): # If overflow
antilog_concentration_mixtures.append(0)
else:
antilog_concentration_mixtures.append(10**concentration)
if (self.smell_engine.smell_controller.valve_driver.timer_paused): self.smell_engine.smell_controller.valve_driver.timer_pause()
# Match the odorant concentration value to its odorant ID via index
self.desired = {self.smell_engine.olfactometer.find_odorant_id_by_index(0): antilog_concentration_mixtures[0]*pq.M, \
self.smell_engine.olfactometer.find_odorant_id_by_index(1): antilog_concentration_mixtures[1]*pq.M, \
self.smell_engine.olfactometer.find_odorant_id_by_index(2): antilog_concentration_mixtures[2]*pq.M}
# Run optimizer and receive optimization results by setting concentrations and flow rate
if (self.last_concentrations is not concentration_mixtures):
self.smell_engine.set_desired_concentrations(antilog_concentration_mixtures)
self.last_concentrations = concentration_mixtures
else: # skip every other repeated instance
self.last_concentrations = []
except OverflowError as err:
print('Hit overflow, skipping this odor frame')
def main(debug_mode: bool,
odor_table_mode: Optional[str] = typer.Argument(None, help="Can specify odor table pkl file."),
write_data: Optional[bool] = typer.Argument(False, help="Can specift if data should be saved in session.")):
if (debug_mode is None):
typer.echo("Must specify if running in debug mode")
return
sc = SmellEngineCommunicator(debug_mode, odor_table_mode, write_data)
sc.main_thread_loop()
if __name__ == "__main__":
typer.run(main) | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
2281,
13,
5215,
1831,
13,
5215,
9909,
13,
5215,
10876,
13,
5215,
9016,
294,
18869,
13,
5215,
679,
3670,
13,
5215,
931,
13,
5215,
26855,
408,
282,
29939,
13,
13,
3166,
16250,
1053,
316,
802,
29871,
13,
5215,
12655,
408,
7442,
13,
5215,
12865,
13,
5215,
7911,
546,
13,
3166,
19229,
1053,
28379,
13,
3166,
282,
2158,
1053,
282,
2158,
13,
3166,
13386,
17028,
8328,
29889,
3844,
514,
29918,
10599,
1053,
4116,
514,
12412,
13,
3166,
13386,
17028,
8328,
29889,
1272,
29918,
7611,
1053,
3630,
7895,
13,
13,
1990,
4116,
514,
12412,
5261,
2523,
1061,
29901,
13,
1678,
9995,
13,
1678,
4116,
514,
12412,
5261,
2523,
1061,
10127,
267,
263,
3564,
844,
1196,
1546,
20872,
322,
4116,
514,
10863,
29889,
13,
1678,
3824,
278,
21083,
338,
13252,
29892,
769,
278,
9909,
11324,
1169,
363,
263,
3957,
313,
4645,
9224,
29897,
13,
1678,
9038,
3132,
3957,
338,
7841,
29892,
8042,
1451,
331,
1367,
29915,
29879,
526,
9859,
29892,
2630,
345,
12376,
338,
13213,
630,
29892,
13,
1678,
769,
9909,
12104,
3133,
5794,
19866,
363,
6166,
310,
848,
29889,
13,
13,
1678,
6212,
5026,
29901,
13,
4706,
4744,
29918,
8513,
29901,
7353,
363,
9128,
7186,
1027,
7964,
12837,
6790,
3025,
1899,
29899,
1220,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4744,
29918,
8513,
29922,
8824,
29892,
2413,
272,
29918,
2371,
29922,
8516,
29892,
2436,
29918,
15581,
29922,
8824,
1125,
268,
13,
4706,
1596,
703,
15514,
5281,
1159,
268,
13,
4706,
1583,
29889,
3539,
29918,
15581,
353,
2436,
29918,
15581,
13,
4706,
1583,
29889,
8382,
29918,
8513,
353,
4744,
29918,
8513,
13,
4706,
1583,
29889,
17606,
29918,
2371,
353,
2413,
272,
29918,
2371,
13,
4706,
1583,
29889,
1272,
29918,
7611,
353,
3630,
7895,
580,
462,
418,
13,
4706,
396,
14602,
19374,
29914,
5690,
7791,
7077,
2544,
13,
4706,
1583,
29889,
2974,
353,
9909,
29889,
11514,
29898,
11514,
29889,
5098,
29918,
1177,
2544,
29892,
9909,
29889,
6156,
7077,
29918,
1254,
1525,
5194,
29897,
13,
4706,
1583,
29889,
2974,
29889,
842,
1271,
292,
29898,
29900,
29897,
13,
4706,
1583,
29889,
2974,
29889,
842,
15619,
29898,
29896,
29897,
13,
4706,
1583,
29889,
2974,
29889,
5355,
29898,
877,
7640,
742,
29871,
29896,
29906,
29941,
29946,
29945,
876,
13,
4706,
1583,
29889,
1949,
29918,
17606,
1934,
353,
29871,
29900,
13,
4706,
1583,
29889,
4230,
29918,
535,
1760,
29878,
800,
353,
5159,
13,
4706,
1596,
703,
1293,
8333,
363,
13154,
636,
1159,
13,
4706,
1583,
29889,
2974,
29889,
20631,
29898,
29896,
29897,
13,
4706,
396,
1105,
9737,
515,
607,
591,
2149,
304,
1303,
13,
4706,
1583,
29889,
2080,
29879,
353,
518,
1583,
29889,
2974,
4514,
13,
4706,
396,
1105,
9737,
304,
607,
591,
2149,
304,
2436,
13,
4706,
1583,
29889,
4905,
29879,
353,
518,
4514,
13,
4706,
1583,
29889,
3844,
514,
29918,
10599,
353,
6213,
13,
4706,
1583,
29889,
11228,
1891,
353,
7700,
13,
4706,
1583,
29889,
2344,
29918,
3396,
29918,
7888,
580,
13,
13,
1678,
822,
2069,
29918,
3396,
29918,
7888,
29898,
1311,
1125,
13,
4706,
1550,
1583,
29889,
2080,
29879,
29901,
13,
9651,
19909,
29892,
2044,
519,
29892,
3682,
284,
353,
1831,
29889,
2622,
29898,
1311,
29889,
2080,
29879,
29892,
1583,
29889,
4905,
29879,
29892,
1583,
29889,
2080,
29879,
29892,
29871,
29896,
29897,
13,
9651,
565,
451,
19909,
29901,
13,
18884,
1596,
703,
15797,
666,
1159,
13,
18884,
931,
29889,
17059,
29898,
29896,
29897,
13,
9651,
1683,
29901,
13,
18884,
396,
29273,
10970,
13,
18884,
363,
1831,
29918,
949,
1849,
297,
19909,
29901,
13,
462,
1678,
565,
1831,
29918,
949,
1849,
338,
1583,
29889,
2974,
29901,
13,
462,
4706,
396,
319,
376,
949,
519,
29908,
1923,
9909,
338,
7960,
304,
3544,
263,
3957,
13,
462,
4706,
1583,
29889,
4645,
29892,
1583,
29889,
4645,
29918,
7887,
353,
1583,
29889,
2974,
29889,
16044,
580,
13,
462,
4706,
1596,
703,
4032,
6631,
472,
3583,
29873,
29908,
718,
851,
29898,
1311,
29889,
4645,
29918,
7887,
876,
308,
13,
462,
4706,
1583,
29889,
2080,
29879,
29889,
4397,
29898,
1311,
29889,
4645,
29897,
13,
462,
4706,
1583,
29889,
4645,
29889,
842,
1271,
292,
29898,
29900,
29897,
13,
462,
4706,
1583,
29889,
2080,
29879,
29889,
4397,
29898,
1311,
29889,
4645,
29897,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
565,
313,
1311,
29889,
1949,
29918,
17606,
1934,
1275,
29871,
29900,
1125,
1678,
1583,
29889,
13556,
573,
29918,
22640,
29918,
17606,
1934,
580,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
565,
451,
1583,
29889,
3844,
514,
29918,
10599,
29901,
462,
462,
13,
462,
18884,
1583,
29889,
3844,
514,
29918,
10599,
353,
4116,
514,
12412,
29898,
1272,
29918,
7611,
29922,
1311,
29889,
1272,
29918,
7611,
29892,
4744,
29918,
8513,
29922,
1311,
29889,
8382,
29918,
8513,
29892,
29871,
13,
462,
462,
462,
9651,
2436,
29918,
15581,
29922,
1311,
29889,
3539,
29918,
15581,
29892,
29925,
1367,
29918,
8513,
29922,
8824,
29892,
1106,
29918,
786,
29918,
2371,
29918,
2084,
29922,
1311,
29889,
17606,
29918,
2371,
29897,
13,
462,
9651,
25342,
451,
7431,
29898,
1311,
29889,
3844,
514,
29918,
10599,
29889,
290,
29918,
4841,
29897,
1405,
29871,
29900,
29901,
13,
462,
18884,
1583,
29889,
3844,
514,
29918,
10599,
29889,
842,
29918,
17606,
424,
29918,
29885,
1772,
29883,
1297,
29918,
4841,
29898,
1311,
29889,
13556,
573,
29918,
5467,
29918,
14969,
1367,
29879,
3101,
13,
13,
462,
9651,
25342,
313,
1311,
29889,
3844,
514,
29918,
10599,
29889,
290,
29918,
29881,
309,
17925,
2804,
6213,
29897,
322,
451,
7431,
29898,
1311,
29889,
3844,
514,
29918,
10599,
29889,
290,
29918,
29881,
309,
17925,
29897,
1405,
29871,
29900,
29901,
13,
462,
18884,
1583,
29889,
3844,
514,
29918,
10599,
29889,
842,
29918,
17606,
424,
29918,
29885,
1772,
29883,
1297,
29918,
29881,
309,
17925,
29898,
1311,
29889,
3757,
2418,
29918,
29881,
309,
17925,
3101,
13,
462,
9651,
25342,
451,
1583,
29889,
11228,
1891,
29901,
462,
1669,
13,
462,
18884,
396,
8186,
3352,
7495,
11368,
1560,
514,
29918,
10599,
29889,
842,
29918,
17606,
424,
29918,
29885,
1772,
29883,
1297,
29918,
29881,
309,
17925,
4197,
29896,
29900,
29892,
29871,
29896,
29900,
2314,
259,
13,
462,
18884,
396,
29902,
626,
451,
1854,
825,
29879,
278,
1900,
982,
304,
437,
445,
881,
591,
437,
445,
297,
20107,
6920,
322,
769,
3638,
975,
263,
9909,
3957,
29889,
29871,
13,
462,
18884,
1583,
29889,
3844,
514,
29918,
10599,
29889,
842,
29918,
17606,
424,
29918,
29885,
1772,
29883,
1297,
29918,
29881,
309,
17925,
4197,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
29896,
29900,
2314,
13,
462,
18884,
1583,
29889,
3844,
514,
29918,
10599,
29889,
24926,
29918,
3844,
514,
29918,
10599,
29918,
5205,
580,
259,
13,
462,
18884,
1583,
29889,
11228,
1891,
353,
5852,
539,
13,
462,
9651,
1683,
29901,
13,
462,
18884,
1583,
29889,
3396,
29918,
7097,
29918,
7888,
580,
308,
13,
462,
259,
13,
1678,
822,
7150,
29918,
22640,
29918,
17606,
1934,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4007,
647,
8042,
1451,
331,
1367,
29915,
29879,
373,
20234,
304,
278,
4522,
936,
29949,
29880,
17028,
290,
2650,
274,
333,
29915,
29879,
29889,
13,
4706,
8108,
338,
2000,
515,
4522,
936,
29949,
29880,
17028,
8328,
13213,
362,
29892,
577,
372,
11324,
1169,
29871,
13,
4706,
2745,
278,
937,
731,
310,
1819,
526,
18750,
4430,
515,
20872,
313,
4716,
526,
278,
8042,
1451,
331,
1367,
29879,
29897,
13,
4706,
9995,
13,
4706,
1596,
28909,
29876,
10685,
292,
363,
263,
3957,
1495,
13,
4706,
1583,
29889,
348,
4058,
261,
353,
2281,
29889,
19560,
877,
29875,
1495,
418,
396,
24328,
573,
1051,
310,
938,
29879,
13,
4706,
848,
353,
1583,
29889,
4645,
29889,
3757,
29894,
29898,
1311,
29889,
348,
4058,
261,
29889,
2311,
29897,
13,
4706,
565,
848,
29901,
13,
9651,
396,
1596,
877,
13556,
2347,
396,
310,
8042,
1451,
331,
1367,
29879,
3583,
29873,
29912,
29991,
29878,
29913,
4286,
4830,
29898,
2109,
294,
18869,
29889,
354,
15524,
1598,
29898,
1272,
4961,
13,
9651,
443,
4058,
287,
29918,
1272,
353,
1051,
29898,
1311,
29889,
348,
4058,
261,
29889,
348,
4058,
29898,
1272,
876,
13,
9651,
1596,
877,
29816,
29871,
396,
310,
8042,
1451,
331,
23481,
3583,
29873,
742,
443,
4058,
287,
29918,
1272,
29897,
13,
9651,
1583,
29889,
1949,
29918,
17606,
1934,
353,
443,
4058,
287,
29918,
1272,
29961,
29900,
29962,
13,
308,
13,
13,
1678,
822,
7150,
29918,
5467,
29918,
14969,
1367,
29879,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4007,
647,
8042,
1451,
331,
1367,
29915,
29879,
373,
20234,
304,
278,
4522,
936,
29949,
29880,
17028,
290,
2650,
274,
333,
29915,
29879,
29889,
13,
4706,
8108,
338,
2000,
515,
4522,
936,
29949,
29880,
17028,
8328,
13213,
362,
29892,
577,
372,
11324,
1169,
29871,
13,
4706,
2745,
278,
937,
731,
310,
1819,
526,
18750,
4430,
515,
20872,
313,
4716,
526,
278,
8042,
1451,
331,
1367,
29879,
29897,
13,
4706,
9995,
13,
4706,
1596,
28909,
29876,
13556,
4357,
2529,
8950,
3553,
29903,
1495,
13,
4706,
1583,
29889,
348,
4058,
261,
353,
2281,
29889,
19560,
29898,
1311,
29889,
1949,
29918,
17606,
1934,
334,
525,
29875,
1495,
418,
396,
24328,
573,
1051,
310,
938,
29879,
13,
4706,
848,
353,
1583,
29889,
4645,
29889,
3757,
29894,
29898,
1311,
29889,
348,
4058,
261,
29889,
2311,
29897,
13,
4706,
565,
313,
1272,
1125,
13,
9651,
1596,
877,
13556,
2347,
8042,
1451,
331,
1367,
29879,
3583,
29873,
29912,
29991,
29878,
29913,
4286,
4830,
29898,
2109,
294,
18869,
29889,
354,
15524,
1598,
29898,
1272,
4961,
13,
9651,
443,
4058,
287,
29918,
1272,
353,
1051,
29898,
1311,
29889,
348,
4058,
261,
29889,
348,
4058,
29898,
1272,
876,
13,
9651,
1596,
877,
348,
4058,
287,
8042,
1451,
331,
23481,
3583,
29873,
742,
443,
4058,
287,
29918,
1272,
29897,
13,
9651,
736,
443,
4058,
287,
29918,
1272,
9651,
396,
910,
848,
338,
9859,
304,
278,
349,
1367,
29915,
29879,
3107,
310,
2630,
345,
26391,
29889,
13,
13,
13,
1678,
822,
1162,
2418,
29918,
29881,
309,
17925,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
3599,
2418,
360,
309,
17925,
1819,
363,
1583,
29889,
3844,
514,
29918,
10599,
29889,
842,
29918,
17606,
424,
29918,
29885,
1772,
29883,
1297,
29918,
29881,
309,
17925,
4197,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
29896,
29900,
2314,
13,
4706,
9995,
13,
4706,
1596,
28909,
29876,
13556,
4357,
360,
309,
17925,
1495,
13,
4706,
1583,
29889,
348,
4058,
261,
353,
2281,
29889,
19560,
29898,
1311,
29889,
1949,
29918,
17606,
1934,
334,
525,
29875,
1495,
418,
396,
24328,
573,
1051,
310,
938,
29879,
13,
4706,
1018,
29901,
13,
9651,
848,
353,
1583,
29889,
4645,
29889,
3757,
29894,
29898,
1311,
29889,
348,
4058,
261,
29889,
2311,
29897,
13,
9651,
565,
313,
1272,
1125,
13,
18884,
1596,
877,
13556,
2347,
360,
309,
17925,
3583,
29873,
29912,
29991,
29878,
29913,
4286,
4830,
29898,
2109,
294,
18869,
29889,
354,
15524,
1598,
29898,
1272,
4961,
13,
18884,
443,
4058,
287,
29918,
1272,
353,
1051,
29898,
1311,
29889,
348,
4058,
261,
29889,
348,
4058,
29898,
1272,
876,
13,
18884,
1596,
877,
348,
4058,
287,
360,
309,
17925,
3583,
29873,
742,
443,
4058,
287,
29918,
1272,
29897,
13,
18884,
736,
443,
4058,
287,
29918,
1272,
9651,
396,
910,
848,
338,
9859,
304,
278,
349,
1367,
29915,
29879,
3107,
310,
2630,
345,
26391,
29889,
13,
4706,
5174,
9909,
29889,
2704,
408,
321,
29901,
13,
18884,
565,
851,
29898,
29872,
29897,
1275,
14704,
19212,
1217,
29871,
29941,
29945,
29962,
18981,
5382,
6275,
443,
16515,
1115,
13,
462,
1678,
931,
29889,
17059,
29898,
29900,
29889,
29896,
29897,
13,
268,
13,
1678,
822,
1667,
29918,
7097,
29918,
7888,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
21493,
5350,
3133,
5794,
1051,
575,
363,
263,
1051,
310,
27641,
29892,
29436,
278,
6262,
29892,
13,
4706,
769,
5626,
963,
304,
278,
4116,
514,
24497,
261,
322,
2630,
345,
26391,
3025,
278,
1158,
2254,
29918,
535,
1760,
29878,
800,
580,
13,
4706,
9995,
13,
4706,
1583,
29889,
4645,
29889,
842,
1271,
292,
29898,
29896,
29897,
13,
4706,
1583,
29889,
348,
4058,
261,
353,
2281,
29889,
19560,
3552,
1311,
29889,
1949,
29918,
17606,
1934,
29897,
334,
525,
29881,
1495,
13,
4706,
1018,
29901,
632,
13,
9651,
3533,
275,
353,
938,
29898,
14486,
29898,
2230,
29889,
2230,
580,
334,
29871,
29896,
29900,
29900,
29900,
876,
632,
13,
9651,
848,
353,
1583,
29889,
4645,
29889,
3757,
29894,
29898,
1311,
29889,
348,
4058,
261,
29889,
2311,
29897,
462,
268,
13,
9651,
565,
848,
29901,
462,
462,
632,
13,
18884,
443,
4058,
287,
29918,
1272,
353,
1051,
29898,
1311,
29889,
348,
4058,
261,
29889,
348,
4058,
29898,
1272,
876,
462,
268,
13,
18884,
1596,
703,
29816,
3583,
29873,
29908,
718,
851,
29898,
348,
4058,
287,
29918,
1272,
876,
259,
13,
18884,
1583,
29889,
1359,
29918,
535,
1760,
29878,
800,
29898,
348,
4058,
287,
29918,
1272,
29897,
462,
462,
462,
462,
4706,
13,
9651,
2923,
29918,
2230,
353,
938,
29898,
14486,
29898,
2230,
29889,
2230,
580,
334,
29871,
29896,
29900,
29900,
29900,
876,
448,
3533,
275,
13,
9651,
565,
313,
1311,
29889,
3539,
29918,
15581,
1125,
13,
18884,
1596,
703,
26023,
931,
304,
7150,
1819,
3583,
29873,
29908,
718,
851,
29898,
12765,
29918,
2230,
876,
13,
18884,
3646,
29918,
535,
29883,
353,
11117,
5182,
29918,
535,
1760,
29878,
362,
29915,
584,
443,
4058,
287,
29918,
1272,
29892,
525,
13556,
573,
29918,
5182,
29918,
535,
29883,
29918,
29880,
2579,
1270,
29915,
584,
2923,
29918,
2230,
29914,
29896,
29900,
29900,
29900,
29913,
13,
18884,
1583,
29889,
1272,
29918,
7611,
29889,
4397,
29918,
1767,
29898,
12673,
29889,
12673,
29889,
3707,
2141,
710,
615,
603,
11702,
29885,
22584,
29881,
22584,
29979,
1273,
29950,
16664,
29924,
16664,
29903,
4968,
3646,
29918,
535,
29883,
29897,
462,
9651,
13,
4706,
5174,
9909,
29889,
2704,
408,
321,
29901,
13,
9651,
1596,
29898,
703,
23323,
593,
4511,
411,
278,
9909,
29899,
2974,
29901,
376,
13,
18884,
11860,
29879,
29905,
29876,
6624,
1218,
1824,
1159,
1273,
321,
29897,
13,
9651,
1596,
703,
4984,
1059,
29892,
27450,
292,
3957,
1159,
13,
9651,
1596,
703,
9965,
633,
18054,
1159,
13,
9651,
565,
313,
1311,
29889,
3539,
29918,
15581,
1125,
259,
1583,
29889,
1272,
29918,
7611,
29889,
3258,
29918,
3126,
580,
13,
9651,
1583,
29889,
3844,
514,
29918,
10599,
29889,
5358,
29918,
3844,
514,
29918,
10599,
580,
13,
9651,
1583,
29889,
4645,
29889,
5358,
580,
13,
9651,
1596,
703,
4032,
766,
18045,
29892,
1923,
12522,
1259,
1623,
23157,
462,
632,
13,
9651,
10876,
29889,
13322,
29898,
29896,
29897,
632,
13,
4706,
5174,
2281,
29889,
2704,
29901,
13,
9651,
1596,
703,
29903,
1984,
3262,
2413,
272,
3515,
1159,
13,
632,
13,
13,
268,
13,
1678,
822,
2254,
29918,
535,
1760,
29878,
800,
29898,
1311,
29892,
26702,
29918,
2460,
486,
1973,
1125,
13,
4706,
9995,
13,
4706,
22871,
1051,
310,
14953,
800,
304,
3737,
486,
1973,
316,
802,
2629,
4116,
514,
24497,
261,
29892,
13,
4706,
607,
297,
2507,
5626,
2413,
272,
1934,
304,
278,
2630,
345,
26391,
363,
278,
7137,
17028,
8328,
29889,
13,
4706,
450,
7429,
2413,
272,
424,
26702,
4608,
338,
20917,
769,
4502,
1623,
278,
29871,
13,
4706,
4116,
514,
10863,
16439,
29889,
3986,
13,
13,
4706,
6212,
5026,
29901,
13,
9651,
26702,
29918,
2460,
486,
1973,
29901,
2391,
310,
7429,
2413,
272,
424,
14953,
800,
13,
4706,
9995,
13,
4706,
1018,
29901,
13,
9651,
385,
1376,
468,
29918,
535,
1760,
29878,
362,
29918,
2460,
486,
1973,
353,
5159,
29871,
13,
9651,
363,
26702,
297,
26702,
29918,
2460,
486,
1973,
29901,
13,
18884,
565,
6425,
29898,
29896,
29900,
1068,
535,
1760,
29878,
362,
29897,
1360,
7411,
877,
7192,
29374,
1678,
396,
960,
11969,
13,
462,
1678,
385,
1376,
468,
29918,
535,
1760,
29878,
362,
29918,
2460,
486,
1973,
29889,
4397,
29898,
29900,
29897,
268,
13,
18884,
1683,
29901,
13,
462,
1678,
385,
1376,
468,
29918,
535,
1760,
29878,
362,
29918,
2460,
486,
1973,
29889,
4397,
29898,
29896,
29900,
1068,
535,
1760,
29878,
362,
29897,
13,
9651,
565,
313,
1311,
29889,
3844,
514,
29918,
10599,
29889,
3844,
514,
29918,
8299,
29889,
791,
345,
29918,
9465,
29889,
20404,
29918,
29886,
15244,
1125,
1678,
1583,
29889,
3844,
514,
29918,
10599,
29889,
3844,
514,
29918,
8299,
29889,
791,
345,
29918,
9465,
29889,
20404,
29918,
29886,
1071,
580,
13,
9651,
396,
14514,
278,
2413,
272,
424,
26702,
995,
304,
967,
2413,
272,
424,
3553,
3025,
2380,
13,
9651,
1583,
29889,
2783,
2859,
353,
426,
1311,
29889,
3844,
514,
29918,
10599,
29889,
4369,
627,
8328,
29889,
2886,
29918,
17606,
424,
29918,
333,
29918,
1609,
29918,
2248,
29898,
29900,
1125,
385,
1376,
468,
29918,
535,
1760,
29878,
362,
29918,
2460,
486,
1973,
29961,
29900,
14178,
29886,
29939,
29889,
29924,
29892,
320,
13,
462,
9651,
1583,
29889,
3844,
514,
29918,
10599,
29889,
4369,
627,
8328,
29889,
2886,
29918,
17606,
424,
29918,
333,
29918,
1609,
29918,
2248,
29898,
29896,
1125,
385,
1376,
468,
29918,
535,
1760,
29878,
362,
29918,
2460,
486,
1973,
29961,
29896,
14178,
29886,
29939,
29889,
29924,
29892,
320,
13,
462,
9651,
1583,
29889,
3844,
514,
29918,
10599,
29889,
4369,
627,
8328,
29889,
2886,
29918,
17606,
424,
29918,
333,
29918,
1609,
29918,
2248,
29898,
29906,
1125,
385,
1376,
468,
29918,
535,
1760,
29878,
362,
29918,
2460,
486,
1973,
29961,
29906,
14178,
29886,
29939,
29889,
29924,
29913,
13,
9651,
396,
7525,
5994,
3950,
322,
7150,
13883,
2582,
491,
4444,
14953,
800,
322,
4972,
6554,
13,
9651,
565,
313,
1311,
29889,
4230,
29918,
535,
1760,
29878,
800,
338,
451,
26702,
29918,
2460,
486,
1973,
1125,
632,
13,
18884,
1583,
29889,
3844,
514,
29918,
10599,
29889,
842,
29918,
2783,
2859,
29918,
535,
1760,
29878,
800,
29898,
424,
26140,
29918,
535,
1760,
29878,
362,
29918,
2460,
486,
1973,
29897,
13,
18884,
1583,
29889,
4230,
29918,
535,
1760,
29878,
800,
353,
26702,
29918,
2460,
486,
1973,
13,
9651,
1683,
29901,
259,
396,
14383,
1432,
916,
10324,
2777,
13,
18884,
1583,
29889,
4230,
29918,
535,
1760,
29878,
800,
353,
5159,
1678,
13,
4706,
5174,
28845,
2392,
408,
4589,
29901,
13,
9651,
1596,
877,
29950,
277,
11969,
29892,
14993,
3262,
445,
2413,
272,
3515,
1495,
13,
13,
268,
13,
13,
1753,
1667,
29898,
8382,
29918,
8513,
29901,
6120,
29892,
29871,
13,
4706,
2413,
272,
29918,
2371,
29918,
8513,
29901,
28379,
29961,
710,
29962,
353,
7911,
546,
29889,
15730,
29898,
8516,
29892,
1371,
543,
6028,
6084,
2413,
272,
1591,
282,
6321,
934,
1213,
511,
259,
13,
4706,
2436,
29918,
1272,
29901,
28379,
29961,
11227,
29962,
353,
7911,
546,
29889,
15730,
29898,
8824,
29892,
1371,
543,
6028,
1580,
2027,
565,
848,
881,
367,
7160,
297,
4867,
1213,
22164,
268,
13,
1678,
565,
313,
8382,
29918,
8513,
338,
6213,
1125,
13,
4706,
7911,
546,
29889,
8057,
703,
29924,
504,
6084,
565,
2734,
297,
4744,
4464,
1159,
13,
4706,
736,
268,
13,
1678,
885,
353,
4116,
514,
12412,
5261,
2523,
1061,
29898,
8382,
29918,
8513,
29892,
2413,
272,
29918,
2371,
29918,
8513,
29892,
2436,
29918,
1272,
29897,
13,
1678,
885,
29889,
3396,
29918,
7097,
29918,
7888,
580,
13,
268,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
7911,
546,
29889,
3389,
29898,
3396,
29897,
2
] |
tests/models/test_model.py | d-cat-support/fusion-platform-python-sdk | 0 | 159177 | #
# Model base class test file.
#
# @author <NAME>
#
# (c) Digital Content Analysis Technology Ltd 2022
#
from datetime import datetime, timezone
from functools import partial
import json
from mock import patch
import pytest
import requests
import requests_mock
import uuid
from tests.custom_test_case import CustomTestCase
from fusion_platform.common.utilities import json_default, value_to_read_only, value_to_string
from fusion_platform.session import Session, RequestError
from fusion_platform.models.data import DataSchema
from fusion_platform.models.model import Model, ModelError
from fusion_platform.models.user import User, UserSchema
class TestModel(CustomTestCase):
"""
Model tests.
"""
def test_init(self):
"""
Test initialisation of the model base class to ensure no exceptions are raised.
"""
session = Session()
model = Model(session)
self.assertIsNotNone(model)
self.assertEqual(session, model._session)
def test_attributes(self):
"""
Test that properties can be retrieved as a dictionary of attributes.
"""
model = Model(Session(), schema=UserSchema())
self.assertIsNotNone(model)
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
model._set_model(content)
with patch.object(Model, '_Model__get_schema', return_value=UserSchema()):
attributes = model.attributes
for key in attributes:
self.assertEqual(getattr(model, key), attributes[key])
def test_build_filter(self):
"""
Test build a filter.
"""
id = uuid.uuid4()
self.assertEqual({'id__eq': id}, Model._build_filter([(Model._FIELD_ID, Model._FILTER_MODIFIER_EQ, id)]))
self.assertEqual({}, Model._build_filter([(Model._FIELD_ID, Model._FILTER_MODIFIER_EQ, None)]))
def test_create_abstract(self):
"""
Tests the create method does not work with abstract path methods.
"""
with pytest.raises(NotImplementedError):
model = Model(Session())
model._create()
def test_create_mocked(self):
"""
Tests that an object can be created via a post to the API endpoint with response validation using a Marshmallow schema.
"""
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
wrong_content = {}
for key in content:
wrong_content[f"new_{key}"] = content[key]
session = Session()
path = '/path'
given_name = 'Test'
model = Model(session, schema=UserSchema())
self.assertIsNotNone(model)
model._set_model(content)
with requests_mock.Mocker() as mock:
with patch.object(Model, Model._get_path.__name__, return_value=path):
with patch.object(Model, '_Model__get_schema', return_value=UserSchema()):
with pytest.raises(RequestError):
mock.post(f"{Session.API_URL_DEFAULT}{path}", exc=requests.exceptions.ConnectTimeout)
model._create(given_name=given_name)
with pytest.raises(RequestError):
mock.post(f"{Session.API_URL_DEFAULT}{path}", status_code=400)
model._create(given_name=given_name)
with pytest.raises(ModelError):
mock.post(f"{Session.API_URL_DEFAULT}{path}", text='{}')
model._create(given_name=given_name)
with pytest.raises(ModelError):
mock.post(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: wrong_content}))
model._create(given_name=given_name)
content['given_name'] = given_name
adapter = mock.post(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: content}))
model._create(given_name=given_name, last_request_at=datetime.now(timezone.utc))
self.assertEqual(json.dumps(model._Model__build_body(given_name=given_name), default=json_default), adapter.last_request.text)
schema = UserSchema()
for key in content:
if Model._METADATA_HIDE not in schema.fields[key].metadata:
self.assertEqual(json.dumps(content[key], default=json_default), json.dumps(getattr(model, key), default=json_default))
else:
self.assertFalse(hasattr(model, key))
def test_delete_abstract(self):
"""
Tests the delete method does not work with abstract path methods.
"""
with pytest.raises(NotImplementedError):
model = Model(Session())
model._Model__persisted = True
model.delete()
def test_delete_mocked(self):
"""
Tests that an object can be deleted via a DELETE to the API endpoint.
"""
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
session = Session()
path = '/path'
model = Model(session)
self.assertIsNotNone(model)
model._Model__persisted = True
with requests_mock.Mocker() as mock:
with patch.object(Model, Model._get_path.__name__, return_value=path):
with pytest.raises(RequestError):
mock.delete(f"{Session.API_URL_DEFAULT}{path}", exc=requests.exceptions.ConnectTimeout)
model.delete()
with pytest.raises(RequestError):
mock.delete(f"{Session.API_URL_DEFAULT}{path}", status_code=400)
model.delete()
mock.delete(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: content}))
model.delete()
def test_eq(self):
"""
Tests model equals.
"""
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
model1 = User(Session())
model1._set_model(content)
model2 = User(Session())
model2._set_model(content)
content['email'] = '<EMAIL>'
model3 = User(Session())
model3._set_model(content)
self.assertTrue(model1 == model1)
self.assertTrue(model2 == model2)
self.assertTrue(model3 == model3)
self.assertTrue(model1 == model2)
self.assertTrue(model2 == model1)
self.assertFalse(model1 == model3)
self.assertFalse(model2 == model3)
def test_first_and_generator(self):
"""
Tests the first and generator method.
"""
def dummy_generator(nothing=False, items_per_request=10):
count = items_per_request if not nothing else 0
i = 0
while i < count:
yield i
i += 1
partial_generator = partial(dummy_generator, nothing=True)
first, generator = Model._first_and_generator(partial_generator)
self.assertIsNone(first)
self.assertIsNotNone(generator)
with pytest.raises(StopIteration):
next(generator)
partial_generator = partial(dummy_generator, nothing=False)
first, generator = Model._first_and_generator(partial_generator)
self.assertIsNotNone(first)
self.assertIsNotNone(generator)
self.assertEqual(0, first)
for index, item in enumerate(generator):
self.assertEqual(index, item)
def test_get_id_name(self):
"""
Tests that the correct id name is returned.
"""
self.assertEqual('user_id', Model._get_id_name(User.__name__))
def test_get_ids_from_list(self):
"""
Tests that the correct id list is returned.
"""
user_id = uuid.uuid4()
organisation_id = uuid.uuid4()
self.assertEqual([{'user_id': user_id, 'organisation_id': organisation_id}], User._get_ids_from_list([user_id], organisation_id=organisation_id))
def test_get_abstract(self):
"""
Tests the get method does not work with abstract path methods.
"""
with pytest.raises(NotImplementedError):
model = Model(Session())
model.get()
def test_get_mocked(self):
"""
Tests that an object can be created from an API endpoint with validation using a Marshmallow schema.
"""
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
wrong_content = {}
for key in content:
wrong_content[f"new_{key}"] = content[key]
session = Session()
path = '/path'
model = Model(session)
self.assertIsNotNone(model)
with requests_mock.Mocker() as mock:
with patch.object(Model, Model._get_path.__name__, return_value=path):
with patch.object(Model, '_Model__get_schema', return_value=UserSchema()):
with pytest.raises(RequestError):
mock.get(f"{Session.API_URL_DEFAULT}{path}", exc=requests.exceptions.ConnectTimeout)
model.get()
with pytest.raises(RequestError):
mock.get(f"{Session.API_URL_DEFAULT}{path}", status_code=400)
model.get()
with pytest.raises(ModelError):
mock.get(f"{Session.API_URL_DEFAULT}{path}", text='{}')
model.get()
with pytest.raises(ModelError):
mock.get(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: wrong_content}))
model.get()
mock.get(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: content}))
model.get()
schema = UserSchema()
for key in content:
if Model._METADATA_HIDE not in schema.fields[key].metadata:
self.assertEqual(json.dumps(content[key], default=json_default), json.dumps(getattr(model, key), default=json_default))
else:
self.assertFalse(hasattr(model, key))
def test_get_path(self):
"""
Tests the get path method.
"""
with pytest.raises(NotImplementedError):
Model(Session())._get_path(Model._PATH_DELETE)
with pytest.raises(NotImplementedError):
Model(Session())._get_path(Model._PATH_GET)
with pytest.raises(NotImplementedError):
Model(Session())._get_path(Model._PATH_PATCH)
self.assertEqual('/model/999', Model(Session())._get_path('/model/{model_id}', id=999))
def test_get_schema(self):
"""
Tests the get schema method.
"""
with pytest.raises(NotImplementedError):
Model(Session())._Model__get_schema()
with patch.object(Model, '_Model__get_schema', return_value=UserSchema()):
Model(Session())._Model__get_schema()
def test_model_from_api_id(self):
"""
Tests the loading of a model with an id from the API method does not work with abstract methods.
"""
with pytest.raises(NotImplementedError):
Model._model_from_api_id(Session(), id=uuid.uuid4())
def test_models_from_api_ids(self):
"""
Tests generating an iterator through models with ids from the API method does not work with abstract methods.
"""
with pytest.raises(NotImplementedError):
iterator = Model._models_from_api_ids(Session(), [{Model._FIELD_ID: uuid.uuid4()}])
next(iterator)
def test_models_from_api_path(self):
"""
Tests generating an iterator through models with a path from the API method does not work with abstract methods.
"""
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
path = '/path'
with pytest.raises(ModelError):
with requests_mock.Mocker() as mock:
mock.get(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_LIST: [content]}))
iterator = Model._models_from_api_path(Session(), path, items_per_request=10, reverse=True, filter={'test_begins_with': 'Test'})
next(iterator)
def test_new_abstract(self):
"""
Tests the new method does not work with abstract path methods.
"""
with pytest.raises(NotImplementedError):
model = Model(Session())
model._new()
def test_new_mocked(self):
"""
Tests that a template new object can be created from an API endpoint with validation using a Marshmallow schema.
"""
with open(self.fixture_path('data.json'), 'r') as file:
content = json.loads(file.read())
wrong_content = {}
for key in content:
wrong_content[f"new_{key}"] = content[key]
session = Session()
organisation_id = content.get('organisation_id')
path = '/path'
model = Model(session)
self.assertIsNotNone(model)
with requests_mock.Mocker() as mock:
with patch.object(Model, Model._get_path.__name__, return_value=path):
with patch.object(Model, '_Model__get_schema', return_value=DataSchema()):
with pytest.raises(RequestError):
mock.get(f"{Session.API_URL_DEFAULT}{path}", exc=requests.exceptions.ConnectTimeout)
model._new(organisation_id=organisation_id)
with pytest.raises(RequestError):
mock.get(f"{Session.API_URL_DEFAULT}{path}", status_code=400)
model._new(organisation_id=organisation_id)
with pytest.raises(ModelError):
mock.get(f"{Session.API_URL_DEFAULT}{path}", text='{}')
model._new(organisation_id=organisation_id)
mock.get(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: wrong_content}))
model._new(organisation_id=organisation_id)
mock.get(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: content}))
model._new(organisation_id=organisation_id)
schema = DataSchema()
for key in content:
if Model._METADATA_HIDE not in schema.fields[key].metadata:
self.assertEqual(json.dumps(content[key], default=json_default), json.dumps(getattr(model, key), default=json_default))
else:
self.assertFalse(hasattr(model, key))
def test_set_field(self):
"""
Test that a field cna be set.
"""
schema = UserSchema()
model = Model(Session(), schema=schema)
self.assertIsNotNone(model)
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
model._set_model(content)
self.assertEqual(content['email'], model.email)
previous = model._model
with pytest.raises(ModelError):
model._set_field(['rubbish1', 'rubbish2', 'rubbish3'], 'rubbish')
self.assertEqual(previous, model._model)
new_email = f"new_{content['email']}"
model._set_field(['email'], new_email)
self.assertEqual(new_email, model.email)
model._set_field(['notification_contact', 0], 'text')
self.assertEqual(('text',), model.notification_contact)
def test_set_model(self):
"""
Test that properties are set correctly from the dictionary.
"""
schema = UserSchema()
model = Model(Session(), schema=schema)
self.assertIsNotNone(model)
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
model._set_model(content)
for key in content:
if Model._METADATA_HIDE not in schema.fields[key].metadata:
self.assertEqual(value_to_read_only(content[key]), getattr(model, key))
with pytest.raises(ModelError):
setattr(model, key, False)
else:
self.assertFalse(hasattr(model, key))
def test_to_csv(self):
"""
Test that properties can be retrieved as a CSV string.
"""
model = Model(Session(), schema=UserSchema())
self.assertIsNotNone(model)
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
model._set_model(content)
with patch.object(Model, '_Model__get_schema', return_value=UserSchema()):
attributes = model.attributes
header, line = model.to_csv()
self.assertIsNotNone(header)
self.assertIsNotNone(line)
self.assertEqual(list(attributes.keys()), header.split(','))
self.assertEqual([value_to_string(value) for value in attributes.values()], line.split(','))
header, line = model.to_csv(exclude='email')
self.assertIsNotNone(header)
self.assertIsNotNone(line)
self.assertTrue('email' not in header.split(','))
self.assertTrue('<EMAIL>' not in line.split(','))
def test_update_abstract(self):
"""
Tests the update method does not work with abstract path methods.
"""
with pytest.raises(NotImplementedError):
model = Model(Session())
model.update()
def test_update_not_persisted_mocked(self):
"""
Tests that an object can be updated when it is not persisted.
"""
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
session = Session()
path = '/path'
given_name = 'Test'
model = Model(session, schema=UserSchema())
self.assertIsNotNone(model)
model._set_model(content)
model._Model__persisted = False
now = datetime.now(timezone.utc)
model.update(given_name=given_name, last_request_at=now)
self.assertEqual(given_name, model.given_name)
self.assertNotEqual(now, model.last_request_at)
def test_update_persisted_mocked(self):
"""
Tests that an object can be updated via a patch to the API endpoint with response validation using a Marshmallow schema.
"""
with open(self.fixture_path('user.json'), 'r') as file:
content = json.loads(file.read())
wrong_content = {}
for key in content:
wrong_content[f"new_{key}"] = content[key]
session = Session()
path = '/path'
given_name = 'Test'
model = Model(session)
self.assertIsNotNone(model)
model._Model__persisted = True
with requests_mock.Mocker() as mock:
with patch.object(Model, Model._get_path.__name__, return_value=path):
with patch.object(Model, '_Model__get_schema', return_value=UserSchema()):
with pytest.raises(RequestError):
mock.patch(f"{Session.API_URL_DEFAULT}{path}", exc=requests.exceptions.ConnectTimeout)
model.update(given_name=given_name)
with pytest.raises(RequestError):
mock.patch(f"{Session.API_URL_DEFAULT}{path}", status_code=400)
model.update(given_name=given_name)
with pytest.raises(ModelError):
mock.patch(f"{Session.API_URL_DEFAULT}{path}", text='{}')
model.update(given_name=given_name)
with pytest.raises(ModelError):
mock.patch(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: wrong_content}))
model.update(given_name=given_name)
with pytest.raises(ModelError):
mock.patch(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: content}))
model.update()
content['given_name'] = given_name
adapter = mock.patch(f"{Session.API_URL_DEFAULT}{path}", text=json.dumps({Model._RESPONSE_KEY_MODEL: content}))
model.update(given_name=given_name, last_request_at=datetime.now(timezone.utc))
self.assertEqual({'Model[given_name]': given_name}, json.loads(adapter.last_request.text))
schema = UserSchema()
for key in content:
if Model._METADATA_HIDE not in schema.fields[key].metadata:
self.assertEqual(json.dumps(content[key], default=json_default), json.dumps(getattr(model, key), default=json_default))
else:
self.assertFalse(hasattr(model, key))
| [
1,
396,
13,
29937,
8125,
2967,
770,
1243,
934,
29889,
13,
29937,
13,
29937,
732,
8921,
529,
5813,
29958,
13,
29937,
13,
29937,
313,
29883,
29897,
15918,
10576,
24352,
17968,
19806,
29871,
29906,
29900,
29906,
29906,
13,
29937,
13,
13,
3166,
12865,
1053,
12865,
29892,
29431,
13,
3166,
2090,
312,
8789,
1053,
7687,
13,
5215,
4390,
13,
3166,
11187,
1053,
13261,
13,
5215,
11451,
1688,
13,
5215,
7274,
13,
5215,
7274,
29918,
17640,
13,
5215,
318,
5416,
13,
13,
3166,
6987,
29889,
6341,
29918,
1688,
29918,
4878,
1053,
8701,
3057,
8259,
13,
13,
3166,
21736,
29918,
12120,
29889,
9435,
29889,
4422,
1907,
1053,
4390,
29918,
4381,
29892,
995,
29918,
517,
29918,
949,
29918,
6194,
29892,
995,
29918,
517,
29918,
1807,
13,
3166,
21736,
29918,
12120,
29889,
7924,
1053,
16441,
29892,
10729,
2392,
13,
3166,
21736,
29918,
12120,
29889,
9794,
29889,
1272,
1053,
3630,
12763,
13,
3166,
21736,
29918,
12120,
29889,
9794,
29889,
4299,
1053,
8125,
29892,
8125,
2392,
13,
3166,
21736,
29918,
12120,
29889,
9794,
29889,
1792,
1053,
4911,
29892,
4911,
12763,
13,
13,
13,
1990,
4321,
3195,
29898,
7281,
3057,
8259,
1125,
13,
1678,
9995,
13,
1678,
8125,
6987,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
1243,
29918,
2344,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
2847,
4371,
310,
278,
1904,
2967,
770,
304,
9801,
694,
15283,
526,
10425,
29889,
13,
4706,
9995,
13,
4706,
4867,
353,
16441,
580,
13,
13,
4706,
1904,
353,
8125,
29898,
7924,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7924,
29892,
1904,
3032,
7924,
29897,
13,
13,
1678,
822,
1243,
29918,
15697,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
393,
4426,
508,
367,
27387,
408,
263,
8600,
310,
8393,
29889,
13,
4706,
9995,
13,
4706,
1904,
353,
8125,
29898,
7317,
3285,
10938,
29922,
2659,
12763,
3101,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
1904,
3032,
842,
29918,
4299,
29898,
3051,
29897,
13,
13,
4706,
411,
13261,
29889,
3318,
29898,
3195,
29892,
22868,
3195,
1649,
657,
29918,
11010,
742,
736,
29918,
1767,
29922,
2659,
12763,
580,
1125,
13,
9651,
8393,
353,
1904,
29889,
15697,
13,
13,
9651,
363,
1820,
297,
8393,
29901,
13,
18884,
1583,
29889,
9294,
9843,
29898,
657,
5552,
29898,
4299,
29892,
1820,
511,
8393,
29961,
1989,
2314,
13,
13,
1678,
822,
1243,
29918,
4282,
29918,
4572,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
2048,
263,
4175,
29889,
13,
4706,
9995,
13,
4706,
1178,
353,
318,
5416,
29889,
25118,
29946,
580,
13,
13,
4706,
1583,
29889,
9294,
9843,
3319,
29915,
333,
1649,
1837,
2396,
1178,
1118,
8125,
3032,
4282,
29918,
4572,
4197,
29898,
3195,
3032,
3738,
27286,
29918,
1367,
29892,
8125,
3032,
3738,
29931,
4945,
29918,
6720,
4571,
3738,
1001,
29918,
28879,
29892,
1178,
4638,
876,
13,
4706,
1583,
29889,
9294,
9843,
3319,
1118,
8125,
3032,
4282,
29918,
4572,
4197,
29898,
3195,
3032,
3738,
27286,
29918,
1367,
29892,
8125,
3032,
3738,
29931,
4945,
29918,
6720,
4571,
3738,
1001,
29918,
28879,
29892,
6213,
4638,
876,
13,
13,
1678,
822,
1243,
29918,
3258,
29918,
16595,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
278,
1653,
1158,
947,
451,
664,
411,
9846,
2224,
3519,
29889,
13,
4706,
9995,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
1904,
353,
8125,
29898,
7317,
3101,
13,
9651,
1904,
3032,
3258,
580,
13,
13,
1678,
822,
1243,
29918,
3258,
29918,
17640,
287,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
393,
385,
1203,
508,
367,
2825,
3025,
263,
1400,
304,
278,
3450,
16248,
411,
2933,
8845,
773,
263,
13216,
29885,
9536,
10938,
29889,
13,
4706,
9995,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
2743,
29918,
3051,
353,
6571,
13,
13,
4706,
363,
1820,
297,
2793,
29901,
13,
9651,
2743,
29918,
3051,
29961,
29888,
29908,
1482,
648,
1989,
29913,
3108,
353,
2793,
29961,
1989,
29962,
13,
13,
4706,
4867,
353,
16441,
580,
13,
4706,
2224,
353,
8207,
2084,
29915,
13,
4706,
2183,
29918,
978,
353,
525,
3057,
29915,
13,
13,
4706,
1904,
353,
8125,
29898,
7924,
29892,
10938,
29922,
2659,
12763,
3101,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
13,
4706,
1904,
3032,
842,
29918,
4299,
29898,
3051,
29897,
13,
13,
4706,
411,
7274,
29918,
17640,
29889,
29924,
8658,
580,
408,
11187,
29901,
13,
9651,
411,
13261,
29889,
3318,
29898,
3195,
29892,
8125,
3032,
657,
29918,
2084,
17255,
978,
1649,
29892,
736,
29918,
1767,
29922,
2084,
1125,
13,
18884,
411,
13261,
29889,
3318,
29898,
3195,
29892,
22868,
3195,
1649,
657,
29918,
11010,
742,
736,
29918,
1767,
29922,
2659,
12763,
580,
1125,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
4706,
11187,
29889,
2490,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
5566,
29922,
24830,
29889,
11739,
29879,
29889,
17918,
10851,
29897,
13,
462,
4706,
1904,
3032,
3258,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29897,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
4706,
11187,
29889,
2490,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
4660,
29918,
401,
29922,
29946,
29900,
29900,
29897,
13,
462,
4706,
1904,
3032,
3258,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29897,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
462,
4706,
11187,
29889,
2490,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
2433,
8875,
1495,
13,
462,
4706,
1904,
3032,
3258,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29897,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
462,
4706,
11187,
29889,
2490,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2743,
29918,
3051,
20073,
13,
462,
4706,
1904,
3032,
3258,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29897,
13,
13,
462,
1678,
2793,
1839,
29887,
5428,
29918,
978,
2033,
353,
2183,
29918,
978,
13,
462,
1678,
13304,
353,
11187,
29889,
2490,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2793,
20073,
13,
462,
1678,
1904,
3032,
3258,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29892,
1833,
29918,
3827,
29918,
271,
29922,
12673,
29889,
3707,
29898,
2230,
8028,
29889,
329,
29883,
876,
13,
13,
462,
1678,
1583,
29889,
9294,
9843,
29898,
3126,
29889,
29881,
17204,
29898,
4299,
3032,
3195,
1649,
4282,
29918,
2587,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
511,
2322,
29922,
3126,
29918,
4381,
511,
13304,
29889,
4230,
29918,
3827,
29889,
726,
29897,
13,
13,
462,
1678,
10938,
353,
4911,
12763,
580,
13,
13,
462,
1678,
363,
1820,
297,
2793,
29901,
13,
462,
4706,
565,
8125,
3032,
2303,
29911,
3035,
8254,
29918,
29950,
22027,
451,
297,
10938,
29889,
9621,
29961,
1989,
1822,
19635,
29901,
13,
462,
9651,
1583,
29889,
9294,
9843,
29898,
3126,
29889,
29881,
17204,
29898,
3051,
29961,
1989,
1402,
2322,
29922,
3126,
29918,
4381,
511,
4390,
29889,
29881,
17204,
29898,
657,
5552,
29898,
4299,
29892,
1820,
511,
2322,
29922,
3126,
29918,
4381,
876,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
1583,
29889,
9294,
8824,
29898,
5349,
5552,
29898,
4299,
29892,
1820,
876,
13,
13,
1678,
822,
1243,
29918,
8143,
29918,
16595,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
278,
5217,
1158,
947,
451,
664,
411,
9846,
2224,
3519,
29889,
13,
4706,
9995,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
1904,
353,
8125,
29898,
7317,
3101,
13,
9651,
1904,
3032,
3195,
1649,
6774,
12652,
353,
5852,
13,
9651,
1904,
29889,
8143,
580,
13,
13,
1678,
822,
1243,
29918,
8143,
29918,
17640,
287,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
393,
385,
1203,
508,
367,
11132,
3025,
263,
5012,
18476,
304,
278,
3450,
16248,
29889,
13,
4706,
9995,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
4867,
353,
16441,
580,
13,
4706,
2224,
353,
8207,
2084,
29915,
13,
13,
4706,
1904,
353,
8125,
29898,
7924,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
4706,
1904,
3032,
3195,
1649,
6774,
12652,
353,
5852,
13,
13,
4706,
411,
7274,
29918,
17640,
29889,
29924,
8658,
580,
408,
11187,
29901,
13,
9651,
411,
13261,
29889,
3318,
29898,
3195,
29892,
8125,
3032,
657,
29918,
2084,
17255,
978,
1649,
29892,
736,
29918,
1767,
29922,
2084,
1125,
13,
18884,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
1678,
11187,
29889,
8143,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
5566,
29922,
24830,
29889,
11739,
29879,
29889,
17918,
10851,
29897,
13,
462,
1678,
1904,
29889,
8143,
580,
13,
13,
18884,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
1678,
11187,
29889,
8143,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
4660,
29918,
401,
29922,
29946,
29900,
29900,
29897,
13,
462,
1678,
1904,
29889,
8143,
580,
13,
13,
18884,
11187,
29889,
8143,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2793,
20073,
13,
18884,
1904,
29889,
8143,
580,
13,
13,
1678,
822,
1243,
29918,
1837,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
1904,
15743,
29889,
13,
4706,
9995,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
1904,
29896,
353,
4911,
29898,
7317,
3101,
13,
4706,
1904,
29896,
3032,
842,
29918,
4299,
29898,
3051,
29897,
13,
13,
4706,
1904,
29906,
353,
4911,
29898,
7317,
3101,
13,
4706,
1904,
29906,
3032,
842,
29918,
4299,
29898,
3051,
29897,
13,
13,
4706,
2793,
1839,
5269,
2033,
353,
12801,
26862,
6227,
16299,
13,
13,
4706,
1904,
29941,
353,
4911,
29898,
7317,
3101,
13,
4706,
1904,
29941,
3032,
842,
29918,
4299,
29898,
3051,
29897,
13,
13,
4706,
1583,
29889,
9294,
5574,
29898,
4299,
29896,
1275,
1904,
29896,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
4299,
29906,
1275,
1904,
29906,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
4299,
29941,
1275,
1904,
29941,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
4299,
29896,
1275,
1904,
29906,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
4299,
29906,
1275,
1904,
29896,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
4299,
29896,
1275,
1904,
29941,
29897,
13,
4706,
1583,
29889,
9294,
8824,
29898,
4299,
29906,
1275,
1904,
29941,
29897,
13,
13,
1678,
822,
1243,
29918,
4102,
29918,
392,
29918,
27959,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
278,
937,
322,
15299,
1158,
29889,
13,
4706,
9995,
13,
13,
4706,
822,
20254,
29918,
27959,
29898,
28450,
29922,
8824,
29892,
4452,
29918,
546,
29918,
3827,
29922,
29896,
29900,
1125,
13,
9651,
2302,
353,
4452,
29918,
546,
29918,
3827,
565,
451,
3078,
1683,
29871,
29900,
13,
9651,
474,
353,
29871,
29900,
13,
13,
9651,
1550,
474,
529,
2302,
29901,
13,
18884,
7709,
474,
13,
18884,
474,
4619,
29871,
29896,
13,
13,
4706,
7687,
29918,
27959,
353,
7687,
29898,
29881,
11770,
29918,
27959,
29892,
3078,
29922,
5574,
29897,
13,
13,
4706,
937,
29892,
15299,
353,
8125,
3032,
4102,
29918,
392,
29918,
27959,
29898,
3846,
29918,
27959,
29897,
13,
4706,
1583,
29889,
9294,
3624,
8516,
29898,
4102,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
27959,
29897,
13,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
16329,
13463,
362,
1125,
13,
9651,
2446,
29898,
27959,
29897,
13,
13,
4706,
7687,
29918,
27959,
353,
7687,
29898,
29881,
11770,
29918,
27959,
29892,
3078,
29922,
8824,
29897,
13,
13,
4706,
937,
29892,
15299,
353,
8125,
3032,
4102,
29918,
392,
29918,
27959,
29898,
3846,
29918,
27959,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4102,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
27959,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29900,
29892,
937,
29897,
13,
13,
4706,
363,
2380,
29892,
2944,
297,
26985,
29898,
27959,
1125,
13,
9651,
1583,
29889,
9294,
9843,
29898,
2248,
29892,
2944,
29897,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
333,
29918,
978,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
393,
278,
1959,
1178,
1024,
338,
4133,
29889,
13,
4706,
9995,
13,
4706,
1583,
29889,
9294,
9843,
877,
1792,
29918,
333,
742,
8125,
3032,
657,
29918,
333,
29918,
978,
29898,
2659,
17255,
978,
1649,
876,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
4841,
29918,
3166,
29918,
1761,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
393,
278,
1959,
1178,
1051,
338,
4133,
29889,
13,
4706,
9995,
13,
4706,
1404,
29918,
333,
353,
318,
5416,
29889,
25118,
29946,
580,
13,
4706,
24788,
29918,
333,
353,
318,
5416,
29889,
25118,
29946,
580,
13,
4706,
1583,
29889,
9294,
9843,
4197,
10998,
1792,
29918,
333,
2396,
1404,
29918,
333,
29892,
525,
22481,
29918,
333,
2396,
24788,
29918,
333,
29913,
1402,
4911,
3032,
657,
29918,
4841,
29918,
3166,
29918,
1761,
4197,
1792,
29918,
333,
1402,
24788,
29918,
333,
29922,
22481,
29918,
333,
876,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
16595,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
278,
679,
1158,
947,
451,
664,
411,
9846,
2224,
3519,
29889,
13,
4706,
9995,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
1904,
353,
8125,
29898,
7317,
3101,
13,
9651,
1904,
29889,
657,
580,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
17640,
287,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
393,
385,
1203,
508,
367,
2825,
515,
385,
3450,
16248,
411,
8845,
773,
263,
13216,
29885,
9536,
10938,
29889,
13,
4706,
9995,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
2743,
29918,
3051,
353,
6571,
13,
13,
4706,
363,
1820,
297,
2793,
29901,
13,
9651,
2743,
29918,
3051,
29961,
29888,
29908,
1482,
648,
1989,
29913,
3108,
353,
2793,
29961,
1989,
29962,
13,
13,
4706,
4867,
353,
16441,
580,
13,
4706,
2224,
353,
8207,
2084,
29915,
13,
13,
4706,
1904,
353,
8125,
29898,
7924,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
13,
4706,
411,
7274,
29918,
17640,
29889,
29924,
8658,
580,
408,
11187,
29901,
13,
9651,
411,
13261,
29889,
3318,
29898,
3195,
29892,
8125,
3032,
657,
29918,
2084,
17255,
978,
1649,
29892,
736,
29918,
1767,
29922,
2084,
1125,
13,
18884,
411,
13261,
29889,
3318,
29898,
3195,
29892,
22868,
3195,
1649,
657,
29918,
11010,
742,
736,
29918,
1767,
29922,
2659,
12763,
580,
1125,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
4706,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
5566,
29922,
24830,
29889,
11739,
29879,
29889,
17918,
10851,
29897,
13,
462,
4706,
1904,
29889,
657,
580,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
4706,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
4660,
29918,
401,
29922,
29946,
29900,
29900,
29897,
13,
462,
4706,
1904,
29889,
657,
580,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
462,
4706,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
2433,
8875,
1495,
13,
462,
4706,
1904,
29889,
657,
580,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
462,
4706,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2743,
29918,
3051,
20073,
13,
462,
4706,
1904,
29889,
657,
580,
13,
13,
462,
1678,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2793,
20073,
13,
462,
1678,
1904,
29889,
657,
580,
13,
13,
462,
1678,
10938,
353,
4911,
12763,
580,
13,
13,
462,
1678,
363,
1820,
297,
2793,
29901,
13,
462,
4706,
565,
8125,
3032,
2303,
29911,
3035,
8254,
29918,
29950,
22027,
451,
297,
10938,
29889,
9621,
29961,
1989,
1822,
19635,
29901,
13,
462,
9651,
1583,
29889,
9294,
9843,
29898,
3126,
29889,
29881,
17204,
29898,
3051,
29961,
1989,
1402,
2322,
29922,
3126,
29918,
4381,
511,
4390,
29889,
29881,
17204,
29898,
657,
5552,
29898,
4299,
29892,
1820,
511,
2322,
29922,
3126,
29918,
4381,
876,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
1583,
29889,
9294,
8824,
29898,
5349,
5552,
29898,
4299,
29892,
1820,
876,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
2084,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
278,
679,
2224,
1158,
29889,
13,
4706,
9995,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
8125,
29898,
7317,
16655,
29918,
657,
29918,
2084,
29898,
3195,
3032,
10145,
29918,
2287,
18476,
29897,
13,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
8125,
29898,
7317,
16655,
29918,
657,
29918,
2084,
29898,
3195,
3032,
10145,
29918,
7194,
29897,
13,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
8125,
29898,
7317,
16655,
29918,
657,
29918,
2084,
29898,
3195,
3032,
10145,
29918,
29925,
14789,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
11219,
4299,
29914,
29929,
29929,
29929,
742,
8125,
29898,
7317,
16655,
29918,
657,
29918,
2084,
11219,
4299,
19248,
4299,
29918,
333,
29913,
742,
1178,
29922,
29929,
29929,
29929,
876,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
11010,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
278,
679,
10938,
1158,
29889,
13,
4706,
9995,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
8125,
29898,
7317,
16655,
29918,
3195,
1649,
657,
29918,
11010,
580,
13,
13,
4706,
411,
13261,
29889,
3318,
29898,
3195,
29892,
22868,
3195,
1649,
657,
29918,
11010,
742,
736,
29918,
1767,
29922,
2659,
12763,
580,
1125,
13,
9651,
8125,
29898,
7317,
16655,
29918,
3195,
1649,
657,
29918,
11010,
580,
13,
13,
1678,
822,
1243,
29918,
4299,
29918,
3166,
29918,
2754,
29918,
333,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
278,
8363,
310,
263,
1904,
411,
385,
1178,
515,
278,
3450,
1158,
947,
451,
664,
411,
9846,
3519,
29889,
13,
4706,
9995,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
8125,
3032,
4299,
29918,
3166,
29918,
2754,
29918,
333,
29898,
7317,
3285,
1178,
29922,
25118,
29889,
25118,
29946,
3101,
13,
13,
1678,
822,
1243,
29918,
9794,
29918,
3166,
29918,
2754,
29918,
4841,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
14655,
385,
20380,
1549,
4733,
411,
18999,
515,
278,
3450,
1158,
947,
451,
664,
411,
9846,
3519,
29889,
13,
4706,
9995,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
20380,
353,
8125,
3032,
9794,
29918,
3166,
29918,
2754,
29918,
4841,
29898,
7317,
3285,
15974,
3195,
3032,
3738,
27286,
29918,
1367,
29901,
318,
5416,
29889,
25118,
29946,
28296,
2314,
13,
9651,
2446,
29898,
17609,
29897,
13,
13,
1678,
822,
1243,
29918,
9794,
29918,
3166,
29918,
2754,
29918,
2084,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
14655,
385,
20380,
1549,
4733,
411,
263,
2224,
515,
278,
3450,
1158,
947,
451,
664,
411,
9846,
3519,
29889,
13,
4706,
9995,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
2224,
353,
8207,
2084,
29915,
13,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
9651,
411,
7274,
29918,
17640,
29889,
29924,
8658,
580,
408,
11187,
29901,
13,
18884,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
24360,
29901,
518,
3051,
12258,
876,
13,
18884,
20380,
353,
8125,
3032,
9794,
29918,
3166,
29918,
2754,
29918,
2084,
29898,
7317,
3285,
2224,
29892,
4452,
29918,
546,
29918,
3827,
29922,
29896,
29900,
29892,
11837,
29922,
5574,
29892,
4175,
3790,
29915,
1688,
29918,
463,
29879,
29918,
2541,
2396,
525,
3057,
29915,
1800,
13,
18884,
2446,
29898,
17609,
29897,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
16595,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
278,
716,
1158,
947,
451,
664,
411,
9846,
2224,
3519,
29889,
13,
4706,
9995,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
1904,
353,
8125,
29898,
7317,
3101,
13,
9651,
1904,
3032,
1482,
580,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
17640,
287,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
393,
263,
4472,
716,
1203,
508,
367,
2825,
515,
385,
3450,
16248,
411,
8845,
773,
263,
13216,
29885,
9536,
10938,
29889,
13,
4706,
9995,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1272,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
2743,
29918,
3051,
353,
6571,
13,
13,
4706,
363,
1820,
297,
2793,
29901,
13,
9651,
2743,
29918,
3051,
29961,
29888,
29908,
1482,
648,
1989,
29913,
3108,
353,
2793,
29961,
1989,
29962,
13,
13,
4706,
4867,
353,
16441,
580,
13,
4706,
24788,
29918,
333,
353,
2793,
29889,
657,
877,
22481,
29918,
333,
1495,
13,
4706,
2224,
353,
8207,
2084,
29915,
13,
13,
4706,
1904,
353,
8125,
29898,
7924,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
13,
4706,
411,
7274,
29918,
17640,
29889,
29924,
8658,
580,
408,
11187,
29901,
13,
9651,
411,
13261,
29889,
3318,
29898,
3195,
29892,
8125,
3032,
657,
29918,
2084,
17255,
978,
1649,
29892,
736,
29918,
1767,
29922,
2084,
1125,
13,
18884,
411,
13261,
29889,
3318,
29898,
3195,
29892,
22868,
3195,
1649,
657,
29918,
11010,
742,
736,
29918,
1767,
29922,
1469,
12763,
580,
1125,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
4706,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
5566,
29922,
24830,
29889,
11739,
29879,
29889,
17918,
10851,
29897,
13,
462,
4706,
1904,
3032,
1482,
29898,
22481,
29918,
333,
29922,
22481,
29918,
333,
29897,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
4706,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
4660,
29918,
401,
29922,
29946,
29900,
29900,
29897,
13,
462,
4706,
1904,
3032,
1482,
29898,
22481,
29918,
333,
29922,
22481,
29918,
333,
29897,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
462,
4706,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
2433,
8875,
1495,
13,
462,
4706,
1904,
3032,
1482,
29898,
22481,
29918,
333,
29922,
22481,
29918,
333,
29897,
13,
13,
462,
1678,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2743,
29918,
3051,
20073,
13,
462,
1678,
1904,
3032,
1482,
29898,
22481,
29918,
333,
29922,
22481,
29918,
333,
29897,
13,
13,
462,
1678,
11187,
29889,
657,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2793,
20073,
13,
462,
1678,
1904,
3032,
1482,
29898,
22481,
29918,
333,
29922,
22481,
29918,
333,
29897,
13,
13,
462,
1678,
10938,
353,
3630,
12763,
580,
13,
13,
462,
1678,
363,
1820,
297,
2793,
29901,
13,
462,
4706,
565,
8125,
3032,
2303,
29911,
3035,
8254,
29918,
29950,
22027,
451,
297,
10938,
29889,
9621,
29961,
1989,
1822,
19635,
29901,
13,
462,
9651,
1583,
29889,
9294,
9843,
29898,
3126,
29889,
29881,
17204,
29898,
3051,
29961,
1989,
1402,
2322,
29922,
3126,
29918,
4381,
511,
4390,
29889,
29881,
17204,
29898,
657,
5552,
29898,
4299,
29892,
1820,
511,
2322,
29922,
3126,
29918,
4381,
876,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
1583,
29889,
9294,
8824,
29898,
5349,
5552,
29898,
4299,
29892,
1820,
876,
13,
13,
1678,
822,
1243,
29918,
842,
29918,
2671,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
393,
263,
1746,
274,
1056,
367,
731,
29889,
13,
4706,
9995,
13,
4706,
10938,
353,
4911,
12763,
580,
13,
4706,
1904,
353,
8125,
29898,
7317,
3285,
10938,
29922,
11010,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
1904,
3032,
842,
29918,
4299,
29898,
3051,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
3051,
1839,
5269,
7464,
1904,
29889,
5269,
29897,
13,
13,
4706,
3517,
353,
1904,
3032,
4299,
13,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
9651,
1904,
3032,
842,
29918,
2671,
18959,
29878,
431,
29890,
728,
29896,
742,
525,
29878,
431,
29890,
728,
29906,
742,
525,
29878,
431,
29890,
728,
29941,
7464,
525,
29878,
431,
29890,
728,
1495,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
24957,
29892,
1904,
3032,
4299,
29897,
13,
13,
4706,
716,
29918,
5269,
353,
285,
29908,
1482,
648,
3051,
1839,
5269,
2033,
5038,
13,
4706,
1904,
3032,
842,
29918,
2671,
18959,
5269,
7464,
716,
29918,
5269,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1482,
29918,
5269,
29892,
1904,
29889,
5269,
29897,
13,
13,
4706,
1904,
3032,
842,
29918,
2671,
18959,
24671,
29918,
12346,
742,
29871,
29900,
1402,
525,
726,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
877,
726,
742,
511,
1904,
29889,
24671,
29918,
12346,
29897,
13,
13,
1678,
822,
1243,
29918,
842,
29918,
4299,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
393,
4426,
526,
731,
5149,
515,
278,
8600,
29889,
13,
4706,
9995,
13,
4706,
10938,
353,
4911,
12763,
580,
13,
4706,
1904,
353,
8125,
29898,
7317,
3285,
10938,
29922,
11010,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
1904,
3032,
842,
29918,
4299,
29898,
3051,
29897,
13,
13,
4706,
363,
1820,
297,
2793,
29901,
13,
9651,
565,
8125,
3032,
2303,
29911,
3035,
8254,
29918,
29950,
22027,
451,
297,
10938,
29889,
9621,
29961,
1989,
1822,
19635,
29901,
13,
18884,
1583,
29889,
9294,
9843,
29898,
1767,
29918,
517,
29918,
949,
29918,
6194,
29898,
3051,
29961,
1989,
11724,
679,
5552,
29898,
4299,
29892,
1820,
876,
13,
13,
18884,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
462,
1678,
731,
5552,
29898,
4299,
29892,
1820,
29892,
7700,
29897,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
9294,
8824,
29898,
5349,
5552,
29898,
4299,
29892,
1820,
876,
13,
13,
1678,
822,
1243,
29918,
517,
29918,
7638,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
393,
4426,
508,
367,
27387,
408,
263,
16874,
1347,
29889,
13,
4706,
9995,
13,
4706,
1904,
353,
8125,
29898,
7317,
3285,
10938,
29922,
2659,
12763,
3101,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
1904,
3032,
842,
29918,
4299,
29898,
3051,
29897,
13,
13,
4706,
411,
13261,
29889,
3318,
29898,
3195,
29892,
22868,
3195,
1649,
657,
29918,
11010,
742,
736,
29918,
1767,
29922,
2659,
12763,
580,
1125,
13,
9651,
8393,
353,
1904,
29889,
15697,
13,
13,
9651,
4839,
29892,
1196,
353,
1904,
29889,
517,
29918,
7638,
580,
13,
9651,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
6672,
29897,
13,
9651,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
1220,
29897,
13,
13,
9651,
1583,
29889,
9294,
9843,
29898,
1761,
29898,
15697,
29889,
8149,
25739,
4839,
29889,
5451,
29898,
3788,
876,
13,
9651,
1583,
29889,
9294,
9843,
4197,
1767,
29918,
517,
29918,
1807,
29898,
1767,
29897,
363,
995,
297,
8393,
29889,
5975,
580,
1402,
1196,
29889,
5451,
29898,
3788,
876,
13,
13,
9651,
4839,
29892,
1196,
353,
1904,
29889,
517,
29918,
7638,
29898,
735,
2325,
2433,
5269,
1495,
13,
9651,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
6672,
29897,
13,
9651,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
1220,
29897,
13,
13,
9651,
1583,
29889,
9294,
5574,
877,
5269,
29915,
451,
297,
4839,
29889,
5451,
29898,
3788,
876,
13,
9651,
1583,
29889,
9294,
5574,
877,
29966,
26862,
6227,
16299,
451,
297,
1196,
29889,
5451,
29898,
3788,
876,
13,
13,
1678,
822,
1243,
29918,
5504,
29918,
16595,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
278,
2767,
1158,
947,
451,
664,
411,
9846,
2224,
3519,
29889,
13,
4706,
9995,
13,
4706,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
9651,
1904,
353,
8125,
29898,
7317,
3101,
13,
9651,
1904,
29889,
5504,
580,
13,
13,
1678,
822,
1243,
29918,
5504,
29918,
1333,
29918,
6774,
12652,
29918,
17640,
287,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
393,
385,
1203,
508,
367,
4784,
746,
372,
338,
451,
3736,
12652,
29889,
13,
4706,
9995,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
4867,
353,
16441,
580,
13,
4706,
2224,
353,
8207,
2084,
29915,
13,
4706,
2183,
29918,
978,
353,
525,
3057,
29915,
13,
13,
4706,
1904,
353,
8125,
29898,
7924,
29892,
10938,
29922,
2659,
12763,
3101,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
13,
4706,
1904,
3032,
842,
29918,
4299,
29898,
3051,
29897,
13,
4706,
1904,
3032,
3195,
1649,
6774,
12652,
353,
7700,
13,
13,
4706,
1286,
353,
12865,
29889,
3707,
29898,
2230,
8028,
29889,
329,
29883,
29897,
13,
4706,
1904,
29889,
5504,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29892,
1833,
29918,
3827,
29918,
271,
29922,
3707,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29887,
5428,
29918,
978,
29892,
1904,
29889,
29887,
5428,
29918,
978,
29897,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
3707,
29892,
1904,
29889,
4230,
29918,
3827,
29918,
271,
29897,
13,
13,
1678,
822,
1243,
29918,
5504,
29918,
6774,
12652,
29918,
17640,
287,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
4321,
29879,
393,
385,
1203,
508,
367,
4784,
3025,
263,
13261,
304,
278,
3450,
16248,
411,
2933,
8845,
773,
263,
13216,
29885,
9536,
10938,
29889,
13,
4706,
9995,
13,
4706,
411,
1722,
29898,
1311,
29889,
7241,
15546,
29918,
2084,
877,
1792,
29889,
3126,
5477,
525,
29878,
1495,
408,
934,
29901,
13,
9651,
2793,
353,
4390,
29889,
18132,
29898,
1445,
29889,
949,
3101,
13,
13,
4706,
2743,
29918,
3051,
353,
6571,
13,
13,
4706,
363,
1820,
297,
2793,
29901,
13,
9651,
2743,
29918,
3051,
29961,
29888,
29908,
1482,
648,
1989,
29913,
3108,
353,
2793,
29961,
1989,
29962,
13,
13,
4706,
4867,
353,
16441,
580,
13,
4706,
2224,
353,
8207,
2084,
29915,
13,
4706,
2183,
29918,
978,
353,
525,
3057,
29915,
13,
13,
4706,
1904,
353,
8125,
29898,
7924,
29897,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
4299,
29897,
13,
4706,
1904,
3032,
3195,
1649,
6774,
12652,
353,
5852,
13,
13,
4706,
411,
7274,
29918,
17640,
29889,
29924,
8658,
580,
408,
11187,
29901,
13,
9651,
411,
13261,
29889,
3318,
29898,
3195,
29892,
8125,
3032,
657,
29918,
2084,
17255,
978,
1649,
29892,
736,
29918,
1767,
29922,
2084,
1125,
13,
18884,
411,
13261,
29889,
3318,
29898,
3195,
29892,
22868,
3195,
1649,
657,
29918,
11010,
742,
736,
29918,
1767,
29922,
2659,
12763,
580,
1125,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
4706,
11187,
29889,
5041,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
5566,
29922,
24830,
29889,
11739,
29879,
29889,
17918,
10851,
29897,
13,
462,
4706,
1904,
29889,
5504,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29897,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3089,
2392,
1125,
13,
462,
4706,
11187,
29889,
5041,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
4660,
29918,
401,
29922,
29946,
29900,
29900,
29897,
13,
462,
4706,
1904,
29889,
5504,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29897,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
462,
4706,
11187,
29889,
5041,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
2433,
8875,
1495,
13,
462,
4706,
1904,
29889,
5504,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29897,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
462,
4706,
11187,
29889,
5041,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2743,
29918,
3051,
20073,
13,
462,
4706,
1904,
29889,
5504,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29897,
13,
13,
462,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3195,
2392,
1125,
13,
462,
4706,
11187,
29889,
5041,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2793,
20073,
13,
462,
4706,
1904,
29889,
5504,
580,
13,
13,
462,
1678,
2793,
1839,
29887,
5428,
29918,
978,
2033,
353,
2183,
29918,
978,
13,
462,
1678,
13304,
353,
11187,
29889,
5041,
29898,
29888,
29908,
29912,
7317,
29889,
8787,
29918,
4219,
29918,
23397,
1157,
2084,
17671,
1426,
29922,
3126,
29889,
29881,
17204,
3319,
3195,
3032,
1525,
5550,
1164,
1660,
29918,
10818,
29918,
20387,
29931,
29901,
2793,
20073,
13,
462,
1678,
1904,
29889,
5504,
29898,
29887,
5428,
29918,
978,
29922,
29887,
5428,
29918,
978,
29892,
1833,
29918,
3827,
29918,
271,
29922,
12673,
29889,
3707,
29898,
2230,
8028,
29889,
329,
29883,
876,
13,
13,
462,
1678,
1583,
29889,
9294,
9843,
3319,
29915,
3195,
29961,
29887,
5428,
29918,
978,
29962,
2396,
2183,
29918,
978,
1118,
4390,
29889,
18132,
29898,
21412,
29889,
4230,
29918,
3827,
29889,
726,
876,
13,
13,
462,
1678,
10938,
353,
4911,
12763,
580,
13,
13,
462,
1678,
363,
1820,
297,
2793,
29901,
13,
462,
4706,
565,
8125,
3032,
2303,
29911,
3035,
8254,
29918,
29950,
22027,
451,
297,
10938,
29889,
9621,
29961,
1989,
1822,
19635,
29901,
13,
462,
9651,
1583,
29889,
9294,
9843,
29898,
3126,
29889,
29881,
17204,
29898,
3051,
29961,
1989,
1402,
2322,
29922,
3126,
29918,
4381,
511,
4390,
29889,
29881,
17204,
29898,
657,
5552,
29898,
4299,
29892,
1820,
511,
2322,
29922,
3126,
29918,
4381,
876,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
1583,
29889,
9294,
8824,
29898,
5349,
5552,
29898,
4299,
29892,
1820,
876,
13,
2
] |
setup.py | MarkLark/dstore-acl | 1 | 1612688 | from setuptools import setup
from os import path
from codecs import open
root_dir = path.abspath(path.dirname(__file__))
with open( path.join( root_dir, 'README.rst' ), encoding = 'utf-8' ) as f:
long_description = f.read()
setup(
name='DStore-ACL',
version='0.1.1',
url = 'https://github.com/MarkLark/dstore-acl',
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
description='DStore Security using Access Control Lists',
long_description=long_description,
packages=['dstore_acl'],
zip_safe=False,
include_package_data=True,
platforms='any',
install_requires=[
'dstore>=0.1.1'
],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Database :: Front-Ends'
]
)
| [
1,
515,
731,
21245,
8789,
1053,
6230,
13,
3166,
2897,
1053,
2224,
13,
3166,
775,
2395,
1053,
1722,
13,
13,
4632,
29918,
3972,
353,
2224,
29889,
370,
1028,
493,
29898,
2084,
29889,
25721,
22168,
1445,
1649,
876,
13,
13,
2541,
1722,
29898,
2224,
29889,
7122,
29898,
3876,
29918,
3972,
29892,
525,
16310,
2303,
29889,
29878,
303,
29915,
10353,
8025,
353,
525,
9420,
29899,
29947,
29915,
1723,
408,
285,
29901,
13,
1678,
1472,
29918,
8216,
353,
285,
29889,
949,
580,
13,
13,
13,
14669,
29898,
13,
1678,
1024,
2433,
29928,
9044,
29899,
2477,
29931,
742,
13,
1678,
1873,
2433,
29900,
29889,
29896,
29889,
29896,
742,
13,
1678,
3142,
353,
525,
991,
597,
3292,
29889,
510,
29914,
9802,
29931,
935,
29914,
29881,
8899,
29899,
562,
29880,
742,
13,
1678,
19405,
2433,
26349,
742,
13,
1678,
4148,
2433,
29966,
5813,
29958,
742,
13,
1678,
4148,
29918,
5269,
2433,
29966,
26862,
6227,
29958,
742,
13,
1678,
6139,
2433,
29928,
9044,
14223,
773,
11028,
11264,
2391,
29879,
742,
13,
1678,
1472,
29918,
8216,
29922,
5426,
29918,
8216,
29892,
13,
1678,
9741,
29922,
1839,
29881,
8899,
29918,
562,
29880,
7464,
13,
1678,
14319,
29918,
11177,
29922,
8824,
29892,
13,
1678,
3160,
29918,
5113,
29918,
1272,
29922,
5574,
29892,
13,
1678,
21796,
2433,
1384,
742,
13,
1678,
2601,
29918,
276,
339,
2658,
11759,
13,
4706,
525,
29881,
8899,
18572,
29900,
29889,
29896,
29889,
29896,
29915,
13,
1678,
21251,
13,
1678,
770,
14903,
11759,
13,
4706,
525,
21956,
358,
16034,
4761,
29871,
29941,
448,
838,
2026,
742,
13,
4706,
525,
2928,
2760,
319,
4749,
663,
4761,
10682,
414,
742,
13,
4706,
525,
29931,
293,
1947,
4761,
438,
5425,
28268,
1490,
4761,
341,
1806,
19245,
742,
13,
4706,
525,
7094,
1218,
2184,
4761,
6570,
25266,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29906,
29889,
29953,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29906,
29889,
29955,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
29889,
29941,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
29889,
29946,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
29889,
29945,
742,
13,
4706,
525,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
29889,
29953,
742,
13,
4706,
525,
7031,
293,
4761,
5470,
4761,
13960,
29899,
5044,
29879,
29915,
13,
1678,
4514,
13,
29897,
13,
2
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.