From e18fb126b12fd1f6fd642116b6bebedec21e0a80 Mon Sep 17 00:00:00 2001 From: "Frank H. Luo" Date: Tue, 5 Nov 2024 10:56:53 -0800 Subject: [PATCH 01/40] CRUD Updates --- app/clients/crud.py | 37 ++++++++++++++++++++++++ app/clients/models.py | 39 +++++++++++++++++++++++++ app/clients/router.py | 42 +++++++++++++++++++++++++-- app/clients/schema.py | 67 +++++++++++++++++++++++++++++++++++++++++++ app/main.py | 5 +++- 5 files changed, 186 insertions(+), 4 deletions(-) create mode 100644 app/clients/crud.py create mode 100644 app/clients/models.py diff --git a/app/clients/crud.py b/app/clients/crud.py new file mode 100644 index 00000000..b151853e --- /dev/null +++ b/app/clients/crud.py @@ -0,0 +1,37 @@ +from sqlalchemy.orm import Session +from .models import Client +from .schema import ClientCreate, ClientUpdate + + # Creates a new client record in the database +def create_client(db: Session, client: ClientCreate): + db_client = Client(**client.dict()) + db.add(db_client) + db.commit() + db.refresh(db_client) + return db_client + +# Retrieves a client record by client_id +def get_client(db: Session, client_id: int): + return db.query(Client).filter(Client.id == client_id).first() + +# Retrieves a list of client records with optional pagination +def get_clients(db: Session, skip: int = 0, limit: int = 10): + return db.query(Client).offset(skip).limit(limit).all() + +# Updates an existing client record with only the fields provided in client +def update_client(db: Session, client_id: int, client: ClientUpdate): + db_client = db.query(Client).filter(Client.id == client_id).first() + if db_client: + for key, value in client.dict(exclude_unset=True).items(): + setattr(db_client, key, value) + db.commit() + db.refresh(db_client) + return db_client + +# Deletes a client record by client_id +def delete_client(db: Session, client_id: int): + db_client = db.query(Client).filter(Client.id == client_id).first() + if db_client: + db.delete(db_client) + db.commit() + return db_client diff --git a/app/clients/models.py b/app/clients/models.py new file mode 100644 index 00000000..c82eb52a --- /dev/null +++ b/app/clients/models.py @@ -0,0 +1,39 @@ +from sqlalchemy import Column, Integer, String, Boolean +from app.database import Base # Need to create database configuration module in app.database + +# Defining the Client model, representing the 'clients' table in the database +class Client(Base): + # Setting the table name for this model to 'clients' + __tablename__ = 'clients' + + # Primary Key column, unique identifier for each client record + id = Column(Integer, primary_key=True, index=True) + name = Column(String, index=True) + age = Column(Integer) + gender = Column(String) + work_experience = Column(Integer) + canada_workex = Column(Integer) + dep_num = Column(Integer) + canada_born = Column(Boolean) + citizen_status = Column(String) + level_of_schooling = Column(String) + fluent_english = Column(Boolean) + reading_english_scale = Column(Integer) + speaking_english_scale = Column(Integer) + writing_english_scale = Column(Integer) + numeracy_scale = Column(Integer) + computer_scale = Column(Integer) + transportation_bool = Column(Boolean) + caregiver_bool = Column(Boolean) + housing = Column(String) + income_source = Column(String) + felony_bool = Column(Boolean) + attending_school = Column(Boolean) + currently_employed = Column(Boolean) + substance_use = Column(Boolean) + time_unemployed = Column(Integer) + need_mental_health_support_bool = Column(Boolean) + + # Provide a string representation of the Client instance + def __repr__(self): + return f"" diff --git a/app/clients/router.py b/app/clients/router.py index f860c402..8d28c439 100644 --- a/app/clients/router.py +++ b/app/clients/router.py @@ -1,15 +1,51 @@ -from fastapi import APIRouter -from fastapi.responses import HTMLResponse +from fastapi import APIRouter, Depends, HTTPException +from sqlalchemy.orm import Session +from typing import List from app.clients.service.logic import interpret_and_calculate -from app.clients.schema import PredictionInput +from app.clients.schema import PredictionInput, ClientCreate, ClientUpdate, Client +from app.clients.crud import create_client, get_client, get_clients, update_client, delete_client +from app.database import get_db # Need to create a get_db function to provide DB sessions router = APIRouter(prefix="/clients", tags=["clients"]) +# Prediction Endpoint @router.post("/predictions") async def predict(data: PredictionInput): print("HERE") print(data.model_dump()) return interpret_and_calculate(data.model_dump()) +# Creating a new client +@router.post("/", response_model=Client) +def create_new_client(client: ClientCreate, db: Session = Depends(get_db)): + return create_client(db=db, client=client) +# Retrieving a specific client by ID +@router.get("/{client_id}", response_model=Client) +def read_client(client_id: int, db: Session = Depends(get_db)): + client = get_client(db=db, client_id=client_id) + if client is None: + raise HTTPException(status_code=404, detail="Client not found") + return client + +# Retrieving all clients with options to skip a certain number of results and limit the number of results shown +@router.get("/", response_model=List[Client]) +def read_clients(skip: int = 0, limit: int = 10, db: Session = Depends(get_db)): + return get_clients(db=db, skip=skip, limit=limit) + +# Updating a client's information +@router.put("/{client_id}", response_model=Client) +def update_existing_client(client_id: int, client: ClientUpdate, db: Session = Depends(get_db)): + db_client = update_client(db=db, client_id=client_id, client=client) + if db_client is None: + raise HTTPException(status_code=404, detail="Client not found") + return db_client + +# Deleting a client +@router.delete("/{client_id}", response_model=Client) +def delete_existing_client(client_id: int, db: Session = Depends(get_db)): + db_client = delete_client(db=db, client_id=client_id) + if db_client is None: + raise HTTPException(status_code=404, detail="Client not found") + return db_client diff --git a/app/clients/schema.py b/app/clients/schema.py index 6b56ad98..b9d153c5 100644 --- a/app/clients/schema.py +++ b/app/clients/schema.py @@ -1,4 +1,5 @@ from pydantic import BaseModel +from typing import Optional class PredictionInput(BaseModel): age: int @@ -25,3 +26,69 @@ class PredictionInput(BaseModel): substance_use: str time_unemployed: int need_mental_health_support_bool: str + +class ClientBase(BaseModel): + name: str + age: int + gender: str + work_experience: int + canada_workex: int + dep_num: int + canada_born: bool + citizen_status: str + level_of_schooling: str + fluent_english: bool + reading_english_scale: int + speaking_english_scale: int + writing_english_scale: int + numeracy_scale: int + computer_scale: int + transportation_bool: bool + caregiver_bool: bool + housing: str + income_source: str + felony_bool: bool + attending_school: bool + currently_employed: bool + substance_use: bool + time_unemployed: int + need_mental_health_support_bool: bool + +# Schema for creating a new client +class ClientCreate(ClientBase): + pass + +# Schema for updating client information with optional fields +class ClientUpdate(BaseModel): + name: Optional[str] = None + age: Optional[int] = None + gender: Optional[str] = None + work_experience: Optional[int] = None + canada_workex: Optional[int] = None + dep_num: Optional[int] = None + canada_born: Optional[bool] = None + citizen_status: Optional[str] = None + level_of_schooling: Optional[str] = None + fluent_english: Optional[bool] = None + reading_english_scale: Optional[int] = None + speaking_english_scale: Optional[int] = None + writing_english_scale: Optional[int] = None + numeracy_scale: Optional[int] = None + computer_scale: Optional[int] = None + transportation_bool: Optional[bool] = None + caregiver_bool: Optional[bool] = None + housing: Optional[str] = None + income_source: Optional[str] = None + felony_bool: Optional[bool] = None + attending_school: Optional[bool] = None + currently_employed: Optional[bool] = None + substance_use: Optional[bool] = None + time_unemployed: Optional[int] = None + need_mental_health_support_bool: Optional[bool] = None + +# Schema for reading client information, with ORM mode enabled +class Client(ClientBase): + id: int + + class Config: + orm_mode = True diff --git a/app/main.py b/app/main.py index 5b6bf162..ea59ff43 100644 --- a/app/main.py +++ b/app/main.py @@ -2,10 +2,13 @@ from fastapi.middleware.cors import CORSMiddleware from app.clients.router import router as clients_router - +from app.database import engine, Base # Still need to create database configuration app = FastAPI() +# Creating database tables if they do not already exist +Base.metadata.create_all(bind=engine) + # Set API endpoints on router app.include_router(clients_router) From c7e593873c5491c646e4a79c334187f88167b7cc Mon Sep 17 00:00:00 2001 From: ya603J Date: Tue, 5 Nov 2024 16:13:48 -0800 Subject: [PATCH 02/40] CRUD Updates --- app/clients/crud.py | 37 ++++++++++++++++++++++++ app/clients/models.py | 39 +++++++++++++++++++++++++ app/clients/router.py | 42 +++++++++++++++++++++++++-- app/clients/schema.py | 67 +++++++++++++++++++++++++++++++++++++++++++ app/main.py | 5 +++- 5 files changed, 186 insertions(+), 4 deletions(-) create mode 100644 app/clients/crud.py create mode 100644 app/clients/models.py diff --git a/app/clients/crud.py b/app/clients/crud.py new file mode 100644 index 00000000..b151853e --- /dev/null +++ b/app/clients/crud.py @@ -0,0 +1,37 @@ +from sqlalchemy.orm import Session +from .models import Client +from .schema import ClientCreate, ClientUpdate + + # Creates a new client record in the database +def create_client(db: Session, client: ClientCreate): + db_client = Client(**client.dict()) + db.add(db_client) + db.commit() + db.refresh(db_client) + return db_client + +# Retrieves a client record by client_id +def get_client(db: Session, client_id: int): + return db.query(Client).filter(Client.id == client_id).first() + +# Retrieves a list of client records with optional pagination +def get_clients(db: Session, skip: int = 0, limit: int = 10): + return db.query(Client).offset(skip).limit(limit).all() + +# Updates an existing client record with only the fields provided in client +def update_client(db: Session, client_id: int, client: ClientUpdate): + db_client = db.query(Client).filter(Client.id == client_id).first() + if db_client: + for key, value in client.dict(exclude_unset=True).items(): + setattr(db_client, key, value) + db.commit() + db.refresh(db_client) + return db_client + +# Deletes a client record by client_id +def delete_client(db: Session, client_id: int): + db_client = db.query(Client).filter(Client.id == client_id).first() + if db_client: + db.delete(db_client) + db.commit() + return db_client diff --git a/app/clients/models.py b/app/clients/models.py new file mode 100644 index 00000000..c82eb52a --- /dev/null +++ b/app/clients/models.py @@ -0,0 +1,39 @@ +from sqlalchemy import Column, Integer, String, Boolean +from app.database import Base # Need to create database configuration module in app.database + +# Defining the Client model, representing the 'clients' table in the database +class Client(Base): + # Setting the table name for this model to 'clients' + __tablename__ = 'clients' + + # Primary Key column, unique identifier for each client record + id = Column(Integer, primary_key=True, index=True) + name = Column(String, index=True) + age = Column(Integer) + gender = Column(String) + work_experience = Column(Integer) + canada_workex = Column(Integer) + dep_num = Column(Integer) + canada_born = Column(Boolean) + citizen_status = Column(String) + level_of_schooling = Column(String) + fluent_english = Column(Boolean) + reading_english_scale = Column(Integer) + speaking_english_scale = Column(Integer) + writing_english_scale = Column(Integer) + numeracy_scale = Column(Integer) + computer_scale = Column(Integer) + transportation_bool = Column(Boolean) + caregiver_bool = Column(Boolean) + housing = Column(String) + income_source = Column(String) + felony_bool = Column(Boolean) + attending_school = Column(Boolean) + currently_employed = Column(Boolean) + substance_use = Column(Boolean) + time_unemployed = Column(Integer) + need_mental_health_support_bool = Column(Boolean) + + # Provide a string representation of the Client instance + def __repr__(self): + return f"" diff --git a/app/clients/router.py b/app/clients/router.py index f860c402..8d28c439 100644 --- a/app/clients/router.py +++ b/app/clients/router.py @@ -1,15 +1,51 @@ -from fastapi import APIRouter -from fastapi.responses import HTMLResponse +from fastapi import APIRouter, Depends, HTTPException +from sqlalchemy.orm import Session +from typing import List from app.clients.service.logic import interpret_and_calculate -from app.clients.schema import PredictionInput +from app.clients.schema import PredictionInput, ClientCreate, ClientUpdate, Client +from app.clients.crud import create_client, get_client, get_clients, update_client, delete_client +from app.database import get_db # Need to create a get_db function to provide DB sessions router = APIRouter(prefix="/clients", tags=["clients"]) +# Prediction Endpoint @router.post("/predictions") async def predict(data: PredictionInput): print("HERE") print(data.model_dump()) return interpret_and_calculate(data.model_dump()) +# Creating a new client +@router.post("/", response_model=Client) +def create_new_client(client: ClientCreate, db: Session = Depends(get_db)): + return create_client(db=db, client=client) +# Retrieving a specific client by ID +@router.get("/{client_id}", response_model=Client) +def read_client(client_id: int, db: Session = Depends(get_db)): + client = get_client(db=db, client_id=client_id) + if client is None: + raise HTTPException(status_code=404, detail="Client not found") + return client + +# Retrieving all clients with options to skip a certain number of results and limit the number of results shown +@router.get("/", response_model=List[Client]) +def read_clients(skip: int = 0, limit: int = 10, db: Session = Depends(get_db)): + return get_clients(db=db, skip=skip, limit=limit) + +# Updating a client's information +@router.put("/{client_id}", response_model=Client) +def update_existing_client(client_id: int, client: ClientUpdate, db: Session = Depends(get_db)): + db_client = update_client(db=db, client_id=client_id, client=client) + if db_client is None: + raise HTTPException(status_code=404, detail="Client not found") + return db_client + +# Deleting a client +@router.delete("/{client_id}", response_model=Client) +def delete_existing_client(client_id: int, db: Session = Depends(get_db)): + db_client = delete_client(db=db, client_id=client_id) + if db_client is None: + raise HTTPException(status_code=404, detail="Client not found") + return db_client diff --git a/app/clients/schema.py b/app/clients/schema.py index 6b56ad98..b9d153c5 100644 --- a/app/clients/schema.py +++ b/app/clients/schema.py @@ -1,4 +1,5 @@ from pydantic import BaseModel +from typing import Optional class PredictionInput(BaseModel): age: int @@ -25,3 +26,69 @@ class PredictionInput(BaseModel): substance_use: str time_unemployed: int need_mental_health_support_bool: str + +class ClientBase(BaseModel): + name: str + age: int + gender: str + work_experience: int + canada_workex: int + dep_num: int + canada_born: bool + citizen_status: str + level_of_schooling: str + fluent_english: bool + reading_english_scale: int + speaking_english_scale: int + writing_english_scale: int + numeracy_scale: int + computer_scale: int + transportation_bool: bool + caregiver_bool: bool + housing: str + income_source: str + felony_bool: bool + attending_school: bool + currently_employed: bool + substance_use: bool + time_unemployed: int + need_mental_health_support_bool: bool + +# Schema for creating a new client +class ClientCreate(ClientBase): + pass + +# Schema for updating client information with optional fields +class ClientUpdate(BaseModel): + name: Optional[str] = None + age: Optional[int] = None + gender: Optional[str] = None + work_experience: Optional[int] = None + canada_workex: Optional[int] = None + dep_num: Optional[int] = None + canada_born: Optional[bool] = None + citizen_status: Optional[str] = None + level_of_schooling: Optional[str] = None + fluent_english: Optional[bool] = None + reading_english_scale: Optional[int] = None + speaking_english_scale: Optional[int] = None + writing_english_scale: Optional[int] = None + numeracy_scale: Optional[int] = None + computer_scale: Optional[int] = None + transportation_bool: Optional[bool] = None + caregiver_bool: Optional[bool] = None + housing: Optional[str] = None + income_source: Optional[str] = None + felony_bool: Optional[bool] = None + attending_school: Optional[bool] = None + currently_employed: Optional[bool] = None + substance_use: Optional[bool] = None + time_unemployed: Optional[int] = None + need_mental_health_support_bool: Optional[bool] = None + +# Schema for reading client information, with ORM mode enabled +class Client(ClientBase): + id: int + + class Config: + orm_mode = True diff --git a/app/main.py b/app/main.py index 5b6bf162..ea59ff43 100644 --- a/app/main.py +++ b/app/main.py @@ -2,10 +2,13 @@ from fastapi.middleware.cors import CORSMiddleware from app.clients.router import router as clients_router - +from app.database import engine, Base # Still need to create database configuration app = FastAPI() +# Creating database tables if they do not already exist +Base.metadata.create_all(bind=engine) + # Set API endpoints on router app.include_router(clients_router) From 22359752e080d2fe9bb5f5a8426308e9d579d22a Mon Sep 17 00:00:00 2001 From: jeshwang Date: Fri, 8 Nov 2024 22:48:08 -0800 Subject: [PATCH 03/40] Add SQL file to create table --- app/clients/clients_create_tables.sql | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/clients/clients_create_tables.sql diff --git a/app/clients/clients_create_tables.sql b/app/clients/clients_create_tables.sql new file mode 100644 index 00000000..73a3cf3e --- /dev/null +++ b/app/clients/clients_create_tables.sql @@ -0,0 +1,34 @@ +CREATE SCHEMA IF NOT EXISTS Clients; + +USE Clients; + +DROP TABLE IF EXISTS Persons; + +CREATE TABLE Persons ( + person_id BIGINT AUTO_INCREMENT, + age INT, + gender VARCHAR(255), + work_experience INT, + canada_workex INT, + dep_num INT, + canada_born VARCHAR(255), + citizen_status VARCHAR(255), + level_of_schooling VARCHAR(255), + fluent_english VARCHAR(255), + reading_english_scale INT, + speaking_english_scale INT, + writing_english_scale INT, + numeracy_scale INT, + computer_scale INT, + transportation_bool VARCHAR(255), + caregiver_bool VARCHAR(255), + housing VARCHAR(255), + income_source VARCHAR(255), + felony_bool VARCHAR(255), + attending_school VARCHAR(255), + currently_employed VARCHAR(255), + substance_use VARCHAR(255), + time_unemployed INT, + need_mental_health_support_bool VARCHAR(255), + CONSTRAINT pk_Persons_PersonId PRIMARY KEY (person_id) +); \ No newline at end of file From 51fe2d3206e4f85e5641b0eaecf0db47ea3c1249 Mon Sep 17 00:00:00 2001 From: ya603J Date: Tue, 12 Nov 2024 13:32:24 -0800 Subject: [PATCH 04/40] Modified update and delete methods to raise an error and display error messages when client not found --- app/clients/crud.py | 13 ++++++++----- app/clients/router.py | 14 +++++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/clients/crud.py b/app/clients/crud.py index b151853e..82966185 100644 --- a/app/clients/crud.py +++ b/app/clients/crud.py @@ -21,11 +21,14 @@ def get_clients(db: Session, skip: int = 0, limit: int = 10): # Updates an existing client record with only the fields provided in client def update_client(db: Session, client_id: int, client: ClientUpdate): db_client = db.query(Client).filter(Client.id == client_id).first() - if db_client: - for key, value in client.dict(exclude_unset=True).items(): - setattr(db_client, key, value) - db.commit() - db.refresh(db_client) + if not db_client: + # Raise an error if the client is not found + raise ValueError(f"Client with ID {client_id} not found.") + # Update the client with the provided data + for key, value in client.dict(exclude_unset=True).items(): + setattr(db_client, key, value) + db.commit() + db.refresh(db_client) return db_client # Deletes a client record by client_id diff --git a/app/clients/router.py b/app/clients/router.py index 8d28c439..3a55703f 100644 --- a/app/clients/router.py +++ b/app/clients/router.py @@ -18,12 +18,12 @@ async def predict(data: PredictionInput): # Creating a new client @router.post("/", response_model=Client) -def create_new_client(client: ClientCreate, db: Session = Depends(get_db)): +async def create_new_client(client: ClientCreate, db: Session = Depends(get_db)): return create_client(db=db, client=client) # Retrieving a specific client by ID @router.get("/{client_id}", response_model=Client) -def read_client(client_id: int, db: Session = Depends(get_db)): +async def read_client(client_id: int, db: Session = Depends(get_db)): client = get_client(db=db, client_id=client_id) if client is None: raise HTTPException(status_code=404, detail="Client not found") @@ -31,21 +31,21 @@ def read_client(client_id: int, db: Session = Depends(get_db)): # Retrieving all clients with options to skip a certain number of results and limit the number of results shown @router.get("/", response_model=List[Client]) -def read_clients(skip: int = 0, limit: int = 10, db: Session = Depends(get_db)): +async def read_clients(skip: int = 0, limit: int = 10, db: Session = Depends(get_db)): return get_clients(db=db, skip=skip, limit=limit) # Updating a client's information @router.put("/{client_id}", response_model=Client) -def update_existing_client(client_id: int, client: ClientUpdate, db: Session = Depends(get_db)): +async def update_existing_client(client_id: int, client: ClientUpdate, db: Session = Depends(get_db)): db_client = update_client(db=db, client_id=client_id, client=client) if db_client is None: raise HTTPException(status_code=404, detail="Client not found") - return db_client + return {f"Client with ID " {client_id} "is updated successfully!"} # Deleting a client @router.delete("/{client_id}", response_model=Client) -def delete_existing_client(client_id: int, db: Session = Depends(get_db)): +async def delete_existing_client(client_id: int, db: Session = Depends(get_db)): db_client = delete_client(db=db, client_id=client_id) if db_client is None: raise HTTPException(status_code=404, detail="Client not found") - return db_client + return {f"Client with ID " {client_id} "is deleted successfully!"} From 9c469d18ac27c9849b5f9d9b1e757ee1ed44e09f Mon Sep 17 00:00:00 2001 From: Zheng Qiao <109362533+BossJoeZz@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:36:51 -0800 Subject: [PATCH 05/40] Database.py --- app/database.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/database.py diff --git a/app/database.py b/app/database.py new file mode 100644 index 00000000..3d5f02ef --- /dev/null +++ b/app/database.py @@ -0,0 +1,28 @@ +from sqlalchemy import create_engine +from sqlalchemy.ext.declarative import declarative_base +from sqlalchemy.orm import sessionmaker + +db_config = { + 'drivername': 'mysql+pymysql', + 'host': 'localhost', + 'port': 3306, + 'username': 'root', + 'password': 'qz325299', + 'database': 'common_assess' +} + +engine = create_engine(f"{db_config['drivername']}://{db_config['username']}:{db_config['password']}@{db_config['host']}:{db_config['port']}/{db_config['database']}") + +# Create a base class to define the database model +Base = declarative_base() + +SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) + +Base = declarative_base() + +def get_db(): + db = SessionLocal() + try: + yield db + finally: + db.close() \ No newline at end of file From 7473f0dbc2b57915a52a127966cc4e1aae6446e6 Mon Sep 17 00:00:00 2001 From: Zheng Qiao <109362533+BossJoeZz@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:38:45 -0800 Subject: [PATCH 06/40] sql syntax loading data --- app/clients/fastapi.sql | 402 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 402 insertions(+) create mode 100644 app/clients/fastapi.sql diff --git a/app/clients/fastapi.sql b/app/clients/fastapi.sql new file mode 100644 index 00000000..2043027f --- /dev/null +++ b/app/clients/fastapi.sql @@ -0,0 +1,402 @@ +/* + Navicat Premium Data Transfer + + Source Server : local + Source Server Type : MySQL + Source Server Version : 80039 + Source Host : localhost:3306 + Source Schema : fastapi + + Target Server Type : MySQL + Target Server Version : 80039 + File Encoding : 65001 + + Date: 11/11/2024 10:50:29 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for clients +-- ---------------------------- +DROP TABLE IF EXISTS `clients`; +CREATE TABLE `clients` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `age` int NULL DEFAULT NULL, + `gender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `work_experience` int NULL DEFAULT NULL, + `canada_workex` int NULL DEFAULT NULL, + `dep_num` int NULL DEFAULT NULL, + `canada_born` tinyint(1) NULL DEFAULT NULL, + `citizen_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `level_of_schooling` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `fluent_english` tinyint(1) NULL DEFAULT NULL, + `reading_english_scale` int NULL DEFAULT NULL, + `speaking_english_scale` int NULL DEFAULT NULL, + `writing_english_scale` int NULL DEFAULT NULL, + `numeracy_scale` int NULL DEFAULT NULL, + `computer_scale` int NULL DEFAULT NULL, + `transportation_bool` tinyint(1) NULL DEFAULT NULL, + `caregiver_bool` tinyint(1) NULL DEFAULT NULL, + `housing` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `income_source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `felony_bool` tinyint(1) NULL DEFAULT NULL, + `attending_school` tinyint(1) NULL DEFAULT NULL, + `currently_employed` tinyint(1) NULL DEFAULT NULL, + `substance_use` tinyint(1) NULL DEFAULT NULL, + `time_unemployed` int NULL DEFAULT NULL, + `need_mental_health_support_bool` tinyint(1) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `ix_clients_name`(`name`) USING BTREE, + INDEX `ix_clients_id`(`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of clients +-- ---------------------------- +INSERT INTO `clients` VALUES (1, 'John Doe', 20, '1', 1, 1, 3, 0, '0', '1', 0, 1, 8, 2, 3, 4, 0, 1, '1', '1', 0, 0, 0, 0, 0, 0); + +-- ---------------------------- +-- Table structure for persons +-- ---------------------------- +DROP TABLE IF EXISTS `persons`; +CREATE TABLE `persons` ( + `age` bigint NULL DEFAULT NULL, + `gender` bigint NULL DEFAULT NULL, + `work_experience` bigint NULL DEFAULT NULL, + `canada_workex` bigint NULL DEFAULT NULL, + `dep_num` bigint NULL DEFAULT NULL, + `canada_born` bigint NULL DEFAULT NULL, + `citizen_status` bigint NULL DEFAULT NULL, + `level_of_schooling` bigint NULL DEFAULT NULL, + `fluent_english` bigint NULL DEFAULT NULL, + `reading_english_scale` bigint NULL DEFAULT NULL, + `speaking_english_scale` bigint NULL DEFAULT NULL, + `writing_english_scale` bigint NULL DEFAULT NULL, + `numeracy_scale` bigint NULL DEFAULT NULL, + `computer_scale` bigint NULL DEFAULT NULL, + `transportation_bool` bigint NULL DEFAULT NULL, + `caregiver_bool` bigint NULL DEFAULT NULL, + `housing` bigint NULL DEFAULT NULL, + `income_source` bigint NULL DEFAULT NULL, + `felony_bool` bigint NULL DEFAULT NULL, + `attending_school` bigint NULL DEFAULT NULL, + `currently_employed` bigint NULL DEFAULT NULL, + `substance_use` bigint NULL DEFAULT NULL, + `time_unemployed` bigint NULL DEFAULT NULL, + `need_mental_health_support_bool` bigint NULL DEFAULT NULL, + `employment_assistance` bigint NULL DEFAULT NULL, + `life_stabilization` bigint NULL DEFAULT NULL, + `retention_services` bigint NULL DEFAULT NULL, + `specialized_services` bigint NULL DEFAULT NULL, + `employment_related_financial_supports` bigint NULL DEFAULT NULL, + `employer_financial_supports` bigint NULL DEFAULT NULL, + `enhanced_referrals` bigint NULL DEFAULT NULL, + `success_rate` bigint NULL DEFAULT NULL +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of persons +-- ---------------------------- +INSERT INTO `persons` VALUES (20, 1, 1, 1, 3, 0, 0, 1, 0, 1, 8, 2, 3, 4, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 80); +INSERT INTO `persons` VALUES (21, 2, 2, 2, 5, 1, 1, 2, 1, 2, 9, 3, 4, 5, 1, 0, 2, 2, 1, 1, 1, 0, 2, 0, 1, 1, 1, 0, 1, 1, 1, 30); +INSERT INTO `persons` VALUES (22, 1, 3, 3, 1, 0, 0, 3, 0, 3, 10, 4, 5, 6, 0, 1, 3, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (23, 2, 4, 4, 2, 1, 1, 4, 1, 4, 1, 5, 6, 7, 1, 0, 4, 4, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 1, 1, 1, 70); +INSERT INTO `persons` VALUES (24, 1, 5, 5, 0, 0, 0, 5, 0, 5, 2, 6, 7, 8, 0, 1, 5, 5, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (25, 2, 6, 6, 2, 1, 1, 6, 1, 6, 3, 7, 8, 9, 1, 0, 6, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 40); +INSERT INTO `persons` VALUES (26, 1, 7, 7, 1, 0, 0, 7, 0, 7, 4, 8, 9, 8, 0, 1, 7, 7, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 10); +INSERT INTO `persons` VALUES (27, 2, 8, 8, 0, 1, 1, 8, 1, 8, 5, 9, 8, 9, 1, 0, 8, 8, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 20); +INSERT INTO `persons` VALUES (28, 1, 9, 9, 1, 0, 0, 9, 0, 9, 6, 8, 9, 10, 0, 1, 9, 9, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 60); +INSERT INTO `persons` VALUES (29, 2, 10, 10, 0, 1, 1, 10, 1, 10, 7, 9, 10, 1, 1, 0, 10, 10, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 50); +INSERT INTO `persons` VALUES (30, 1, 1, 1, 2, 0, 0, 11, 0, 1, 8, 10, 1, 2, 0, 0, 1, 2, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 100); +INSERT INTO `persons` VALUES (31, 2, 2, 2, 0, 1, 1, 12, 1, 2, 9, 1, 2, 3, 1, 1, 2, 3, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 40); +INSERT INTO `persons` VALUES (32, 1, 3, 3, 4, 0, 0, 13, 0, 3, 8, 2, 3, 4, 0, 0, 3, 4, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 70); +INSERT INTO `persons` VALUES (33, 2, 4, 4, 2, 1, 1, 1, 1, 4, 9, 3, 4, 5, 1, 1, 4, 5, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 90); +INSERT INTO `persons` VALUES (34, 1, 5, 5, 0, 0, 0, 2, 0, 5, 10, 4, 5, 6, 0, 0, 5, 6, 1, 0, 0, 0, 3, 1, 1, 0, 0, 0, 1, 0, 0, 30); +INSERT INTO `persons` VALUES (35, 2, 6, 6, 3, 0, 0, 3, 0, 6, 1, 5, 6, 7, 0, 1, 6, 7, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (36, 1, 7, 7, 5, 1, 1, 4, 1, 7, 2, 6, 7, 8, 1, 0, 7, 8, 1, 1, 1, 0, 2, 1, 1, 1, 1, 0, 1, 1, 1, 70); +INSERT INTO `persons` VALUES (37, 2, 8, 8, 1, 0, 0, 5, 0, 8, 3, 7, 8, 9, 0, 1, 8, 9, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (38, 1, 9, 9, 2, 1, 1, 6, 1, 9, 4, 8, 9, 8, 1, 0, 9, 10, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 1, 1, 1, 30); +INSERT INTO `persons` VALUES (39, 2, 10, 10, 0, 0, 0, 7, 0, 10, 5, 9, 8, 9, 0, 1, 10, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0); +INSERT INTO `persons` VALUES (40, 1, 1, 1, 2, 1, 1, 8, 1, 1, 6, 8, 9, 10, 1, 0, 1, 2, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (41, 2, 2, 2, 1, 0, 0, 9, 0, 2, 7, 9, 10, 1, 0, 1, 2, 3, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 30); +INSERT INTO `persons` VALUES (42, 1, 3, 3, 0, 1, 1, 10, 1, 3, 8, 10, 1, 2, 1, 0, 3, 4, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 20); +INSERT INTO `persons` VALUES (43, 2, 4, 4, 1, 0, 0, 11, 0, 4, 9, 1, 2, 3, 0, 1, 4, 5, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 60); +INSERT INTO `persons` VALUES (44, 1, 5, 5, 0, 1, 1, 12, 1, 5, 8, 2, 3, 4, 1, 0, 5, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (45, 2, 6, 6, 2, 0, 0, 13, 0, 6, 9, 3, 4, 5, 0, 0, 6, 7, 1, 0, 0, 0, 3, 1, 1, 0, 0, 0, 1, 0, 0, 50); +INSERT INTO `persons` VALUES (46, 1, 7, 7, 0, 1, 1, 1, 1, 7, 10, 4, 5, 6, 1, 1, 7, 8, 0, 1, 1, 0, 4, 1, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (47, 2, 8, 8, 4, 0, 0, 2, 0, 8, 1, 5, 6, 7, 0, 0, 8, 9, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 70); +INSERT INTO `persons` VALUES (48, 1, 9, 9, 2, 1, 1, 3, 1, 9, 2, 6, 7, 8, 1, 1, 9, 10, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (49, 2, 10, 10, 0, 0, 0, 4, 0, 10, 3, 7, 8, 3, 0, 0, 6, 1, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 40); +INSERT INTO `persons` VALUES (50, 1, 1, 1, 3, 0, 0, 5, 0, 1, 4, 8, 9, 4, 0, 1, 7, 2, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (51, 2, 2, 2, 5, 1, 1, 6, 1, 2, 5, 9, 8, 5, 1, 0, 8, 3, 1, 0, 0, 1, 2, 0, 1, 0, 0, 1, 1, 0, 0, 40); +INSERT INTO `persons` VALUES (52, 1, 3, 3, 1, 0, 0, 7, 0, 3, 6, 8, 9, 6, 0, 1, 9, 4, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (53, 2, 4, 4, 2, 1, 1, 8, 1, 4, 7, 9, 10, 7, 1, 0, 10, 5, 1, 0, 0, 0, 4, 0, 1, 0, 0, 0, 1, 0, 0, 50); +INSERT INTO `persons` VALUES (54, 1, 5, 5, 0, 0, 0, 9, 0, 5, 8, 10, 1, 8, 0, 1, 1, 6, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (55, 2, 6, 6, 2, 1, 1, 10, 1, 6, 9, 1, 2, 9, 1, 0, 2, 7, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 20); +INSERT INTO `persons` VALUES (56, 1, 7, 7, 1, 0, 0, 11, 0, 7, 8, 2, 3, 8, 0, 1, 3, 8, 1, 1, 1, 0, 3, 1, 1, 1, 1, 0, 1, 1, 1, 70); +INSERT INTO `persons` VALUES (57, 2, 8, 8, 0, 1, 1, 12, 1, 8, 9, 3, 4, 9, 1, 0, 4, 9, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (58, 1, 9, 9, 1, 0, 0, 13, 0, 9, 10, 4, 5, 10, 0, 1, 5, 6, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 90); +INSERT INTO `persons` VALUES (59, 2, 10, 10, 0, 1, 1, 1, 1, 10, 1, 5, 6, 1, 1, 0, 6, 7, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 80); +INSERT INTO `persons` VALUES (60, 1, 1, 1, 2, 0, 0, 2, 0, 1, 2, 6, 7, 2, 0, 0, 8, 8, 1, 0, 1, 1, 3, 0, 1, 0, 1, 1, 1, 0, 1, 60); +INSERT INTO `persons` VALUES (61, 2, 2, 2, 0, 1, 1, 3, 1, 2, 3, 7, 8, 3, 1, 1, 9, 9, 0, 1, 0, 1, 4, 0, 0, 1, 0, 1, 0, 1, 0, 100); +INSERT INTO `persons` VALUES (62, 1, 3, 3, 4, 0, 0, 4, 0, 3, 4, 8, 3, 4, 0, 0, 10, 10, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 40); +INSERT INTO `persons` VALUES (63, 2, 4, 4, 2, 1, 1, 5, 1, 4, 5, 9, 4, 5, 1, 1, 1, 1, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 0, 80); +INSERT INTO `persons` VALUES (64, 1, 5, 5, 0, 0, 0, 6, 0, 5, 6, 8, 5, 6, 0, 0, 2, 2, 1, 0, 1, 0, 3, 1, 1, 0, 1, 0, 1, 0, 1, 30); +INSERT INTO `persons` VALUES (65, 2, 6, 6, 3, 0, 0, 7, 0, 6, 7, 9, 6, 7, 0, 1, 3, 3, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (66, 1, 7, 7, 5, 1, 1, 8, 1, 7, 8, 10, 7, 8, 1, 0, 4, 4, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 1, 0, 1, 70); +INSERT INTO `persons` VALUES (67, 2, 8, 8, 1, 0, 0, 9, 0, 8, 9, 1, 8, 9, 0, 1, 5, 5, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (68, 1, 9, 9, 2, 1, 1, 10, 1, 9, 8, 2, 9, 8, 1, 0, 6, 6, 1, 0, 0, 1, 4, 0, 1, 0, 0, 1, 1, 0, 0, 40); +INSERT INTO `persons` VALUES (69, 2, 10, 10, 0, 0, 0, 11, 0, 10, 9, 3, 8, 9, 0, 1, 7, 8, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 10); +INSERT INTO `persons` VALUES (70, 1, 1, 1, 2, 1, 1, 12, 1, 1, 10, 4, 9, 10, 1, 0, 8, 9, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 20); +INSERT INTO `persons` VALUES (71, 2, 2, 2, 1, 0, 0, 13, 0, 2, 1, 5, 10, 1, 0, 1, 9, 10, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (72, 1, 3, 3, 0, 1, 1, 1, 1, 3, 2, 6, 1, 4, 1, 0, 6, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (73, 2, 4, 4, 1, 0, 0, 2, 0, 4, 3, 7, 2, 5, 0, 1, 7, 2, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (74, 1, 5, 5, 0, 1, 1, 3, 1, 5, 4, 8, 3, 6, 1, 0, 8, 3, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (75, 2, 6, 6, 2, 0, 0, 4, 0, 6, 5, 9, 4, 7, 0, 0, 9, 4, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 70); +INSERT INTO `persons` VALUES (76, 1, 7, 7, 0, 1, 1, 5, 1, 7, 6, 8, 5, 8, 1, 1, 10, 5, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 0, 0, 0, 90); +INSERT INTO `persons` VALUES (20, 2, 8, 8, 4, 0, 0, 6, 0, 8, 7, 9, 6, 9, 0, 0, 1, 6, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 30); +INSERT INTO `persons` VALUES (21, 1, 9, 9, 2, 1, 1, 7, 1, 9, 8, 10, 7, 8, 1, 1, 2, 7, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (22, 2, 10, 10, 0, 0, 0, 8, 0, 10, 9, 1, 8, 9, 0, 0, 9, 8, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 70); +INSERT INTO `persons` VALUES (23, 1, 1, 1, 3, 0, 0, 9, 0, 1, 8, 2, 9, 10, 0, 1, 10, 9, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (24, 2, 2, 2, 5, 1, 1, 10, 1, 2, 9, 3, 8, 1, 1, 0, 1, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 30); +INSERT INTO `persons` VALUES (25, 1, 3, 3, 1, 0, 0, 11, 0, 3, 10, 4, 9, 2, 0, 1, 2, 7, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0); +INSERT INTO `persons` VALUES (26, 2, 4, 4, 2, 1, 1, 12, 1, 4, 1, 5, 10, 3, 1, 0, 3, 8, 0, 1, 1, 0, 4, 1, 0, 1, 1, 0, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (27, 1, 5, 5, 0, 0, 0, 13, 0, 5, 2, 6, 1, 4, 0, 1, 4, 9, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 30); +INSERT INTO `persons` VALUES (28, 2, 6, 6, 2, 1, 1, 1, 1, 6, 3, 7, 2, 5, 1, 0, 5, 10, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 20); +INSERT INTO `persons` VALUES (29, 1, 7, 7, 1, 0, 0, 2, 0, 7, 4, 8, 3, 6, 0, 1, 6, 1, 0, 0, 0, 1, 3, 0, 0, 0, 0, 1, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (30, 2, 8, 8, 0, 1, 1, 3, 1, 8, 5, 9, 4, 7, 1, 0, 8, 2, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (31, 1, 9, 9, 1, 0, 0, 4, 0, 9, 6, 8, 5, 8, 0, 1, 9, 9, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 50); +INSERT INTO `persons` VALUES (32, 2, 10, 10, 0, 1, 1, 5, 1, 10, 7, 9, 6, 9, 1, 0, 10, 10, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (33, 1, 1, 1, 2, 0, 0, 6, 0, 1, 8, 10, 7, 8, 0, 0, 1, 1, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 70); +INSERT INTO `persons` VALUES (34, 2, 2, 2, 0, 1, 1, 7, 1, 2, 9, 1, 8, 9, 1, 1, 2, 2, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (35, 1, 3, 3, 4, 0, 0, 8, 0, 3, 8, 2, 9, 10, 0, 0, 3, 3, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (36, 2, 4, 4, 2, 1, 1, 9, 1, 4, 9, 3, 8, 1, 1, 1, 4, 4, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 80); +INSERT INTO `persons` VALUES (37, 1, 5, 5, 0, 0, 0, 10, 0, 5, 10, 4, 9, 2, 0, 0, 5, 5, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (38, 2, 6, 6, 3, 0, 0, 11, 0, 6, 1, 5, 10, 3, 0, 1, 6, 6, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (39, 1, 7, 7, 5, 1, 1, 12, 1, 7, 2, 6, 1, 4, 1, 0, 7, 8, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 50); +INSERT INTO `persons` VALUES (40, 2, 8, 8, 1, 0, 0, 13, 0, 8, 3, 7, 2, 5, 0, 1, 8, 9, 0, 0, 1, 1, 3, 0, 0, 0, 1, 1, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (41, 1, 9, 9, 2, 1, 1, 1, 1, 9, 4, 8, 3, 6, 1, 0, 9, 10, 0, 1, 0, 1, 4, 0, 0, 1, 0, 1, 0, 1, 0, 20); +INSERT INTO `persons` VALUES (42, 2, 10, 10, 0, 0, 0, 2, 0, 10, 5, 2, 4, 7, 0, 1, 10, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 70); +INSERT INTO `persons` VALUES (43, 1, 1, 1, 2, 1, 1, 3, 1, 1, 6, 3, 5, 8, 1, 0, 1, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (44, 2, 2, 2, 1, 0, 0, 4, 0, 2, 7, 4, 6, 3, 0, 1, 2, 2, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 90); +INSERT INTO `persons` VALUES (45, 1, 3, 3, 0, 1, 1, 5, 1, 3, 8, 5, 7, 4, 1, 0, 3, 3, 0, 0, 1, 0, 4, 1, 0, 0, 1, 0, 0, 0, 1, 80); +INSERT INTO `persons` VALUES (46, 2, 4, 4, 1, 0, 0, 6, 0, 4, 9, 6, 8, 5, 0, 1, 4, 4, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (47, 1, 5, 5, 0, 1, 1, 7, 1, 5, 8, 7, 3, 6, 1, 0, 5, 5, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (48, 2, 6, 6, 2, 0, 0, 8, 0, 6, 9, 8, 4, 7, 0, 0, 6, 6, 0, 1, 0, 1, 3, 0, 0, 1, 0, 1, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (49, 1, 7, 7, 0, 1, 1, 9, 1, 7, 10, 9, 5, 8, 1, 1, 8, 7, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 30); +INSERT INTO `persons` VALUES (50, 2, 8, 8, 4, 0, 0, 10, 0, 8, 1, 8, 6, 9, 0, 0, 9, 8, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 20); +INSERT INTO `persons` VALUES (51, 1, 9, 9, 2, 1, 1, 11, 1, 9, 2, 9, 7, 8, 1, 1, 10, 9, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (52, 2, 10, 10, 0, 0, 0, 12, 0, 10, 3, 10, 8, 9, 0, 0, 1, 10, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (53, 1, 1, 1, 3, 0, 0, 13, 0, 1, 4, 1, 9, 10, 0, 1, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 50); +INSERT INTO `persons` VALUES (54, 2, 2, 2, 5, 1, 1, 1, 1, 2, 5, 2, 8, 1, 1, 0, 3, 2, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (55, 1, 3, 3, 1, 0, 0, 2, 0, 3, 6, 3, 9, 2, 0, 1, 4, 3, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 70); +INSERT INTO `persons` VALUES (56, 2, 4, 4, 2, 1, 1, 3, 1, 4, 7, 4, 10, 3, 1, 0, 5, 4, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 0, 0, 0, 100); +INSERT INTO `persons` VALUES (57, 1, 5, 5, 0, 0, 0, 4, 0, 5, 8, 5, 1, 4, 0, 1, 6, 5, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 40); +INSERT INTO `persons` VALUES (58, 2, 6, 6, 2, 1, 1, 5, 1, 6, 9, 6, 2, 5, 1, 0, 7, 6, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 80); +INSERT INTO `persons` VALUES (59, 1, 7, 7, 1, 0, 0, 6, 0, 7, 8, 7, 3, 6, 0, 1, 8, 7, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 40); +INSERT INTO `persons` VALUES (60, 2, 8, 8, 0, 1, 1, 7, 1, 8, 9, 8, 4, 7, 1, 0, 9, 8, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 100); +INSERT INTO `persons` VALUES (61, 1, 9, 9, 1, 0, 0, 8, 0, 9, 10, 9, 5, 8, 0, 1, 10, 9, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 50); +INSERT INTO `persons` VALUES (62, 2, 1, 10, 0, 1, 1, 9, 1, 10, 1, 8, 6, 9, 1, 1, 1, 10, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (63, 1, 2, 1, 2, 0, 0, 10, 0, 1, 2, 9, 7, 8, 0, 0, 2, 1, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 0, 1, 1, 20); +INSERT INTO `persons` VALUES (64, 2, 3, 2, 0, 1, 1, 11, 1, 2, 3, 10, 8, 9, 1, 1, 3, 2, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 70); +INSERT INTO `persons` VALUES (65, 1, 4, 3, 4, 0, 0, 12, 0, 3, 4, 1, 9, 10, 0, 0, 4, 3, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (66, 2, 5, 4, 2, 1, 1, 13, 1, 4, 5, 2, 8, 1, 1, 1, 5, 4, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 90); +INSERT INTO `persons` VALUES (67, 1, 6, 5, 0, 0, 0, 1, 0, 5, 6, 3, 9, 4, 0, 0, 6, 5, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (68, 2, 7, 6, 3, 0, 0, 2, 0, 6, 7, 4, 10, 5, 0, 1, 8, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (69, 1, 8, 7, 5, 1, 1, 3, 1, 7, 8, 5, 1, 6, 1, 0, 9, 7, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (70, 2, 9, 8, 1, 0, 0, 4, 0, 8, 9, 6, 2, 7, 0, 1, 10, 8, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (71, 1, 10, 9, 2, 1, 1, 5, 1, 9, 8, 7, 3, 8, 1, 0, 1, 9, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 30); +INSERT INTO `persons` VALUES (72, 2, 1, 10, 0, 0, 0, 6, 0, 10, 9, 8, 4, 9, 0, 0, 2, 6, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 20); +INSERT INTO `persons` VALUES (73, 1, 2, 1, 2, 1, 1, 7, 1, 1, 10, 9, 5, 8, 1, 1, 3, 7, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (74, 2, 3, 2, 1, 0, 0, 8, 0, 2, 1, 8, 6, 9, 0, 0, 4, 8, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (75, 1, 4, 3, 0, 1, 1, 9, 1, 3, 2, 9, 7, 10, 1, 1, 5, 9, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 50); +INSERT INTO `persons` VALUES (76, 2, 5, 4, 1, 0, 0, 10, 0, 4, 3, 10, 8, 1, 0, 0, 6, 10, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (21, 2, 6, 5, 0, 1, 1, 11, 1, 5, 4, 1, 9, 2, 1, 1, 7, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 70); +INSERT INTO `persons` VALUES (22, 1, 7, 6, 2, 0, 0, 12, 0, 6, 5, 2, 8, 3, 0, 0, 8, 2, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (23, 2, 8, 7, 0, 1, 1, 13, 1, 7, 6, 3, 9, 4, 1, 1, 9, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (24, 1, 9, 8, 4, 0, 0, 1, 0, 8, 7, 4, 10, 5, 0, 0, 10, 4, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (25, 2, 10, 9, 2, 1, 1, 2, 1, 9, 8, 5, 1, 6, 1, 1, 1, 5, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (26, 1, 1, 10, 0, 0, 0, 3, 0, 10, 9, 6, 2, 7, 0, 0, 2, 6, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (27, 2, 2, 1, 3, 0, 0, 4, 0, 1, 8, 7, 3, 8, 0, 1, 3, 8, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 50); +INSERT INTO `persons` VALUES (28, 1, 3, 2, 5, 1, 1, 5, 1, 2, 9, 8, 4, 9, 1, 0, 4, 9, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (29, 2, 4, 3, 1, 0, 0, 6, 0, 3, 10, 9, 5, 8, 0, 1, 5, 10, 0, 1, 0, 1, 3, 0, 0, 1, 0, 1, 0, 1, 0, 20); +INSERT INTO `persons` VALUES (30, 1, 5, 4, 2, 1, 1, 7, 1, 4, 1, 8, 6, 9, 1, 0, 6, 1, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 70); +INSERT INTO `persons` VALUES (31, 2, 6, 5, 0, 0, 0, 8, 0, 5, 2, 9, 7, 10, 0, 0, 8, 2, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (32, 1, 7, 6, 2, 1, 1, 9, 1, 6, 3, 10, 8, 1, 1, 1, 9, 3, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 90); +INSERT INTO `persons` VALUES (33, 2, 8, 7, 1, 0, 0, 10, 0, 7, 4, 1, 3, 2, 0, 0, 10, 4, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 80); +INSERT INTO `persons` VALUES (34, 1, 9, 8, 0, 1, 1, 11, 1, 8, 5, 2, 4, 3, 1, 1, 1, 5, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (35, 2, 10, 9, 1, 0, 0, 12, 0, 9, 6, 3, 5, 4, 0, 0, 2, 6, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 100); +INSERT INTO `persons` VALUES (36, 1, 1, 10, 0, 1, 1, 13, 1, 10, 7, 4, 6, 5, 1, 1, 3, 7, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 40); +INSERT INTO `persons` VALUES (37, 2, 2, 1, 2, 0, 0, 1, 0, 1, 8, 5, 7, 6, 0, 0, 4, 8, 0, 1, 0, 1, 3, 1, 0, 1, 0, 1, 0, 1, 0, 30); +INSERT INTO `persons` VALUES (38, 2, 3, 2, 0, 1, 1, 2, 1, 2, 9, 6, 8, 7, 1, 1, 5, 9, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 20); +INSERT INTO `persons` VALUES (39, 1, 4, 3, 4, 0, 0, 3, 0, 3, 8, 7, 9, 8, 0, 0, 6, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (40, 2, 5, 4, 2, 1, 1, 4, 1, 4, 9, 8, 8, 3, 1, 1, 7, 7, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (41, 1, 1, 5, 0, 0, 0, 5, 0, 5, 10, 9, 9, 4, 0, 0, 8, 8, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (42, 2, 2, 6, 3, 0, 0, 6, 0, 6, 1, 8, 10, 5, 0, 1, 9, 9, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (43, 1, 3, 7, 5, 1, 1, 7, 1, 7, 2, 9, 1, 6, 1, 0, 10, 10, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 70); +INSERT INTO `persons` VALUES (44, 2, 4, 8, 1, 0, 0, 8, 0, 8, 3, 10, 2, 7, 0, 1, 1, 1, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (39, 1, 5, 9, 2, 1, 1, 9, 1, 9, 4, 1, 3, 8, 1, 0, 2, 2, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (40, 2, 6, 10, 0, 0, 0, 10, 0, 10, 5, 2, 4, 9, 0, 0, 3, 9, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (41, 1, 7, 1, 2, 1, 1, 11, 1, 1, 6, 3, 5, 8, 1, 1, 4, 10, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (42, 2, 8, 2, 1, 0, 0, 12, 0, 2, 7, 4, 6, 9, 0, 0, 5, 1, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (43, 1, 9, 3, 0, 1, 1, 13, 1, 3, 8, 5, 7, 10, 1, 1, 6, 2, 0, 0, 0, 1, 4, 0, 0, 0, 0, 1, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (44, 2, 10, 4, 1, 0, 0, 7, 0, 4, 9, 6, 8, 1, 0, 0, 8, 3, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (45, 1, 1, 5, 0, 1, 1, 8, 1, 5, 5, 7, 9, 2, 1, 1, 9, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 20); +INSERT INTO `persons` VALUES (46, 2, 2, 6, 2, 0, 0, 9, 0, 6, 6, 8, 8, 3, 0, 0, 10, 5, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 70); +INSERT INTO `persons` VALUES (47, 1, 3, 7, 0, 1, 1, 10, 1, 7, 7, 9, 9, 4, 1, 1, 1, 6, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (48, 2, 4, 8, 4, 0, 0, 11, 0, 8, 8, 8, 10, 5, 0, 0, 2, 8, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 90); +INSERT INTO `persons` VALUES (49, 1, 5, 9, 2, 1, 1, 12, 1, 9, 9, 9, 1, 6, 1, 1, 3, 9, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 80); +INSERT INTO `persons` VALUES (20, 1, 1, 1, 3, 0, 0, 1, 0, 1, 8, 2, 3, 4, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 80); +INSERT INTO `persons` VALUES (21, 2, 2, 2, 5, 1, 1, 2, 1, 2, 9, 3, 4, 5, 1, 0, 2, 2, 1, 1, 1, 0, 2, 0, 1, 1, 1, 0, 1, 1, 1, 30); +INSERT INTO `persons` VALUES (22, 1, 3, 3, 1, 0, 0, 3, 0, 3, 10, 4, 5, 6, 0, 1, 3, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (23, 2, 4, 4, 2, 1, 1, 4, 1, 4, 1, 5, 6, 7, 1, 0, 4, 4, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 1, 1, 1, 70); +INSERT INTO `persons` VALUES (24, 1, 5, 5, 0, 0, 0, 5, 0, 5, 2, 6, 7, 8, 0, 1, 5, 5, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (25, 2, 6, 6, 2, 1, 1, 6, 1, 6, 3, 7, 8, 9, 1, 0, 6, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 40); +INSERT INTO `persons` VALUES (26, 1, 7, 7, 1, 0, 0, 7, 0, 7, 4, 8, 9, 8, 0, 1, 7, 7, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 10); +INSERT INTO `persons` VALUES (27, 2, 8, 8, 0, 1, 1, 8, 1, 8, 5, 9, 8, 9, 1, 0, 8, 8, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 20); +INSERT INTO `persons` VALUES (28, 1, 9, 9, 1, 0, 0, 9, 0, 9, 6, 8, 9, 10, 0, 1, 9, 9, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 60); +INSERT INTO `persons` VALUES (29, 2, 10, 10, 0, 1, 1, 10, 1, 10, 7, 9, 10, 1, 1, 0, 10, 10, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 50); +INSERT INTO `persons` VALUES (30, 1, 1, 1, 2, 0, 0, 11, 0, 1, 8, 10, 1, 2, 0, 0, 1, 2, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 100); +INSERT INTO `persons` VALUES (31, 2, 2, 2, 0, 1, 1, 12, 1, 2, 9, 1, 2, 3, 1, 1, 2, 3, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 40); +INSERT INTO `persons` VALUES (32, 1, 3, 3, 4, 0, 0, 13, 0, 3, 8, 2, 3, 4, 0, 0, 3, 4, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 70); +INSERT INTO `persons` VALUES (33, 2, 4, 4, 2, 1, 1, 1, 1, 4, 9, 3, 4, 5, 1, 1, 4, 5, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 90); +INSERT INTO `persons` VALUES (34, 1, 5, 5, 0, 0, 0, 2, 0, 5, 10, 4, 5, 6, 0, 0, 5, 6, 1, 0, 0, 0, 3, 1, 1, 0, 0, 0, 1, 0, 0, 30); +INSERT INTO `persons` VALUES (35, 2, 6, 6, 3, 0, 0, 3, 0, 6, 1, 5, 6, 7, 0, 1, 6, 7, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (36, 1, 7, 7, 5, 1, 1, 4, 1, 7, 2, 6, 7, 8, 1, 0, 7, 8, 1, 1, 1, 0, 2, 1, 1, 1, 1, 0, 1, 1, 1, 70); +INSERT INTO `persons` VALUES (37, 2, 8, 8, 1, 0, 0, 5, 0, 8, 3, 7, 8, 9, 0, 1, 8, 9, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (38, 1, 9, 9, 2, 1, 1, 6, 1, 9, 4, 8, 9, 8, 1, 0, 9, 10, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 1, 1, 1, 30); +INSERT INTO `persons` VALUES (39, 2, 10, 10, 0, 0, 0, 7, 0, 10, 5, 9, 8, 9, 0, 1, 10, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0); +INSERT INTO `persons` VALUES (40, 1, 1, 1, 2, 1, 1, 8, 1, 1, 6, 8, 9, 10, 1, 0, 1, 2, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (41, 2, 2, 2, 1, 0, 0, 9, 0, 2, 7, 9, 10, 1, 0, 1, 2, 3, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 30); +INSERT INTO `persons` VALUES (42, 1, 3, 3, 0, 1, 1, 10, 1, 3, 8, 10, 1, 2, 1, 0, 3, 4, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 20); +INSERT INTO `persons` VALUES (43, 2, 4, 4, 1, 0, 0, 11, 0, 4, 9, 1, 2, 3, 0, 1, 4, 5, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 60); +INSERT INTO `persons` VALUES (44, 1, 5, 5, 0, 1, 1, 12, 1, 5, 8, 2, 3, 4, 1, 0, 5, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (45, 2, 6, 6, 2, 0, 0, 13, 0, 6, 9, 3, 4, 5, 0, 0, 6, 7, 1, 0, 0, 0, 3, 1, 1, 0, 0, 0, 1, 0, 0, 50); +INSERT INTO `persons` VALUES (46, 1, 7, 7, 0, 1, 1, 1, 1, 7, 10, 4, 5, 6, 1, 1, 7, 8, 0, 1, 1, 0, 4, 1, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (47, 2, 8, 8, 4, 0, 0, 2, 0, 8, 1, 5, 6, 7, 0, 0, 8, 9, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 70); +INSERT INTO `persons` VALUES (48, 1, 9, 9, 2, 1, 1, 3, 1, 9, 2, 6, 7, 8, 1, 1, 9, 10, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (49, 2, 10, 10, 0, 0, 0, 4, 0, 10, 3, 7, 8, 3, 0, 0, 6, 1, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 40); +INSERT INTO `persons` VALUES (50, 1, 1, 1, 3, 0, 0, 5, 0, 1, 4, 8, 9, 4, 0, 1, 7, 2, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (51, 2, 2, 2, 5, 1, 1, 6, 1, 2, 5, 9, 8, 5, 1, 0, 8, 3, 1, 0, 0, 1, 2, 0, 1, 0, 0, 1, 1, 0, 0, 40); +INSERT INTO `persons` VALUES (52, 1, 3, 3, 1, 0, 0, 7, 0, 3, 6, 8, 9, 6, 0, 1, 9, 4, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (53, 2, 4, 4, 2, 1, 1, 8, 1, 4, 7, 9, 10, 7, 1, 0, 10, 5, 1, 0, 0, 0, 4, 0, 1, 0, 0, 0, 1, 0, 0, 50); +INSERT INTO `persons` VALUES (54, 1, 5, 5, 0, 0, 0, 9, 0, 5, 8, 10, 1, 8, 0, 1, 1, 6, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (55, 2, 6, 6, 2, 1, 1, 10, 1, 6, 9, 1, 2, 9, 1, 0, 2, 7, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 20); +INSERT INTO `persons` VALUES (56, 1, 7, 7, 1, 0, 0, 11, 0, 7, 8, 2, 3, 8, 0, 1, 3, 8, 1, 1, 1, 0, 3, 1, 1, 1, 1, 0, 1, 1, 1, 70); +INSERT INTO `persons` VALUES (57, 2, 8, 8, 0, 1, 1, 12, 1, 8, 9, 3, 4, 9, 1, 0, 4, 9, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (58, 1, 9, 9, 1, 0, 0, 13, 0, 9, 10, 4, 5, 10, 0, 1, 5, 6, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 90); +INSERT INTO `persons` VALUES (59, 2, 10, 10, 0, 1, 1, 1, 1, 10, 1, 5, 6, 1, 1, 0, 6, 7, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 80); +INSERT INTO `persons` VALUES (60, 1, 1, 1, 2, 0, 0, 2, 0, 1, 2, 6, 7, 2, 0, 0, 8, 8, 1, 0, 1, 1, 3, 0, 1, 0, 1, 1, 1, 0, 1, 60); +INSERT INTO `persons` VALUES (61, 2, 2, 2, 0, 1, 1, 3, 1, 2, 3, 7, 8, 3, 1, 1, 9, 9, 0, 1, 0, 1, 4, 0, 0, 1, 0, 1, 0, 1, 0, 100); +INSERT INTO `persons` VALUES (62, 1, 3, 3, 4, 0, 0, 4, 0, 3, 4, 8, 3, 4, 0, 0, 10, 10, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 40); +INSERT INTO `persons` VALUES (63, 2, 4, 4, 2, 1, 1, 5, 1, 4, 5, 9, 4, 5, 1, 1, 1, 1, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 0, 80); +INSERT INTO `persons` VALUES (64, 1, 5, 5, 0, 0, 0, 6, 0, 5, 6, 8, 5, 6, 0, 0, 2, 2, 1, 0, 1, 0, 3, 1, 1, 0, 1, 0, 1, 0, 1, 30); +INSERT INTO `persons` VALUES (65, 2, 6, 6, 3, 0, 0, 7, 0, 6, 7, 9, 6, 7, 0, 1, 3, 3, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (66, 1, 7, 7, 5, 1, 1, 8, 1, 7, 8, 10, 7, 8, 1, 0, 4, 4, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 1, 0, 1, 70); +INSERT INTO `persons` VALUES (67, 2, 8, 8, 1, 0, 0, 9, 0, 8, 9, 1, 8, 9, 0, 1, 5, 5, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (68, 1, 9, 9, 2, 1, 1, 10, 1, 9, 8, 2, 9, 8, 1, 0, 6, 6, 1, 0, 0, 1, 4, 0, 1, 0, 0, 1, 1, 0, 0, 40); +INSERT INTO `persons` VALUES (69, 2, 10, 10, 0, 0, 0, 11, 0, 10, 9, 3, 8, 9, 0, 1, 7, 8, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 10); +INSERT INTO `persons` VALUES (70, 1, 1, 1, 2, 1, 1, 12, 1, 1, 10, 4, 9, 10, 1, 0, 8, 9, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 20); +INSERT INTO `persons` VALUES (71, 2, 2, 2, 1, 0, 0, 13, 0, 2, 1, 5, 10, 1, 0, 1, 9, 10, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (72, 1, 3, 3, 0, 1, 1, 1, 1, 3, 2, 6, 1, 4, 1, 0, 6, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (73, 2, 4, 4, 1, 0, 0, 2, 0, 4, 3, 7, 2, 5, 0, 1, 7, 2, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (74, 1, 5, 5, 0, 1, 1, 3, 1, 5, 4, 8, 3, 6, 1, 0, 8, 3, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (75, 2, 6, 6, 2, 0, 0, 4, 0, 6, 5, 9, 4, 7, 0, 0, 9, 4, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 70); +INSERT INTO `persons` VALUES (76, 1, 7, 7, 0, 1, 1, 5, 1, 7, 6, 8, 5, 8, 1, 1, 10, 5, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 0, 0, 0, 90); +INSERT INTO `persons` VALUES (20, 2, 8, 8, 4, 0, 0, 6, 0, 8, 7, 9, 6, 9, 0, 0, 1, 6, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 30); +INSERT INTO `persons` VALUES (21, 1, 9, 9, 2, 1, 1, 7, 1, 9, 8, 10, 7, 8, 1, 1, 2, 7, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (22, 2, 10, 10, 0, 0, 0, 8, 0, 10, 9, 1, 8, 9, 0, 0, 9, 8, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 70); +INSERT INTO `persons` VALUES (23, 1, 1, 1, 3, 0, 0, 9, 0, 1, 8, 2, 9, 10, 0, 1, 10, 9, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (24, 2, 2, 2, 5, 1, 1, 10, 1, 2, 9, 3, 8, 1, 1, 0, 1, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 30); +INSERT INTO `persons` VALUES (25, 1, 3, 3, 1, 0, 0, 11, 0, 3, 10, 4, 9, 2, 0, 1, 2, 7, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0); +INSERT INTO `persons` VALUES (26, 2, 4, 4, 2, 1, 1, 12, 1, 4, 1, 5, 10, 3, 1, 0, 3, 8, 0, 1, 1, 0, 4, 1, 0, 1, 1, 0, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (27, 1, 5, 5, 0, 0, 0, 13, 0, 5, 2, 6, 1, 4, 0, 1, 4, 9, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 30); +INSERT INTO `persons` VALUES (28, 2, 6, 6, 2, 1, 1, 1, 1, 6, 3, 7, 2, 5, 1, 0, 5, 10, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 20); +INSERT INTO `persons` VALUES (29, 1, 7, 7, 1, 0, 0, 2, 0, 7, 4, 8, 3, 6, 0, 1, 6, 1, 0, 0, 0, 1, 3, 0, 0, 0, 0, 1, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (30, 2, 8, 8, 0, 1, 1, 3, 1, 8, 5, 9, 4, 7, 1, 0, 8, 2, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (31, 1, 9, 9, 1, 0, 0, 4, 0, 9, 6, 8, 5, 8, 0, 1, 9, 9, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 50); +INSERT INTO `persons` VALUES (32, 2, 10, 10, 0, 1, 1, 5, 1, 10, 7, 9, 6, 9, 1, 0, 10, 10, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (33, 1, 1, 1, 2, 0, 0, 6, 0, 1, 8, 10, 7, 8, 0, 0, 1, 1, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 70); +INSERT INTO `persons` VALUES (34, 2, 2, 2, 0, 1, 1, 7, 1, 2, 9, 1, 8, 9, 1, 1, 2, 2, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (35, 1, 3, 3, 4, 0, 0, 8, 0, 3, 8, 2, 9, 10, 0, 0, 3, 3, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (36, 2, 4, 4, 2, 1, 1, 9, 1, 4, 9, 3, 8, 1, 1, 1, 4, 4, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 80); +INSERT INTO `persons` VALUES (37, 1, 5, 5, 0, 0, 0, 10, 0, 5, 10, 4, 9, 2, 0, 0, 5, 5, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (38, 2, 6, 6, 3, 0, 0, 11, 0, 6, 1, 5, 10, 3, 0, 1, 6, 6, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (39, 1, 7, 7, 5, 1, 1, 12, 1, 7, 2, 6, 1, 4, 1, 0, 7, 8, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 50); +INSERT INTO `persons` VALUES (40, 2, 8, 8, 1, 0, 0, 13, 0, 8, 3, 7, 2, 5, 0, 1, 8, 9, 0, 0, 1, 1, 3, 0, 0, 0, 1, 1, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (41, 1, 9, 9, 2, 1, 1, 1, 1, 9, 4, 8, 3, 6, 1, 0, 9, 10, 0, 1, 0, 1, 4, 0, 0, 1, 0, 1, 0, 1, 0, 20); +INSERT INTO `persons` VALUES (42, 2, 10, 10, 0, 0, 0, 2, 0, 10, 5, 2, 4, 7, 0, 1, 10, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 70); +INSERT INTO `persons` VALUES (43, 1, 1, 1, 2, 1, 1, 3, 1, 1, 6, 3, 5, 8, 1, 0, 1, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (44, 2, 2, 2, 1, 0, 0, 4, 0, 2, 7, 4, 6, 3, 0, 1, 2, 2, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 90); +INSERT INTO `persons` VALUES (45, 1, 3, 3, 0, 1, 1, 5, 1, 3, 8, 5, 7, 4, 1, 0, 3, 3, 0, 0, 1, 0, 4, 1, 0, 0, 1, 0, 0, 0, 1, 80); +INSERT INTO `persons` VALUES (46, 2, 4, 4, 1, 0, 0, 6, 0, 4, 9, 6, 8, 5, 0, 1, 4, 4, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (47, 1, 5, 5, 0, 1, 1, 7, 1, 5, 8, 7, 3, 6, 1, 0, 5, 5, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (48, 2, 6, 6, 2, 0, 0, 8, 0, 6, 9, 8, 4, 7, 0, 0, 6, 6, 0, 1, 0, 1, 3, 0, 0, 1, 0, 1, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (49, 1, 7, 7, 0, 1, 1, 9, 1, 7, 10, 9, 5, 8, 1, 1, 8, 7, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 30); +INSERT INTO `persons` VALUES (50, 2, 8, 8, 4, 0, 0, 10, 0, 8, 1, 8, 6, 9, 0, 0, 9, 8, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 20); +INSERT INTO `persons` VALUES (51, 1, 9, 9, 2, 1, 1, 11, 1, 9, 2, 9, 7, 8, 1, 1, 10, 9, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (52, 2, 10, 10, 0, 0, 0, 12, 0, 10, 3, 10, 8, 9, 0, 0, 1, 10, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (53, 1, 1, 1, 3, 0, 0, 13, 0, 1, 4, 1, 9, 10, 0, 1, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 50); +INSERT INTO `persons` VALUES (54, 2, 2, 2, 5, 1, 1, 1, 1, 2, 5, 2, 8, 1, 1, 0, 3, 2, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (55, 1, 3, 3, 1, 0, 0, 2, 0, 3, 6, 3, 9, 2, 0, 1, 4, 3, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 70); +INSERT INTO `persons` VALUES (56, 2, 4, 4, 2, 1, 1, 3, 1, 4, 7, 4, 10, 3, 1, 0, 5, 4, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 0, 0, 0, 100); +INSERT INTO `persons` VALUES (57, 1, 5, 5, 0, 0, 0, 4, 0, 5, 8, 5, 1, 4, 0, 1, 6, 5, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 40); +INSERT INTO `persons` VALUES (58, 2, 6, 6, 2, 1, 1, 5, 1, 6, 9, 6, 2, 5, 1, 0, 7, 6, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 80); +INSERT INTO `persons` VALUES (59, 1, 7, 7, 1, 0, 0, 6, 0, 7, 8, 7, 3, 6, 0, 1, 8, 7, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 40); +INSERT INTO `persons` VALUES (60, 2, 8, 8, 0, 1, 1, 7, 1, 8, 9, 8, 4, 7, 1, 0, 9, 8, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 100); +INSERT INTO `persons` VALUES (61, 1, 9, 9, 1, 0, 0, 8, 0, 9, 10, 9, 5, 8, 0, 1, 10, 9, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 50); +INSERT INTO `persons` VALUES (62, 2, 1, 10, 0, 1, 1, 9, 1, 10, 1, 8, 6, 9, 1, 1, 1, 10, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (63, 1, 2, 1, 2, 0, 0, 10, 0, 1, 2, 9, 7, 8, 0, 0, 2, 1, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 0, 1, 1, 20); +INSERT INTO `persons` VALUES (64, 2, 3, 2, 0, 1, 1, 11, 1, 2, 3, 10, 8, 9, 1, 1, 3, 2, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 70); +INSERT INTO `persons` VALUES (65, 1, 4, 3, 4, 0, 0, 12, 0, 3, 4, 1, 9, 10, 0, 0, 4, 3, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (66, 2, 5, 4, 2, 1, 1, 13, 1, 4, 5, 2, 8, 1, 1, 1, 5, 4, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 90); +INSERT INTO `persons` VALUES (67, 1, 6, 5, 0, 0, 0, 1, 0, 5, 6, 3, 9, 4, 0, 0, 6, 5, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (68, 2, 7, 6, 3, 0, 0, 2, 0, 6, 7, 4, 10, 5, 0, 1, 8, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (69, 1, 8, 7, 5, 1, 1, 3, 1, 7, 8, 5, 1, 6, 1, 0, 9, 7, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (70, 2, 9, 8, 1, 0, 0, 4, 0, 8, 9, 6, 2, 7, 0, 1, 10, 8, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 40); +INSERT INTO `persons` VALUES (71, 1, 10, 9, 2, 1, 1, 5, 1, 9, 8, 7, 3, 8, 1, 0, 1, 9, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 30); +INSERT INTO `persons` VALUES (72, 2, 1, 10, 0, 0, 0, 6, 0, 10, 9, 8, 4, 9, 0, 0, 2, 6, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 20); +INSERT INTO `persons` VALUES (73, 1, 2, 1, 2, 1, 1, 7, 1, 1, 10, 9, 5, 8, 1, 1, 3, 7, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (74, 2, 3, 2, 1, 0, 0, 8, 0, 2, 1, 8, 6, 9, 0, 0, 4, 8, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (75, 1, 4, 3, 0, 1, 1, 9, 1, 3, 2, 9, 7, 10, 1, 1, 5, 9, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 50); +INSERT INTO `persons` VALUES (76, 2, 5, 4, 1, 0, 0, 10, 0, 4, 3, 10, 8, 1, 0, 0, 6, 10, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (21, 2, 6, 5, 0, 1, 1, 11, 1, 5, 4, 1, 9, 2, 1, 1, 7, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 70); +INSERT INTO `persons` VALUES (22, 1, 7, 6, 2, 0, 0, 12, 0, 6, 5, 2, 8, 3, 0, 0, 8, 2, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (23, 2, 8, 7, 0, 1, 1, 13, 1, 7, 6, 3, 9, 4, 1, 1, 9, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (24, 1, 9, 8, 4, 0, 0, 1, 0, 8, 7, 4, 10, 5, 0, 0, 10, 4, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (25, 2, 10, 9, 2, 1, 1, 2, 1, 9, 8, 5, 1, 6, 1, 1, 1, 5, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (26, 1, 1, 10, 0, 0, 0, 3, 0, 10, 9, 6, 2, 7, 0, 0, 2, 6, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 100); +INSERT INTO `persons` VALUES (27, 2, 2, 1, 3, 0, 0, 4, 0, 1, 8, 7, 3, 8, 0, 1, 3, 8, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 50); +INSERT INTO `persons` VALUES (28, 1, 3, 2, 5, 1, 1, 5, 1, 2, 9, 8, 4, 9, 1, 0, 4, 9, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (29, 2, 4, 3, 1, 0, 0, 6, 0, 3, 10, 9, 5, 8, 0, 1, 5, 10, 0, 1, 0, 1, 3, 0, 0, 1, 0, 1, 0, 1, 0, 20); +INSERT INTO `persons` VALUES (30, 1, 5, 4, 2, 1, 1, 7, 1, 4, 1, 8, 6, 9, 1, 0, 6, 1, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 70); +INSERT INTO `persons` VALUES (31, 2, 6, 5, 0, 0, 0, 8, 0, 5, 2, 9, 7, 10, 0, 0, 8, 2, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 60); +INSERT INTO `persons` VALUES (32, 1, 7, 6, 2, 1, 1, 9, 1, 6, 3, 10, 8, 1, 1, 1, 9, 3, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 90); +INSERT INTO `persons` VALUES (33, 2, 8, 7, 1, 0, 0, 10, 0, 7, 4, 1, 3, 2, 0, 0, 10, 4, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 80); +INSERT INTO `persons` VALUES (34, 1, 9, 8, 0, 1, 1, 11, 1, 8, 5, 2, 4, 3, 1, 1, 1, 5, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 60); +INSERT INTO `persons` VALUES (35, 2, 10, 9, 1, 0, 0, 12, 0, 9, 6, 3, 5, 4, 0, 0, 2, 6, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 100); +INSERT INTO `persons` VALUES (36, 1, 1, 10, 0, 1, 1, 13, 1, 10, 7, 4, 6, 5, 1, 1, 3, 7, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 40); +INSERT INTO `persons` VALUES (37, 2, 2, 1, 2, 0, 0, 1, 0, 1, 8, 5, 7, 6, 0, 0, 4, 8, 0, 1, 0, 1, 3, 1, 0, 1, 0, 1, 0, 1, 0, 30); +INSERT INTO `persons` VALUES (38, 2, 3, 2, 0, 1, 1, 2, 1, 2, 9, 6, 8, 7, 1, 1, 5, 9, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 20); +INSERT INTO `persons` VALUES (39, 1, 4, 3, 4, 0, 0, 3, 0, 3, 8, 7, 9, 8, 0, 0, 6, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (40, 2, 5, 4, 2, 1, 1, 4, 1, 4, 9, 8, 8, 3, 1, 1, 7, 7, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (41, 1, 1, 5, 0, 0, 0, 5, 0, 5, 10, 9, 9, 4, 0, 0, 8, 8, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (42, 2, 2, 6, 3, 0, 0, 6, 0, 6, 1, 8, 10, 5, 0, 1, 9, 9, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (43, 1, 3, 7, 5, 1, 1, 7, 1, 7, 2, 9, 1, 6, 1, 0, 10, 10, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 70); +INSERT INTO `persons` VALUES (44, 2, 4, 8, 1, 0, 0, 8, 0, 8, 3, 10, 2, 7, 0, 1, 1, 1, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (39, 1, 5, 9, 2, 1, 1, 9, 1, 9, 4, 1, 3, 8, 1, 0, 2, 2, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (40, 2, 6, 10, 0, 0, 0, 10, 0, 10, 5, 2, 4, 9, 0, 0, 3, 9, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 80); +INSERT INTO `persons` VALUES (41, 1, 7, 1, 2, 1, 1, 11, 1, 1, 6, 3, 5, 8, 1, 1, 4, 10, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 40); +INSERT INTO `persons` VALUES (42, 2, 8, 2, 1, 0, 0, 12, 0, 2, 7, 4, 6, 9, 0, 0, 5, 1, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 100); +INSERT INTO `persons` VALUES (43, 1, 9, 3, 0, 1, 1, 13, 1, 3, 8, 5, 7, 10, 1, 1, 6, 2, 0, 0, 0, 1, 4, 0, 0, 0, 0, 1, 0, 0, 0, 50); +INSERT INTO `persons` VALUES (44, 2, 10, 4, 1, 0, 0, 7, 0, 4, 9, 6, 8, 1, 0, 0, 8, 3, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); +INSERT INTO `persons` VALUES (45, 1, 1, 5, 0, 1, 1, 8, 1, 5, 5, 7, 9, 2, 1, 1, 9, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 20); +INSERT INTO `persons` VALUES (46, 2, 2, 6, 2, 0, 0, 9, 0, 6, 6, 8, 8, 3, 0, 0, 10, 5, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 70); +INSERT INTO `persons` VALUES (47, 1, 3, 7, 0, 1, 1, 10, 1, 7, 7, 9, 9, 4, 1, 1, 1, 6, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 60); +INSERT INTO `persons` VALUES (48, 2, 4, 8, 4, 0, 0, 11, 0, 8, 8, 8, 10, 5, 0, 0, 2, 8, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 90); +INSERT INTO `persons` VALUES (49, 1, 5, 9, 2, 1, 1, 12, 1, 9, 9, 9, 1, 6, 1, 1, 3, 9, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 80); + +SET FOREIGN_KEY_CHECKS = 1; From 497340924635fa5d2b2ba5e4b820b4f68b7f19cf Mon Sep 17 00:00:00 2001 From: Zheng Qiao <109362533+BossJoeZz@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:39:53 -0800 Subject: [PATCH 07/40] python script reading the data in the csv file --- app/clients/service/load_data.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 app/clients/service/load_data.py diff --git a/app/clients/service/load_data.py b/app/clients/service/load_data.py new file mode 100644 index 00000000..6eba0e00 --- /dev/null +++ b/app/clients/service/load_data.py @@ -0,0 +1,5 @@ +from app.database import engine +import pandas as pd + +df = pd.read_csv('data_commontool.csv') +df.to_sql('persons', engine, if_exists='append', index=False) \ No newline at end of file From d2d4ace0e310843e45aa21c63a8bcba8e40e4fcc Mon Sep 17 00:00:00 2001 From: ya603J Date: Tue, 12 Nov 2024 13:40:36 -0800 Subject: [PATCH 08/40] Configured test database and wrote test cases for CRUD and endpoints --- tests/test.py | 132 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 128 insertions(+), 4 deletions(-) diff --git a/tests/test.py b/tests/test.py index a911f0a2..aa5b711e 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,5 +1,10 @@ from logic import interpret_and_calculate -from itertools import combinations_with_replacement +from itertools import combinations_with_replacement, product +from fastapi.testclient import TestClient +from app.main import app +from app.database import Base, get_db #not implemented yet +from sqlalchemy import create_engine +from sqlalchemy.orm import sessionmaker # def test_interpret_and_calculate(): # print("running tests") @@ -9,8 +14,6 @@ # result = interpret_and_calculate(data) # print(data) -from itertools import product - # Cartesian product of [0, 1] repeated 2 times result = list(product([0, 1], repeat=2)) @@ -20,4 +23,125 @@ result = list(combinations_with_replacement([0, 1], 2)) # Output: [(0, 0), (0, 1), (1, 1)] -print(result) \ No newline at end of file +print(result) + + +# MySQL test database configuration +SQLALCHEMY_TEST_DATABASE_URL = "mysql+pymysql://username:password@localhost/test_db" +# Connect to the test database +engine = create_engine(SQLALCHEMY_TEST_DATABASE_URL) +TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) + +# Override get_db dependency to use the test database +def override_get_db(): + try: + db = TestingSessionLocal() + yield db + finally: + db.close() + +app.dependency_overrides[get_db] = override_get_db + +# Clear existing tables to ensure tests don’t interfere with each other +Base.metadata.drop_all(bind=engine) +# Create fresh tables +Base.metadata.create_all(bind=engine) + +client = TestClient(app) + +def test_create_client(): + response = client.post( + "/clients/", + json={"name": "John Doe", "email": "john.doe@example.com", "employment_status": "Employed"}, + ) + assert response.status_code == 201 + data = response.json() + assert data["name"] == "John Doe" + assert data["email"] == "john.doe@example.com" + assert data["employment_status"] == "Employed" + assert "id" in data + +def test_get_all_clients(): + response = client.get("/clients/") + assert response.status_code == 200 + assert isinstance(response.json(), list) + +def test_update_non_existent_client(): + response = client.put( + "/clients/9999", + json={"name": "Non Existent Client"}, + ) + assert response.status_code == 404 + assert response.json() == {"detail": "Client not found"} + +def test_update_client(): + # Create a client + response = client.post( + "/clients/", + json={ + "name": "Mark Brown", + "email": "mark.brown@example.com", + "employment_status": "Self-Employed" + }, + ) + client_id = response.json()["id"] + + # Update the client's information + response = client.put( + f"/clients/{client_id}", + json={ + "name": "Mark B.", + "email": "mark.b@example.com" + }, + ) + assert response.status_code == 200 + data = response.json() + assert data["name"] == "Mark B." + assert data["email"] == "mark.b@example.com" + assert data["employment_status"] == "Self-Employed" + +def test_delete_non_existent_client(): + response = client.delete("/clients/9999") + assert response.status_code == 404 + assert response.json() == {"detail": "Client not found"} + +def test_get_client_by_id(): + # Create a client + response = client.post( + "/clients/", + json={ + "name": "Jane Smith", + "email": "jane.smith@example.com", + "employment_status": "Unemployed" + }, + ) + client_id = response.json()["id"] + + # Retrieve the client by ID + response = client.get(f"/clients/{client_id}") + assert response.status_code == 200 + data = response.json() + assert data["name"] == "Jane Smith" + assert data["email"] == "jane.smith@example.com" + assert data["employment_status"] == "Unemployed" + +def test_delete_client(): + # Create a client + response = client.post( + "/clients/", + json={ + "name": "Anna Lee", + "email": "anna.lee@example.com", + "employment_status": "Part-Time" + }, + ) + client_id = response.json()["id"] + + # Delete the client + response = client.delete(f"/clients/{client_id}") + assert response.status_code == 200 + assert response.json() == {"detail": f"Client with ID {client_id} is deleted successfully!"} + + # Verify the client no longer exists + response = client.get(f"/clients/{client_id}") + assert response.status_code == 404 \ No newline at end of file From 767bc4f43d6ea04526bab158274bc06b8d031d7f Mon Sep 17 00:00:00 2001 From: Zheng Qiao <109362533+BossJoeZz@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:13:36 -0800 Subject: [PATCH 09/40] tool to add csv data to database --- app/database_tools.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 app/database_tools.py diff --git a/app/database_tools.py b/app/database_tools.py new file mode 100644 index 00000000..097e0e14 --- /dev/null +++ b/app/database_tools.py @@ -0,0 +1,40 @@ +from app.database import engine +import pandas as pd + + +def load_csv_to_db(csv_path, table_name, model='append'): + """ + model: + append: Append to the table. + replace: Replace the table. + fail: Raise an error if the table already exists. + """ + df = pd.read_csv(csv_path) + if model not in ['append', 'replace', 'fail']: + raise ValueError("Model must be 'append', 'replace', or 'fail'.") + try: + df.to_sql(table_name, engine, if_exists=model, index=False) + except Exception as e: + print(f"Error: {e}") + print('success csv to db !') + + +def read_db_to_csv(file_path, table_name, sql=None, mode='w'): + """ + mode: + w: Write to the file. + a: Append to the file. + """ + query = f"SELECT * FROM {table_name}" + if sql is not None: + query = sql + try: + df = pd.read_sql(query, engine) + df.to_csv(file_path, index=False, mode=mode) + except Exception as e: + print(f"Error: {e}") + print('success db to csv file !') + + +if __name__ == '__main__': + load_csv_to_db(r"C:\Users\zq789\OneDrive\Desktop\common_assess\data_sample.csv", 'persons', 'replace') \ No newline at end of file From b86533bcdeda3c4eaf085d95e9a5c65768665967 Mon Sep 17 00:00:00 2001 From: ya603J Date: Mon, 18 Nov 2024 10:47:46 -0800 Subject: [PATCH 10/40] modified tests --- tests/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.py b/tests/test.py index aa5b711e..e1d8f1fe 100644 --- a/tests/test.py +++ b/tests/test.py @@ -2,7 +2,7 @@ from itertools import combinations_with_replacement, product from fastapi.testclient import TestClient from app.main import app -from app.database import Base, get_db #not implemented yet +from app.database import Base, get_db from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker From 9440782b254013ddcb7244c7c573dc2fe843ba62 Mon Sep 17 00:00:00 2001 From: ya603J Date: Mon, 18 Nov 2024 23:08:06 -0800 Subject: [PATCH 11/40] fixed syntax errors in response info --- app/clients/router.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/clients/router.py b/app/clients/router.py index 3a55703f..d51da259 100644 --- a/app/clients/router.py +++ b/app/clients/router.py @@ -40,7 +40,7 @@ async def update_existing_client(client_id: int, client: ClientUpdate, db: Sessi db_client = update_client(db=db, client_id=client_id, client=client) if db_client is None: raise HTTPException(status_code=404, detail="Client not found") - return {f"Client with ID " {client_id} "is updated successfully!"} + return {f"Client with ID {client_id} is updated successfully!"} # Deleting a client @router.delete("/{client_id}", response_model=Client) @@ -48,4 +48,4 @@ async def delete_existing_client(client_id: int, db: Session = Depends(get_db)): db_client = delete_client(db=db, client_id=client_id) if db_client is None: raise HTTPException(status_code=404, detail="Client not found") - return {f"Client with ID " {client_id} "is deleted successfully!"} + return {f"Client with ID {client_id} is deleted successfully!"} From cc4fdae544a33cc438268fc43d4f5bd2d0ae807f Mon Sep 17 00:00:00 2001 From: "Frank H. Luo" Date: Wed, 20 Nov 2024 11:54:49 -0800 Subject: [PATCH 12/40] Adding Continuous Improvement Pipeline --- .github/workflows/continuous_improvement.yml | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/continuous_improvement.yml diff --git a/.github/workflows/continuous_improvement.yml b/.github/workflows/continuous_improvement.yml new file mode 100644 index 00000000..0b21c18c --- /dev/null +++ b/.github/workflows/continuous_improvement.yml @@ -0,0 +1,44 @@ +name: Continuous Improvement Pipeline + +# Triggering the workflow on push or pull request to the master branch +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build: + # Virtual environment on which the job runs + runs-on: ubuntu-latest + + steps: + # Step 1: Checking out the repository's code + - name: Checkout Code + uses: actions/checkout@v4 + + # Step 2: Setting up Python + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.10 + + # Step 3: Installing dependencies + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + # Step 4: Linting the app code with Pylint + - name: Run Pylint + run: | + pip install pylint + pylint app + + # Step 5: Running Unit Tests with Pytest + - name: Run Unit Tests + run: | + pip install pytest + pytest test From 0a0e3fea38651710cc1d7da168d8ceeb4c9042fd Mon Sep 17 00:00:00 2001 From: frankluo123 <133156484+frankluo123@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:58:52 -0800 Subject: [PATCH 13/40] Update continuous_improvement.yml --- .github/workflows/continuous_improvement.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous_improvement.yml b/.github/workflows/continuous_improvement.yml index 0b21c18c..3c4c5827 100644 --- a/.github/workflows/continuous_improvement.yml +++ b/.github/workflows/continuous_improvement.yml @@ -4,10 +4,10 @@ name: Continuous Improvement Pipeline on: pull_request: branches: - - master + - main push: branches: - - master + - main jobs: build: From 00b2a1a7cfe4a000a556169d07cdca1946b38012 Mon Sep 17 00:00:00 2001 From: frankluo123 <133156484+frankluo123@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:04:24 -0800 Subject: [PATCH 14/40] Update continuous_improvement.yml --- .github/workflows/continuous_improvement.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_improvement.yml b/.github/workflows/continuous_improvement.yml index 3c4c5827..d99712a3 100644 --- a/.github/workflows/continuous_improvement.yml +++ b/.github/workflows/continuous_improvement.yml @@ -17,7 +17,7 @@ jobs: steps: # Step 1: Checking out the repository's code - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v4.8.0 # Step 2: Setting up Python - name: Set up Python From 973f8ba8181964254cc255241cc395ad14429203 Mon Sep 17 00:00:00 2001 From: frankluo123 <133156484+frankluo123@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:06:27 -0800 Subject: [PATCH 15/40] Update continuous_improvement.yml --- .github/workflows/continuous_improvement.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous_improvement.yml b/.github/workflows/continuous_improvement.yml index d99712a3..856f75e2 100644 --- a/.github/workflows/continuous_improvement.yml +++ b/.github/workflows/continuous_improvement.yml @@ -17,11 +17,11 @@ jobs: steps: # Step 1: Checking out the repository's code - name: Checkout Code - uses: actions/checkout@v4.8.0 + uses: actions/checkout@v4 # Step 2: Setting up Python - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v4.8.0 with: python-version: 3.10 From 1715658014d9c277c2d6a4b1f63b8057e2972742 Mon Sep 17 00:00:00 2001 From: "Frank H. Luo" Date: Wed, 20 Nov 2024 12:16:33 -0800 Subject: [PATCH 16/40] Fixing Python version and updating setup-python action --- .github/workflows/continuous_improvement.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_improvement.yml b/.github/workflows/continuous_improvement.yml index 856f75e2..e37ebd33 100644 --- a/.github/workflows/continuous_improvement.yml +++ b/.github/workflows/continuous_improvement.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4.8.0 with: - python-version: 3.10 + python-version: 3.10.11 # Step 3: Installing dependencies - name: Install Dependencies From 247c7ea5b08326084418a18dda1926e5869a3014 Mon Sep 17 00:00:00 2001 From: "Frank H. Luo" Date: Wed, 20 Nov 2024 12:25:00 -0800 Subject: [PATCH 17/40] Debugging --- .github/workflows/continuous_improvement.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/continuous_improvement.yml b/.github/workflows/continuous_improvement.yml index e37ebd33..1584a677 100644 --- a/.github/workflows/continuous_improvement.yml +++ b/.github/workflows/continuous_improvement.yml @@ -25,6 +25,13 @@ jobs: with: python-version: 3.10.11 + # Debugging step to check the Python environment + - name: Debugging Logs + run: | + python --version + pip --version + pip list + # Step 3: Installing dependencies - name: Install Dependencies run: | From b87b94f69dd8bdbefd9147d262bfd475f0387d80 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 18:31:25 -0800 Subject: [PATCH 18/40] New continuous integration file. Remove previous 'continuous improvement' file. --- .github/workflows/continuous_improvement.yml | 51 -------------------- .github/workflows/continuous_integration.yml | 41 ++++++++++++++++ 2 files changed, 41 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/continuous_improvement.yml create mode 100644 .github/workflows/continuous_integration.yml diff --git a/.github/workflows/continuous_improvement.yml b/.github/workflows/continuous_improvement.yml deleted file mode 100644 index 1584a677..00000000 --- a/.github/workflows/continuous_improvement.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Continuous Improvement Pipeline - -# Triggering the workflow on push or pull request to the master branch -on: - pull_request: - branches: - - main - push: - branches: - - main - -jobs: - build: - # Virtual environment on which the job runs - runs-on: ubuntu-latest - - steps: - # Step 1: Checking out the repository's code - - name: Checkout Code - uses: actions/checkout@v4 - - # Step 2: Setting up Python - - name: Set up Python - uses: actions/setup-python@v4.8.0 - with: - python-version: 3.10.11 - - # Debugging step to check the Python environment - - name: Debugging Logs - run: | - python --version - pip --version - pip list - - # Step 3: Installing dependencies - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - # Step 4: Linting the app code with Pylint - - name: Run Pylint - run: | - pip install pylint - pylint app - - # Step 5: Running Unit Tests with Pytest - - name: Run Unit Tests - run: | - pip install pytest - pytest test diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml new file mode 100644 index 00000000..d0a510da --- /dev/null +++ b/.github/workflows/continuous_integration.yml @@ -0,0 +1,41 @@ +name: Continuous Integration Pipeline + +# Triggering the workflow on push or pull request to the main branch +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Check versions + run: | + python --version + pip --version + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + - name: Install dependencies + run: | + pip install -r requirements.txt + - name: Run Pylint + run: | + pip install pylint + pylint $(git ls-files '*.py') + - name: Run Unit Tests + run: | + pip install pytest + pytest test \ No newline at end of file From 54244b1702a3ada424a2b41f017267f969a0f0e3 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 18:38:51 -0800 Subject: [PATCH 19/40] Changed versions for continuous integration --- .github/workflows/continuous_integration.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index d0a510da..7532e459 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -12,15 +12,12 @@ on: jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + - name: Set up Python + uses: actions/setup-python@v4.8.0 with: - python-version: ${{ matrix.python-version }} + python-version: 3.10.11 - name: Check versions run: | python --version From 4aec4bee9f1ce221c03fc75b127fecd24b4722a8 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 18:40:01 -0800 Subject: [PATCH 20/40] Rearranged test order --- tests/test.py | 65 ++++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/tests/test.py b/tests/test.py index e1d8f1fe..79136a5f 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,4 +1,4 @@ -from logic import interpret_and_calculate +#from logic import interpret_and_calculate from itertools import combinations_with_replacement, product from fastapi.testclient import TestClient from app.main import app @@ -49,6 +49,7 @@ def override_get_db(): client = TestClient(app) + def test_create_client(): response = client.post( "/clients/", @@ -61,18 +62,33 @@ def test_create_client(): assert data["employment_status"] == "Employed" assert "id" in data + def test_get_all_clients(): response = client.get("/clients/") assert response.status_code == 200 assert isinstance(response.json(), list) -def test_update_non_existent_client(): - response = client.put( - "/clients/9999", - json={"name": "Non Existent Client"}, + +def test_get_client_by_id(): + # Create a client + response = client.post( + "/clients/", + json={ + "name": "Jane Smith", + "email": "jane.smith@example.com", + "employment_status": "Unemployed" + }, ) - assert response.status_code == 404 - assert response.json() == {"detail": "Client not found"} + client_id = response.json()["id"] + + # Retrieve the client by ID + response = client.get(f"/clients/{client_id}") + assert response.status_code == 200 + data = response.json() + assert data["name"] == "Jane Smith" + assert data["email"] == "jane.smith@example.com" + assert data["employment_status"] == "Unemployed" + def test_update_client(): # Create a client @@ -100,30 +116,15 @@ def test_update_client(): assert data["email"] == "mark.b@example.com" assert data["employment_status"] == "Self-Employed" -def test_delete_non_existent_client(): - response = client.delete("/clients/9999") - assert response.status_code == 404 - assert response.json() == {"detail": "Client not found"} -def test_get_client_by_id(): - # Create a client - response = client.post( - "/clients/", - json={ - "name": "Jane Smith", - "email": "jane.smith@example.com", - "employment_status": "Unemployed" - }, +def test_update_non_existent_client(): + response = client.put( + "/clients/9999", + json={"name": "Non Existent Client"}, ) - client_id = response.json()["id"] + assert response.status_code == 404 + assert response.json() == {"detail": "Client not found"} - # Retrieve the client by ID - response = client.get(f"/clients/{client_id}") - assert response.status_code == 200 - data = response.json() - assert data["name"] == "Jane Smith" - assert data["email"] == "jane.smith@example.com" - assert data["employment_status"] == "Unemployed" def test_delete_client(): # Create a client @@ -144,4 +145,10 @@ def test_delete_client(): # Verify the client no longer exists response = client.get(f"/clients/{client_id}") - assert response.status_code == 404 \ No newline at end of file + assert response.status_code == 404 + + +def test_delete_non_existent_client(): + response = client.delete("/clients/9999") + assert response.status_code == 404 + assert response.json() == {"detail": "Client not found"} \ No newline at end of file From f5b3ffa07f63a5afaf14b78599b44401c2bbc19a Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 18:40:41 -0800 Subject: [PATCH 21/40] Revised spelling --- app/database_tools.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/database_tools.py b/app/database_tools.py index 097e0e14..30ec1960 100644 --- a/app/database_tools.py +++ b/app/database_tools.py @@ -2,18 +2,18 @@ import pandas as pd -def load_csv_to_db(csv_path, table_name, model='append'): +def load_csv_to_db(csv_path, table_name, mode='append'): """ - model: + mode: append: Append to the table. replace: Replace the table. fail: Raise an error if the table already exists. """ df = pd.read_csv(csv_path) - if model not in ['append', 'replace', 'fail']: - raise ValueError("Model must be 'append', 'replace', or 'fail'.") + if mode not in ['append', 'replace', 'fail']: + raise ValueError("Mode must be 'append', 'replace', or 'fail'.") try: - df.to_sql(table_name, engine, if_exists=model, index=False) + df.to_sql(table_name, engine, if_exists=mode, index=False) except Exception as e: print(f"Error: {e}") print('success csv to db !') From a88b8ce69e18411a9779d8e1a1703c92c8e1c7d6 Mon Sep 17 00:00:00 2001 From: ya603J Date: Sun, 24 Nov 2024 18:52:51 -0800 Subject: [PATCH 22/40] Keep only local unit testings of CRUD functions --- tests/test.py | 130 ++------------------------------------------- tests/test_crud.py | 123 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 127 deletions(-) create mode 100644 tests/test_crud.py diff --git a/tests/test.py b/tests/test.py index e1d8f1fe..b1b3359c 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,10 +1,5 @@ from logic import interpret_and_calculate -from itertools import combinations_with_replacement, product -from fastapi.testclient import TestClient -from app.main import app -from app.database import Base, get_db -from sqlalchemy import create_engine -from sqlalchemy.orm import sessionmaker +from itertools import combinations_with_replacement # def test_interpret_and_calculate(): # print("running tests") @@ -14,6 +9,8 @@ # result = interpret_and_calculate(data) # print(data) +from itertools import product + # Cartesian product of [0, 1] repeated 2 times result = list(product([0, 1], repeat=2)) @@ -24,124 +21,3 @@ # Output: [(0, 0), (0, 1), (1, 1)] print(result) - - -# MySQL test database configuration -SQLALCHEMY_TEST_DATABASE_URL = "mysql+pymysql://username:password@localhost/test_db" -# Connect to the test database -engine = create_engine(SQLALCHEMY_TEST_DATABASE_URL) -TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) - -# Override get_db dependency to use the test database -def override_get_db(): - try: - db = TestingSessionLocal() - yield db - finally: - db.close() - -app.dependency_overrides[get_db] = override_get_db - -# Clear existing tables to ensure tests don’t interfere with each other -Base.metadata.drop_all(bind=engine) -# Create fresh tables -Base.metadata.create_all(bind=engine) - -client = TestClient(app) - -def test_create_client(): - response = client.post( - "/clients/", - json={"name": "John Doe", "email": "john.doe@example.com", "employment_status": "Employed"}, - ) - assert response.status_code == 201 - data = response.json() - assert data["name"] == "John Doe" - assert data["email"] == "john.doe@example.com" - assert data["employment_status"] == "Employed" - assert "id" in data - -def test_get_all_clients(): - response = client.get("/clients/") - assert response.status_code == 200 - assert isinstance(response.json(), list) - -def test_update_non_existent_client(): - response = client.put( - "/clients/9999", - json={"name": "Non Existent Client"}, - ) - assert response.status_code == 404 - assert response.json() == {"detail": "Client not found"} - -def test_update_client(): - # Create a client - response = client.post( - "/clients/", - json={ - "name": "Mark Brown", - "email": "mark.brown@example.com", - "employment_status": "Self-Employed" - }, - ) - client_id = response.json()["id"] - - # Update the client's information - response = client.put( - f"/clients/{client_id}", - json={ - "name": "Mark B.", - "email": "mark.b@example.com" - }, - ) - assert response.status_code == 200 - data = response.json() - assert data["name"] == "Mark B." - assert data["email"] == "mark.b@example.com" - assert data["employment_status"] == "Self-Employed" - -def test_delete_non_existent_client(): - response = client.delete("/clients/9999") - assert response.status_code == 404 - assert response.json() == {"detail": "Client not found"} - -def test_get_client_by_id(): - # Create a client - response = client.post( - "/clients/", - json={ - "name": "Jane Smith", - "email": "jane.smith@example.com", - "employment_status": "Unemployed" - }, - ) - client_id = response.json()["id"] - - # Retrieve the client by ID - response = client.get(f"/clients/{client_id}") - assert response.status_code == 200 - data = response.json() - assert data["name"] == "Jane Smith" - assert data["email"] == "jane.smith@example.com" - assert data["employment_status"] == "Unemployed" - -def test_delete_client(): - # Create a client - response = client.post( - "/clients/", - json={ - "name": "Anna Lee", - "email": "anna.lee@example.com", - "employment_status": "Part-Time" - }, - ) - client_id = response.json()["id"] - - # Delete the client - response = client.delete(f"/clients/{client_id}") - assert response.status_code == 200 - assert response.json() == {"detail": f"Client with ID {client_id} is deleted successfully!"} - - # Verify the client no longer exists - response = client.get(f"/clients/{client_id}") - assert response.status_code == 404 \ No newline at end of file diff --git a/tests/test_crud.py b/tests/test_crud.py new file mode 100644 index 00000000..15884da4 --- /dev/null +++ b/tests/test_crud.py @@ -0,0 +1,123 @@ +from unittest.mock import MagicMock +import pytest +from app.clients.crud import ( + create_client, get_client, get_clients, update_client, delete_client +) +from app.clients.schema import ClientCreate, ClientUpdate, ClientBase + +# Test creating a client +class MockClient: + def __init__(self, **kwargs): + self.__dict__.update(kwargs) + +def test_create_client(): + # Mock the database session + mock_db = MagicMock() + + # Provide valid test data matching the ClientCreate schema + client_data = ClientBase( + name="Ann Lu", + age=35, + gender="Male", + work_experience=10, + canada_workex=5, + dep_num=2, + canada_born=True, + citizen_status="Citizen", + level_of_schooling="Bachelor's Degree", + fluent_english=True, + reading_english_scale=5, + speaking_english_scale=5, + writing_english_scale=5, + numeracy_scale=4, + computer_scale=3, + transportation_bool=True, + caregiver_bool=False, + housing="Owned", + income_source="Employment", + felony_bool=False, + attending_school=False, + currently_employed=True, + substance_use=False, + time_unemployed=0, + need_mental_health_support_bool=False + ) + + # Call the function to test + result = create_client(mock_db, client=client_data) + + # Assert that the mock database methods were called correctly + mock_db.add.assert_called_once_with(result) + mock_db.commit.assert_called_once() + + # Verify the result is the same as the input data (or matches expectations) + assert result.name == client_data.name + assert result.age == client_data.age + assert result.gender == client_data.gender + +# Test retrieving a client by ID +def test_get_client(): + mock_db = MagicMock() + mock_db.query().filter().first.return_value = {"id": 1, "name": "Test Client"} + + result = get_client(mock_db, client_id=1) + assert result == {"id": 1, "name": "Test Client"} + mock_db.query().filter().first.assert_called_once() + +# Test retrieving all clients +def test_get_clients(): + mock_db = MagicMock() + mock_db.query().offset().limit().all.return_value = [ + {"id": 1, "name": "Client 1"}, + {"id": 2, "name": "Client 2"}, + ] + + result = get_clients(mock_db, skip=0, limit=10) + assert len(result) == 2 + assert result[0]["name"] == "Client 1" + +# Test updating a client +def test_update_client(): + # Mock the database session + mock_db = MagicMock() + + # Existing client in the database + existing_client = MockClient( + id=1, + name="Old Name", + age=30, + gender="Male", + work_experience=5 + ) + + # Updated client data + updated_data = ClientUpdate( + name="New Name", + age=35, + gender="Male", + work_experience=10 + ) + + # Mock the behavior of query.filter().first() + mock_db.query().filter().first.return_value = existing_client + + # Call the function to test + result = update_client(mock_db, client_id=1, client=updated_data) + + # Assert that the mock database methods were called correctly + mock_db.commit.assert_called_once() + + # Assert that the attributes were updated correctly + assert result.name == updated_data.name + assert result.age == updated_data.age + assert result.gender == updated_data.gender + assert result.work_experience == updated_data.work_experience + +# Test deleting a client +def test_delete_client(): + mock_db = MagicMock() + mock_db.query().filter().first.return_value = {"id": 1, "name": "Test Client"} + + result = delete_client(mock_db, client_id=1) + mock_db.delete.assert_called_once() + mock_db.commit.assert_called_once() \ No newline at end of file From bf00b10cdc8ff739948df5fdaf1662da0fdae590 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 19:29:33 -0800 Subject: [PATCH 23/40] Fixed lint issues for crud.py --- app/clients/crud.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/clients/crud.py b/app/clients/crud.py index 82966185..671e8ec9 100644 --- a/app/clients/crud.py +++ b/app/clients/crud.py @@ -1,25 +1,36 @@ +"""Module providing CRUD functions.""" + from sqlalchemy.orm import Session from .models import Client from .schema import ClientCreate, ClientUpdate - # Creates a new client record in the database + def create_client(db: Session, client: ClientCreate): + '''Creates a new client record in the database''' db_client = Client(**client.dict()) db.add(db_client) db.commit() db.refresh(db_client) return db_client -# Retrieves a client record by client_id + def get_client(db: Session, client_id: int): + '''Retrieves a client record by client_id''' return db.query(Client).filter(Client.id == client_id).first() -# Retrieves a list of client records with optional pagination + def get_clients(db: Session, skip: int = 0, limit: int = 10): + '''Retrieves a list of client records with custom formatting. + + Args: + skip (int): Number of client records to skip from start of list + limit (int): Maximum number of client records to return + ''' return db.query(Client).offset(skip).limit(limit).all() -# Updates an existing client record with only the fields provided in client + def update_client(db: Session, client_id: int, client: ClientUpdate): + '''Updates an existing client record with only the fields provided in client''' db_client = db.query(Client).filter(Client.id == client_id).first() if not db_client: # Raise an error if the client is not found @@ -31,8 +42,8 @@ def update_client(db: Session, client_id: int, client: ClientUpdate): db.refresh(db_client) return db_client -# Deletes a client record by client_id def delete_client(db: Session, client_id: int): + '''Deletes a client record by client_id''' db_client = db.query(Client).filter(Client.id == client_id).first() if db_client: db.delete(db_client) From bad4be28ad670408597e984247453f9fa8e2ba2d Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 19:37:07 -0800 Subject: [PATCH 24/40] Fixed lint issues for models.py --- app/clients/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/clients/models.py b/app/clients/models.py index c82eb52a..16cd23e0 100644 --- a/app/clients/models.py +++ b/app/clients/models.py @@ -1,8 +1,12 @@ +'''Module providing functions for building the client model''' + from sqlalchemy import Column, Integer, String, Boolean from app.database import Base # Need to create database configuration module in app.database -# Defining the Client model, representing the 'clients' table in the database + +# pylint: disable=too-few-public-methods class Client(Base): + '''Class defining the client model''' # Setting the table name for this model to 'clients' __tablename__ = 'clients' @@ -34,6 +38,6 @@ class Client(Base): time_unemployed = Column(Integer) need_mental_health_support_bool = Column(Boolean) - # Provide a string representation of the Client instance def __repr__(self): + '''Provide string representation of the Client instance''' return f"" From 46b9cbddc9b1fe968e89e1cbe8f3e0ce399fd616 Mon Sep 17 00:00:00 2001 From: ya603J Date: Sun, 24 Nov 2024 19:53:12 -0800 Subject: [PATCH 25/40] Modified and added necessary __init__.py files --- app/__init__.py | 3 +++ tests/__init__.py | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 tests/__init__.py diff --git a/app/__init__.py b/app/__init__.py index e69de29b..9f6ed3cd 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -0,0 +1,3 @@ +""" +Package for client-related functionality (CRUD operations, schemas, etc.). +""" \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..829b1449 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +""" +Package for unit and integration tests. +""" \ No newline at end of file From 8f42334a1fcc1a64c2256ba7b8c25ffaaeb251e2 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 19:53:51 -0800 Subject: [PATCH 26/40] Fixed lint issues for router.py --- app/clients/router.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/app/clients/router.py b/app/clients/router.py index d51da259..5ab3ac30 100644 --- a/app/clients/router.py +++ b/app/clients/router.py @@ -1,50 +1,60 @@ +'''Model containing functions for router''' + +from typing import List from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.orm import Session -from typing import List - from app.clients.service.logic import interpret_and_calculate from app.clients.schema import PredictionInput, ClientCreate, ClientUpdate, Client from app.clients.crud import create_client, get_client, get_clients, update_client, delete_client from app.database import get_db # Need to create a get_db function to provide DB sessions + router = APIRouter(prefix="/clients", tags=["clients"]) -# Prediction Endpoint @router.post("/predictions") async def predict(data: PredictionInput): + '''Prediction endpoint''' print("HERE") print(data.model_dump()) return interpret_and_calculate(data.model_dump()) -# Creating a new client + @router.post("/", response_model=Client) async def create_new_client(client: ClientCreate, db: Session = Depends(get_db)): + '''Create a new client''' return create_client(db=db, client=client) -# Retrieving a specific client by ID + @router.get("/{client_id}", response_model=Client) async def read_client(client_id: int, db: Session = Depends(get_db)): + '''Get a client by client_id''' client = get_client(db=db, client_id=client_id) if client is None: raise HTTPException(status_code=404, detail="Client not found") return client -# Retrieving all clients with options to skip a certain number of results and limit the number of results shown + @router.get("/", response_model=List[Client]) async def read_clients(skip: int = 0, limit: int = 10, db: Session = Depends(get_db)): + '''Retrieve clients with options to skip a number of results and limit max results shown''' return get_clients(db=db, skip=skip, limit=limit) -# Updating a client's information + @router.put("/{client_id}", response_model=Client) -async def update_existing_client(client_id: int, client: ClientUpdate, db: Session = Depends(get_db)): +async def update_existing_client( + client_id: int, + client: ClientUpdate, + db: Session = Depends(get_db)): + '''Update a client's information by client_id''' db_client = update_client(db=db, client_id=client_id, client=client) if db_client is None: raise HTTPException(status_code=404, detail="Client not found") return {f"Client with ID {client_id} is updated successfully!"} -# Deleting a client + @router.delete("/{client_id}", response_model=Client) async def delete_existing_client(client_id: int, db: Session = Depends(get_db)): + '''Delete a client by client_id''' db_client = delete_client(db=db, client_id=client_id) if db_client is None: raise HTTPException(status_code=404, detail="Client not found") From bb84e1126cbb412bc1e2724e94a0dde6f1edb6be Mon Sep 17 00:00:00 2001 From: ya603J Date: Sun, 24 Nov 2024 19:54:52 -0800 Subject: [PATCH 27/40] Updates workflow to adjust to current program --- .github/workflows/continuous_integration.yml | 101 ++++++++++++++----- 1 file changed, 77 insertions(+), 24 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 7532e459..533933d9 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -10,29 +10,82 @@ on: - main jobs: - build: + setup-and-build: + name: Setup and Run Application + runs-on: ubuntu-latest + + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: common_assess + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping --silent" + --health-interval=10s + --health-timeout=5s + --health-retries=3 + + steps: + # Step 1: Checkout the repository + - name: Checkout Code + - uses: actions/checkout@v4 + + # Step 2: Set up Python + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.10 + + - name: Check versions + run: | + python --version + pip --version + + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + + # Step 3: Install dependencies + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install pymysql + + # Step 4: Wait for MySQL service to be ready + - name: Wait for MySQL to be ready + run: | + for i in {1..30}; do + mysqladmin ping -h 127.0.0.1 --silent && break + echo "Waiting for MySQL..." && sleep 2 + done + + # Step 5: Run database migrations (if required) + - name: Apply Database Migrations + run: | + python app/database.py + + # Step 6: Run the application + - name: Run Application + run: | + nohup uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload & + + pylint: + name: Run Pylint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4.8.0 - with: - python-version: 3.10.11 - - name: Check versions - run: | - python --version - pip --version - - name: Upgrade pip - run: | - python -m pip install --upgrade pip - - name: Install dependencies - run: | - pip install -r requirements.txt - - name: Run Pylint - run: | - pip install pylint - pylint $(git ls-files '*.py') - - name: Run Unit Tests - run: | - pip install pytest - pytest test \ No newline at end of file + - name: Linter Check + run: | + pip install pylint + pylint $(git ls-files '*.py') + + unit-testing: + name: Run Unit Tests + runs-on: ubuntu-latest + steps: + - name: Configure Test Enviroment + run: | + pip install pytest + pytest test_crud From 1f2f047cbd5818cbc0326ab995d7b94b3d5c820d Mon Sep 17 00:00:00 2001 From: ya603J Date: Sun, 24 Nov 2024 19:57:21 -0800 Subject: [PATCH 28/40] Update continuous_integration.yml --- .github/workflows/continuous_integration.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 533933d9..aa14d06f 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -82,10 +82,10 @@ jobs: pylint $(git ls-files '*.py') unit-testing: - name: Run Unit Tests - runs-on: ubuntu-latest - steps: - - name: Configure Test Enviroment - run: | - pip install pytest - pytest test_crud + name: Run Unit Tests + runs-on: ubuntu-latest + steps: + - name: Configure Test Enviroment + run: | + pip install pytest + pytest test_crud From 6d6e3fb7c934c13cbffde8ba909ade814c6d8c39 Mon Sep 17 00:00:00 2001 From: ya603J Date: Sun, 24 Nov 2024 20:45:22 -0800 Subject: [PATCH 29/40] fix indentation errors --- .github/workflows/continuous_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index aa14d06f..c9f6e374 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -31,7 +31,7 @@ jobs: steps: # Step 1: Checkout the repository - name: Checkout Code - - uses: actions/checkout@v4 + uses: actions/checkout@v4 # Step 2: Set up Python - name: Set up Python From 3a8fee5f8fd569bb283de0f04a6fe200650da288 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 20:46:02 -0800 Subject: [PATCH 30/40] Lint changes to schema and logic --- app/clients/schema.py | 25 +++++++++++++++++++------ app/clients/service/logic.py | 33 ++++++++++++++------------------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/app/clients/schema.py b/app/clients/schema.py index b9d153c5..e636dedc 100644 --- a/app/clients/schema.py +++ b/app/clients/schema.py @@ -1,7 +1,12 @@ -from pydantic import BaseModel +"""Model contains functions to create schema""" + from typing import Optional +from pydantic import BaseModel +# pylint: disable=too-few-public-methods class PredictionInput(BaseModel): + """Create schema for PredictionInput""" + age: int gender: str work_experience: int @@ -27,7 +32,10 @@ class PredictionInput(BaseModel): time_unemployed: int need_mental_health_support_bool: str + class ClientBase(BaseModel): + """Create schema for ClientBase""" + name: str age: int gender: str @@ -54,12 +62,14 @@ class ClientBase(BaseModel): time_unemployed: int need_mental_health_support_bool: bool -# Schema for creating a new client + class ClientCreate(ClientBase): - pass + """Schema for creating a new client""" + -# Schema for updating client information with optional fields class ClientUpdate(BaseModel): + """Schema for updating client information with optional fields""" + name: Optional[str] = None age: Optional[int] = None gender: Optional[str] = None @@ -86,9 +96,12 @@ class ClientUpdate(BaseModel): time_unemployed: Optional[int] = None need_mental_health_support_bool: Optional[bool] = None -# Schema for reading client information, with ORM mode enabled + class Client(ClientBase): + """Schema for reading client information, with ORM mode enabled""" + id: int - + class Config: + '''Class for configuring ORM''' orm_mode = True diff --git a/app/clients/service/logic.py b/app/clients/service/logic.py index 0fd826a5..030477d7 100644 --- a/app/clients/service/logic.py +++ b/app/clients/service/logic.py @@ -1,9 +1,6 @@ -from typing import List -import pandas as pd -import json +import os import numpy as np import pickle -from itertools import combinations_with_replacement from itertools import product column_intervention = [ @@ -13,25 +10,22 @@ 'Specialized Services', 'Employment-Related Financial Supports for Job Seekers and Employers', 'Employer Financial Supports', - 'Enhanced Referrals for Skills Development' -] - -#loads the model into logic - -import os + 'Enhanced Referrals for Skills Development'] +# Loads the model into logic current_dir = os.path.dirname(os.path.abspath(__file__)) filename = os.path.join(current_dir, 'model.pkl') model = pickle.load(open(filename, "rb")) def clean_input_data(data): - #translate input into wahtever we trained the model on, numerical data in a specific order - columns = ["age","gender","work_experience","canada_workex","dep_num", "canada_born", - "citizen_status", "level_of_schooling", "fluent_english", "reading_english_scale", - "speaking_english_scale", "writing_english_scale", "numeracy_scale", "computer_scale", - "transportation_bool", "caregiver_bool", "housing", "income_source", "felony_bool", "attending_school", - "currently_employed", "substance_use", "time_unemployed", "need_mental_health_support_bool"] + '''Translate input into what we trained the model on, numerical data in a specific order''' + columns = ["age", "gender", "work_experience", "canada_workex", "dep_num", "canada_born", + "citizen_status","level_of_schooling","fluent_english","reading_english_scale", + "speaking_english_scale", "writing_english_scale","numeracy_scale", + "computer_scale", "transportation_bool", "caregiver_bool", "housing", + "income_source", "felony_bool", "attending_school", "currently_employed", + "substance_use", "time_unemployed", "need_mental_health_support_bool"] demographics = { 'age': data['age'], 'gender': data['gender'], @@ -60,7 +54,8 @@ def clean_input_data(data): } output = [] for column in columns: - data = demographics.get(column, None) #default is None, and if you want to pass a value, can return any value + # If you want to pass a value, can return any value. + data = demographics.get(column, None) if isinstance(data, str): data = convert_text(column, data) output.append(data) @@ -68,8 +63,8 @@ def clean_input_data(data): def convert_text(column, data:str): - # Convert text answers from front end into digits - # TODO: ensure that categorical columns match the valid answers in FormNew.jsx (L131) + '''Convert text answers from front end into digits. + TODO: ensure that categorical columns match the valid answers in FormNew.jsx (L131)''' categorical_cols_integers = [ { "": 0, From 720f625b5c2758fb27e1e03566c597e61c3bc3e9 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 20:59:17 -0800 Subject: [PATCH 31/40] Combine jobs in continuous integration --- .github/workflows/continuous_integration.yml | 42 +++++++------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index c9f6e374..aef9d3d5 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -11,7 +11,7 @@ on: jobs: setup-and-build: - name: Setup and Run Application + name: Continuous Integration runs-on: ubuntu-latest services: @@ -27,13 +27,11 @@ jobs: --health-interval=10s --health-timeout=5s --health-retries=3 - + steps: - # Step 1: Checkout the repository - name: Checkout Code uses: actions/checkout@v4 - # Step 2: Set up Python - name: Set up Python uses: actions/setup-python@v4 with: @@ -43,49 +41,37 @@ jobs: run: | python --version pip --version - + - name: Upgrade pip run: | python -m pip install --upgrade pip - # Step 3: Install dependencies - name: Install dependencies run: | pip install -r requirements.txt pip install pymysql - # Step 4: Wait for MySQL service to be ready + - name: Linter Check + run: | + pip install pylint + pylint $(git ls-files '*.py') + + - name: Configure Test Enviroment + run: | + pip install pytest + pytest test_crud + - name: Wait for MySQL to be ready run: | for i in {1..30}; do mysqladmin ping -h 127.0.0.1 --silent && break echo "Waiting for MySQL..." && sleep 2 done - - # Step 5: Run database migrations (if required) + - name: Apply Database Migrations run: | python app/database.py - # Step 6: Run the application - name: Run Application run: | nohup uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload & - - pylint: - name: Run Pylint - runs-on: ubuntu-latest - steps: - - name: Linter Check - run: | - pip install pylint - pylint $(git ls-files '*.py') - - unit-testing: - name: Run Unit Tests - runs-on: ubuntu-latest - steps: - - name: Configure Test Enviroment - run: | - pip install pytest - pytest test_crud From 494180b8cdd81959610f105ac7427d679d6742b7 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 21:02:02 -0800 Subject: [PATCH 32/40] Minor edits in continuous integration --- .github/workflows/continuous_integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index aef9d3d5..db4a9e74 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -33,9 +33,9 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v4.8.0 with: - python-version: 3.10 + python-version: 3.10.11 - name: Check versions run: | From d2f04c1ed2fa5f001fda971b78297a7e9108faf1 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 21:42:47 -0800 Subject: [PATCH 33/40] Large batch of lint changes --- app/__init__.py | 2 +- app/clients/service/load_data.py | 7 ++-- app/clients/service/logic.py | 59 ++++++++++++++++++++------------ app/clients/service/model.py | 29 +++++++++------- app/database_tools.py | 10 +++--- app/main.py | 4 +-- tests/__init__.py | 2 +- tests/test.py | 7 ++-- tests/test_crud.py | 42 ++++++++++++++--------- 9 files changed, 99 insertions(+), 63 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 9f6ed3cd..12fe4bd1 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,3 +1,3 @@ """ Package for client-related functionality (CRUD operations, schemas, etc.). -""" \ No newline at end of file +""" diff --git a/app/clients/service/load_data.py b/app/clients/service/load_data.py index 6eba0e00..4cfe0514 100644 --- a/app/clients/service/load_data.py +++ b/app/clients/service/load_data.py @@ -1,5 +1,8 @@ -from app.database import engine +'''Module containing functions for load_data''' + import pandas as pd +from app.database import engine + df = pd.read_csv('data_commontool.csv') -df.to_sql('persons', engine, if_exists='append', index=False) \ No newline at end of file +df.to_sql('persons', engine, if_exists='append', index=False) diff --git a/app/clients/service/logic.py b/app/clients/service/logic.py index 030477d7..d9f314e3 100644 --- a/app/clients/service/logic.py +++ b/app/clients/service/logic.py @@ -1,7 +1,10 @@ +'''Module containing functions for logic''' + import os -import numpy as np import pickle from itertools import product +import numpy as np + column_intervention = [ 'Life Stabilization', @@ -15,6 +18,7 @@ # Loads the model into logic current_dir = os.path.dirname(os.path.abspath(__file__)) filename = os.path.join(current_dir, 'model.pkl') +# pylint: disable=consider-using-with model = pickle.load(open(filename, "rb")) @@ -127,20 +131,25 @@ def convert_text(column, data:str): return data -#creates 128 possible combinations in order to run every possibility through model + def create_matrix(row): - data = [row.copy() for _ in range(128)] + '''Create 128 possible combos to run every possibility through model''' + data = [row.copy() for _ in range(128)] perms = intervention_permutations(7) data = np.array(data) perms = np.array(perms) - matrix = np.concatenate((data,perms), axis = 1) + matrix = np.concatenate((data,perms), axis = 1) return np.array(matrix) -#create matrix of permutations of 1 and 0 of num length + + def intervention_permutations(num): + '''Create matrix of permutations of 1 and 0 of num length''' perms = list(product([0,1],repeat=num)) return np.array(perms) + def get_baseline_row(row): + '''Get baseline row''' print(type(row)) base_interventions = np.array([0]*7) # no interventions row = np.array(row) @@ -150,37 +159,41 @@ def get_baseline_row(row): return line def intervention_row_to_names(row): + '''Reture names with the intervention''' names = [] for i, value in enumerate(row): - if value == 1: + if value == 1: names.append(column_intervention[i]) return names def process_results(baseline, results): - ##Example: - """ + '''Example: { baseline_probability: 80 #baseline percentage point with no interventions results: [ - (85, [A,B,C]) #new percentange with intervention combinations and list of intervention names + #new percentange with intervention combinations and list of intervention names + (85, [A,B,C]) (89, [B,C]) (91, [D,E]) ] } - """ + ''' result_list= [] for row in results: - percent = row[-1] + percent = row[-1] names = intervention_row_to_names(row) result_list.append((percent,names)) output = { - "baseline": baseline[-1], #if it's an array, want the value inside of the array + #if it's an array, want the value inside of the array + "baseline": baseline[-1], "interventions": result_list, } return output + def interpret_and_calculate(data): + '''Interpret and calculate from data''' raw_data = clean_input_data(data) baseline_row = get_baseline_row(raw_data) baseline_row = baseline_row.reshape(1, -1) @@ -188,25 +201,29 @@ def interpret_and_calculate(data): intervention_rows = create_matrix(raw_data) baseline_prediction = model.predict(baseline_row) intervention_predictions = model.predict(intervention_rows) - intervention_predictions = intervention_predictions.reshape(-1, 1) #want shape to be a vertical column, not a row - result_matrix = np.concatenate((intervention_rows,intervention_predictions), axis = 1) ##CHANGED AXIS - + intervention_predictions = intervention_predictions.reshape(-1, 1) # vertical column + result_matrix = np.concatenate((intervention_rows,intervention_predictions), axis = 1) + # sort this matrix based on prediction # print("RESULT SAMPLE::", result_matrix[:5]) - result_order = result_matrix[:,-1].argsort() #take all rows and only last column, gives back list of indexes sorted - result_matrix = result_matrix[result_order] #indexing the matrix by the order + #take all rows and only last column, gives back list of indexes sorted + #indexing the matrix by the order + result_order = result_matrix[:,-1].argsort() + result_matrix = result_matrix[result_order] # slice matrix to only top N results - result_matrix = result_matrix[-3:,-8:] #-8 for interventions and prediction, want top 3, 3 combinations of intervention + #-8 for interventions and prediction, want top 3, 3 combinations of intervention + result_matrix = result_matrix[-3:,-8:] # post process results if needed ie make list of names for each row results = process_results(baseline_prediction,result_matrix) # build output dict print(f"RESULTS: {results}") return results + if __name__ == "__main__": print("running") - data = { + new_client = { "age": "23", "gender": "1", "work_experience": "1", @@ -232,7 +249,5 @@ def interpret_and_calculate(data): "time_unemployed": "1", "need_mental_health_support_bool": "1" } - # print(data) - results = interpret_and_calculate(data) - print(results) + print(interpret_and_calculate(new_client)) diff --git a/app/clients/service/model.py b/app/clients/service/model.py index 51369ac3..a385ed4b 100644 --- a/app/clients/service/model.py +++ b/app/clients/service/model.py @@ -1,14 +1,17 @@ +'''Creates the model''' +# pylint: disable=all + +import pickle import pandas as pd -import json import numpy as np -import pickle from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestRegressor def prepare_models(): + '''Prepare models''' # Load dataset and define the features and labels - backendCode = pd.read_csv('data_commontool.csv') + backend_code = pd.read_csv('data_commontool.csv') # Define categorical columns and interventions categorical_cols = ['age', 'gender', #bool @@ -21,7 +24,7 @@ def prepare_models(): 'fluent_english', #english level fluency, scale (1-10) 'reading_english_scale', #reading scale (1-10) 'speaking_english_scale', #speaking level comfort (1-10) - 'writing_english_scale', #writing scale (1-10) + 'writing_english_scale', #writing scale (1-10) 'numeracy_scale', #numeracy scale (1-10) 'computer_scale', #computer use scale (1-10) 'transportation_bool', #need transportation support (bool) @@ -45,28 +48,28 @@ def prepare_models(): ] categorical_cols.extend(interventions) # Prepare training data - X_categorical_baseline = backendCode[categorical_cols] + x_categorical_baseline = backendCode[categorical_cols] y_baseline = backendCode['success_rate'] - X_categorical_baseline = np.array(X_categorical_baseline) + x_categorical_baseline = np.array(x_categorical_baseline) y_baseline = np.array(y_baseline) - X_train_baseline, X_test_baseline, y_train_baseline, y_test_baseline = train_test_split( - X_categorical_baseline, y_baseline, test_size=0.2, random_state=42) + x_train_baseline, x_test_baseline, y_train_baseline, y_test_baseline = train_test_split( + x_categorical_baseline, y_baseline, test_size=0.2, random_state=42) rf_model_baseline = RandomForestRegressor(n_estimators=100, random_state=42) - rf_model_baseline.fit(X_train_baseline, y_train_baseline) - - # Example: Predicting on the test set - baseline_predictions = rf_model_baseline.predict(X_test_baseline) + rf_model_baseline.fit(x_train_baseline, y_train_baseline) - return rf_model_baseline + def main(): + '''Prepare and start model''' + print("Start model.") model = prepare_models() pickle.dump(model, open("model.pkl", "wb")) #saves model to the file name input, write binary model = pickle.load(open("model.pkl", "rb")) #read binary + if __name__ == "__main__": main() diff --git a/app/database_tools.py b/app/database_tools.py index 30ec1960..69fd8219 100644 --- a/app/database_tools.py +++ b/app/database_tools.py @@ -1,5 +1,6 @@ -from app.database import engine +'''Module contains functions to load and read database from csv''' import pandas as pd +from app.database import engine def load_csv_to_db(csv_path, table_name, mode='append'): @@ -14,7 +15,7 @@ def load_csv_to_db(csv_path, table_name, mode='append'): raise ValueError("Mode must be 'append', 'replace', or 'fail'.") try: df.to_sql(table_name, engine, if_exists=mode, index=False) - except Exception as e: + except ValueError as e: print(f"Error: {e}") print('success csv to db !') @@ -31,10 +32,11 @@ def read_db_to_csv(file_path, table_name, sql=None, mode='w'): try: df = pd.read_sql(query, engine) df.to_csv(file_path, index=False, mode=mode) - except Exception as e: + except ValueError as e: print(f"Error: {e}") print('success db to csv file !') if __name__ == '__main__': - load_csv_to_db(r"C:\Users\zq789\OneDrive\Desktop\common_assess\data_sample.csv", 'persons', 'replace') \ No newline at end of file + load_csv_to_db(r"C:\Users\zq789\OneDrive\Desktop\common_assess\data_sample.csv", + 'persons', 'replace') diff --git a/app/main.py b/app/main.py index ea59ff43..db859471 100644 --- a/app/main.py +++ b/app/main.py @@ -1,3 +1,5 @@ +'''Module containing main''' + from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware @@ -19,5 +21,3 @@ allow_methods=["*"], # Allows all methods, including OPTIONS allow_headers=["*"], # Allows all headers ) - - diff --git a/tests/__init__.py b/tests/__init__.py index 829b1449..7e679dcc 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,3 +1,3 @@ """ Package for unit and integration tests. -""" \ No newline at end of file +""" diff --git a/tests/test.py b/tests/test.py index b1b3359c..c9adc7d8 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,5 +1,9 @@ -from logic import interpret_and_calculate +'''Module containing tests''' + from itertools import combinations_with_replacement +from itertools import product +# from logic import interpret_and_calculate + # def test_interpret_and_calculate(): # print("running tests") @@ -9,7 +13,6 @@ # result = interpret_and_calculate(data) # print(data) -from itertools import product # Cartesian product of [0, 1] repeated 2 times result = list(product([0, 1], repeat=2)) diff --git a/tests/test_crud.py b/tests/test_crud.py index 15884da4..bdcc2145 100644 --- a/tests/test_crud.py +++ b/tests/test_crud.py @@ -1,19 +1,26 @@ +'''Module contains tests for CRUD functions''' +# pylint: disable=unused-import +# pylint: disable=too-few-public-methods + from unittest.mock import MagicMock -import pytest from app.clients.crud import ( create_client, get_client, get_clients, update_client, delete_client ) from app.clients.schema import ClientCreate, ClientUpdate, ClientBase -# Test creating a client + class MockClient: + '''Create mock client''' + def __init__(self, **kwargs): self.__dict__.update(kwargs) + def test_create_client(): + '''Test create_client''' # Mock the database session mock_db = MagicMock() - + # Provide valid test data matching the ClientCreate schema client_data = ClientBase( name="Ann Lu", @@ -42,42 +49,45 @@ def test_create_client(): time_unemployed=0, need_mental_health_support_bool=False ) - + # Call the function to test result = create_client(mock_db, client=client_data) - + # Assert that the mock database methods were called correctly mock_db.add.assert_called_once_with(result) - mock_db.commit.assert_called_once() + mock_db.commit.assert_called_once() # Verify the result is the same as the input data (or matches expectations) assert result.name == client_data.name assert result.age == client_data.age assert result.gender == client_data.gender -# Test retrieving a client by ID + def test_get_client(): + '''Test retrieving client by client_id''' mock_db = MagicMock() mock_db.query().filter().first.return_value = {"id": 1, "name": "Test Client"} - + result = get_client(mock_db, client_id=1) assert result == {"id": 1, "name": "Test Client"} mock_db.query().filter().first.assert_called_once() -# Test retrieving all clients + def test_get_clients(): + '''Test retrieving all clients''' mock_db = MagicMock() mock_db.query().offset().limit().all.return_value = [ {"id": 1, "name": "Client 1"}, {"id": 2, "name": "Client 2"}, ] - + result = get_clients(mock_db, skip=0, limit=10) assert len(result) == 2 assert result[0]["name"] == "Client 1" -# Test updating a client + def test_update_client(): + '''Test updating a client''' # Mock the database session mock_db = MagicMock() @@ -105,7 +115,7 @@ def test_update_client(): result = update_client(mock_db, client_id=1, client=updated_data) # Assert that the mock database methods were called correctly - mock_db.commit.assert_called_once() + mock_db.commit.assert_called_once() # Assert that the attributes were updated correctly assert result.name == updated_data.name @@ -113,11 +123,11 @@ def test_update_client(): assert result.gender == updated_data.gender assert result.work_experience == updated_data.work_experience -# Test deleting a client + def test_delete_client(): + '''Test deleting a client''' mock_db = MagicMock() mock_db.query().filter().first.return_value = {"id": 1, "name": "Test Client"} - - result = delete_client(mock_db, client_id=1) + mock_db.delete.assert_called_once() - mock_db.commit.assert_called_once() \ No newline at end of file + mock_db.commit.assert_called_once() From c867dccfbd36313376caa3d064f23c7d465ef425 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 21:48:18 -0800 Subject: [PATCH 34/40] Lint changes to database.py --- app/database.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/database.py b/app/database.py index 3d5f02ef..6df4a953 100644 --- a/app/database.py +++ b/app/database.py @@ -1,3 +1,4 @@ +'''Module containing functions to define database model''' from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker @@ -11,7 +12,9 @@ 'database': 'common_assess' } -engine = create_engine(f"{db_config['drivername']}://{db_config['username']}:{db_config['password']}@{db_config['host']}:{db_config['port']}/{db_config['database']}") +engine = create_engine(f"{db_config['drivername']}://{db_config['username']}:"+ + "{db_config['password']}@{db_config['host']}:"+ + "{db_config['port']}/{db_config['database']}") # Create a base class to define the database model Base = declarative_base() @@ -21,8 +24,9 @@ Base = declarative_base() def get_db(): + '''Get database''' db = SessionLocal() try: yield db finally: - db.close() \ No newline at end of file + db.close() From e6f39a76d565d8bbbcdb029c2d791936a0ff300f Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 21:57:51 -0800 Subject: [PATCH 35/40] Minor changes to make unit tests run --- .github/workflows/continuous_integration.yml | 2 +- tests/{test.py => math.py} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename tests/{test.py => math.py} (94%) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index db4a9e74..620ad45d 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -59,7 +59,7 @@ jobs: - name: Configure Test Enviroment run: | pip install pytest - pytest test_crud + pytest - name: Wait for MySQL to be ready run: | diff --git a/tests/test.py b/tests/math.py similarity index 94% rename from tests/test.py rename to tests/math.py index c9adc7d8..52ef27ae 100644 --- a/tests/test.py +++ b/tests/math.py @@ -1,4 +1,4 @@ -'''Module containing tests''' +'''Module containing some math''' from itertools import combinations_with_replacement from itertools import product From cf9474079c0dbd497862f6a723229c8852199ae3 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 22:07:49 -0800 Subject: [PATCH 36/40] Minor edit to database.py --- app/database.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/database.py b/app/database.py index 6df4a953..0549527d 100644 --- a/app/database.py +++ b/app/database.py @@ -12,9 +12,8 @@ 'database': 'common_assess' } -engine = create_engine(f"{db_config['drivername']}://{db_config['username']}:"+ - "{db_config['password']}@{db_config['host']}:"+ - "{db_config['port']}/{db_config['database']}") +# pylint: disable=line-too-long +engine = create_engine(f"{db_config['drivername']}://{db_config['username']}:{db_config['password']}@{db_config['host']}:{db_config['port']}/{db_config['database']}") # Create a base class to define the database model Base = declarative_base() From 53d533e2a6d8dd62836f5869956abbe0122e0ab9 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Sun, 24 Nov 2024 22:13:52 -0800 Subject: [PATCH 37/40] Minor edit to test_crud.py --- tests/test_crud.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_crud.py b/tests/test_crud.py index bdcc2145..6c99bf1f 100644 --- a/tests/test_crud.py +++ b/tests/test_crud.py @@ -129,5 +129,7 @@ def test_delete_client(): mock_db = MagicMock() mock_db.query().filter().first.return_value = {"id": 1, "name": "Test Client"} + delete_client(mock_db, client_id=1) + mock_db.delete.assert_called_once() mock_db.commit.assert_called_once() From 1b6ddda12fb2fa07e4eec7bb05c79ce69e3d0dd7 Mon Sep 17 00:00:00 2001 From: jeshwang Date: Wed, 27 Nov 2024 15:21:12 -0800 Subject: [PATCH 38/40] Add Dockerfile --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..d369a361 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM python:3.11 + +# Set the working directory +WORKDIR /app + +# Copy the requirements file +COPY app/requirements.txt . + +# Install the dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy rest of the app code +COPY . /app + +# Expose the port +EXPOSE 8000 + +# Command to run application +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] From abd9da50450e8fdfc6dd4bd3e308c053b3928c95 Mon Sep 17 00:00:00 2001 From: Zheng Qiao <109362533+BossJoeZz@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:56:18 -0800 Subject: [PATCH 39/40] Update fastapi.sql --- app/clients/fastapi.sql | 380 +++------------------------------------- 1 file changed, 20 insertions(+), 360 deletions(-) diff --git a/app/clients/fastapi.sql b/app/clients/fastapi.sql index 2043027f..f7f17615 100644 --- a/app/clients/fastapi.sql +++ b/app/clients/fastapi.sql @@ -1,19 +1,3 @@ -/* - Navicat Premium Data Transfer - - Source Server : local - Source Server Type : MySQL - Source Server Version : 80039 - Source Host : localhost:3306 - Source Schema : fastapi - - Target Server Type : MySQL - Target Server Version : 80039 - File Encoding : 65001 - - Date: 11/11/2024 10:50:29 -*/ - SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; @@ -56,347 +40,23 @@ CREATE TABLE `clients` ( -- ---------------------------- -- Records of clients -- ---------------------------- -INSERT INTO `clients` VALUES (1, 'John Doe', 20, '1', 1, 1, 3, 0, '0', '1', 0, 1, 8, 2, 3, 4, 0, 1, '1', '1', 0, 0, 0, 0, 0, 0); - --- ---------------------------- --- Table structure for persons --- ---------------------------- -DROP TABLE IF EXISTS `persons`; -CREATE TABLE `persons` ( - `age` bigint NULL DEFAULT NULL, - `gender` bigint NULL DEFAULT NULL, - `work_experience` bigint NULL DEFAULT NULL, - `canada_workex` bigint NULL DEFAULT NULL, - `dep_num` bigint NULL DEFAULT NULL, - `canada_born` bigint NULL DEFAULT NULL, - `citizen_status` bigint NULL DEFAULT NULL, - `level_of_schooling` bigint NULL DEFAULT NULL, - `fluent_english` bigint NULL DEFAULT NULL, - `reading_english_scale` bigint NULL DEFAULT NULL, - `speaking_english_scale` bigint NULL DEFAULT NULL, - `writing_english_scale` bigint NULL DEFAULT NULL, - `numeracy_scale` bigint NULL DEFAULT NULL, - `computer_scale` bigint NULL DEFAULT NULL, - `transportation_bool` bigint NULL DEFAULT NULL, - `caregiver_bool` bigint NULL DEFAULT NULL, - `housing` bigint NULL DEFAULT NULL, - `income_source` bigint NULL DEFAULT NULL, - `felony_bool` bigint NULL DEFAULT NULL, - `attending_school` bigint NULL DEFAULT NULL, - `currently_employed` bigint NULL DEFAULT NULL, - `substance_use` bigint NULL DEFAULT NULL, - `time_unemployed` bigint NULL DEFAULT NULL, - `need_mental_health_support_bool` bigint NULL DEFAULT NULL, - `employment_assistance` bigint NULL DEFAULT NULL, - `life_stabilization` bigint NULL DEFAULT NULL, - `retention_services` bigint NULL DEFAULT NULL, - `specialized_services` bigint NULL DEFAULT NULL, - `employment_related_financial_supports` bigint NULL DEFAULT NULL, - `employer_financial_supports` bigint NULL DEFAULT NULL, - `enhanced_referrals` bigint NULL DEFAULT NULL, - `success_rate` bigint NULL DEFAULT NULL -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of persons --- ---------------------------- -INSERT INTO `persons` VALUES (20, 1, 1, 1, 3, 0, 0, 1, 0, 1, 8, 2, 3, 4, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 80); -INSERT INTO `persons` VALUES (21, 2, 2, 2, 5, 1, 1, 2, 1, 2, 9, 3, 4, 5, 1, 0, 2, 2, 1, 1, 1, 0, 2, 0, 1, 1, 1, 0, 1, 1, 1, 30); -INSERT INTO `persons` VALUES (22, 1, 3, 3, 1, 0, 0, 3, 0, 3, 10, 4, 5, 6, 0, 1, 3, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (23, 2, 4, 4, 2, 1, 1, 4, 1, 4, 1, 5, 6, 7, 1, 0, 4, 4, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 1, 1, 1, 70); -INSERT INTO `persons` VALUES (24, 1, 5, 5, 0, 0, 0, 5, 0, 5, 2, 6, 7, 8, 0, 1, 5, 5, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (25, 2, 6, 6, 2, 1, 1, 6, 1, 6, 3, 7, 8, 9, 1, 0, 6, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 40); -INSERT INTO `persons` VALUES (26, 1, 7, 7, 1, 0, 0, 7, 0, 7, 4, 8, 9, 8, 0, 1, 7, 7, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 10); -INSERT INTO `persons` VALUES (27, 2, 8, 8, 0, 1, 1, 8, 1, 8, 5, 9, 8, 9, 1, 0, 8, 8, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 20); -INSERT INTO `persons` VALUES (28, 1, 9, 9, 1, 0, 0, 9, 0, 9, 6, 8, 9, 10, 0, 1, 9, 9, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 60); -INSERT INTO `persons` VALUES (29, 2, 10, 10, 0, 1, 1, 10, 1, 10, 7, 9, 10, 1, 1, 0, 10, 10, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 50); -INSERT INTO `persons` VALUES (30, 1, 1, 1, 2, 0, 0, 11, 0, 1, 8, 10, 1, 2, 0, 0, 1, 2, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 100); -INSERT INTO `persons` VALUES (31, 2, 2, 2, 0, 1, 1, 12, 1, 2, 9, 1, 2, 3, 1, 1, 2, 3, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 40); -INSERT INTO `persons` VALUES (32, 1, 3, 3, 4, 0, 0, 13, 0, 3, 8, 2, 3, 4, 0, 0, 3, 4, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 70); -INSERT INTO `persons` VALUES (33, 2, 4, 4, 2, 1, 1, 1, 1, 4, 9, 3, 4, 5, 1, 1, 4, 5, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 90); -INSERT INTO `persons` VALUES (34, 1, 5, 5, 0, 0, 0, 2, 0, 5, 10, 4, 5, 6, 0, 0, 5, 6, 1, 0, 0, 0, 3, 1, 1, 0, 0, 0, 1, 0, 0, 30); -INSERT INTO `persons` VALUES (35, 2, 6, 6, 3, 0, 0, 3, 0, 6, 1, 5, 6, 7, 0, 1, 6, 7, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (36, 1, 7, 7, 5, 1, 1, 4, 1, 7, 2, 6, 7, 8, 1, 0, 7, 8, 1, 1, 1, 0, 2, 1, 1, 1, 1, 0, 1, 1, 1, 70); -INSERT INTO `persons` VALUES (37, 2, 8, 8, 1, 0, 0, 5, 0, 8, 3, 7, 8, 9, 0, 1, 8, 9, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (38, 1, 9, 9, 2, 1, 1, 6, 1, 9, 4, 8, 9, 8, 1, 0, 9, 10, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 1, 1, 1, 30); -INSERT INTO `persons` VALUES (39, 2, 10, 10, 0, 0, 0, 7, 0, 10, 5, 9, 8, 9, 0, 1, 10, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0); -INSERT INTO `persons` VALUES (40, 1, 1, 1, 2, 1, 1, 8, 1, 1, 6, 8, 9, 10, 1, 0, 1, 2, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (41, 2, 2, 2, 1, 0, 0, 9, 0, 2, 7, 9, 10, 1, 0, 1, 2, 3, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 30); -INSERT INTO `persons` VALUES (42, 1, 3, 3, 0, 1, 1, 10, 1, 3, 8, 10, 1, 2, 1, 0, 3, 4, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 20); -INSERT INTO `persons` VALUES (43, 2, 4, 4, 1, 0, 0, 11, 0, 4, 9, 1, 2, 3, 0, 1, 4, 5, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 60); -INSERT INTO `persons` VALUES (44, 1, 5, 5, 0, 1, 1, 12, 1, 5, 8, 2, 3, 4, 1, 0, 5, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (45, 2, 6, 6, 2, 0, 0, 13, 0, 6, 9, 3, 4, 5, 0, 0, 6, 7, 1, 0, 0, 0, 3, 1, 1, 0, 0, 0, 1, 0, 0, 50); -INSERT INTO `persons` VALUES (46, 1, 7, 7, 0, 1, 1, 1, 1, 7, 10, 4, 5, 6, 1, 1, 7, 8, 0, 1, 1, 0, 4, 1, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (47, 2, 8, 8, 4, 0, 0, 2, 0, 8, 1, 5, 6, 7, 0, 0, 8, 9, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 70); -INSERT INTO `persons` VALUES (48, 1, 9, 9, 2, 1, 1, 3, 1, 9, 2, 6, 7, 8, 1, 1, 9, 10, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (49, 2, 10, 10, 0, 0, 0, 4, 0, 10, 3, 7, 8, 3, 0, 0, 6, 1, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 40); -INSERT INTO `persons` VALUES (50, 1, 1, 1, 3, 0, 0, 5, 0, 1, 4, 8, 9, 4, 0, 1, 7, 2, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (51, 2, 2, 2, 5, 1, 1, 6, 1, 2, 5, 9, 8, 5, 1, 0, 8, 3, 1, 0, 0, 1, 2, 0, 1, 0, 0, 1, 1, 0, 0, 40); -INSERT INTO `persons` VALUES (52, 1, 3, 3, 1, 0, 0, 7, 0, 3, 6, 8, 9, 6, 0, 1, 9, 4, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (53, 2, 4, 4, 2, 1, 1, 8, 1, 4, 7, 9, 10, 7, 1, 0, 10, 5, 1, 0, 0, 0, 4, 0, 1, 0, 0, 0, 1, 0, 0, 50); -INSERT INTO `persons` VALUES (54, 1, 5, 5, 0, 0, 0, 9, 0, 5, 8, 10, 1, 8, 0, 1, 1, 6, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (55, 2, 6, 6, 2, 1, 1, 10, 1, 6, 9, 1, 2, 9, 1, 0, 2, 7, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 20); -INSERT INTO `persons` VALUES (56, 1, 7, 7, 1, 0, 0, 11, 0, 7, 8, 2, 3, 8, 0, 1, 3, 8, 1, 1, 1, 0, 3, 1, 1, 1, 1, 0, 1, 1, 1, 70); -INSERT INTO `persons` VALUES (57, 2, 8, 8, 0, 1, 1, 12, 1, 8, 9, 3, 4, 9, 1, 0, 4, 9, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (58, 1, 9, 9, 1, 0, 0, 13, 0, 9, 10, 4, 5, 10, 0, 1, 5, 6, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 90); -INSERT INTO `persons` VALUES (59, 2, 10, 10, 0, 1, 1, 1, 1, 10, 1, 5, 6, 1, 1, 0, 6, 7, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 80); -INSERT INTO `persons` VALUES (60, 1, 1, 1, 2, 0, 0, 2, 0, 1, 2, 6, 7, 2, 0, 0, 8, 8, 1, 0, 1, 1, 3, 0, 1, 0, 1, 1, 1, 0, 1, 60); -INSERT INTO `persons` VALUES (61, 2, 2, 2, 0, 1, 1, 3, 1, 2, 3, 7, 8, 3, 1, 1, 9, 9, 0, 1, 0, 1, 4, 0, 0, 1, 0, 1, 0, 1, 0, 100); -INSERT INTO `persons` VALUES (62, 1, 3, 3, 4, 0, 0, 4, 0, 3, 4, 8, 3, 4, 0, 0, 10, 10, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 40); -INSERT INTO `persons` VALUES (63, 2, 4, 4, 2, 1, 1, 5, 1, 4, 5, 9, 4, 5, 1, 1, 1, 1, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 0, 80); -INSERT INTO `persons` VALUES (64, 1, 5, 5, 0, 0, 0, 6, 0, 5, 6, 8, 5, 6, 0, 0, 2, 2, 1, 0, 1, 0, 3, 1, 1, 0, 1, 0, 1, 0, 1, 30); -INSERT INTO `persons` VALUES (65, 2, 6, 6, 3, 0, 0, 7, 0, 6, 7, 9, 6, 7, 0, 1, 3, 3, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (66, 1, 7, 7, 5, 1, 1, 8, 1, 7, 8, 10, 7, 8, 1, 0, 4, 4, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 1, 0, 1, 70); -INSERT INTO `persons` VALUES (67, 2, 8, 8, 1, 0, 0, 9, 0, 8, 9, 1, 8, 9, 0, 1, 5, 5, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (68, 1, 9, 9, 2, 1, 1, 10, 1, 9, 8, 2, 9, 8, 1, 0, 6, 6, 1, 0, 0, 1, 4, 0, 1, 0, 0, 1, 1, 0, 0, 40); -INSERT INTO `persons` VALUES (69, 2, 10, 10, 0, 0, 0, 11, 0, 10, 9, 3, 8, 9, 0, 1, 7, 8, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 10); -INSERT INTO `persons` VALUES (70, 1, 1, 1, 2, 1, 1, 12, 1, 1, 10, 4, 9, 10, 1, 0, 8, 9, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 20); -INSERT INTO `persons` VALUES (71, 2, 2, 2, 1, 0, 0, 13, 0, 2, 1, 5, 10, 1, 0, 1, 9, 10, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (72, 1, 3, 3, 0, 1, 1, 1, 1, 3, 2, 6, 1, 4, 1, 0, 6, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (73, 2, 4, 4, 1, 0, 0, 2, 0, 4, 3, 7, 2, 5, 0, 1, 7, 2, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (74, 1, 5, 5, 0, 1, 1, 3, 1, 5, 4, 8, 3, 6, 1, 0, 8, 3, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (75, 2, 6, 6, 2, 0, 0, 4, 0, 6, 5, 9, 4, 7, 0, 0, 9, 4, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 70); -INSERT INTO `persons` VALUES (76, 1, 7, 7, 0, 1, 1, 5, 1, 7, 6, 8, 5, 8, 1, 1, 10, 5, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 0, 0, 0, 90); -INSERT INTO `persons` VALUES (20, 2, 8, 8, 4, 0, 0, 6, 0, 8, 7, 9, 6, 9, 0, 0, 1, 6, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 30); -INSERT INTO `persons` VALUES (21, 1, 9, 9, 2, 1, 1, 7, 1, 9, 8, 10, 7, 8, 1, 1, 2, 7, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (22, 2, 10, 10, 0, 0, 0, 8, 0, 10, 9, 1, 8, 9, 0, 0, 9, 8, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 70); -INSERT INTO `persons` VALUES (23, 1, 1, 1, 3, 0, 0, 9, 0, 1, 8, 2, 9, 10, 0, 1, 10, 9, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (24, 2, 2, 2, 5, 1, 1, 10, 1, 2, 9, 3, 8, 1, 1, 0, 1, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 30); -INSERT INTO `persons` VALUES (25, 1, 3, 3, 1, 0, 0, 11, 0, 3, 10, 4, 9, 2, 0, 1, 2, 7, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0); -INSERT INTO `persons` VALUES (26, 2, 4, 4, 2, 1, 1, 12, 1, 4, 1, 5, 10, 3, 1, 0, 3, 8, 0, 1, 1, 0, 4, 1, 0, 1, 1, 0, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (27, 1, 5, 5, 0, 0, 0, 13, 0, 5, 2, 6, 1, 4, 0, 1, 4, 9, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 30); -INSERT INTO `persons` VALUES (28, 2, 6, 6, 2, 1, 1, 1, 1, 6, 3, 7, 2, 5, 1, 0, 5, 10, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 20); -INSERT INTO `persons` VALUES (29, 1, 7, 7, 1, 0, 0, 2, 0, 7, 4, 8, 3, 6, 0, 1, 6, 1, 0, 0, 0, 1, 3, 0, 0, 0, 0, 1, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (30, 2, 8, 8, 0, 1, 1, 3, 1, 8, 5, 9, 4, 7, 1, 0, 8, 2, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (31, 1, 9, 9, 1, 0, 0, 4, 0, 9, 6, 8, 5, 8, 0, 1, 9, 9, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 50); -INSERT INTO `persons` VALUES (32, 2, 10, 10, 0, 1, 1, 5, 1, 10, 7, 9, 6, 9, 1, 0, 10, 10, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (33, 1, 1, 1, 2, 0, 0, 6, 0, 1, 8, 10, 7, 8, 0, 0, 1, 1, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 70); -INSERT INTO `persons` VALUES (34, 2, 2, 2, 0, 1, 1, 7, 1, 2, 9, 1, 8, 9, 1, 1, 2, 2, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (35, 1, 3, 3, 4, 0, 0, 8, 0, 3, 8, 2, 9, 10, 0, 0, 3, 3, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (36, 2, 4, 4, 2, 1, 1, 9, 1, 4, 9, 3, 8, 1, 1, 1, 4, 4, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 80); -INSERT INTO `persons` VALUES (37, 1, 5, 5, 0, 0, 0, 10, 0, 5, 10, 4, 9, 2, 0, 0, 5, 5, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (38, 2, 6, 6, 3, 0, 0, 11, 0, 6, 1, 5, 10, 3, 0, 1, 6, 6, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (39, 1, 7, 7, 5, 1, 1, 12, 1, 7, 2, 6, 1, 4, 1, 0, 7, 8, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 50); -INSERT INTO `persons` VALUES (40, 2, 8, 8, 1, 0, 0, 13, 0, 8, 3, 7, 2, 5, 0, 1, 8, 9, 0, 0, 1, 1, 3, 0, 0, 0, 1, 1, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (41, 1, 9, 9, 2, 1, 1, 1, 1, 9, 4, 8, 3, 6, 1, 0, 9, 10, 0, 1, 0, 1, 4, 0, 0, 1, 0, 1, 0, 1, 0, 20); -INSERT INTO `persons` VALUES (42, 2, 10, 10, 0, 0, 0, 2, 0, 10, 5, 2, 4, 7, 0, 1, 10, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 70); -INSERT INTO `persons` VALUES (43, 1, 1, 1, 2, 1, 1, 3, 1, 1, 6, 3, 5, 8, 1, 0, 1, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (44, 2, 2, 2, 1, 0, 0, 4, 0, 2, 7, 4, 6, 3, 0, 1, 2, 2, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 90); -INSERT INTO `persons` VALUES (45, 1, 3, 3, 0, 1, 1, 5, 1, 3, 8, 5, 7, 4, 1, 0, 3, 3, 0, 0, 1, 0, 4, 1, 0, 0, 1, 0, 0, 0, 1, 80); -INSERT INTO `persons` VALUES (46, 2, 4, 4, 1, 0, 0, 6, 0, 4, 9, 6, 8, 5, 0, 1, 4, 4, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (47, 1, 5, 5, 0, 1, 1, 7, 1, 5, 8, 7, 3, 6, 1, 0, 5, 5, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (48, 2, 6, 6, 2, 0, 0, 8, 0, 6, 9, 8, 4, 7, 0, 0, 6, 6, 0, 1, 0, 1, 3, 0, 0, 1, 0, 1, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (49, 1, 7, 7, 0, 1, 1, 9, 1, 7, 10, 9, 5, 8, 1, 1, 8, 7, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 30); -INSERT INTO `persons` VALUES (50, 2, 8, 8, 4, 0, 0, 10, 0, 8, 1, 8, 6, 9, 0, 0, 9, 8, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 20); -INSERT INTO `persons` VALUES (51, 1, 9, 9, 2, 1, 1, 11, 1, 9, 2, 9, 7, 8, 1, 1, 10, 9, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (52, 2, 10, 10, 0, 0, 0, 12, 0, 10, 3, 10, 8, 9, 0, 0, 1, 10, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (53, 1, 1, 1, 3, 0, 0, 13, 0, 1, 4, 1, 9, 10, 0, 1, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 50); -INSERT INTO `persons` VALUES (54, 2, 2, 2, 5, 1, 1, 1, 1, 2, 5, 2, 8, 1, 1, 0, 3, 2, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (55, 1, 3, 3, 1, 0, 0, 2, 0, 3, 6, 3, 9, 2, 0, 1, 4, 3, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 70); -INSERT INTO `persons` VALUES (56, 2, 4, 4, 2, 1, 1, 3, 1, 4, 7, 4, 10, 3, 1, 0, 5, 4, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 0, 0, 0, 100); -INSERT INTO `persons` VALUES (57, 1, 5, 5, 0, 0, 0, 4, 0, 5, 8, 5, 1, 4, 0, 1, 6, 5, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 40); -INSERT INTO `persons` VALUES (58, 2, 6, 6, 2, 1, 1, 5, 1, 6, 9, 6, 2, 5, 1, 0, 7, 6, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 80); -INSERT INTO `persons` VALUES (59, 1, 7, 7, 1, 0, 0, 6, 0, 7, 8, 7, 3, 6, 0, 1, 8, 7, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 40); -INSERT INTO `persons` VALUES (60, 2, 8, 8, 0, 1, 1, 7, 1, 8, 9, 8, 4, 7, 1, 0, 9, 8, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 100); -INSERT INTO `persons` VALUES (61, 1, 9, 9, 1, 0, 0, 8, 0, 9, 10, 9, 5, 8, 0, 1, 10, 9, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 50); -INSERT INTO `persons` VALUES (62, 2, 1, 10, 0, 1, 1, 9, 1, 10, 1, 8, 6, 9, 1, 1, 1, 10, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (63, 1, 2, 1, 2, 0, 0, 10, 0, 1, 2, 9, 7, 8, 0, 0, 2, 1, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 0, 1, 1, 20); -INSERT INTO `persons` VALUES (64, 2, 3, 2, 0, 1, 1, 11, 1, 2, 3, 10, 8, 9, 1, 1, 3, 2, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 70); -INSERT INTO `persons` VALUES (65, 1, 4, 3, 4, 0, 0, 12, 0, 3, 4, 1, 9, 10, 0, 0, 4, 3, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (66, 2, 5, 4, 2, 1, 1, 13, 1, 4, 5, 2, 8, 1, 1, 1, 5, 4, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 90); -INSERT INTO `persons` VALUES (67, 1, 6, 5, 0, 0, 0, 1, 0, 5, 6, 3, 9, 4, 0, 0, 6, 5, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (68, 2, 7, 6, 3, 0, 0, 2, 0, 6, 7, 4, 10, 5, 0, 1, 8, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (69, 1, 8, 7, 5, 1, 1, 3, 1, 7, 8, 5, 1, 6, 1, 0, 9, 7, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (70, 2, 9, 8, 1, 0, 0, 4, 0, 8, 9, 6, 2, 7, 0, 1, 10, 8, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (71, 1, 10, 9, 2, 1, 1, 5, 1, 9, 8, 7, 3, 8, 1, 0, 1, 9, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 30); -INSERT INTO `persons` VALUES (72, 2, 1, 10, 0, 0, 0, 6, 0, 10, 9, 8, 4, 9, 0, 0, 2, 6, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 20); -INSERT INTO `persons` VALUES (73, 1, 2, 1, 2, 1, 1, 7, 1, 1, 10, 9, 5, 8, 1, 1, 3, 7, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (74, 2, 3, 2, 1, 0, 0, 8, 0, 2, 1, 8, 6, 9, 0, 0, 4, 8, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (75, 1, 4, 3, 0, 1, 1, 9, 1, 3, 2, 9, 7, 10, 1, 1, 5, 9, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 50); -INSERT INTO `persons` VALUES (76, 2, 5, 4, 1, 0, 0, 10, 0, 4, 3, 10, 8, 1, 0, 0, 6, 10, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (21, 2, 6, 5, 0, 1, 1, 11, 1, 5, 4, 1, 9, 2, 1, 1, 7, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 70); -INSERT INTO `persons` VALUES (22, 1, 7, 6, 2, 0, 0, 12, 0, 6, 5, 2, 8, 3, 0, 0, 8, 2, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (23, 2, 8, 7, 0, 1, 1, 13, 1, 7, 6, 3, 9, 4, 1, 1, 9, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (24, 1, 9, 8, 4, 0, 0, 1, 0, 8, 7, 4, 10, 5, 0, 0, 10, 4, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (25, 2, 10, 9, 2, 1, 1, 2, 1, 9, 8, 5, 1, 6, 1, 1, 1, 5, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (26, 1, 1, 10, 0, 0, 0, 3, 0, 10, 9, 6, 2, 7, 0, 0, 2, 6, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (27, 2, 2, 1, 3, 0, 0, 4, 0, 1, 8, 7, 3, 8, 0, 1, 3, 8, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 50); -INSERT INTO `persons` VALUES (28, 1, 3, 2, 5, 1, 1, 5, 1, 2, 9, 8, 4, 9, 1, 0, 4, 9, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (29, 2, 4, 3, 1, 0, 0, 6, 0, 3, 10, 9, 5, 8, 0, 1, 5, 10, 0, 1, 0, 1, 3, 0, 0, 1, 0, 1, 0, 1, 0, 20); -INSERT INTO `persons` VALUES (30, 1, 5, 4, 2, 1, 1, 7, 1, 4, 1, 8, 6, 9, 1, 0, 6, 1, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 70); -INSERT INTO `persons` VALUES (31, 2, 6, 5, 0, 0, 0, 8, 0, 5, 2, 9, 7, 10, 0, 0, 8, 2, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (32, 1, 7, 6, 2, 1, 1, 9, 1, 6, 3, 10, 8, 1, 1, 1, 9, 3, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 90); -INSERT INTO `persons` VALUES (33, 2, 8, 7, 1, 0, 0, 10, 0, 7, 4, 1, 3, 2, 0, 0, 10, 4, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 80); -INSERT INTO `persons` VALUES (34, 1, 9, 8, 0, 1, 1, 11, 1, 8, 5, 2, 4, 3, 1, 1, 1, 5, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (35, 2, 10, 9, 1, 0, 0, 12, 0, 9, 6, 3, 5, 4, 0, 0, 2, 6, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 100); -INSERT INTO `persons` VALUES (36, 1, 1, 10, 0, 1, 1, 13, 1, 10, 7, 4, 6, 5, 1, 1, 3, 7, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 40); -INSERT INTO `persons` VALUES (37, 2, 2, 1, 2, 0, 0, 1, 0, 1, 8, 5, 7, 6, 0, 0, 4, 8, 0, 1, 0, 1, 3, 1, 0, 1, 0, 1, 0, 1, 0, 30); -INSERT INTO `persons` VALUES (38, 2, 3, 2, 0, 1, 1, 2, 1, 2, 9, 6, 8, 7, 1, 1, 5, 9, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 20); -INSERT INTO `persons` VALUES (39, 1, 4, 3, 4, 0, 0, 3, 0, 3, 8, 7, 9, 8, 0, 0, 6, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (40, 2, 5, 4, 2, 1, 1, 4, 1, 4, 9, 8, 8, 3, 1, 1, 7, 7, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (41, 1, 1, 5, 0, 0, 0, 5, 0, 5, 10, 9, 9, 4, 0, 0, 8, 8, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (42, 2, 2, 6, 3, 0, 0, 6, 0, 6, 1, 8, 10, 5, 0, 1, 9, 9, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (43, 1, 3, 7, 5, 1, 1, 7, 1, 7, 2, 9, 1, 6, 1, 0, 10, 10, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 70); -INSERT INTO `persons` VALUES (44, 2, 4, 8, 1, 0, 0, 8, 0, 8, 3, 10, 2, 7, 0, 1, 1, 1, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (39, 1, 5, 9, 2, 1, 1, 9, 1, 9, 4, 1, 3, 8, 1, 0, 2, 2, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (40, 2, 6, 10, 0, 0, 0, 10, 0, 10, 5, 2, 4, 9, 0, 0, 3, 9, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (41, 1, 7, 1, 2, 1, 1, 11, 1, 1, 6, 3, 5, 8, 1, 1, 4, 10, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (42, 2, 8, 2, 1, 0, 0, 12, 0, 2, 7, 4, 6, 9, 0, 0, 5, 1, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (43, 1, 9, 3, 0, 1, 1, 13, 1, 3, 8, 5, 7, 10, 1, 1, 6, 2, 0, 0, 0, 1, 4, 0, 0, 0, 0, 1, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (44, 2, 10, 4, 1, 0, 0, 7, 0, 4, 9, 6, 8, 1, 0, 0, 8, 3, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (45, 1, 1, 5, 0, 1, 1, 8, 1, 5, 5, 7, 9, 2, 1, 1, 9, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 20); -INSERT INTO `persons` VALUES (46, 2, 2, 6, 2, 0, 0, 9, 0, 6, 6, 8, 8, 3, 0, 0, 10, 5, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 70); -INSERT INTO `persons` VALUES (47, 1, 3, 7, 0, 1, 1, 10, 1, 7, 7, 9, 9, 4, 1, 1, 1, 6, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (48, 2, 4, 8, 4, 0, 0, 11, 0, 8, 8, 8, 10, 5, 0, 0, 2, 8, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 90); -INSERT INTO `persons` VALUES (49, 1, 5, 9, 2, 1, 1, 12, 1, 9, 9, 9, 1, 6, 1, 1, 3, 9, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 80); -INSERT INTO `persons` VALUES (20, 1, 1, 1, 3, 0, 0, 1, 0, 1, 8, 2, 3, 4, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 80); -INSERT INTO `persons` VALUES (21, 2, 2, 2, 5, 1, 1, 2, 1, 2, 9, 3, 4, 5, 1, 0, 2, 2, 1, 1, 1, 0, 2, 0, 1, 1, 1, 0, 1, 1, 1, 30); -INSERT INTO `persons` VALUES (22, 1, 3, 3, 1, 0, 0, 3, 0, 3, 10, 4, 5, 6, 0, 1, 3, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (23, 2, 4, 4, 2, 1, 1, 4, 1, 4, 1, 5, 6, 7, 1, 0, 4, 4, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 1, 1, 1, 70); -INSERT INTO `persons` VALUES (24, 1, 5, 5, 0, 0, 0, 5, 0, 5, 2, 6, 7, 8, 0, 1, 5, 5, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (25, 2, 6, 6, 2, 1, 1, 6, 1, 6, 3, 7, 8, 9, 1, 0, 6, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 40); -INSERT INTO `persons` VALUES (26, 1, 7, 7, 1, 0, 0, 7, 0, 7, 4, 8, 9, 8, 0, 1, 7, 7, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 10); -INSERT INTO `persons` VALUES (27, 2, 8, 8, 0, 1, 1, 8, 1, 8, 5, 9, 8, 9, 1, 0, 8, 8, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 20); -INSERT INTO `persons` VALUES (28, 1, 9, 9, 1, 0, 0, 9, 0, 9, 6, 8, 9, 10, 0, 1, 9, 9, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 60); -INSERT INTO `persons` VALUES (29, 2, 10, 10, 0, 1, 1, 10, 1, 10, 7, 9, 10, 1, 1, 0, 10, 10, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 50); -INSERT INTO `persons` VALUES (30, 1, 1, 1, 2, 0, 0, 11, 0, 1, 8, 10, 1, 2, 0, 0, 1, 2, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 100); -INSERT INTO `persons` VALUES (31, 2, 2, 2, 0, 1, 1, 12, 1, 2, 9, 1, 2, 3, 1, 1, 2, 3, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 40); -INSERT INTO `persons` VALUES (32, 1, 3, 3, 4, 0, 0, 13, 0, 3, 8, 2, 3, 4, 0, 0, 3, 4, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 70); -INSERT INTO `persons` VALUES (33, 2, 4, 4, 2, 1, 1, 1, 1, 4, 9, 3, 4, 5, 1, 1, 4, 5, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 90); -INSERT INTO `persons` VALUES (34, 1, 5, 5, 0, 0, 0, 2, 0, 5, 10, 4, 5, 6, 0, 0, 5, 6, 1, 0, 0, 0, 3, 1, 1, 0, 0, 0, 1, 0, 0, 30); -INSERT INTO `persons` VALUES (35, 2, 6, 6, 3, 0, 0, 3, 0, 6, 1, 5, 6, 7, 0, 1, 6, 7, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (36, 1, 7, 7, 5, 1, 1, 4, 1, 7, 2, 6, 7, 8, 1, 0, 7, 8, 1, 1, 1, 0, 2, 1, 1, 1, 1, 0, 1, 1, 1, 70); -INSERT INTO `persons` VALUES (37, 2, 8, 8, 1, 0, 0, 5, 0, 8, 3, 7, 8, 9, 0, 1, 8, 9, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (38, 1, 9, 9, 2, 1, 1, 6, 1, 9, 4, 8, 9, 8, 1, 0, 9, 10, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 1, 1, 1, 30); -INSERT INTO `persons` VALUES (39, 2, 10, 10, 0, 0, 0, 7, 0, 10, 5, 9, 8, 9, 0, 1, 10, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0); -INSERT INTO `persons` VALUES (40, 1, 1, 1, 2, 1, 1, 8, 1, 1, 6, 8, 9, 10, 1, 0, 1, 2, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (41, 2, 2, 2, 1, 0, 0, 9, 0, 2, 7, 9, 10, 1, 0, 1, 2, 3, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 30); -INSERT INTO `persons` VALUES (42, 1, 3, 3, 0, 1, 1, 10, 1, 3, 8, 10, 1, 2, 1, 0, 3, 4, 0, 1, 1, 1, 4, 0, 0, 1, 1, 1, 0, 1, 1, 20); -INSERT INTO `persons` VALUES (43, 2, 4, 4, 1, 0, 0, 11, 0, 4, 9, 1, 2, 3, 0, 1, 4, 5, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 60); -INSERT INTO `persons` VALUES (44, 1, 5, 5, 0, 1, 1, 12, 1, 5, 8, 2, 3, 4, 1, 0, 5, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (45, 2, 6, 6, 2, 0, 0, 13, 0, 6, 9, 3, 4, 5, 0, 0, 6, 7, 1, 0, 0, 0, 3, 1, 1, 0, 0, 0, 1, 0, 0, 50); -INSERT INTO `persons` VALUES (46, 1, 7, 7, 0, 1, 1, 1, 1, 7, 10, 4, 5, 6, 1, 1, 7, 8, 0, 1, 1, 0, 4, 1, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (47, 2, 8, 8, 4, 0, 0, 2, 0, 8, 1, 5, 6, 7, 0, 0, 8, 9, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 70); -INSERT INTO `persons` VALUES (48, 1, 9, 9, 2, 1, 1, 3, 1, 9, 2, 6, 7, 8, 1, 1, 9, 10, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (49, 2, 10, 10, 0, 0, 0, 4, 0, 10, 3, 7, 8, 3, 0, 0, 6, 1, 1, 0, 0, 1, 3, 0, 1, 0, 0, 1, 1, 0, 0, 40); -INSERT INTO `persons` VALUES (50, 1, 1, 1, 3, 0, 0, 5, 0, 1, 4, 8, 9, 4, 0, 1, 7, 2, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (51, 2, 2, 2, 5, 1, 1, 6, 1, 2, 5, 9, 8, 5, 1, 0, 8, 3, 1, 0, 0, 1, 2, 0, 1, 0, 0, 1, 1, 0, 0, 40); -INSERT INTO `persons` VALUES (52, 1, 3, 3, 1, 0, 0, 7, 0, 3, 6, 8, 9, 6, 0, 1, 9, 4, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (53, 2, 4, 4, 2, 1, 1, 8, 1, 4, 7, 9, 10, 7, 1, 0, 10, 5, 1, 0, 0, 0, 4, 0, 1, 0, 0, 0, 1, 0, 0, 50); -INSERT INTO `persons` VALUES (54, 1, 5, 5, 0, 0, 0, 9, 0, 5, 8, 10, 1, 8, 0, 1, 1, 6, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (55, 2, 6, 6, 2, 1, 1, 10, 1, 6, 9, 1, 2, 9, 1, 0, 2, 7, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 20); -INSERT INTO `persons` VALUES (56, 1, 7, 7, 1, 0, 0, 11, 0, 7, 8, 2, 3, 8, 0, 1, 3, 8, 1, 1, 1, 0, 3, 1, 1, 1, 1, 0, 1, 1, 1, 70); -INSERT INTO `persons` VALUES (57, 2, 8, 8, 0, 1, 1, 12, 1, 8, 9, 3, 4, 9, 1, 0, 4, 9, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (58, 1, 9, 9, 1, 0, 0, 13, 0, 9, 10, 4, 5, 10, 0, 1, 5, 6, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 90); -INSERT INTO `persons` VALUES (59, 2, 10, 10, 0, 1, 1, 1, 1, 10, 1, 5, 6, 1, 1, 0, 6, 7, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 80); -INSERT INTO `persons` VALUES (60, 1, 1, 1, 2, 0, 0, 2, 0, 1, 2, 6, 7, 2, 0, 0, 8, 8, 1, 0, 1, 1, 3, 0, 1, 0, 1, 1, 1, 0, 1, 60); -INSERT INTO `persons` VALUES (61, 2, 2, 2, 0, 1, 1, 3, 1, 2, 3, 7, 8, 3, 1, 1, 9, 9, 0, 1, 0, 1, 4, 0, 0, 1, 0, 1, 0, 1, 0, 100); -INSERT INTO `persons` VALUES (62, 1, 3, 3, 4, 0, 0, 4, 0, 3, 4, 8, 3, 4, 0, 0, 10, 10, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 40); -INSERT INTO `persons` VALUES (63, 2, 4, 4, 2, 1, 1, 5, 1, 4, 5, 9, 4, 5, 1, 1, 1, 1, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 0, 80); -INSERT INTO `persons` VALUES (64, 1, 5, 5, 0, 0, 0, 6, 0, 5, 6, 8, 5, 6, 0, 0, 2, 2, 1, 0, 1, 0, 3, 1, 1, 0, 1, 0, 1, 0, 1, 30); -INSERT INTO `persons` VALUES (65, 2, 6, 6, 3, 0, 0, 7, 0, 6, 7, 9, 6, 7, 0, 1, 3, 3, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (66, 1, 7, 7, 5, 1, 1, 8, 1, 7, 8, 10, 7, 8, 1, 0, 4, 4, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 1, 0, 1, 70); -INSERT INTO `persons` VALUES (67, 2, 8, 8, 1, 0, 0, 9, 0, 8, 9, 1, 8, 9, 0, 1, 5, 5, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (68, 1, 9, 9, 2, 1, 1, 10, 1, 9, 8, 2, 9, 8, 1, 0, 6, 6, 1, 0, 0, 1, 4, 0, 1, 0, 0, 1, 1, 0, 0, 40); -INSERT INTO `persons` VALUES (69, 2, 10, 10, 0, 0, 0, 11, 0, 10, 9, 3, 8, 9, 0, 1, 7, 8, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 10); -INSERT INTO `persons` VALUES (70, 1, 1, 1, 2, 1, 1, 12, 1, 1, 10, 4, 9, 10, 1, 0, 8, 9, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 20); -INSERT INTO `persons` VALUES (71, 2, 2, 2, 1, 0, 0, 13, 0, 2, 1, 5, 10, 1, 0, 1, 9, 10, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (72, 1, 3, 3, 0, 1, 1, 1, 1, 3, 2, 6, 1, 4, 1, 0, 6, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (73, 2, 4, 4, 1, 0, 0, 2, 0, 4, 3, 7, 2, 5, 0, 1, 7, 2, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (74, 1, 5, 5, 0, 1, 1, 3, 1, 5, 4, 8, 3, 6, 1, 0, 8, 3, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (75, 2, 6, 6, 2, 0, 0, 4, 0, 6, 5, 9, 4, 7, 0, 0, 9, 4, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 70); -INSERT INTO `persons` VALUES (76, 1, 7, 7, 0, 1, 1, 5, 1, 7, 6, 8, 5, 8, 1, 1, 10, 5, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 0, 0, 0, 90); -INSERT INTO `persons` VALUES (20, 2, 8, 8, 4, 0, 0, 6, 0, 8, 7, 9, 6, 9, 0, 0, 1, 6, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 30); -INSERT INTO `persons` VALUES (21, 1, 9, 9, 2, 1, 1, 7, 1, 9, 8, 10, 7, 8, 1, 1, 2, 7, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (22, 2, 10, 10, 0, 0, 0, 8, 0, 10, 9, 1, 8, 9, 0, 0, 9, 8, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 70); -INSERT INTO `persons` VALUES (23, 1, 1, 1, 3, 0, 0, 9, 0, 1, 8, 2, 9, 10, 0, 1, 10, 9, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (24, 2, 2, 2, 5, 1, 1, 10, 1, 2, 9, 3, 8, 1, 1, 0, 1, 6, 0, 1, 1, 0, 2, 0, 0, 1, 1, 0, 0, 1, 1, 30); -INSERT INTO `persons` VALUES (25, 1, 3, 3, 1, 0, 0, 11, 0, 3, 10, 4, 9, 2, 0, 1, 2, 7, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0); -INSERT INTO `persons` VALUES (26, 2, 4, 4, 2, 1, 1, 12, 1, 4, 1, 5, 10, 3, 1, 0, 3, 8, 0, 1, 1, 0, 4, 1, 0, 1, 1, 0, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (27, 1, 5, 5, 0, 0, 0, 13, 0, 5, 2, 6, 1, 4, 0, 1, 4, 9, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 30); -INSERT INTO `persons` VALUES (28, 2, 6, 6, 2, 1, 1, 1, 1, 6, 3, 7, 2, 5, 1, 0, 5, 10, 0, 1, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 1, 20); -INSERT INTO `persons` VALUES (29, 1, 7, 7, 1, 0, 0, 2, 0, 7, 4, 8, 3, 6, 0, 1, 6, 1, 0, 0, 0, 1, 3, 0, 0, 0, 0, 1, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (30, 2, 8, 8, 0, 1, 1, 3, 1, 8, 5, 9, 4, 7, 1, 0, 8, 2, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (31, 1, 9, 9, 1, 0, 0, 4, 0, 9, 6, 8, 5, 8, 0, 1, 9, 9, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 50); -INSERT INTO `persons` VALUES (32, 2, 10, 10, 0, 1, 1, 5, 1, 10, 7, 9, 6, 9, 1, 0, 10, 10, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (33, 1, 1, 1, 2, 0, 0, 6, 0, 1, 8, 10, 7, 8, 0, 0, 1, 1, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 70); -INSERT INTO `persons` VALUES (34, 2, 2, 2, 0, 1, 1, 7, 1, 2, 9, 1, 8, 9, 1, 1, 2, 2, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (35, 1, 3, 3, 4, 0, 0, 8, 0, 3, 8, 2, 9, 10, 0, 0, 3, 3, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (36, 2, 4, 4, 2, 1, 1, 9, 1, 4, 9, 3, 8, 1, 1, 1, 4, 4, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 80); -INSERT INTO `persons` VALUES (37, 1, 5, 5, 0, 0, 0, 10, 0, 5, 10, 4, 9, 2, 0, 0, 5, 5, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (38, 2, 6, 6, 3, 0, 0, 11, 0, 6, 1, 5, 10, 3, 0, 1, 6, 6, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (39, 1, 7, 7, 5, 1, 1, 12, 1, 7, 2, 6, 1, 4, 1, 0, 7, 8, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 0, 50); -INSERT INTO `persons` VALUES (40, 2, 8, 8, 1, 0, 0, 13, 0, 8, 3, 7, 2, 5, 0, 1, 8, 9, 0, 0, 1, 1, 3, 0, 0, 0, 1, 1, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (41, 1, 9, 9, 2, 1, 1, 1, 1, 9, 4, 8, 3, 6, 1, 0, 9, 10, 0, 1, 0, 1, 4, 0, 0, 1, 0, 1, 0, 1, 0, 20); -INSERT INTO `persons` VALUES (42, 2, 10, 10, 0, 0, 0, 2, 0, 10, 5, 2, 4, 7, 0, 1, 10, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 70); -INSERT INTO `persons` VALUES (43, 1, 1, 1, 2, 1, 1, 3, 1, 1, 6, 3, 5, 8, 1, 0, 1, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (44, 2, 2, 2, 1, 0, 0, 4, 0, 2, 7, 4, 6, 3, 0, 1, 2, 2, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 90); -INSERT INTO `persons` VALUES (45, 1, 3, 3, 0, 1, 1, 5, 1, 3, 8, 5, 7, 4, 1, 0, 3, 3, 0, 0, 1, 0, 4, 1, 0, 0, 1, 0, 0, 0, 1, 80); -INSERT INTO `persons` VALUES (46, 2, 4, 4, 1, 0, 0, 6, 0, 4, 9, 6, 8, 5, 0, 1, 4, 4, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (47, 1, 5, 5, 0, 1, 1, 7, 1, 5, 8, 7, 3, 6, 1, 0, 5, 5, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (48, 2, 6, 6, 2, 0, 0, 8, 0, 6, 9, 8, 4, 7, 0, 0, 6, 6, 0, 1, 0, 1, 3, 0, 0, 1, 0, 1, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (49, 1, 7, 7, 0, 1, 1, 9, 1, 7, 10, 9, 5, 8, 1, 1, 8, 7, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 30); -INSERT INTO `persons` VALUES (50, 2, 8, 8, 4, 0, 0, 10, 0, 8, 1, 8, 6, 9, 0, 0, 9, 8, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 20); -INSERT INTO `persons` VALUES (51, 1, 9, 9, 2, 1, 1, 11, 1, 9, 2, 9, 7, 8, 1, 1, 10, 9, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (52, 2, 10, 10, 0, 0, 0, 12, 0, 10, 3, 10, 8, 9, 0, 0, 1, 10, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (53, 1, 1, 1, 3, 0, 0, 13, 0, 1, 4, 1, 9, 10, 0, 1, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 50); -INSERT INTO `persons` VALUES (54, 2, 2, 2, 5, 1, 1, 1, 1, 2, 5, 2, 8, 1, 1, 0, 3, 2, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (55, 1, 3, 3, 1, 0, 0, 2, 0, 3, 6, 3, 9, 2, 0, 1, 4, 3, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 70); -INSERT INTO `persons` VALUES (56, 2, 4, 4, 2, 1, 1, 3, 1, 4, 7, 4, 10, 3, 1, 0, 5, 4, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 0, 0, 0, 100); -INSERT INTO `persons` VALUES (57, 1, 5, 5, 0, 0, 0, 4, 0, 5, 8, 5, 1, 4, 0, 1, 6, 5, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 40); -INSERT INTO `persons` VALUES (58, 2, 6, 6, 2, 1, 1, 5, 1, 6, 9, 6, 2, 5, 1, 0, 7, 6, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 80); -INSERT INTO `persons` VALUES (59, 1, 7, 7, 1, 0, 0, 6, 0, 7, 8, 7, 3, 6, 0, 1, 8, 7, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 40); -INSERT INTO `persons` VALUES (60, 2, 8, 8, 0, 1, 1, 7, 1, 8, 9, 8, 4, 7, 1, 0, 9, 8, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 100); -INSERT INTO `persons` VALUES (61, 1, 9, 9, 1, 0, 0, 8, 0, 9, 10, 9, 5, 8, 0, 1, 10, 9, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 50); -INSERT INTO `persons` VALUES (62, 2, 1, 10, 0, 1, 1, 9, 1, 10, 1, 8, 6, 9, 1, 1, 1, 10, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (63, 1, 2, 1, 2, 0, 0, 10, 0, 1, 2, 9, 7, 8, 0, 0, 2, 1, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 0, 1, 1, 20); -INSERT INTO `persons` VALUES (64, 2, 3, 2, 0, 1, 1, 11, 1, 2, 3, 10, 8, 9, 1, 1, 3, 2, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 70); -INSERT INTO `persons` VALUES (65, 1, 4, 3, 4, 0, 0, 12, 0, 3, 4, 1, 9, 10, 0, 0, 4, 3, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (66, 2, 5, 4, 2, 1, 1, 13, 1, 4, 5, 2, 8, 1, 1, 1, 5, 4, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 90); -INSERT INTO `persons` VALUES (67, 1, 6, 5, 0, 0, 0, 1, 0, 5, 6, 3, 9, 4, 0, 0, 6, 5, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (68, 2, 7, 6, 3, 0, 0, 2, 0, 6, 7, 4, 10, 5, 0, 1, 8, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (69, 1, 8, 7, 5, 1, 1, 3, 1, 7, 8, 5, 1, 6, 1, 0, 9, 7, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (70, 2, 9, 8, 1, 0, 0, 4, 0, 8, 9, 6, 2, 7, 0, 1, 10, 8, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 40); -INSERT INTO `persons` VALUES (71, 1, 10, 9, 2, 1, 1, 5, 1, 9, 8, 7, 3, 8, 1, 0, 1, 9, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 30); -INSERT INTO `persons` VALUES (72, 2, 1, 10, 0, 0, 0, 6, 0, 10, 9, 8, 4, 9, 0, 0, 2, 6, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 20); -INSERT INTO `persons` VALUES (73, 1, 2, 1, 2, 1, 1, 7, 1, 1, 10, 9, 5, 8, 1, 1, 3, 7, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (74, 2, 3, 2, 1, 0, 0, 8, 0, 2, 1, 8, 6, 9, 0, 0, 4, 8, 0, 1, 0, 0, 3, 1, 0, 1, 0, 0, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (75, 1, 4, 3, 0, 1, 1, 9, 1, 3, 2, 9, 7, 10, 1, 1, 5, 9, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 50); -INSERT INTO `persons` VALUES (76, 2, 5, 4, 1, 0, 0, 10, 0, 4, 3, 10, 8, 1, 0, 0, 6, 10, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (21, 2, 6, 5, 0, 1, 1, 11, 1, 5, 4, 1, 9, 2, 1, 1, 7, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 70); -INSERT INTO `persons` VALUES (22, 1, 7, 6, 2, 0, 0, 12, 0, 6, 5, 2, 8, 3, 0, 0, 8, 2, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (23, 2, 8, 7, 0, 1, 1, 13, 1, 7, 6, 3, 9, 4, 1, 1, 9, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (24, 1, 9, 8, 4, 0, 0, 1, 0, 8, 7, 4, 10, 5, 0, 0, 10, 4, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (25, 2, 10, 9, 2, 1, 1, 2, 1, 9, 8, 5, 1, 6, 1, 1, 1, 5, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (26, 1, 1, 10, 0, 0, 0, 3, 0, 10, 9, 6, 2, 7, 0, 0, 2, 6, 0, 0, 1, 0, 3, 1, 0, 0, 1, 0, 0, 0, 1, 100); -INSERT INTO `persons` VALUES (27, 2, 2, 1, 3, 0, 0, 4, 0, 1, 8, 7, 3, 8, 0, 1, 3, 8, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 50); -INSERT INTO `persons` VALUES (28, 1, 3, 2, 5, 1, 1, 5, 1, 2, 9, 8, 4, 9, 1, 0, 4, 9, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (29, 2, 4, 3, 1, 0, 0, 6, 0, 3, 10, 9, 5, 8, 0, 1, 5, 10, 0, 1, 0, 1, 3, 0, 0, 1, 0, 1, 0, 1, 0, 20); -INSERT INTO `persons` VALUES (30, 1, 5, 4, 2, 1, 1, 7, 1, 4, 1, 8, 6, 9, 1, 0, 6, 1, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 70); -INSERT INTO `persons` VALUES (31, 2, 6, 5, 0, 0, 0, 8, 0, 5, 2, 9, 7, 10, 0, 0, 8, 2, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 60); -INSERT INTO `persons` VALUES (32, 1, 7, 6, 2, 1, 1, 9, 1, 6, 3, 10, 8, 1, 1, 1, 9, 3, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 90); -INSERT INTO `persons` VALUES (33, 2, 8, 7, 1, 0, 0, 10, 0, 7, 4, 1, 3, 2, 0, 0, 10, 4, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 80); -INSERT INTO `persons` VALUES (34, 1, 9, 8, 0, 1, 1, 11, 1, 8, 5, 2, 4, 3, 1, 1, 1, 5, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 60); -INSERT INTO `persons` VALUES (35, 2, 10, 9, 1, 0, 0, 12, 0, 9, 6, 3, 5, 4, 0, 0, 2, 6, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 100); -INSERT INTO `persons` VALUES (36, 1, 1, 10, 0, 1, 1, 13, 1, 10, 7, 4, 6, 5, 1, 1, 3, 7, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 40); -INSERT INTO `persons` VALUES (37, 2, 2, 1, 2, 0, 0, 1, 0, 1, 8, 5, 7, 6, 0, 0, 4, 8, 0, 1, 0, 1, 3, 1, 0, 1, 0, 1, 0, 1, 0, 30); -INSERT INTO `persons` VALUES (38, 2, 3, 2, 0, 1, 1, 2, 1, 2, 9, 6, 8, 7, 1, 1, 5, 9, 0, 0, 1, 1, 4, 0, 0, 0, 1, 1, 0, 0, 1, 20); -INSERT INTO `persons` VALUES (39, 1, 4, 3, 4, 0, 0, 3, 0, 3, 8, 7, 9, 8, 0, 0, 6, 6, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (40, 2, 5, 4, 2, 1, 1, 4, 1, 4, 9, 8, 8, 3, 1, 1, 7, 7, 0, 1, 1, 1, 2, 0, 0, 1, 1, 1, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (41, 1, 1, 5, 0, 0, 0, 5, 0, 5, 10, 9, 9, 4, 0, 0, 8, 8, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (42, 2, 2, 6, 3, 0, 0, 6, 0, 6, 1, 8, 10, 5, 0, 1, 9, 9, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (43, 1, 3, 7, 5, 1, 1, 7, 1, 7, 2, 9, 1, 6, 1, 0, 10, 10, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 70); -INSERT INTO `persons` VALUES (44, 2, 4, 8, 1, 0, 0, 8, 0, 8, 3, 10, 2, 7, 0, 1, 1, 1, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (39, 1, 5, 9, 2, 1, 1, 9, 1, 9, 4, 1, 3, 8, 1, 0, 2, 2, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (40, 2, 6, 10, 0, 0, 0, 10, 0, 10, 5, 2, 4, 9, 0, 0, 3, 9, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 80); -INSERT INTO `persons` VALUES (41, 1, 7, 1, 2, 1, 1, 11, 1, 1, 6, 3, 5, 8, 1, 1, 4, 10, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 40); -INSERT INTO `persons` VALUES (42, 2, 8, 2, 1, 0, 0, 12, 0, 2, 7, 4, 6, 9, 0, 0, 5, 1, 0, 1, 1, 1, 3, 0, 0, 1, 1, 1, 0, 1, 1, 100); -INSERT INTO `persons` VALUES (43, 1, 9, 3, 0, 1, 1, 13, 1, 3, 8, 5, 7, 10, 1, 1, 6, 2, 0, 0, 0, 1, 4, 0, 0, 0, 0, 1, 0, 0, 0, 50); -INSERT INTO `persons` VALUES (44, 2, 10, 4, 1, 0, 0, 7, 0, 4, 9, 6, 8, 1, 0, 0, 8, 3, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 60); -INSERT INTO `persons` VALUES (45, 1, 1, 5, 0, 1, 1, 8, 1, 5, 5, 7, 9, 2, 1, 1, 9, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 20); -INSERT INTO `persons` VALUES (46, 2, 2, 6, 2, 0, 0, 9, 0, 6, 6, 8, 8, 3, 0, 0, 10, 5, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 0, 1, 1, 70); -INSERT INTO `persons` VALUES (47, 1, 3, 7, 0, 1, 1, 10, 1, 7, 7, 9, 9, 4, 1, 1, 1, 6, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 60); -INSERT INTO `persons` VALUES (48, 2, 4, 8, 4, 0, 0, 11, 0, 8, 8, 8, 10, 5, 0, 0, 2, 8, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 90); -INSERT INTO `persons` VALUES (49, 1, 5, 9, 2, 1, 1, 12, 1, 9, 9, 9, 1, 6, 1, 1, 3, 9, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 80); - -SET FOREIGN_KEY_CHECKS = 1; +INSERT INTO `clients` VALUES (1, 'Joe', 25, '1', 6, 2, '1', '1', '1', '5', '1', 7, 6, 5, 4, 6, '1', '1', '3', '4', '1', '1', '1', '1', 12, '1'); +INSERT INTO `clients` VALUES (2, 'Mike', 32, '2', 10, 5, '2', '0', '0', '8', '0', 8, 9, 7, 6, 7, '0', '0', '2', '2', '0', '0', '0', '0', 8, '0'); +INSERT INTO `clients` VALUES (3, 'Leo', 24, '1', 2, 1, '3', '1', '1', '3', '1', 6, 4, 6, 5, 4, '1', '1', '5', '3', '1', '1', '1', '1', 10, '1'); +INSERT INTO `clients` VALUES (4, 'Alice', 29, '2', 7, 3, '0', '0', '0', '4', '0', 7, 8, 5, 7, 9, '0', '0', '6', '5', '0', '0', '0', '0', 6, '0'); +INSERT INTO `clients` VALUES (5, 'Clara', 31, '1', 5, 4, '4', '1', '1', '7', '1', 6, 5, 4, 8, 6, '1', '1', '4', '7', '1', '1', '1', '1', 15, '1'); +INSERT INTO `clients` VALUES (6, 'Ella', 22, '2', 1, 0, '1', '0', '0', '2', '0', 7, 8, 6, 7, 5, '0', '0', '2', '1', '0', '0', '0', '0', 5, '0'); +INSERT INTO `clients` VALUES (7, 'Bella', 34, '1', 12, 6, '3', '1', '1', '10', '1', 9, 8, 10, 9, 9, '1', '1', '7', '6', '1', '1', '1', '1', 0, '1'); +INSERT INTO `clients` VALUES (8, 'Diana', 26, '2', 4, 2, '2', '1', '1', '3', '1', 5, 7, 6, 5, 8, '1', '1', '5', '3', '1', '1', '1', '1', 9, '1'); +INSERT INTO `clients` VALUES (9, 'Fiona', 30, '1', 8, 3, '0', '0', '0', '6', '0', 10, 9, 8, 6, 7, '0', '0', '3', '2', '0', '0', '0', '0', 3, '0'); +INSERT INTO `clients` VALUES (10, 'Grace', 27, '2', 6, 5, '1', '1', '1', '5', '1', 8, 6, 7, 8, 6, '1', '1', '1', '4', '1', '1', '1', '1', 4, '1'); +INSERT INTO `clients` VALUES (11, 'India', 25, '1', 3, 1, '2', '0', '0', '4', '0', 6, 5, 4, 6, 5, '0', '0', '3', '3', '0', '0', '0', '0', '0', 7, '0'); +INSERT INTO `clients` VALUES (12, 'Karen', 33, '2', 10, 7, '0', '1', '1', '9', '1', 9, 10, 8, 9, 10, '1', '1', '8', '7', '1', '1', '1', '1', 2, '1'); +INSERT INTO `clients` VALUES (13, 'Hannah', 20, '1', 1, 0, '1', '0', '0', '1', '0', 5, 3, 5, 4, 3, '0', '0', '2', '1', '0', '0', '0', '0', 14, '0'); +INSERT INTO `clients` VALUES (14, 'Julia', 36, '2', 11, 6, '2', '1', '1', '8', '1', 10, 9, 10, 8, 9, '1', '1', '5', '6', '1', '1', '1', '1', 1, '1'); +INSERT INTO `clients` VALUES (15, 'Luna', 29, '1', 5, 2, '4', '1', '1', '5', '1', 8, 7, 6, 6, 8, '1', '1', '7', '5', '1', '1', '1', '1', 11, '1'); +INSERT INTO `clients` VALUES (16, 'Mia', 23, '2', 2, 1, '1', '0', '0', '3', '0', 7, 6, 7, 5, 6, '0', '0', '4', '2', '0', '0', '0', '0', '0', 10, '0'); +INSERT INTO `clients` VALUES (17, 'Olivia', 35, '1', 8, 4, '3', '1', '1', '7', '1', 9, 10, 9, 8, 9, '1', '1', '3', '6', '1', '1', '1', '1', 6, '1'); +INSERT INTO `clients` VALUES (18, 'Qiana', 28, '2', 6, 2, '0', '0', '0', '6', '0', 6, 8, 5, 7, 7, '0', '0', '1', '4', '0', '0', '0', '0', 12, '0'); +INSERT INTO `clients` VALUES (19, 'Nora', 21, '1', 2, 0, '2', '1', '1', '2', '1', 5, 4, 6, 3, 5, '1', '1', '2', '2', '1', '1', '1', '1', 13, '1'); +INSERT INTO `clients` VALUES (20, 'Poppy', 24, '2', 3, 1, '0', '0', '0', '3', '0', 6, 5, 7, 6, 6, '0', '0', '3', '3', '0', '0', '0', '0', 16, '0'); From 49f5fd4ca798668204df95fd5dd3a46b6645c015 Mon Sep 17 00:00:00 2001 From: Zheng Qiao <109362533+BossJoeZz@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:07:21 -0800 Subject: [PATCH 40/40] Update and rename fastapi.sql to data_source.sql --- app/clients/{fastapi.sql => data_source.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/clients/{fastapi.sql => data_source.sql} (100%) diff --git a/app/clients/fastapi.sql b/app/clients/data_source.sql similarity index 100% rename from app/clients/fastapi.sql rename to app/clients/data_source.sql