content
stringlengths
7
1.05M
def insertData(db): db.insert("RESTRICTION",('Titanic',1997,'M','Australia')) db.insert("RESTRICTION",('Titanic',1997,'KT','Belgium')) db.insert("RESTRICTION",('Titanic',1997,'TE','Chile')) db.insert("RESTRICTION",('Titanic',1997,'K-12','Finland')) db.insert("RESTRICTION",('Titanic',1997,'U','France')) db.insert("RESTRICTION",('Titanic',1997,'12(w)','Germany')) db.insert("RESTRICTION",('Titanic',1997,'IIA','HongKong')) db.insert("RESTRICTION",('Titanic',1997,'12','UK')) db.insert("RESTRICTION",('Shakespeare_in_Love',1998,'M','Australia')) db.insert("RESTRICTION",('Shakespeare_in_Love',1998,'U','France')) db.insert("RESTRICTION",('Shakespeare_in_Love',1998,'6(bw)','Germany')) db.insert("RESTRICTION",('Shakespeare_in_Love',1998,'M','New_Zealand')) db.insert("RESTRICTION",('The_Cider_House_Rules',1999,'M','Australia')) db.insert("RESTRICTION",('The_Cider_House_Rules',1999,'K-12','Finland')) db.insert("RESTRICTION",('The_Cider_House_Rules',1999,'M','New_Zealand')) db.insert("RESTRICTION",('The_Cider_House_Rules',1999,'U','France')) db.insert("RESTRICTION",('The_Cider_House_Rules',1999,'12','Germany')) db.insert("RESTRICTION",('The_Price_of_Milk',2000,'M','New_Zealand')) db.insert("RESTRICTION",('The_Price_of_Milk',2000,'PG-13','USA')) db.insert("RESTRICTION",('Topless_Women_Talk_About_Their_Lives',1997,'M','Australia')) db.insert("RESTRICTION",('The_Piano',1993,'M','Australia')) db.insert("RESTRICTION",('The_Piano',1993,'R','USA')) db.insert("RESTRICTION",('Mad_Max',1979,'R','USA')) db.insert("RESTRICTION",('Mad_Max',1979,'R','Australia')) db.insert("RESTRICTION",('Strictly_Ballroom',1992,'PG','Australia')) db.insert("RESTRICTION",('Strictly_Ballroom',1992,'PG','USA')) db.insert("RESTRICTION",('My_Mother_Frank',2000,'M','Australia')) db.insert("RESTRICTION",('My_Mother_Frank',2000,'M','New_Zealand')) db.insert("RESTRICTION",('American_Psycho',2000,'R18','New_Zealand')) db.insert("RESTRICTION",('American_Psycho',2000,'R','Australia')) db.insert("RESTRICTION",('American_Psycho',2000,'R','USA')) db.insert("RESTRICTION",('Scream_2',1997,'R','USA')) db.insert("RESTRICTION",('Scream_3',2000,'R','USA')) db.insert("RESTRICTION",('Scream_3',2000,'R18','New_Zealand')) db.insert("RESTRICTION",('Traffic',2000,'R','USA')) db.insert("RESTRICTION",('Traffic',2000,'M','Australia')) db.insert("RESTRICTION",('Psycho',1960,'M','Australia')) db.insert("RESTRICTION",('Psycho',1960,'R','USA')) db.insert("RESTRICTION",('I_Know_What_You_Did_Last_Summer',1997,'M','Australia')) db.insert("RESTRICTION",('I_Know_What_You_Did_Last_Summer',1997,'R','USA')) db.insert("RESTRICTION",('Cruel_Intentions',1999,'R','USA')) db.insert("RESTRICTION",('Cruel_Intentions',1999,'M','Australia')) db.insert("RESTRICTION",('Wild_Things',1998,'M','Australia')) db.insert("RESTRICTION",('Wild_Things',1998,'R','USA')) db.insert("RESTRICTION",('Alien',1979,'M','Australia')) db.insert("RESTRICTION",('Alien',1979,'R','USA')) db.insert("RESTRICTION",('Aliens',1986,'M','Australia')) db.insert("RESTRICTION",('Aliens',1986,'R','USA')) db.insert("RESTRICTION",('Alien_3',1992,'M','Australia')) db.insert("RESTRICTION",('Alien_3',1992,'R','USA')) db.insert("RESTRICTION",('Alien:_Resurrection',1997,'M','Australia')) db.insert("RESTRICTION",('Alien:_Resurrection',1997,'R','USA')) db.insert("RESTRICTION",('Gladiator',2000,'M','Australia')) db.insert("RESTRICTION",('Gladiator',2000,'R','USA')) db.insert("RESTRICTION",('The_World_Is_Not_Enough',1999,'PG-13','USA')) db.insert("RESTRICTION",('The_World_Is_Not_Enough',1999,'M','Australia')) db.insert("RESTRICTION",('The_World_Is_Not_Enough',1999,'M','New_Zealand')) db.insert("RESTRICTION",('Heat',1995,'R','USA')) db.insert("RESTRICTION",('Heat',1995,'M','Australia')) db.insert("RESTRICTION",('American_History_X',1998,'R18','New_Zealand')) db.insert("RESTRICTION",('American_History_X',1998,'M','Australia')) db.insert("RESTRICTION",('American_History_X',1998,'R','USA')) db.insert("RESTRICTION",('Fight_Club',1999,'R','USA')) db.insert("RESTRICTION",('Fight_Club',1999,'R18','New_Zealand')) db.insert("RESTRICTION",('Fight_Club',1999,'R','Australia')) db.insert("RESTRICTION",('Out_of_Sight',1998,'M','Australia')) db.insert("RESTRICTION",('Out_of_Sight',1998,'R','USA')) db.insert("RESTRICTION",('Entrapment',1999,'PG-13','USA')) db.insert("RESTRICTION",('Entrapment',1999,'M','New_Zealand')) db.insert("RESTRICTION",('Entrapment',1999,'M','Australia')) db.insert("RESTRICTION",('The_Insider',1999,'M','New_Zealand')) db.insert("RESTRICTION",('The_Insider',1999,'R','USA')) db.insert("RESTRICTION",('The_Blair_Witch_Project',1999,'R','USA')) db.insert("RESTRICTION",('The_Blair_Witch_Project',1999,'M','Australia')) db.insert("RESTRICTION",('Lethal_Weapon_4',1998,'M','Australia')) db.insert("RESTRICTION",('Lethal_Weapon_4',1998,'R','USA')) db.insert("RESTRICTION",('The_Fifth_Element',1997,'PG-13','USA')) db.insert("RESTRICTION",('The_Fifth_Element',1997,'PG','Australia')) db.insert("RESTRICTION",('The_Sixth_Sense',1999,'M','Australia')) db.insert("RESTRICTION",('The_Sixth_Sense',1999,'M','New_Zealand')) db.insert("RESTRICTION",('The_Sixth_Sense',1999,'PG-13','USA')) db.insert("RESTRICTION",('Unbreakable',2000,'PG-13','USA')) db.insert("RESTRICTION",('Unbreakable',2000,'M','New_Zealand')) db.insert("RESTRICTION",('Unbreakable',2000,'M','Australia')) db.insert("RESTRICTION",('Armageddon',1998,'M','Australia')) db.insert("RESTRICTION",('Armageddon',1998,'PG-13','USA')) db.insert("RESTRICTION",('The_Kid',2000,'PG','Australia')) db.insert("RESTRICTION",('The_Kid',2000,'PG','USA')) db.insert("RESTRICTION",('The_Kid',2000,'PG','New_Zealand')) db.insert("RESTRICTION",('Twelve_Monkeys',1995,'M','Australia')) db.insert("RESTRICTION",('Twelve_Monkeys',1995,'R','USA')) db.insert("RESTRICTION",('Affliction',1997,'R','USA')) db.insert("RESTRICTION",('Affliction',1997,'M','Australia')) db.insert("RESTRICTION",('American_Beauty',1999,'R','USA')) db.insert("RESTRICTION",('American_Beauty',1999,'M','Australia')) db.insert("RESTRICTION",('American_Beauty',1999,'R18','New_Zealand')) db.insert("RESTRICTION",('Boys_Dont_Cry',1999,'R18','New_Zealand')) db.insert("RESTRICTION",('Boys_Dont_Cry',1999,'R','USA')) db.insert("RESTRICTION",('Boys_Dont_Cry',1999,'R','Australia')) db.insert("RESTRICTION",('Gandhi',1982,'PG','USA')) db.insert("RESTRICTION",('Hanging_Up',2000,'PG-13','USA')) db.insert("RESTRICTION",('Hanging_Up',2000,'M','New_Zealand')) db.insert("RESTRICTION",('Life_is_Beautiful',1997,'M','New_Zealand')) db.insert("RESTRICTION",('Life_is_Beautiful',1997,'M','Australia')) db.insert("RESTRICTION",('Life_is_Beautiful',1997,'PG-13','USA')) db.insert("RESTRICTION",('Proof_of_Life',2000,'M','New_Zealand')) db.insert("RESTRICTION",('Proof_of_Life',2000,'M','Australia')) db.insert("RESTRICTION",('Proof_of_Life',2000,'R','USA')) db.insert("RESTRICTION",('Saving_Private_Ryan',1998,'R','USA')) db.insert("RESTRICTION",('Saving_Private_Ryan',1998,'M','Australia')) db.insert("RESTRICTION",('The_Birds',1963,'PG','Australia')) db.insert("RESTRICTION",('The_Birds',1963,'PG-13','USA')) db.insert("RESTRICTION",('Rear_Window',1954,'PG','Australia')) db.insert("RESTRICTION",('Rear_Window',1954,'PG','USA')) db.insert("RESTRICTION",('The_Matrix',1999,'M','New_Zealand')) db.insert("RESTRICTION",('The_Matrix',1999,'M','Australia')) db.insert("RESTRICTION",('The_Matrix',1999,'R','USA')) db.insert("RESTRICTION",('Toy_Story',1995,'G','Australia')) db.insert("RESTRICTION",('Toy_Story',1995,'G','USA')) db.insert("RESTRICTION",('You_have_Got_Mail',1998,'PG','USA')) db.insert("RESTRICTION",('Rear_Window',1954,'16','Germany')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'13','Argentina')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'14','Chile')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'K-12','Finland')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'U','France')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'12','Germany')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'12','Portugal')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'M','Portugal')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'T','Spain')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'11','Sweden')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'15','UK')) db.insert("RESTRICTION",('Bullets_Over_Broadway',1994,'R','USA')) db.insert("RESTRICTION",('Tombstone',1993,'M','Australia')) db.insert("RESTRICTION",('Tombstone',1993,'K-16','Finland')) db.insert("RESTRICTION",('Tombstone',1993,'16','Germany')) db.insert("RESTRICTION",('Tombstone',1993,'18','Spain')) db.insert("RESTRICTION",('Tombstone',1993,'15','Sweden')) db.insert("RESTRICTION",('Tombstone',1993,'15','UK')) db.insert("RESTRICTION",('Tombstone',1993,'R','USA')) db.insert("RESTRICTION",('Alice',1990,'13','Argentina')) db.insert("RESTRICTION",('Alice',1990,'14','Chile')) db.insert("RESTRICTION",('Alice',1990,'S','Finland')) db.insert("RESTRICTION",('Alice',1990,'U','France')) db.insert("RESTRICTION",('Alice',1990,'12','Germany')) db.insert("RESTRICTION",('Alice',1990,'Btl','Sweden')) db.insert("RESTRICTION",('Alice',1990,'12','UK')) db.insert("RESTRICTION",('Alice',1990,'PG-13','USA')) db.insert("RESTRICTION",('Mermaids',1990,'13','Argentina')) db.insert("RESTRICTION",('Mermaids',1990,'14','Chile')) db.insert("RESTRICTION",('Mermaids',1990,'K-12','Finland')) db.insert("RESTRICTION",('Mermaids',1990,'U','France')) db.insert("RESTRICTION",('Mermaids',1990,'12','Germany')) db.insert("RESTRICTION",('Mermaids',1990,'11','Sweden')) db.insert("RESTRICTION",('Mermaids',1990,'15','UK')) db.insert("RESTRICTION",('Mermaids',1990,'PG-13','USA')) db.insert("RESTRICTION",('Exotica',1994,'18','Chile')) db.insert("RESTRICTION",('Exotica',1994,'K-16','Finland')) db.insert("RESTRICTION",('Exotica',1994,'IIB','HongKong')) db.insert("RESTRICTION",('Exotica',1994,'M','Portugal')) db.insert("RESTRICTION",('Exotica',1994,'16','Portugal')) db.insert("RESTRICTION",('Exotica',1994,'13','Spain')) db.insert("RESTRICTION",('Exotica',1994,'15','Sweden')) db.insert("RESTRICTION",('Exotica',1994,'18','UK')) db.insert("RESTRICTION",('Exotica',1994,'R','USA')) db.insert("RESTRICTION",('Red_Rock_West',1992,'16','Germany')) db.insert("RESTRICTION",('Red_Rock_West',1992,'T','Spain')) db.insert("RESTRICTION",('Red_Rock_West',1992,'15','UK')) db.insert("RESTRICTION",('Red_Rock_West',1992,'R','USA')) db.insert("RESTRICTION",('Chaplin',1992,'13','Argentina')) db.insert("RESTRICTION",('Chaplin',1992,'14','Chile')) db.insert("RESTRICTION",('Chaplin',1992,'S','Finland')) db.insert("RESTRICTION",('Chaplin',1992,'6','Germany')) db.insert("RESTRICTION",('Chaplin',1992,'T','Spain')) db.insert("RESTRICTION",('Chaplin',1992,'Btl','Sweden')) db.insert("RESTRICTION",('Chaplin',1992,'15','UK')) db.insert("RESTRICTION",('Chaplin',1992,'PG-13','USA')) db.insert("RESTRICTION",('Fearless',1993,'13','Argentina')) db.insert("RESTRICTION",('Fearless',1993,'M','Australia')) db.insert("RESTRICTION",('Fearless',1993,'KT','Belgium')) db.insert("RESTRICTION",('Fearless',1993,'14','Chile')) db.insert("RESTRICTION",('Fearless',1993,'K-14','Finland')) db.insert("RESTRICTION",('Fearless',1993,'12','Germany')) db.insert("RESTRICTION",('Fearless',1993,'12','Netherlands')) db.insert("RESTRICTION",('Fearless',1993,'13','Spain')) db.insert("RESTRICTION",('Fearless',1993,'15','Sweden')) db.insert("RESTRICTION",('Fearless',1993,'15','UK')) db.insert("RESTRICTION",('Fearless',1993,'R','USA')) db.insert("RESTRICTION",('Threesome',1994,'MA','Australia')) db.insert("RESTRICTION",('Threesome',1994,'K-16','Finland')) db.insert("RESTRICTION",('Threesome',1994,'16','Germany')) db.insert("RESTRICTION",('Threesome',1994,'M','Portugal')) db.insert("RESTRICTION",('Threesome',1994,'18','Spain')) db.insert("RESTRICTION",('Threesome',1994,'11','Sweden')) db.insert("RESTRICTION",('Threesome',1994,'18','UK')) db.insert("RESTRICTION",('Threesome',1994,'R','USA')) db.insert("RESTRICTION",('Jungle_Fever',1991,'K-14','Finland')) db.insert("RESTRICTION",('Jungle_Fever',1991,'16','Germany')) db.insert("RESTRICTION",('Jungle_Fever',1991,'18','Spain')) db.insert("RESTRICTION",('Jungle_Fever',1991,'15','Sweden')) db.insert("RESTRICTION",('Jungle_Fever',1991,'18','UK')) db.insert("RESTRICTION",('Jungle_Fever',1991,'R','USA')) db.insert("RESTRICTION",('Internal_Affairs',1990,'18','Argentina')) db.insert("RESTRICTION",('Internal_Affairs',1990,'K-16','Finland')) db.insert("RESTRICTION",('Internal_Affairs',1990,'18','Germany')) db.insert("RESTRICTION",('Internal_Affairs',1990,'15','Sweden')) db.insert("RESTRICTION",('Internal_Affairs',1990,'18','UK')) db.insert("RESTRICTION",('Internal_Affairs',1990,'R','USA')) db.insert("RESTRICTION",('Single_White_Female',1992,'18','Argentina')) db.insert("RESTRICTION",('Single_White_Female',1992,'M','Australia')) db.insert("RESTRICTION",('Single_White_Female',1992,'18','Chile')) db.insert("RESTRICTION",('Single_White_Female',1992,'K-16','Finland')) db.insert("RESTRICTION",('Single_White_Female',1992,'16','Germany')) db.insert("RESTRICTION",('Single_White_Female',1992,'18','Spain')) db.insert("RESTRICTION",('Single_White_Female',1992,'15','Sweden')) db.insert("RESTRICTION",('Single_White_Female',1992,'18','UK')) db.insert("RESTRICTION",('Single_White_Female',1992,'R','USA')) db.insert("RESTRICTION",('Trust',1990,'K-14','Finland')) db.insert("RESTRICTION",('Trust',1990,'15','Sweden')) db.insert("RESTRICTION",('Trust',1990,'R','USA')) db.insert("RESTRICTION",('Ju_Dou',1990,'18','Chile')) db.insert("RESTRICTION",('Ju_Dou',1990,'K-12','Finland')) db.insert("RESTRICTION",('Ju_Dou',1990,'15','Sweden')) db.insert("RESTRICTION",('Ju_Dou',1990,'PG-13','USA')) db.insert("RESTRICTION",('Dahong_Denglong_Gaogao_Gua',1991,'13','Argentina')) db.insert("RESTRICTION",('Dahong_Denglong_Gaogao_Gua',1991,'14','Chile')) db.insert("RESTRICTION",('Dahong_Denglong_Gaogao_Gua',1991,'12','Germany')) db.insert("RESTRICTION",('Dahong_Denglong_Gaogao_Gua',1991,'13','Spain')) db.insert("RESTRICTION",('Dahong_Denglong_Gaogao_Gua',1991,'11','Sweden')) db.insert("RESTRICTION",('Dahong_Denglong_Gaogao_Gua',1991,'PG','USA')) db.insert("RESTRICTION",('Cyrano_de_Bergerac',1990,'TE','Chile')) db.insert("RESTRICTION",('Cyrano_de_Bergerac',1990,'U','France')) db.insert("RESTRICTION",('Cyrano_de_Bergerac',1990,'11','Sweden')) db.insert("RESTRICTION",('Cyrano_de_Bergerac',1990,'PG','USA')) db.insert("RESTRICTION",('Manhattan_Murder_Mystery',1993,'13','Argentina')) db.insert("RESTRICTION",('Manhattan_Murder_Mystery',1993,'T','Spain')) db.insert("RESTRICTION",('Manhattan_Murder_Mystery',1993,'11','Sweden')) db.insert("RESTRICTION",('Manhattan_Murder_Mystery',1993,'PG','USA')) db.insert("RESTRICTION",('El_Mariachi',1992,'M','Australia')) db.insert("RESTRICTION",('El_Mariachi',1992,'K-16','Finland')) db.insert("RESTRICTION",('El_Mariachi',1992,'18','Germany')) db.insert("RESTRICTION",('El_Mariachi',1992,'18','Spain')) db.insert("RESTRICTION",('El_Mariachi',1992,'15','UK')) db.insert("RESTRICTION",('El_Mariachi',1992,'R','USA')) db.insert("RESTRICTION",('Once_Were_Warriors',1994,'MA','Australia')) db.insert("RESTRICTION",('Once_Were_Warriors',1994,'18','Chile')) db.insert("RESTRICTION",('Once_Were_Warriors',1994,'K-16','Finland')) db.insert("RESTRICTION",('Once_Were_Warriors',1994,'16','Germany')) db.insert("RESTRICTION",('Once_Were_Warriors',1994,'16','Portugal')) db.insert("RESTRICTION",('Once_Were_Warriors',1994,'18','Spain')) db.insert("RESTRICTION",('Once_Were_Warriors',1994,'15','Sweden')) db.insert("RESTRICTION",('Once_Were_Warriors',1994,'18','UK')) db.insert("RESTRICTION",('Once_Were_Warriors',1994,'R','USA')) db.insert("RESTRICTION",('Priest',1994,'MA','Australia')) db.insert("RESTRICTION",('Priest',1994,'K-16','Finland')) db.insert("RESTRICTION",('Priest',1994,'12(w)','Germany')) db.insert("RESTRICTION",('Priest',1994,'16','Portugal')) db.insert("RESTRICTION",('Priest',1994,'18','Spain')) db.insert("RESTRICTION",('Priest',1994,'15','Sweden')) db.insert("RESTRICTION",('Priest',1994,'15','UK')) db.insert("RESTRICTION",('Priest',1994,'R','USA')) db.insert("RESTRICTION",('Pump_Up_the_Volum',1990,'M','Australia')) db.insert("RESTRICTION",('Pump_Up_the_Volum',1990,'12','Germany')) db.insert("RESTRICTION",('Pump_Up_the_Volum',1990,'15','UK')) db.insert("RESTRICTION",('Pump_Up_the_Volum',1990,'R','USA')) db.insert("RESTRICTION",('Benny_and_Joon',1993,'U','France')) db.insert("RESTRICTION",('Benny_and_Joon',1993,'12','Germany')) db.insert("RESTRICTION",('Benny_and_Joon',1993,'T','Spain')) db.insert("RESTRICTION",('Benny_and_Joon',1993,'11','Sweden')) db.insert("RESTRICTION",('Benny_and_Joon',1993,'12','UK')) db.insert("RESTRICTION",('Benny_and_Joon',1993,'PG','USA')) db.insert("RESTRICTION",('Six_Degrees_of_Separation',1993,'13','Argentina')) db.insert("RESTRICTION",('Six_Degrees_of_Separation',1993,'13','Spain')) db.insert("RESTRICTION",('Six_Degrees_of_Separation',1993,'15','UK')) db.insert("RESTRICTION",('Six_Degrees_of_Separation',1993,'R','USA')) db.insert("RESTRICTION",('Bawang_Bie_Ji',1993,'18','Chile')) db.insert("RESTRICTION",('Bawang_Bie_Ji',1993,'K-14','Finland')) db.insert("RESTRICTION",('Bawang_Bie_Ji',1993,'12','Germany')) db.insert("RESTRICTION",('Bawang_Bie_Ji',1993,'18','Spain')) db.insert("RESTRICTION",('Bawang_Bie_Ji',1993,'15','Sweden')) db.insert("RESTRICTION",('Bawang_Bie_Ji',1993,'15','UK')) db.insert("RESTRICTION",('Bawang_Bie_Ji',1993,'R','USA')) db.insert("RESTRICTION",('In_the_Line_of_Fire',1993,'13','Argentina')) db.insert("RESTRICTION",('In_the_Line_of_Fire',1993,'M','Australia')) db.insert("RESTRICTION",('In_the_Line_of_Fire',1993,'14','Chile')) db.insert("RESTRICTION",('In_the_Line_of_Fire',1993,'K-16','Finland')) db.insert("RESTRICTION",('In_the_Line_of_Fire',1993,'16','Germany')) db.insert("RESTRICTION",('In_the_Line_of_Fire',1993,'18','Spain')) db.insert("RESTRICTION",('In_the_Line_of_Fire',1993,'15','Sweden')) db.insert("RESTRICTION",('In_the_Line_of_Fire',1993,'15','UK')) db.insert("RESTRICTION",('In_the_Line_of_Fire',1993,'R','USA')) db.insert("RESTRICTION",('Heavenly_Creatures',1994,'M','Australia')) db.insert("RESTRICTION",('Heavenly_Creatures',1994,'18','Chile')) db.insert("RESTRICTION",('Heavenly_Creatures',1994,'K-16','Finland')) db.insert("RESTRICTION",('Heavenly_Creatures',1994,'16','Germany')) db.insert("RESTRICTION",('Heavenly_Creatures',1994,'16','Portugal')) db.insert("RESTRICTION",('Heavenly_Creatures',1994,'18','Spain')) db.insert("RESTRICTION",('Heavenly_Creatures',1994,'15','Sweden')) db.insert("RESTRICTION",('Heavenly_Creatures',1994,'18','UK')) db.insert("RESTRICTION",('Heavenly_Creatures',1994,'R','USA')) db.insert("RESTRICTION",('Hoop_Dreams',1994,'M','Australia')) db.insert("RESTRICTION",('Hoop_Dreams',1994,'15','UK')) db.insert("RESTRICTION",('Hoop_Dreams',1994,'PG-13','USA')) db.insert("RESTRICTION",('Seven',1995,'R','Australia')) db.insert("RESTRICTION",('Seven',1995,'18','Chile')) db.insert("RESTRICTION",('Seven',1995,'K-16','Finland')) db.insert("RESTRICTION",('Seven',1995,'16','Germany')) db.insert("RESTRICTION",('Seven',1995,'IIB','HongKong')) db.insert("RESTRICTION",('Seven',1995,'16','Portugal')) db.insert("RESTRICTION",('Seven',1995,'18','Spain')) db.insert("RESTRICTION",('Seven',1995,'15','Sweden')) db.insert("RESTRICTION",('Seven',1995,'18','UK')) db.insert("RESTRICTION",('Seven',1995,'R','USA')) db.insert("RESTRICTION",('Shallow_Grave',1994,'MA','Australia')) db.insert("RESTRICTION",('Shallow_Grave',1994,'K-16','Finland')) db.insert("RESTRICTION",('Shallow_Grave',1994,'16','Germany')) db.insert("RESTRICTION",('Shallow_Grave',1994,'M','Portugal')) db.insert("RESTRICTION",('Shallow_Grave',1994,'18','Spain')) db.insert("RESTRICTION",('Shallow_Grave',1994,'15','Sweden')) db.insert("RESTRICTION",('Shallow_Grave',1994,'18','UK')) db.insert("RESTRICTION",('Shallow_Grave',1994,'R','USA')) db.insert("RESTRICTION",('French_Kiss',1995,'PG','Australia')) db.insert("RESTRICTION",('French_Kiss',1995,'TE','Chile')) db.insert("RESTRICTION",('French_Kiss',1995,'U','France')) db.insert("RESTRICTION",('French_Kiss',1995,'6(bw)','Germany')) db.insert("RESTRICTION",('French_Kiss',1995,'12','Portugal')) db.insert("RESTRICTION",('French_Kiss',1995,'T','Spain')) db.insert("RESTRICTION",('French_Kiss',1995,'12','UK')) db.insert("RESTRICTION",('French_Kiss',1995,'PG-13','USA')) db.insert("RESTRICTION",('Braindead',1992,'18','Argentina')) db.insert("RESTRICTION",('Braindead',1992,'R','Australia')) db.insert("RESTRICTION",('Braindead',1992,'18','Chile')) db.insert("RESTRICTION",('Braindead',1992,'18','Germany')) db.insert("RESTRICTION",('Braindead',1992,'16','Portugal')) db.insert("RESTRICTION",('Braindead',1992,'18','Spain')) db.insert("RESTRICTION",('Braindead',1992,'15','Sweden')) db.insert("RESTRICTION",('Braindead',1992,'18','UK')) db.insert("RESTRICTION",('Clerks',1994,'R','Australia')) db.insert("RESTRICTION",('Clerks',1994,'K-12','Finland')) db.insert("RESTRICTION",('Clerks',1994,'12','Germany')) db.insert("RESTRICTION",('Clerks',1994,'18','Spain')) db.insert("RESTRICTION",('Clerks',1994,'Btl','Sweden')) db.insert("RESTRICTION",('Clerks',1994,'18','UK')) db.insert("RESTRICTION",('Clerks',1994,'R','USA')) db.insert("RESTRICTION",('Apollo_13',1995,'13','Argentina')) db.insert("RESTRICTION",('Apollo_13',1995,'PG','Australia')) db.insert("RESTRICTION",('Apollo_13',1995,'KT','Belgium')) db.insert("RESTRICTION",('Apollo_13',1995,'14','Chile')) db.insert("RESTRICTION",('Apollo_13',1995,'U','France')) db.insert("RESTRICTION",('Apollo_13',1995,'6(bw)','Germany')) db.insert("RESTRICTION",('Apollo_13',1995,'12','Portugal')) db.insert("RESTRICTION",('Apollo_13',1995,'T','Spain')) db.insert("RESTRICTION",('Apollo_13',1995,'PG','USA')) db.insert("RESTRICTION",('Reservoir_Dogs',1992,'R','Australia')) db.insert("RESTRICTION",('Reservoir_Dogs',1992,'18','Germany')) db.insert("RESTRICTION",('Reservoir_Dogs',1992,'R18','New_Zealand')) db.insert("RESTRICTION",('Reservoir_Dogs',1992,'16','Portugal')) db.insert("RESTRICTION",('Reservoir_Dogs',1992,'18','Spain')) db.insert("RESTRICTION",('Reservoir_Dogs',1992,'15','Sweden')) db.insert("RESTRICTION",('Reservoir_Dogs',1992,'18','UK')) db.insert("RESTRICTION",('Reservoir_Dogs',1992,'R','USA')) db.insert("RESTRICTION",('Pulp_Fiction',1994,'18','Argentina')) db.insert("RESTRICTION",('Pulp_Fiction',1994,'R','Australia')) db.insert("RESTRICTION",('Pulp_Fiction',1994,'18','Chile')) db.insert("RESTRICTION",('Pulp_Fiction',1994,'16','Germany')) db.insert("RESTRICTION",('Pulp_Fiction',1994,'16','Portugal')) db.insert("RESTRICTION",('Pulp_Fiction',1994,'18','Spain')) db.insert("RESTRICTION",('Pulp_Fiction',1994,'15','Sweden')) db.insert("RESTRICTION",('Pulp_Fiction',1994,'18','UK')) db.insert("RESTRICTION",('Pulp_Fiction',1994,'R','USA')) db.insert("RESTRICTION",('Yinshi_Nan_Nu',1994,'13','Argentina')) db.insert("RESTRICTION",('Yinshi_Nan_Nu',1994,'14','Chile')) db.insert("RESTRICTION",('Yinshi_Nan_Nu',1994,'S','Finland')) db.insert("RESTRICTION",('Yinshi_Nan_Nu',1994,'6','Germany')) db.insert("RESTRICTION",('Yinshi_Nan_Nu',1994,'12','Portugal')) db.insert("RESTRICTION",('Yinshi_Nan_Nu',1994,'T','Spain')) db.insert("RESTRICTION",('Short_Cuts',1993,'MA','Australia')) db.insert("RESTRICTION",('Short_Cuts',1993,'K-14','Finland')) db.insert("RESTRICTION",('Short_Cuts',1993,'U','France')) db.insert("RESTRICTION",('Short_Cuts',1993,'16','Germany')) db.insert("RESTRICTION",('Short_Cuts',1993,'18','Spain')) db.insert("RESTRICTION",('Short_Cuts',1993,'15','Sweden')) db.insert("RESTRICTION",('Short_Cuts',1993,'18','UK')) db.insert("RESTRICTION",('Short_Cuts',1993,'R','USA')) db.insert("RESTRICTION",('Legends_of_the_Fall',1994,'13','Argentina')) db.insert("RESTRICTION",('Legends_of_the_Fall',1994,'M','Australia')) db.insert("RESTRICTION",('Legends_of_the_Fall',1994,'14','Chile')) db.insert("RESTRICTION",('Legends_of_the_Fall',1994,'12(w)','Germany')) db.insert("RESTRICTION",('Legends_of_the_Fall',1994,'12','Netherlands')) db.insert("RESTRICTION",('Legends_of_the_Fall',1994,'13','Spain')) db.insert("RESTRICTION",('Legends_of_the_Fall',1994,'15','Sweden')) db.insert("RESTRICTION",('Legends_of_the_Fall',1994,'15','UK')) db.insert("RESTRICTION",('Legends_of_the_Fall',1994,'R','USA')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'18','Argentina')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'R','Australia')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'18','Chile')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'K-16','Finland')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'18','Germany')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'12','Portugal')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'18','Spain')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'15','Sweden')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'18','UK')) db.insert("RESTRICTION",('Natural_Born_Killers',1994,'R','USA')) db.insert("RESTRICTION",('In_the_Mouth_of_Madness',1995,'M','Australia')) db.insert("RESTRICTION",('In_the_Mouth_of_Madness',1995,'16','Germany')) db.insert("RESTRICTION",('In_the_Mouth_of_Madness',1995,'16','Portugal')) db.insert("RESTRICTION",('In_the_Mouth_of_Madness',1995,'18','Spain')) db.insert("RESTRICTION",('In_the_Mouth_of_Madness',1995,'18','UK')) db.insert("RESTRICTION",('In_the_Mouth_of_Madness',1995,'R','USA')) db.insert("RESTRICTION",('Forrest_Gump',1994,'13','Argentina')) db.insert("RESTRICTION",('Forrest_Gump',1994,'PG','Australia')) db.insert("RESTRICTION",('Forrest_Gump',1994,'14','Chile')) db.insert("RESTRICTION",('Forrest_Gump',1994,'K-12','Finland')) db.insert("RESTRICTION",('Forrest_Gump',1994,'12','Germany')) db.insert("RESTRICTION",('Forrest_Gump',1994,'12','Netherlands')) db.insert("RESTRICTION",('Forrest_Gump',1994,'T','Spain')) db.insert("RESTRICTION",('Forrest_Gump',1994,'11','Sweden')) db.insert("RESTRICTION",('Forrest_Gump',1994,'12','UK')) db.insert("RESTRICTION",('Forrest_Gump',1994,'PG-13','USA')) db.insert("RESTRICTION",('Malcolm_X',1992,'13','Argentina')) db.insert("RESTRICTION",('Malcolm_X',1992,'M','Australia')) db.insert("RESTRICTION",('Malcolm_X',1992,'14','Chile')) db.insert("RESTRICTION",('Malcolm_X',1992,'K-14','Finland')) db.insert("RESTRICTION",('Malcolm_X',1992,'12','Germany')) db.insert("RESTRICTION",('Malcolm_X',1992,'T','Spain')) db.insert("RESTRICTION",('Malcolm_X',1992,'15','Sweden')) db.insert("RESTRICTION",('Malcolm_X',1992,'15','UK')) db.insert("RESTRICTION",('Malcolm_X',1992,'PG-13','USA')) db.insert("RESTRICTION",('Dead_Again',1991,'M','Australia')) db.insert("RESTRICTION",('Dead_Again',1991,'K-16','Finland')) db.insert("RESTRICTION",('Dead_Again',1991,'16','Germany')) db.insert("RESTRICTION",('Dead_Again',1991,'13','Spain')) db.insert("RESTRICTION",('Dead_Again',1991,'15','Sweden')) db.insert("RESTRICTION",('Dead_Again',1991,'15','UK')) db.insert("RESTRICTION",('Dead_Again',1991,'R','USA')) db.insert("RESTRICTION",('Jurassic_Park',1993,'13','Argentina')) db.insert("RESTRICTION",('Jurassic_Park',1993,'PG','Australia')) db.insert("RESTRICTION",('Jurassic_Park',1993,'TE','Chile')) db.insert("RESTRICTION",('Jurassic_Park',1993,'K-16','Finland')) db.insert("RESTRICTION",('Jurassic_Park',1993,'U','France')) db.insert("RESTRICTION",('Jurassic_Park',1993,'12','Germany')) db.insert("RESTRICTION",('Jurassic_Park',1993,'13','Spain')) db.insert("RESTRICTION",('Jurassic_Park',1993,'11','Sweden')) db.insert("RESTRICTION",('Jurassic_Park',1993,'PG-13','USA')) db.insert("RESTRICTION",('Clueless',1995,'13','Argentina')) db.insert("RESTRICTION",('Clueless',1995,'M','Australia')) db.insert("RESTRICTION",('Clueless',1995,'KT','Belgium')) db.insert("RESTRICTION",('Clueless',1995,'14','Chile')) db.insert("RESTRICTION",('Clueless',1995,'S','Finland')) db.insert("RESTRICTION",('Clueless',1995,'U','France')) db.insert("RESTRICTION",('Clueless',1995,'12','Portugal')) db.insert("RESTRICTION",('Clueless',1995,'T','Spain')) db.insert("RESTRICTION",('Clueless',1995,'11','Sweden')) db.insert("RESTRICTION",('Clueless',1995,'12','UK')) db.insert("RESTRICTION",('Clueless',1995,'PG-13','USA')) db.insert("RESTRICTION",('Shadowlands',1993,'13','Argentina')) db.insert("RESTRICTION",('Shadowlands',1993,'14','Chile')) db.insert("RESTRICTION",('Shadowlands',1993,'S','Finland')) db.insert("RESTRICTION",('Shadowlands',1993,'PG','USA')) db.insert("RESTRICTION",('Amateur',1994,'K-16','Finland')) db.insert("RESTRICTION",('Amateur',1994,'18','Spain')) db.insert("RESTRICTION",('Amateur',1994,'15','Sweden')) db.insert("RESTRICTION",('Amateur',1994,'15','UK')) db.insert("RESTRICTION",('Amateur',1994,'R','USA')) db.insert("RESTRICTION",('GoodFellas',1990,'18','Argentina')) db.insert("RESTRICTION",('GoodFellas',1990,'R','Australia')) db.insert("RESTRICTION",('GoodFellas',1990,'18','Chile')) db.insert("RESTRICTION",('GoodFellas',1990,'K-16','Finland')) db.insert("RESTRICTION",('GoodFellas',1990,'16','Germany')) db.insert("RESTRICTION",('GoodFellas',1990,'16','Portugal')) db.insert("RESTRICTION",('GoodFellas',1990,'15','Sweden')) db.insert("RESTRICTION",('GoodFellas',1990,'18','UK')) db.insert("RESTRICTION",('GoodFellas',1990,'R','USA')) db.insert("RESTRICTION",('Little_Women',1994,'G','Australia')) db.insert("RESTRICTION",('Little_Women',1994,'TE','Chile')) db.insert("RESTRICTION",('Little_Women',1994,'S','Finland')) db.insert("RESTRICTION",('Little_Women',1994,'T','Spain')) db.insert("RESTRICTION",('Little_Women',1994,'Btl','Sweden')) db.insert("RESTRICTION",('Little_Women',1994,'PG','USA')) db.insert("RESTRICTION",('While_You_Were_Sleeping',1995,'PG','Australia')) db.insert("RESTRICTION",('While_You_Were_Sleeping',1995,'TE','Chile')) db.insert("RESTRICTION",('While_You_Were_Sleeping',1995,'S','Finland')) db.insert("RESTRICTION",('While_You_Were_Sleeping',1995,'U','France')) db.insert("RESTRICTION",('While_You_Were_Sleeping',1995,'6(bw)','Germany')) db.insert("RESTRICTION",('While_You_Were_Sleeping',1995,'12','Portugal')) db.insert("RESTRICTION",('While_You_Were_Sleeping',1995,'T','Spain')) db.insert("RESTRICTION",('While_You_Were_Sleeping',1995,'PG','USA')) db.insert("ROLE",('00000002','Titanic',1997,'Jack Dawson','')) db.insert("ROLE",('00001188','Titanic',1997,'Rose DeWitt Bukater','Heavenly Creatures')) db.insert("ROLE",('00000004','Titanic',1997,'Cal Hockley','')) db.insert("ROLE",('00000005','Titanic',1997,'Molly Brown','')) db.insert("ROLE",('00000023','Shakespeare in Love',1998,'Philip Henslowe','')) db.insert("ROLE",('00001146','Shakespeare in Love',1998,'Hugh Fennyman','Priest')) db.insert("ROLE",('00000025','Shakespeare in Love',1998,'Lambert','')) db.insert("ROLE",('00000026','Shakespeare in Love',1998,'Queen Elizabeth','')) db.insert("ROLE",('00000043','The Cider House Rules',1999,'Olive Worthington','')) db.insert("ROLE",('00000044','The Cider House Rules',1999,'Homer Wells','')) db.insert("ROLE",('00000045','The Cider House Rules',1999,'Candy Kendall','')) db.insert("ROLE",('00000046','The Cider House Rules',1999,'Mr.Rose','')) db.insert("ROLE",('00000047','The Cider House Rules',1999,'Dr Wilbur Larch','')) db.insert("ROLE",('00000063','Gandhi',1982,'Mahatma Gandhi','')) db.insert("ROLE",('00000064','Gandhi',1982,'Margaret Bourke','')) db.insert("ROLE",('00000065','Gandhi',1982,'Pandit Nehru','')) db.insert("ROLE",('00000066','Gandhi',1982,'General Dyer','')) db.insert("ROLE",('00000083','American Beauty',1999,'Lester Burnham','')) db.insert("ROLE",('00000084','American Beauty',1999,'Carolyn Burnham','')) db.insert("ROLE",('00000085','American Beauty',1999,'Jane Burnham','')) db.insert("ROLE",('00000086','American Beauty',1999,'Ricky Fitts','')) db.insert("ROLE",('00000103','Affliction',1997,'Wade Whitehouse','')) db.insert("ROLE",('00000104','Affliction',1997,'Jill','')) db.insert("ROLE",('00000105','Affliction',1997,'Gordon LaRiviere','')) db.insert("ROLE",('00000106','Affliction',1997,'Jack Hewitt','')) db.insert("ROLE",('00000107','Affliction',1997,'Glen Whitehouse','')) db.insert("ROLE",('00000121','Life is Beautiful',1997,'Guido Orefice','')) db.insert("ROLE",('00000123','Life is Beautiful',1997,'Dora','')) db.insert("ROLE",('00000143','Boys Dont Cry',1999,'Brandon Teena','')) db.insert("ROLE",('00000144','Boys Dont Cry',1999,'Lana Tisdel','')) db.insert("ROLE",('00000145','Boys Dont Cry',1999,'John Lotter','')) db.insert("ROLE",('00000146','Boys Dont Cry',1999,'Marvin Thomas','')) db.insert("ROLE",('00001227','Saving Private Ryan',1998,'Captain John','Toy Story')) db.insert("ROLE",('00000164','Saving Private Ryan',1998,'Sergeant Michael','')) db.insert("ROLE",('00000165','Saving Private Ryan',1998,'Richard Reiben','')) db.insert("ROLE",('00000166','Saving Private Ryan',1998,'Jackson','')) db.insert("ROLE",('00000181','The Birds',1963,'Man in pet shop','')) db.insert("ROLE",('00000184','The Birds',1963,'Mitch Brenner','')) db.insert("ROLE",('00000185','The Birds',1963,'Lydia Brenner','')) db.insert("ROLE",('00000186','The Birds',1963,'Annie Hayworth','')) db.insert("ROLE",('00000187','The Birds',1963,'Melanie Daniels','')) db.insert("ROLE",('00001001','Rear Window',1954,'L.B. Jeff Jefferies','')) db.insert("ROLE",('00001002','Rear Window',1954,'Lisa Carol Fremont','')) db.insert("ROLE",('00001003','Rear Window',1954,'Lars Thorwald','')) db.insert("ROLE",('00000181','Rear Window',1954,'Clock-Winding Man','Psycho, Birds')) db.insert("ROLE",('00000203','The Matrix',1999,'Thomas','')) db.insert("ROLE",('00000204','The Matrix',1999,'Morpheus','')) db.insert("ROLE",('00001227','Toy Story',1995,'Woody','Saving Private Ryan')) db.insert("ROLE",('00000942','Toy Story',1995,'Buzz Lightyear','')) db.insert("ROLE",('00000943','Toy Story',1995,'Bo Peep','')) db.insert("ROLE",('00001212','Proof of Life',2000,'Alice Bowman','Hanging Up')) db.insert("ROLE",('00000622','Proof of Life',2000,'Terry Thorne','Gladiator')) db.insert("ROLE",('00000963','Proof of Life',2000,'Peter Bowman','')) db.insert("ROLE",('00001212','Hanging Up',2000,'Eve','Proof of Life')) db.insert("ROLE",('00001131','Hanging Up',2000,'Georgia','Manhattan Murder Mystery')) db.insert("ROLE",('00000983','Hanging Up',2000,'Maddy','')) db.insert("ROLE",('00000223','You have Got Mail',1998,'Patricia Eden','')) db.insert("ROLE",('00000163','You have Got Mail',1998,'Joe Fox III','Saving Private Ryan')) db.insert("ROLE",('00001212','You have Got Mail',1998,'Kathleen Kelly','Hanging Up')) db.insert("ROLE",('00000242','The Price of Milk',2000,'Lucinda','Topless Women Talk About Their Lives')) db.insert("ROLE",('00000243','The Price of Milk',2000,'Rob','')) db.insert("ROLE",('00000244','The Price of Milk',2000,'Drosophila','Topless Women Talk About Their Lives')) db.insert("ROLE",('00000262','The Footstep Man',1992,'Sam','')) db.insert("ROLE",('00000263','The Footstep Man',1992,'Mirielle','')) db.insert("ROLE",('00000264','The Footstep Man',1992,'Henri de Toulouse','')) db.insert("ROLE",('00000242','Topless Women Talk About Their Lives',1997,'Liz','The Price of Milk')) db.insert("ROLE",('00000281','Topless Women Talk About Their Lives',1997,'Neil','')) db.insert("ROLE",('00000282','Topless Women Talk About Their Lives',1997,'Ant','')) db.insert("ROLE",('00000244','Topless Women Talk About Their Lives',1997,'Prue','The Price of Milk')) db.insert("ROLE",('00000302','The Piano',1993,'Ada McGrath','')) db.insert("ROLE",('00001233','The Piano',1993,'George Baines','Reservoir Dogs')) db.insert("ROLE",('00000304','The Piano',1993,'Flora McGrath','')) db.insert("ROLE",('00000323','Mad Max',1979,'Max Rockatansky','Lethal Weapon 4')) db.insert("ROLE",('00000324','Mad Max',1979,'Jessie Rockatansky','')) db.insert("ROLE",('00000343','Strictly Ballroom',1992,'Scott Hastings','')) db.insert("ROLE",('00000344','Strictly Ballroom',1992,'Fran','')) db.insert("ROLE",('00000345','Strictly Ballroom',1992,'Shirley Hastings','')) db.insert("ROLE",('00000346','Strictly Ballroom',1992,'Doug Hastings','')) db.insert("ROLE",('00000362','My Mother Frank',2000,'Mike','')) db.insert("ROLE",('00000363','My Mother Frank',2000,'Jenny','')) db.insert("ROLE",('00000364','My Mother Frank',2000,'Frank','')) db.insert("ROLE",('00000383','American Psycho',2000,'Patrick Bateman ','')) db.insert("ROLE",('00000384','American Psycho',2000,'Donald Kimball','')) db.insert("ROLE",('00000385','American Psycho',2000,'Paul Allen','')) db.insert("ROLE",('00001153','American Psycho',2000,'Courtney Rawlinson','Pump Up the Volume')) db.insert("ROLE",('00000403','Scream 2',1997,'Dwight Dewey Riley','')) db.insert("ROLE",('00000404','Scream 2',1997,'Sidney Prescott','')) db.insert("ROLE",('00000405','Scream 2',1997,'Gale Weathers','')) db.insert("ROLE",('00000485','Scream 2',1997,'Casey','I Know What You Did Last Summer')) db.insert("ROLE",('00000421','Scream 3',2000,'Cotton Weary','')) db.insert("ROLE",('00000422','Scream 3',2000,'Female Caller','')) db.insert("ROLE",('00000423','Scream 3',2000,'The Voice','')) db.insert("ROLE",('00000424','Scream 3',2000,'Christine','')) db.insert("ROLE",('00000404','Scream 3',2000,'Sidney Prescott','Scream 2')) db.insert("ROLE",('00000405','Scream 3',2000,'Gale Weathers','Scream 2')) db.insert("ROLE",('00000443','Traffic',2000,'Robert Wakefield','')) db.insert("ROLE",('00000444','Traffic',2000,'Javier Rodriguez','')) db.insert("ROLE",('00000445','Traffic',2000,'Helena Ayala','Entrapment')) db.insert("ROLE",('00000446','Traffic',2000,'Carlos Ayala','')) db.insert("ROLE",('00000447','Traffic',2000,'Ray Castro','')) db.insert("ROLE",('00000448','Traffic',2000,'Barbara Wakefield','')) db.insert("ROLE",('00000449','Traffic',2000,'Caroline Wakefield','')) db.insert("ROLE",('00000450','Traffic',2000,'Montel Gordon','')) db.insert("ROLE",('00000451','Traffic',2000,'Manolo Sanchez','')) db.insert("ROLE",('00000452','Traffic',2000,'Francisco Flores','')) db.insert("ROLE",('00000462','Psycho',1960,'Norman Bates','')) db.insert("ROLE",('00000463','Psycho',1960,'Lila Crane','')) db.insert("ROLE",('00000464','Psycho',1960,'Marion Crane','')) db.insert("ROLE",('00000181','Psycho',1960,'Man in hat','')) db.insert("ROLE",('00000465','Psycho',1960,'Sam Loomis','')) db.insert("ROLE",('00000466','Psycho',1960,'Mother','')) db.insert("ROLE",('00000483','I Know What You Did Last Summer',1997,'Julie James','')) db.insert("ROLE",('00000485','I Know What You Did Last Summer',1997,'Helen Shivers','Scream 2')) db.insert("ROLE",('00000484','I Know What You Did Last Summer',1997,'Barry Cox','Cruel Intentions')) db.insert("ROLE",('00000484','Cruel Intentions',1999,'Sebastian Valmont','I Know What You Did Last Summer')) db.insert("ROLE",('00000485','Cruel Intentions',1999,'Kathryn Merteuil','Scream 2')) db.insert("ROLE",('00000503','Cruel Intentions',1999,'Annette Hargrove','')) db.insert("ROLE",('00000504','Cruel Intentions',1999,'Cecile Caldwell','')) db.insert("ROLE",('00001229','Wild Things',1998,'Ray Duquette','Apollo 13')) db.insert("ROLE",('00000524','Wild Things',1998,'Sam Lombardo','')) db.insert("ROLE",('00000404','Wild Things',1998,'Suzie Toller','Scream 2')) db.insert("ROLE",('00000543','Alien',1979,'Captain','')) db.insert("ROLE",('00000544','Alien',1979,'Warrent Officer','Aliens')) db.insert("ROLE",('00000544','Aliens',1986,'Lieutenant','Alien')) db.insert("ROLE",('00000561','Aliens',1986,'Rebecca','')) db.insert("ROLE",('00000544','Alien 3',1992,'Ellen Ripley','Aliens')) db.insert("ROLE",('00000583','Alien 3',1992,'Dillon','')) db.insert("ROLE",('00000584','Alien 3',1992,'Clemens','')) db.insert("ROLE",('00000544','Alien: Resurrection',1997,'Lieutenant Ellen','Aliens')) db.insert("ROLE",('00001031','Alien: Resurrection',1997,'Betty Mechanic','Mermaids')) db.insert("ROLE",('00000604','Alien: Resurrection',1997,'Betty Chief Mechanic','')) db.insert("ROLE",('00000622','Gladiator',2000,'Maximus','The Insider')) db.insert("ROLE",('00000623','Gladiator',2000,'Commodus','')) db.insert("ROLE",('00000624','Gladiator',2000,'Lucilla','')) db.insert("ROLE",('00000643','The World Is Not Enough',1999,'James Bond','')) db.insert("ROLE",('00000644','The World Is Not Enough',1999,'CEO Elektra','')) db.insert("ROLE",('00000645','The World Is Not Enough',1999,'Christmas','')) db.insert("ROLE",('00000662','Heat',1995,'Vincent Hanna','The Insider')) db.insert("ROLE",('00000663','Heat',1995,'Neil McCauley','')) db.insert("ROLE",('00001017','Heat',1995,'Chris Shiherlis','Tombstone')) db.insert("ROLE",('00000683','American History X',1998,'Derek Vinyard','')) db.insert("ROLE",('00000684','American History X',1998,'Daniel Vinyard','')) db.insert("ROLE",('00000685','American History X',1998,'Doris Vinyard','')) db.insert("ROLE",('00000683','Fight Club',1999,'Narrator','')) db.insert("ROLE",('00001198','Fight Club',1999,'Tyler Durden','Twelve Monkeys')) db.insert("ROLE",('00000703','Fight Club',1999,'Robert Paulsen','')) db.insert("ROLE",('00000722','Out of Sight',1998,'Jack Foley','')) db.insert("ROLE",('00000723','Out of Sight',1998,'Bank Employee','')) db.insert("ROLE",('00000724','Out of Sight',1998,'Karen Sisco','')) db.insert("ROLE",('00000445','Entrapment',1999,'Virginia Baker','Traffic')) db.insert("ROLE",('00000743','Entrapment',1999,'Robert Mac','')) db.insert("ROLE",('00000744','Entrapment',1999,'Aaron Thibadeaux','')) db.insert("ROLE",('00000762','The Insider',1999,'Liane Wigand','')) db.insert("ROLE",('00000622','The Insider',1999,'Jeffrey Wigand','Gladiator')) db.insert("ROLE",('00000662','The Insider',1999,'Lowell Bergman','Heat')) db.insert("ROLE",('00000782','The Blair Witch Project',1999,'Heather Donahue','')) db.insert("ROLE",('00000783','The Blair Witch Project',1999,'Josh','')) db.insert("ROLE",('00000784','The Blair Witch Project',1999,'Mike','')) db.insert("ROLE",('00000803','Lethal Weapon 4',1998,'Roger Murtaugh','')) db.insert("ROLE",('00001183','Lethal Weapon 4',1998,'Lorna Cole','In the Line of Fire')) db.insert("ROLE",('00000323','Lethal Weapon 4',1998,'Martin Riggs','Mad Max')) db.insert("ROLE",('00000822','The Fifth Element',1997,'Korben Dallas','The Sixth Sense')) db.insert("ROLE",('00000823','The Fifth Element',1997,'Zorg','')) db.insert("ROLE",('00000824','The Fifth Element',1997,'Leeloo','')) db.insert("ROLE",('00000822','The Sixth Sense',1999,'Dr.Malcolm Crowe','The Fifth Element')) db.insert("ROLE",('00000842','The Sixth Sense',1999,'Cole Sear','')) db.insert("ROLE",('00000843','The Sixth Sense',1999,'Lynn Sear','')) db.insert("ROLE",('00000822','Unbreakable',2000,'David Dunn','The Sixth Sense')) db.insert("ROLE",('00001276','Unbreakable',2000,'Audrey Dunn','Forrest Gump')) db.insert("ROLE",('00000862','Unbreakable',2000,'Joseph Dunn','')) db.insert("ROLE",('00000822','Armageddon',1998,'Harry S.Stamper','The Fifth Element')) db.insert("ROLE",('00000883','Armageddon',1998,'Dan Truman','')) db.insert("ROLE",('00000884','Armageddon',1998,'Grace Stamper','')) db.insert("ROLE",('00000822','The Kid',2000,'Russ Duritz','Armageddon')) db.insert("ROLE",('00000903','The Kid',2000,'Rusty Duritz','')) db.insert("ROLE",('00000904','The Kid',2000,'Amy','')) db.insert("ROLE",('00000822','Twelve Monkeys',1995,'James Cole','The Fifth Element')) db.insert("ROLE",('00000923','Twelve Monkeys',1995,'Young Cole','')) db.insert("ROLE",('00001198','Twelve Monkeys',1995,'Jeffrey Goines','Fight Club')) db.insert("ROLE",('00001006','Bullets Over Broadway',1994,'David Shayne','')) db.insert("ROLE",('00001007','Bullets Over Broadway',1994,'Julian Marx','While You Were Sleeping')) db.insert("ROLE",('00001008','Bullets Over Broadway',1994,'Rocco','')) db.insert("ROLE",('00001016','Tombstone',1993,'Kurt Russell','')) db.insert("ROLE",('00001017','Tombstone',1993,'Val Kilmer','Heat')) db.insert("ROLE",('00001018','Tombstone',1993,'Sam Elliott','')) db.insert("ROLE",('00001024','Alice',1990,'Joe','')) db.insert("ROLE",('00001025','Alice',1990,'Alice Tate','')) db.insert("ROLE",('00001026','Alice',1990,'Doug Tate','')) db.insert("ROLE",('00001029','Mermaids',1990,'Rachel Flax','')) db.insert("ROLE",('00001030','Mermaids',1990,'Lou Landsky','')) db.insert("ROLE",('00001031','Mermaids',1990,'Charlotte Flax','Little Women')) db.insert("ROLE",('00001038','Exotica',1994,'Inspector','')) db.insert("ROLE",('00001039','Exotica',1994,'Thomas Pinto','')) db.insert("ROLE",('00001040','Exotica',1994,'Christina','')) db.insert("ROLE",('00001045','Red Rock West',1992,'Michael Williams','')) db.insert("ROLE",('00001046','Red Rock West',1992,'Jim','')) db.insert("ROLE",('00001053','Chaplin',1992,'Charlie Chaplin','')) db.insert("ROLE",('00001054','Chaplin',1992,'Hannah Chaplin','')) db.insert("ROLE",('00001055','Chaplin',1992,'Sydney Chaplin','')) db.insert("ROLE",('00001062','Fearless',1993,'Max Klein','')) db.insert("ROLE",('00001063','Fearless',1993,'Laura Klein','')) db.insert("ROLE",('00001064','Fearless',1993,'Carla Rodrigo','')) db.insert("ROLE",('00001071','Threesome',1994,'Alex','')) db.insert("ROLE",('00001072','Threesome',1994,'Stuart','')) db.insert("ROLE",('00001073','Threesome',1994,'Eddy','')) db.insert("ROLE",('00001080','Jungle Fever',1991,'Flipper Purify','')) db.insert("ROLE",('00001081','Jungle Fever',1991,'Angie Tucci','')) db.insert("ROLE",('00001088','Internal Affairs',1990,'Dennis Peck','')) db.insert("ROLE",('00001089','Internal Affairs',1990,'Raymond Avila','Dead Again')) db.insert("ROLE",('00001090','Internal Affairs',1990,'Kathleen Avila','')) db.insert("ROLE",('00001098','Single White Female',1992,'Allison Jones','')) db.insert("ROLE",('00001099','Single White Female',1992,'Hedra Carlson','')) db.insert("ROLE",('00001100','Single White Female',1992,'Sam Rawson','')) db.insert("ROLE",('00001105','Trust',1990,'Maria Coughlin','')) db.insert("ROLE",('00001106','Trust',1990,'Matthew Slaughter','Amateur')) db.insert("ROLE",('00001112','Ju Dou',1990,'Ju Dou','Daohong Denglong Gaogao Gua')) db.insert("ROLE",('00001113','Ju Dou',1990,'Yang Tian-qing','')) db.insert("ROLE",('00001112','Dahong Denglong Gaogao Gua',1991,'Songlian','Ju Dou')) db.insert("ROLE",('00001120','Dahong Denglong Gaogao Gua',1991,'The Third Concubine','')) db.insert("ROLE",('00001119','Dahong Denglong Gaogao Gua',1991,'The Master','')) db.insert("ROLE",('00001125','Cyrano de Bergerac',1990,'Cyrano De Bergerac','')) db.insert("ROLE",('00001126','Cyrano de Bergerac',1990,'Roxane','')) db.insert("ROLE",('00001005','Manhattan Murder Mystery',1993,'Larry Lipton','')) db.insert("ROLE",('00001131','Manhattan Murder Mystery',1993,'Carol Lipton','Hanging Up')) db.insert("ROLE",('00001133','El Mariachi',1992,'El Mariachi','')) db.insert("ROLE",('00001134','El Mariachi',1992,'Domino','')) db.insert("ROLE",('00001137','Once Were Warriors',1994,'Beth Heke','')) db.insert("ROLE",('00001138','Once Were Warriors',1994,'Jake Heke','')) db.insert("ROLE",('00001145','Priest',1994,'Father Greg Pilkington','')) db.insert("ROLE",('00001146','Priest',1994,'Father Matthew Thomas','Shakespeare in Love')) db.insert("ROLE",('00001152','Pump Up the Volum',1990,'Mark Hunter','')) db.insert("ROLE",('00001153','Pump Up the Volum',1990,'Nora Diniro','Little Women')) db.insert("ROLE",('00001160','Benny and Joon',1993,'Sam','')) db.insert("ROLE",('00001161','Benny and Joon',1993,'Juniper Pearl','')) db.insert("ROLE",('00001167','Six Degrees of Separation',1993,'Ouisa Kittredge','')) db.insert("ROLE",('00001168','Six Degrees of Separation',1993,'Paul','')) db.insert("ROLE",('00001169','Six Degrees of Separation',1993,'John Flanders','')) db.insert("ROLE",('00001175','Bawang Bie Ji',1993,'Cheng Dieyi','')) db.insert("ROLE",('00001176','Bawang Bie Ji',1993,'Duan Xiaolou','')) db.insert("ROLE",('00001112','Bawang Bie Ji',1993,'Juxian','')) db.insert("ROLE",('00001181','In the Line of Fire',1993,'Secret Service Agent Frank Horrigan','')) db.insert("ROLE",('00001182','In the Line of Fire',1993,'Mitch Leary','')) db.insert("ROLE",('00001183','In the Line of Fire',1993,'Secret Service Agent Lilly Raines','Lethal Weapon 4')) db.insert("ROLE",('00001187','Heavenly Creatures',1994,'Pauline Yvonne Rieper','')) db.insert("ROLE",('00001188','Heavenly Creatures',1994,'Juliet Marion Hulme','Titanic')) db.insert("ROLE",('00001192','Hoop Dreams',1994,'Himself','')) db.insert("ROLE",('00001193','Hoop Dreams',1994,'Arthur','')) db.insert("ROLE",('00001197','Seven',1995,'Detective William Somerset','')) db.insert("ROLE",('00001198','Seven',1995,'Detective David Mills','Legends of the Fall')) db.insert("ROLE",('00001204','Shallow Grave',1994,'Juliet Miller','')) db.insert("ROLE",('00001205','Shallow Grave',1994,'David Stephens','')) db.insert("ROLE",('00001206','Shallow Grave',1994,'Alex Law','')) db.insert("ROLE",('00001212','French Kiss',1995,'Kate','You have Got Mail')) db.insert("ROLE",('00001213','French Kiss',1995,'Luc Teyssier','')) db.insert("ROLE",('00001214','French Kiss',1995,'Charlie','')) db.insert("ROLE",('00001217','Braindead',1992,'Lionel Cosgrove','')) db.insert("ROLE",('00001218','Braindead',1992,'Paquita Maria Sanchez','')) db.insert("ROLE",('00001219','Braindead',1992,'Mum','')) db.insert("ROLE",('00001186','Braindead',1992,'Undertaker Assistant','')) db.insert("ROLE",('00001222','Clerks',1994,'Veronica Loughran','')) db.insert("ROLE",('00001223','Clerks',1994,'Caitlin Bree','')) db.insert("ROLE",('00001227','Apollo 13',1995,'Jim Lovell','Forrest Gump')) db.insert("ROLE",('00001228','Apollo 13',1995,'Fred Haise','')) db.insert("ROLE",('00001229','Apollo 13',1995,'Jack Swigert','Wild Things')) db.insert("ROLE",('00001233','Reservoir Dogs',1992,'Larry','Pulp Fiction')) db.insert("ROLE",('00001234','Reservoir Dogs',1992,'Freddy','')) db.insert("ROLE",('00001235','Reservoir Dogs',1992,'Vic','')) db.insert("ROLE",('00001238','Pulp Fiction',1994,'Vincent Vega','')) db.insert("ROLE",('00001239','Pulp Fiction',1994,'Jules Winnfield','')) db.insert("ROLE",('00001233','Pulp Fiction',1994,'Winston Wolf','Reservoir Dogs')) db.insert("ROLE",('00001242','Yinshi Nan Nu',1994,'Chu','')) db.insert("ROLE",('00001243','Yinshi Nan Nu',1994,'Jia-Ning','')) db.insert("ROLE",('00001244','Yinshi Nan Nu',1994,'Jia-Chien','')) db.insert("ROLE",('00001249','Short Cuts',1993,'Ann Finnigan','')) db.insert("ROLE",('00001250','Short Cuts',1993,'Howard Finnigan','')) db.insert("ROLE",('00001251','Short Cuts',1993,'Paul Finnigan','')) db.insert("ROLE",('00001198','Legends of the Fall',1994,'Tristan Ludlow','Seven')) db.insert("ROLE",('00001256','Legends of the Fall',1994,'Colonel William Ludlow','Shadowlands')) db.insert("ROLE",('00001257','Legends of the Fall',1994,'Alfred Ludlow','')) db.insert("ROLE",('00001262','Natural Born Killers',1994,'Mickey Knox','')) db.insert("ROLE",('00001263','Natural Born Killers',1994,'Mallory Wilson Knox','')) db.insert("ROLE",('00001264','Natural Born Killers',1994,'Wayne Gale','')) db.insert("ROLE",('00001269','In the Mouth of Madness',1995,'John Trent','Jurassic Park')) db.insert("ROLE",('00001270','In the Mouth of Madness',1995,'Sutter Cane','')) db.insert("ROLE",('00001271','In the Mouth of Madness',1995,'Linda Styles','')) db.insert("ROLE",('00001227','Forrest Gump',1994,'Forrest Gump','Apollo 13')) db.insert("ROLE",('00001276','Forrest Gump',1994,'Jenny Curran','Unbreakable')) db.insert("ROLE",('00001277','Forrest Gump',1994,'Lieutenant Daniel Taylor','')) db.insert("ROLE",('00001281','Malcolm X',1992,'Malcolm X','')) db.insert("ROLE",('00001282','Malcolm X',1992,'Betty Shabazz','')) db.insert("ROLE",('00001079','Malcolm X',1992,'Shorty','')) db.insert("ROLE",('00001284','Dead Again',1991,'Mike Church','')) db.insert("ROLE",('00001089','Dead Again',1991,'Gray Baker','Internal Affaris')) db.insert("ROLE",('00001286','Dead Again',1991,'Margaret Strauss','')) db.insert("ROLE",('00001269','Jurassic Park',1993,'Alan Grant','In the Mouth of Madness')) db.insert("ROLE",('00001293','Jurassic Park',1993,'Ellie Sattler','')) db.insert("ROLE",('00001294','Jurassic Park',1993,'Ian Malcolm','')) db.insert("ROLE",('00001051','Jurassic Park',1993,'John Parker Hammond','')) db.insert("ROLE",('00001298','Clueless',1995,'Cher Horowitz','')) db.insert("ROLE",('00001299','Clueless',1995,'Dionne','')) db.insert("ROLE",('00001300','Clueless',1995,'Tai Fraiser','')) db.insert("ROLE",('00001256','Shadowlands',1993,'Lewis','Legends of the Fall')) db.insert("ROLE",('00001307','Shadowlands',1993,'Joy Gresham','')) db.insert("ROLE",('00001308','Shadowlands',1993,'Arnold Dopliss','')) db.insert("ROLE",('00001312','Amateur',1994,'Isabelle','')) db.insert("ROLE",('00001106','Amateur',1994,'Thomas Ludens','Trust')) db.insert("ROLE",('00001313','Amateur',1994,'Sofia Ludens','')) db.insert("ROLE",('00001318','GoodFellas',1990,'James','')) db.insert("ROLE",('00001319','GoodFellas',1990,'Henry Hill','')) db.insert("ROLE",('00001320','GoodFellas',1990,'Tommy DeVito','')) db.insert("ROLE",('00001031','Little Women',1994,'Josephine','Mermaids')) db.insert("ROLE",('00001326','Little Women',1994,'Friedrich','')) db.insert("ROLE",('00001327','Little Women',1994,'Margaret','')) db.insert("ROLE",('00001153','Little Women',1994,'Older Amy March','Pump Up the Volum')) db.insert("ROLE",('00001333','While You Were Sleeping',1995,'Narrator','')) db.insert("ROLE",('00001334','While You Were Sleeping',1995,'Jack Callaghan','')) db.insert("ROLE",('00001007','While You Were Sleeping',1995,'Saul','Bullets Over Broadway')) db.insert("PERSON",('00001001','James','Stewart',1908)) db.insert("PERSON",('00001002','Grace','Kelly',1929)) db.insert("PERSON",('00001003','Raymond','Burr',1917)) db.insert("PERSON",('00001004','John Michael','Hayes',1919)) db.insert("PERSON",('00000982','Delia','Ephron',1943)) db.insert("PERSON",('00000983','Lisa','Kudrow',1963)) db.insert("PERSON",('00000961','Taylor','Hackford',1945)) db.insert("PERSON",('00000962','Tony','Gilroy (I)',1962)) db.insert("PERSON",('00000963','David','Morse',1953)) db.insert("PERSON",('00000941','John','Lasseter',1957)) db.insert("PERSON",('00000942','Tim','Allen',1953)) db.insert("PERSON",('00000943','Annie','Potts',1952)) db.insert("PERSON",('00000921','Terry','Gilliam',1940)) db.insert("PERSON",('00000922','Chris','Marker',1921)) db.insert("PERSON",('00000923','Joseph','Melito',1932)) db.insert("PERSON",('00000902','Audrey','Wells',1961)) db.insert("PERSON",('00000903','Spencer','Breslin',1992)) db.insert("PERSON",('00000904','Emily','Mortimer',1971)) db.insert("PERSON",('00000881','Michael','Bay',1965)) db.insert("PERSON",('00000882','Robert','Roy Pool',1957)) db.insert("PERSON",('00000883','Billy','Bob Thornton',1955)) db.insert("PERSON",('00000884','Liv','Tyler',1977)) db.insert("PERSON",('00000862','Spencer','Clark',1987)) db.insert("PERSON",('00000841','M. Night','Shyamalan',1970)) db.insert("PERSON",('00000842','Haley','Joel Osment',1988)) db.insert("PERSON",('00000843','Toni','Collette',1972)) db.insert("PERSON",('00000821','Luc','Besson',1959)) db.insert("PERSON",('00000822','Bruce','Willis',1955)) db.insert("PERSON",('00000823','Gary','Oldman',1958)) db.insert("PERSON",('00000824','Milla','Jovovich',1975)) db.insert("PERSON",('00000801','Richard','Donner',1930)) db.insert("PERSON",('00000802','Jonathan','Lemkin',1948)) db.insert("PERSON",('00000803','Danny','Glover',1946)) db.insert("PERSON",('00000781','Daniel','Myrick',1964)) db.insert("PERSON",('00000782','Heather','Donahue',1974)) db.insert("PERSON",('00000783','Joshua','Leonard',1975)) db.insert("PERSON",('00000784','Michael','C. Williams',1973)) db.insert("PERSON",('00000761','Marie','Brenner',1963)) db.insert("PERSON",('00000762','Diane','Venora',1952)) db.insert("PERSON",('00000741','Jon','Amiel',1948)) db.insert("PERSON",('00000742','Ronald','Bass',1943)) db.insert("PERSON",('00000743','Sean','Connery',1930)) db.insert("PERSON",('00000744','Ving','Rhames',1961)) db.insert("PERSON",('00000721','Elmore','Leonard',1925)) db.insert("PERSON",('00000722','George','Clooney',1961)) db.insert("PERSON",('00000723','Jim','Robinson (I)',1947)) db.insert("PERSON",('00000724','Jennifer','Lopez',1970)) db.insert("PERSON",('00000701','Chuck','Palahniuk',1955)) db.insert("PERSON",('00000703','Meat','Loaf',1951)) db.insert("PERSON",('00000681','Tony','Kaye (I)',1968)) db.insert("PERSON",('00000682','David ','McKenna',1968)) db.insert("PERSON",('00000683','Edward','Norton',1969)) db.insert("PERSON",('00000684','Edward','Furlong',1977)) db.insert("PERSON",('00000685','Beverly','DAngelo',1969)) db.insert("PERSON",('00000661','Michael','Mann',1943)) db.insert("PERSON",('00000662','Al','Pacino',1940)) db.insert("PERSON",('00000663','Robert','De Niro',1943)) db.insert("PERSON",('00000641','Michael','Apted',1941)) db.insert("PERSON",('00000642','Neal','Purvis',1950)) db.insert("PERSON",('00000643','Pierce','Brosnan',1953)) db.insert("PERSON",('00000644','Sophie','Marceau',1966)) db.insert("PERSON",('00000645','Denise','Richards',1972)) db.insert("PERSON",('00000621','David','H. Franzoni',1967)) db.insert("PERSON",('00000622','Russell','Crowe',1964)) db.insert("PERSON",('00000623','Joaquin','Phoenix',1974)) db.insert("PERSON",('00000624','Connie','Nielsen',1965)) db.insert("PERSON",('00000601','Jean-Pierre','Jeunet',1955)) db.insert("PERSON",('00000602','Joss','Whedon',1964)) db.insert("PERSON",('00000604','Dominique','Pinon',1955)) db.insert("PERSON",('00000582','Vincent','Ward',1956)) db.insert("PERSON",('00000583','Charles','Dutton',1951)) db.insert("PERSON",('00000584','Charles','Dance',1946)) db.insert("PERSON",('00000561','Carrie','Henn',1976)) db.insert("PERSON",('00000562','Don','Sharpe',1968)) db.insert("PERSON",('00000563','Suzanne','M. Benson',1959)) db.insert("PERSON",('00000564','Brian','Johnson (I)',1970)) db.insert("PERSON",('00000541','Ridley','Scott',1937)) db.insert("PERSON",('00000542','Dan','OBannon',1946)) db.insert("PERSON",('00000543','Tom','Skerritt',1933)) db.insert("PERSON",('00000544','Sigourney','Weaver',1949)) db.insert("PERSON",('00000545','Derrick','Leather',1960)) db.insert("PERSON",('00000546','Michael','Seymour (I)',1958)) db.insert("PERSON",('00000547','Nick','Allder',1963)) db.insert("PERSON",('00000521','John','McNaughton',1950)) db.insert("PERSON",('00000522','Stephen ','Peters',1947)) db.insert("PERSON",('00000524','Matt','Dillon',1964)) db.insert("PERSON",('00000501','Roger','Kumble',1966)) db.insert("PERSON",('00000502','Choderlos','de Laclos',1741)) db.insert("PERSON",('00000503','Reese','Witherspoon',1976)) db.insert("PERSON",('00000504','Selma','Blair',1972)) db.insert("PERSON",('00000481','Jim','Gillespie (I)',1968)) db.insert("PERSON",('00000482','Lois','Duncan',1972)) db.insert("PERSON",('00000483','Jennifer','Love Hewitt',1979)) db.insert("PERSON",('00000484','Ryan','Phillippe',1974)) db.insert("PERSON",('00000485','Sarah','Michelle Gellar',1977)) db.insert("PERSON",('00000461','Robert','Bloch',1917)) db.insert("PERSON",('00000462','Anthony','Perkins',1932)) db.insert("PERSON",('00000463','Vera','Miles',1929)) db.insert("PERSON",('00000464','Janet','Leigh',1927)) db.insert("PERSON",('00000465','John','Gavin',1928)) db.insert("PERSON",('00000466','Paul','Jasmin',1921)) db.insert("PERSON",('00000441','Steven','Soderbergh',1963)) db.insert("PERSON",('00000442','Stephen','Gaghan',1956)) db.insert("PERSON",('00000443','Michael','Douglas',1944)) db.insert("PERSON",('00000444','Benicio','Del Toro',1967)) db.insert("PERSON",('00000445','Catherine','Zeta-Jones',1969)) db.insert("PERSON",('00000446','Stephen','Bauer',1956)) db.insert("PERSON",('00000447','Luis','Guzman',1967)) db.insert("PERSON",('00000448','Amy','Irving',1953)) db.insert("PERSON",('00000449','Erika','Christensen',1982)) db.insert("PERSON",('00000450','Don','Cheadle',1964)) db.insert("PERSON",('00000451','Jacob','Vargas',1963)) db.insert("PERSON",('00000452','Clifton','Collins',1971)) db.insert("PERSON",('00000421','Liev','Schreiber',1967)) db.insert("PERSON",('00000422','Beth','Toussaint',1962)) db.insert("PERSON",('00000423','Roger','Jackson',1965)) db.insert("PERSON",('00000424','Kelly','Rutherford',1968)) db.insert("PERSON",('00000401','Wes','Craven',1939)) db.insert("PERSON",('00000402','Kevin','Williamson',1965)) db.insert("PERSON",('00000403','David','Arquette',1971)) db.insert("PERSON",('00000404','Neve','Campbell',1973)) db.insert("PERSON",('00000405','Courteney','Cox',1964)) db.insert("PERSON",('00000381','Mary','Harron (I)',1966)) db.insert("PERSON",('00000382','Bret','Easton Ellis',1964)) db.insert("PERSON",('00000383','Christian','Bale',1974)) db.insert("PERSON",('00000384','Willem','Dafoe',1955)) db.insert("PERSON",('00000385','Jared','Leto',1971)) db.insert("PERSON",('00000361','Mark','Lamprell',1950)) db.insert("PERSON",('00000362','Nicholas','Bishop',1974)) db.insert("PERSON",('00000363','Rose','Byrne',1953)) db.insert("PERSON",('00000364','Sinead','Cusack',1948)) db.insert("PERSON",('00000341','Baz','Luhrmann',1942)) db.insert("PERSON",('00000342','Craig','Pearce',1948)) db.insert("PERSON",('00000343','Paul','Mercurio',1963)) db.insert("PERSON",('00000344','Tara','Morice',1967)) db.insert("PERSON",('00000345','Pat','Thompson (II)',1940)) db.insert("PERSON",('00000346','Barry','Otto',1965)) db.insert("PERSON",('00000347','Jill','Bilcock',1967)) db.insert("PERSON",('00000348','Catherine','Martin (I)',1950)) db.insert("PERSON",('00000349','Angus','Strathie',1954)) db.insert("PERSON",('00000321','George','Miller (II)',1945)) db.insert("PERSON",('00000322','James','McCausland',1943)) db.insert("PERSON",('00000323','Mel','Gibson',1956)) db.insert("PERSON",('00000324','Joanne','Samuel',1951)) db.insert("PERSON",('00000325','Brian','May (I)',1934)) db.insert("PERSON",('00000001','James','Cameron',1954)) db.insert("PERSON",('00000002','Leonardo','DiCaprio',1974)) db.insert("PERSON",('00000004','Billy','Zane',1966)) db.insert("PERSON",('00000005','Kathy','Bates',1948)) db.insert("PERSON",('00000006','Michael','Ford (I)',1966)) db.insert("PERSON",('00000007','Russell','Carpenter',1971)) db.insert("PERSON",('00000008','Deborah','Lynn Scott',1968)) db.insert("PERSON",('00000009','Thomas','L.Fisher',1956)) db.insert("PERSON",('00000010','Tom','Bellfort',1964)) db.insert("PERSON",('00000011','Conrad','Buff IV',1956)) db.insert("PERSON",('00000012','James','Horner',1953)) db.insert("PERSON",('00000013','Will','Jennings (II)',1961)) db.insert("PERSON",('00000021','John','Madden',1949)) db.insert("PERSON",('00000022','Marc','Norman',1952)) db.insert("PERSON",('00000023','Geoffrey','Rush',1951)) db.insert("PERSON",('00000025','Steve','ODonnell',1956)) db.insert("PERSON",('00000026','Judi','Dench',1934)) db.insert("PERSON",('00000027','Sandy','Powell',1940)) db.insert("PERSON",('00000041','Lasse','Hallstrom',1946)) db.insert("PERSON",('00000042','John','Irving',1942)) db.insert("PERSON",('00000043','Kate','Nelligan',1950)) db.insert("PERSON",('00000044','Tobey','Maguire',1975)) db.insert("PERSON",('00000045','Charlize','Theron',1975)) db.insert("PERSON",('00000046','Delroy','Lindo',1952)) db.insert("PERSON",('00000047','Michael','Caine',1958)) db.insert("PERSON",('00000062','John','Briley',1925)) db.insert("PERSON",('00000063','Ben','Kingsley',1943)) db.insert("PERSON",('00000064','Candice','Bergen',1946)) db.insert("PERSON",('00000065','Roshan','Seth',1942)) db.insert("PERSON",('00000066','Edward','Fox',1937)) db.insert("PERSON",('00000081','Sam','Mendes',1965)) db.insert("PERSON",('00000082','Alan','Ball',1957)) db.insert("PERSON",('00000083','Kevin','Spacey',1959)) db.insert("PERSON",('00000084','Annette','Bening',1958)) db.insert("PERSON",('00000085','Thora','Birch',1982)) db.insert("PERSON",('00000086','Wes','Bentley',1978)) db.insert("PERSON",('00000101','Paul','Schrader',1946)) db.insert("PERSON",('00000102','Russell','Banks',1940)) db.insert("PERSON",('00000103','Nick','Nolte',1941)) db.insert("PERSON",('00000104','Brigid','Tierney',1948)) db.insert("PERSON",('00000105','Holmes','Osborne',1950)) db.insert("PERSON",('00000106','Jim','True',1945)) db.insert("PERSON",('00000107','James','Coburn',1928)) db.insert("PERSON",('00000121','Roberto','Benigini',1952)) db.insert("PERSON",('00000122','Vincenzo','Cerami',1940)) db.insert("PERSON",('00000123','Nicoletta','Braschi',1960)) db.insert("PERSON",('00000141','Kimberly','Peirce',1967)) db.insert("PERSON",('00000142','Andy','Bienen',1965)) db.insert("PERSON",('00000143','Hilary','Swank',1974)) db.insert("PERSON",('00000144','Chloe','Sevigny',1974)) db.insert("PERSON",('00000145','Peter','Sarsgaard',1972)) db.insert("PERSON",('00000146','Brendan','Sexton III',1980)) db.insert("PERSON",('00000162','Robert','Rodat',1953)) db.insert("PERSON",('00000164','Tom','Sizemore',1964)) db.insert("PERSON",('00000165','Edwards','Burns',1968)) db.insert("PERSON",('00000166','Barry','Pepper',1970)) db.insert("PERSON",('00000181','Alfred','Hitchcock',1932)) db.insert("PERSON",('00000182','Daphne','Du Maurier',1940)) db.insert("PERSON",('00000183','Evan','Hunter',1937)) db.insert("PERSON",('00000184','Rod','Taylor',1935)) db.insert("PERSON",('00000185','Jessica','Tandy',1941)) db.insert("PERSON",('00000186','Suzanne','Pleshette',1938)) db.insert("PERSON",('00000187','Tippi','Hedren',1931)) db.insert("PERSON",('00000201','Andy','Wachowski',1965)) db.insert("PERSON",('00000202','Larry','Wachowski',1968)) db.insert("PERSON",('00000203','Keanu','Reeves',1972)) db.insert("PERSON",('00000204','Laurence','Fishburne',1970)) db.insert("PERSON",('00000205','John','Gaeta',1962)) db.insert("PERSON",('00000206','Janek','Sirrs',1957)) db.insert("PERSON",('00000207','Steve','Courtley',1961)) db.insert("PERSON",('00000208','Jon','Thum',1956)) db.insert("PERSON",('00000209','Dane','A.davis',1966)) db.insert("PERSON",('00000222','Nora','Ephron',1941)) db.insert("PERSON",('00000223','Parker','Posey',1968)) db.insert("PERSON",('00000241','Harry','Sinclair (II)',1965)) db.insert("PERSON",('00000242','Danielle','Cormack',1959)) db.insert("PERSON",('00000243','Karl','Urban',1972)) db.insert("PERSON",('00000244','Willa','ONeill',1970)) db.insert("PERSON",('00000261','Leon','Narbey',1958)) db.insert("PERSON",('00000262','Stephen','Grives',1971)) db.insert("PERSON",('00000263','Jennifer','Ward-Lealand',1966)) db.insert("PERSON",('00000264','Michael','Hurst (I)',1957)) db.insert("PERSON",('00000281','Joel','Tobeck',1971)) db.insert("PERSON",('00000282','Ian','Hughes (I)',1968)) db.insert("PERSON",('00000301','Jane','Campion',1954)) db.insert("PERSON",('00000302','Holly','Hunter',1958)) db.insert("PERSON",('00000304','Anna','Paquin',1982)) db.insert("PERSON",('00000306','Janet','Patterson',1967)) db.insert("PERSON",('00000307','Andrew','McAlpine',1962)) db.insert("PERSON",('00001005','Woody','Allen',1935)) db.insert("PERSON",('00001006','John','Cusack',1966)) db.insert("PERSON",('00001007','Jack','Warden',1920)) db.insert("PERSON",('00001008','Tony','Sirico',1942)) db.insert("PERSON",('00001009','Robert','Greenhut',1943)) db.insert("PERSON",('00001010','Carlo','DiPalma',1925)) db.insert("PERSON",('00001011','Susan E.','Morse',1930)) db.insert("PERSON",('00001012','Juliet','Taylor',1967)) db.insert("PERSON",('00001013','Jeffrey','Kurland',1958)) db.insert("PERSON",('00001014','George P.','Cosmatos',1941)) db.insert("PERSON",('00001015','Kevin','Jarre',1938)) db.insert("PERSON",('00001016','Kurt','Russell',1951)) db.insert("PERSON",('00001017','Val','Kilmer',1959)) db.insert("PERSON",('00001018','Sam','Elliott',1944)) db.insert("PERSON",('00001019','Sean','Daniel',1951)) db.insert("PERSON",('00001020','William A.','Fraker',1923)) db.insert("PERSON",('00001021','Harvey','Rosenstock',1935)) db.insert("PERSON",('00001022','Lora','Kennedy',1940)) db.insert("PERSON",('00001023','Joseph A.','Porro',1943)) db.insert("PERSON",('00001024','Joe','Mantegna',1947)) db.insert("PERSON",('00001025','Mia','Farrow',1945)) db.insert("PERSON",('00001026','William','Hurt',1950)) db.insert("PERSON",('00001027','Richard','Benjamin',1938)) db.insert("PERSON",('00001028','Patty','Dann',1942)) db.insert("PERSON",('00001029','Cherilyn','LaPierre',1946)) db.insert("PERSON",('00001030','Bob','Hoskins',1942)) db.insert("PERSON",('00001031','Winona','Ryder',1971)) db.insert("PERSON",('00001032','Lauren','Lloyd',1941)) db.insert("PERSON",('00001033','Howard','Atherton',1938)) db.insert("PERSON",('00001034','Jacqueline','Cambas',1952)) db.insert("PERSON",('00001035','Margery','Simkin',1947)) db.insert("PERSON",('00001036','Marit','Allen',1954)) db.insert("PERSON",('00001037','Atom','Egoyan',1960)) db.insert("PERSON",('00001038','David','Hemblen',1958)) db.insert("PERSON",('00001039','Don','Mckellar',1963)) db.insert("PERSON",('00001040','Mia','Kirshner',1976)) db.insert("PERSON",('00001041','Paul','Sarossy',1963)) db.insert("PERSON",('00001042','Susan','Shipton',1959)) db.insert("PERSON",('00001043','Linda','Muir',1960)) db.insert("PERSON",('00001044','John','Dahl',1956)) db.insert("PERSON",('00001045','Nicolas','Cage',1964)) db.insert("PERSON",('00001046','Craig','Reay',1967)) db.insert("PERSON",('00001047','Steve','Golin',1958)) db.insert("PERSON",('00001048','Marc','Reshovsky',1965)) db.insert("PERSON",('00001049','Scott','Chestnut',1959)) db.insert("PERSON",('00001050','Terry','Dresbach',1964)) db.insert("PERSON",('00001051','Richard','Attenborough',1923)) db.insert("PERSON",('00001052','Charles','Chaplin',1889)) db.insert("PERSON",('00001053','Robert','Downey Jr.',1965)) db.insert("PERSON",('00001054','Geraldine','Chaplin',1944)) db.insert("PERSON",('00001055','Paul','Rhys',1963)) db.insert("PERSON",('00001056','Sven','Nykvist',1922)) db.insert("PERSON",('00001057','Anne V.','Coates',1925)) db.insert("PERSON",('00001058','Mike','Fenton',1947)) db.insert("PERSON",('00001059','Ellen','Mirojnick',1949)) db.insert("PERSON",('00001060','Peter','Weir',1944)) db.insert("PERSON",('00001061','Rafael','Yglesias',1954)) db.insert("PERSON",('00001062','Jeff','Bridges',1949)) db.insert("PERSON",('00001063','Isabella','Rossellini',1952)) db.insert("PERSON",('00001064','Rosie','Perez',1964)) db.insert("PERSON",('00001065','Mark','Rosenberg',1948)) db.insert("PERSON",('00001066','Allen','Daviau',1953)) db.insert("PERSON",('00001067','Bill','Anderson',1962)) db.insert("PERSON",('00001068','Howard','Feuer',1965)) db.insert("PERSON",('00001069','Marilyn','Matthews',1955)) db.insert("PERSON",('00001070','Andrew','Fleming',1946)) db.insert("PERSON",('00001071','Lara','Boyle',1970)) db.insert("PERSON",('00001072','Stephen','Baldwin',1966)) db.insert("PERSON",('00001073','Josh','Charles',1971)) db.insert("PERSON",('00001074','Brad','Krevoy',1967)) db.insert("PERSON",('00001075','Alexander','Gruszynski',1954)) db.insert("PERSON",('00001076','Bill','Carruth',1949)) db.insert("PERSON",('00001077','Ed','Mitchell',1955)) db.insert("PERSON",('00001078','Deborah','Everton',1962)) db.insert("PERSON",('00001079','Spike','Lee',1957)) db.insert("PERSON",('00001080','Wesley','Snipes',1962)) db.insert("PERSON",('00001081','Annabella','Sciorra',1964)) db.insert("PERSON",('00001082','Ernest R.','Dickerson',1952)) db.insert("PERSON",('00001083','Samuel D.','Pollard',1963)) db.insert("PERSON",('00001084','Robi','Reed',1954)) db.insert("PERSON",('00001085','Ruth E.','Carter',1968)) db.insert("PERSON",('00001086','Mike','Figgis',1948)) db.insert("PERSON",('00001087','Henry','Bean',1943)) db.insert("PERSON",('00001088','Richard','Gere',1949)) db.insert("PERSON",('00001089','Andy','Carcia',1956)) db.insert("PERSON",('00001090','Nancy','Travis',1961)) db.insert("PERSON",('00001091','Frank','Mancuso',1958)) db.insert("PERSON",('00001092','John','Alonzo',1934)) db.insert("PERSON",('00001093','Robert','Estrin',1942)) db.insert("PERSON",('00001094','Carrie','Frazier',1947)) db.insert("PERSON",('00001095','Rudy','Dillon',1950)) db.insert("PERSON",('00001096','Barbet','Schroeder',1941)) db.insert("PERSON",('00001097','John','Lutz',1948)) db.insert("PERSON",('00001098','Bridget','Fonda',1964)) db.insert("PERSON",('00001099','Jennifer','Leigh',1962)) db.insert("PERSON",('00001100','Steven','Weber',1961)) db.insert("PERSON",('00001101','Luciano','Tovoli',1965)) db.insert("PERSON",('00001102','Lee','Percy',1971)) db.insert("PERSON",('00001103','Milena','Canonero',1965)) db.insert("PERSON",('00001104','Hal','Hartley',1959)) db.insert("PERSON",('00001105','Adrienne','Shelly',1966)) db.insert("PERSON",('00001106','Martin','Donovan',1957)) db.insert("PERSON",('00001107','Michael','Spiller',1961)) db.insert("PERSON",('00001108','Nick','Gomez',1963)) db.insert("PERSON",('00001109','Claudia','Brown',1962)) db.insert("PERSON",('00001110','Yimou','Zhang',1951)) db.insert("PERSON",('00001111','Heng','Liu',1964)) db.insert("PERSON",('00001112','Li','Gong',1965)) db.insert("PERSON",('00001113','Baotian','Li',1950)) db.insert("PERSON",('00001114','Hu','Jian',1962)) db.insert("PERSON",('00001115','Changwei','Gu',1965)) db.insert("PERSON",('00001116','Yuan','Du',1955)) db.insert("PERSON",('00001117','Zhi-an','Zhang',1963)) db.insert("PERSON",('00001118','Su','Tong',1957)) db.insert("PERSON",('00001119','Jingwu','Ma',1947)) db.insert("PERSON",('00001120','Caifei','He',1965)) db.insert("PERSON",('00001121','Fu-Sheng','Chiu',1956)) db.insert("PERSON",('00001122','Zhao','Fei',1952)) db.insert("PERSON",('00001123','Yuan','Du',1967)) db.insert("PERSON",('00001124','Jean-Paul','Rappeneau',1932)) db.insert("PERSON",('00001125','Gerard','Depardieu',1948)) db.insert("PERSON",('00001126','Anne','Brochet',1966)) db.insert("PERSON",('00001127','Rene','Cleitman',1940)) db.insert("PERSON",('00001128','Pierre','Lhomme',1930)) db.insert("PERSON",('00001129','Noelle','Boisson',1942)) db.insert("PERSON",('00001130','Franca','Squarciapion',1943)) db.insert("PERSON",('00001131','Diane','Keaton',1946)) db.insert("PERSON",('00001132','Robert','Rodriguez',1968)) db.insert("PERSON",('00001133','Carlos','Gallardo',1966)) db.insert("PERSON",('00001134','Consuelo','Gomez',1958)) db.insert("PERSON",('00001135','Lee','Tamahori',1950)) db.insert("PERSON",('00001136','Riwia','Brown',1953)) db.insert("PERSON",('00001137','Rena','Owen',1960)) db.insert("PERSON",('00001138','Temuera','Morrison',1961)) db.insert("PERSON",('00001139','Robin','Scholes',1965)) db.insert("PERSON",('00001140','Stuart','Dryburgh',1952)) db.insert("PERSON",('00001141','D.Michael','Horton',1958)) db.insert("PERSON",('00001142','Don','Selwyn',1960)) db.insert("PERSON",('00001143','Antonia','Bird',1963)) db.insert("PERSON",('00001144','Jimmy','McGovern',1949)) db.insert("PERSON",('00001145','Linus','Roache',1964)) db.insert("PERSON",('00001146','Tom','Wilkinson',1959)) db.insert("PERSON",('00001147','George','Faber',1961)) db.insert("PERSON",('00001148','Fred','Tammes',1963)) db.insert("PERSON",('00001149','Susan','Spivey',1957)) db.insert("PERSON",('00001150','Janet','Goddard',1965)) db.insert("PERSON",('00001151','Allan','Moyle',1947)) db.insert("PERSON",('00001152','Christian','Slater',1969)) db.insert("PERSON",('00001153','Samantha','Mathis',1970)) db.insert("PERSON",('00001154','Sandy','Stern',1968)) db.insert("PERSON",('00001155','Walt','Lloyd',1972)) db.insert("PERSON",('00001156','Larry','Bock',1962)) db.insert("PERSON",('00001157','Judith','Holstra',1964)) db.insert("PERSON",('00001158','Jeremiah S.','Chechik',1962)) db.insert("PERSON",('00001159','Barry','Berman',1957)) db.insert("PERSON",('00001160','Johnny','Depp',1963)) db.insert("PERSON",('00001161','Mary','Masterson',1966)) db.insert("PERSON",('00001162','John','Schwartzman',1965)) db.insert("PERSON",('00001163','Carol','Littleton',1957)) db.insert("PERSON",('00001164','Risa','Garcia',1956)) db.insert("PERSON",('00001165','Fred','Schepisi',1939)) db.insert("PERSON",('00001166','John','Guare',1938)) db.insert("PERSON",('00001167','Stockard','Channing',1944)) db.insert("PERSON",('00001168','Will','Smith',1968)) db.insert("PERSON",('00001169','Donald','Sutherland',1935)) db.insert("PERSON",('00001170','Ian','Baker',1947)) db.insert("PERSON",('00001171','Peter','Honess',1951)) db.insert("PERSON",('00001172','Ellen','Chenoweth',1962)) db.insert("PERSON",('00001173','Kaige','Chen',1952)) db.insert("PERSON",('00001174','Lillian','Lee',1954)) db.insert("PERSON",('00001175','Leslie','Cheung',1956)) db.insert("PERSON",('00001176','Fengyi','Zhang',1965)) db.insert("PERSON",('00001177','Feng','Hsu',1948)) db.insert("PERSON",('00001178','Xiaonan','Pei',1966)) db.insert("PERSON",('00001179','Wolfgang','Petersen',1941)) db.insert("PERSON",('00001180','Jeff','Maguire',1948)) db.insert("PERSON",('00001181','Clint','Eastwood',1930)) db.insert("PERSON",('00001182','John','Malkovich',1953)) db.insert("PERSON",('00001183','Rene','Russo',1954)) db.insert("PERSON",('00001184','John','Bailey',1942)) db.insert("PERSON",('00001185','Janet','Hirshenson',1950)) db.insert("PERSON",('00001186','Peter','Jackson',1961)) db.insert("PERSON",('00001187','Melanie','Lynskey',1977)) db.insert("PERSON",('00001188','Kate','Winslet',1975)) db.insert("PERSON",('00001189','Alun','Bollinger',1963)) db.insert("PERSON",('00001190','Jamie','Selkirk',1966)) db.insert("PERSON",('00001191','Steve','James',1957)) db.insert("PERSON",('00001192','William','Gates',1968)) db.insert("PERSON",('00001193','Arthur','Agee',1956)) db.insert("PERSON",('00001194','Peter','Gilbert',1963)) db.insert("PERSON",('00001195','David','Fincher',1962)) db.insert("PERSON",('00001196','Andrew','Walker',1964)) db.insert("PERSON",('00001197','Morgan','Freeman',1937)) db.insert("PERSON",('00001198','Brad','Pitt',1963)) db.insert("PERSON",('00001199','Darius','Khondji',1956)) db.insert("PERSON",('00001200','Richard','Francis-Bruce',1948)) db.insert("PERSON",('00001201','Kerry','Barden',1951)) db.insert("PERSON",('00001202','Danny','Boyle',1956)) db.insert("PERSON",('00001203','John','Hodge',1964)) db.insert("PERSON",('00001204','Kerry','Fox',1966)) db.insert("PERSON",('00001205','Christopher','Eccleston',1964)) db.insert("PERSON",('00001206','Ewan','McGregor',1971)) db.insert("PERSON",('00001207','Andrew','Macdonald',1966)) db.insert("PERSON",('00001208','Brian','Tufano',1968)) db.insert("PERSON",('00001209','Masahiro','Hirakubo',1964)) db.insert("PERSON",('00001210','Lawrence','Kasdan',1949)) db.insert("PERSON",('00001211','Adam','Brooks',1956)) db.insert("PERSON",('00001212','Meg','Ryan',1961)) db.insert("PERSON",('00001213','Kevin','Kline',1947)) db.insert("PERSON",('00001214','Timothy','Hutton',1960)) db.insert("PERSON",('00001215','Owen','Roizman',1936)) db.insert("PERSON",('00001216','Joe','Hutshing',1947)) db.insert("PERSON",('00001217','Timothy','Balme',1964)) db.insert("PERSON",('00001218','Diana','Penalver',1967)) db.insert("PERSON",('00001219','Elizabeth','Moody',1957)) db.insert("PERSON",('00001220','Murray','Milne',1959)) db.insert("PERSON",('00001221','Kevin','Smith',1970)) db.insert("PERSON",('00001222','Marilyn','Ghigliotti',1971)) db.insert("PERSON",('00001223','Lisa','Spoonhauer',1968)) db.insert("PERSON",('00001224','David','Klein',1965)) db.insert("PERSON",('00001225','Ron','Howard',1954)) db.insert("PERSON",('00001226','Jim','Lovell',1928)) db.insert("PERSON",('00001227','Tom','Hanks',1956)) db.insert("PERSON",('00001228','Bill','Paxton',1955)) db.insert("PERSON",('00001229','Kevin','Bacon',1958)) db.insert("PERSON",('00001230','Brian','Grazer',1951)) db.insert("PERSON",('00001231','Dean','Cundey',1945)) db.insert("PERSON",('00001232','Quentin','Tarantino',1963)) db.insert("PERSON",('00001233','Harvey','Keitel',1939)) db.insert("PERSON",('00001234','Tom','Roth',1961)) db.insert("PERSON",('00001235','Michael','Madsen',1958)) db.insert("PERSON",('00001236','Sally','Menke',1962)) db.insert("PERSON",('00001237','Ronnie','Yeskel',1967)) db.insert("PERSON",('00001238','John','Travolta',1954)) db.insert("PERSON",('00001239','Samuel','Jackson',1948)) db.insert("PERSON",('00001240','Lawrence','Bender',1958)) db.insert("PERSON",('00001241','Ang','Lee',1954)) db.insert("PERSON",('00001242','Sihung','Lung',1968)) db.insert("PERSON",('00001243','Yu-Wen','Wang',1969)) db.insert("PERSON",('00001244','Chien-lien','Wu',1968)) db.insert("PERSON",('00001245','Kong','Hsu',1956)) db.insert("PERSON",('00001246','Jong','Lin',1969)) db.insert("PERSON",('00001247','Tim','Squyres',1962)) db.insert("PERSON",('00001248','Robert','Altman',1925)) db.insert("PERSON",('00001249','Andie','MacDowell',1958)) db.insert("PERSON",('00001250','Bruce','Davison',1946)) db.insert("PERSON",('00001251','Jack','Lemmon',1925)) db.insert("PERSON",('00001252','Cary','Brokaw',1951)) db.insert("PERSON",('00001253','Geraldine','Peroni',1954)) db.insert("PERSON",('00001254','Edward','Zwick',1952)) db.insert("PERSON",('00001255','Jim','Harrison',1937)) db.insert("PERSON",('00001256','Anthony','Hopkins',1937)) db.insert("PERSON",('00001257','Aidan','Quinn',1959)) db.insert("PERSON",('00001258','John','Toll',1962)) db.insert("PERSON",('00001259','Steven','Rosenblum',1963)) db.insert("PERSON",('00001260','Mary','Colquhoun',1939)) db.insert("PERSON",('00001261','Oliver','Stone',1946)) db.insert("PERSON",('00001262','Woody','Harrelson',1961)) db.insert("PERSON",('00001263','Juliette','Lewis',1973)) db.insert("PERSON",('00001264','Robert','Richardson',1964)) db.insert("PERSON",('00001265','Brain','Berdan',1958)) db.insert("PERSON",('00001266','Richard','Hornung',1950)) db.insert("PERSON",('00001267','John','Carpenter',1948)) db.insert("PERSON",('00001268','Michael','Luca',1951)) db.insert("PERSON",('00001269','Sam','Neil',1947)) db.insert("PERSON",('00001270','Jurgen','Prochnow',1941)) db.insert("PERSON",('00001271','Julie','Carmen',1960)) db.insert("PERSON",('00001272','Gary','Kibbe',1954)) db.insert("PERSON",('00001273','Edward','Warschilka',1949)) db.insert("PERSON",('00001274','Robert','Zemeckis',1952)) db.insert("PERSON",('00001275','Winston','Groom',1944)) db.insert("PERSON",('00001276','Robin','Wright',1966)) db.insert("PERSON",('00001277','Gary','Sinise',1955)) db.insert("PERSON",('00001278','Wendy','Finerman',1953)) db.insert("PERSON",('00001279','Don','Burgess',1957)) db.insert("PERSON",('00001280','Ellen','Lewis',1961)) db.insert("PERSON",('00001281','Denzel','Washington',1954)) db.insert("PERSON",('00001282','Angela','Bassett',1958)) db.insert("PERSON",('00001283','Barry','Brown',1952)) db.insert("PERSON",('00001284','Kenneth','Branagh',1960)) db.insert("PERSON",('00001285','Scott','Frank',1960)) db.insert("PERSON",('00001286','Emma','Thompson',1959)) db.insert("PERSON",('00001287','Lindsay','Doran',1948)) db.insert("PERSON",('00001288','Matthew','Leonetti',1952)) db.insert("PERSON",('00001289','Peter','Berger',1955)) db.insert("PERSON",('00001290','Gail','Levin',1960)) db.insert("PERSON",('00001291','Steven','Spielberg',1946)) db.insert("PERSON",('00001292','Michael','Crichton',1942)) db.insert("PERSON",('00001293','Laura','Dern',1967)) db.insert("PERSON",('00001294','Jeff','Goldblum',1952)) db.insert("PERSON",('00001295','Kathleen','Kennedy',1947)) db.insert("PERSON",('00001296','Michael','Kahn',1924)) db.insert("PERSON",('00001297','Amy','Heckerling',1954)) db.insert("PERSON",('00001298','Alicia','Silverston',1976)) db.insert("PERSON",('00001299','Stacey','Dash',1966)) db.insert("PERSON",('00001300','Brittany','Murphy',1977)) db.insert("PERSON",('00001301','Scott','Rudin',1958)) db.insert("PERSON",('00001302','Bill','Pope',1961)) db.insert("PERSON",('00001303','Debra','Chiate',1970)) db.insert("PERSON",('00001304','Marcia','Ross',1969)) db.insert("PERSON",('00001305','Richard','Attenborough',1923)) db.insert("PERSON",('00001306','William','Nicholson',1948)) db.insert("PERSON",('00001307','Debra','Winger',1955)) db.insert("PERSON",('00001308','Roddy','Maude-Roxby',1930)) db.insert("PERSON",('00001309','Roger','Pratt',1947)) db.insert("PERSON",('00001310','Lesley','Walker',1956)) db.insert("PERSON",('00001311','Lucy','Boulting',1967)) db.insert("PERSON",('00001312','Isabelle','Huppert',1955)) db.insert("PERSON",('00001313','Elina','Lowensohn',1966)) db.insert("PERSON",('00001314','Steven','Hamilton',1968)) db.insert("PERSON",('00001315','Billy','Hopkins',1965)) db.insert("PERSON",('00001316','Alexandra','Welker',1959)) db.insert("PERSON",('00001317','Martin','Scorsese',1942)) db.insert("PERSON",('00001318','Robert','Niro',1943)) db.insert("PERSON",('00001319','Ray','Liotta',1955)) db.insert("PERSON",('00001320','Joe','Pesci',1943)) db.insert("PERSON",('00001321','Irwin','Winkler',1931)) db.insert("PERSON",('00001322','Michael','Ballhaus',1935)) db.insert("PERSON",('00001323','Thelma','Schoonmaker',1940)) db.insert("PERSON",('00001324','Gillian','Armstrong',1950)) db.insert("PERSON",('00001325','Lousia','Alcott',1832)) db.insert("PERSON",('00001326','Gabriel','Byrne',1950)) db.insert("PERSON",('00001327','Trini','Alvarado',1967)) db.insert("PERSON",('00001328','Denise','DiNovi',1955)) db.insert("PERSON",('00001329','Geoffrey','Simpson',1961)) db.insert("PERSON",('00001330','Nicholas','Beauman',1965)) db.insert("PERSON",('00001331','Jon','Turteltaub',1964)) db.insert("PERSON",('00001332','Daniel','Sullivan',1939)) db.insert("PERSON",('00001333','Sandra','Bullock',1964)) db.insert("PERSON",('00001334','Bill','Pullman',1953)) db.insert("PERSON",('00001335','Roger','Birnbaum',1954)) db.insert("PERSON",('00001336','Bruce','Green',1952)) db.insert("PERSON",('00001337','Cathy','Sandrich',1961))
model = """# Stochastic Simulation Algorithm input format R1: $pool > TF kTFsyn R2: TF > $pool kTFdeg*TF R3: TFactive > $pool kTFdeg*TFactive R4: TF > TFactive kActivate*TF R5: TFactive > TF kInactivate*TFactive R6: TFactive > mRNA + TFactive kmRNAsyn*(TFactive/(TFactive+kX)) R7: mRNA > $pool kmRNAdeg*mRNA R8: mRNA > Protein + mRNA kProteinsyn*mRNA R9: Protein > $pool kProteindeg*Protein # InitPar kTFsyn = 200 kTFdeg = 20 kActivate = 2000 kInactivate = 200 kX = 5 kmRNAsyn = 240 kmRNAdeg = 20 kProteinsyn = 400 kProteindeg = 2 # InitVar TF = 2 TFactive = 10 mRNA = 10 Protein = 220 """
class Solution: def assignBikes(self, W: List[List[int]], B: List[List[int]]) -> List[int]: ans, used = [-1] * len(W), set() for d, w, b in sorted([abs(W[i][0] - B[j][0]) + abs(W[i][1] - B[j][1]), i, j] for i in range(len(W)) for j in range(len(B))): if ans[w] == -1 and b not in used: ans[w] = b used.add(b) if len(used) == len(ans): break return ans
class OneLayerActiveScriptGen: def __init__(self, args): self.valid = args.split('|') pass def GenerateScript(self, arg2): if len(self.valid) == 1: #OK, this uses sub-layers Script = "for (i=0;i<app.activeDocument.layers.length;i++)\n" Script += "{\n" for vl in self.valid: Script += " lyr = app.activeDocument.layers[i];\n" Script += " if (lyr.name == '" + self.valid[0] + "') {" Script += " for (q=0;q<lyr.layers.length;q++) {\n" Script += " if (lyr.layers[q].name == '" + arg2 + "')\n" Script += " lyr.layers[q].visible = true;\n" Script += " else\n" Script += " lyr.layers[q].visible = false;\n" Script += " }; };\n" Script += "}\n" else: #This has a list of the layers we are going to use. Script = "for (i=0;i<app.activeDocument.layers.length;i++)\n" Script += "{\n" for vl in self.valid: Script += " if (app.activeDocument.layers[i].name == '" + vl + "') {\n" Script += " if (app.activeDocument.layers[i].name == '" + arg2 + "')\n" Script += " app.activeDocument.layers[i].visible = true;\n" Script += " else\n" Script += " app.activeDocument.layers[i].visible = false;\n" Script += " };\n" Script += "}\n" return Script
def downcase_keys(dict_): return {k.lower(): v for k, v in dict_.items()} def assert_aws4auth_in_headers(headers): lc_headers = downcase_keys(headers) assert 'authorization' in lc_headers assert 'x-amz-date' in lc_headers assert 'x-amz-content-sha256' in lc_headers auth_header = lc_headers.get('authorization') assert auth_header assert 'TESTKEY' in auth_header assert 'eu-west-1' in auth_header assert 'Signature=' in auth_header
class MyHashSet: def __init__(self): """ Initialize your data structure here. """ self.n = 853 self.hashtable = [None] * self.n def add(self, key: int) -> None: idx = key % self.n if not self.hashtable[idx]: self.hashtable[idx] = BST(key) else: tree = self.hashtable[idx] if not tree.search(key): tree.insert(key) def remove(self, key: int) -> None: idx = key % self.n if not self.hashtable[idx]: return None else: tree = self.hashtable[idx] if tree.search(key): tree.delete(key) if tree.isNone(): # print(idx, self.hashtable[idx]) self.hashtable[idx] = None def contains(self, key: int) -> bool: """ Returns true if this set contains the specified element """ idx = key % self.n if not self.hashtable[idx]: return False else: tree = self.hashtable[idx] # if key in (43, 974, 856, 616): # print('Tree:', tree) # print('cur_key: {}, result: {}'.format(key, tree.search(key))) return tree.search(key) class TreeNode: def __init__(self, val): self.val = val self.left = None self.right = None class BST: def __init__(self, val): self.root = TreeNode(val) def search(self, val): """ Find val in BST return True if any node.val == val """ def helper(node, val): if not node: return False if node.val > val: return helper(node.left, val) elif node.val < val: return helper(node.right, val) else: return True return helper(self.root, val) def insert(self, val): """ insert node with val in the BST """ node = self.root while node.val != val: if node.val > val: if not node.left: node.left = TreeNode(val) node = node.left else: if not node.right: node.right = TreeNode(val) node = node.right def _successor(self, node): node = node.right while node.left: node = node.left return node def _predecessor(self, node): node = node.left while node.right: node = node.right return node def delete(self, val): """ delete the node with val in BST """ def helper(node, val): if node.val > val: node.left = helper(node.left, val) elif node.val < val: node.right = helper(node.right, val) else: if not node.left and not node.right: return None elif node.right: node.val = self._successor(node).val node.right = helper(node.right, node.val) else: node.val = self._predecessor(node).val node.left = helper(node.left, node.val) return node self.root = helper(self.root, val) def isNone(self): if self.root is None: return True return False def __repr__(self): res = [] def helper(node): if not node: return helper(node.left) res.append(str(node.val)) helper(node.right) helper(self.root) return ' '.join(res) # Your MyHashSet object will be instantiated and called as such: # obj = MyHashSet() # obj.add(key) # obj.remove(key) # param_3 = obj.contains(key)
"""Useful literals""" TABLE_LEVEL_PG_STAT_USER_TABLES_COLUMNS = [ "relid", "schemaname", "relname", "seq_scan", "seq_tup_read", "idx_scan", "idx_tup_fetch", "n_tup_ins", "n_tup_upd", "n_tup_del", "n_tup_hot_upd", "n_live_tup", "n_dead_tup", "n_mod_since_analyze", "last_vacuum", "last_autovacuum", "last_analyze", "last_autoanalyze", "vacuum_count", "autovacuum_count", "analyze_count", "autoanalyze_count", ] TABLE_LEVEL_MYSQL_COLUMNS = [ "TABLE_SCHEMA", "TABLE_NAME", "TABLE_TYPE", "ENGINE", "ROW_FORMAT", "TABLE_ROWS", "AVG_ROW_LENGTH", "DATA_LENGTH", "INDEX_LENGTH", "DATA_FREE", ]
class PersonError(Exception): def __init__(self, a, b): self.a = a self.b = b def print_obj(self): print(self.a, self.b) class Person: def __init__(self, name: str, surname: str, age: int, gender: str): try: if age <= 0: raise PersonError("Person age cant be a negative number:", age) elif type(age) != int: raise PersonError("Person age must be a integer:", age) elif type(name) != str: raise PersonError("Person name must be a string:", name) elif type(surname) != str: raise PersonError("Person surname must be a string:", surname) elif type(gender) != str: raise PersonError("Person gender Male or Female:", gender) else: self.__name = name self.__surname = surname self.__age = age self.__gender = gender except PersonError as pe: pe.print_obj() def __repr__(self): return "{} {} - {} {}".format(self.__name, self.__surname, self.__age, self.__gender) def get_name(self): return self.__name def set_name(self, other): try: if type(other) != str: raise PersonError("Person name must be a string:", other) else: self.__name = other except PersonError as pe: pe.print_obj() def get_surname(self): return self.__surname def set_surname(self, other): try: if type(other) != str: raise PersonError("Person surname must be a string", other) else: self.__surname = other except PersonError as pe: pe.print_obj() def get_age(self): return self.__age def set_age(self, value): try: if value < 0: raise PersonError("Person age cant be a negative number:", value) elif type(value) != int: raise PersonError("Person age must be a ineger:", value) else: self.__age = value except PersonError as pe: pe.print_obj() def get_gender(self): return self.__gender def set_gender(self, other): try: if type(other) != str: raise PersonError("Person gender must be Male or Female:", other) else: self.__gender = other except PersonError as pe: pe.print_obj()
number_one = int(input("Enter a number: ")) number_two = int(input("Enter another number: ")) if (number_one > number_two): print("Number one is greater than number two") else: print("Number two is greater than number one")
# Exercise 1: Rewrite your pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours. # Enter Hours: 45 # Enter Rate: 10 # Pay: 475.0 hours = int(input('Enter hours: ')); rate = float(input('Enter rate: ')); if hours > 40: rate = rate * 1.5 pay = hours * rate; print('Pay',pay);
#Desenvolva um programa que leia o comprimento de três retas e diga ao usuário se elas podem ou não formar um triângulo. print('-='*20) print('Analisador de Triângulo') print('-='*20) r1 = float(input('Primeiro segmento: ')) r2 = float(input('Segundo segmento: ')) r3 = float(input('Terceiro segmento: ')) if r1 < r2+ r3 and r2 < r1+r3 and r3 < r1+r2: print('Os segmentos acima \033[34mPODEM FORMAR triângulo.') else: print('Os segmentos acima \033[31mNÃO PODEM FORMAR triângulo.')
def Menu(): print("Bienvenido, seleccione la operacion que desea realizar") print("1.) Añadir") print("2.) Asignar||Adicionar||Cancelar Materias") print("3.) Modificar") print("4.) Eliminar usuario") print("5.) Mostrar bases de datos") print("6.) Calificar") print("7.) Buscar") print("8.) Salir") while True: try: opcion = int(input("Digite la opción: ")) break except: print("Numero no valido, escoga denuevo.") return opcion def MenuAñadir(): while True: print("1.) Estudiante") print("2.) Profesor") print("3.) Materia") print("4.) Cancelar") while True: try: opcion1 = int(input("Digite el tipo de dato a añadir: ")) break except: print("Numero no valido, escoga denuevo.") return opcion1 def MenuAsignar(): while True: print("1.) Asignar materia a profesor") print("2.) Inscribir materias para estudiante") print("3.) Cancelacion de una materia") print("4.) Cancelar") while True: try: opcion2 = int(input("Digite la opcion que desea: ")) break except: print("Numero no valido, escoga denuevo.") return opcion2 def MenuModificar(): while True: print("1.) Estudiantes") print("2.) Profesor") print("3.) Materias") print("4.) Cancelar") while True: try: opcion3 = int(input("Digite la opcion que desea: ")) break except: print("Numero no valido, escoga denuevo.") return opcion3 def MenuEstudiantes(): print("1.) Nombre") print("2.) Apellido") print("3.) Carrera") print("4.) Estado") print("5.) Cancelar") def MenuProfesor(): print("1.) Nombre") print("2.) Apellido") print("3.) Estado") print("4.) Cancelar") def MenuMaterias(): print("1.) Nombre") print("2.) Creditos") print("3.) Cancelar") def MenuEliminar(): while True: print("1.) Estudiantes") print("2.) Profesor") print("3.) Cancelar") while True: try: opcion4 = int(input("Digite la opcion que desea: ")) break except: print("Numero no valido, escoga denuevo.") return opcion4 def MenuMostrar(): while True: print("1.) Estudiantes") print("2.) Profesor") print("3.) Materias") print("4.) Materias asignadas a profesores") print("5.) Materias vistas por estudiante") print("6.) Cancelar") while True: try: opcion5 = int(input("Digite la opcion que desea: ")) break except: print("Numero no valido, escoga denuevo.") return opcion5 def MenuCalificaciones(): while True: print("1.) Calificar materias") print("2.) Calcular PAPA") print("3.) Cancelar") while True: try: opcion6 = int(input("Digite la opcion que desea: ")) break except: print("Numero no valido, escoga denuevo.") return opcion6 def MenuBuscar(): while True: print("1.) Buscar Estudiante") print("2.) Buscar Profesor") print("3.) Buscar Materia") while True: try: opcion7 = int(input("Digite la opcion que desea: ")) break except: print("Numero no valido, escoga denuevo.") return opcion7 def ImprimirTabla(tabla): if (tabla == "ESTUDIANTES"): print("Nombres"," ","Apellidos"," ","ID"," ","Codigo Plan de estudios"," ","Estado"," "," P.A.P.A.") print("") print("") if (tabla == "PROFESORES"): print("Nombres"," ","Apellidos"," ","ID"," ","Estado") print("") print("") if (tabla == "MATERIAS"): print("Codigo"," ","Nombre"," ","Codigo de Facultad"," ","Codigo plan de estudio"," ","Creditos"," "," Prerequisito"," ","Codigo del prerequisito") print("") print("") if (tabla == "MATERIASDOC"): print("Codigo"," ","Nombre"," ","Nombre Docente"," ","Apellido Docente"," ","ID"," "," Hora de inicio"," ","Horas clase"," ","Dias"," ","Cupos"," ","Grupo") print("") print("") if (tabla == "MATERIASEST"): print("Codigo"," ","Nombre"," ","ID Estudiante"," ","Nombre Estudiante"," ","Apellido Estudiante"," "," Grupo"," ","ID Profesor"," "," Nombre Profesor"," ","Apellido Profesor"," ","Hora final"," ","Dias"," ","Estatus"," ","Calificación") print("") print("") def ImprimirTabla2(tabla): if (tabla == "ESTUDIANTES"): print("") print("") if (tabla == "PROFESORES"): print("") print("") if (tabla == "MATERIAS"): print("") print("") if (tabla == "MATERIASDOC"): print("") print("") if (tabla == "MATERIASEST"): print("Codigo materia"," ","id estudiante",) print("") print("") def Salir(): condition = True salida = input("Esta seguro que desea salir Y|N: ") if (salida == "Y"): condition = False else: pass return condition
n = int(input()) for i in range(n,0,-1): if n%i==0: n=i print(i, end=' ')
############################################################### # Servers ############################################################### class ServerType(models.Model): name = models.CharField(max_length=40, verbose_name='Nome') type = models.CharField(max_length=40, verbose_name='Tipo') created_at = models.DateTimeField(auto_now=False, auto_now_add=True, verbose_name='Created') updated_at = models.DateTimeField(auto_now=True, verbose_name='Updated') expire_at = models.DateTimeField(null=True, verbose_name='Expires') author = models.CharField(max_length=40, null=True) class Meta: verbose_name_plural = 'Servers - Models' verbose_name = 'Server - Model' def __unicode__(self): return self.name class Servers(models.Model): STATUS_CHOICES = ( ('outdated', 'Outdated'), ('dev', 'Development'), ('stolen', 'Stolen'), ('maint', 'Maintenance'), ('off', 'Offline'), ('on', 'Online'), ('stock', 'Stocked'), ) name = models.CharField(max_length=40, verbose_name='Name', unique=True) type = models.ForeignKey(ServerType) list = models.CharField(db_index=True, null=True, blank=True, max_length=200, help_text='IP/Name (space separated)', verbose_name="Host") status = models.CharField(max_length=11, choices=STATUS_CHOICES, verbose_name='Status', help_text='Status', default='on') mac = models.CharField(db_index=True, max_length=20, default='auto', verbose_name='Mac Address', blank=True, null=True) puppet_at = models.DateTimeField(null=True, verbose_name='Last Puppet Run') created_at = models.DateTimeField(auto_now=False, auto_now_add=True, verbose_name='Created') updated_at = models.DateTimeField(auto_now=True, verbose_name='Updated') expire_at = models.DateTimeField(null=True, verbose_name='Expires') author = models.CharField(max_length=40, null=True) class Meta: verbose_name_plural = 'Servers' verbose_name = 'Server' def __unicode__(self): return self.name ############################################################### # Puppet ############################################################### class PuppetModule(models.Model): module = models.CharField(max_length=40, verbose_name='Module', unique=True) obs = models.CharField(max_length=80, verbose_name='Description') filtro = models.TextField(help_text='(CSV Regular Expression HOSTNAME). Ex. "saltop.*, fremontt\d{2}", "saltop*, !saltop01", ".*, !saltop01"', verbose_name='Filter', blank=True, null=True) created_at = models.DateTimeField(auto_now=False, auto_now_add=True, verbose_name='Created') updated_at = models.DateTimeField(auto_now=True, verbose_name='Updated') expire_at = models.DateTimeField(null=True, blank=True, verbose_name='Expires') author = models.CharField(max_length=40, null=True) class Meta: verbose_name_plural = 'Puppet Models' verbose_name = 'Puppet Model' def __unicode__(self): return self.module class PuppetClass(models.Model): name = models.CharField(max_length=40, verbose_name='Nome', unique=True) servertype = models.ManyToManyField(ServerType, verbose_name='Groups', help_text='Grupos ao qual tem acesso.') modules = models.ManyToManyField(PuppetModule, verbose_name='Models', help_text='Models', blank=True, null=True) created_at = models.DateTimeField(auto_now=False, auto_now_add=True, verbose_name='Created') updated_at = models.DateTimeField(auto_now=True, verbose_name='Updated') expire_at = models.DateTimeField(null=True, blank=True, verbose_name='Expires') author = models.CharField(max_length=40, null=True) class Meta: verbose_name_plural = 'Puppet Classes' verbose_name = 'Puppet Class' def __unicode__(self): return self.name
# from math import factorial >>>> jeito mais fácil n1 = -1 while n1 <= 0: n1 = int(input('Qual número deseja calcular o fatorial? ')) if n1 <= 0: print('Digite um número inteiro maior que 0...') n2 = n1 f = 1 print('{}! = '.format(n1), end='') while n2 > 0: print('{}'.format(n2), end='') print(' x ' if n2 > 1 else ' = ', end='') f *= n2 n2 -= 1 print('{}'.format(f))
#AUTOGENERATED! DO NOT EDIT! File to edit: dev/92_set_directories.ipynb (unless otherwise specified). __all__ = ['Dirs'] #Cell """ Directories for Image preparation training and testing """ class Dirs: def __init__(obj, basepath): obj.basepath = basepath obj.originImages = basepath + '/Original' obj.train = basepath + '/Fullsize/Train' obj.validTxtFile = basepath + '/Fullsize/valid.txt' obj.label = basepath + '/Fullsize/Label' obj.test = basepath + '/Fullsize/Test' obj.crop = basepath + '/Crop-200' obj.sizeCsvFile = basepath + '/file_size.csv' obj.cropValidTxtFile = basepath + '/Crop-200/valid.txt' obj.cropTrain = basepath + '/Crop-200/Train' obj.cropLabel = basepath + '/Crop-200/Label' obj.cropTest = basepath + '/Crop-200/Test' obj.model = basepath + '/models/' def __members(obj): return [attr for attr in dir(dirs) if not callable(getattr(dirs, attr)) and not attr.startswith("__")] @classmethod def all(cls): return [(name, value) for name, value in vars(cls).items() if not callable(name) and not name.startswith("__")] @classmethod def all2(cls): return [name for name, value in vars(cls).items()] def __repr__(obj): __vars = [attr for attr in dir(obj) if not callable(getattr(obj, attr)) and not attr.startswith("__")] print(__doc__) """Renders variables and their values on the terminal.""" max_name_len = max([len(k) for k in __vars]) max_val_len = max([len(str([k])) for k in __vars]) ret = '' for k in __vars: ret += f' {k:<{max_name_len}}: {getattr(obj, k):{max_val_len}} \n' return ret # def members(obj): # return [attr for attr in dir(dirs) if not callable(getattr(dirs, attr)) and not attr.startswith("__")] # # def printdirs(d): # ks = [k for k in d if (k[:2] != "__" and not callable(globals()[k]))] # printVariables(ks)
# import geopandas as gpd # import folium # import matplotlib.pyplot as plt # # # def teste(): # # # Lê os dados # url = 'https://geoservicos.pbh.gov.br/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName=ide_bhgeo:BAIRRO&srsName=EPSG:31983&outputFormat=application%2Fjson' # gdf = gpd.read_file(url) # # # Você pode agora ver os dados em formato df # gdf # # # Verifica se os dados estão certos # fig, ax = plt.subplots(figsize=(10, 10)) # gdf.plot(ax=ax) # # # Converte para lat-long # gdf = gdf.to_crs(epsg=4326) # # # Faz o mapa # bh = gdf[['id', 'geometry', 'NOME']] # x_map = bh.geometry.centroid.x.mean() # y_map = bh.geometry.centroid.y.mean() # mymap = folium.Map(location=[y_map, x_map], zoom_start=11, tiles='OpenStreetMap') # # # Adiciona polígonos # folium.GeoJson( # gdf # ).add_to(mymap) # # mymap def teste(): pass
# Código utilizado no livro Aprenda Python Básico - Rápido e Fácil de entender, de Felipe Galvão # Mais informações sobre o livro: http://felipegalvao.com.br/livros # Capítulo 8: Dicionários # Criando nosso primeiro dicionário aluno = {"nome": "José", "idade": 20, "nota": 9.2} print(aluno) # Criando um dicionário vazio dict_vazio = {} print(dict_vazio) # Acessando elementos do dicionário pela chave print(aluno["nome"]) print(aluno["idade"]) # Acessando uma chave que não existe, o Python retorna um erro # print(aluno["Peso"]) # Modificando o valor de uma chave em um dicionário aluno["nota"] = 8.2 # Para criar uma nova chave, basta definir uma chave não existente ainda no Dicionário aluno["peso"] = 74 print(aluno) # Removendo uma ou todas as chaves de um dicionário del aluno["idade"] print(aluno) aluno.clear() print(aluno) # Funções úteis para se trabalhar com dicionários aluno = {"nome": "José", "idade": 20, "nota": 9.2} print(len(aluno)) print("idade" in aluno) print("peso" in aluno) print(aluno.get("nome")) print(aluno.get("peso")) print(aluno.get("peso", "Não existe")) print(aluno.items()) print(aluno.keys()) print(aluno.values()) aluno_original = {"nome": "José", "idade": 20, "nota": 9.2} aluno_update = {"peso": 75, "nota": 8.7} aluno_original.update(aluno_update) print(aluno_original)
class MyClass: def func_1(self): return "1" def func_2(func): return func() def main(): a=func_2(MyClass().func_1) print(a) if __name__ == '__main__': main()
people = ['Conrad', 'Deepak', 'Heinrich', 'Tom'] ages = [29, 30, 34, 36] for position in range(len(people)): person = people[position] age = ages[position] print(person, age)
# @Title: 数组中重复的数据 (Find All Duplicates in an Array) # @Author: KivenC # @Date: 2018-07-22 14:56:19 # @Runtime: 388 ms # @Memory: N/A class Solution(object): def findDuplicates(self, nums): """ :type nums: List[int] :rtype: List[int] """ res = [] for i in range(len(nums)): nums[abs(nums[i]) - 1] = 0 - nums[abs(nums[i]) - 1] if nums[abs(nums[i]) - 1] > 0: res.append(abs(nums[i])) return res
income_tax=0 id = int(input("Enter Employee id: ")) basic_salary = int(input("Enter monthly gross salary: ")) allowance = int(input("Enter allowance: ")) gross_salary = basic_salary+allowance if gross_salary<=5000: income_tax = 0 elif gross_salary<=10000: income_tax = 0.1 * gross_salary elif gross_salary<=20000: income_tax = 0.2 * gross_salary else : income_tax = 0.3 * gross_salary net_pay = gross_salary-income_tax print("Employee id: {}\nBasic Salary: {}\nAllowance: {}\nGross Pay: {}\nIncome Tax: {}\nNet pay: {}". format(id,basic_salary,allowance,gross_salary,income_tax,net_pay))
# !/usr/bin/env python3 # Author: C.K # Email: [email protected] # DateTime:2021-11-16 21:11:11 # Description: class Solution: def findMaxLength(self, nums: List[int]) -> int: count = 0 result = 0 dict_seen = {0: -1} for i in range(len(nums)): n = nums[i] if n == 0: count -= 1 if n == 1: count += 1 if count in dict_seen: result = max(result, i - dict_seen[count]) else: dict_seen[count] = i return result if __name__ == "__main__": pass
__author__ = 'prossi' class DISK: def __init__(self, obj, connection): self.__dict__ = dict(obj.attrib) self.connection = connection
class ResponseMaker(object): __slot__ = ['error_verbose'] def __init__(self, error_verbose=True): self.error_verbose = error_verbose def get_response(self, result, request_id): return { "jsonrpc": "2.0", "result": result, "id": request_id } def get_error(self, code, message, data=None, request_id=None): result = { "jsonrpc": "2.0", "error": { "code": code, "message": message, }, "id": request_id } if self.error_verbose and data: result["error"]['data'] = data return result def get_parse_error(self, data=None, request_id=None): return self.get_error( -32700, 'Parse error', data=data, request_id=request_id ) def get_invalid_request(self, data=None, request_id=None): return self.get_error( -32600, 'Invalid Request', data=data, request_id=request_id ) def get_method_not_found(self, data=None, request_id=None): return self.get_error( -32601, 'Method not found', data=data, request_id=request_id ) def get_invalid_params(self, data=None, request_id=None): return self.get_error( -32602, 'Invalid params', data=data, request_id=request_id ) def get_internal_error(self, data=None, request_id=None): return self.get_error( -32603, 'Internal error', data=data, request_id=request_id ) def get_server_error(self, code, data, request_id=None): return self.get_error( code=code, message='Server error', data=data, request_id=request_id )
def Sorting_array_data(A,i): B = sorted(A, key=lambda a_entry: a_entry[i]) return B
contas = [] depositos = [] saldo = 0 def main(): opc = bool(int(input('[1] Criar conta\n[0] Fechar programa\nSua opção: '))) while opc: criaConta() ver_saldo() opc = bool(int(input('[1] Criar conta\n[0] Fechar programa\nSua opção: '))) if opc == 0: break def criaConta(): global contas, depositos, saldo num_conta = int(input('Digite um número de conta: ')) while num_conta in contas: print('Conta já existente, digite novamente.') num_conta = int(input('Digite um número de conta: ')) contas.append(num_conta) deposito = float(input('Digite o valor do primeiro depósito. R$')) while deposito<=0: print('Valor inválido.') deposito = float(input('Digite o valor do primeiro depósito.')) depositos.append(deposito) saldo += deposito def ver_saldo(): global saldo op = bool(int(input('Deseja ver saldo do banco? [1-SIM 2-NAO] '))) if op: print(f'O saldo do banco Ricardo Bank é R${saldo:.2f}') main()
#Desafio 49 #Programa Tabuada, Lê um número inteiro e mostra sua tabuada. #Testando a estrutura de repetição "for" do python num = int(input("Digite um número inteiro qualquer para saber sua tabuada: ")) for i in range(1,11): print(f" {num} x {i} = {num*i}") print("---Fim da Tabuada---")
class Tracker(object): def __init__(self): self.trk = [] # currently tracked 2D Points self.trk_i = [] # self.pts[self.trk_i] are currently tracked self.pts = [] # list of all known object feature point positions self.kpt = [] # corresponding image coordinates for all points self.des = [] # corresponding descriptors for all points def detect(self, img): pass def solve(self, img, pt0, pt1, li_c): #R1, t1, o1, i_u, i_i = self.solve(img, pt0, pt1, li_c) E, _ = findEssentialMat( ... ) def track(self, img0, kpt0, des0, img1): # initialize containers o_pt0 = [] o_pt1 = [] # grab landmark points kpt_l = self.kpt[self.trk_i] #des_l = self.des[self.trk_i] # compute cross-frame match results # i_l0l, i_l00 = self.match(des_l, des0) # i_l1l, i_l11 = self.match(des_l, des1) # i_010, i_011 = self.match(des0, des1) # detect already registered feature points from kpt0 i_ll, i_l0 = self.match(self.des, des0) # TODO : global match (i.e. bounded search but not constrained to current track) # compute inverted match index m_l0 = np.ones(len(des0), dtype=np.bool) m_l0[i_l0] = False ni_l0 = np.where(m_l0)[0] # handle track recovery ... ril, ri0 = zip(*[(il, i0) for (il,i0) in zip(i_ll,i_l0) if il not in self.trk_i]) # track recovery # TODO : better way to get ^^ pt1_lr, idx_tr = self.flow(img0, img1, pt0[ri0]) self.kpt[ril[idx_tr]] = ptl_lr o_pt0.extend( pt0[ri0][idx_tr] ) o_pt1.extend( pt1_lr[idx_tr] ) # track previous landmark/keypoints ... ptl1, idx_tl = self.flow(img0, img1, kpt_l) self.kpt[idx_tl] = ptl1 o_pt0.extend( kpt_l[idx_tl] ) o_pt1.extend( ptl1[idx_tl] ) # track 'new' points ... pt1, idx_t = self.flow(img0, img1, pt0[ni_l0]) o_pt0.extend( pt0[ni_l0][idx_t] ) o_pt1.extend( pt1[idx_t] ) # does not insert to tracking cache yet # compute output indices o_li = np.r_[ril[idx_tr], self.trk_i[idx_tl]] o_li_c = np.s_[:len(idx_tr) + len(idx_tl)] # slice corresponding new descriptors o_des1 = des0[ni_l0][idx_t] # update tracking points and indices # NOTE : does not ADD points here. self.trk_i = np.intersect1d(self.trk_i, idx_tl) # subtract lost points self.trk_i = np.union1d(self.trk_i, ril[idx_tr]) # add recovered points << TODO : validate return o_pt0, o_pt1, o_li, o_li_c, o_des1 def track_v2(self, args): # detect already registered feature points from kpt0 # global match (i.e. bounded search but not constrained to current track) m_ml, m_m0 = self.match(self.des, des0, strict=True) m_ml, m_m0 = self.match(self.des, des0, strict=False) # TODO : global match (i.e. bounded search but not constrained to current track) mla = (~m_ml & ~self.trk ) # case a : new; unmatched mlb = ( m_ml & ~self.trk ) # case b : recovery; matched & untracked landmark mlc = ( m_ml & self.trk ) # case c : suppress; matched & tracked landmark mld = (~m_ml & self.trk ) # case d : old ; unmatched & tracked landmark m0a = ~m_m0 # new; unmatched m0b = m_m0 & ... # matched & untracked m0b = m_m0 & ... # matched & tracked # compute flows pt1a, m_ta = self.flow(img0, img1, pt0[m0a]) pt1b, m_tb = self.flow(img0, img1, pt0[m0b]) pt1c, m_tc = self.flow(img0, img1, ptl[mlc]) pt1d, m_td = self.flow(img0, img1, ptl[mld]) # case a : new pt0_n = pt0[m0a][m_ta] pt1_n = pt1a[m_ta] # case b : recovery pt0_r = pt0[m0b][m_tb] pt1_r = pt1b[m_tb] # case c : suppress pt0_s = ptl[mlc][m_tc] pt1_s = pt1c[m_tc] # case d : old pt0_o = ptl[mld][m_td] pt1_o = pt1d[m_td] # retrack recovery case for b # TODO : verify if msk assignments work self.trk[mlb][m_tb] = True self.kpt[mlb][m_tb] = pt1_r # untrack failure cases for c/d self.trk[mlc][~m_tc] = False self.trk[mld][~m_td] = False # update keypoints for d self.kpt[mld][m_td] = pt1_o # format output o_pt0 = np.concatenate([pt0_n, pt0_r, pt0_s, pt0_o], axis=0) o_pt1 = np.concatenate([pt1_n, pt1_r, pt1_s, pt1_o], axis=0) # TODO : forge o_li/ o_li_c from case b,c,d # TODO : forge des_new from case a # compute inverted match index m_l0 = np.ones(len(des0), dtype=np.bool) m_l0[i_l0] = False ni_l0 = np.where(m_l0)[0] # handle track recovery ... # TODO : better way to get ^^ pt1_lr, idx_tr = self.flow(img0, img1, pt0[ri0]) self.kpt[ril[idx_tr]] = ptl_lr o_pt0.extend( pt0[ri0][idx_tr] ) o_pt1.extend( pt1_lr[idx_tr] ) # track previous landmark/keypoints ... ptl1, idx_tl = self.flow(img0, img1, kpt_l) self.kpt[idx_tl] = ptl1 o_pt0.extend( kpt_l[idx_tl] ) o_pt1.extend( ptl1[idx_tl] ) # track 'new' points ... pt1, idx_t = self.flow(img0, img1, pt0[ni_l0]) o_pt0.extend( pt0[ni_l0][idx_t] ) o_pt1.extend( pt1[idx_t] ) # does not insert to tracking cache yet # compute output indices o_li = np.r_[ril[idx_tr], self.trk_i[idx_tl]] o_li_c = np.s_[:len(idx_tr) + len(idx_tl)] # slice corresponding new descriptors o_des1 = des0[ni_l0][idx_t] # update tracking points and indices # NOTE : does not ADD points here. self.trk_i = np.intersect1d(self.trk_i, idx_tl) # subtract lost points self.trk_i = np.union1d(self.trk_i, ril[idx_tr]) # add recovered points << TODO : validate return o_pt0, o_pt1, o_li, o_li_c, o_des1 def __call__(self, img): img1 = undistort(img) kpt1, des1 = self.detect(img1) self.hist.append( [img1, kpt1, des1] ) # query history img0, kpt0, des0 = self.hist[-2] # track old + new points # such that self.pts[li] = pt0[li_c] = pt1[li_c] pt0, pt1, li, li_c, des_new = self.track( img0, kpt0, des0, img1, kpt1, des1) # compute current pose and new object points # i_u = indices that are good to update # i_i = indices that are good to insert R1, t1, o1, i_u, i_i = self.solve(img, pt0, pt1, li_c) # update old points with new position self.pts[li].update( o1[i_u] ) # insert new points msk_i = np.ones(len(self.pts), dtype=np.bool) # insert mask msk_i[li_c] = False # do not insert previous landmarks again prv_size = len(self.pts) self.pts.extend(o1[i_i]) self.kpt.extend(pt1[msk_i][i_i]) self.des.extend(des_new[i_i]) new_size = len(self.pts) self.trk_i.extend( np.arange(prv_size, new_size) )
# -*- coding: utf-8 -*- # @Author: 何睿 # @Create Date: 2019-04-07 11:54:35 # @Last Modified by: 何睿 # @Last Modified time: 2019-04-07 12:22:34 class Solution: def countBits(self, num: int) -> [int]: # 结果数组 result, count = [0], 1 while count * 2 <= num: # 从 resut 数组中索引对应的二进制数前面加 # 一个 1 构成范围从 count 到 count*2 -1 的数(包括两端) for i in range(count, count * 2): result.append(1 + result[i - count]) count *= 2 # 处理剩下的数 for i in range(count, num + 1): result.append(1 + result[i - count]) return result
# Write an efficient program to find the sum of contiguous subarray within # a one-dimensional array of numbers which has the largest sum. def max_sum_kadane(nums: list) -> int: # kadane's algorithm max_so_far = max_ending_here = 0 for value in nums: max_ending_here = max(max_ending_here + value, 0) if max_ending_here > 0: max_so_far = max(max_so_far, max_ending_here) return max_so_far def max_sum_print_subarray(nums: list) -> int: start = s = 0 end = -1 max_so_far = max_ending_here = 0 for index, value in enumerate(nums): max_ending_here += value if max_ending_here > max_so_far: start = s end = index max_so_far = max_ending_here if max_ending_here < 0: max_ending_here = 0 s = index + 1 return nums[start: end + 1] if __name__ == "__main__": assert max_sum_kadane([-13, -3, -25, -20, -3, -16, -23, -12, -5, -22, -15, -4, -7]) == 0 assert max_sum_print_subarray([-13, -3, -25, -20, -3, -16, -23, -12, -5, -22, -15, -4, -7]) == [] assert max_sum_kadane([-2, -3, 4, -1, -2, 1, 5, -3]) == 7 assert max_sum_print_subarray([-2, -3, 4, -1, -2, 1, 5, -3]) == [4, -1, -2, 1, 5]
class Runtime: """Encapsulates the runtime state of execution itself, excluding I/O.""" def __init__(self, program, env): self.program = program self.env = env
# -*- coding: utf-8 -*- """ Created on Thu Jan 3 15:54:59 2019 @author: janej """ print('name:'+__name__) print('package:'+__package__) print('doc:'+__doc__) print('file:'+__file__)
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, 'variables': { 'version_py_path': '<(DEPTH)/build/util/version.py', 'version_path': 'VERSION', }, 'version_py_path': '<(version_py_path) -f', 'version_path': '<(version_path)', }, 'includes': [ '../build/util/version.gypi', ], 'targets': [ { 'target_name': 'cloud_print_version_resources', 'type': 'none', 'variables': { 'output_dir': 'cloud_print', 'branding_path': '<(DEPTH)/chrome/app/theme/<(branding_path_component)/BRANDING', 'template_input_path': '../chrome/app/chrome_version.rc.version', 'extra_variable_files_arguments': [ '-f', 'BRANDING' ], 'extra_variable_files': [ 'BRANDING' ], # NOTE: matches that above }, 'direct_dependent_settings': { 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/<(output_dir)', ], }, 'sources': [ 'service/win/cloud_print_service_exe.ver', 'service/win/cloud_print_service_config_exe.ver', 'service/win/cloud_print_service_setup_exe.ver', 'virtual_driver/win/gcp_portmon64_dll.ver', 'virtual_driver/win/gcp_portmon_dll.ver', 'virtual_driver/win/install/virtual_driver_setup_exe.ver', ], 'includes': [ '../chrome/version_resource_rules.gypi', ], }, { 'target_name': 'cloud_print_version_header', 'type': 'none', 'hard_dependency': 1, 'actions': [ { 'action_name': 'version_header', 'variables': { 'branding_path': '<(DEPTH)/chrome/app/theme/<(branding_path_component)/BRANDING', 'output_dir': 'cloud_print', 'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE', }, 'direct_dependent_settings': { 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/<(output_dir)', ], }, 'inputs': [ '<(version_path)', '<(branding_path)', '<(lastchange_path)', '<(DEPTH)/chrome/version.h.in', 'BRANDING', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/<(output_dir)/version.h', ], 'action': [ 'python', '<(version_py_path)', '-f', '<(version_path)', '-f', '<(branding_path)', '-f', '<(lastchange_path)', '-f', 'BRANDING', '<(DEPTH)/chrome/version.h.in', '<@(_outputs)', ], 'message': 'Generating version header file: <@(_outputs)', }, ], }, ], }
# veri = bytearray("ş") veri = bytearray("abcd",encoding="utf-8") print(veri) print(veri[1]) print(veri[0]) with open("veri.bin", 'wb') as dosya: dosya.write(veri) veri2 = bytearray("diğer veri", encoding="utf-8") with open("veri.bin", "rb") as dosya1: data = dosya1.readinto(veri2) print("Veri eklendi") print(veri2)
''' Steven Kyritsis CS100 2021F Section 031 HW 08, November 5, 2021 ''' #1 def two_words(length, first_letter): while True: word1 = input("Please enter a " + str(length) + "-letter word please: ") if len(word1) == length: break while True: word2 = input("Please enter a word beginnning with the letter " + str(first_letter) + " please: ") if word2[0].lower() == first_letter.lower(): break
X, Y, A, B = map(int, input().split()) ans = 0 while True: if X*A < B and X*A < Y: X *= A ans += 1 else: break ans += (Y-X-1)//B print(ans)
"""Guarde en lista `naturales` los primeros 100 números naturales (desde el 1) usando el bucle while """ naturales=[] i=1 while i <=100: naturales.append(i) i+=1 #print(i) #print(naturales) """Guarde en `acumulado` una lista con el siguiente patrón: ['1','1 2','1 2 3','1 2 3 4','1 2 3 4 5',...,'...47 48 49 50'] Hasta el número 50. """ acumulado=[] i=1 while i <=51: acumulado.insert(i,list(range(1,i,1))) i+=1 #print(acumulado) """Guarde en `suma100` el entero de la suma de todos los números entre 1 y 100: """ suma100=0 for elemento in naturales: suma100+=elemento #print(suma100) """Guarde en `tabla100` un string con los primeros 10 múltiplos del número 134, separados por coma, así: '134,268,...' """ lista=list(range(1,11,1)) lista=[el*134 for el in lista] tabla100=",".join(map(str, lista)) print(tabla100) """Guardar en `multiplos3` la cantidad de números que son múltiplos de 3 y menores o iguales a 300 en la lista `lista1` que se define a continuación (la lista está ordenada). """ lista1 = [12, 15, 20, 27, 32, 39, 42, 48, 55, 66, 75, 82, 89, 91, 93, 105, 123, 132, 150, 180, 201, 203, 231, 250, 260, 267, 300, 304, 310, 312, 321, 326] """Guardar en `regresivo50` una lista con la cuenta regresiva desde el número 50 hasta el 1, así: [ '50 49 48 47...', '49 48 47 46...', ... '5 4 3 2 1', '4 3 2 1', '3 2 1', '2 1', '1' ] """ """Invierta la siguiente lista usando el bucle for y guarde el resultado en `invertido` (sin hacer uso de la función `reversed` ni del método `reverse`) """ lista2 = list(range(1, 70, 5)) """Guardar en `primos` una lista con todos los números primos desde el 37 al 300 Nota: Un número primo es un número entero que no se puede calcular multiplicando otros números enteros. """ """Guardar en `fibonacci` una lista con los primeros 60 términos de la serie de Fibonacci. Nota: En la serie de Fibonacci, los 2 primeros términos son 0 y 1, y a partir del segundo cada uno se calcula sumando los dos anteriores términos de la serie. [0, 1, 1, 2, 3, 5, 8, ...] """ """Guardar en `factorial` el factorial de 30 El factorial (símbolo:!) Significa multiplicar todos los números enteros desde el 1 hasta el número elegido. Por ejemplo, el factorial de 5 se calcula así: 5! = 5 × 4 × 3 × 2 × 1 = 120 """ """Guarde en lista `pares` los elementos de la siguiente lista que esten presentes en posiciones pares, pero solo hasta la posición 80. """ lista3 = [941, 149, 672, 208, 99, 562, 749, 947, 251, 750, 889, 596, 836, 742, 512, 19, 674, 142, 272, 773, 859, 598, 898, 930, 119, 107, 798, 447, 348, 402, 33, 678, 460, 144, 168, 290, 929, 254, 233, 563, 48, 249, 890, 871, 484, 265, 831, 694, 366, 499, 271, 123, 870, 986, 449, 894, 347, 346, 519, 969, 242, 57, 985, 250, 490, 93, 999, 373, 355, 466, 416, 937, 214, 707, 834, 126, 698, 268, 217, 406, 334, 285, 429, 130, 393, 396, 936, 572, 688, 765, 404, 970, 159, 98, 545, 412, 629, 361, 70, 602] """Guarde en lista `cubos` el cubo (potencia elevada a la 3) de los números del 1 al 100. """ """Encuentre la suma de la serie 2 +22 + 222 + 2222 + .. hasta sumar 10 términos y guardar resultado en variable `suma_2s` """ """Guardar en un string llamado `patron` el siguiente patrón llegando a una cantidad máxima de asteriscos de 30. * ** *** **** ***** ****** ******* ******** ********* ******** ******* ****** ***** **** *** ** * """
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> scope = "Private Program" description = """ User with authorization to peform administrative tasks such as associating users to roles within the scope of of a program.<br/><br/>When a person creates a program they are automatically given the ProgramOwner role. This allows them to Edit, Delete, or Map objects to the Program. It also allows them to add people and assign them roles when their programs are private. ProgramOwner is the most powerful role. """ permissions = { "read": [ "ObjectDocument", "ObjectPerson", "Program", "ProgramControl", "Relationship", "UserRole", "Context", ], "create": [ "ObjectDocument", "ObjectPerson", "ProgramControl", "Relationship", "UserRole", "Audit", ], "view_object_page": [ "__GGRC_ALL__" ], "update": [ "ObjectDocument", "ObjectPerson", "Program", "ProgramControl", "Relationship", "UserRole" ], "delete": [ "ObjectDocument", "ObjectPerson", "Program", "ProgramControl", "Relationship", "UserRole", ] }
""" link: https://leetcode-cn.com/problems/find-all-anagrams-in-a-string problem: 给小写字母字符串 s, p,求s中所有子串中,p的字母异位词,即组成字符串的字符集一致 solution: 滑动窗口。维护长度为len(p)的窗口内每个字符出现的次数 """ class Solution: def findAnagrams(self, s: str, p: str) -> List[int]: c1, c2, res = [0] * 26, [0] * 26, [] for x in p: c2[ord(x) - 97] += 1 for i, x in enumerate(s): c1[ord(x) - 97] += 1 if i >= len(p): c1[ord(s[i - len(p)]) - 97] -= 1 # debug(c1, c2, sum(c1), sum(c2), i, s[i - len(p) + 1:i + 1]) if i >= len(p) - 1 and c1 == c2: res.append(i - len(p) + 1) return res
"""Exceptions raised by this NApp.""" class DeviceException(Exception): """Device related exception.""" def __init__(self, message, device=None): """Take the parameter to inform the user about the error. Args: device (str, :class:`Device`): The device that was looked for. """ super().__init__(message) self.device = device class DeviceNotFound(DeviceException): """Exception raised when trying to access a device that does not exist.""" def __str__(self): return f"Device {self.device} not found. " + super().__str__() class PortException(Exception): """Port related exceptions.""" def __init__(self, message, port=None): """Take the parameter to inform the user about the error. Args: port (str, :class:`Port`): The port that was looked for. """ super().__init__(message) self.port = port class PortNotFound(PortException): """Exception raised when trying to access a port that does not exist.""" def __str__(self): return f"Port {self.port} not found. " + super().__str__() class InterfaceException(Exception): """Interface related exceptions.""" def __init__(self, message, interface=None): """Take the parameter to inform the user about the error. Args: interface (str, :class:`Interface`): The Interface that was looked for. """ super().__init__(message) self.interface = interface class InterfaceDisconnected(InterfaceException): """When a forbidden action was performed on a disconnected interface.""" def __str__(self): msg = f"The interface {self.interface} is disconnected." return msg + super().__str__() class InterfaceConnected(InterfaceException): """When a forbidden action was performed on a connected interface.""" def __str__(self): msg = f"The interface {self.interface.port} is already connected." return msg + super().__str__() class LinkException(Exception): """Link related exception.""" def __init__(self, message, link=None): """Take the parameter to inform the user about the error. Args: link (str, :class:`Link`): The link that was looked for. """ super().__init__(message) self.link = link class LinkNotFound(LinkException): """Exception raised when trying to access a link that does not exist.""" def __str__(self): return f"Link {self.link} not found. " + super().__str__() class TopologyException(Exception): """Exception generated while working with the Topology class.""" pass
"""A function for testing approximate equality of two numbers. Same as math.isclose in Python v3.5 (and newer) https://www.python.org/dev/peps/pep-0485 """ def almost_equal(a, b, rel_tol=1e-09, abs_tol=0.0): """A function for testing approximate equality of two numbers. Same as math.isclose in Python v3.5 (and newer) https://www.python.org/dev/peps/pep-0485 """ return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) # Examples: almost_equal(5.2, 5.2) # True almost_equal(5.201, 5.202) # False almost_equal(5.201, 5.202, 0.1) # True
old_file = open('city.txt', 'r') new_file = open('city_with_format.txt', 'w') all_cities = old_file.readlines() # print all_cities for i in all_cities: city, country = i.strip().split() new_file.write('%-25s%-25s\n' % (city, country)) old_file.close() new_file.close()
{ 'targets': [ { 'configurations': { 'Debug': { }, 'Release': { } }, 'target_name': 'appels', 'type': 'executable', 'dependencies': [ 'third_party/skia/skia.gyp:alltargets', 'third_party/skia/gyp/sdl.gyp:sdl', ], 'include_dirs': [ 'third_party/skia/include/config', 'third_party/skia/include/core', 'third_party/skia/include/gpu', 'third_party/skia/include/gpu/gl', 'third_party/skia/include/utils', 'third_party/skia/third_party/externals/sdl/include', 'third_party/skia/src/gpu/', ], 'sources': [ 'app/appels.cpp' ], 'ldflags': [ '-std=c++11', ], 'cflags': [ '-Werror', '-W', '-Wall', '-Wextra', '-Wno-unused-parameter', '-g', '-O0' ] } ] }
def pattern(n): if n <= 1: return "" res = "" for i in range(1, n//2+1): res += str(i*2)*(i*2)+"\n" return res[:-1]
TOTAL_CHARACTERS = 'SELECT COUNT(character_id) FROM charactercreator_character;' TOTAL_SUBCLASS = ''' SELECT COUNT(*) FROM (SELECT * FROM charactercreator_character cc_c INNER JOIN charactercreator_necromancer cc_n ON cc_c.character_id = cc_n.mage_ptr_id); ''' TOTAL_ITEMS = ''' SELECT COUNT(cc_ci.id) FROM charactercreator_character as cc_char INNER JOIN charactercreator_character_inventory as cc_ci WHERE cc_char.character_id = cc_ci.character_id; ''' TOTAL_WEAPON = ''' SELECT COUNT(*) FROM charactercreator_character AS cc_char INNER JOIN charactercreator_character_inventory AS cc_ci ON cc_char.character_id = cc_ci.character_id INNER JOIN armory_weapon AS aw WHERE aw.item_ptr_id = cc_ci.item_id ''' NON_WEAPONS = '''''' CHARACTER_ITEMS = '''''' CHARACTER_WEAPONS = '''''' AVG_CHARACTER_ITEMS = '''''' AVG_CHARACTER_WEAPONMS = '''''' GET_CHARACTERS = ''' SELECT * FROM charactercreator_character ''' GET_CHARACTERS_ITEMS = ''' SELECT name, value, weight FROM charactercreator_character_inventory as cc_ci LEFT JOIN armory_item WHERE cc_ci.item_id = armory_item.item_id and armory_item.item_id < 138 and cc_ci.character_id = {} ''' GET_CHARACTERS_WEAPONS = ''' SELECT name, value, weight FROM charactercreator_character_inventory as cc_ci LEFT JOIN armory_item ON cc_ci.item_id = armory_item.item_id INNER JOIN armory_weapon where armory_weapon.item_ptr_id = cc_ci.item_id and cc_ci.character_id = {} '''
response.title = settings.title response.subtitle = settings.subtitle response.meta.author = '%(author)s <%(author_email)s>' % settings response.meta.keywords = settings.keywords response.meta.description = settings.description response.menu = [ (T('Home'),URL('default','index')==URL(),URL('default','index'),[]), (T('Contracts'),URL('default','contract')==URL(),URL('default','contract'),[]), (T('About'),URL('default','about')==URL(),URL('default','about'),[]), (T('Contact'),URL('default','contact')==URL(),URL('default','contact'),[]), #(T('Building'),URL('default','building_manage')==URL(),URL('default','building_manage'),[]), #(T('Floor'),URL('default','floor_manage')==URL(),URL('default','floor_manage'),[]), #(T('Apartment'),URL('default','apartment_manage')==URL(),URL('default','apartment_manage'),[]), #(T('Apartment Type'),URL('default','apartment_type_manage')==URL(),URL('default','apartment_type_manage'),[]), #(T('User Info'),URL('default','user_info_manage')==URL(),URL('default','user_info_manage'),[]), #(T('Contract'),URL('default','contract_manage')==URL(),URL('default','contract_manage'),[]), #(T('Semester'),URL('default','semester_manage')==URL(),URL('default','semester_manage'),[]), #(T('Parking'),URL('default','parking_manage')==URL(),URL('default','parking_manage'),[]), #(T('Request'),URL('default','request_manage')==URL(),URL('default','request_manage'),[]), #(T('Request Comments'),URL('default','request_comments_manage')==URL(),URL('default','request_comments_manage'),[]), #(T('Request Type'),URL('default','request_type_manage')==URL(),URL('default','request_type_manage'),[]), #(T('Room'),URL('default','room_manage')==URL(),URL('default','room_manage'),[]), #(T('Room Type'),URL('default','room_type_manage')==URL(),URL('default','room_type_manage'),[]), #(T('T Building'),URL('default','t_building_manage')==URL(),URL('default','t_building_manage'),[]), #(T('T Floor'),URL('default','t_floor_manage')==URL(),URL('default','t_floor_manage'),[]), #(T('T Apartment'),URL('default','t_apartment_manage')==URL(),URL('default','t_apartment_manage'),[]), #(T('T Apartment Type'),URL('default','t_apartment_type_manage')==URL(),URL('default','t_apartment_type_manage'),[]), #(T('T User Info'),URL('default','t_user_info_manage')==URL(),URL('default','t_user_info_manage'),[]), #(T('T Contract'),URL('default','t_contract_manage')==URL(),URL('default','t_contract_manage'),[]), #(T('T Semester'),URL('default','t_semester_manage')==URL(),URL('default','t_semester_manage'),[]), #(T('T Parking'),URL('default','t_parking_manage')==URL(),URL('default','t_parking_manage'),[]), #(T('T Request'),URL('default','t_request_manage')==URL(),URL('default','t_request_manage'),[]), #(T('T Request Comments'),URL('default','t_request_comments_manage')==URL(),URL('default','t_request_comments_manage'),[]), #(T('T Request Type'),URL('default','t_request_type_manage')==URL(),URL('default','t_request_type_manage'),[]), #(T('T Room'),URL('default','t_room_manage')==URL(),URL('default','t_room_manage'),[]), #(T('T Room Type'),URL('default','t_room_type_manage')==URL(),URL('default','t_room_type_manage'),[]), ]
class Solution: def split(self, spaces: int, sets: int) -> Iterable[int]: if (spaces % sets == 0): rem = spaces // sets return (rem for i in range(sets)) else: rem, bigRem = sets - (spaces % sets), spaces//sets return (bigRem + 1 if (i >= rem) else bigRem for i in range(sets-1,-1,-1)) def merge(self, words: List[str], maxWidth: int, last: int = None) -> str: if last: s = ' '.join(words) return s + ' ' * (maxWidth - len(s)) lenw, lenEachw = len(words), sum(len(i) for i in words) if lenw == 1: return words[0] + ' ' * (maxWidth - lenEachw) spaceSet = self.split(maxWidth - lenEachw, lenw - 1) return ''.join((word + ' ' * spaceLen for word, spaceLen in zip(words, spaceSet))) + words[-1] def fullJustify(self, words: List[str], maxWidth: int) -> List[str]: lenw, i, sol = len(words), 0, [] while i < lenw: maxLen, j = maxWidth, i while maxLen >= -1 and j < lenw: maxLen -= (len(words[j]) + 1) j += 1 if j >= lenw and maxLen >= -1: sol.append(self.merge(words[i:], maxWidth, 'last')) break else: sol.append(self.merge(words[i : j-1], maxWidth)) i = j-1 return sol
#dicionario suporta um par de chave e um valor d1 = dict(chave1 = "valor da chave", chave2 = "chave 2") d1["nova_chave"] = "chave nova" print(d1["nova_chave"]) print(d1) d2 = {"chave": "esse é outro jeito de declarar chaves"} print(d2) d3 = { "string" : "valor", 123: "outro valor", (1,2,3,4) : "tupla", } print(d3 [(1,2,3,4)]) print(d1.get("chave3")) print("string" in d3) print("valor" in d3.values()) print(len(d3)) '''for k in d3: print(k)--assim acessa só os nomes das chaves, o de baixo pega o nome e o valor''' for k, v in d3.items(): print(k, v) clientes = { "cliente1": { "nome": "Natalia", "sobrenome": "Ferrandin", }, "cliente2":{ "nome":"Natan", "sobrenome":"Artini", }, } for clients_k, clients_v in clientes.items(): print(f"mostra {clients_k}") for dados_k, dados_v in clients_v.items(): print(f"\t{dados_k} = {dados_v}") lista = [ ["c1", 1], ["c2", 2], ["c3", 3], ] d4 = dict(lista) #consigo converter listas e tuplas em dict d4.pop("c3") print(d4) d4.update(d2) print(d4) print(28*"-") perguntas = { "pergunta 1": { "pergunta": "quanto é 2²?", "respostas": { "a-": "2", "b-": "4", "c-": "6", }, "resposta_certa": "b", }, "pergunta 2": { "pergunta": "resolva a conta: 9+3*4", "respostas": { "a-": "23", "b-": "48", "c-": "21", }, "resposta_certa": "c", }, } acertos = 0 for chavep, chaver in perguntas.items(): #iterando sobre o dicionario com as perguntas print(f"{chavep}: {chaver['pergunta']}") for respkey, respvalue in chaver["respostas"].items(): #iterando sobre o dicionario com as respostas print(f"[{respkey}]: {respvalue}") responda = input("resposta: ") if responda == chaver["resposta_certa"]: print("Parabéns!") acertos+=1 else: print("ops não foi dessa vez") pergunta = len(perguntas) porcentagem = acertos / pergunta * 100 print(f"você acertou {acertos} respostas") print(f"isso é {porcentagem}%")
# # PySNMP MIB module FMS100-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FMS100-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:14:07 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") NotificationType, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, ObjectIdentity, iso, Unsigned32, Counter32, IpAddress, ModuleIdentity, TimeTicks, MibIdentifier, Bits, enterprises, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "ObjectIdentity", "iso", "Unsigned32", "Counter32", "IpAddress", "ModuleIdentity", "TimeTicks", "MibIdentifier", "Bits", "enterprises", "Counter64") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") a3Com = MibIdentifier((1, 3, 6, 1, 4, 1, 43)) products = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1)) hub = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8)) cards = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9)) linkBuilderFMS100_mib = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 19)).setLabel("linkBuilderFMS100-mib") linkBuilderFMS100 = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 8, 20)) linkBuilderFMS100_cards = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 10)).setLabel("linkBuilderFMS100-cards") linkBuilderFMS100_cards_12utp = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 1, 9, 10, 1)).setLabel("linkBuilderFMS100-cards-12utp") hubEnviroObject = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 19, 2)) hubEnviroGroupTable = MibTable((1, 3, 6, 1, 4, 1, 43, 19, 2, 1), ) if mibBuilder.loadTexts: hubEnviroGroupTable.setStatus('mandatory') if mibBuilder.loadTexts: hubEnviroGroupTable.setDescription('Table of Environment information about the group.') hubEnviroGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 19, 2, 1, 1), ).setIndexNames((0, "FMS100-MIB", "hubServiceId"), (0, "FMS100-MIB", "hubGroupIndex")) if mibBuilder.loadTexts: hubEnviroGroupEntry.setStatus('mandatory') if mibBuilder.loadTexts: hubEnviroGroupEntry.setDescription('An Entry in the table, containing information about a single group.') hubServiceId = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hubServiceId.setStatus('mandatory') if mibBuilder.loadTexts: hubServiceId.setDescription('This object identifies the repeater which this entry contains information. For FMS100, this is a constant 1.') hubGroupIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly") if mibBuilder.loadTexts: hubGroupIndex.setStatus('mandatory') if mibBuilder.loadTexts: hubGroupIndex.setDescription('This object identifies the group within the repeater for which this entry contains information. This number is never greater than paRptrGroupCapacity.') hubHighTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hubHighTemp.setStatus('mandatory') if mibBuilder.loadTexts: hubHighTemp.setDescription(' This variable shows the current temperature status of the hub. If the variable changed from false to true, The enterprise-specific trap(a3comHighTemp) will be sent to the configured SNMP manager stations.') hubFanFailed = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hubFanFailed.setStatus('mandatory') if mibBuilder.loadTexts: hubFanFailed.setDescription(' This variable shows the current Fan Fail status of the hub. If the variable changed from false to true, The enterprise-specific trap(a3comFanFailed) will be sent to the configured SNMP manager stations.') pa100RptrSpecific = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 19, 3)) pa100RptrInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 19, 3, 1)) pa100GroupInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 19, 3, 2)) pa100PortInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 19, 3, 3)) pa100RptrTable = MibTable((1, 3, 6, 1, 4, 1, 43, 19, 3, 1, 1), ) if mibBuilder.loadTexts: pa100RptrTable.setStatus('mandatory') if mibBuilder.loadTexts: pa100RptrTable.setDescription('Table of descriptive and STATUS information about the 100Mb Ethernet Hub') pa100RptrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 19, 3, 1, 1, 1), ).setIndexNames((0, "FMS100-MIB", "pa100RptrServiceId")) if mibBuilder.loadTexts: pa100RptrEntry.setStatus('mandatory') if mibBuilder.loadTexts: pa100RptrEntry.setDescription('An entry in the table, containing information about the repeater.') pa100RptrServiceId = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 3, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pa100RptrServiceId.setStatus('mandatory') if mibBuilder.loadTexts: pa100RptrServiceId.setDescription('This object identifies the repeater which this entry contains information.') pa100RptrClass = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 3, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("classI", 1), ("classII", 2), ("unknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pa100RptrClass.setStatus('mandatory') if mibBuilder.loadTexts: pa100RptrClass.setDescription('The pa100RptrClass is the repeater class as defined in 802.3 standard. Class I: A type of repeater set specified such that in a maximum length segment topology, only one such repeater set may exist between any two DTEs within a single collision domain. Class II: A type of repeater set specified such that in a maximum length segment topology, only two such repeater set may exist between any two DTEs within a single collision domain.') pa100RptrStackCardTypeInfo = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 3, 1, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: pa100RptrStackCardTypeInfo.setStatus('mandatory') if mibBuilder.loadTexts: pa100RptrStackCardTypeInfo.setDescription("Supplies the information about the type of Cards in the repeater stack. There is one octet for each unit in the stack. Each octet can have the following values: 0 : undetected(power off or non-exist) 1 : repeater card 2 : management unit 3 : bridge/management card 4 : backup management(/bridge) card 5 : powered off 6 : unknown Value 0 indicates either the powered off card's cardindex is higher than all of the powered on cards or the card is non-existant. Value 5 indicates that the card is powered off and there are powered on card(s) with higher index number. Octet offset(started 0) N indicates N+1 th card information. I.e. The first octet indicates card 1's information.") pa100PortTable = MibTable((1, 3, 6, 1, 4, 1, 43, 19, 3, 3, 1), ) if mibBuilder.loadTexts: pa100PortTable.setStatus('mandatory') if mibBuilder.loadTexts: pa100PortTable.setDescription('Table of descriptive and STATUS information about the ports that is specific to 100Mb Ethernet Hub') pa100PortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 19, 3, 3, 1, 1), ).setIndexNames((0, "FMS100-MIB", "pa100PortServiceId"), (0, "FMS100-MIB", "pa100PortGroupIndex"), (0, "FMS100-MIB", "pa100PortIndex")) if mibBuilder.loadTexts: pa100PortEntry.setStatus('mandatory') if mibBuilder.loadTexts: pa100PortEntry.setDescription('An entry in the table, containing information about a single port.') pa100PortServiceId = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 3, 3, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pa100PortServiceId.setStatus('mandatory') if mibBuilder.loadTexts: pa100PortServiceId.setDescription('This object identifies the repeater which this entry contains information.') pa100PortGroupIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 3, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly") if mibBuilder.loadTexts: pa100PortGroupIndex.setStatus('mandatory') if mibBuilder.loadTexts: pa100PortGroupIndex.setDescription('This object identifies the group containing the port for which this entry contains information.') pa100PortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 3, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly") if mibBuilder.loadTexts: pa100PortIndex.setStatus('mandatory') if mibBuilder.loadTexts: pa100PortIndex.setDescription('This object identifies the port within the group for which this entry contains information. This value can never be greater than paRptrGroupPortCapacity for the associated group.') pa100PortIsolate = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 3, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pa100PortIsolate.setStatus('mandatory') if mibBuilder.loadTexts: pa100PortIsolate.setDescription('Increment counter by each time that the repeater port automatically isolates as a consequence of false carrier events. The conditions which cause a port to automatically isolate are as defined by the transition from the False Carrier state to the Link Unstable state of the carrier integrity state diagram.(802.3 std)') pa100PortSymbolErrorDuringPacket = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 19, 3, 3, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pa100PortSymbolErrorDuringPacket.setStatus('mandatory') if mibBuilder.loadTexts: pa100PortSymbolErrorDuringPacket.setDescription('A count of the number of times when valid length packet was received at the port and there was at least one occurrence of an invalid symbol. This can increment only once per valid carrier event. A collision presence at any port of the repeater containing port N, will not cause this attribute to increment. ') mibBuilder.exportSymbols("FMS100-MIB", hubGroupIndex=hubGroupIndex, pa100PortServiceId=pa100PortServiceId, pa100RptrInfo=pa100RptrInfo, linkBuilderFMS100_cards=linkBuilderFMS100_cards, linkBuilderFMS100_cards_12utp=linkBuilderFMS100_cards_12utp, hubEnviroGroupEntry=hubEnviroGroupEntry, linkBuilderFMS100_mib=linkBuilderFMS100_mib, pa100RptrSpecific=pa100RptrSpecific, hubEnviroObject=hubEnviroObject, pa100RptrEntry=pa100RptrEntry, hubEnviroGroupTable=hubEnviroGroupTable, hub=hub, pa100PortTable=pa100PortTable, pa100PortIsolate=pa100PortIsolate, pa100GroupInfo=pa100GroupInfo, pa100PortGroupIndex=pa100PortGroupIndex, cards=cards, pa100RptrServiceId=pa100RptrServiceId, pa100RptrStackCardTypeInfo=pa100RptrStackCardTypeInfo, pa100RptrTable=pa100RptrTable, hubFanFailed=hubFanFailed, pa100PortEntry=pa100PortEntry, pa100PortSymbolErrorDuringPacket=pa100PortSymbolErrorDuringPacket, pa100PortInfo=pa100PortInfo, a3Com=a3Com, hubServiceId=hubServiceId, linkBuilderFMS100=linkBuilderFMS100, pa100PortIndex=pa100PortIndex, products=products, hubHighTemp=hubHighTemp, pa100RptrClass=pa100RptrClass)
""" Write program, that will count the sum of all numbers from 1 to number that was entered by user. 1,2,3,4,5,... 100 (1 + 100) / 2 * 100 For 5: 1+2+3+4+5 the result is gonna be: 15 (1 + 5) / 2 * 5 = 15 range(1, 6) 1,2,3,4,5 """ def sum_up_to(end): sum = 0 # 15 for number in range(1, end+1): #number = 5 sum = sum + number return sum def sum_up_to2(end): return sum([number for number in range(1, end+1)]) def sum_up_to3(end): return sum({number for number in range(1, end+1)}) def sum_up_to4(end): return sum((number for number in range(1, end+1))) def sum_up_to5(end): return (1 + end) / 2 * end print(sum_up_to(1255)) print(sum_up_to2(1255)) print(sum_up_to3(1255)) print(sum_up_to4(1255)) print(sum_up_to5(1255))
{ "targets": [ { "target_name": "cpp-netlib", "type": "static_library", # unlike boost-asio which is header-only "include_dirs": [ "0.11.1-final/cpp-netlib-cpp-netlib-0.11.1-final" ], "defines": [ "BOOST_NETWORK_ENABLE_HTTPS" # otherwise getting "HTTPS not supported" ], "sources": [ "0.11.1-final/cpp-netlib-cpp-netlib-0.11.1-final/libs/network/src/*.cpp", "0.11.1-final/cpp-netlib-cpp-netlib-0.11.1-final/libs/network/src/*/*.cpp" ], "sources!": [ # I'm getting internal compiler errors with clang 3.5 and gcc 4.8.2 # on uri.cpp after compiling for minutes. This uri.cpp uses # boost-spirit, which is a bit of an ICE-magnet :( # See also https://github.com/cpp-netlib/cpp-netlib/issues/133 # and http://stackoverflow.com/questions/2616011/easy-way-to-parse-a-url-in-c-cross-platform # Anyway, cannot exlude it from build, yields linker errors. #"0.11.1-final/cpp-netlib-cpp-netlib-0.11.1-final/libs/network/src/uri/uri.cpp" ], "direct_dependent_settings": { "defines": [ "BOOST_NETWORK_ENABLE_HTTPS" ], "include_dirs": [ "0.11.1-final/cpp-netlib-cpp-netlib-0.11.1-final" ] }, "dependencies": [ "../boost-asio/boost-asio.gyp:boost-asio", "../boost-assign/boost-assign.gyp:boost-assign", "../boost-logic/boost-logic.gyp:boost-logic" ], "export_dependent_settings": [ "../boost-asio/boost-asio.gyp:boost-asio", "../boost-assign/boost-assign.gyp:boost-assign", "../boost-logic/boost-logic.gyp:boost-logic" ] }, { "target_name": "cpp-netlib_simple_wget", "type" : "executable", "test": { "args": [] }, "sources" : [ "0.11.1-final/cpp-netlib-cpp-netlib-0.11.1-final/libs/network/example/simple_wget.cpp" ], "dependencies" : [ "cpp-netlib", "../openssl/openssl.gyp:*" # only needed for https GETs ] } ] }
def chdir(): pass def getcwd(): pass def listdir(): pass def mkdir(): pass def remove(): pass def rename(): pass def rmdir(): pass sep = "/" def stat(): pass def statvfs(): pass def sync(): pass def uname(): pass def unlink(): pass def urandom(): pass
#!/usr/bin/env python """Contains the Data Model Descripts for the REST Resources. Contains the Data Model Configuration settings for each REST Resource provided by the Python Eve Server. Data validation object typing is also included. """ __author__ = "Sanjay Joshi" __copyright__ = "IBM Copyright 2015" __credits__ = ["Sanjay Joshi"] __license__ = "Apache 2.0" __version__ = "1.0" __maintainer__ = "Sanjay Joshi" __email__ = "[email protected]" __status__ = "Prototype"
# Given a linked list, rotate the list to the right by k places, where k is non-negative. # # Example 1: # # Input: 1->2->3->4->5->NULL, k = 2 # Output: 4->5->1->2->3->NULL # Explanation: # rotate 1 steps to the right: 5->1->2->3->4->NULL # rotate 2 steps to the right: 4->5->1->2->3->NULL # Example 2: # # Input: 0->1->2->NULL, k = 4 # Output: 2->0->1->NULL # Explanation: # rotate 1 steps to the right: 2->0->1->NULL # rotate 2 steps to the right: 1->2->0->NULL # rotate 3 steps to the right: 0->1->2->NULL # rotate 4 steps to the right: 2->0->1->NULL class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def rotateRight(self, head, k): if not head: return head if not head.next: return head length = 0 curr = head while curr: length += 1 curr = curr.next k = k % length slow = fast = head for _ in range(k): fast = fast.next while fast.next: slow = slow.next fast = fast.next fast.next = head head = slow.next slow.next = None return head
# 28 Wind Chill #Asking for air temperature and wind speed. T = float(input('Enter the air temperature in celsius= ')) v = float(input('Enter the velocity of windin km/h = ')) x = round(13.12 * 0.6215 * T - 11.37 * v ** 0.16 + 0.3965 * T * v ** 0.16) print('Wind chill index = ',x)
""" Class that represents a single linked list node that holds a single value and a reference to the next node in the list """ class Node: def __init__(self, value=None, next_node=None): self.value = value self.next_node = next_node def get_value(self): return self.value def get_next(self): return self.next_node def set_next(self, new_next): self.next_node = new_next class LinkedList: def __init__(self): self.head = None self.tail = None def __iter__(self): node = self.head while node: yield node node = node.next_node def add_to_tail(self, value): node = Node(value) if self.head: self.tail.next_node = node else: self.head = node self.tail = node def remove_head(self): prev_value = None if not self.head: return None elif self.head is self.tail: prev_value = self.head.value self.head = None self.tail = None else: prev_value = self.head.value self.head = self.head.next_node return prev_value def contains(self, value): for node in self: if node.value is value: return True return False def get_max(self): if not self.head: return None max = self.head.value for node in self: if node.value > max: max = node.value return max
##Read the dictionary fh = open('C:\\english-dict.txt') dict = [] while True: line = fh.readline() dict.append(line.strip()) if not line: break fh.close() #Enter letters to use when compile a list of words letters = input("Please enter your letters: ") letters_set=set(letters) mini = input("Minimum length of the word (default is 2): ") maks = int(input("Maximum length of the word (default is length of the input letters): ")) if mini == "": mini = 2 # this will be the default minimum value of words length mini = int(mini) newdic=[] for words1 in dict: if len(words1) <= maks and len(words1)>= mini: newdic.append(words1) for words in newdic: ok = 1 for i in words: if i in letters_set: ok = ok * 1 else: ok = ok * 0 if ok == 1: print(words)
class Collector: def __init__(self, name, have_task=True): self.name = name self.have_task = have_task self.data_dict = None self.last_collect = 0 def run_task(self): pass def get_data(self): pass
class ControlPoint(object): '''undirected unweighted graph''' def __init__(self): self.num = int(0) self.name = "" self.X = 0.0 self.Y = 0.0 self.Z = 0.0 self.N = 0.0 self.E = 0.0 self.H = 0.0 def init_controlpoint(self,line): line = line.rstrip('\n') line = line.split(',') self.num = int(line[0]) self.name = line[1] self.X = float(line[2]) self.Y = float(line[3]) self.Z = float(line[4]) self.N = float(line[5]) self.E = float(line[6]) self.H = float(line[7]) def controlpoint_inf(self): return [ self.num ,self.name, self.X, self.Y , self.Z] def controlpoint_match(self, point_name): if self.name == point_name: return True else : return False class Baseline(object): '''undirected unweighted graph''' def __init__(self): self.num = int(0) self.origin = "" self.target = "" self.name = "" self.DX = 0.0 self.DY = 0.0 self.DZ = 0.0 self.sigema_DX = 0.0 self.sigema_DY = 0.0 self.sigema_DZ = 0.0 def init_baseline(self,line): self.num = int(line[0]) self.origin = line[1] self.target = line[2] self.name = line[3] self.DX = float(line[4]) self.DY = float(line[5]) self.DZ = float(line[6]) self.sigema_DX = float(line[7]) self.sigema_DY = float(line[8]) self.sigema_DZ = float(line[9]) def baseline_inf(self): return [self.num,self.origin,self.target,self.name ,self.DX,self.DY,self.DZ,self.sigema_DX,self.sigema_DY,self.sigema_DZ,] def baseline_match(self,baseline): if baseline[0] == self.origin and baseline[1] == self.target: return True,1,self.num elif baseline[0] == self.target and baseline[1] == self.origin: return True,-1,self.num else: return False,0,-1 class GNSSNet(object): '''undirected unweighted graph''' def __init__(self): self.VertexNumber = int(0) #点 self.EdgeNumber = int(0) #边 self.BaselineSet = [] self.ControlPointSet = [] def insert_Baseline(self,baseline): self.BaselineSet.append(baseline) def insert_ControlPoint(self, controlpoint): self.ControlPointSet.append(controlpoint) def Net_baseline_match(self,baseline): for Baseline in self.BaselineSet: a,towards,number = Baseline.baseline_match(baseline) if a: return towards,self.BaselineSet[number-1].baseline_inf() def controlpoint_match(self,point_name): for controlpoint in self.ControlPointSet: if controlpoint.controlpoint_match(point_name): return True,controlpoint.controlpoint_inf() return False,None def init_P(self,P): for Baseline in self.BaselineSet: P[Baseline.num*3-3][Baseline.num*3-3] = 1.0 / (Baseline.sigema_DX * Baseline.sigema_DX) P[Baseline.num*3-2][Baseline.num*3-2] = 1.0 / (Baseline.sigema_DY * Baseline.sigema_DY) P[Baseline.num*3-1][Baseline.num*3-1] = 1.0 / (Baseline.sigema_DZ * Baseline.sigema_DZ) return P def init_L(self,L): for Baseline in self.BaselineSet: L[Baseline.num*3-3][0] = Baseline.DX L[Baseline.num*3-2][0] = Baseline.DY L[Baseline.num*3-1][0] = Baseline.DZ return L
# # Copyright (c) 2009 Voltaire # $COPYRIGHT$ # # Additional copyrights may follow # # $HEADER$ # """ Configuration settings for application """ # Debug mode DEBUG = True # Authorisation key AUTH = ""
def digit_powers(): res = [] for i in range(1, 10): j = 0 while True: j += 1 num = i ** j num_digits = len(str(num)) if num_digits != j: break res += [num] return res
class Solution(object): def longestPalindrome(self, s): """ :type s: str :rtype: str """ def preProcess(s): if not s: return ['^', '$'] T = ['^'] for c in s: T += ['#', c] T += ['#', '$'] return T T = preProcess(s) P = [0] * len(T) center, right = 0, 0 for i in xrange(1, len(T) - 1): i_mirror = 2 * center - i if right > i: P[i] = min(right - i, P[i_mirror]) else: P[i] = 0 while T[i + 1 + P[i]] == T[i - 1 - P[i]]: P[i] += 1 if i + P[i] > right: center, right = i, i + P[i] max_i = 0 for i in xrange(1, len(T) - 1): if P[i] > P[max_i]: max_i = i start = (max_i - 1 - P[max_i]) / 2 return s[start : start + P[max_i]] # Time: O(n^2) # Space: O(1) class Solution2(object): def longestPalindrome(self, s): """ :type s: str :rtype: str """ def expand(s, left, right): while left >= 0 and right < len(s) and s[left] == s[right]: left -= 1 right += 1 return (right-left+1)-2 left, right = -1, -2 for i in xrange(len(s)): l = max(expand(s, i, i), expand(s, i, i+1)) if l > right-left+1: right = i+l//2 left = right-l+1 return s[left:right+1] if left >= 0 else ""
print((type(None))) print(type(True)) print(type(5)) print(type(5.5)) print(type('hi')) print(type([])) print(type(())) print(type({}))
#!/usr/bin/env python #pylint: skip-file # This source code is licensed under the Apache license found in the # LICENSE file in the root directory of this project. class ProtectionDomain(object): def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. attributeMap (dict): The key is attribute name and the value is json key in definition. """ self.swaggerTypes = { 'classLoader': 'ClassLoader', 'codeSource': 'CodeSource', 'principals': 'list[Principal]', 'permissions': 'PermissionCollection' } self.attributeMap = { 'classLoader': 'classLoader', 'codeSource': 'codeSource', 'principals': 'principals', 'permissions': 'permissions' } self.classLoader = None # ClassLoader self.codeSource = None # CodeSource self.principals = None # list[Principal] self.permissions = None # PermissionCollection
a=1 b=2 print('a=',a,'b=',b) x=3 y=3 z=3 print(x,y,z)
res = 0 n = 0 print("S= ", end="") for n2 in range(1, 51): if n2 == 1: n += 1 print(f"{n}/{n}", end="") else: n += 2 res += (n / n2) print(f" + {n}/{n2}", end="") print(f"\nResultado = {res}")
"""A single Node in the graph of the art.""" class ArtNode: def __init__(self, x: int, y: int, thickness: int) -> None: self.x = x self.y = y self.thickness: int = thickness def xy(self, factor: int = 1): """ Gets the xy position of this node, but also allow for scaling it (for upscaling or downscaling resolution. """ return (self.x * factor, self.y * factor) def serialize(self): return f"{self.x}.{self.y}.{self.thickness}" @staticmethod def deserialize(code: str) -> "ArtNode": code_arr = code.split(".") x = int(code_arr[0]) y = int(code_arr[1]) thickness = int(code_arr[2]) return ArtNode(x, y, thickness) def clone(self) -> "ArtNode": return ArtNode(self.x, self.y, self.thickness)
lanche = 'Hambúrguer', 'Suco', 'Pizza', 'Pudim' for comida in lanche: print(f'Eu vou comer {comida}') for cont in range(0, len(lanche)): print(f'Eu vou comer {lanche[cont]} na posição {cont}') for pos, comida in enumerate(lanche): print(f'Eu vou comer {comida} na posição {pos + 1}') print('Comi pra caramba!')
""" By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom of the triangle below: 75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75 03 34 88 02 77 73 07 63 67 99 65 04 28 06 16 70 92 41 41 26 56 83 40 80 70 33 41 48 72 33 47 32 37 16 94 29 53 71 44 65 25 43 91 52 97 51 14 70 11 33 28 77 73 17 78 39 68 17 57 91 71 52 38 17 14 91 43 58 50 27 29 48 63 66 04 68 89 53 67 30 73 16 69 87 40 31 04 62 98 27 23 09 70 98 73 93 38 53 60 04 23 NOTE: As there are only 16384 routes, it is possible to solve this problem by trying every route. However, Problem 67, is the same challenge with a triangle containing one-hundred rows; it cannot be solved by brute force, and requires a clever method! ;o) """ input = """75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75 03 34 88 02 77 73 07 63 67 99 65 04 28 06 16 70 92 41 41 26 56 83 40 80 70 33 41 48 72 33 47 32 37 16 94 29 53 71 44 65 25 43 91 52 97 51 14 70 11 33 28 77 73 17 78 39 68 17 57 91 71 52 38 17 14 91 43 58 50 27 29 48 63 66 04 68 89 53 67 30 73 16 69 87 40 31 04 62 98 27 23 09 70 98 73 93 38 53 60 04 23""" # organize the data into an array of array # [[75], [95, 64], [17, 47, 82], [18, 35, 87, 10], .....] rows = input.split("\n") array = [] for i in rows: values = [int(j) for j in i.split()] array.append(values) # reverse the array to start from bottom row array.reverse() # compute partial sums until max total is found for i in range(1, len(array)): for j, k in enumerate(array[i]): array[i][j] = k + max([array[i - 1][j], array[i - 1][j + 1]]) print("maximum total from top to bottom: %s" % array[-1][0])
""" PyNullWeb - a web server that returns minimal content. :copyright: (c) 2017 by Detlef Kreuz :license: Apache 2.0, see LICENSE """
def alphabeta(node, is_max=True, alpha=float('-inf'), beta=float('inf')): if node and not node.children: return (node.val, [node]) elif is_max: # Can always fall back on alpha. This is the lower bound score for child in node.children: score, path = minimax(child, False, alpha, beta) # Prune here. A grandparent would not go down this path since beta # is lower than score. That is, it already knows a path that's better # than anything in this subtree. if score > beta: return (score, path + [node]) elif score > alpha: alpha = score best_path = path + [node] return (alpha, best_path) else: # Minimizer for child in node.children: # Can always fall back on beta. This is the upper bound score score, path = minimax(child, True, alpha, beta) # Prune here. A grandparent would not go down this path since alpha # is higher than score. if alpha > score: return (score, path + [node]) elif score < beta: beta = score best_path = path + [node] return (beta, best_path)
#desenvolva um programa que leia o primeiro #termo e a razao de uma PA. No final, Mostre #os 10 primeiro termos dessa progressao. #OBS: PA= (1,100,10) o primeiro n=1 a razao=10 primeiroTermo=int(input("Digite o primeiro termo da sua PA: ")) razao=int(input("Digite a razao da sua PA: ")) pa=int(input("Qual a posiçao voce quer encontrar? ")) posicao=primeiroTermo+(pa-1)*razao print(posicao) print("="*45) print("{:^45}".format("10 termos de uma PA")) print("="*45) primeiroTermo=int(input("\nDigite o primeiro termo da sua PA: ")) razao=int(input("Digite a razao da sua PA: ")) for pa in range(1,11): posicao=primeiroTermo+(pa-1)*razao print(posicao, end=" → ") print("Fim") print("="*45) print("{:^45}".format("10 termos de uma PA")) print("="*45) primeiroTermo=int(input("\nDigite o primeiro termo da sua PA: ")) razao=int(input("Digite a razao da sua PA: ")) decimo=primeiroTermo+(11-1)*razao for pa in range(primeiroTermo,decimo,razao): print(pa, end=" → ") print("Fim")
# -*- coding: utf-8 -*- class ErrorResponse(Exception): def __init__(self, error=None, errorcode=None, errormessage=None, errordetails=None): self.error = error self.errorcode = errorcode self.errormessage = errormessage self.errordetails = errordetails def __str__(self): return repr(self) def __repr__(self): return ( "ErrorResponse(error={}, errorcode={}, errormessage={}" ", errordetails={})" ).format(self.error, self.errorcode, self.errormessage, self.errordetails)
#!/usr/bin/env python3 """ This module contains forms used by the app. """
""" construir uma classe carro que vai possuir dois atributos compostos por outras duas classes: 1) Motor 2) Direção 1 - Motor resposavel de controlar a velocidade 1- atributo de velocidade 2- acelerar, incremetar de 1 unidade a 1 3- frear que decremeta em 2 unidades 2 - Direção responsavel por controlar a direção 1- valor de direção ( Leste , Sul , Oeste , Norte ) N O L S 2- Metodo girar para esquerda 3- Metodo girar para direita Exemplo: >>> # Testando motor >>> motor = Motor() >>> motor.velocidade 0 >>> motor.acelerar() >>> motor.velocidade 1 >>> motor.acelerar() >>> motor.velocidade 2 >>> motor.acelerar() >>> motor.velocidade 3 >>> motor.frear() >>> motor.velocidade 1 >>> motor.frear() >>> motor.velocidade 0 >>> # Testando Direcao >>> direcao = Direcao() >>> direcao.valor 'Norte' >>> direcao.girar_a_direita() >>> direcao.valor 'Leste' >>> direcao.girar_a_direita() >>> direcao.valor 'Sul' >>> direcao.girar_a_direita() >>> direcao.valor 'Oeste' >>> direcao.girar_a_direita() >>> direcao.valor 'Norte' >>> direcao.girar_a_esquerda() >>> direcao.valor 'Oeste' >>> direcao.girar_a_esquerda() >>> direcao.valor 'Sul' >>> direcao.girar_a_esquerda() >>> direcao.valor 'Leste' >>> direcao.girar_a_esquerda() >>> direcao.valor 'Norte' >>> carro = Carro(direcao, motor) >>> carro.calcular_velocidade() 0 >>> carro.acelerar() >>> carro.calcular_velocidade() 1 >>> carro.acelerar() >>> carro.calcular_velocidade() 2 >>> carro.frear() >>> carro.calcular_velocidade() 0 >>> carro.calcular_direcao() 'Norte' >>> carro.girar_a_direita() >>> carro.calcular_direcao() 'Leste' >>> carro.girar_a_esquerda() >>> carro.calcular_direcao() 'Norte' >>> carro.girar_a_esquerda() >>> carro.calcular_direcao() 'Oeste' """ class Motor: NORTE = 'Norte' # metodo de classe LESTE = 'Leste' # metodo de classe SUL = 'Sul' # metodo de classe OESTE = 'Oeste' # metodo de classe def __init__(self): self.velocidade = 0 # metodo de instancia def acelerar(self): # atributo self.velocidade += 1 def frear(self): self.velocidade -= 2 self.velocidade = max(0, self.velocidade) # classe "max" pega o parametro para menor e maior valor , assim o # valor nunca sera menor que zero # variaveis criada em MAIUSCULO mostra que o valor é uma constante mas não garante que não seja alterada class Direcao: direcao_direita_dct = {NORTE: LESTE, LESTE: SUL, SUL: OESTE, OESTE: NORTE} direcao_esquerda_dct = {NORTE: OESTE, OESTE: SUL, SUL: LESTE, LESTE: NORTE} def __init__(self): self.valor = NORTE def girar_a_direita(self): self.valor = self.direcao_direita_dct[self.valor] def girar_a_esquerda(self): self.valor = self.direcao_esquerda_dct[self.valor]
# -*- coding: utf-8 -*- ''' File name: code\sum_of_squares\sol_273.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x ''' # Solution to Project Euler Problem #273 :: Sum of Squares # # For more information see: # https://projecteuler.net/problem=273 # Problem Statement ''' Consider equations of the form: a2 + b2 = N, 0 ≤ a ≤ b, a, b and N integer. For N=65 there are two solutions: a=1, b=8 and a=4, b=7. We call S(N) the sum of the values of a of all solutions of a2 + b2 = N, 0 ≤ a ≤ b, a, b and N integer. Thus S(65) = 1 + 4 = 5. Find ∑S(N), for all squarefree N only divisible by primes of the form 4k+1 with 4k+1 < 150. ''' # Solution # Solution Approach ''' '''
def primes(n): for i, prime in enumerate(prime_generator()): if i == n: return prime def prime_generator(): n = 2 primes = set() while True: for p in primes: if n % p == 0: break else: primes.add(n) yield n n += 1
#-*-coding=utf-8-*- class Node(object): def __init__(self, elem=-1,lchild=None, rchild=None): self.elem=elem self.lchild=lchild self.rchild=rchild class Tree(object): def __init__(self): self.root=Node() self.nodequeue=[] def addnode(self, elem): node =Node(elem) if self.root.elem == -1: self.root=node self.nodequeue.append(self.root) else: treeNode = self.nodequeue[0] if treeNode.lchild == None: treeNode.lchild=node self.nodequeue.append(treeNode.lchild) else: treeNode.rchild=node self.nodequeue.append(treeNode.rchild) self.nodequeue.pop(0) # def traversal(self): # return class traversal(object): def preorder(self,root): if root==None: return print(root.elem,end=' ') self.preorder(root.lchild) self.preorder(root.rchild) def postorder(self,root): if root==None: return self.postorder(root.lchild) self.postorder(root.rchild) print(root.elem,end=' ') def inorder(self,root): if root==None: return self.inorder(root.lchild) print(root.elem,end=' ') self.inorder(root.rchild) def level(self,root): if root==None: return nodequeue=[] node=root nodequeue.append(node) while nodequeue: node=nodequeue.pop(0) print(node.elem,end=' ') if node.lchild !=None: nodequeue.append(node.lchild) if node.rchild !=None: nodequeue.append(node.rchild) def prestack(self,root): if root == None: return nodeStack=[] node=root while node or nodeStack: while node: print(node.elem,end=' ') nodeStack.append(node) node=node.lchild node=nodeStack.pop() node=node.rchild def poststack(self,root): if root == None: return nodeStack1 = [] nodeStack2= [] node = root nodeStack1.append(node) while nodeStack1: node=nodeStack1.pop() if node.lchild: nodeStack1.append(node.lchild) if node.rchild: nodeStack1.append(node.rchild) nodeStack2.append(node) while nodeStack2: print(nodeStack2.pop().elem,end=' ') def instack(self,root): if root==None: return nodeStack=[] node=root while node or nodeStack: while node: nodeStack.append(node) node=node.lchild node = nodeStack.pop() print(node.elem,end=' ') node=node.rchild #tree's diameter equal to the sum of left and right's depth 1-2-3-4-5 => 4-2-1-3 ,d=3 class Diameter(object): def getDepth(self, root): if not root: return 0 l=self.getDepth(root.lchild) r=self.getDepth(root.rchild) self.d=max(self.d,l+r) #??? return max(l,r)+1 def diaofTree(self,root): self.d=0 self.getDepth(root) return self.d if __name__=='__main__': elems=range(10) tree=Tree() trave=traversal() dia=Diameter() for elem in elems: tree.addnode(elem) print('level:') trave.level(tree.root) print() print('preorder:') trave.preorder(tree.root) print() print('postorder:') trave.postorder(tree.root) print() print('poststack') trave.poststack(tree.root) print() print(dia.diaofTree(tree.root))
def f(n:Int)->Int: return (n * (n+1)) // 2 def get_numbers(how_many:Int)->List(Int): nums = [] for i in range(1, 1 + how_many): nums.append(f) return nums print(get_numbers(4)) def apply_first(funs, n): return funs[0](n) print(apply_first(get_numbers(4), 10))
""" 异常的自定义和抛出: class ****Exception(Exception): pass 定义一个学生类,私有属性gender,提供对应的设置值及访问值的方法 """ # 异常类定义 class GenderException(Exception): def __init__(self): super().__init__() self.err_msg = "性别只能设置为男、女、male、female、man、woman" class Student: def __init__(self, name, gender): self.name = name self.__gender = self.gender = gender @property def gender(self): return self.__gender @gender.setter def gender(self, gender): if gender == 'man' \ or gender == 'woman'\ or gender == 'male' \ or gender == 'female'\ or gender == '男' \ or gender == '女': self.__gender = gender else: # 抛出(性别)异常 raise GenderException def show_info(self): print('我叫{0},性别{1}'.format(self.name, self.__gender)) stu1 = Student('yy', 'male') stu1.show_info() try: stu1.gender = 'unknown' except Exception as e: print(type(e)) print(e.args) print(e.err_msg) finally: stu1.show_info() print(stu1.gender) print(type(stu1.gender))
''' Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. ''' class Solution: def isValid(self, s: str) -> bool: stack = [] par_dic = { ")" : "(", "}" : "{", "]" : "[" } for i in s: if i == "{" or i == "[" or i == "(": stack.append(i) else: if len(stack) > 0 and stack[-1] == par_dic[i]: stack.pop() else: return False if len(stack) == 0: return True return False
""" Codemonk link: https://www.hackerearth.com/problem/algorithm/monk-and-palindromes-52299611/ Monk loves maths and is always curious to learn new things. Recently, he learned about palindromes. Now, he decided to give his students a problem which uses maths and the concept of palindromes. So, he wants the students to find how many different numbers they can create according to the following conditions. He will give the students an integer N which will denote the total number of digits in the final number. Also he will provide them with Q conditions where these conditions will be of form A B where the number formed by concatenating the digits from the Ath position to Bth position is a palindrome. You can learn more about palindromes here. Note- Numbers with leading zeros are also to be considered. Input - Output: First line consists of the integer N denoting the number of digits in final number. Next line consists of the integer Q denoting the number of conditions. Next Q lines will be of the form A B which denotes that the number formed by concatenating the digits from the position to position of the final number is a palindrome. Print the number of different numbers the students can create by following the conditions. Since the answer can be very large, print it modulo 10^9 + 7. Sample input: 5 2 2 4 3 5 Sample Output: 1000 """ """ To translate the problem to a disjoint set problem we have to note that if we have a palindrome from 0th position to nth, then 0-n, 1-n-1, 2-n-2, etc must have the same value. That basically means that if the range of the sequence is N and i have 10^N possible combinations, if we have a palindrome from 0 to N then we have 10^(N-N//2) combinations. We basically need to find all such groups. For example, if we have 1-5 to be a palindrome then 1 and 5 belong to one set and 2-4 to another. We can continue the same process to find the total number of groups. After doing so we can easily calculate the answer. Final complexity: O(Q*N*INVERSE_ACKERMAN) """ def find_root(array, value): if array[value] != value: array[value] = find_root(array, array[value]) return array[value] n = int(input()) q = int(input()) disjoint = [i for i in range(n)] sizes = [1] * n for _ in range(q): a, b = map(int, input().split()) ind = b for i in range(a-1, (b+a)//2): val_a = i ind -= 1 val_b = ind root_a = find_root(disjoint, val_a) root_b = find_root(disjoint, val_b) if root_a != root_b: if sizes[root_a] < sizes[root_b]: disjoint[root_a] = root_b sizes[root_b] += sizes[root_a] else: disjoint[root_b] = root_a sizes[root_a] += sizes[root_b] groups = {} for i in range(n): temp = find_root(disjoint, i) if temp in groups: continue else: groups[temp] = 1 ans = 1 temp_mod = 1000000007 for i in range(1, len(groups)+1): ans = ((ans % temp_mod) * (10 % temp_mod)) % temp_mod print(ans)
def contador(* num): # O asterisco no contador significa que pode receber diversos valores e vai colocar dentro de uma tupla for valor in num: print(f' {valor} ', end='') print(f'Recebi os valores {num} e sao ao todo {len(num)}') print('Fim') contador(2, 1, 7) contador(4, 0, 4, 6, 9, 8) def soma(* valores): s = 0 for n in valores: s+= n print(f'somando os valores{valores} tems {s}') soma(1, 2, 3) soma(4, 5, 6, 7)
# -*- coding: utf-8 -*- """Main module.""" def ascii_deco(vector): cadena = vector.split(',') suma = " " for i in range(len(cadena)): ascci = int(cadena[i]) caracter = chr(ascci) suma = suma + caracter print (suma)
# # This file contains the Python code from Program 11.22 of # "Data Structures and Algorithms # with Object-Oriented Design Patterns in Python" # by Bruno R. Preiss. # # Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved. # # http://www.brpreiss.com/books/opus7/programs/pgm11_22.txt # class Simulation(object): ARRIVAL = 0 DEPARTURE = 1 def __init__(self): super(Simulation, self).__init__() self._eventList = LeftistHeap() self._serverBusy = False self._numberInQueue = 0 self._serviceTime = ExponentialRV(100.0) self._interArrivalTime = ExponentialRV(100.0) def run(self, timeLimit): self._eventList.enqueue(self.Event(self.ARRIVAL, 0)) while not self._eventList.isEmpty: evt = self._eventList.dequeueMin() t = evt.time if t > timeLimit: self._eventList.purge() break if evt.type == self.ARRIVAL: if not self._serverBusy: self._serverBusy = True self._eventList.enqueue( self.Event(self.DEPARTURE, t + self._serviceTime.next)) else: self._numberInQueue += 1 self._eventList.enqueue(self.Event(self.ARRIVAL, t + self._interArrivalTime.next)) elif evt.type == self.DEPARTURE: if self._numberInQueue == 0: self._serverBusy = False else: self._numberInQueue -= 1 self._eventList.enqueue( self.Event(self.DEPARTURE, t + self._serviceTime.next)) # ...
NETWORKS = { 3: { "name": "test", "http_provider": "https://ropsten.infura.io", "ws_provider": "wss://ropsten.infura.io/ws", "db": { "DB_DRIVER": "mysql+pymysql", "DB_HOST": "localhost", "DB_USER": "unittest_root", "DB_PASSWORD": "unittest_pwd", "DB_NAME": "verification_unittest_db", "DB_PORT": 3306, }, } } NETWORK_ID = 3 SLACK_HOOK = {} REGION_NAME = "us-east-2" JUMIO_BASE_URL = "https://netverify.com/api/v4" JUMIO_INITIATE_URL = f"{JUMIO_BASE_URL}/initiate" JUMIO_SUBMIT_URL = "" DAPP_POST_JUMIO_URL = "" JUMIO_CALLBACK_URL = "" JUMIO_WORKFLOW_ID = 200 JUMIO_API_TOKEN_SSM_KEY = "" JUMIO_API_SECRET_SSM_KEY = "" ALLOWED_VERIFICATION_REQUESTS = 2 VERIFIED_MAIL_DOMAIN = ["allowed.io"] REGISTRY_ARN = { "ORG_VERIFICATION": "" }
# Declares an initial list with 5 values List1 = [1,2,3,4,5] # Unpacks this list into 5 separate variables a,b,c,d,e = List1 # Prints both the list and one of the unpacking variables print(List1) print(a) # Changes the value of a to 6 a = 6 # Prints both the list and a, and we can see that changing a does not change the corresponding value in the list print(a) print(List1) # Changes the value of one list entry to nine List1[1] = 9 # Prints the list and the corresponding unpacking variable to show that changing the unpacking # variable does not change the list value print(List1) print(b) # We conclude that this method does not just create a variable that points to the same location in space, but rather # fills new separately stored variables with values from the list
def sum_of_multiples(limit, multiples): multiples_set = set() for multiple in multiples: if multiple != 0: quotient, rest = divmod(limit, multiple) if rest == 0: quotient -=1 multiples_set = multiples_set.union(set(multiple * i for i in range(1,quotient+1))) return sum(multiples_set)
# Size of the window SCREEN_WIDTH = 1200 SCREEN_HEIGHT = 800 # Default friction used for sprites, unless otherwise specified DEFAULT_FRICTION = 0.2 # Default mass used for sprites DEFAULT_MASS = 1 # Gravity GRAVITY = (0.0, -900.0) # Player forces PLAYER_MOVE_FORCE = 700 PLAYER_JUMP_IMPULSE = 600 PLAYER_PUNCH_IMPULSE = 600 # Grid-size SPRITE_SIZE = 64 # How close we get to the edge before scrolling VIEWPORT_MARGIN = 100
# Write a program that outputs the string representation of numbers from 1 to n. # # But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of both three and five output “FizzBuzz”. # # Example: # # n = 15, # # Return: # [ # "1", # "2", # "Fizz", # "4", # "Buzz", # "Fizz", # "7", # "8", # "Fizz", # "Buzz", # "11", # "Fizz", # "13", # "14", # "FizzBuzz" # ] # # # # @lc app=leetcode id=412 lang=python3 # # [412] Fizz Buzz # # https://leetcode.com/problems/fizz-buzz/description/ # # algorithms # Easy (60.01%) # Likes: 582 # Dislikes: 866 # Total Accepted: 230.2K # Total Submissions: 383.4K # Testcase Example: '1' # # Write a program that outputs the string representation of numbers from 1 to # n. # # But for multiples of three it should output “Fizz” instead of the number and # for the multiples of five output “Buzz”. For numbers which are multiples of # both three and five output “FizzBuzz”. # # Example: # # n = 15, # # Return: # [ # ⁠ "1", # ⁠ "2", # ⁠ "Fizz", # ⁠ "4", # ⁠ "Buzz", # ⁠ "Fizz", # ⁠ "7", # ⁠ "8", # ⁠ "Fizz", # ⁠ "Buzz", # ⁠ "11", # ⁠ "Fizz", # ⁠ "13", # ⁠ "14", # ⁠ "FizzBuzz" # ] # # # class Solution: def fizzBuzz(self, n: int) -> List[str]: result = [] for i in range(1, n + 1): if i % 3 == 0 and i % 5 == 0: result.append("FizzBuzz") elif i % 3 == 0: result.append("Fizz") elif i % 5 == 0: result.append("Buzz") else: result.append(str(i)) return result
class Solution: """ Time Complexity: O(N) Space Complexity: O(1) """ def balanced_string_split(self, s: str) -> int: # initialize variables L_count, R_count = 0, 0 balanced_substring_count = 0 # parse the string for char in s: # update the number of Ls and the number of Rs so far if char == 'L': L_count += 1 elif char == 'R': R_count += 1 # if the string is balanced, increment the balanced substrings count and reset the counters if L_count == R_count: balanced_substring_count += 1 L_count, R_count = 0, 0 return balanced_substring_count
# -*- coding: utf-8 -*- # # Copyright 2017-2021 BigML # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Options for BigMLer deepnet """ def get_deepnet_options(defaults=None): """Adding arguments for the deepnet subcommand """ if defaults is None: defaults = {} options = { # Input fields to include in the deepnet. '--deepnet-fields': { "action": 'store', "dest": 'deepnet_fields', "default": defaults.get('deepnet_fields', None), "help": ("Comma-separated list of input fields" " (predictors) to create the deepnet.")}, # If a BigML deepnet is provided, the script will # use it to generate predictions '--deepnet': { 'action': 'store', 'dest': 'deepnet', 'default': defaults.get('deepnet', None), 'help': "BigML deepnet Id."}, # The path to a file containing deepnet ids. '--deepnets': { 'action': 'store', 'dest': 'deepnets', 'default': defaults.get('deepnets', None), 'help': ("Path to a file containing deepnets/ids." " One deepnet" " per line (e.g., " "deepnet/50a206a8035d0706dc000376" ").")}, # If a BigML json file containing a deepnet # structure is provided, # the script will use it. '--deepnet-file': { 'action': 'store', 'dest': 'deepnet_file', 'default': defaults.get('deepnet_file', None), 'help': "BigML deepnet JSON structure file."}, # The batch_normalization. Specifies whether to normalize the outputs # of a network before being passed to the activation function or not. '--batch-normalization': { 'action': 'store_true', 'dest': 'batch_normalization', 'default': defaults.get('batch_normalization', None), 'help': ("Specifies whether to normalize the outputs of" " a network before being passed to the activation" " function or not.")}, # Stopping criteria for solver. '--default-numeric-value': { 'action': 'store', 'dest': 'default_numeric_value', 'default': defaults.get('default_numeric_value', None), 'choices': ["mean", "median", "minimum", "maximum", "zero"], 'help': ("It accepts any of the following strings to substitute" " missing numeric values across all the numeric fields" " in the dataset: 'mean', 'median', 'minimum'," " 'maximum', 'zero'.")}, # dropout to control overfitting '--dropout-rate': { 'action': 'store', 'dest': 'dropout_rate', 'type': float, 'default': defaults.get('dropout_rate', None), 'help': ("A number between 0 and 1 specifying the rate at " "which to drop weights during training to control" " overfitting")}, # Hidden layers description '--hidden-layers': { 'action': 'store', 'dest': 'hidden_layers', 'default': defaults.get('hidden_layers', None), 'help': ("A JSON file that contains a list of maps describing" " the number and type of layers in the network " "(other than the output layer, which is determined by " "the type of learning problem).")}, # Use alternate layers for residuals '--learn-residuals': { 'action': 'store_true', 'dest': 'learn_residuals', 'default': defaults.get('learn_residuals', None), 'help': ("Specifies whether alternate layers should learn a" " representation of the residuals for a given layer" " rather than the layer itself or not.")}, # Learning rate '--learning-rate': { 'action': 'store', 'dest': 'learning_rate', 'type': float, 'default': defaults.get('learning_rate', None), 'help': ("A number between 0 and 1 specifying the" " learning rate.")}, # Max iterations '--max-iterations': { 'action': 'store', 'dest': 'max_iterations', 'type': int, 'default': defaults.get('max_iterations', None), 'help': ("A number between 100 and 100000 for the maximum " "number of gradient steps to take during the" " optimization.")}, # Max training time '--max-training-time': { 'action': 'store', 'dest': 'max_training_time', 'type': int, 'default': defaults.get('max_training_time', None), 'help': ("The maximum wall-clock training time, in seconds, " "for which to train the network. ")}, # Number of hidden layers '--number-of-hidden-layers': { 'action': 'store', 'dest': 'number_of_hidden_layers', 'type': int, 'default': defaults.get('number_of_hidden_layers', None), 'help': ("The number of hidden layers to use in the network. " "If the number is greater than the length of the list" " of hidden_layers, the list is cycled until the" " desired number is reached. If the number is smaller" " than the length of the list of hidden_layers, the" " list is shortened. ")}, # Number of model candidates '--number-of-model-candidates': { 'action': 'store', 'dest': 'number_of_model_candidates', 'type': int, 'default': defaults.get('number_of_model_candidates', None), 'help': ("An integer specifying the number of models to try " "during the model search. ")}, # use search '--search': { 'action': 'store', 'dest': 'search', 'default': defaults.get('search', None), 'help': ("During the deepnet creation, BigML trains and" " evaluates over all possible network configurations," " returning the best networks found for the problem. " "The final deepnet returned by the search is a " "compromise between the top n networks found in the" " search. Since this option builds several networks," " it may be significantly slower than the" " suggest_structure technique.")}, # Suggest structure '--suggest-structure': { 'action': 'store_true', 'dest': 'suggest_structure', 'default': defaults.get('suggest_structure', None), 'help': ("An alternative to the search technique that is " "usually a more efficient way to quickly train " "and iterate deepnets and it can reach similar" " results. BigML has learned some general rules " "about what makes one network structure better" " than another for a given dataset. Given your" " dataset, BigML will automatically suggest a" " structure and a set of parameter values that" " are likely to perform well for your dataset." " This option only builds one network.")}, # Missing numeric values are used '--missing-numerics': { 'action': 'store_true', 'dest': 'missing_numerics', 'default': defaults.get('missing_numerics', True), 'help': ("Whether to create an additional binary predictor each" " numeric field which denotes a missing value. If" " false, these predictors are not created, and rows" " containing missing numeric values are dropped. ")}, # Missing numeric values are not used '--no-missing-numerics': { 'action': 'store_false', 'dest': 'missing_numerics', 'default': defaults.get('missing_numerics', True), 'help': ("Whether to create an additional binary predictor each" " numeric field which denotes a missing value. If" " true, these predictors are not created, and rows" " containing missing numeric values are dropped. ")}, # Suggest structure '--tree-embedding': { 'action': 'store_true', 'dest': 'tree_embedding', 'default': defaults.get('tree_embedding', None), 'help': ("Specify whether to learn a tree-based representation" " of the data as engineered features along with the" " raw features, essentially by learning trees over " "slices of the input space and a small amount of " "the training data. The theory is that these engineered" " features will linearize obvious non-linear " "dependencies before training begins, and so make " "learning proceed more quickly. ")}, # Does not balance fields '--no-balance-fields': { 'action': 'store_false', 'dest': 'balance_fields', 'default': defaults.get('balance_fields', True), 'help': "Do not balance fields."}, # Does not create a deepnet just a dataset. '--no-deepnet': { 'action': 'store_true', 'dest': 'no_deepnet', 'default': defaults.get('no_deepnet', False), 'help': "Do not create a deepnet."}, # The path to a file containing deepnet attributes. '--deepnet-attributes': { 'action': 'store', 'dest': 'deepnet_attributes', 'default': defaults.get('deepnet_attributes', None), 'help': ("Path to a json file describing deepnet" " attributes.")}, # Create a deepnet, not just a dataset. '--no-no-depnet': { 'action': 'store_false', 'dest': 'no_deepnet', 'default': defaults.get('no_deepnet', False), 'help': "Create a deepnet."}} return options
""" Introduction ============ The ``ox_profile`` package provides a python framework for statistical profiling. If you are using ``Flask``, then ``ox_profile`` provides a flask blueprint so that you can start/stop/analyze profiling from within your application. You can also run the profiler stand-alone without ``Flask`` as well. Why statistical profiling (and why ox\_profile)? ================================================ Python contains many profilers which instrument your code and give you exact results. A main benefit here is you know *exactly* what your program is doing. The disadvantage is that there can be significant overhead. With a statistical profiler such as ``ox_profile``, we sample a running program periodically to get a sense of what the program is doing with an overhead that can be tuned as desired. One main use case for ``ox_profile`` specifically (and statistical profiling in general) is that you can apply it to a production server to see how things work "in the wild". There are other statistical profilers out there for python (such as statprof), which are pretty good and may be better for your needs than ``ox_profile``. So why would you consider ``ox_profile``? Some possible reasons include: 1. Works on non-UNIX systems (e.g., works on Windows). - Many other statistical profilers use various excellent features of LINUX or UNIX while ``ox_profile`` only really relies on the python ``sys._current_frames`` method. 2. Simple to understand. - The code for ``ox_profile`` is fairly simple. The main work is really inside ``ox_profile.core.sampling.Sampler`` so it is easy to reason about or modify if you need slightly different profiling. 3. Flask Blueprint provided. - If you are using Flask, then you can register the ``ox_profile`` blueprint and easily get statistical profiling in your flask app. Usage ===== With Flask ---------- If you are using the python flask framework and have installed ``ox_profile`` (e.g., with ``pip install ox_profile``) then you can simply do the following in the appropriate place after initializing your app: :: from ox_profile.ui.flask.views import OX_PROF_BP app.register_blueprint(OX_PROF_BP) app.config['OX_PROF_USERS'] = {<admin_user_1>, <admin_user_2>, ...} where ``<admin_user_>``, etc. are strings referring to users who are allowed to access ``ox_profile``. Pointing your browser to the route ``/ox_profile/status`` will then show you the profiling status. By default, ``ox_profile`` starts out paused so that it will not incur any overhead for your app. Go to the ``/ox_profile/unpause`` route to unpause and begin profiling so that ``/ox_profile/status`` shows something interesting. Stand alone ----------- You can run the profiler without flask simply by starting the launcher and then running queries when convenient via something like: :: >>> from ox_profile.core import launchers >>> launcher = launchers.SimpleLauncher() >>> launcher.start() >>> launcher.unpause() >>> <call some functions> >>> query, total_records = launcher.sampler.my_db.query() >>> info = ['%s: %s' % (i.name, i.hits) for i in query] >>> print('Items in query:\n - %s' % (('\n - '.join(info)))) >>> launcher.cancel() # This turns off the profiler for good Output ====== Currently ``ox_profile`` is in alpha mode and so the output is fairly bare bones. When you look at the results of ``launcher.sampler.my_db.query()`` in stand alone mode or at the ``/ox_profile/status`` route when running with flask, what you get is a raw list of each function your program has called along with how many times that function was called in our sampling. Design ====== High Level Design ----------------- Python offers a number of ways to get profiling information. In addition to high-level profiling tools such as in the ``profile`` package, there are specialized functions like ``sys.settrace`` and ``sys.setprofile``. These are used for deterministic profiling and relatively robust but have some overhead as they are invoked on each function call. At a high level, we want a way to get a sample of what the python interpreter is doing at any give instance. The sampling approach has the advantage that by turning the sampling interval low enough, we can add arbitrarily low overhead and make profiling feasible in a production system. By taking a long enough sample, however, we should be able to get arbitrarily accurate profiling information. Low Level Design ---------------- At a low level, we do this sampling using ``sys._current_frames``. As suggested by the leading underscore, this system function may be a bit less robust. Indeed, the documentation says "This function should be used for specialized purposes only." Hopefully the core python developers will not make major changes to such a useful function. In any case, the most interesting class is the ``Sampler`` class in the ``ox_profile.core.sampling`` module. This class has a run method which does the following: 1. Uses ``sys.setswitchinterval`` to try and prevent a thread context switch. 2. Calls ``sys._current_frames`` to sample what the python interpreter is doing. 3. Updates a simple in-memory database of what functions are running. In principle, you could just use the Sampler via something like :: >>> from ox_profile.core import sampling, recording >>> sampler = sampling.Sampler(recording.CountingRecorder()) >>> def foo(): ... sampler.run() ... return 'done' ... >>> foo() The above would have the sampler take a snapshot of the stack frames when the ``foo`` function is run. Of course, this isn't very useful by itself because it just tells you that ``foo`` is being run. It could be useful if there were other threads which were running because the sampler would tell you what stack frame those threads were in. In principle, you could just call the ``Sampler.run`` method to track other threads but that still isn't very convenient. To make things easy to use, we provide the ``SimpleLauncher`` class in the ``ox_profile.core.launchers`` module as shown in the Usage section. The ``SimpleLauncher`` basically does the following: 1. Creates an instance of the ``Sampler`` class with reasonable defaults. 2. Initializes itself as a daemon thread and starts. 3. Pauses itself so the thread does nothing so as to not load the system. 4. Provides an ``unpause`` method you can use when you want to turn on profiling. 5. Provides a ``pause`` method if you want to turn off profiling. In principle, you don't need much beyond the ``Sampler`` but the ``SimpleLauncher`` makes it easier to launch a ``Sampler`` in a separate thread. Known Issues ============ Granularity ----------- With statistical profiling, we need to ask the thread to sleep for some small amount so that it does not overuse CPU resources. Sadly, the minimum sleep time (using either ``time.sleep`` or ``wait`` on a thread event) is on the order of 1--10 milliseconds on most operating systems. This means that you can not efficiently do statistical profiling at a granularity finer than about 1 millisecond. Thus you should consider statistical profiling as a tool to find the relatively slow issues in production and not a tool for optimizing issues faster than about a millisecond. """
def opcodeI() -> int: with open("/home/thelichking/Desktop/adventOfCode/Day2/Opcodes",'r' ) as file: lines = list(map(int,file.readline().replace("\n","").split(","))) lines[1],lines[2] = 1,0 idx = 0 while idx < len(lines): cur_opcode = lines[idx] if cur_opcode == 99: return lines[0] else: if cur_opcode == 1: lines[lines[idx+3]] = lines[lines[idx+1]] + lines[lines[idx+2]] elif cur_opcode == 2: lines[lines[idx+3]] = lines[lines[idx+1]] * lines[lines[idx+2]] idx += 4 return lines[0] def opcodeII(noun, verb) -> int: with open("/home/thelichking/Desktop/adventOfCode/Day2/Opcodes",'r' ) as file: lines = list(map(int,file.readline().replace("\n","").split(","))) lines[1],lines[2] = noun,verb idx = 0 while idx < len(lines): cur_opcode = lines[idx] if cur_opcode == 99: return lines[0] else: if cur_opcode == 1: lines[lines[idx+3]] = lines[lines[idx+1]] + lines[lines[idx+2]] elif cur_opcode == 2: lines[lines[idx+3]] = lines[lines[idx+1]] * lines[lines[idx+2]] idx += 4 return lines[0] def inputII() -> int: for i in range(100): for j in range(100): if opcodeII(j,i) == 19690720: return 100*j + i if __name__=="__main__": print(inputII())
class Solution: def findLUSlength(self, a, b): """ :type a: str :type b: str :rtype: int """ if a == b: return -1 return max(len(a), len(b))
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def inOrder(self, root, bstArr): if not root: return if root.left: self.inOrder(root.left, bstArr) bstArr.append(root.val) if root.right: self.inOrder(root.right, bstArr) return bstArr def findTarget(self, root, k): """ :type root: TreeNode :type k: int :rtype: bool """ ordered_tree = self.inOrder(root, []) p1 = 0 p2 = len(ordered_tree)-1 while p1 < p2: if ordered_tree[p1]+ordered_tree[p2]==k: return True elif ordered_tree[p1]+ordered_tree[p2]<k: p1+=1 else: p2-=1 return False if __name__ == "__main__": solution = Solution() head1 = TreeNode(5) head1.left = TreeNode(3) head1.right = TreeNode(6) head1.left.left = TreeNode(2) head1.left.right = TreeNode(4) head1.right.right = TreeNode(7) print(solution.inOrder(head1, [])) print(solution.findTarget(head1, 9))
# Advent Of Code 2016, day 3, part 2 # http://adventofcode.com/2016/day/3 # solution by ByteCommander, 2016-12-03 data = open("inputs/aoc2016_3.txt").read() # parse input to vertical groups of 3 numbers rows = [[int(x) for x in line.split()] for line in data.splitlines()] vertically = [item for inner in zip(*rows) for item in inner] v3 = [vertically[i:i + 3] for i in range(0, len(vertically), 3)] counter = 0 for a, b, c in v3: if a + b > c and a + c > b and b + c > a: counter += 1 print("Answer: there are {} possible vertical triangles".format(counter))
__title__ = "pyls-isort" __version__ = "0.1.1" __summary__ = "Isort plugin for python-language-server" __uri__ = "https://github.com/paradoxxxzero/pyls-isort" __author__ = "Florian Mounier" __email__ = "[email protected]" __license__ = "MIT" __copyright__ = "Copyright 2017 %s" % __author__
class Solutions(object): def singleNumber(self, nums): res = 0 for i in range(32): bit_i_sum = 0 for num in nums: bit_i_sum += (num >> i) & 1 res += (bit_i_sum % 3) << i return res if __name__ == '__main__': print(Solutions().singleNumber([0,1,0,1,0,1,99]))